/* Space Shooter 3D - stage, HUD and screens. Phone first: 44px+ tap targets, no hover-only UI. */
.stage{position:relative;width:100%;aspect-ratio:9/16;max-height:88vh;max-height:88svh;margin:0 auto;background:#120826;border-radius:12px;overflow:hidden;color:#eaf6ff;
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}
.stage [hidden]{display:none!important}
.stage canvas{position:absolute;top:0;left:0;width:100%;height:100%;display:block;touch-action:none;outline:none}
.stage.big{position:fixed;top:0;left:0;right:0;bottom:0;z-index:2147483000;width:100vw;height:100vh;height:100dvh;max-height:none;aspect-ratio:auto;border-radius:0;margin:0}
html.pip-big,html.pip-big body{overflow:hidden}
.bigrow{max-width:420px;margin:.6rem auto 0;display:flex;gap:.5rem;justify-content:center}
.bigrow .btn{width:auto;min-height:44px;padding:.55rem 1.1rem}

.ibtn{pointer-events:auto;width:44px;height:44px;border-radius:12px;border:1px solid rgba(255,255,255,.35);background:rgba(10,6,30,.55);color:#fff;font:700 15px system-ui;cursor:pointer;touch-action:manipulation}
.fsbtn{position:absolute;top:calc(8px + env(safe-area-inset-top,0px));right:10px;z-index:8;display:none;width:auto;padding:0 12px}
.stage.big:not(.playing) .fsbtn{display:block}

.hud{position:absolute;top:0;left:0;right:0;bottom:0;pointer-events:none;z-index:3}
.hud-top{display:flex;justify-content:space-between;align-items:flex-start;padding:calc(8px + env(safe-area-inset-top,0px)) 10px 0}
.hud-l{min-width:90px}.hud-c{flex:1;text-align:center;font-size:11px;letter-spacing:.08em;text-transform:uppercase;opacity:.85;padding-top:4px}
.hud-r{display:flex;gap:6px}
.score{font:800 22px ui-monospace,Menlo,Consolas,monospace;text-shadow:0 0 8px #59f0ff}
.mult{font:800 14px ui-monospace,monospace;color:#ffd23f;min-height:17px}
.chain{height:3px;width:70px;background:rgba(255,255,255,.15);border-radius:2px;overflow:hidden}.chain i{display:block;height:100%;width:0;background:#ffd23f}
.hud-row{display:flex;gap:12px;align-items:center;padding:6px 12px 0;font-size:12px;font-weight:700}
.pips{letter-spacing:2px;font-size:15px}.pips.hull{color:#59f0ff}.pips.bomb{color:#ffd23f}.wpn{opacity:.9;margin-left:auto}.cred{color:#ffd23f;opacity:.9}
.bossbar{position:absolute;top:calc(92px + env(safe-area-inset-top,0px));left:14px;right:14px}
.bossbar .bn{font:700 11px system-ui;letter-spacing:.1em;text-transform:uppercase;text-align:center;margin-bottom:3px;color:#ffb1d8}
.bossbar .bt{height:8px;border-radius:4px;background:rgba(255,255,255,.15);overflow:hidden;border:1px solid rgba(255,255,255,.25)}
.bossbar .bt i{display:block;height:100%;width:100%;background:linear-gradient(90deg,#ff3d6e,#ffb04d)}
.abtn{position:absolute;bottom:calc(16px + env(safe-area-inset-bottom,0px));width:78px;height:78px;border-radius:50%;pointer-events:auto;overflow:hidden;border:2px solid rgba(255,255,255,.5);
  background:rgba(10,6,30,.55);color:#fff;font:800 12px system-ui;letter-spacing:.06em;cursor:pointer;touch-action:none;display:flex;align-items:center;justify-content:center;flex-direction:column}
.abtn b{position:relative;z-index:1}.abtn em{position:relative;z-index:1;font-style:normal;font-size:16px;color:#ffd23f}
.abtn.spec{left:14px}.abtn.bomb{right:14px;border-color:#ffd23f}
.abtn .fill{position:absolute;left:0;bottom:0;width:100%;height:0;background:rgba(89,240,255,.45)}
.abtn.ready{border-color:#59f0ff;box-shadow:0 0 14px #59f0ff}
.abtn.down{transform:scale(.94);background:rgba(255,255,255,.2)}
.abtn.off{opacity:.4}

.banner{position:absolute;left:0;right:0;top:28%;text-align:center;pointer-events:none;z-index:4;text-shadow:0 0 14px rgba(255,63,174,.9)}
.banner .b1{font:900 30px system-ui;letter-spacing:.12em}.banner .b2{font:600 14px system-ui;opacity:.9;margin-top:4px;letter-spacing:.05em}
.banner.warn .b1{color:#ff4d6d;animation:blink .35s steps(2) infinite}
@keyframes blink{50%{opacity:.25}}
.hint{position:absolute;left:12px;right:12px;bottom:calc(104px + env(safe-area-inset-bottom,0px));text-align:center;background:rgba(6,3,20,.72);border:1px solid rgba(89,240,255,.5);padding:8px 12px;border-radius:12px;font-size:13px;line-height:1.35;pointer-events:none;z-index:4}
.toast{position:absolute;left:12px;right:12px;top:calc(80px + env(safe-area-inset-top,0px));text-align:center;background:rgba(255,210,63,.95);color:#201400;font-weight:800;padding:8px;border-radius:10px;font-size:13px;pointer-events:none;z-index:8}
.flash{position:absolute;top:0;left:0;right:0;bottom:0;pointer-events:none;opacity:0;z-index:6;background:transparent}

.screen{position:absolute;top:0;left:0;right:0;bottom:0;z-index:7;overflow-y:auto;-webkit-overflow-scrolling:touch;display:flex;padding:14px;background:rgba(8,4,24,.8);touch-action:pan-y}
.fatal{position:absolute;top:0;left:0;right:0;bottom:0;z-index:9;display:flex;padding:14px;background:rgba(8,4,24,.92)}
.panel{margin:auto;width:100%;max-width:340px;text-align:center}.panel.wide{max-width:390px}
.panel h2{font:900 22px system-ui;letter-spacing:.08em;text-transform:uppercase;margin:4px 0 6px}.panel h2.win{color:#ffd23f}
.logo{font:900 38px/1.02 system-ui;letter-spacing:.06em;text-shadow:0 0 18px #ff3fae;margin-top:6px}.logo b{color:#59f0ff}
.tag{opacity:.85;font-size:13px;margin:6px 0 10px}.foot{font-size:12px;opacity:.7;margin-top:8px}
.cores{font-weight:800;color:#ffd23f;margin:4px 0 8px;font-size:14px}
.lab{font:700 11px system-ui;letter-spacing:.12em;text-transform:uppercase;opacity:.8;margin:12px 0 6px;text-align:left}
.note{font-size:12.5px;opacity:.85;margin:8px 0;line-height:1.4}.note.warn{color:#ff9a9a}
.btn{display:block;width:100%;min-height:46px;margin:8px 0;padding:10px 14px;border-radius:12px;border:1px solid #5b4bd1;background:#241a5e;color:#eaf6ff;font:700 16px system-ui;cursor:pointer;touch-action:manipulation}
.btn.pri{background:linear-gradient(#ff3fae,#b0208a);border-color:#ff8ad0}.btn.ghost{background:transparent;border-color:rgba(255,255,255,.35)}
.btn.danger{background:#7a1630;border-color:#ff5d7d}.btn.small{display:inline-block;width:auto;margin:0;min-width:74px;min-height:44px;padding:8px 12px;font-size:14px}
.btn[disabled]{opacity:.45;cursor:default}.btn small{display:block;font:500 11px system-ui;opacity:.85}
.btn:active:not([disabled]){transform:scale(.98)}
.row3{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.row3 .btn{font-size:13px;padding:8px 4px}
.chips{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-start}
.chip{min-height:44px;padding:0 14px;border-radius:22px;border:1px solid rgba(255,255,255,.35);background:rgba(255,255,255,.06);color:#eaf6ff;font:700 13px system-ui;cursor:pointer;text-transform:capitalize;touch-action:manipulation}
.chip.on{background:#59f0ff;color:#06203a;border-color:#59f0ff}.chip.lock{opacity:.55}.chip[disabled]{opacity:.4}
.tabs{display:flex;gap:8px;justify-content:center;margin:6px 0 10px}
.secs{display:grid;gap:6px}
.sec{display:grid;grid-template-columns:34px 1fr auto;align-items:center;gap:8px;min-height:52px;padding:6px 10px;border-radius:12px;border:1px solid rgba(255,255,255,.3);background:rgba(255,255,255,.05);color:#eaf6ff;text-align:left;cursor:pointer;touch-action:manipulation;font:600 14px system-ui}
.sec b{font-size:20px;color:#59f0ff}.sec i{font-style:normal;font-size:11px;opacity:.7}.sec.on{border-color:#ff3fae;background:rgba(255,63,174,.18)}.sec.lock{opacity:.5}
.card{background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.18);border-radius:12px;padding:10px 12px;margin:8px 0;text-align:left}
.card.sel{border-color:#59f0ff}.card.done{border-color:#ffd23f}.card .cn{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:15px}
.card p{font-size:12.5px;opacity:.85;margin:4px 0 6px;line-height:1.35}.card .st{font-size:11.5px;opacity:.75;margin-bottom:6px}
.card .btn{margin:4px 0 0}.dot{display:inline-block;width:12px;height:12px;border-radius:50%;margin-right:8px}
.tagon{display:inline-block;font-size:12px;font-weight:800;color:#59f0ff;padding:6px 0}.lockt{display:inline-block;font-size:12px;opacity:.7;padding:6px 0}
.pp{display:inline-flex;gap:4px}.pp i{width:12px;height:12px;border-radius:3px;background:rgba(255,255,255,.2)}.pp i.on{background:#ffd23f}
.bar{height:8px;background:rgba(255,255,255,.15);border-radius:4px;overflow:hidden;margin:6px 0 4px}.bar i{display:block;height:100%;background:linear-gradient(90deg,#59f0ff,#ff3fae)}
.setrow{display:flex;justify-content:space-between;align-items:center;gap:10px;min-height:48px;border-bottom:1px solid rgba(255,255,255,.12);font-size:15px}
.rows{text-align:left;margin:6px 0}.rows div{display:flex;justify-content:space-between;padding:6px 2px;border-bottom:1px solid rgba(255,255,255,.1);font-size:14px}.rows .gold{color:#ffd23f}
.bigscore{font:900 38px ui-monospace,monospace;color:#59f0ff;text-shadow:0 0 14px #59f0ff;margin:4px 0}.newbest{color:#ffd23f;font-weight:900;letter-spacing:.1em}
.shoprow{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:5px 0;border-bottom:1px solid rgba(255,255,255,.1);font-size:14px;text-align:left}

@media (max-height:560px){.logo{font-size:30px}.btn{min-height:44px;margin:5px 0}.abtn{width:68px;height:68px}}
@media (prefers-reduced-motion:reduce){.banner.warn .b1{animation:none}}

.best{font:700 11px ui-monospace,monospace;color:#9fc4e8;min-height:14px;letter-spacing:.04em}.best.beat{color:#ffd23f}
.lowhull{position:absolute;top:0;left:0;right:0;bottom:0;pointer-events:none;z-index:5;opacity:0;transition:opacity .25s;box-shadow:inset 0 0 70px 14px rgba(255,45,85,.55)}
.lowhull.on{opacity:1;animation:lowPulse 1.1s ease-in-out infinite}
@keyframes lowPulse{0%,100%{opacity:.35}50%{opacity:1}}
@media (prefers-reduced-motion:reduce){.lowhull.on{animation:none;opacity:.6}}

/* Shell full screen (native and immersive): the stage fills the area under the dock. The game's own Play big is retired. */
.bigrow,#b-fs,.fsbtn,.stage.big .fsbtn{display:none!important}
.stage::after{content:"";position:absolute;inset:0;pointer-events:none;z-index:2;background:radial-gradient(ellipse at 50% 45%,rgba(0,0,0,0) 55%,rgba(8,2,24,.45) 100%)}
html.pip-immersive .game-wrap{display:flex;flex-direction:column;overflow:hidden}
html.pip-immersive .game-wrap>.stage{flex:1 1 0;min-height:0;width:100%;height:auto;max-height:none;aspect-ratio:auto;border-radius:0;margin:0}
html.pip-immersive .abtn{bottom:16px}
html.pip-immersive .hud-top{padding-top:8px}
html.pip-immersive .abtn{width:84px;height:84px}
@media (orientation:landscape) and (max-height:480px){
  html.pip-immersive .abtn{width:72px;height:72px;bottom:10px}
  html.pip-immersive .abtn.spec{left:10px}html.pip-immersive .abtn.bomb{right:10px}
}
.stage:fullscreen{width:100%;height:100%;max-height:none;aspect-ratio:auto;border-radius:0}

/* Full screen menus: action row stays pinned at the bottom of the scrolling screen; landscape uses two columns. */
html.pip-immersive .actrow,html.pip-native .actrow{position:sticky;bottom:-14px;z-index:2;display:flex;gap:8px;margin:8px -4px 0;padding:8px 4px calc(8px + env(safe-area-inset-bottom,0px));background:linear-gradient(rgba(8,4,24,0),rgba(8,4,24,.96) 28%)}
html.pip-immersive .actrow .btn,html.pip-native .actrow .btn{flex:1 1 0;margin:0;min-width:0}
html.pip-immersive .tabs,html.pip-native .tabs{position:sticky;top:-14px;z-index:2;padding:6px 0;margin:0 0 6px;background:rgba(8,4,24,.96)}
@media (orientation:landscape) and (max-height:480px){
  html.pip-immersive .screen,html.pip-native .screen{padding:8px calc(10px + env(safe-area-inset-right,0px)) 8px calc(10px + env(safe-area-inset-left,0px))}
  html.pip-immersive .actrow,html.pip-native .actrow{bottom:-8px}
  html.pip-immersive .tabs,html.pip-native .tabs{top:-8px}
  html.pip-immersive .panel,html.pip-native .panel{max-width:520px}
  html.pip-immersive .panel.wide,html.pip-native .panel.wide{max-width:720px;display:grid;grid-template-columns:1fr 1fr;column-gap:12px;align-content:start}
  html.pip-immersive .panel.wide>*,html.pip-native .panel.wide>*{grid-column:1/-1;min-width:0}
  html.pip-immersive .panel.wide>.card,html.pip-native .panel.wide>.card{grid-column:auto;margin:4px 0}
  html.pip-immersive .panel h2,html.pip-native .panel h2{font-size:18px;margin:0 0 2px}
  html.pip-immersive .logo,html.pip-native .logo{font-size:26px;margin-top:0}
  html.pip-immersive .tag,html.pip-native .tag{margin:2px 0 4px}
  html.pip-immersive .panel .btn,html.pip-native .panel .btn{margin:4px 0}
  html.pip-immersive .actrow .btn,html.pip-native .actrow .btn{margin:0}
  html.pip-immersive .bigscore,html.pip-native .bigscore{font-size:28px;margin:0}
}
