/* Kryptex Quest game screens (Night Quest). Tokens, keys, panels, medals and ribbons live in theme.css. */

html, body { overflow: hidden; overscroll-behavior: none; }

/* ---------- login: key art with the title and the play key over it ---------- */
.screen { position: fixed; inset: 0; }
.login { display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; background: #191724; }
.login-art { position: absolute; inset: 0; background: #191724 url('./assets/art/keyart-night.svg') center bottom / cover no-repeat; }
.login-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(11, 9, 20, 0.35), transparent 28%, transparent 45%, rgba(5, 7, 30, 0.88) 100%); }
.login-logo { position: relative; z-index: 1; justify-self: center; width: min(78vw, 300px); height: auto; box-sizing: content-box; padding: 8px 14px; border-radius: 18px; border: 3px solid var(--ink); background: rgba(11, 9, 20, 0.82); margin-top: calc(var(--safe-top) + 22px); filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.5)); }
.login-bottom { position: relative; z-index: 1; grid-row: 3; display: grid; gap: 14px; padding: 0 22px calc(var(--safe-bottom) + 26px); width: min(100%, 440px); justify-self: center; text-align: center; }
.login-title { font-size: clamp(54px, 17vw, 76px); line-height: 0.92; display: grid; justify-items: center; }
.login-title span:first-child { color: var(--blue-hi); }
.login-title span:last-child { color: var(--yellow-hi); }
.login-copy { margin: 0; color: #ede8fb; font-size: 16px; font-weight: 500; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6); text-wrap: pretty; }
.google-button svg { width: 24px; height: 24px; }
.login-error { margin: 0; padding: 10px 12px; border-radius: 12px; border: 3px solid var(--ink); background: var(--red-lo); color: #fff; font-size: 13px; text-align: left; }
.login-fine { margin: 0; font-size: 12.5px; color: #d9d1ef; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6); }
.login-fine b { color: #fff; font-weight: 700; }
@media (max-height: 640px) { .login-title { font-size: 46px; } .login-copy { display: none; } }

/* ---------- game stage ---------- */
.game { position: fixed; inset: 0; background: var(--bg); }
/* MapLibre's remote stylesheet sets #map to position:relative; keep the full-bleed override. */
#map.map-canvas { position: absolute; inset: 0; width: 100%; height: 100%; background: #333045; }
.vignette { position: absolute; inset: 0; pointer-events: none; background:
  linear-gradient(to bottom, rgba(11, 9, 20, 0.7), transparent 22%),
  linear-gradient(to top, rgba(11, 9, 20, 0.55), transparent 20%); }
.maplibregl-ctrl-bottom-right, .maplibregl-ctrl-bottom-left { z-index: 1; }
.maplibregl-ctrl-attrib { background: rgba(11, 9, 20, 0.75) !important; color: var(--muted) !important; font-size: 9px; }
.maplibregl-ctrl-attrib a { color: var(--muted) !important; }

/* ---------- map pins: a hex medal on a tip, the name on a plate. grey = found but locked, blue = open, green = cleared, red = the base ---------- */
.stop-labels { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.beacon-label { --m-hi: var(--blue-hi); --m-lo: var(--blue-lo); position: absolute; left: 0; top: 0; display: grid; justify-items: center; gap: 3px; color: var(--text); font-family: var(--font-display); font-size: 13px; letter-spacing: 0.02em; white-space: nowrap; will-change: transform, opacity; }
.bl-icon { position: relative; width: 48px; height: 53px; display: grid; place-items: center; color: #fff; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.5)); }
.bl-icon::before, .bl-icon::after { content: ''; position: absolute; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.bl-icon::before { inset: 0; background: var(--ink); }
.bl-icon::after { inset: 3.5px; background: linear-gradient(180deg, var(--m-hi), var(--m-lo)); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5); }
.bl-icon .gi { position: relative; z-index: 1; width: 26px; height: 26px; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.4)); }
.bl-name { padding: 2px 10px; border-radius: 999px; border: 2px solid var(--ink); background: rgba(26, 14, 66, 0.92); box-shadow: 0 2px 0 var(--ink); }
.beacon-label[data-state='locked'] { --m-hi: var(--locked-hi); --m-lo: var(--locked-lo); color: var(--muted); }
.beacon-label[data-state='cleared'] { --m-hi: var(--green-hi); --m-lo: var(--green-lo); }
.beacon-label[data-state='hub'] { --m-hi: var(--red-hi); --m-lo: var(--red-lo); }
.beacon-label.selected { transform-origin: bottom center; }

/* ---------- HUD ---------- */
.hud { position: absolute; z-index: 5; top: calc(var(--safe-top) + 12px); left: 12px; right: 12px; display: flex; gap: 10px; align-items: stretch; }
.avatar-btn { position: relative; width: 62px; height: 62px; flex: none; border-radius: 50%; border: 4px solid var(--ink); background: radial-gradient(circle at 50% 30%, #5a527e, #35304c); box-shadow: 0 4px 0 var(--ink), inset 0 0 0 3px var(--blue-hi); overflow: visible; transition: transform 0.08s; }
.avatar-btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ink), inset 0 0 0 3px var(--blue-hi); }
.avatar-btn img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 50% 10%; transform: scale(1.35); transform-origin: 50% 18%; clip-path: circle(50%); }
.avatar-burger { position: absolute; right: -4px; bottom: -4px; width: 24px; height: 24px; display: grid; place-content: center; gap: 3px; border-radius: 50%; border: 3px solid var(--ink); background: var(--yellow); }
.avatar-burger i { display: block; width: 11px; height: 2.5px; border-radius: 2px; background: var(--ink); }
.chip { display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 0 14px; border-radius: 18px; border: 3px solid var(--ink); background: var(--stars), linear-gradient(180deg, #2f2c3f, #211f2e); box-shadow: 0 4px 0 var(--ink), inset 0 3px 0 rgba(255, 255, 255, 0.16); }
.stat { flex: 1; flex-wrap: wrap; row-gap: 4px; align-content: center; padding-block: 6px; }
.stat strong { font-size: 22px; margin-left: auto; line-height: 1; }
.dots { display: flex; gap: 6px; width: 100%; font-style: normal; }
.gps { white-space: nowrap; gap: 9px; font-family: var(--font-display); font-size: 15px; letter-spacing: 0.04em; padding: 0 14px; }
.gps-dot { width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--ink); background: var(--locked); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5); }
.gps.good .gps-dot { background: var(--green); }
.gps.weak .gps-dot { background: var(--yellow); }
.gps.bad .gps-dot { background: var(--red); }
.gps.sim .gps-dot { background: var(--blue); }
.gps.wait .gps-dot { background: var(--yellow); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

.side-tools { position: absolute; z-index: 5; right: 12px; top: calc(var(--safe-top) + 112px); display: grid; justify-items: center; gap: 12px; width: 62px; }
.round-btn { --k-hi: #7464b8; --k-lo: #443f5a; --k-lip: #39354c; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; border: 3px solid var(--ink); background: linear-gradient(180deg, var(--k-hi), var(--k-lo)); box-shadow: 0 4px 0 var(--k-lip), 0 4px 0 3px var(--ink), inset 0 3px 0 rgba(255, 255, 255, 0.45); transition: transform 0.08s; }
.round-btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--k-lip), 0 0 0 3px var(--ink); }
.round-btn .i { width: 24px; height: 24px; }

/* ---------- objective plate ---------- */
.near-card { position: absolute; z-index: 5; left: 12px; right: 12px; bottom: calc(var(--safe-bottom) + 18px); display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 10px; border-radius: 22px; border: 3px solid var(--ink); background: var(--stars), linear-gradient(180deg, #2f2c3f, #211f2e); text-align: left; box-shadow: 0 5px 0 var(--ink), 0 12px 20px -6px rgba(0, 0, 0, 0.6), inset 0 3px 0 rgba(255, 255, 255, 0.16); transition: transform 0.08s; }
.near-card:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.near-card.in-range { border-color: var(--yellow); box-shadow: 0 5px 0 var(--yellow-lip), 0 5px 0 3px var(--ink), 0 0 0 3px var(--yellow), inset 0 3px 0 rgba(255, 255, 255, 0.16); animation: ring 1.6s ease-in-out infinite; }
@keyframes ring { 50% { box-shadow: 0 5px 0 var(--yellow-lip), 0 5px 0 3px var(--ink), 0 0 0 7px rgba(251, 188, 4, 0.45), inset 0 3px 0 rgba(255, 255, 255, 0.16); } }
.near-arrow { width: 54px; height: 54px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 3px solid var(--ink); background: linear-gradient(180deg, var(--blue-hi), var(--blue-lo)); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.5); color: #fff; }
.near-arrow .i { width: 28px; height: 28px; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.4)); transition: transform 0.2s linear; }
.near-card.in-range .near-arrow { background: linear-gradient(180deg, var(--yellow-hi), var(--yellow-lo)); color: #3a2200; }
.near-text { flex: 1; display: grid; gap: 1px; min-width: 0; }
.near-text strong { font-family: var(--font-display); font-weight: 400; font-size: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0.01em; }
.near-dist { font-family: var(--font-display); font-size: 20px; padding: 4px 12px; border-radius: 999px; border: 3px solid var(--ink); background: var(--recess); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5); }
.near-card.hint-only .near-arrow, .near-card.hint-only .near-dist { display: none; }
.near-card.hint-only { border-color: var(--blue); }
.near-card.hint-only .near-text strong { white-space: normal; font-size: 17px; line-height: 1.25; }

/* ---------- console map pins ---------- */
.stop-marker { --c: var(--blue); position: relative; display: grid; justify-items: center; width: 64px; padding-bottom: 2px; }
.stop-orb { position: relative; z-index: 2; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--c); border: 3px solid var(--ink); box-shadow: 0 0 0 3px var(--c), 0 6px 0 var(--ink); }
.stop-orb .gi, .stop-orb .i { width: 22px; height: 22px; }
.stop-pole { width: 3px; height: 16px; background: linear-gradient(var(--c), transparent); }
.stop-pulse { position: absolute; left: 50%; top: 22px; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; border: 2px solid var(--c); opacity: 0; }
.stop-label { position: absolute; top: 52px; white-space: nowrap; padding: 2px 10px; border-radius: 999px; border: 2px solid var(--ink); font-family: var(--font-display); font-size: 12px; background: rgba(26, 14, 66, 0.92); color: var(--text); pointer-events: none; }
.stop-marker.locked { --c: var(--locked); }
.stop-marker.open { --c: var(--blue); }
.stop-marker.near { --c: var(--yellow); }
.stop-marker.near .stop-pulse { animation: pulse 1.5s ease-out infinite; }
.stop-marker.cleared { --c: var(--green); }
.stop-marker.selected .stop-orb { transform: scale(1.18); }
@keyframes pulse { 0% { transform: scale(1); opacity: 0.9; } 100% { transform: scale(2.4); opacity: 0; } }

/* ---------- location gate ---------- */
.loc-gate { position: absolute; z-index: 20; inset: 0; display: grid; place-items: end center; padding: 16px 16px calc(var(--safe-bottom) + 16px); background: linear-gradient(to top, rgba(11, 9, 20, 0.92), rgba(11, 9, 20, 0.35)); }
.loc-card { position: relative; width: min(100%, 420px); display: grid; gap: 12px; padding: 24px; text-align: center; border-radius: 26px; border: 3px solid var(--ink); background: var(--stars), linear-gradient(180deg, #2f2c3f, #211f2e); box-shadow: var(--panel-shadow), inset 0 3px 0 rgba(255, 255, 255, 0.16); }
.loc-icon { width: 76px; height: 84px; margin: -58px auto 0; display: grid; place-items: center; position: relative; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.5)); color: #fff; }
.loc-icon::before, .loc-icon::after { content: ''; position: absolute; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.loc-icon::before { inset: 0; background: var(--ink); }
.loc-icon::after { inset: 4px; background: linear-gradient(180deg, var(--blue-hi), var(--blue-lo)); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.5); }
.loc-icon .i { position: relative; z-index: 1; width: 36px; height: 36px; }
.loc-card h2 { font-size: 28px; }
.loc-card p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; text-wrap: pretty; }

/* ---------- simulator ---------- */
.sim-pad { position: absolute; z-index: 6; left: 12px; bottom: calc(var(--safe-bottom) + 108px); display: grid; grid-template: 'n n n' 48px 'w . e' 48px 'f s r' 48px / 48px 48px 48px; gap: 6px; }
.sim-pad button { display: grid; place-items: center; border-radius: 14px; border: 3px solid var(--ink); background: linear-gradient(180deg, #7464b8, #443f5a); box-shadow: 0 4px 0 #39354c, 0 4px 0 3px var(--ink), inset 0 2px 0 rgba(255, 255, 255, 0.4); touch-action: none; user-select: none; -webkit-user-select: none; }
.sim-pad button:active { background: var(--blue); transform: translateY(4px); box-shadow: 0 0 0 3px var(--ink); }
.sim-pad button .i { width: 22px; height: 22px; }
.sim-pad [data-dir='0,1'] { grid-area: n; grid-column: 2; }
.sim-pad [data-dir='-1,0'] { grid-area: w; }
.sim-pad [data-dir='-1,0'] .i { transform: rotate(-90deg); }
.sim-pad [data-dir='1,0'] { grid-area: e; }
.sim-pad [data-dir='1,0'] .i { transform: rotate(90deg); }
.sim-pad [data-dir='0,-1'] { grid-area: s; }
.sim-pad [data-dir='0,-1'] .i { transform: rotate(180deg); }
.sim-fast { grid-area: f; display: flex; align-items: center; justify-content: center; gap: 4px; font-family: var(--font-display); font-size: 13px; color: var(--text); text-shadow: 0 2px 0 var(--ink); }
.sim-tag { grid-area: r; display: grid; place-items: center; font-family: var(--font-display); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--blue-ink); text-shadow: 0 2px 0 var(--ink); }

/* ---------- bottom sheet: the quest scroll ---------- */
.sheet { position: absolute; z-index: 15; left: 0; right: 0; bottom: 0; max-height: 90dvh; display: flex; flex-direction: column; border-radius: 28px 28px 0 0; border: 3px solid var(--ink); border-bottom: 0; background: var(--stars), linear-gradient(180deg, #2f2c3f 0%, #38354b 22%, #2e2b3f 100%); box-shadow: 0 -6px 0 rgba(11, 9, 20, 0.5), 0 -24px 50px -16px rgba(0, 0, 0, 0.85), inset 0 3px 0 rgba(255, 255, 255, 0.18); transform: translateY(105%); transition: transform 0.45s var(--ease); }
.sheet.open { transform: none; }
.sheet-grab { padding: 10px 0 2px; display: grid; place-items: center; }
.sheet-grab span { width: 54px; height: 7px; border-radius: 4px; background: var(--ink); box-shadow: 0 2px 0 rgba(255, 255, 255, 0.18); }
.sheet-body { overflow-y: auto; padding: 4px 18px calc(var(--safe-bottom) + 26px); -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sheet-top { display: flex; align-items: center; justify-content: flex-end; margin-bottom: 0; }
.close, .dialog-close { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 3px solid var(--ink); background: linear-gradient(180deg, var(--red-hi), var(--red-lo)); color: #fff; box-shadow: 0 4px 0 var(--red-lip), 0 4px 0 3px var(--ink), inset 0 2px 0 rgba(255, 255, 255, 0.5); transition: transform 0.08s; }
.close:active, .dialog-close:active { transform: translateY(4px); box-shadow: 0 0 0 3px var(--ink); }
.close .i, .dialog-close .i { width: 20px; height: 20px; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35)); }
.sheet h2 { font-size: 36px; line-height: 1.02; color: #fff; -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; text-shadow: 0 4px 0 var(--ink); margin-top: -34px; padding-right: 56px; }
.place { margin: 10px 0 0; display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px 4px 10px; border-radius: 999px; border: 3px solid var(--ink); background: linear-gradient(180deg, var(--yellow-hi), var(--yellow-lo)); color: #3a2200; font-family: var(--font-display); font-size: 17px; box-shadow: 0 3px 0 var(--ink); }
.desc { color: var(--muted); line-height: 1.5; margin: 12px 0 14px; text-wrap: pretty; font-size: 15px; }
.range { display: flex; gap: 8px; align-items: flex-start; padding: 10px 14px; border-radius: 14px; border: 3px solid var(--ink); font-size: 14px; font-weight: 500; line-height: 1.4; margin-bottom: 14px; }
.range .i { margin-top: 2px; }
.range.ok { background: rgba(52, 168, 83, 0.28); color: var(--green-ink); }
.range.far { background: rgba(251, 188, 4, 0.2); color: var(--yellow-ink); }
.link { margin-left: 6px; color: var(--blue-ink); text-decoration: underline; font-weight: 700; }
.gate, .clue { padding: 16px; border-radius: 18px; border: 3px solid var(--ink); background: var(--surface-2); box-shadow: 0 4px 0 var(--ink), inset 0 3px 0 rgba(255, 255, 255, 0.1); display: grid; gap: 10px; }
.gate h3 { display: flex; align-items: center; gap: 8px; font-size: 22px; }
.gate p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.progress { display: flex; justify-content: space-between; align-items: center; }
.progress b { font-size: 20px; }
.bar { margin: 8px 0 16px; }

/* Questions: quest rows, all open at once. The number sits in a hex gem. */
.puzzles { display: grid; gap: 12px; }
.puzzle { border-radius: 18px; border: 3px solid var(--ink); background: var(--surface-2); box-shadow: 0 4px 0 var(--ink), inset 0 3px 0 rgba(255, 255, 255, 0.1); overflow: hidden; }
.puzzle.solved { background: #14503a; }
.puzzle-head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: left; }
.puzzle-head strong { flex: 1; font-family: var(--font-display); font-weight: 400; font-size: 20px; line-height: 1.2; letter-spacing: 0.01em; }
.puzzle-head small { padding: 3px 10px; border-radius: 999px; border: 2px solid var(--ink); background: var(--blue-lo); font-family: var(--font-display); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: #fff; }
.puzzle.photo .puzzle-head small { background: var(--yellow); color: #3a2200; }
.puzzle.solved .puzzle-head small { background: var(--green-lo); }
.puzzle-num { isolation: isolate; position: relative; width: 40px; height: 44px; flex: none; display: grid; place-items: center; color: #fff; font-family: var(--font-display); font-size: 20px; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.45)); }
.puzzle-num::before, .puzzle-num::after { content: ''; position: absolute; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.puzzle-num::before { inset: 0; background: var(--ink); z-index: -1; }
.puzzle-num::after { z-index: -1; inset: 3px; background: linear-gradient(180deg, var(--blue-hi), var(--blue-lo)); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5); }
.puzzle-num > * { position: relative; z-index: 1; }
.puzzle-num .i { width: 20px; height: 20px; }
.puzzle.photo .puzzle-num { color: #3a2200; }
.puzzle.photo .puzzle-num::after { background: linear-gradient(180deg, var(--yellow-hi), var(--yellow-lo)); }
.puzzle.solved .puzzle-num::after { background: linear-gradient(180deg, var(--green-hi), var(--green-lo)); }
.puzzle-body { padding: 0 14px 14px; display: grid; gap: 12px; }
.puzzle-body p { margin: 0; line-height: 1.5; color: #ede8fb; text-wrap: pretty; font-size: 15px; }
.q-note { color: var(--muted) !important; font-size: 14px !important; }
.q-link { --k-hi: var(--yellow-hi); --k-lo: var(--yellow-lo); --k-lip: var(--yellow-lip); display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 18px; border-radius: 16px; border: 3px solid var(--ink); background: linear-gradient(180deg, var(--k-hi), var(--k-lo)); color: #3a2200; font-family: var(--font-display); font-size: 19px; text-decoration: none; text-shadow: 0 2px 0 rgba(255, 255, 255, 0.4); box-shadow: 0 5px 0 var(--k-lip), 0 5px 0 3px var(--ink), inset 0 3px 0 rgba(255, 255, 255, 0.5); transition: transform 0.08s; }
.q-link:active { transform: translateY(5px); box-shadow: 0 0 0 3px var(--ink); }
.q-link .i { width: 20px; height: 20px; }
.flag-row { display: flex; gap: 10px; margin-top: 4px; }
.flag-input { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 17px; letter-spacing: 0.05em; text-transform: uppercase; }
.photo-pick { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 68px; padding: 14px; border-radius: 16px; border: 3px dashed #ad9fe1; background: var(--recess); color: var(--blue-ink); font-family: var(--font-display); font-size: 19px; cursor: pointer; }
.photo-pick .i { width: 26px; height: 26px; }
.photo-pick input { display: none; }
.photo-preview { width: 100%; max-height: 220px; object-fit: cover; border-radius: 16px; border: 3px solid var(--ink); }
.clue-line { color: var(--yellow-ink) !important; display: flex; gap: 8px; align-items: flex-start; }
.clue-line .i { margin-top: 3px; }
.clue small { font-family: var(--font-display); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.clue strong { font-family: var(--font-display); font-weight: 400; font-size: 22px; line-height: 1.3; }
.clue code { padding: 12px; border-radius: 12px; border: 3px solid var(--ink); background: var(--recess); color: var(--green-ink); font-family: var(--font-mono); font-weight: 700; letter-spacing: 0.06em; user-select: all; -webkit-user-select: all; }
.win { margin: 0; font-weight: 700; color: var(--yellow-ink); }
.tick-tag { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 3px 12px; border-radius: 999px; border: 2px solid var(--ink); background: var(--green-lo); color: #fff; font-family: var(--font-display); font-size: 14px; }
.tick-tag .i { width: 16px; height: 16px; }

/* ---------- dialogs ---------- */
.app-dialog { position: relative; width: min(92vw, 410px); padding: 26px 20px 22px; border: 3px solid var(--ink); border-radius: 26px; background: var(--stars), linear-gradient(180deg, #2f2c3f, #211f2e); color: var(--text); box-shadow: var(--panel-shadow), 0 40px 90px -30px #000, inset 0 3px 0 rgba(255, 255, 255, 0.16); overflow: visible; }
.app-dialog::backdrop { background: rgba(12, 6, 32, 0.82); }
.app-dialog[open] { animation: pop 0.35s var(--pop); }
.app-dialog h2 { font-size: 32px; margin: 0 0 14px; padding-right: 50px; color: #fff; -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; text-shadow: 0 4px 0 var(--ink); }
.dialog-close { position: absolute; top: -14px; right: -10px; }
.dialog-note { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 12px 0 0; text-wrap: pretty; }
.avatar-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.avatar-option { display: grid; gap: 4px; justify-items: center; padding: 8px 8px 14px; border-radius: 18px; background: var(--recess); border: 3px solid var(--ink); box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.5); font-family: var(--font-display); font-size: 19px; }
.avatar-option.selected { border-color: var(--yellow); }
.avatar-option model-viewer { width: 100%; height: 190px; --poster-color: transparent; }
.menu-list { display: grid; gap: 10px; }
.menu-list > button, .menu-toggle { --k-hi: #7464b8; --k-lo: #443f5a; --k-lip: #39354c; min-height: 52px; padding: 0 16px; border-radius: 16px; border: 3px solid var(--ink); background: linear-gradient(180deg, var(--k-hi), var(--k-lo)); box-shadow: 0 4px 0 var(--k-lip), 0 4px 0 3px var(--ink), inset 0 3px 0 rgba(255, 255, 255, 0.35); text-align: left; font-family: var(--font-display); font-size: 18px; letter-spacing: 0.02em; display: flex; justify-content: flex-start; align-items: center; gap: 10px; transition: transform 0.08s; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); }
.menu-list > button:active { transform: translateY(4px); box-shadow: 0 0 0 3px var(--ink); }
.menu-list > button .i, .menu-list > button .gi { margin-right: 2px; }
.menu-toggle { justify-content: space-between; }
.menu-toggle small { display: block; color: #e0d9f9; font-family: var(--font-body); font-size: 12px; text-shadow: none; }
.menu-list .danger { --k-hi: var(--red-hi); --k-lo: var(--red-lo); --k-lip: var(--red-lip); }
.menu-locations { display: grid; gap: 10px; }
.menu-label { margin: 16px 2px 0; font-family: var(--font-display); font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--yellow-ink); text-shadow: 0 2px 0 var(--ink); }
.menu-locations button { display: flex; align-items: center; gap: 10px; }
.menu-locations small { margin-left: auto; padding: 2px 10px; border-radius: 999px; border: 2px solid var(--ink); background: var(--ink); font-family: var(--font-display); font-size: 12px; text-shadow: none; color: #fff; }
.menu-locations .dot { width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--ink); background: var(--locked); flex: none; }
.menu-locations .dot.open { background: var(--blue); }
.menu-locations .dot.cleared { background: var(--green); }
.guide-list { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 14px; counter-reset: step; }
.guide-list li { display: grid; grid-template-columns: 38px 1fr; column-gap: 12px; counter-increment: step; }
.guide-list li b { font-family: var(--font-display); font-weight: 400; font-size: 20px; }
.guide-list li::before { content: counter(step); grid-row: span 2; width: 36px; height: 40px; display: grid; place-items: center; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: linear-gradient(180deg, var(--blue-hi), var(--blue-lo)); font-family: var(--font-display); font-size: 18px; color: #fff; }
.guide-list span { color: var(--muted); font-size: 14.5px; line-height: 1.5; }

/* ---------- feedback ---------- */
.toast { position: fixed; z-index: 90; left: 50%; top: calc(var(--safe-top) + 10px); width: max-content; max-width: min(88vw, 340px); padding: 10px 18px; border-radius: 16px; border: 3px solid var(--ink); background: linear-gradient(180deg, #443f5a, #444059); color: #fff; font-family: var(--font-display); font-size: 17px; line-height: 1.3; text-align: center; letter-spacing: 0.01em; box-shadow: 0 5px 0 var(--ink), 0 14px 24px -8px rgba(0, 0, 0, 0.7), inset 0 3px 0 rgba(255, 255, 255, 0.2); transform: translate(-50%, -24px) scale(0.9); opacity: 0; pointer-events: none; transition: transform 0.35s var(--pop), opacity 0.2s; }
.toast.show { transform: translate(-50%, 0) scale(1); opacity: 1; }
.confetti { position: fixed; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -10px; width: 11px; height: 16px; border-radius: 3px; border: 2px solid var(--ink); animation: fall 1.9s ease-in forwards; }
@keyframes fall { to { transform: translate(var(--dx), 105vh) rotate(540deg); opacity: 0.9; } }

.compass { display: grid; place-items: center; }
.compass[aria-pressed='true'] { --k-hi: var(--yellow-hi); --k-lo: var(--yellow-lo); --k-lip: var(--yellow-lip); }
.compass-enable { position: absolute; z-index: 6; left: 12px; top: calc(var(--safe-top) + 112px); }
.game:has(.banners > :not([hidden])) .compass-enable { top: auto; bottom: calc(var(--safe-bottom) + 108px); }

/* ---------- team screen: the lobby ---------- */
.team { display: grid; place-items: center; padding: 20px; overflow-y: auto; background: #191724 url('./assets/art/keyart-night.svg') center bottom / cover no-repeat; }
.team::before { content: ''; position: fixed; inset: 0; background: rgba(11, 9, 20, 0.6); pointer-events: none; }
.team-card { position: relative; min-width: 0; width: min(100%, 410px); display: grid; gap: 16px; padding: 38px 18px 20px; border-radius: 26px; border: 3px solid var(--ink); background: var(--stars), linear-gradient(180deg, #2f2c3f, #211f2e); box-shadow: var(--panel-shadow), inset 0 3px 0 rgba(255, 255, 255, 0.16); margin: 18px auto auto; }
.team-ribbon { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 24px; }
.team-card > .login-fine { text-align: center; }
.team-card h2 { font-size: 34px; text-align: center; color: #fff; -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; text-shadow: 0 4px 0 var(--ink); }
.team-card > div { display: grid; gap: 14px; }
.team-copy, .team-status { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; text-align: center; text-wrap: pretty; }
.team-status { font-weight: 500; }
.team-form { display: grid; gap: 12px; }
.team-input.code { font-family: var(--font-display); letter-spacing: 0.4em; text-align: center; text-transform: uppercase; font-size: 26px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-family: var(--font-display); font-size: 15px; }
.or::before, .or::after { content: ''; flex: 1; height: 4px; border-radius: 2px; background: var(--ink); }
.code-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; padding: 12px 14px; border-radius: 18px; border: 3px solid var(--ink); background: var(--recess); box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.5); }
.code-box .engrave { grid-column: 1; }
.rotors { grid-column: 1; display: flex; gap: 6px; }
.rotors span { flex: 1; max-width: 44px; height: 54px; display: grid; place-items: center; border-radius: 10px; border: 3px solid var(--ink); background: linear-gradient(180deg, #6558a8, #353247); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.25), 0 3px 0 var(--ink); font-family: var(--font-display); font-size: 28px; color: var(--yellow-hi); text-shadow: 0 2px 0 var(--ink); user-select: all; -webkit-user-select: all; }
.code-box .small-action { grid-column: 2; grid-row: 1 / span 2; align-self: end; --k-hi: var(--yellow-hi); --k-lo: var(--yellow-lo); --k-lip: var(--yellow-lip); color: #3a2200; text-shadow: 0 2px 0 rgba(255, 255, 255, 0.4); }
.progress .engrave { color: var(--yellow-ink); }
.members { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.members li { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; border-radius: 18px; border: 3px solid var(--ink); background: var(--surface-2); box-shadow: 0 4px 0 var(--ink), inset 0 3px 0 rgba(255, 255, 255, 0.1); }
.member-av { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-size: 22px; border: 3px solid var(--ink); background: linear-gradient(180deg, var(--blue-hi), var(--blue-lo)); color: #fff; }
.member-av.f { background: linear-gradient(180deg, var(--red-hi), var(--red-lo)); }
.member-name { flex: 1; font-family: var(--font-display); font-size: 19px; letter-spacing: 0.01em; }
.member-name em { color: var(--muted); font-family: var(--font-body); font-style: normal; font-size: 14px; }
.badge { padding: 2px 10px; border-radius: 999px; border: 2px solid var(--ink); background: var(--yellow); color: #3a2200; font-family: var(--font-display); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.kick { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 3px solid var(--ink); background: linear-gradient(180deg, var(--red-hi), var(--red-lo)); color: #fff; }
.kick .i { width: 16px; height: 16px; }

/* ---------- larger screens: keep the phone-shaped experience centred ---------- */
@media (min-width: 720px) {
  .game { left: 50%; width: 480px; margin-left: -240px; border-inline: 3px solid var(--ink); }
}

/* ---------- banners ---------- */
.banners { position: absolute; z-index: 7; left: 12px; right: 12px; top: calc(var(--safe-top) + 112px); display: grid; gap: 8px; pointer-events: none; }
.banner { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 16px; border: 3px solid var(--ink); font-size: 14px; font-weight: 500; line-height: 1.4; background: linear-gradient(180deg, #55516e, #434058); box-shadow: 0 4px 0 var(--ink); }
.banner .i { margin-top: 2px; }
.banner.status { background: linear-gradient(180deg, #8a6a08, #6b5006); color: var(--yellow-ink); }
.banner.status button { margin-left: 8px; color: #fff; text-decoration: underline; font-weight: 700; }
.banner.announce .i { color: var(--blue-ink); }
.banner.announce.warn { background: linear-gradient(180deg, #8a2a22, #6b1b15); }
.banner.announce span { flex: 1; }
.banner.announce button { color: var(--muted); }
.banner.lock { background: linear-gradient(180deg, #8a6a08, #6b5006); color: var(--yellow-ink); }
.banner.safety { background: linear-gradient(180deg, #8a2a22, #6b1b15); color: #ffd0cb; }

/* ---------- base (hub) sheet ---------- */
.stop-card { margin-bottom: 12px; padding: 12px 14px; border-radius: 18px; border: 3px solid var(--ink); background: var(--surface-2); box-shadow: 0 4px 0 var(--ink), inset 0 3px 0 rgba(255, 255, 255, 0.1); display: grid; gap: 8px; }
.stop-card.cleared { background: #14503a; }
.stop-card.open { background: #6552ae; }
.stop-card .loc-head { display: flex; align-items: center; gap: 10px; }
.stop-card .loc-head strong { flex: 1; font-family: var(--font-display); font-weight: 400; font-size: 21px; }
.loc-num { isolation: isolate; position: relative; width: 38px; height: 42px; display: grid; place-items: center; flex: none; color: #fff; font-family: var(--font-display); font-size: 19px; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.45)); }
.loc-num::before, .loc-num::after { content: ''; position: absolute; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.loc-num::before { inset: 0; background: var(--ink); z-index: -1; }
.loc-num::after { z-index: -1; inset: 3px; background: linear-gradient(180deg, var(--blue-hi), var(--blue-lo)); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5); }
.loc-num > * { position: relative; z-index: 1; }
.loc-num .i { width: 18px; height: 18px; }
.stop-card.cleared .loc-num::after { background: linear-gradient(180deg, var(--green-hi), var(--green-lo)); }
.stop-card.locked .loc-num::after { background: linear-gradient(180deg, var(--locked-hi), var(--locked-lo)); }
.chip-s { padding: 2px 10px; border-radius: 999px; border: 2px solid var(--ink); background: var(--ink); font-family: var(--font-display); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.stop-card.open .chip-s { background: var(--blue-lo); color: #fff; }
.stop-card.cleared .chip-s { background: var(--green-lo); color: #fff; }
.loc-hint { margin: 0; color: #f0ecfc; font-size: 15px; line-height: 1.5; display: flex; gap: 8px; align-items: flex-start; text-wrap: pretty; }
.loc-hint .i { margin-top: 3px; color: var(--yellow-ink); }
.loc-note { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; text-wrap: pretty; }
.loc-note .i { margin-right: 2px; }
.loc-note code, .loc-hint code { font-family: var(--font-mono); color: var(--green-ink); }
.handin { padding: 16px; border-radius: 18px; border: 3px dashed var(--yellow); background: rgba(11, 9, 20, 0.4); display: grid; gap: 12px; }
.handin h3 { font-size: 22px; }
.handed { display: flex; flex-wrap: wrap; gap: 6px; }
.handed span { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; border: 2px solid var(--ink); background: var(--green-lo); color: #fff; font-family: var(--font-display); font-size: 14px; }
.handed .i { width: 14px; height: 14px; }
.section-title { font-family: var(--font-display); font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--yellow-ink); text-shadow: 0 2px 0 var(--ink); margin: 14px 0 8px; }
.finished-box { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 14px; border-radius: 16px; border: 3px solid var(--ink); background: linear-gradient(180deg, var(--yellow-hi), var(--yellow-lo)); box-shadow: 0 4px 0 var(--ink); font-family: var(--font-display); font-size: 20px; color: #3a2200; text-align: center; margin-bottom: 12px; }

/* ---------- leaderboard ---------- */
.board-body { display: grid; gap: 8px; max-height: 55vh; overflow-y: auto; padding: 2px 2px 6px; }
.board-row { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; padding: 8px 12px 8px 8px; border-radius: 16px; border: 3px solid var(--ink); background: var(--surface-2); box-shadow: 0 3px 0 var(--ink); }
.board-row.me { background: #6552ae; border-color: var(--yellow); }
.board-row .pos { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 3px solid var(--ink); background: var(--locked-lo); font-family: var(--font-display); font-size: 17px; font-variant-numeric: tabular-nums; }
.board-row:nth-child(1) .pos { background: linear-gradient(180deg, var(--yellow-hi), var(--yellow-lo)); color: #3a2200; }
.board-row:nth-child(2) .pos { background: linear-gradient(180deg, #e8ecff, #9aa5d6); color: #1b2140; }
.board-row:nth-child(3) .pos { background: linear-gradient(180deg, #f0a56a, #b5622a); color: #3a1c08; }
.board-row strong { font-family: var(--font-display); font-weight: 400; font-size: 18px; }
.board-row small { color: var(--muted); display: block; font-size: 12px; }
.board-row .time { font-family: var(--font-display); font-size: 18px; text-align: right; font-variant-numeric: tabular-nums; }

/* teammates on the map */
.mate-pin { display: flex; flex-direction: column; align-items: center; gap: 3px; pointer-events: none; }
.mate-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--green); border: 3px solid var(--ink); box-shadow: 0 0 0 3px #fff; }
.mate-name { font: 400 13px/1 var(--font-display); color: #fff; background: rgba(26, 14, 66, 0.94); padding: 3px 9px; border-radius: 999px; border: 2px solid var(--ink); white-space: nowrap; }

/* rehearsal / offline badges */
.hud-badge { position: absolute; top: calc(var(--safe-top) + 80px); left: 50%; transform: translateX(-50%); z-index: 6; padding: 4px 14px; border-radius: 999px; border: 3px solid var(--ink); font: 400 14px/1.2 var(--font-display); letter-spacing: 0.04em; pointer-events: none; white-space: nowrap; box-shadow: 0 3px 0 var(--ink); }
.hud-badge.offline { background: var(--red); color: #fff; }
.hud-badge.test { background: var(--yellow); color: #3a2200; top: calc(var(--safe-top) + 112px); }

/* recap */
.recap-line { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 3px solid var(--ink); font-size: 15px; }
.recap-line .gi { width: 24px; height: 24px; color: var(--yellow-ink); }
.recap-line b { font-family: var(--font-display); font-weight: 400; font-size: 18px; }
.recap-line small { color: var(--muted); }
.recap-stats { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; margin: 10px 0; }
.recap-stats div { background: var(--recess); border: 3px solid var(--ink); border-radius: 14px; padding: 8px 12px; display: grid; gap: 0; box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.5); }
.recap-stats strong { font-family: var(--font-display); font-weight: 400; font-size: 26px; color: var(--yellow-hi); }
.recap-stats small { font-family: var(--font-display); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* ---------- quest banner (toast) with a medal ---------- */
.toast { display: flex; align-items: center; gap: 10px; text-align: left; }
.toast .medal { --s: 34px; }
.toast.warn { background: linear-gradient(180deg, #a8362d, #7a1f18); }
.toast.discover { background: linear-gradient(180deg, #4f4572, #352e50); border-color: var(--yellow); }
.toast.win, .toast.unlock { background: linear-gradient(180deg, #1f7a46, #145c33); }

/* ---------- reward moments: rays, a chest or medal that pops, loot ---------- */
.reward { border: 0; background: transparent; padding: 0; width: min(92vw, 380px); color: var(--text); text-align: center; overflow: visible; }
.reward::backdrop { background: radial-gradient(circle at 50% 36%, rgba(60, 36, 140, 0.97), rgba(12, 6, 32, 0.98) 70%); }
.reward[open] { display: grid; justify-items: center; gap: 12px; }
.reward-rays { position: absolute; top: 20px; left: 50%; width: 460px; height: 460px; margin-left: -230px; pointer-events: none; opacity: 0.55; background: repeating-conic-gradient(from 0deg, rgba(255, 224, 102, 0.55) 0 8deg, transparent 8deg 24deg); -webkit-mask: radial-gradient(circle, #000 18%, transparent 68%); mask: radial-gradient(circle, #000 18%, transparent 68%); animation: spin 22s linear infinite; }
.reward-art { position: relative; width: 190px; height: 170px; display: grid; place-items: center; animation: pop 0.55s var(--pop) both; }
.reward-art .chest { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 8px 0 rgba(0, 0, 0, 0.4)); transition: opacity 0.2s, transform 0.4s var(--pop); }
.reward-art .chest.opened { opacity: 0; transform: scale(0.9) translateY(10px); }
.reward-art.open .chest.closed { opacity: 0; transform: scale(1.1); }
.reward-art.open .chest.opened { opacity: 1; transform: none; }
.reward-art .medal.big { --s: 132px; }
.reward-art .medal.big > * { width: 54%; height: 54%; }
.reward h2, #finishDialog h2 { font-size: 40px; line-height: 1; color: #fff; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; text-shadow: 0 5px 0 var(--ink); padding: 0; margin: 0; animation: pop 0.5s 0.15s var(--pop) both; }
.reward-sub { margin: 0; color: #fff; font-size: 16px; line-height: 1.45; text-shadow: 0 2px 0 var(--ink), 0 0 8px var(--ink); text-wrap: pretty; max-width: 320px; }
.reward-loot { display: grid; gap: 6px; padding: 12px 18px; border-radius: 18px; border: 3px solid var(--ink); background: var(--recess); box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.6), 0 3px 0 rgba(255, 255, 255, 0.12); animation: pop 0.5s 0.35s var(--pop) both; }
.reward-loot .engrave { color: var(--yellow-ink); }
.reward-loot code { font-family: var(--font-mono); font-size: 20px; font-weight: 700; letter-spacing: 0.08em; color: var(--green-ink); user-select: all; -webkit-user-select: all; word-break: break-all; }
.reward .primary-button { margin-top: 6px; --k-hi: var(--green-hi); --k-lo: var(--green-lo); --k-lip: var(--green-lip); font-size: 22px; min-height: 58px; }
#finishDialog { position: relative; text-align: center; }
#finishDialog h2 { padding: 0; }
#finishDialog .reward-art { margin: -70px auto 6px; }

/* drawn toggles instead of browser checkboxes */
.menu-toggle input { appearance: none; -webkit-appearance: none; flex: none; width: 54px; height: 30px; border-radius: 999px; border: 3px solid var(--ink); background: var(--recess); box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.6); position: relative; cursor: pointer; transition: background 0.15s; }
.menu-toggle input::after { content: ''; position: absolute; top: 1px; left: 1px; width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--ink); background: linear-gradient(180deg, #d9d1ef, #a8a5c6); transition: transform 0.2s var(--pop), background 0.15s; }
.menu-toggle input:checked { background: var(--green-lo); }
.menu-toggle input:checked::after { transform: translateX(24px); background: linear-gradient(180deg, #fff, #e8e1fa); }
#resetRow { --k-hi: #62559b; --k-lo: #353247; --k-lip: #2e2b40; font-size: 15px; min-height: 44px; }
/* hint/range warning in a yellow-tinted navy, not olive */
.range.far { background: #3e3b4d; border-color: var(--yellow); color: var(--yellow-ink); }
.range.ok { background: #14503a; }
/* leaderboard: fade the clipped bottom */
.board-body { -webkit-mask-image: linear-gradient(to bottom, #000 90%, transparent); mask-image: linear-gradient(to bottom, #000 90%, transparent); padding-bottom: 14px; }
/* login: the go key is green and the bottom gets a darker scrim */
#demoSignIn { --k-hi: var(--green-hi); --k-lo: var(--green-lo); --k-lip: var(--green-lip); }
.login-art::after { background: linear-gradient(to bottom, rgba(11, 9, 20, 0.4), transparent 26%, transparent 38%, rgba(5, 7, 30, 0.94) 82%); }


/* ---------- compass dial ---------- */
.compass { padding: 0; border: 0; background: none !important; box-shadow: 0 4px 0 var(--ink) !important; border-radius: 50%; width: 62px; height: 62px; }
.compass:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ink) !important; }
.compass .dial { width: 100%; height: 100%; display: block; overflow: visible; }
.compass #compassNeedle { transform-box: fill-box; transform-origin: center; transition: transform 0.12s linear; }
.compass[aria-pressed='true'] .dial circle:first-child { fill: #4a3a12; }

/* ---------- location gems in the HUD: a tappable shortcut to every location found ---------- */
.stat { padding-block: 7px 8px; }
.dots { gap: 6px; margin-top: 2px; justify-content: space-between; }
.gem { position: relative; isolation: isolate; width: 30px; height: 34px; flex: none; display: grid; place-items: center; color: #fff; font-family: var(--font-display); font-size: 16px; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.45)); }
.gem::before, .gem::after { content: ''; position: absolute; z-index: -1; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.gem::before { inset: 0; background: var(--ink); }
.gem::after { inset: 3px; background: linear-gradient(180deg, var(--locked-hi), var(--locked-lo)); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45); }
.gem.open::after { background: linear-gradient(180deg, var(--blue-hi), var(--blue-lo)); }
.gem.cleared::after { background: linear-gradient(180deg, var(--green-hi), var(--green-lo)); }
.gem.hidden { color: rgba(255, 255, 255, 0.35); filter: none; }
.gem.hidden::after { background: #211f2e; box-shadow: none; }
button.gem { transition: transform 0.08s; }
button.gem:active { transform: translateY(3px); }
.gem .i { width: 16px; height: 16px; }

/* ---------- splash / loading ---------- */
.splash { position: fixed; inset: 0; z-index: 200; display: grid; grid-template-rows: auto 1fr auto; justify-items: center; background: #191724; transition: opacity 0.5s ease, transform 0.5s ease; }
.splash.leave { opacity: 0; transform: scale(1.04); pointer-events: none; }
.splash-art { position: absolute; inset: 0; background: #191724 url('./assets/art/keyart-night.svg') center bottom / cover no-repeat; }
.splash-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(11, 9, 20, 0.5), transparent 30%, transparent 50%, rgba(11, 9, 20, 0.9)); }
.splash-logo { position: relative; z-index: 1; width: min(78vw, 300px); height: auto; box-sizing: content-box; padding: 8px 14px; border-radius: 18px; border: 3px solid var(--ink); background: rgba(11, 9, 20, 0.82); margin-top: calc(var(--safe-top) + 24px); filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.5)); }
.splash-center { position: relative; z-index: 1; grid-row: 3; width: min(86vw, 380px); padding-bottom: calc(var(--safe-bottom) + 56px); display: grid; gap: 14px; justify-items: center; text-align: center; }
.splash-title { font-size: clamp(54px, 17vw, 76px); line-height: 0.92; display: grid; justify-items: center; animation: pop 0.6s var(--pop) both; }
.splash-title span:first-child { color: var(--blue-hi); }
.splash-title span:last-child { color: var(--yellow-hi); }
.loadbar { width: 100%; height: 22px; border-radius: 999px; border: 3px solid var(--ink); background: var(--recess); box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.6), 0 3px 0 var(--ink); overflow: hidden; }
.loadbar i { display: block; height: 100%; width: 40%; border-radius: 999px; background: linear-gradient(180deg, var(--yellow-hi), var(--yellow-lo)); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.5); animation: load 1.4s ease-in-out infinite; }
@keyframes load { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.splash-text { margin: 0; font-family: var(--font-display); font-size: 18px; letter-spacing: 0.03em; color: #fff; text-shadow: 0 2px 0 var(--ink); }

/* ---------- finished screen ---------- */
#finishDialog.finish { width: min(92vw, 400px); padding-top: 70px; text-align: center; }
#finishDialog .finish-title { font-size: 56px; line-height: 1; margin: 0; color: var(--yellow-hi); }
.finish-team { margin: 4px 0 14px; font-family: var(--font-display); font-size: 22px; color: #fff; text-shadow: 0 2px 0 var(--ink); }
.finish-stats { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.finish-stats div { background: var(--recess); border: 3px solid var(--ink); border-radius: 14px; padding: 10px 6px; display: grid; gap: 0; box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.5); }
.finish-stats strong { font-family: var(--font-display); font-weight: 400; font-size: 28px; color: var(--yellow-hi); }
.finish-stats small { font-family: var(--font-display); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* ---------- menu: the player's name and email in game type; toggles ---------- */
#menuEmail { font-family: var(--font-display); font-size: 18px; letter-spacing: 0.02em; color: var(--yellow-ink); text-shadow: 0 2px 0 var(--ink); margin: -6px 0 10px; word-break: break-all; }
.menu-toggle { display: grid !important; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
.mt-text { display: grid; gap: 0; }
.mt-text b { display: flex; align-items: center; gap: 10px; font-weight: 400; font-size: 18px; }
.mt-text small { padding-left: 36px; margin-top: -2px; }
.menu-toggle input { width: 58px; height: 32px; }
.menu-toggle input::after { top: 1px; left: 1px; width: 22px; height: 22px; box-sizing: border-box; }
.menu-toggle input:checked::after { transform: translateX(26px); }
.avatar-option img { width: 100%; max-width: 150px; aspect-ratio: 1; object-fit: contain; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #5a527e, #2a2738); border: 3px solid var(--ink); }

/* base: the one next-location card stands out */
.stop-card.next { border-color: var(--yellow); }

.app-dialog .ghost-button, .team-card .ghost-button, .login-bottom .ghost-button, .team-card .primary-button, .app-dialog .primary-button { width: 100%; }

/* recenter sits right above the compass: same size, same centre line, same dark face */
.recenter { padding: 0; border: 0; background: none !important; box-shadow: 0 4px 0 var(--ink) !important; border-radius: 50%; width: 62px; height: 62px; display: grid; place-items: center; }
.recenter:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ink) !important; }
.recenter .dial { width: 100%; height: 100%; display: block; }
.side-tools .round-btn { margin: 0; }

/* HUD avatar: the portrait is cropped to head and shoulders inside the ring; the menu badge sits on the rim, off the face */
.avatar-btn { overflow: visible; }
.avatar-face { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; }
.avatar-btn .avatar-face img { position: absolute; left: -16%; top: 4%; width: 132%; height: 132%; max-width: none; border-radius: 0; object-fit: cover; object-position: 50% 0; transform: none; clip-path: none; }
.avatar-burger { right: -8px; bottom: -8px; width: 22px; height: 22px; z-index: 2; }

/* menu rows: one icon box, one text column, switches centred in their track */
.menu-list > button .i, .menu-list > button .gi, .mt-text b .gi { width: 26px; height: 26px; margin: 0; vertical-align: 0; flex: none; }
.menu-list > button { gap: 12px; }
.mt-text b { gap: 12px; }
.mt-text small { padding: 0; margin-top: 1px; line-height: 1.2; }
.menu-toggle { grid-template-columns: 26px 1fr auto !important; gap: 12px !important; padding-block: 6px; }
.mt-text b { display: block; line-height: 1.15; }
.menu-toggle input::after { top: 2px; left: 2px; }
.menu-toggle input:checked::after { transform: translateX(26px); }

.surprise .flag-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 10px; }
.surprise .flag-input { min-width: 0; width: 100%; }
.surprise { border-color: var(--yellow); }

/* sequential questions: a locked one shows only its number */
.puzzle.locked { opacity: 0.7; box-shadow: none; background: var(--recess); }
.puzzle.locked .puzzle-num { background: none; color: var(--muted); }
.puzzle.locked small { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.q-images { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 8px 0; }
.q-images a { display: block; border-radius: 12px; overflow: hidden; border: 3px solid var(--ink); background: var(--recess); }
.q-images img { display: block; width: 100%; max-height: 220px; object-fit: cover; }

/* emblem above the title on the sign-in and loading screens */
.login-emblem, .splash-emblem { width: 112px; height: 112px; justify-self: center; margin-bottom: -6px; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.5)); animation: pop 0.6s var(--pop) both; }
.login-fine.legal a, .dialog-note.legal a { color: #fff; text-underline-offset: 2px; }
.dialog-note.legal { text-align: center; }
