:root{
  --bg:#081428;--gold:#ffe36e;--gold2:#ffb52e;--shadow:#c47a10;
  --cream:#fff8e0;--ink:#081428;--btn-ink:#14200a;--phone:#1d6fd8;--phone-sh:#0d4590;--cyan:#5fe6ff;
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{width:100%;height:100%;overflow:hidden;background:var(--bg);color:var(--cream);font-family:"Trebuchet MS","Segoe UI",system-ui,sans-serif;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;touch-action:none}
.hidden{display:none!important}
#stage{position:fixed;inset:0;display:flex;flex-direction:column;height:100%;height:100dvh}

#hud{flex:0 0 auto;display:flex;align-items:center;gap:10px;padding:max(5px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) 5px max(8px,env(safe-area-inset-left));background:var(--bg);border-bottom:2px solid #16305a}
.hud-logo{height:40px;width:auto;flex:0 0 auto}
.stat{display:flex;flex-direction:column;line-height:1.05;min-width:44px}
.stat span{font-size:10px;font-weight:800;letter-spacing:.12em;color:#a9c8f0}
.stat b{font-size:20px;font-weight:900;color:var(--gold);font-variant-numeric:tabular-nums}
.hud-btns{margin-left:auto;display:flex;gap:6px}
.hb{font:inherit;font-weight:900;font-size:11px;letter-spacing:.08em;color:var(--cream);background:#1d3c6e;border:0;border-radius:9px;padding:9px 10px;cursor:pointer;touch-action:manipulation}
.hb.off{background:#4a3a2a;color:#e0c9a0}
.hb.warn{background:#b8321e}

#wrap{position:relative;flex:1 1 auto;min-height:0;overflow:hidden;background:#050c18}
#cv{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none}
#toast{position:absolute;left:50%;top:40%;transform:translateX(-50%);font-weight:900;font-size:clamp(20px,6vw,38px);letter-spacing:.06em;color:#fff;text-shadow:0 3px 0 #1d4fa0,0 0 18px rgba(95,230,255,.9);opacity:0;transition:opacity .2s;pointer-events:none;white-space:nowrap;text-align:center}
#toast.show{opacity:1}

#foot{flex:0 0 auto;display:flex;gap:14px;justify-content:center;align-items:center;flex-wrap:wrap;padding:5px 8px max(5px,env(safe-area-inset-bottom));background:var(--bg);font-size:12px;font-weight:800;color:#a9c8f0;border-top:2px solid #16305a}
#foot a{color:#fff;text-decoration:none;background:var(--phone);border-radius:8px;padding:4px 9px;box-shadow:0 2px 0 var(--phone-sh)}
@media (max-width:520px){ #hud{gap:7px} .stat{min-width:34px} .stat b{font-size:16px} .stat span{font-size:9px} .hud-logo{height:30px} .hb{padding:8px 6px;font-size:10px} #foot{gap:8px;font-size:11px} #foot .lic{width:100%;text-align:center} }
@media (max-width:380px){ .hud-logo{display:none} }

.overlay{position:fixed;inset:0;z-index:20;overflow-y:auto;display:flex;justify-content:center;align-items:flex-start;padding:max(14px,env(safe-area-inset-top)) 14px max(14px,env(safe-area-inset-bottom));background:linear-gradient(rgba(6,14,32,.72),rgba(6,14,32,.92));touch-action:pan-y}
.panel{width:100%;max-width:540px;margin:auto 0;display:flex;flex-direction:column;gap:9px;text-align:center}
.panel.small{max-width:340px}
.logo-hero{width:160px;height:auto;margin:0 auto;filter:drop-shadow(0 3px 8px rgba(0,0,0,.45))}
.logo-hero.sm{width:110px}
.brand{font-size:12px;font-weight:800;letter-spacing:.16em;color:var(--cream);text-transform:uppercase}
.title{font-size:clamp(40px,12vw,68px);font-weight:900;letter-spacing:.05em;line-height:.95;color:#fffde8;text-shadow:0 3px 0 #1d4fa0,0 6px 0 rgba(10,30,70,.6),0 0 26px rgba(95,230,255,.85)}
.title2{font-size:clamp(30px,9vw,46px);font-weight:900;letter-spacing:.06em;color:#fffde8;text-shadow:0 3px 0 #1d4fa0,0 0 18px rgba(95,230,255,.7)}
.card{font-size:13px;color:#0b1a33;background:rgba(255,255,255,.9);border-radius:10px;padding:9px 11px;line-height:1.4;font-weight:700}
.card.tip{font-size:12px;background:rgba(255,248,200,.94)}
.how{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.how div{background:rgba(18,38,76,.85);border-radius:10px;padding:6px 8px;text-align:left;box-shadow:inset 0 0 0 1px rgba(95,230,255,.3)}
.how b{display:block;font-size:11px;letter-spacing:.12em;color:var(--gold)}
.how span{display:block;font-size:12px;font-weight:700;color:var(--cream);line-height:1.25}
.best{font-size:15px;font-weight:900;color:var(--ink);background:rgba(255,248,200,.94);border-radius:10px;padding:7px 10px;letter-spacing:.06em}
.best b{color:#8a5a00}
.row{display:flex;justify-content:center}
.btn{font:inherit;font-weight:900;font-size:22px;letter-spacing:.12em;color:var(--btn-ink);background:linear-gradient(var(--gold),var(--gold2));border:0;border-radius:12px;padding:12px 40px;cursor:pointer;box-shadow:0 4px 0 var(--shadow);touch-action:manipulation;min-width:220px}
.btn.alt{font-size:15px;padding:10px 24px;background:#1d3c6e;color:var(--cream);box-shadow:0 3px 0 #0a1830}
.btn:active{transform:translateY(2px)}
.lic{font-size:13px;color:var(--cream);font-weight:800}
.phones{display:flex;gap:8px}
.phones a{flex:1;display:block;text-decoration:none;font-weight:900;font-size:15px;color:#fff;background:var(--phone);border-radius:12px;padding:10px 6px;box-shadow:0 3px 0 var(--phone-sh)}
.phones a small{display:block;font-size:12px;font-weight:700;opacity:.9}
.web{font-weight:900;font-size:14px;color:var(--cream)}
.web a{color:var(--gold)}
.big{font-size:52px;font-weight:900;color:var(--gold);line-height:1;text-shadow:0 3px 0 #6a4a00}
.newbest{font-size:15px;font-weight:900;letter-spacing:.14em;color:#14200a;background:var(--gold);border-radius:8px;padding:5px;margin:0 auto;width:220px}
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.stats div{background:rgba(18,38,76,.85);border-radius:10px;padding:6px}
.stats span{display:block;font-size:10px;letter-spacing:.1em;font-weight:800;color:#a9c8f0}
.stats b{font-size:20px;color:var(--gold)}
@media (max-height:780px){ .logo-hero{width:110px} .title{font-size:clamp(34px,9vw,54px)} .panel{gap:7px} }
.stat.st-score{min-width:74px}
@media (max-width:440px){ .st-best{display:none} .hud-logo{display:none} #hud{gap:9px} }
