:root { --blue:#3fb6ff; --blue2:#8fdcff; --red:#ff4d5e; --green:#3dff9a; --ink:#e9f2ff; --panel:rgba(6,14,32,.62); }
* { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html,body { margin:0; height:100%; height:100dvh; overflow:hidden; background:#050b18; color:var(--ink); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; touch-action:none; user-select:none; -webkit-user-select:none; }
#c { position:fixed; inset:0; width:100%; height:100%; display:block; }
.hidden { display:none !important; }
.panel { position:absolute; background:var(--panel); border:1px solid rgba(143,220,255,.18); border-radius:14px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow:0 6px 24px rgba(0,0,0,.35); }
.lbl { font-size:11px; letter-spacing:.14em; text-transform:uppercase; opacity:.7; }
.big { font-size:28px; font-weight:800; line-height:1.1; font-variant-numeric: tabular-nums; }
.sub { font-size:12px; opacity:.75; }
.unit { font-size:14px; opacity:.7; font-weight:600; }
#hud { position:fixed; inset:0; pointer-events:none; }
#hudScore { top:calc(12px + env(safe-area-inset-top)); left:calc(12px + env(safe-area-inset-left)); padding:10px 14px; min-width:170px; }
#hudScore .big { color:#fff; text-shadow:0 0 12px rgba(63,182,255,.6); }
#hudTimer { top:calc(12px + env(safe-area-inset-top)); right:calc(12px + env(safe-area-inset-right)); padding:10px 14px; text-align:right; min-width:120px; }
#hudTimer.low .big { color:var(--red); animation: pulse .6s infinite alternate; }
@keyframes pulse { to { transform:scale(1.08); } }
#hudCompare { top:calc(12px + env(safe-area-inset-top)); left:50%; transform:translateX(-50%); padding:8px 14px 10px; width:min(400px, 42vw); }
#hudCompare .row { display:flex; align-items:center; gap:8px; font-size:13px; font-weight:700; padding:3px 6px; border-radius:8px; transition: all .25s; opacity:.55; }
#hudCompare .name { width:70px; } #hudCompare .ms { width:60px; text-align:right; font-variant-numeric: tabular-nums; }
#hudCompare .bar { flex:1; height:8px; background:rgba(255,255,255,.08); border-radius:5px; overflow:hidden; }
#hudCompare .bar i { display:block; height:100%; border-radius:5px; }
#rowGossip .bar i { width:100%; background:var(--red); }
#rowOptimum .bar i { width:49.3%; background:var(--green); }
#rowGossip.active { opacity:1; background:rgba(255,77,94,.18); color:#ffd0d5; box-shadow: inset 0 0 0 1px rgba(255,77,94,.6); }
#rowOptimum.active { opacity:1; background:rgba(61,255,154,.16); color:#d4ffe9; box-shadow: inset 0 0 0 1px rgba(61,255,154,.6), 0 0 18px rgba(61,255,154,.35); }
#mumpTag { position:absolute; right:10px; bottom:-14px; font-size:12px; font-weight:900; letter-spacing:.06em; color:#03140b; background:var(--green); padding:2px 8px; border-radius:20px; opacity:0; transform:scale(.6); transition:all .25s; box-shadow:0 0 16px rgba(61,255,154,.7); }
#hudCompare.mump #mumpTag { opacity:1; transform:scale(1); }
#hudMap { left:calc(12px + env(safe-area-inset-left)); bottom:calc(12px + env(safe-area-inset-bottom)); padding:6px; border-radius:50%; }
#minimap { display:block; width:200px; height:200px; border-radius:50%; }
#hudPower { right:calc(12px + env(safe-area-inset-right)); bottom:calc(12px + env(safe-area-inset-bottom)); padding:10px 14px; display:flex; align-items:center; gap:12px; min-width:250px; }
#hudPower .logoSlot svg { display:block; opacity:.35; transition:opacity .3s; }
#hudPower.on .logoSlot svg { opacity:1; animation: glow 1s infinite alternate; }
@keyframes glow { to { filter: drop-shadow(0 0 8px var(--blue)); } }
#powerState { font-weight:700; font-size:14px; margin:2px 0 5px; }
.pbar { height:6px; background:rgba(255,255,255,.08); border-radius:4px; overflow:hidden; width:150px; }
.pbar i { display:block; height:100%; width:0; background:linear-gradient(90deg,var(--blue),var(--green)); }
#toast { position:absolute; top:22%; left:50%; transform:translateX(-50%); font-size:26px; font-weight:900; text-shadow:0 2px 12px rgba(0,0,0,.6), 0 0 20px rgba(63,182,255,.7); opacity:0; transition:opacity .3s; white-space:nowrap; }
#toast.show { opacity:1; }
#stormWarn { position:absolute; top:120px; left:50%; transform:translateX(-50%); background:rgba(180,220,255,.15); border:1px solid rgba(200,230,255,.4); padding:6px 14px; border-radius:20px; font-weight:700; font-size:13px; opacity:0; transition:opacity .5s; }
#stormWarn.show { opacity:1; }
#holdHint { position:absolute; bottom:30%; left:50%; transform:translateX(-50%); font-weight:800; font-size:16px; text-shadow:0 2px 8px #000; opacity:0; transition:opacity .2s; }
#holdHint.show { opacity:1; }
#lookHint { position:absolute; bottom:18%; left:50%; transform:translateX(-50%); font-weight:700; font-size:14px; padding:6px 14px; border-radius:16px; background:rgba(10,20,40,.55); border:1px solid rgba(143,220,255,.3); text-shadow:0 1px 4px #000; opacity:0; transition:opacity .4s; pointer-events:none; white-space:nowrap; }
#lookHint.show { opacity:1; }
body.touch #lookHint { display:none; }
#pauseBtn { position:absolute; top:calc(96px + env(safe-area-inset-top)); right:12px; pointer-events:auto; width:38px; height:38px; border-radius:50%; border:1px solid rgba(143,220,255,.3); background:var(--panel); color:#fff; font-weight:900; }

/* touch UI */
#touchUI { position:fixed; inset:0; pointer-events:none; }
#joyZone { position:absolute; left:0; bottom:0; width:45vw; height:50vh; pointer-events:auto; }
#joyBase { position:absolute; left:calc(30px + env(safe-area-inset-left)); bottom:calc(30px + env(safe-area-inset-bottom)); width:130px; height:130px; border-radius:50%; background:rgba(143,220,255,.12); border:2px solid rgba(143,220,255,.35); }
#joyKnob { position:absolute; left:37px; top:37px; width:56px; height:56px; border-radius:50%; background:rgba(143,220,255,.55); box-shadow:0 0 18px rgba(63,182,255,.6); }
#jumpBtn { position:absolute; right:calc(26px + env(safe-area-inset-right)); bottom:calc(30px + env(safe-area-inset-bottom)); width:118px; height:118px; border-radius:50%; pointer-events:auto; touch-action:none; -webkit-user-select:none; user-select:none; background:radial-gradient(circle at 50% 38%, rgba(143,220,255,.45), rgba(40,110,200,.28)); border:3px solid rgba(190,235,255,.8); color:#fff; font:900 20px/1 system-ui, sans-serif; letter-spacing:.08em; text-shadow:0 2px 6px rgba(0,0,0,.5); box-shadow:0 0 22px rgba(63,182,255,.45); }
#jumpBtn.on { transform:scale(.92); background:radial-gradient(circle at 50% 38%, rgba(190,240,255,.8), rgba(63,182,255,.55)); }
@media (max-height:420px) { #jumpBtn { width:100px; height:100px; } }
body.touch #hudMap { left:auto; right:calc(12px + env(safe-area-inset-right)); top:calc(100px + env(safe-area-inset-top)); bottom:auto; }
body.touch #minimap { width:120px; height:120px; }
body.touch #hudPower { bottom:calc(12px + env(safe-area-inset-bottom)); min-width:0; padding:8px 10px; }
body.touch #hudPower .pbar { width:90px; }
body.touch #pauseBtn { top:auto; bottom:calc(230px + env(safe-area-inset-bottom)); right:calc(52px + env(safe-area-inset-right)); }

@media (max-width: 720px) {
  .big { font-size:20px; }
  #hudScore { min-width:0; padding:7px 10px; } #hudTimer { min-width:0; padding:7px 10px; }
  #hudCompare { top:auto; bottom:calc(150px + env(safe-area-inset-bottom)); width:min(300px,70vw); padding:6px 10px 8px; }
  #hudCompare .row { font-size:11px; } #hudCompare .name { width:56px; } #hudCompare .ms { width:50px; }
  #stormWarn { top:90px; }
  #hudPower .lbl { display:none; } #powerState { font-size:12px; }
}

/* screens */
.screen { position:fixed; inset:0; display:flex; align-items:center; justify-content:center; background: radial-gradient(ellipse at 50% 30%, rgba(20,40,90,.55), rgba(3,7,18,.92)); z-index:10; padding:16px; overflow:auto; }
.card { max-width:640px; width:100%; text-align:center; background:rgba(6,14,32,.75); border:1px solid rgba(143,220,255,.25); border-radius:22px; padding:26px 26px 20px; box-shadow:0 20px 60px rgba(0,0,0,.5), 0 0 60px rgba(63,182,255,.12); }
h1 { margin:6px 0 2px; font-size:clamp(28px,5vw,44px); letter-spacing:.01em; text-shadow:0 0 22px rgba(63,182,255,.55); }
h2 { margin:0 0 12px; font-weight:500; font-size:16px; color:var(--blue2); letter-spacing:.12em; text-transform:uppercase; }
.story { line-height:1.5; font-size:15px; opacity:.92; }
.red { color:var(--red); font-weight:700; } .blue { color:var(--blue); font-weight:700; }
.how { display:grid; grid-template-columns:1fr 1fr; gap:6px 14px; text-align:left; font-size:13px; margin:14px 0; background:rgba(255,255,255,.04); padding:12px; border-radius:12px; }
.opts { display:flex; gap:14px; justify-content:center; margin:8px 0 14px; flex-wrap:wrap; }
select { background:#0b1a36; color:#fff; border:1px solid rgba(143,220,255,.35); border-radius:8px; padding:6px 8px; margin-left:6px; font-size:14px; }
.cta { pointer-events:auto; font-size:18px; font-weight:800; padding:13px 30px; border-radius:40px; border:0; color:#03121f; background:linear-gradient(90deg,#43c3ff,#3dff9a); box-shadow:0 0 30px rgba(63,182,255,.5); cursor:pointer; }
.cta:active { transform:scale(.97); }
.ghost { font-size:15px; padding:11px 22px; border-radius:40px; background:transparent; color:#cfe; border:1px solid rgba(143,220,255,.4); margin-left:8px; cursor:pointer; }
.foot { margin-top:12px; font-size:12px; opacity:.6; }
.logoHero svg { width:min(260px,60vw); height:auto; }
#ovStats { display:grid; grid-template-columns:repeat(auto-fit,minmax(96px,1fr)); gap:10px; margin:14px 0 18px; }
#ovStats div { background:rgba(255,255,255,.05); border-radius:12px; padding:10px; }
#ovStats b { display:block; font-size:22px; }
#ovStats div { font-size:13px; }
#ending { position:fixed; inset:auto 0 0 0; bottom:6vh; text-align:center; z-index:9; pointer-events:none; }
#ending h1 { font-size:clamp(34px,7vw,72px); text-shadow:0 0 30px rgba(63,182,255,.9), 0 0 60px rgba(63,182,255,.5); }
#ending p { font-size:18px; opacity:.9; margin:4px 0 16px; }
#ending .cta { pointer-events:auto; }
.endLogo svg { width:min(200px,40vw); height:auto; }
#loading { flex-direction:column; gap:14px; z-index:20; font-weight:600; }
.spinner { width:44px; height:44px; border-radius:50%; border:4px solid rgba(143,220,255,.2); border-top-color:var(--blue); animation: spin 1s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }

/* Boosted callout + combo */
#boostCallout { position:absolute; top:30%; left:50%; transform:translate(-50%,-50%) scale(.4); text-align:center; opacity:0; pointer-events:none; }
#boostCallout .bc-main { font-size:clamp(54px, 11vw, 120px); font-weight:900; font-style:italic; letter-spacing:.04em; color:#eafaff;
  background:linear-gradient(90deg,#3fb6ff,#9ff4ff 45%,#3dff9a); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent;
  filter:drop-shadow(0 0 18px rgba(63,182,255,.9)) drop-shadow(0 4px 10px rgba(0,0,0,.6)); }
#boostCallout .bc-sub { margin-top:4px; font-size:clamp(14px,2.2vw,22px); font-weight:800; color:#bdf0ff; text-shadow:0 0 12px rgba(63,182,255,.9), 0 2px 6px #000; letter-spacing:.08em; text-transform:uppercase; }
#boostCallout.show { animation: boostIn var(--bd, 2.2s) cubic-bezier(.2,1.4,.4,1) forwards; }
@keyframes boostIn {
  0% { opacity:0; transform:translate(-50%,-50%) scale(.3) rotate(-6deg); }
  14% { opacity:1; transform:translate(-50%,-50%) scale(1.18) rotate(2deg); }
  24% { transform:translate(-50%,-50%) scale(.96) rotate(-1deg); }
  32% { transform:translate(-50%,-50%) scale(1.02) rotate(0); }
  80% { opacity:1; transform:translate(-50%,-50%) scale(1); }
  100% { opacity:0; transform:translate(-50%,-62%) scale(1.08); }
}
#combo { position:absolute; top:150px; right:16px; text-align:right; opacity:0; pointer-events:none; }
#combo .cb-main { font-size:34px; font-weight:900; font-style:italic; color:#7fe6ff; text-shadow:0 0 14px rgba(63,182,255,.95), 0 2px 6px #000; }
#combo .cb-sub { font-size:14px; font-weight:800; color:#3dff9a; text-shadow:0 2px 6px #000; }
#combo.show { opacity:1; }
#combo.pop .cb-main { animation: comboPop .45s cubic-bezier(.2,1.6,.4,1); }
@keyframes comboPop { 0% { transform:scale(1.7); } 100% { transform:scale(1); } }
#combo .cb-bar { height:4px; margin-top:4px; margin-left:auto; width:120px; border-radius:2px; background:rgba(255,255,255,.15); overflow:hidden; }
#combo .cb-bar i { display:block; height:100%; background:linear-gradient(90deg,#3fb6ff,#3dff9a); }
@media (max-width: 700px) { #combo { top:118px; } #combo .cb-main { font-size:26px; } }

/* phones: keep HUD panels clear of each other and of the touch controls */
@media (max-width: 720px) {
  #hudScore { max-width:56vw; } #hudScore .sub, #hudScore small { font-size:10px; }
  #minimap { width:104px; height:104px; }
  body.touch #hudMap { top:calc(84px + env(safe-area-inset-top)); right:calc(10px + env(safe-area-inset-right)); padding:4px; }
  #pauseBtn { top:calc(84px + env(safe-area-inset-top)); right:auto; left:12px; }
  #hudCompare { bottom:calc(228px + env(safe-area-inset-bottom)); }
  #hudPower { min-width:0; max-width:54vw; padding:8px 10px; gap:8px; }
}

/* phone portrait layout: score/timer row, then latency bars left + minimap right, pause under the map */
@media (max-width: 720px) {
  #hudCompare { top:calc(74px + env(safe-area-inset-top)); bottom:auto; left:12px; transform:none; width:calc(100vw - 160px); }
  body.touch #hudMap { top:calc(70px + env(safe-area-inset-top)); right:calc(10px + env(safe-area-inset-right)); padding:4px; }
  body.touch #minimap { width:118px; height:118px; }
  #pauseBtn { top:calc(200px + env(safe-area-inset-top)); }
  #hudPower { min-width:0; left:auto; max-width:calc(100vw - 190px); padding:8px 10px; }
  #combo { top:212px; }
}

#dbgFps { position: fixed; left: calc(8px + env(safe-area-inset-left)); bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 99; white-space: pre; font: 600 11px/1.35 ui-monospace, Menlo, monospace; color: #9ff59f; background: rgba(0,0,0,.62); padding: 6px 8px; border-radius: 6px; pointer-events: none; }
#ctxLost { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; background: #050b18; color: #fff; font: 600 18px system-ui; text-align: center; padding: 24px; }

/* navigation aids */
#navEdge { position:absolute; inset:0; pointer-events:none; overflow:hidden; }
.navEdgeItem { position:absolute; left:0; top:0; width:46px; height:46px; display:flex; align-items:center; justify-content:center; pointer-events:none; }
.navEdgeItem i { position:absolute; inset:0; border-radius:50%; background:radial-gradient(circle, rgba(63,182,255,.55) 0, rgba(63,182,255,.18) 55%, transparent 70%); }
.navEdgeItem i::after { content:''; position:absolute; right:-2px; top:50%; margin-top:-8px; border-left:14px solid #8fdcff; border-top:8px solid transparent; border-bottom:8px solid transparent; filter:drop-shadow(0 0 4px #3fb6ff); }
.navEdgeItem span { position:relative; font:800 11px system-ui, sans-serif; color:#fff; text-shadow:0 1px 3px #000, 0 0 6px rgba(63,182,255,.9); white-space:nowrap; }
.navEdgeItem.near i { background:radial-gradient(circle, rgba(120,220,255,.8) 0, rgba(63,182,255,.3) 55%, transparent 72%); animation: navPulse 1s ease-in-out infinite; }
.navEdgeItem.slow i { background:radial-gradient(circle, rgba(255,180,70,.6) 0, rgba(255,160,50,.2) 55%, transparent 70%); }
.navEdgeItem.slow i::after { border-left-color:#ffcf6b; }
@keyframes navPulse { 50% { transform:scale(1.18); } }
#navDist { position:absolute; left:0; top:0; padding:2px 8px; border-radius:10px; background:rgba(8,20,40,.62); border:1px solid rgba(143,220,255,.55); font:800 13px system-ui, sans-serif; color:#cfefff; pointer-events:none; opacity:0; transition:opacity .2s; white-space:nowrap; }
#navDist.show { opacity:1; }
#housesLeft { position:absolute; top:calc(84px + env(safe-area-inset-top)); left:50%; transform:translateX(-50%); padding:4px 14px; border-radius:14px; background:rgba(8,20,40,.6); border:1px solid rgba(143,220,255,.45); font:800 14px system-ui, sans-serif; color:#e9f6ff; letter-spacing:.3px; opacity:0; transition:opacity .3s; pointer-events:none; white-space:nowrap; }
#housesLeft.show { opacity:1; }
@media (max-height: 500px) { #housesLeft { top:calc(86px + env(safe-area-inset-top)); font-size:12px; } body.touch #hudPower { right:calc(150px + env(safe-area-inset-right)); } }

/* PWA / fullscreen / mute */
.hudBtn { position:absolute; pointer-events:auto; width:38px; height:38px; border-radius:50%; border:1px solid rgba(143,220,255,.3); background:var(--panel); color:var(--ink); font-size:17px; line-height:1; cursor:pointer; display:flex; align-items:center; justify-content:center; padding:0; }
#muteBtn { top:calc(140px + env(safe-area-inset-top)); right:calc(12px + env(safe-area-inset-right)); }
#fsBtn { top:calc(184px + env(safe-area-inset-top)); right:calc(12px + env(safe-area-inset-right)); }
body.touch #muteBtn { top:auto; bottom:calc(274px + env(safe-area-inset-bottom)); right:calc(52px + env(safe-area-inset-right)); }
body.touch #fsBtn { top:auto; bottom:calc(318px + env(safe-area-inset-bottom)); right:calc(52px + env(safe-area-inset-right)); }
@media (max-height: 500px) { /* phone landscape: small button row under the score panel, clear of the joystick */
  body.touch #pauseBtn { bottom:auto; top:calc(102px + env(safe-area-inset-top)); right:auto; left:calc(12px + env(safe-area-inset-left)); }
  body.touch #muteBtn { bottom:auto; top:calc(102px + env(safe-area-inset-top)); right:auto; left:calc(56px + env(safe-area-inset-left)); }
  body.touch #fsBtn { bottom:auto; top:calc(102px + env(safe-area-inset-top)); right:auto; left:calc(100px + env(safe-area-inset-left)); }
  #title .card { padding:12px 18px; }
  #title .logoHero svg { width:min(120px,30vw); }
  #title h1 { font-size:26px; margin:4px 0; }
  #title h2 { margin:2px 0 6px; }
  #title .story { font-size:12px; line-height:1.35; }
  body.touch #title .how { display:none; }
}
#fsBtnTitle { margin-top:8px; }
#iosTip { position:fixed; z-index:60; left:50%; transform:translateX(-50%); bottom:calc(14px + env(safe-area-inset-bottom)); max-width:min(520px, 92vw); padding:10px 38px 10px 14px; border-radius:12px; background:rgba(6,14,32,.92); border:1px solid rgba(143,220,255,.35); font-size:13px; line-height:1.4; }
#iosTip .shareIco { display:inline-block; transform:rotate(-90deg); }
#iosTip button { position:absolute; right:6px; top:6px; background:none; border:0; color:var(--ink); font-size:16px; cursor:pointer; }
#rotateHint { position:fixed; z-index:70; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px; background:rgba(5,11,24,.94); font-size:16px; text-align:center; padding:24px; }
#rotateHint .rotIco { font-size:56px; animation: rotHint 1.8s ease-in-out infinite; }
#rotateHint button { margin-top:8px; background:none; border:1px solid rgba(143,220,255,.4); color:var(--ink); border-radius:18px; padding:8px 16px; font-size:13px; }
@keyframes rotHint { 0%,30% { transform:rotate(0) } 60%,100% { transform:rotate(90deg) } }
.screen .card { max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px); overflow-y:auto; }
#pauseAudio { display:grid; grid-template-columns:auto 1fr; gap:6px 12px; align-items:center; margin:10px auto 4px; max-width:300px; font-size:13px; }
#pauseAudio input { width:100%; }

/* error toast (bottom-centre above controls, safe-area aware) */
#errToast { position: fixed; left: 50%; transform: translateX(-50%); top: calc(8px + env(safe-area-inset-top)); z-index: 300; display: flex; flex-direction: column; gap: 6px; max-width: min(92vw, 560px); pointer-events: auto; }
#errToast .errItem { background: rgba(120, 20, 30, 0.92); color: #fff; font: 500 12px/1.35 system-ui, sans-serif; padding: 7px 11px; border-radius: 9px; box-shadow: 0 4px 14px rgba(0,0,0,.4); word-break: break-word; }
#errToast .errItem.info { background: rgba(20, 50, 90, 0.92); }

/* ================= mobile HUD v2 (touch devices): compact, safe-area aware, nothing over the thumbs ================= */
body.touch { --sat: env(safe-area-inset-top); --sab: env(safe-area-inset-bottom); --sal: env(safe-area-inset-left); --sar: env(safe-area-inset-right); }
body.touch .panel { border-radius:11px; box-shadow:0 3px 12px rgba(0,0,0,.3); }
body.touch .lbl { font-size:9px; letter-spacing:.1em; }
body.touch #hudScore { top:calc(8px + var(--sat)); left:calc(8px + var(--sal)); padding:5px 9px; min-width:0; max-width:48vw; }
body.touch #hudScore .big { font-size:18px; } body.touch #hudScore .unit { font-size:11px; } body.touch #hudScore .sub { font-size:9.5px; }
body.touch #hudTimer { top:calc(8px + var(--sat)); right:calc(8px + var(--sar)); padding:5px 9px; min-width:0; }
body.touch #hudTimer .big { font-size:18px; } body.touch #hudTimer .sub { font-size:9px; } body.touch #hudTimer .lbl { font-size:8.5px; }
/* latency bars collapse into a mini pill: only the active network + its ms */
body.touch #hudCompare { top:calc(62px + var(--sat)); left:calc(8px + var(--sal)); bottom:auto; transform:none; width:auto; padding:3px 9px; border-radius:20px; display:flex; }
body.touch #hudCompare .row { display:none; padding:0; font-size:11px; gap:6px; background:none !important; box-shadow:none !important; }
body.touch #hudCompare .row.active { display:flex; } body.touch #hudCompare .bar { display:none; }
body.touch #hudCompare .name, body.touch #hudCompare .ms { width:auto; }
body.touch #rowGossip.active .ms { color:#ff9aa5; } body.touch #rowOptimum.active .ms { color:var(--green); }
body.touch #mumpTag { position:static; margin-left:6px; font-size:10px; padding:1px 6px; display:none; }
body.touch #hudCompare.mump #mumpTag { display:inline-block; }
/* minimap: small, top-right under the timer */
body.touch #hudMap { top:calc(60px + var(--sat)); right:calc(8px + var(--sar)); left:auto; bottom:auto; padding:3px; }
body.touch #minimap { width:96px; height:96px; }
/* icon row: top-right, under the minimap */
body.touch .hudBtn, body.touch #pauseBtn { width:32px; height:32px; font-size:14px; }
body.touch #pauseBtn { top:calc(166px + var(--sat)); bottom:auto; left:auto; right:calc(84px + var(--sar)); }
body.touch #muteBtn { top:calc(166px + var(--sat)); bottom:auto; left:auto; right:calc(46px + var(--sar)); }
body.touch #fsBtn { top:calc(166px + var(--sat)); bottom:auto; left:auto; right:calc(8px + var(--sar)); }
body.touch #housesLeft { top:calc(92px + var(--sat)); font-size:12px; padding:3px 10px; }
/* power-up card -> small auto-hiding toast, top centre */
body.touch #hudPower { top:calc(122px + var(--sat)); bottom:auto; left:50%; right:auto; transform:translateX(-50%); min-width:0; max-width:64vw; padding:4px 10px; gap:6px; border-radius:16px;
  opacity:0; transition:opacity .35s; pointer-events:none; }
body.touch #hudPower.on, body.touch #hudPower.peek { opacity:1; }
body.touch #hudPower .logoSlot, body.touch #hudPower .lbl { display:none; }
body.touch #powerState { font-size:11px; margin:0 0 3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
body.touch #hudPower .pbar { width:100%; height:4px; }
body.touch #hudPower:not(.on) .pbar { display:none; }
body.touch #combo { top:calc(206px + var(--sat)); right:calc(10px + var(--sar)); } body.touch #combo .cb-main { font-size:24px; }
body.touch #stormWarn { top:calc(150px + var(--sat)); font-size:11px; }
body.touch #toast { font-size:20px; top:28%; }
/* thumbs: joystick 116 px bottom-left, JUMP 80 px bottom-right */
body.touch #joyBase { left:calc(18px + var(--sal)); bottom:calc(18px + var(--sab)); width:116px; height:116px; }
body.touch #joyKnob { left:31px; top:31px; width:50px; height:50px; }
body.touch #jumpBtn { right:calc(22px + var(--sar)); bottom:calc(30px + var(--sab)); width:80px; height:80px; font-size:13px; }
/* portrait rotate hint: a small card that never blocks play */
#rotateHint { inset:auto; left:50%; top:42%; transform:translate(-50%,-50%); width:min(300px,80vw); padding:14px 16px; gap:6px; border-radius:16px; background:rgba(5,11,24,.72);
  border:1px solid rgba(143,220,255,.3); font-size:13px; pointer-events:none; animation: rotFade 6s ease forwards; }
#rotateHint .rotIco { font-size:30px; } #rotateHint button { pointer-events:auto; margin-top:2px; padding:5px 12px; font-size:12px; }
@keyframes rotFade { 0%,80% { opacity:1 } 100% { opacity:0 } }
/* phone landscape: short screen, wide -> spread across the top edge */
@media (max-height: 500px) {
  body.touch #hudCompare { top:calc(8px + var(--sat)); left:50%; transform:translateX(-50%); }
  body.touch #housesLeft { top:calc(36px + var(--sat)); }
  body.touch #hudPower { top:calc(64px + var(--sat)); }
  body.touch #hudMap { top:calc(58px + var(--sat)); } body.touch #minimap { width:84px; height:84px; }
  body.touch #pauseBtn, body.touch #muteBtn, body.touch #fsBtn { top:calc(62px + var(--sat)); right:auto; }
  body.touch #pauseBtn { left:calc(8px + var(--sal)); } body.touch #muteBtn { left:calc(46px + var(--sal)); } body.touch #fsBtn { left:calc(84px + var(--sal)); }
  body.touch #combo { top:calc(150px + var(--sat)); }
  body.touch #stormWarn { top:calc(92px + var(--sat)); }
  body.touch #joyBase { width:110px; height:110px; } body.touch #joyKnob { left:29px; top:29px; }
  body.touch #jumpBtn { width:78px; height:78px; bottom:calc(22px + var(--sab)); }
}

/* ---- score card (night build 2026-10-31) */
#ovCard { margin:4px 0 14px; }
#ovCardImg { display:block; width:100%; max-width:480px; aspect-ratio:1200/675; margin:0 auto 10px; border-radius:12px; border:1px solid rgba(143,220,255,.35); box-shadow:0 8px 30px rgba(0,0,0,.45); cursor:zoom-in; background:#081430; }
.cardBtns { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; }
.cardBtns .ghost { margin:0; font-size:14px; padding:9px 16px; pointer-events:auto; }
#cardX { border-color:rgba(255,255,255,.55); color:#fff; }
#cardView { position:fixed; inset:0; z-index:60; background:rgba(2,6,16,.88); display:flex; align-items:center; justify-content:center; padding:calc(10px + env(safe-area-inset-top)) calc(10px + env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) calc(10px + env(safe-area-inset-left)); cursor:zoom-out; }
#cardView img { max-width:100%; max-height:100%; border-radius:12px; box-shadow:0 0 60px rgba(63,182,255,.35); }
@media (max-height: 500px) { #ovCardImg { max-width:300px; margin-bottom:6px; } .cardBtns .ghost { padding:7px 12px; font-size:13px; } #overlay #ovStats { margin:8px 0 10px; } }
/* phone landscape: card on the left, result + buttons on the right so everything fits 390 px tall */
@media (max-height: 500px) and (min-aspect-ratio: 4/3) {
  #overlay.withCard .card { max-width:820px; display:grid; grid-template-columns:minmax(0,1.1fr) minmax(0,1fr); grid-template-areas:"img title" "img text" "img stats" "img btns"; column-gap:18px; align-items:center; text-align:center; padding:12px 16px; }
  #overlay.withCard #ovTitle { grid-area:title; font-size:24px; margin:0; }
  #overlay.withCard #ovText { grid-area:text; font-size:13px; margin:4px 0; }
  #overlay.withCard #ovStats { grid-area:stats; grid-template-columns:repeat(2,1fr); gap:6px; margin:6px 0; }
  #overlay.withCard #ovStats div { padding:5px; font-size:11px; } #overlay.withCard #ovStats b { font-size:16px; }
  #overlay.withCard #ovCard { grid-area:img; margin:0; }
  #overlay.withCard #ovCardImg { max-width:100%; }
  #overlay.withCard .btns { grid-area:btns; } #overlay.withCard .btns .cta { font-size:15px; padding:10px 18px; } #overlay.withCard .btns .ghost { padding:8px 14px; font-size:13px; }
}
/* portrait phones: a compact stack */
@media (max-width: 500px) { #overlay.withCard #ovTitle { font-size:26px; } #overlay.withCard #ovText { font-size:13px; } #overlay.withCard #ovStats { grid-template-columns:repeat(2,1fr); gap:6px; margin:8px 0; } #overlay.withCard #ovStats b { font-size:17px; } }

/* ---- stages: obstacle intro card, wind gust arrow, lag / time-steal chip */
#intro { position:absolute; left:50%; bottom:calc(16px + var(--sab, 0px)); transform:translateX(-50%); display:flex; gap:12px; align-items:center; max-width:min(460px, 56vw);
  background:linear-gradient(180deg, rgba(14,28,52,.92), rgba(8,16,32,.92)); border:1.5px solid rgba(255,214,110,.75); border-radius:14px; padding:10px 14px; box-shadow:0 8px 30px rgba(0,0,0,.45), 0 0 18px rgba(255,200,80,.25);
  animation:introIn .45s cubic-bezier(.2,1.4,.4,1); pointer-events:none; z-index:6; }
#intro.hidden { display:none; }
#intro .ic { font-size:34px; line-height:1; filter:drop-shadow(0 2px 6px rgba(0,0,0,.5)); }
#intro b { display:block; color:#ffd66e; font-size:15px; letter-spacing:.3px; }
#intro span { display:block; font-size:13px; line-height:1.3; color:#e6efff; margin-top:2px; }
@keyframes introIn { from { opacity:0; transform:translate(-50%, 24px) scale(.9); } to { opacity:1; transform:translate(-50%, 0) scale(1); } }
#gust { position:absolute; top:168px; left:50%; transform:translateX(-50%); display:flex; flex-direction:column; align-items:center; gap:2px; opacity:0; transition:opacity .25s; pointer-events:none; }
#gust.show { opacity:1; }
#gust i { font-style:normal; font-size:34px; color:#cfe9ff; text-shadow:0 0 12px rgba(150,210,255,.9), 0 2px 6px #000; display:block; transform-origin:50% 50%; }
#gust i::before { content:''; }
#gust span { font-size:11px; font-weight:900; letter-spacing:2px; color:#cfe9ff; text-shadow:0 1px 4px #000; }
#gust.warn i { color:#ffd66e; animation:gustBlink .35s steps(2) infinite; }
@keyframes gustBlink { 50% { opacity:.35; } }
#hudStatus { position:absolute; top:142px; left:50%; transform:translateX(-50%); display:flex; gap:8px; opacity:0; transition:opacity .2s; pointer-events:none; }
#hudStatus.show { opacity:1; }
#hudStatus span { padding:4px 10px; border-radius:14px; font-size:12px; font-weight:900; }
#hudStatus .lag { background:rgba(150,60,230,.35); border:1px solid rgba(210,150,255,.7); color:#f0dcff; }
#hudStatus .steal { background:rgba(230,40,60,.35); border:1px solid rgba(255,120,130,.8); color:#ffe0e3; }
body.touch #intro { max-width:min(420px, 50vw); padding:8px 12px; }
body.touch #intro .ic { font-size:26px; }
body.touch #intro b { font-size:13px; } body.touch #intro span { font-size:11.5px; }
body.touch #gust { top:calc(170px + var(--sat)); }
body.touch #hudStatus { top:calc(128px + var(--sat)); }
@media (orientation: portrait) { body.touch #intro { max-width:86vw; bottom:calc(160px + var(--sab)); } }

/* ---- stage select */
.menuRow { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; align-items:center; margin-top:10px; }
.menuRow #fsBtnTitle { margin-top:0; }
.menuRow .ghost { line-height:20px; }
.menuRow .ghost { margin:0; }
.gold { color:#ffd25a; font-weight:800; }
.stagesCard { max-width:860px; }
.stagesCard h1 { margin:0 0 4px; }
.stSub { font-size:13px; color:#bcd6ef; margin-bottom:12px; }
.stSub b { color:#ffd66e; }
#stageGrid { display:grid; grid-template-columns:repeat(4, 1fr); gap:10px; margin-bottom:14px; }
.stTile { position:relative; display:flex; flex-direction:column; align-items:flex-start; gap:2px; padding:9px 10px 8px; min-height:84px; text-align:left; cursor:pointer; color:#e9f2ff;
  background:linear-gradient(160deg, rgba(30,60,110,.75), rgba(10,22,48,.85)); border:1px solid rgba(143,220,255,.3); border-radius:12px; font:inherit; }
.stTile:hover:not(.locked) { border-color:#8fe0ff; box-shadow:0 0 16px rgba(63,182,255,.35); }
.stTile.cur { border-color:#3dff9a; box-shadow:0 0 0 1px #3dff9a inset, 0 0 18px rgba(61,255,154,.25); }
.stTile .n { font-size:11px; font-weight:900; letter-spacing:1px; color:#8fdcff; }
.stTile .nm { font-size:14px; font-weight:800; line-height:1.15; }
.stTile .st { font-size:15px; letter-spacing:1px; color:#ffd25a; text-shadow:0 0 8px rgba(255,200,60,.5); }
.stTile .st i { font-style:normal; color:rgba(255,255,255,.22); text-shadow:none; }
.stTile .ob { position:absolute; right:8px; top:7px; font-size:13px; opacity:.9; }
.stTile.locked { cursor:not-allowed; filter:saturate(.3); opacity:.55; }
.stTile.locked .st { color:#cfe; font-size:11px; text-shadow:none; letter-spacing:0; }
.stTile.finale { background:linear-gradient(160deg, rgba(110,40,70,.8), rgba(40,10,30,.9)); border-color:rgba(255,120,160,.45); }
@media (max-height: 500px) {
  #stageGrid { grid-template-columns:repeat(8, 1fr); gap:6px; margin-bottom:8px; }
  .stTile { min-height:66px; padding:6px 6px 5px; }
  .stTile .nm { font-size:11px; } .stTile .st { font-size:12px; } .stTile .ob { display:none; }
  .stagesCard { padding:10px 14px; } .stagesCard h1 { font-size:20px; } .stSub { margin-bottom:6px; font-size:12px; }
}
@media (max-width: 500px) and (orientation: portrait) {
  #stageGrid { grid-template-columns:repeat(3, 1fr); gap:7px; }
  .stTile { min-height:72px; } .stTile .nm { font-size:12px; } .stTile .ob { display:none; }
}
.stTile .sh { display:none; }
@media (max-height: 500px) { .stTile .lg { display:none; } .stTile .sh { display:inline; } .stTile.locked .st { white-space:nowrap; font-size:10px; } }
@media (max-height: 500px) { body.touch #gust { top:calc(150px + var(--sat)); left:33%; } body.touch #gust i { font-size:28px; } body.touch #hudStatus { top:calc(148px + var(--sat)); } }

/* ---- wardrobe (live mascot preview shows through the transparent side of the screen) */
#wardrobe { background: linear-gradient(90deg, rgba(3,7,18,.82) 0, rgba(3,7,18,.55) 46%, rgba(3,7,18,0) 62%); justify-content:flex-start; align-items:stretch; padding:calc(10px + env(safe-area-inset-top)) 12px calc(10px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left)); }
.wardPanel { width:min(460px, 54vw); display:flex; flex-direction:column; gap:8px; background:rgba(6,14,32,.78); border:1px solid rgba(143,220,255,.25); border-radius:18px; padding:12px; box-shadow:0 20px 60px rgba(0,0,0,.5); min-height:0; }
.wardHead { display:flex; align-items:center; gap:10px; }
.wardHead h1 { font-size:22px; margin:0; }
#wardCount { color:#8fdcff; font-size:12px; flex:1; }
.wardHead .ghost { padding:7px 14px; font-size:13px; }
#wardTabs { display:flex; gap:4px; overflow-x:auto; scrollbar-width:none; flex:none; }
.wTab { position:relative; flex:1 0 auto; display:flex; flex-direction:column; align-items:center; gap:1px; padding:5px 6px; border-radius:10px; border:1px solid rgba(143,220,255,.2); background:rgba(255,255,255,.04); color:#cfe; cursor:pointer; font-size:11px; }
.wTab .ic { font-size:17px; line-height:1; }
.wTab.on { background:linear-gradient(180deg,rgba(67,195,255,.35),rgba(61,255,154,.18)); border-color:#43c3ff; color:#fff; }
.wTab .dot, .newDot { position:absolute; top:2px; right:3px; width:8px; height:8px; border-radius:50%; background:#ff4d6d; }
.newDot { position:relative; display:inline-block; top:-6px; right:auto; margin-left:4px; width:auto; height:auto; min-width:16px; padding:0 4px; font-size:11px; line-height:16px; color:#fff; }
#wardInfo { font-size:12px; color:#bfe4ff; min-height:16px; }
#wardGrid { display:grid; grid-template-columns:repeat(3, 1fr); gap:6px; overflow-y:auto; min-height:0; flex:1; align-content:start; }
.wItem { display:flex; flex-direction:column; align-items:center; gap:3px; padding:7px 4px; border-radius:12px; border:1px solid rgba(143,220,255,.18); background:rgba(255,255,255,.04); color:#e8f6ff; cursor:pointer; position:relative; }
.wItem .sw { width:34px; height:34px; border-radius:50%; border:2px solid rgba(255,255,255,.35); box-shadow:inset 0 -4px 8px rgba(0,0,0,.35); }
.wItem .sw.none { border-style:dashed; }
.wItem .nm { font-size:12px; font-weight:700; text-align:center; line-height:1.15; }
.wItem .rq { font-size:10px; color:#8fdcff; text-align:center; line-height:1.15; }
.wItem.eq { border-color:#3dff9a; background:rgba(61,255,154,.12); }
.wItem.eq .rq { color:#3dff9a; }
.wItem.new .rq { color:#ffd36b; font-weight:800; }
.wItem.locked { opacity:.62; } .wItem.locked .sw { filter:grayscale(.7) brightness(.7); }
.wItem.locked .rq { color:#ffb8c4; }
.wItem.sel { opacity:1; border-color:#ffd36b; }
@media (max-height:500px) { .wardHead h1 { font-size:18px; } .wTab .tl { display:none; } .wTab .ic { font-size:18px; } #wardGrid { grid-template-columns:repeat(4, 1fr); } .wItem { padding:5px 3px; } .wItem .sw { width:26px; height:26px; } }
@media (orientation:portrait) {
  #wardrobe { background: linear-gradient(0deg, rgba(3,7,18,.85) 0, rgba(3,7,18,.6) 50%, rgba(3,7,18,0) 62%); align-items:flex-end; padding-left:10px; padding-right:10px; }
  .wardPanel { width:100%; height:54%; }
  .wTab .tl { display:none; }
}
#unlockToasts { position:fixed; top:calc(10px + env(safe-area-inset-top)); left:50%; transform:translateX(-50%); z-index:60; display:flex; flex-direction:column; gap:6px; pointer-events:none; }
.uToast { display:flex; align-items:center; gap:10px; padding:8px 14px 8px 8px; border-radius:30px; background:rgba(6,14,32,.92); border:1px solid #ffd36b; color:#fff; font-size:14px; box-shadow:0 0 24px rgba(255,211,107,.35); opacity:0; transform:translateY(-12px); transition:opacity .35s, transform .35s; white-space:nowrap; }
.uToast.show { opacity:1; transform:none; }
.uToast .sw { width:28px; height:28px; border-radius:50%; border:2px solid rgba(255,255,255,.5); flex:none; }
.uToast small { display:block; font-size:10px; color:#ffd36b; text-transform:uppercase; letter-spacing:.08em; }


/* ---- first-launch onboarding + recovery code ---- */
.onboardCard { max-width:420px; text-align:center; padding:22px 22px 18px; }
#onboard .logoHero svg { width:min(200px,56vw); }
#onboard h1 { font-size:clamp(24px,6vw,34px); margin:4px 0 8px; }
#onboard .story { font-size:14px; margin:0 0 16px; }
#obForm, #obRestoreForm, #obProfileForm { display:flex; flex-direction:column; align-items:stretch; gap:6px; text-align:left; }
#onboard label { font-size:13px; font-weight:600; opacity:.85; margin-top:6px; }
#obName, #obProfName, #obRestoreIn, #obCountry, #obProfCountry {
  width:100%; font-size:16px; padding:10px 14px; border-radius:16px; border:1px solid rgba(143,220,255,.4);
  background:rgba(0,0,0,.35); color:#fff; box-sizing:border-box;
}
#obCountry, #obProfCountry { max-width:100%; }
#onboard .cta { margin:14px 0 6px; width:100%; }
#onboard .cta:disabled { opacity:.4; cursor:not-allowed; box-shadow:none; transform:none; pointer-events:none; filter:grayscale(.3); }
.obHint, .obMsg { min-height:1.2em; font-size:13px; margin:0; }
.obHint.bad, .obMsg.bad { color:#ff9a8a; } .obMsg.ok { color:#8fe8a8; }
.obLink { margin:10px 0 0; width:100%; }
#obJoinBack, #obProfBack, #obRestoreBack { margin:10px 0 0; width:100%; }
.obCodeBox { margin:8px 0 14px; padding:14px 12px; border-radius:16px; background:rgba(0,0,0,.35); border:1px solid rgba(143,220,255,.35);
  box-shadow:inset 0 0 20px rgba(63,182,255,.08); }
.obCodeBox.subtle { text-align:left; }
.obCodeLbl { display:block; font-size:11px; letter-spacing:.08em; text-transform:uppercase; opacity:.7; margin-bottom:6px; }
#obCodeValue, #obProfCode { display:block; font:700 22px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing:.12em; color:#8fdcff; text-shadow:0 0 16px rgba(63,182,255,.45); word-break:break-all; user-select:all; }
#obProfCode { font-size:18px; }
.obCodeBtns { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; }
.obCodeBtns .ghost, .obCodeBtns .cta { margin:0; flex:1 1 140px; }
#obStepProfile .obCodeBtns { margin-bottom:8px; }
@media (max-width: 480px) {
  .onboardCard { padding:18px 16px 16px; }
  #onboard .story { font-size:13px; }
  #obCodeValue { font-size:18px; letter-spacing:.08em; }
}
@media (max-height: 500px) {
  .onboardCard { max-width:620px; padding:12px 16px; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.1fr); gap:8px 18px; align-items:center; }
  #onboard .logoHero { grid-column:1; }
  #onboard h1, #onboard .story { grid-column:1; }
  #obForm, #obRestoreForm, #obProfileForm, .obCodeBox, .obCodeBtns, .obLink, #obJoinBack, #obProfBack { grid-column:2; }
  #onboard .logoHero svg { width:min(140px,28vw); }
  #onboard h1 { font-size:22px; }
  #onboard .cta { margin-top:8px; }
}

/* ---- leaderboard */
.boardCard { max-width:620px; text-align:left; padding:16px 18px 14px; display:flex; flex-direction:column; gap:8px; }
.bdHead { display:flex; align-items:center; gap:10px; } .bdHead h1 { margin:0; font-size:26px; flex:1; } .bdHead .ghost { margin:0; padding:8px 16px; font-size:14px; }
#bdNote { font-size:13px; color:#ffe7a8; background:rgba(255,200,80,.1); border:1px solid rgba(255,200,80,.35); border-radius:10px; padding:6px 10px; }
#bdTabs { display:flex; gap:5px; overflow-x:auto; scrollbar-width:none; padding-bottom:2px; flex-shrink:0; } #bdTabs::-webkit-scrollbar { display:none; }
#bdTabs button { flex:0 0 auto; min-width:34px; height:32px; border-radius:16px; border:1px solid rgba(143,220,255,.35); background:rgba(10,24,52,.7); color:#cfe; font:600 13px system-ui, sans-serif; cursor:pointer; padding:0 10px; }
#bdTabs button.on { background:linear-gradient(180deg,#3fb6ff,#1f7fd6); color:#fff; border-color:#8fdcff; }
#bdScope { display:flex; flex-direction:column; align-items:stretch; gap:6px; min-width:0; flex-shrink:0; }
#bdScope .bdScopeTabs { display:flex; gap:6px; min-width:0; width:100%; flex-wrap:wrap; }
#bdScope button { flex:0 0 auto; height:32px; border-radius:16px; border:1px solid rgba(143,220,255,.35); background:rgba(10,24,52,.7); color:#cfe; font:600 13px system-ui, sans-serif; cursor:pointer; padding:0 10px; white-space:nowrap; }
#bdScope button.on { background:linear-gradient(180deg,#3fb6ff,#1f7fd6); color:#fff; border-color:#8fdcff; }
#bdScope .bdN { display:inline-block; margin-left:5px; font-size:11px; font-weight:700; opacity:.72; font-variant-numeric:tabular-nums; }
#bdScope button.on .bdN { opacity:.95; }
#bdScope .bdViewLab { display:flex; align-items:center; gap:6px; font-size:13px; opacity:.85; align-self:flex-end; }
#bdScope select, #bdCountry { font-size:14px; padding:6px 10px; border-radius:16px; border:1px solid rgba(143,220,255,.4); background:rgba(0,0,0,.35); color:#fff; max-width:200px; }
@media (max-width: 560px) {
  #bdScope .bdScopeTabs { flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; -webkit-overflow-scrolling:touch; overscroll-behavior-x:contain; padding-bottom:2px; }
  #bdScope .bdScopeTabs::-webkit-scrollbar { display:none; }
}
#bdSub { font-size:13px; opacity:.75; } #bdMe { font-size:14px; color:#bfe9ff; } #bdMe b { color:#fff; }
#bdList { list-style:none; margin:0; padding:0; overflow-y:auto; flex:1 1 auto; min-height:90px; max-height:46vh; border-radius:12px; background:rgba(0,0,0,.18); }
#bdList li { display:grid; grid-template-columns:34px minmax(0,1fr) auto 56px 34px; gap:8px; align-items:center; padding:6px 10px; font-size:14px; border-bottom:1px solid rgba(143,220,255,.08); }
#bdList li .rk { text-align:center; font-weight:700; opacity:.85; } #bdList li .nm { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:600; } #bdList li .nm .fg { margin-right:2px; }
#bdList li .eth { color:#8fdcff; font-variant-numeric:tabular-nums; } #bdList li .tm, #bdList li .sr { opacity:.75; text-align:right; font-variant-numeric:tabular-nums; } #bdList li .sr { color:#ffd76a; opacity:1; }
#bdList li.me { background:rgba(63,182,255,.18); box-shadow:inset 3px 0 0 #3fb6ff; }
#bdList li.empty { display:block; text-align:center; opacity:.7; padding:18px 10px; }
#bdName { display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-size:14px; flex-shrink:0; }
#bdNameIn { flex:1 1 140px; min-width:0; font-size:16px; padding:8px 12px; border-radius:20px; border:1px solid rgba(143,220,255,.4); background:rgba(0,0,0,.3); color:#fff; }
#bdName .bdCountryLab { opacity:.8; }
#bdCountry { flex:0 1 180px; min-width:120px; }
#bdName .ghost { margin:0; padding:8px 16px; font-size:14px; } #bdNameMsg { font-size:13px; } #bdNameMsg.ok { color:#8fe8a8; } #bdNameMsg.bad { color:#ff9a8a; }
@media (max-height: 500px) {
  #board { padding:calc(6px + env(safe-area-inset-top)) calc(10px + env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) calc(10px + env(safe-area-inset-left)); }
  .boardCard { max-width:760px; padding:8px 14px; gap:5px; display:grid; grid-template-columns:minmax(0,1fr) 250px; grid-template-areas:"head head" "scope scope" "tabs tabs" "list sub" "list me" "list note" "list name"; align-content:start; height:calc(100dvh - 16px); }
  .bdHead { grid-area:head; } .bdHead h1 { font-size:20px; } #bdScope { grid-area:scope; } #bdTabs { grid-area:tabs; } #bdTabs button, #bdScope button { height:28px; min-width:30px; }
  #bdSub { grid-area:sub; } #bdMe { grid-area:me; font-size:13px; } #bdNote { grid-area:note; font-size:12px; } #bdName { grid-area:name; align-self:end; }
  #bdList { grid-area:list; max-height:none; height:100%; min-height:0; } #bdList li { padding:4px 8px; font-size:13px; }
}
@media (max-width: 480px) { #bdList li { grid-template-columns:28px minmax(0,1fr) auto 46px 30px; gap:6px; font-size:13px; padding:6px 8px; } .boardCard { padding:12px; } }
@media (max-height: 500px) { .menuRow { margin-top:6px; gap:6px; flex-wrap:nowrap; } .menuRow .ghost { padding:6px 12px; font-size:13px; white-space:nowrap; min-height:0; } }
@media (max-width: 480px) { .menuRow .ghost { padding:8px 14px; font-size:14px; } }
