/* Hoverboard Rush 3D - stage and in-game UI. Everything is scoped under #stage so site styles never leak in. */
html.pip-big, html.pip-big body { overflow: hidden; }
#stage { --pink:#ff3fa4; --cyan:#35e0ff; --vio:#7c3aed; --gold:#ffd23f; --ink:#e9e4ff; --bg:#150c36;
  position: relative; width: min(100%, calc(78vh * 0.5625)); width: min(100%, calc(78svh * 0.5625)); aspect-ratio: 9 / 16; margin: 0 auto; overflow: hidden;
  border-radius: 14px; background: linear-gradient(#1b0f45, #2a1768); color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", Verdana, system-ui, sans-serif; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; line-height: 1.25; }
#stage.is-big { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; aspect-ratio: auto; border-radius: 0; z-index: 99999; }
#stage *, #stage *::before, #stage *::after { box-sizing: border-box; }
#stage #app { position: absolute; inset: 0; touch-action: none; }
#stage #app canvas { display: block; width: 100%; height: 100%; }
#stage #ui { position: absolute; inset: 0; pointer-events: none; }
#stage #screen-host { position: absolute; inset: 0; pointer-events: none; }
#stage #screen-host[hidden], #stage .hud[hidden], #stage .hint[hidden], #stage .toast[hidden], #stage .count[hidden], #stage .ctl[hidden], #stage .mult[hidden], #stage .prog[hidden], #stage .hp[hidden] { display: none; }
#stage button { font-family: inherit; cursor: pointer; touch-action: manipulation; }
#stage button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

#stage #loader { position: absolute; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: linear-gradient(#1b0f45, #3a1a7a); pointer-events: auto; }
#stage #loader[hidden] { display: none; }
#stage .load-in { display: flex; flex-direction: column; align-items: center; gap: 10px; color: #fff; text-align: center; padding: 0 18px; }
#stage .load-in b { font-size: clamp(20px, 6vw, 30px); letter-spacing: 3px; text-shadow: 0 0 14px var(--pink); }
#stage .load-in span { font-size: 14px; opacity: .9; }
#stage .spinner { width: 42px; height: 42px; border-radius: 50%; border: 6px solid rgba(255,255,255,.25); border-top-color: var(--cyan); animation: hrspin .8s linear infinite; }
@keyframes hrspin { to { transform: rotate(360deg); } }
#stage #ctxlost { position: absolute; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; background: rgba(15,8,40,.9); color: #fff; font-weight: 700; pointer-events: auto; }
#stage #ctxlost[hidden] { display: none; }

/* inside the site's own game shell keep the 9:16 stage fitting the viewport; wide full screen caps the panels */
.game-wrap.pip-stage #stage { width: min(100%, calc((100vh - 64px) * 0.5625)); width: min(100%, calc((100svh - 64px) * 0.5625)); }
#stage.is-big .screen .panel { max-width: 460px; margin: 0 auto; }

/* HUD */
#stage .hud { position: absolute; inset: 0; pointer-events: none; padding: max(8px, env(safe-area-inset-top)) 10px 8px; }
#stage .hud-top { display: flex; gap: 6px; padding-right: 54px; }
#stage .stat { flex: 1.3 1 0; background: rgba(10,6,34,.62); border: 1px solid rgba(53,224,255,.35); border-radius: 12px; padding: 4px 7px; display: flex; flex-direction: column; min-width: 0; min-height: 40px; }
#stage .stat:last-child { flex: .8 1 0; }
#stage .stat .lbl { font-size: 9px; letter-spacing: 1.5px; opacity: .7; }
#stage .stat b { font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
#stage .pausebtn { position: absolute; top: max(8px, env(safe-area-inset-top)); right: 10px; width: 46px; height: 46px; border-radius: 12px; border: 1px solid rgba(255,255,255,.4); background: rgba(10,6,34,.7); color: #fff; font-weight: 800; font-size: 16px; pointer-events: auto; }
#stage .prog { position: absolute; left: 10px; right: 10px; top: calc(max(8px, env(safe-area-inset-top)) + 50px); height: 6px; border-radius: 4px; background: rgba(255,255,255,.18); overflow: hidden; }
#stage .prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--pink)); }
#stage .hp { position: absolute; left: 12px; top: calc(max(8px, env(safe-area-inset-top)) + 52px); display: flex; gap: 5px; }
#stage .hp i { width: 16px; height: 16px; border-radius: 4px; background: rgba(255,255,255,.2); transform: rotate(45deg); }
#stage .hp i.on { background: var(--pink); box-shadow: 0 0 8px var(--pink); }
#stage .mult { position: absolute; left: 12px; top: calc(max(8px, env(safe-area-inset-top)) + 76px); background: var(--gold); color: #3b2a00; font-weight: 800; border-radius: 8px; padding: 1px 8px; font-size: 14px; }
#stage .meter { position: absolute; left: 12px; right: 112px; bottom: 22px; height: 14px; border-radius: 8px; background: rgba(10,6,34,.65); border: 1px solid rgba(255,255,255,.3); overflow: hidden; }
#stage .meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #4dffb0, var(--cyan)); }
#stage .meter span { position: absolute; inset: 0; font-size: 9px; letter-spacing: 2px; text-align: center; line-height: 14px; color: #fff; text-shadow: 0 1px 2px #000; }
#stage .ctl { position: absolute; pointer-events: auto; border: 2px solid rgba(255,255,255,.55); background: rgba(10,6,34,.55); color: #fff; font-weight: 800; letter-spacing: 1px; border-radius: 50%; touch-action: none; user-select: none; }
#stage .ctl.on, #stage .ctl.active { background: var(--pink); }
#stage .ctl.boost { right: 10px; bottom: 10px; width: 92px; height: 92px; font-size: 14px; border-color: var(--cyan); }
#stage .ctl.boost.ready { box-shadow: 0 0 16px var(--cyan); }
#stage .ctl.jump { right: 24px; bottom: 110px; width: 72px; height: 72px; font-size: 13px; }
#stage .ctl.left { left: 8px; bottom: 56px; width: 60px; height: 60px; font-size: 20px; }
#stage .ctl.right { left: 76px; bottom: 56px; width: 60px; height: 60px; font-size: 20px; }
#stage .hint { position: absolute; left: 14px; right: 14px; top: 34%; text-align: center; background: rgba(10,6,34,.82); border: 1px solid var(--cyan); border-radius: 12px; padding: 10px 12px; font-weight: 700; font-size: 15px; }
#stage .toast { position: absolute; left: 20px; right: 20px; top: 22%; text-align: center; font-weight: 800; font-size: 15px; text-shadow: 0 2px 6px #000; }
#stage .count { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: clamp(60px, 22vw, 110px); font-weight: 900; color: #fff; text-shadow: 0 0 24px var(--pink), 0 4px 0 rgba(0,0,0,.5); }
#stage .flash { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
#stage .flash.hit { background: rgba(255,40,90,.4); animation: hrflash .26s ease-out; }
#stage .flash.boost { background: rgba(53,224,255,.25); animation: hrflash .26s ease-out; }
@keyframes hrflash { from { opacity: 1; } to { opacity: 0; } }

/* screens */
#stage .screen { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; background: linear-gradient(rgba(12,6,34,.55), rgba(12,6,34,.82)); }
#stage .screen.dim { background: rgba(8,4,26,.7); }
#stage .panel { pointer-events: auto; width: 100%; max-height: 100%; padding: max(14px, env(safe-area-inset-top)) 16px 16px; display: flex; flex-direction: column; gap: 10px; }
#stage .panel.scroll { overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
#stage .panel h3 { font-size: 22px; text-align: center; letter-spacing: 1px; }
#stage .home .panel { justify-content: center; min-height: 100%; }
#stage .logo { text-align: center; font-size: clamp(30px, 10vw, 46px); line-height: 1; letter-spacing: 3px; color: #fff; text-shadow: 0 0 18px var(--pink), 0 3px 0 rgba(0,0,0,.4); }
#stage .logo em { font-style: normal; color: var(--cyan); text-shadow: 0 0 18px var(--cyan); }
#stage .sub { text-align: center; font-size: 13px; opacity: .85; }
#stage .note { font-size: 12.5px; opacity: .85; text-align: center; }
#stage .note.warn { color: #ffb4b4; } #stage .note.ok { color: #8dffcf; }
#stage .goal { text-align: center; font-weight: 700; color: var(--gold); font-size: 14px; }
#stage .rankrow { display: flex; align-items: center; gap: 8px; font-size: 13px; }
#stage .bar { flex: 1; height: 8px; background: rgba(255,255,255,.18); border-radius: 5px; overflow: hidden; }
#stage .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--pink)); }
#stage .b { min-height: 48px; padding: 8px 14px; border-radius: 12px; border: 2px solid rgba(255,255,255,.28); background: rgba(40,22,96,.9); color: #fff; font-weight: 800; font-size: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; text-align: center; }
#stage .b small { font-size: 11px; font-weight: 600; opacity: .8; }
#stage .b.primary { background: linear-gradient(90deg, var(--vio), var(--pink)); border-color: #fff; font-size: 18px; }
#stage .b.dis { opacity: .5; }
#stage .b.go { border-color: var(--gold); }
#stage .b.on { background: var(--cyan); color: #06223a; }
#stage .b.sm { min-height: 44px; min-width: 44px; font-size: 14px; padding: 6px 12px; }
#stage .b.danger { border-color: #ff6b81; }
#stage .lk { font-size: 11px; font-weight: 600; opacity: .8; }
#stage .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#stage .head { display: flex; align-items: center; gap: 10px; }
#stage .head h3 { flex: 1; text-align: left; }
#stage .cr { font-weight: 800; color: var(--gold); }
#stage .dist { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--cyan); margin-top: 4px; }
#stage .dist small { font-weight: 600; opacity: .8; text-transform: none; letter-spacing: 0; }
#stage .card { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 8px 12px; border-radius: 12px; border: 2px solid rgba(255,255,255,.25); background: rgba(40,22,96,.9); color: #fff; text-align: left; }
#stage .card.locked { opacity: .45; }
#stage .card .num { width: 32px; height: 32px; border-radius: 50%; background: var(--vio); display: flex; align-items: center; justify-content: center; flex: none; }
#stage .card .nm { flex: 1; font-weight: 800; display: flex; flex-direction: column; min-width: 0; }
#stage .card .nm small { font-size: 11px; opacity: .7; font-weight: 600; }
#stage .card .meta { font-size: 12px; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
#stage .stars { color: var(--gold); font-size: 18px; letter-spacing: 2px; }
#stage .big { text-align: center; font-size: 30px; } #stage .big .stars { font-size: 36px; }
#stage .medal { font-weight: 800; font-size: 11px; text-transform: uppercase; padding: 1px 7px; border-radius: 8px; color: #1a1030; }
#stage .medal.gold { background: #ffd23f; } #stage .medal.silver { background: #d5dbe8; } #stage .medal.bronze { background: #e0996a; } #stage .medal.none { background: rgba(255,255,255,.2); color: #fff; }
#stage .tabs, #stage .seg { display: flex; gap: 6px; } #stage .tabs .b, #stage .seg .b { flex: 1; }
#stage .row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(40,22,96,.8); border: 1px solid rgba(255,255,255,.18); }
#stage .row.dim { opacity: .5; }
#stage .row .rt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
#stage .row small { font-size: 11px; opacity: .8; }
#stage .sw { width: 28px; height: 28px; border-radius: 8px; flex: none; }
#stage .eq { font-weight: 800; color: #8dffcf; font-size: 13px; }
#stage .pips { display: flex; gap: 4px; } #stage .pips i { width: 14px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.2); } #stage .pips i.on { background: var(--cyan); }
#stage .setrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; } #stage .setrow > span:first-child { font-weight: 700; }
#stage .stats { display: flex; justify-content: space-around; } #stage .stats div { display: flex; flex-direction: column; align-items: center; } #stage .stats b { font-size: 20px; } #stage .stats small { opacity: .7; font-size: 11px; }
#stage .reward { display: flex; flex-direction: column; align-items: center; background: rgba(255,210,63,.14); border: 1px solid var(--gold); border-radius: 12px; padding: 8px; } #stage .reward b { color: var(--gold); font-size: 20px; } #stage .reward span { font-size: 12px; }

.hr-bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: .75rem 0 .25rem; }
.hr-bar .btn { min-height: 44px; min-width: 44px; }
.hr-keys { text-align: center; font-size: .8rem; color: #64748b; margin: .25rem 0 0; }
.hr-guide { max-width: 640px; margin: 1.5rem auto; padding: 0 1rem; line-height: 1.6; }
.hr-guide h2 { font-size: 1.25rem; margin-bottom: .5rem; }
.hr-guide h3 { font-size: 1rem; margin: 1rem 0 .25rem; }
.hr-guide p { margin-bottom: .5rem; font-size: .95rem; }
@media (prefers-reduced-motion: reduce) { #stage .flash { animation: none !important; } #stage .spinner { animation-duration: 2s; } }
#stage .cmp { text-align: center; font-weight: 700; font-size: 14px; opacity: .9; } #stage .cmp.up { color: var(--gold); }
#stage .card.next { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
#stage .pop .stars { display: inline-block; animation: hrpop .6s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes hrpop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #stage .pop .stars { animation: none; } }

/* Full screen (shell native + immersive): the stage fills the area under the dock, no extra chrome. */
html.pip-immersive .game-wrap.pip-stage { display: flex; flex-direction: column; padding: 0; margin: 0; }
html.pip-immersive .game-wrap.pip-stage #stage { flex: 1 1 auto; min-height: 0; width: 100%; max-width: none; height: auto; aspect-ratio: auto; border-radius: 0; margin: 0; }
html.pip-immersive .hr-bar, html.pip-immersive .hr-keys, html.pip-immersive .hub-bar, html.pip-immersive .playyard-ad, html.pip-immersive .below-content { display: none; }
html.pip-immersive #stage .screen .panel { max-width: 460px; margin: 0 auto; }
@media (orientation: landscape) and (max-height: 500px) {
  html.pip-immersive #stage .screen .panel { max-height: 100%; overflow-y: auto; }
}
