:root {
  --navy-950: #031022;
  --navy-900: #071a36;
  --navy-800: #0b2a53;
  --sky: #4fc3ff;
  --sky-bright: #95e4ff;
  --red: #d72838;
  --green: #14b86f;
  --green-dark: #087346;
  --gold: #ffd45c;
  --orange: #ff9a4d;
  --white: #f7fbff;
  --muted: #afc5dc;
  --danger: #ff5e6d;
  --line: rgba(151, 213, 255, .18);
  --shadow: 0 18px 50px rgba(0, 5, 20, .42);
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body { background: radial-gradient(circle at 50% 12%, #113b6f 0, #07162f 40%, #020811 100%); color: var(--white); -webkit-tap-highlight-color: transparent; user-select: none; }
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.is-hidden { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.fatal-message { position: fixed; inset: 0; display: grid; place-items: center; padding: 30px; background: var(--navy-950); color: #fff; text-align: center; }

#app { width: 100%; height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; justify-items: center; isolation: isolate; }
#game-shell { position: relative; height: min(100dvh, calc(100vw * 1.7777778)); max-height: 1080px; width: min(100vw, calc(100dvh * .5625)); max-width: 608px; overflow: hidden; background: linear-gradient(180deg, var(--navy-800), var(--navy-950)); box-shadow: 0 0 0 1px rgba(160, 219, 255, .22), 0 40px 100px rgba(0, 0, 0, .58); }
.shell-glow { position: absolute; z-index: 0; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% -4%, rgba(81, 196, 255, .3), transparent 35%); }

.desktop-rail { width: min(190px, 15vw); height: min(620px, 75vh); display: flex; flex-direction: column; align-items: center; justify-content: space-between; opacity: .42; color: #91bbd4; font-size: 10px; letter-spacing: .34em; font-weight: 900; writing-mode: vertical-rl; }
.desktop-rail i { flex: 1; width: 1px; margin: 30px 0; background: linear-gradient(transparent, rgba(79, 195, 255, .8), transparent); }
.desktop-rail--left { transform: rotate(180deg); }

.screen { position: absolute; z-index: 2; inset: 0; display: none; overflow: hidden; background: linear-gradient(180deg, #0a2b52 0%, #061730 55%, #041021 100%); }
.screen.is-active { display: flex; animation: screen-in .25s ease-out both; }
.screen--center { flex-direction: column; align-items: center; justify-content: center; padding: max(28px, env(safe-area-inset-top)) 28px max(28px, env(safe-area-inset-bottom)); text-align: center; }
.screen--panel { flex-direction: column; justify-content: center; gap: 18px; padding: max(34px, env(safe-area-inset-top)) clamp(24px, 7vw, 46px) max(28px, env(safe-area-inset-bottom)); background:
  linear-gradient(135deg, transparent 0 48%, rgba(79, 195, 255, .05) 48% 52%, transparent 52%),
  radial-gradient(circle at 85% 8%, rgba(79, 195, 255, .2), transparent 30%),
  linear-gradient(180deg, #09294e, #041326);
}
@keyframes screen-in { from { opacity: 0; transform: scale(1.012); } to { opacity: 1; transform: scale(1); } }

.eyebrow { margin: 0; color: var(--sky-bright); font-size: clamp(10px, 2.6vw, 13px); line-height: 1.2; font-weight: 900; letter-spacing: .23em; text-transform: uppercase; }
.eyebrow.gold { color: var(--gold); }
.build-label { margin: 8px 0 0; color: rgba(220, 236, 251, .54); font-size: clamp(8px, 2vw, 10px); line-height: 1.35; font-weight: 800; letter-spacing: .12em; text-align: center; }
h1, h2, h3, p { text-wrap: balance; }
h2 { margin: -4px 0 0; font-size: clamp(38px, 11vw, 60px); line-height: .94; letter-spacing: -.055em; text-transform: uppercase; font-weight: 950; }
.screen--panel > p:not(.eyebrow):not(.build-label) { margin: 0; color: #c4d7e9; font-size: clamp(14px, 3.8vw, 18px); line-height: 1.55; }

.loading-mark { width: 94px; aspect-ratio: 1; display: grid; place-items: center; margin-bottom: 24px; border: 2px solid var(--sky); background: linear-gradient(145deg, rgba(79,195,255,.25), rgba(4,16,33,.8)); transform: rotate(45deg); box-shadow: 0 0 42px rgba(79,195,255,.28); }
.loading-mark span { transform: rotate(-45deg); font-weight: 950; font-style: italic; font-size: 32px; }
.loading-title { margin: 9px 0 36px; font-size: clamp(56px, 18vw, 94px); line-height: .76; letter-spacing: -.08em; font-weight: 950; font-style: italic; }
.loading-title em { color: var(--sky); font-style: inherit; }
.loader { width: min(290px, 75vw); height: 8px; padding: 2px; overflow: hidden; border: 1px solid rgba(149,228,255,.42); border-radius: 99px; background: rgba(0,0,0,.3); }
.loader span { display: block; width: 0%; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--green), var(--sky), var(--gold)); box-shadow: 0 0 14px var(--sky); transition: width .2s ease; }
.loading-copy { color: var(--muted); font-size: 12px; letter-spacing: .08em; }

.notice-icon { width: 56px; height: 56px; display: grid; place-items: center; border: 2px solid var(--gold); color: var(--gold); font-weight: 950; font-size: 28px; transform: rotate(45deg); }
.notice-icon::first-letter { transform: rotate(-45deg); }
.legal-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(0,8,24,.36); }
.legal-card strong { font-size: 13px; }
.legal-card span { color: var(--muted); font-size: 12px; }

.button { min-height: 50px; border: 0; border-radius: 12px; padding: 0 22px; cursor: pointer; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; transition: transform .12s ease, filter .12s ease, background .12s ease; }
.button:active, .icon-button:active, .text-button:active { transform: scale(.97); }
.button--wide { width: 100%; }
.button--primary { color: #03142a; background: linear-gradient(135deg, var(--sky-bright), var(--sky)); box-shadow: 0 12px 26px rgba(79,195,255,.24); }
.button--secondary { border: 1px solid var(--line); background: rgba(10,44,82,.72); }
.button--danger { background: var(--danger); color: #200208; }
.text-button { appearance: none; border: 0; padding: 10px 4px; background: transparent; color: #d3e5f4; cursor: pointer; font-size: 12px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; text-decoration: underline; text-decoration-color: rgba(151,213,255,.35); text-underline-offset: 5px; }
.text-button--gold { color: var(--gold); text-decoration-color: rgba(255,212,92,.42); }
.danger-button { width: 100%; border: 1px solid rgba(255,94,109,.35); border-radius: 12px; padding: 14px; background: rgba(255,94,109,.08); color: #ff8995; cursor: pointer; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.24); border-radius: 50%; background: rgba(3,16,34,.66); backdrop-filter: blur(12px); cursor: pointer; font-size: 18px; }
.icon-button--back { font-size: 24px; }

.home-screen { background: var(--navy-950); }
.home-portrait { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 28%; }
.home-vignette { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(2,10,23,.08) 0%, rgba(2,10,23,.04) 28%, rgba(2,10,23,.7) 56%, #031022 82%); }
.home-topline { position: absolute; z-index: 2; inset: max(20px, env(safe-area-inset-top)) 18px auto; display: flex; align-items: center; justify-content: space-between; }
.build-chip { padding: 8px 10px; border: 1px solid rgba(255,212,92,.6); border-radius: 999px; background: rgba(3,16,34,.68); color: var(--gold); font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.home-copy { position: absolute; z-index: 2; inset: auto clamp(18px, 5.5vw, 34px) max(16px, env(safe-area-inset-bottom)); text-align: center; }
.home-copy h1 { margin: 8px 0 14px; font-size: clamp(48px, 14vw, 78px); line-height: .78; letter-spacing: -.075em; font-weight: 950; font-style: italic; text-shadow: 0 3px 0 rgba(0,0,0,.4); }
.home-copy h1 em { display: inline-block; color: var(--sky); font-style: inherit; }
.home-records { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; width: min(330px, 90%); margin: 0 auto 12px; overflow: hidden; border: 1px solid rgba(151,213,255,.18); border-radius: 12px; background: rgba(151,213,255,.18); backdrop-filter: blur(12px); }
.home-records div { padding: 9px; background: rgba(3,16,34,.82); }
.home-records span { display: block; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.home-records strong { display: block; margin-top: 2px; font-size: 20px; }
.home-records strong b { font: inherit; }
.button--play { width: min(360px, 100%); min-height: 62px; display: flex; align-items: center; justify-content: space-between; margin: 0 auto; padding: 0 15px 0 28px; border-radius: 16px; color: #03142a; background: linear-gradient(135deg, #d8f7ff 0%, var(--sky) 52%, #34a2ff 100%); box-shadow: 0 16px 38px rgba(41,164,255,.34); font-size: 20px; }
.button--play i { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: #061932; font-style: normal; font-size: 15px; }
.button--compact { margin: 14px auto 2px; min-height: 56px; }
.home-secondary { display: flex; justify-content: center; gap: clamp(8px, 3vw, 22px); }

.game-screen { background: #0b6843; }
#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: default; }
.hud { position: absolute; z-index: 5; inset: max(12px, env(safe-area-inset-top)) 14px auto; pointer-events: none; text-shadow: 0 2px 5px rgba(0,0,0,.65); }
.hud-row { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: start; }
.hud-row--match { grid-template-columns: minmax(0,1.2fr) minmax(88px,.8fr) 42px; gap: 8px; }
.match-scoreboard { min-width: 0; display: flex; align-items: center; gap: 5px; width: max-content; max-width: 100%; padding: 6px 8px; border: 1px solid rgba(255,255,255,.34); border-radius: 12px; background: rgba(3,16,34,.78); backdrop-filter: blur(9px); }
.match-scoreboard strong { display: flex; align-items: center; gap: 3px; white-space: nowrap; font-size: clamp(10px,2.6vw,14px); letter-spacing: .03em; }
.match-scoreboard strong b { min-width: 12px; color: var(--gold); font-size: 1.16em; }
.match-scoreboard strong i { color: rgba(255,255,255,.55); font-style: normal; }
.match-flag { font-size: clamp(14px,3.8vw,20px); line-height: 1; }
.hud-stat span { display: block; color: rgba(255,255,255,.72); font-size: 8px; font-weight: 900; letter-spacing: .15em; }
.hud-stat strong { display: block; font-size: clamp(19px, 5vw, 27px); line-height: 1.05; font-weight: 950; }
.hud-stat strong b { font: inherit; }
.hud-stat--points { min-width: 0; text-align: right; }
.hud-stat--points small { display: block; color: rgba(255,255,255,.66); font-size: 8px; font-weight: 850; white-space: nowrap; }
.hud-stat--points small b { font: inherit; color: var(--white); }
.hud-stat--center { text-align: center; }
.hud-pause { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; gap: 5px; justify-self: end; border: 1px solid rgba(255,255,255,.34); border-radius: 50%; background: rgba(3,16,34,.65); pointer-events: auto; cursor: pointer; }
.hud-pause i { width: 4px; height: 15px; border-radius: 2px; background: #fff; }
.charge-wrap { margin-top: 8px; }
.charge-label { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.charge-label strong { color: var(--gold); }
.charge-track { position: relative; height: 12px; display: flex; overflow: hidden; border: 2px solid rgba(255,255,255,.7); border-radius: 99px; background: rgba(3,16,34,.65); }
.charge-track span { position: absolute; inset: 0 auto 0 0; width: 0%; background: linear-gradient(90deg, var(--sky), var(--gold)); transition: width .2s cubic-bezier(.2,.9,.3,1.2); }
.charge-track i { position: relative; z-index: 1; flex: 1; border-left: 1px solid rgba(255,255,255,.38); }
.power-row { min-height: 26px; display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; }
.power-pill { padding: 5px 9px; border: 1px solid rgba(149,228,255,.5); border-radius: 999px; background: rgba(3,16,34,.75); color: var(--sky-bright); font-size: 9px; font-weight: 900; letter-spacing: .05em; }
.power-pill--gold { margin-left: auto; border-color: rgba(255,212,92,.6); color: var(--gold); }
.power-pill--red { border-color: rgba(255,100,115,.65); color: #ffabb2; background: rgba(91,10,25,.72); }

.tutorial-cue { position: absolute; z-index: 7; top: 29%; left: 50%; width: 80%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 7px; color: #fff; text-align: center; text-shadow: 0 2px 7px rgba(0,0,0,.7); animation: tutorial-pulse 1s ease-in-out infinite; pointer-events: none; }
.tutorial-cue span { font-size: 42px; }
.tutorial-cue strong { padding: 9px 14px; border-radius: 999px; background: rgba(3,16,34,.82); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
@keyframes tutorial-pulse { 50% { transform: translateX(-50%) translateY(-6px); } }
.aim-instructions { position: absolute; z-index: 7; left: 50%; bottom: 25%; transform: translateX(-50%); width: max-content; max-width: 82%; display: flex; flex-direction: column; padding: 9px 15px; border: 1px solid rgba(255,212,92,.5); border-radius: 10px; background: rgba(3,16,34,.82); text-align: center; pointer-events: none; }
.aim-instructions strong { color: var(--gold); font-size: 11px; letter-spacing: .1em; }
.aim-instructions span { margin-top: 2px; color: #d9e8f4; font-size: 9px; }
.game-toast { position: absolute; z-index: 10; left: 50%; bottom: 18%; transform: translateX(-50%); padding: 8px 13px; border-radius: 99px; background: rgba(3,16,34,.88); font-size: 11px; font-weight: 800; white-space: nowrap; }
.reaction-panel { position: absolute; z-index: 12; inset: 18% -15% 23%; display: grid; grid-template-columns: auto auto; align-items: center; justify-content: center; gap: 18px; padding: 20px 12%; transform: rotate(-5deg); background: linear-gradient(120deg, rgba(1,13,29,.97), rgba(16,101,162,.96) 70%, rgba(79,195,255,.95)); border-block: 5px solid #fff; box-shadow: 0 25px 70px rgba(0,0,0,.54); pointer-events: none; animation: reaction-in .25s cubic-bezier(.17,.89,.28,1.3) both; }
.reaction-panel[data-result="perfect"] { background: linear-gradient(120deg, #2e1c04, #b66c0b 62%, var(--gold)); }
.reaction-panel[data-result="miss"], .reaction-panel[data-result="saved"], .reaction-panel[data-result="post"], .reaction-panel[data-result="wide"], .reaction-panel[data-result="high"] { background: linear-gradient(120deg, #1c1224, #6a2852 65%, #e25e77); }
.reaction-panel div { transform: rotate(5deg); text-align: center; }
.reaction-face { width: clamp(92px, 28vw, 150px); aspect-ratio: 1; object-fit: cover; border: 4px solid rgba(255,255,255,.85); box-shadow: 0 14px 32px rgba(0,0,0,.38); transform: rotate(5deg); clip-path: polygon(9% 0, 100% 0, 91% 100%, 0 100%); }
.reaction-panel span { display: block; font-size: 10px; font-weight: 900; letter-spacing: .22em; }
.reaction-panel strong { display: block; font-size: clamp(54px, 17vw, 90px); line-height: .9; font-style: italic; letter-spacing: -.06em; }
.reaction-panel small { display: block; margin-top: 4px; color: var(--gold); font-size: 18px; font-weight: 950; }
@keyframes reaction-in { from { opacity: 0; transform: translateX(100%) rotate(-5deg); } }

.overlay-panel { z-index: 15; background: rgba(3,16,34,.94); backdrop-filter: blur(9px); }
.overlay-panel h2 { margin-bottom: 12px; }
.results-screen { z-index: 15; flex-direction: column; align-items: center; justify-content: flex-start; overflow-x: hidden; overflow-y: auto; padding: max(24px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom)); text-align: center; background: radial-gradient(circle at 50% 18%, rgba(79,195,255,.26), transparent 34%), linear-gradient(180deg, #09294e, #041326); scrollbar-width: thin; }
.results-screen h2 { font-size: clamp(38px, 10vw, 55px); }
.new-best { margin-top: 8px; color: var(--gold); font-size: 11px; font-weight: 900; letter-spacing: .13em; animation: tutorial-pulse 1s ease-in-out infinite; }
.result-hero { margin-top: 10px; }
.result-match { display: flex; align-items: center; gap: 11px; margin-top: 12px; padding: 8px 13px; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; background: rgba(0,8,24,.48); }
.result-match > span { font-size: 22px; }
.result-match strong { display: flex; gap: 5px; align-items: center; font-size: 14px; letter-spacing: .04em; }
.result-match strong i { color: var(--gold); font-size: 20px; font-style: normal; }
.result-hero > span { display: block; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .2em; }
.result-hero > strong { display: block; font-size: clamp(55px, 17vw, 88px); line-height: .9; letter-spacing: -.05em; }
.result-hero small { color: var(--sky-bright); font-size: 13px; font-weight: 800; }
.result-grid { width: min(390px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 18px 0 4px; }
.result-grid div { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(0,8,24,.34); }
.result-grid span { display: block; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.result-grid strong { display: block; margin-top: 2px; font-size: 21px; }

.score-submit-card { width: min(390px,100%); display: grid; gap: 7px; margin: 14px 0 4px; padding: 15px; border: 1px solid rgba(255,212,92,.28); border-radius: 16px; background: rgba(0,8,24,.52); text-align: left; }
.score-submit-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.score-submit-heading span { display: block; color: var(--gold); font-size: 8px; font-weight: 950; letter-spacing: .14em; }
.score-submit-heading strong { display: block; margin-top: 2px; font-size: 16px; }
.score-submit-heading > b { color: var(--gold); font-size: 30px; line-height: 1; }
.score-submit-card label { margin-top: 3px; color: #dbe8f4; font-size: 10px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.score-submit-card input, .score-submit-card select { width: 100%; min-height: 43px; border: 1px solid rgba(151,213,255,.28); border-radius: 10px; padding: 0 12px; background: #071a34; color: var(--white); user-select: text; }
.score-submit-card select { cursor: pointer; }
.score-submit-card .button { margin-top: 5px; }
.online-status { min-height: 28px; margin: 1px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; text-align: center; }
.online-status[data-type="success"] { color: #83efb9; }
.online-status[data-type="error"] { color: #ff9ba5; }
.online-status[data-type="warning"] { color: #ffd988; }
.button:disabled { cursor: not-allowed; filter: grayscale(.45); opacity: .58; }

.leaderboard-screen { z-index: 18; flex-direction: column; overflow-x: hidden; overflow-y: auto; padding: max(20px,env(safe-area-inset-top)) 20px max(22px,env(safe-area-inset-bottom)); background: radial-gradient(circle at 80% 0, rgba(215,40,56,.2), transparent 35%), linear-gradient(180deg,#09294e,#041326); scrollbar-width: thin; }
.leaderboard-screen .screen-header { flex: 0 0 auto; }
.leaderboard-screen .screen-header > :last-child { margin-left: auto; }
.leaderboard-loading { padding: 35px 15px; color: var(--muted); text-align: center; }
.leaderboard-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; counter-reset: none; }
.leaderboard-row { min-height: 52px; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(0,8,24,.42); }
.leaderboard-row.is-current { border-color: rgba(255,212,92,.6); background: rgba(255,212,92,.09); }
.leaderboard-rank { color: var(--sky-bright); font-size: 16px; font-weight: 950; text-align: center; }
.leaderboard-identity { min-width: 0; display: flex; align-items: center; gap: 9px; }
.leaderboard-identity > span { font-size: 21px; }
.leaderboard-identity strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.leaderboard-score { color: var(--gold); font-size: 17px; font-weight: 950; }
.leaderboard-list .is-empty { padding: 30px 15px; color: var(--muted); text-align: center; }
.leaderboard-own { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.leaderboard-own > small { display: block; margin-bottom: 6px; color: var(--gold); font-size: 9px; font-weight: 900; letter-spacing: .15em; }
.leaderboard-error { padding: 25px 0; text-align: center; }
.leaderboard-error p { color: #ff9ba5; }
.leaderboard-note { margin: 14px 3px 0; color: var(--muted); font-size: 9px; line-height: 1.45; text-align: center; }

.settings-screen, .how-to-screen { z-index: 18; flex-direction: column; padding: max(20px, env(safe-area-inset-top)) 22px max(18px, env(safe-area-inset-bottom)); background: linear-gradient(180deg, #09294e, #041326); }
.screen-header { display: flex; align-items: center; gap: 17px; margin-bottom: 18px; }
.screen-header h2 { margin: 1px 0 0; font-size: clamp(33px, 9vw, 48px); }
.settings-scroll { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 2px 3px 12px; scrollbar-width: thin; }
.setting-row { min-height: 59px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.setting-row label, .slider-row label { font-size: 14px; font-weight: 800; }
.setting-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.toggle { width: 49px; height: 27px; position: relative; flex: 0 0 auto; padding: 3px; border: 0; border-radius: 99px; background: #31445a; cursor: pointer; transition: background .18s ease; }
.toggle span { display: block; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 3px 9px rgba(0,0,0,.32); transition: transform .18s ease; }
.toggle[aria-checked="true"] { background: var(--sky); }
.toggle[aria-checked="true"] span { transform: translateX(22px); }
.slider-row { padding: 14px 0 16px; border-bottom: 1px solid var(--line); }
.slider-row label { display: flex; justify-content: space-between; color: #dceaf5; }
.slider-row output { color: var(--sky-bright); }
input[type="range"] { width: 100%; height: 6px; margin-top: 13px; accent-color: var(--sky); cursor: pointer; }
.settings-scroll .button { margin-top: 14px; }
.settings-scroll .danger-button { margin-top: 9px; }

.credits-screen { z-index: 18; }
.credits-screen > .icon-button { position: absolute; top: max(20px, env(safe-area-inset-top)); left: 22px; }
.credit-card { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(0,8,24,.35); }
.credit-card span { color: var(--sky-bright); font-size: 9px; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
.credit-card strong { font-size: 15px; }
.credit-card small { color: var(--muted); font-size: 11px; }
.version { color: var(--gold); font-size: 11px; letter-spacing: .12em; }

.how-to-screen { z-index: 18; }
.how-cards { display: grid; gap: 10px; flex: 1; align-content: center; }
.how-card { display: flex; align-items: center; gap: 15px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(0,8,24,.32); }
.how-card--gold { border-color: rgba(255,212,92,.34); background: rgba(255,212,92,.07); }
.how-card--red { border-color: rgba(255,94,109,.34); background: rgba(215,40,56,.08); }
.gesture-icon { width: 45px; height: 45px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; background: rgba(79,195,255,.13); color: var(--sky-bright); font-size: 25px; font-weight: 900; }
.how-card div { text-align: left; }
.how-card strong { display: block; font-size: 14px; }
.how-card small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.35; }

.rotate-screen { z-index: 50; background: var(--navy-950); }
.phone-rotate { width: 65px; height: 104px; display: grid; place-items: center; position: relative; border: 3px solid var(--sky); border-radius: 12px; font-size: 76px; line-height: 1; color: transparent; }
.phone-rotate span { position: absolute; right: -33px; top: 31px; color: var(--gold); font-size: 34px; }
.rotate-screen h2 { margin-top: 32px; font-size: 34px; }
.rotate-screen p { color: var(--muted); }

.modal { position: absolute; z-index: 60; inset: 0; display: grid; place-items: center; padding: 25px; background: rgba(0,5,15,.74); backdrop-filter: blur(8px); }
.modal-card { width: 100%; padding: 23px; border: 1px solid var(--line); border-radius: 18px; background: #0a2443; box-shadow: var(--shadow); }
.modal-card h3 { margin: 8px 0; font-size: 26px; text-transform: uppercase; }
.modal-card p:not(.eyebrow) { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.modal-card > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.enable-music { position: absolute; z-index: 70; left: 50%; bottom: max(15px, env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 10px 15px; border: 1px solid var(--gold); border-radius: 999px; background: rgba(3,16,34,.94); color: var(--gold); cursor: pointer; font-size: 11px; font-weight: 900; box-shadow: var(--shadow); white-space: nowrap; }

@media (max-width: 700px) {
  #app { display: grid; grid-template-columns: 1fr; place-items: center; }
  #game-shell { width: min(100vw, calc(100dvh * .5625)); max-width: none; height: min(100dvh, calc(100vw * 1.7777778)); max-height: none; box-shadow: 0 0 42px rgba(0, 5, 20, .52); }
  .desktop-rail { display: none; }
}

@media (max-height: 670px) {
  .home-copy h1 { font-size: 43px; margin-bottom: 9px; }
  .home-records { margin-bottom: 8px; }
  .button--play { min-height: 54px; }
  .screen--panel { gap: 12px; }
  .result-grid { margin-top: 10px; }
  .result-grid div { padding: 8px; }
  .result-hero > strong { font-size: 55px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

body.reduced-motion *, body.reduced-motion *::before, body.reduced-motion *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
body.reduced-motion .reaction-panel { animation-name: screen-in; transform: none; }
