:root { color-scheme: dark; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { background: #0A0F22 radial-gradient(circle 70vmax at 50% 45%, #25306A 0%, #0A0F22 75%) fixed; color: #F3F1EA; font: 15px/1.5 "Inter", system-ui, sans-serif; overflow-x: hidden; }
main { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 100vh; min-height: 100dvh; padding: max(14px, env(safe-area-inset-top)) 14px max(10px, env(safe-area-inset-bottom)); text-align: center; }
h1 { margin: 0; font: 600 clamp(20px, 5vw, 30px)/1.2 "Fraunces", Georgia, serif; text-wrap: balance; }
.sub { margin: 0; font-size: 14px; color: #C3CBE4; }
.mark { width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-top: 15px solid #F6D37E; }
.stage { --s: max(160px, min(94vw, calc(100vh - 300px), 740px)); width: var(--s); height: var(--s); perspective: 1400px; }
.tilt, .layer { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.tilt { position: relative; transform-style: preserve-3d; }
.layer img { display: block; width: 100%; height: 100%; }
img.layer { display: block; }
.halo { position: absolute; inset: 7%; border-radius: 50%; transform: translateZ(-12px); box-shadow: 0 0 70px 14px rgba(120,150,255,.18); transition: box-shadow .4s; }
.on .halo { box-shadow: 0 0 90px 44px rgba(255,208,100,.55); }
.throne { transform-origin: 50% 10%; }
.body { filter: drop-shadow(0 18px 24px rgba(0,0,0,.45)); }
.rete { transform: translateZ(16px); filter: drop-shadow(0 4px 4px rgba(50,28,0,.5)); }
.glint { inset: 6.5%; width: 87%; height: 87%; left: 6.5%; top: 6.5%; border-radius: 50%; pointer-events: none; transform: translateZ(22px);
  background: conic-gradient(from 0deg, transparent 0deg, rgba(255,255,255,.28) 20deg, transparent 52deg, transparent 180deg, rgba(255,255,255,.13) 200deg, transparent 230deg); }
.marks { transform: translateZ(26px); }
.sun span { position: absolute; left: 46.6%; top: 3.4%; width: 6.8%; height: 6.8%; border-radius: 50%; background: radial-gradient(circle, #FFFBE0 0%, #FFD35C 45%, #F08A1C 70%, rgba(240,138,28,0) 72%); box-shadow: 0 0 28px 10px rgba(255,190,70,.55); }
.needle { filter: drop-shadow(4px 7px 5px rgba(40,20,0,.5)); }
.hub { transform: translateZ(54px); }
.status { margin: 0; min-height: 34px; font: 600 clamp(20px, 5vw, 26px)/1.35 "Fraunces", Georgia, serif; font-variant-numeric: tabular-nums; }
.on .status { color: #FFD971; }
.hint { margin: 0; max-width: 46ch; min-height: 20px; font-size: 13px; color: #E8C88A; }
.controls { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 12px; width: min(100%, 760px); }
button { min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid #3A4778; background: #141C3B; color: #F3F1EA; font: 600 15px "Inter", system-ui, sans-serif; cursor: pointer; touch-action: manipulation; }
button:hover { background: #1E2954; }
button.gold { background: #F2C14E; border-color: #F2C14E; color: #1A1400; }
button.gold:hover { background: #FFD571; }
a { color: #C3CBE4; } a:hover { color: #fff; }
:focus-visible { outline: 3px solid #FFB000; outline-offset: 2px; }
.try { margin: 0; max-width: 46ch; font-size: 14px; color: #C3CBE4; text-wrap: balance; }
.add { margin: auto 0 0; padding-top: 6px; font-size: 13px; }
.add a { display: inline-block; padding: 4px 8px; color: #E8C88A; }
.credit { margin: 0; padding-top: 4px; font-size: 12px; color: #9AA4C4; }
@media (max-height: 560px) { .sub, .mark, .try { display: none; } .stage { --s: max(150px, min(94vw, calc(100vh - 170px))); } .controls button { min-height: 36px; padding: 0 12px; font-size: 13px; } }

/* the turning layers are square: their corners must not widen the page */
html, body { overflow-x: clip; }
.share { display: inline-flex; align-items: center; gap: 9px; border-color: #F2C14E; color: #F2C14E; }
.share-round { position: absolute; z-index: 2; right: 12px; top: max(10px, env(safe-area-inset-top)); display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 46px; min-height: 46px; height: 46px; padding: 0 11px; background: #F2C14E; border-color: #F2C14E; color: #1A1400; }
.share-round:hover { background: #FFD571; }
.said:empty { display: none; }
h1 { padding: 0 50px; }
[dir=rtl] .share-round { right: auto; left: 12px; }
body, button { font-family: var(--script, "Inter"), "Inter", system-ui, sans-serif; }
h1, .status { font-family: "Fraunces", var(--script-head, Georgia), Georgia, serif; }
html:not([lang=en]) * { letter-spacing: 0; }
html[lang=ur] body, html[lang=pnb] body { line-height: 1.9; }
.sharelink { display: block; max-width: 100%; margin-top: 6px; font-size: 13px; color: #F2C14E; overflow-wrap: anywhere; user-select: all; }
@media (max-height: 560px) { .share-round { min-height: 36px; height: 36px; min-width: 36px; padding: 0 7px; } .controls .share { display: none; } }
main { position: relative; }
.back { position: absolute; z-index: 2; left: 12px; top: max(10px, env(safe-area-inset-top)); display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; border: 1px solid #3A4778; border-radius: 50%; background: #141C3B; }
[dir=rtl] .back { left: auto; right: 12px; }
[dir=rtl] .back svg { transform: scaleX(-1); }
.controls .installbtn { color: #F3F1EA; }
@media (max-height: 560px) { .back { width: 36px; height: 36px; } .controls .installbtn { display: none; } }

/* choosing another place, and saying this one is far away */
.place { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; }
.place bdi { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.faraway { position: relative; width: min(100%, 560px); padding: 10px 44px 12px; border: 1px solid #6B5520; border-radius: 18px; background: rgba(60,46,10,.55); }
.faraway p { margin: 0 0 8px; font-weight: 600; color: #FFE3A0; }
.faraway div { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.faraway a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; background: #F2C14E; color: #1A1400; font-weight: 600; text-decoration: none; }
.faraway .farclose { position: absolute; inset-inline-end: 2px; top: 2px; min-height: 40px; width: 40px; padding: 0; border: 0; background: none; font-size: 22px; }
.has-far .stage { --s: max(160px, min(94vw, calc(100vh - 460px), 740px)); }
.has-far .try:not(.ask) { display: none; }
.choose { width: min(440px, calc(100vw - 16px)); margin: 62px auto auto; padding: 16px; border: 1px solid #39477F; border-radius: 18px; background: #141C3B; color: #F3F1EA; }
.choose[open] { display: flex; flex-direction: column; gap: 10px; }
.choose::backdrop { background: rgba(5,8,20,.7); }
.choose .head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.choose .find { display: flex; gap: 8px; }
.choose input { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0 16px; border: 1px solid #3A4778; border-radius: 999px; background: #0A0F22; color: inherit; font: 16px var(--script, "Inter"), "Inter", system-ui, sans-serif; }
@media (max-height: 560px) { .place { min-height: 32px; font-size: 13px; } .has-far .stage { --s: max(150px, min(94vw, calc(100vh - 290px))); } }
