:root {
  color-scheme: dark;
  --bg: #071529;
  --panel: rgba(7, 21, 41, .88);
  --line: rgba(98, 208, 255, .28);
  --cyan: #54d9ff;
  --gold: #ffbd39;
  --text: #f7fbff;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: #020812; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button { font: inherit; }
#app { position: relative; width: 100%; height: 100%; min-height: 100svh; overflow: hidden; background: var(--bg); touch-action: none; user-select: none; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.screen { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; }
.hidden { display: none !important; }
.start-screen { overflow: hidden; background: #061326; }
.poster { position: absolute; inset: 0; background: radial-gradient(circle at 68% 26%, rgba(255,189,57,.22), transparent 28%), linear-gradient(90deg, rgba(1,6,15,.84) 0%, rgba(1,6,15,.46) 38%, rgba(1,6,15,.18) 100%), url('poster.png') center center/cover no-repeat; transform: scale(1.03); }
.cover-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.16), rgba(2,9,20,.34) 44%, rgba(2,9,20,.72) 100%); }
.cover-content {
  position: absolute; left: max(24px, env(safe-area-inset-left)); right: max(24px, env(safe-area-inset-right)); bottom: max(24px, env(safe-area-inset-bottom));
  max-width: 760px; z-index: 2; padding: 28px 30px 26px; border-radius: 28px;
  background: linear-gradient(180deg, rgba(4,13,28,.74), rgba(4,13,28,.84));
  border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(12px); box-shadow: 0 20px 80px rgba(0,0,0,.45);
}
.eyebrow { display: inline-flex; padding: 6px 11px; border-radius: 999px; background: rgba(84,217,255,.12); border: 1px solid rgba(84,217,255,.34); color: #94e8ff; font-size: 12px; font-weight: 800; letter-spacing: .18em; }
.cover-content h1 { margin: 12px 0 0; font-size: clamp(56px, 8vw, 110px); line-height: .88; letter-spacing: -.06em; color: #fff7dc; text-shadow: 0 0 34px rgba(84,217,255,.18), 0 10px 24px rgba(0,0,0,.35); }
.cover-content p { margin: 14px 0 24px; color: #d8ebfb; font-size: clamp(16px, 2vw, 22px); max-width: 32ch; }
.badge { display: inline-flex; padding: 6px 11px; border-radius: 999px; background: rgba(84,217,255,.12); border: 1px solid rgba(84,217,255,.34); color: #94e8ff; font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.badge.danger { color: #ffd7ce; border-color: rgba(255,109,77,.44); background: rgba(255,109,77,.13); }
.primary { appearance: none; border: 0; border-radius: 14px; padding: 14px 24px; min-width: 180px; background: linear-gradient(180deg, #ffd05d, #f19a1d); color: #14100a; font-weight: 900; cursor: pointer; box-shadow: 0 10px 30px rgba(241,154,29,.24); }
.primary:active { transform: translateY(1px) scale(.99); }
.secondary { appearance:none; border:1px solid rgba(255,255,255,.18); border-radius:14px; padding:14px 18px; background:rgba(3,14,30,.72); color:#fff; font-weight:800; cursor:pointer; backdrop-filter:blur(8px); }
.secondary:active { transform: translateY(1px) scale(.99); }
.start-actions { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.controls { margin-top: 18px; font-size: 13px; color: #a9bfd0; }
.hud { position: absolute; z-index: 12; top: max(12px, env(safe-area-inset-top)); left: max(14px, env(safe-area-inset-left)); right: max(14px, env(safe-area-inset-right)); display: flex; align-items: center; gap: 8px; pointer-events: none; }
.hud-item { min-width: 94px; padding: 8px 12px; border-radius: 12px; background: rgba(3,14,30,.72); border: 1px solid rgba(255,255,255,.13); backdrop-filter: blur(8px); }
.hud-item small { display: block; color: #84a5be; font-size: 9px; letter-spacing: .14em; }
.hud-item b { display: block; color: #fff; font-size: 18px; margin-top: 1px; }
.icon-btn { margin-left: auto; width: 42px; height: 42px; border-radius: 12px; border: 1px solid rgba(255,255,255,.13); color: white; background: rgba(3,14,30,.72); cursor: pointer; pointer-events: auto; }
.panel { width: min(480px, calc(100vw - 32px)); padding: 26px; border-radius: 22px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 24px 80px rgba(0,0,0,.52); text-align: center; backdrop-filter: blur(12px); }
.game-over h2, .pause h2 { margin: 12px 0 18px; font-size: 34px; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 0; }
.result-grid div { padding: 12px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.09); }
.result-grid span { display: block; color: #8fa8bd; font-size: 12px; }
.result-grid strong { display: block; margin-top: 3px; font-size: 24px; color: #fff; }
.pause { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(0,7,18,.55); }
.pause p { color: #a9bdd0; }
@media (max-width: 900px) {
  .poster { background-position: 62% 36%; }
  .cover-content { left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); padding: 20px 22px; }
  .cover-content h1 { font-size: clamp(48px, 13vw, 78px); }
  .cover-content p { max-width: none; }
  .hud-item { min-width: 72px; padding: 7px 9px; }
  .hud-item b { font-size: 16px; }
}
