:root { color-scheme: dark; font-family: Inter, ui-rounded, system-ui, -apple-system, sans-serif; }
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #06253a; color: #f8fafc; }
body { touch-action: manipulation; }
#game, #camera { position: fixed; inset: 0; width: 100%; height: 100%; }
#game { z-index: 1; }
#camera { object-fit: cover; transform: scaleX(-1); opacity: .16; filter: saturate(.7); }
.hidden { display: none !important; }
.overlay { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; overflow: auto; padding: calc(18px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom)); background: linear-gradient(150deg, rgba(3, 22, 37, .76), rgba(7, 71, 88, .64)); backdrop-filter: blur(8px); }
.card { width: min(600px, 100%); border: 1px solid rgba(255,255,255,.17); border-radius: 30px; padding: 26px; background: linear-gradient(150deg, rgba(8, 48, 66, .96), rgba(10, 76, 83, .94)); box-shadow: 0 28px 80px rgba(0,0,0,.35); text-align: center; }
.card.compact { width: min(480px, 100%); }
.topbar { display: flex; align-items: center; justify-content: space-between; }
.topbar a { display: grid; place-items: center; width: 44px; height: 44px; color: white; text-decoration: none; font-size: 24px; border-radius: 50%; background: rgba(255,255,255,.1); }
select, button { min-height: 46px; border: 1px solid rgba(255,255,255,.2); border-radius: 14px; background: rgba(4, 32, 48, .72); color: white; padding: 10px 14px; font: inherit; font-weight: 700; }
button { cursor: pointer; }
button:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid #fde68a; outline-offset: 3px; }
.icon { font-size: clamp(44px, 10vw, 70px); margin-top: 5px; }
.eyebrow { color: #99f6e4; font-size: 12px; font-weight: 900; letter-spacing: .16em; }
h1 { font-size: clamp(30px, 7vw, 50px); line-height: 1; margin: 8px 0 12px; }
h2 { font-size: clamp(26px, 6vw, 38px); margin: 8px 0; }
p { line-height: 1.55; }
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0 14px; text-align: left; }
.settings label { display: grid; gap: 7px; font-size: 13px; color: #ccfbf1; }
.settings select { width: 100%; }
.actions { display: grid; gap: 10px; }
.primary { color: #042f2e; border: 0; background: linear-gradient(135deg, #99f6e4, #fde68a); }
.privacy { margin: 10px 0 6px; color: #a7f3d0; font-size: 12px; }
small { display: block; line-height: 1.5; color: #cbd5e1; }
.progress { height: 13px; overflow: hidden; margin: 18px 0 8px; border-radius: 999px; background: rgba(0,0,0,.28); }
.progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #5eead4, #fde68a); }
.hud { position: fixed; z-index: 8; top: calc(12px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right)); display: flex; gap: 8px; align-items: stretch; }
.hud div { min-width: 76px; padding: 8px 10px; border-radius: 14px; background: rgba(3, 25, 40, .78); text-align: center; backdrop-filter: blur(8px); }
.hud span { display: block; font-size: 9px; color: #99f6e4; letter-spacing: .09em; }
.hud b { font-size: 18px; }
.hud button { min-width: 46px; padding: 8px; border-radius: 50%; background: rgba(3, 25, 40, .78); }
.cue { position: fixed; z-index: 6; left: 50%; top: calc(100px + env(safe-area-inset-top)); transform: translateX(-50%); min-width: 140px; padding: 11px 24px; border: 2px solid rgba(255,255,255,.4); border-radius: 999px; background: rgba(4, 47, 46, .8); text-align: center; box-shadow: 0 12px 30px rgba(0,0,0,.2); }
.cue small { color: #ccfbf1; }
.cue b { display: block; font-size: 24px; color: #fde68a; }
.cue.pulse { animation: pulse .3s ease-out; }
@keyframes pulse { 50% { transform: translateX(-50%) scale(1.08); } }
.tracking { position: fixed; z-index: 7; left: 50%; bottom: calc(120px + env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 10px 16px; border-radius: 999px; background: rgba(127, 29, 29, .88); font-weight: 700; text-align: center; }
.controls { position: fixed; z-index: 8; left: max(14px, env(safe-area-inset-left)); right: max(14px, env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.controls button { min-height: 74px; border: 2px solid rgba(255,255,255,.28); background: rgba(3, 44, 59, .85); font-size: 17px; backdrop-filter: blur(7px); }
.controls span { margin: 0 12px; font-size: 26px; color: #fde68a; }
.result-score { font-size: 22px; }
.result-score b { font-size: 52px; color: #fde68a; }
@media (max-width: 640px) {
  .overlay { align-items: start; padding-left: 10px; padding-right: 10px; }
  .card { border-radius: 24px; padding: 18px 16px; }
  .card p { margin: 8px 0; }
  .settings { margin: 13px 0 10px; }
  .hud { left: calc(72px + env(safe-area-inset-left)); right: 8px; justify-content: flex-end; }
  .hud div { min-width: 58px; padding: 7px 6px; }
  .hud b { font-size: 16px; }
  .hud button { min-width: 40px; min-height: 40px; }
  .cue { top: calc(92px + env(safe-area-inset-top)); }
}
@media (max-width: 370px) {
  .hud div:nth-child(2) { display: none; }
  .settings { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } }
