:root {
  --bg: #090d10;
  --panel: rgba(9, 14, 18, .92);
  --line: rgba(255,255,255,.12);
  --text: #f4f6f7;
  --muted: #9da7ad;
  --acid: #d8ff48;
  --danger: #ff5e63;
  --cyan: #63e6ff;
}
* { box-sizing: border-box; }
html, body { width:100%; height:100%; min-height:100dvh; margin:0; overflow:hidden; background:var(--bg); color:var(--text); font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { touch-action:none; }
#game-shell { position:relative; width:100%; height:100%; min-height:100dvh; background:radial-gradient(circle at 50% 40%, #142028 0%, #090d10 62%, #050709 100%); }
#game { width:100%; height:100%; display:block; }
.hidden { display:none !important; }
.hud { position:absolute; inset:0 0 auto 0; display:flex; justify-content:space-between; gap:24px; padding:18px 22px; pointer-events:none; text-shadow:0 2px 6px #000; }
.hud-left { min-width:min(430px, 48vw); }
.brand { font-weight:950; letter-spacing:.15em; font-size:13px; margin-bottom:10px; color:var(--acid); }
.stat { display:grid; grid-template-columns:44px minmax(100px, 300px) 42px; align-items:center; gap:8px; margin:5px 0; font-size:12px; letter-spacing:.05em; }
.stat.xp { grid-template-columns:44px minmax(100px, 300px); }
.bar { height:8px; background:rgba(255,255,255,.1); overflow:hidden; border-radius:999px; box-shadow:inset 0 0 0 1px rgba(255,255,255,.05); }
.bar i { display:block; width:100%; height:100%; background:var(--danger); border-radius:inherit; transition:width .15s ease; }
.stat.xp .bar i { width:0%; background:var(--acid); }
.hud-right { display:flex; gap:24px; text-align:right; }
.hud-right div { min-width:62px; }
.hud-right small, .results small { display:block; font-size:9px; color:var(--muted); letter-spacing:.16em; }
.hud-right b { font-size:19px; }
.overlay { position:absolute; inset:0; display:none; align-items:center; justify-content:center; padding:20px; background:rgba(2,5,7,.62); backdrop-filter:blur(8px); }
.overlay.show { display:flex; }
.panel { width:min(760px, 95vw); padding:34px; border:1px solid var(--line); background:linear-gradient(160deg, rgba(18,27,33,.96), rgba(8,12,15,.96)); box-shadow:0 30px 90px rgba(0,0,0,.5); border-radius:24px; }
.start-panel { max-width:650px; }
.eyebrow { color:var(--acid); font-size:11px; font-weight:900; letter-spacing:.25em; }
h1 { font-size:clamp(62px, 10vw, 104px); line-height:.75; letter-spacing:-.075em; margin:20px 0 26px; font-weight:1000; }
h1 span { color:var(--acid); }
h2 { margin:8px 0 24px; font-size:clamp(34px, 5vw, 58px); line-height:.95; letter-spacing:-.04em; }
.lead { max-width:470px; color:#ccd2d5; font-size:17px; line-height:1.5; }
.controls-grid { display:grid; grid-template-columns:1fr 1fr; margin:28px 0; border:1px solid var(--line); border-radius:16px; overflow:hidden; }
.controls-grid div { display:flex; flex-direction:column; gap:4px; padding:14px 16px; border-right:1px solid var(--line); border-bottom:1px solid var(--line); }
.controls-grid div:nth-child(2n) { border-right:0; }
.controls-grid div:nth-last-child(-n+2) { border-bottom:0; }
.controls-grid b { font-size:11px; color:var(--acid); letter-spacing:.13em; }
.controls-grid span { color:var(--muted); font-size:12px; }
button { font:inherit; }
.primary { border:0; border-radius:999px; padding:15px 24px; background:var(--acid); color:#10140a; font-weight:950; letter-spacing:.08em; cursor:pointer; box-shadow:0 10px 30px rgba(216,255,72,.18); transition:transform .12s ease, filter .12s ease; }
.primary:hover { transform:translateY(-2px); filter:brightness(1.06); }
.tiny { color:var(--muted); font-size:11px; margin:16px 0 0; }
.upgrade-panel { width:min(980px, 95vw); }
.upgrade-cards { display:grid; grid-template-columns:repeat(3, 1fr); gap:14px; }
.upgrade-card { min-height:230px; border:1px solid var(--line); background:rgba(255,255,255,.035); border-radius:18px; padding:20px; text-align:left; color:var(--text); cursor:pointer; transition:.15s ease; }
.upgrade-card:hover { transform:translateY(-5px); border-color:rgba(216,255,72,.6); background:rgba(216,255,72,.06); }
.upgrade-icon { width:46px; height:46px; display:grid; place-items:center; border-radius:13px; background:var(--acid); color:#111; font-size:22px; margin-bottom:32px; }
.upgrade-card h3 { margin:0 0 8px; font-size:20px; }
.upgrade-card p { margin:0; color:var(--muted); line-height:1.45; font-size:13px; }
.results { display:grid; grid-template-columns:repeat(4, 1fr); gap:8px; margin:26px 0; }
.results div { padding:18px; border:1px solid var(--line); border-radius:14px; }
.results b { display:block; margin-top:7px; font-size:24px; }
.incident-banner { position:absolute; left:50%; top:76px; transform:translateX(-50%); width:min(560px, calc(100vw - 30px)); padding:12px 16px 10px; border:1px solid rgba(255,94,99,.42); border-radius:14px; background:rgba(32,7,9,.84); backdrop-filter:blur(9px); text-align:center; pointer-events:none; box-shadow:0 14px 50px rgba(0,0,0,.35); }
.incident-banner small { display:block; color:#ff8f93; letter-spacing:.2em; font-weight:900; font-size:9px; }
.incident-banner strong { display:block; font-size:21px; margin:3px 0; }
.incident-banner span { color:#d3b4b6; font-size:12px; }
.incident-timer { margin-top:8px; height:3px; background:rgba(255,255,255,.1); overflow:hidden; border-radius:99px; }
.incident-timer i { display:block; width:100%; height:100%; background:var(--danger); }
.mobile-controls { position:absolute; inset:auto 0 22px 0; height:150px; pointer-events:none; }
.joystick { position:absolute; left:24px; bottom:0; width:120px; height:120px; border-radius:50%; border:1px solid rgba(255,255,255,.18); background:rgba(255,255,255,.04); pointer-events:auto; }
.joystick i { position:absolute; left:36px; top:36px; width:48px; height:48px; border-radius:50%; background:rgba(216,255,72,.6); }
.touch-btn { position:absolute; pointer-events:auto; border:1px solid rgba(255,255,255,.2); background:rgba(255,255,255,.08); color:#fff; border-radius:50%; font-weight:900; }
.touch-btn.fire { right:24px; bottom:4px; width:86px; height:86px; }
.touch-btn.dash { right:118px; bottom:72px; width:58px; height:58px; font-size:10px; }
@media (max-width:720px) {
  .hud { padding:12px; }
  .hud-left { min-width:55vw; }
  .brand { margin-bottom:6px; }
  .stat { grid-template-columns:32px minmax(70px, 1fr) 34px; }
  .stat.xp { grid-template-columns:32px minmax(70px, 1fr); }
  .hud-right { gap:9px; }
  .hud-right div { min-width:42px; }
  .hud-right b { font-size:14px; }
  .panel { padding:24px; border-radius:18px; }
  .upgrade-cards { grid-template-columns:1fr; max-height:62vh; overflow:auto; }
  .upgrade-card { min-height:130px; }
  .upgrade-icon { margin-bottom:14px; }
  .results { grid-template-columns:1fr 1fr; }
  .incident-banner { top:68px; }
}

.install-tip { margin:10px 0 0; color:#c7ced1; font-size:11px; line-height:1.4; }
@supports (padding: max(0px)) {
  .hud { padding-top:max(18px, env(safe-area-inset-top)); padding-left:max(22px, env(safe-area-inset-left)); padding-right:max(22px, env(safe-area-inset-right)); }
  .mobile-controls { bottom:max(22px, env(safe-area-inset-bottom)); }
}
@media (display-mode: standalone) {
  .install-tip { display:none; }
}
