/* Hockey Shootout 3D - stage + in-game UI. Everything is scoped under #stage so site styles never leak in. */
html.pip-big, html.pip-big body { overflow: hidden; }
#stage { --blue:#1f7ae0; --blue-d:#14529c; --ice:#eaf6ff; --gold:#ffc21a; --red:#e0452e; --green:#2fc46a; --ink:#14304f;
  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: #0e1a2e; 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; }
.game-wrap.pip-stage #stage { width: 100%; height: 100%; max-width: none; aspect-ratio: auto; border-radius: 0; }
#stage *, #stage *::before, #stage *::after { box-sizing: border-box; }
#stage #app { position: absolute; inset: 0; }
#stage #app canvas { display: block; width: 100%; height: 100%; }
#stage #ui { position: absolute; inset: 0; pointer-events: none; }
#stage #ui button, #stage #ui .panel, #stage #ui input { pointer-events: auto; }
#stage button { font-family: inherit; cursor: pointer; touch-action: manipulation; }
#stage button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
#stage [hidden] { display: none !important; }
#stage .bigx { display: none; }
#stage.is-big .bigx { display: block; position: absolute; left: 8px; top: max(8px, env(safe-area-inset-top)); z-index: 30; min-width: 54px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 12px; background: rgba(10,24,48,.72); color: #fff; font-weight: 800; font-size: 14px; }

#stage #loader { position: absolute; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: linear-gradient(#0e1a2e, #1f4f86); }
#stage .load-in { display: flex; flex-direction: column; align-items: center; gap: 10px; color: #fff; text-align: center; padding: 0 22px; font-weight: 700; }
#stage .load-in b { font-size: clamp(20px, 6vw, 30px); letter-spacing: 2px; }
#stage .load-in span { font-size: 14px; opacity: .95; }
#stage .spinner { width: 42px; height: 42px; border-radius: 50%; border: 6px solid rgba(255,255,255,.3); border-top-color: var(--gold); animation: hsspin .8s linear infinite; }
@keyframes hsspin { 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(14,26,46,.88); color: #fff; font-weight: 700; }

/* HUD */
#stage .hud { position: absolute; inset: 0; padding: max(8px, env(safe-area-inset-top)) 10px 8px; pointer-events: none; }
#stage .hud-top { display: flex; justify-content: center; align-items: flex-start; padding-right: 54px; }
#stage .scorebox { display: flex; align-items: center; gap: 8px; background: rgba(10,24,48,.72); color: #fff; border-radius: 14px; padding: 5px 12px; font-weight: 800; }
#stage .sb-team { font-size: 11px; letter-spacing: 1px; opacity: .85; max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#stage .sb-team.away { color: #ffb3a6; }
#stage .sb-score { font-size: 20px; font-variant-numeric: tabular-nums; white-space: nowrap; }
#stage .clock { position: absolute; left: 50%; top: 46px; transform: translateX(-50%); color: #fff; font-weight: 800; font-size: 18px; text-shadow: 0 2px 0 rgba(0,0,0,.45); font-variant-numeric: tabular-nums; }
#stage .hud-sub { position: absolute; left: 10px; right: 64px; top: 70px; text-align: center; color: #dff0ff; font-size: 12px; font-weight: 700; text-shadow: 0 1px 0 rgba(0,0,0,.5); }
#stage .pausebtn { position: absolute; top: max(8px, env(safe-area-inset-top)); right: 8px; width: 46px; height: 46px; border-radius: 13px; border: 0; background: rgba(10,24,48,.72); color: #fff; font-weight: 800; font-size: 16px; letter-spacing: 1px; pointer-events: auto; }
#stage .banner { position: absolute; left: 0; right: 0; top: 30%; text-align: center; font-weight: 900; font-size: clamp(30px, 11vw, 54px); color: #fff; letter-spacing: 2px; text-shadow: 0 4px 0 rgba(10,24,48,.65); animation: hspop .45s ease-out; pointer-events: none; }
#stage .banner.goal { color: var(--gold); } #stage .banner.bad { color: #ff8a7a; } #stage .banner.save { color: #8fe3ff; } #stage .banner.info { font-size: clamp(22px, 7vw, 34px); }
@keyframes hspop { 0% { transform: scale(1.7); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
#stage .hint-bubble { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); width: 84%; background: rgba(255,255,255,.96); color: var(--ink); font-weight: 800; font-size: 14px; text-align: center; padding: 10px 14px; border-radius: 16px; box-shadow: 0 4px 0 rgba(10,24,48,.35); pointer-events: none; }
#stage .stick-base { position: absolute; left: 0; top: 0; width: 100px; height: 100px; border-radius: 50%; border: 3px solid rgba(255,255,255,.55); background: rgba(255,255,255,.14); pointer-events: none; }
#stage .stick-knob { position: absolute; left: 30px; top: 30px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.8); }
#stage .pad { position: absolute; bottom: max(14px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
#stage .pad.right { right: 12px; } #stage .pad.left { left: 12px; }
#stage .padbtn { width: 68px; height: 68px; border-radius: 50%; border: 0; background: var(--gold); color: #3a2a00; font-weight: 900; font-size: 13px; letter-spacing: .5px; box-shadow: 0 5px 0 rgba(10,24,48,.45); pointer-events: auto; }
#stage .padbtn.alt { background: #8fe3ff; color: #07304a; } #stage .padbtn.alt2 { background: #ff9d8a; color: #4a1208; } #stage .padbtn.off { opacity: .55; }
#stage .padbtn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(10,24,48,.45); }
#stage .flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
#stage .flash.on { animation: hsflash .4s ease-out forwards; }
@keyframes hsflash { 0% { opacity: 1; } 100% { opacity: 0; } }

/* Screens */
#stage .screen { position: absolute; inset: 0; z-index: 20; display: flex; align-items: stretch; justify-content: center; background: linear-gradient(rgba(10,24,48,.45), rgba(10,24,48,.8)); pointer-events: auto; }
#stage .panel { width: 100%; max-height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; padding: max(12px, env(safe-area-inset-top)) 14px 16px; color: #fff; }
#stage .logo { text-align: center; margin: 4px 0 8px; line-height: 1; }
#stage .logo b { display: block; font-size: clamp(34px, 12vw, 54px); letter-spacing: 4px; color: #fff; text-shadow: 0 4px 0 var(--blue-d); }
#stage .logo span { display: block; font-size: clamp(16px, 5.4vw, 24px); letter-spacing: 6px; color: var(--gold); font-weight: 800; margin-top: 2px; }
#stage .phead { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
#stage .phead h2 { font-size: 22px; flex: 1; text-align: center; padding-right: 64px; }
#stage .back { min-width: 64px; min-height: 44px; border: 0; border-radius: 12px; background: rgba(255,255,255,.2); color: #fff; font-weight: 800; font-size: 14px; }
#stage h3 { margin: 14px 0 6px; font-size: 15px; color: var(--gold); }
#stage .lead { font-size: 13px; color: #d6e8fb; margin: 2px 0 10px; text-align: center; }
#stage .chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 6px; }
#stage .chip { background: rgba(255,255,255,.16); border-radius: 99px; padding: 4px 11px; font-size: 13px; font-weight: 800; }
#stage .chip.coin { color: var(--gold); } #stage .chip.star { color: #ffe27a; } #stage .chip.rank { color: #8fe3ff; }
#stage .xprow { margin: 0 10px 10px; text-align: center; } #stage .xprow small { font-size: 11px; color: #cfe3f7; }
#stage .xpbar { height: 8px; background: rgba(255,255,255,.2); border-radius: 5px; overflow: hidden; margin-top: 3px; }
#stage .xpbar i { display: block; height: 100%; background: linear-gradient(90deg, #5ad0ff, var(--gold)); }
#stage .cards { display: flex; flex-direction: column; gap: 8px; }
#stage .card { position: relative; text-align: left; border: 0; border-radius: 16px; padding: 11px 14px; min-height: 58px; background: #fff; color: var(--ink); box-shadow: 0 4px 0 rgba(10,24,48,.4); display: flex; flex-direction: column; gap: 2px; }
#stage .card b { font-size: 17px; } #stage .card span { font-size: 12px; color: #4a6785; }
#stage .card em { position: absolute; right: 12px; top: 12px; font-style: normal; font-size: 11px; font-weight: 800; color: var(--blue); background: #e3f0ff; border-radius: 99px; padding: 2px 8px; }
#stage .card.locked { background: #aebccd; box-shadow: none; } #stage .card.locked em { color: #55687d; background: #d4dde8; }
#stage .nav { display: flex; gap: 8px; margin-top: 12px; } #stage .nav.col { flex-direction: column; }
#stage .btn2 { flex: 1; min-height: 46px; border: 0; border-radius: 13px; background: rgba(255,255,255,.2); color: #fff; font-weight: 800; font-size: 15px; padding: 0 12px; }
#stage .big { width: 100%; min-height: 54px; border: 0; border-radius: 16px; background: var(--gold); color: #3a2a00; font-weight: 900; font-size: 18px; box-shadow: 0 5px 0 rgba(10,24,48,.45); padding: 0 14px; margin-top: 6px; }
#stage .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#stage .lvl { border: 0; border-radius: 14px; min-height: 62px; padding: 8px 10px; background: #fff; color: var(--ink); text-align: left; display: flex; flex-direction: column; box-shadow: 0 4px 0 rgba(10,24,48,.4); }
#stage .lvl b { font-size: 15px; } #stage .lvl span { font-size: 12px; color: #4a6785; }
#stage .lvl.done { background: #d8f5e2; } #stage .lvl.locked { background: #aebccd; box-shadow: none; opacity: .75; }
#stage .rows { display: flex; flex-direction: column; gap: 7px; }
#stage .row { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.14); border-radius: 14px; padding: 9px 12px; min-height: 52px; color: #fff; text-align: left; border: 0; width: 100%; }
#stage button.row { background: #fff; color: var(--ink); box-shadow: 0 4px 0 rgba(10,24,48,.4); } #stage button.row.locked { background: #aebccd; box-shadow: none; opacity: .8; }
#stage .row.small { min-height: 0; padding: 6px 12px; font-size: 13px; } #stage .row.col { flex-direction: column; align-items: stretch; }
#stage .row.done { background: rgba(47,196,106,.28); }
#stage .rl { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; } #stage .rl b { font-size: 15px; } #stage .rl span { font-size: 12px; opacity: .85; }
#stage .rr { font-weight: 900; color: #e0a800; font-size: 17px; letter-spacing: 1px; }
#stage .pips { display: flex; gap: 4px; margin-top: 3px; } #stage .pips i { width: 20px; height: 7px; border-radius: 4px; background: rgba(255,255,255,.25); } #stage .pips i.on { background: var(--gold); }
#stage .buy { min-width: 74px; min-height: 44px; border: 0; border-radius: 12px; background: var(--gold); color: #3a2a00; font-weight: 900; font-size: 14px; box-shadow: 0 3px 0 rgba(10,24,48,.4); } #stage .buy.off { background: #8d9bad; color: #e9eef5; }
#stage .tabs { display: flex; gap: 6px; margin: 8px 0; } #stage .tab { flex: 1; min-height: 44px; border: 0; border-radius: 12px; background: rgba(255,255,255,.16); color: #fff; font-weight: 800; } #stage .tab.on { background: #fff; color: var(--ink); }
#stage .looks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#stage .look { border: 0; border-radius: 14px; min-height: 66px; padding: 8px 10px 8px 46px; position: relative; text-align: left; background: #fff; color: var(--ink); display: flex; flex-direction: column; justify-content: center; box-shadow: 0 4px 0 rgba(10,24,48,.4); }
#stage .look b { font-size: 14px; } #stage .look span { font-size: 11px; color: #4a6785; } #stage .look.on { outline: 3px solid var(--gold); } #stage .look.locked { opacity: .65; }
#stage .look .sw { position: absolute; left: 10px; top: 50%; width: 26px; height: 26px; margin-top: -13px; border-radius: 50%; border: 2px solid rgba(0,0,0,.25); }
#stage .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; } #stage .stat { background: rgba(255,255,255,.14); border-radius: 12px; padding: 8px 4px; text-align: center; } #stage .stat b { display: block; font-size: 18px; } #stage .stat span { font-size: 11px; opacity: .85; }
#stage .tog { min-width: 70px; min-height: 44px; border: 0; border-radius: 12px; background: #8d9bad; color: #fff; font-weight: 900; } #stage .tog.on { background: var(--green); }
#stage .seg { display: flex; gap: 6px; margin-top: 6px; } #stage .segb { flex: 1; min-height: 44px; border: 0; border-radius: 12px; background: rgba(255,255,255,.16); color: #fff; font-weight: 800; font-size: 13px; } #stage .segb.on { background: #fff; color: var(--ink); }
#stage .danger { width: 100%; min-height: 48px; margin-top: 14px; border: 0; border-radius: 13px; background: #c0392b; color: #fff; font-weight: 800; }
#stage .tiny { font-size: 11px; opacity: .7; text-align: center; margin-top: 8px; }
#stage .rhead { text-align: center; font-size: clamp(28px, 9vw, 40px); font-weight: 900; margin: 8px 0 2px; text-shadow: 0 3px 0 rgba(0,0,0,.4); } #stage .rhead.win { color: var(--gold); } #stage .rhead.lose { color: #ff9d8a; }
#stage .bigscore { text-align: center; font-size: clamp(34px, 12vw, 52px); font-weight: 900; margin: 2px 0 8px; font-variant-numeric: tabular-nums; }
#stage .rewards { display: flex; gap: 8px; justify-content: center; margin: 10px 0 6px; }
#stage .note { background: rgba(255,255,255,.16); border-radius: 10px; padding: 6px 10px; margin: 5px 0; font-size: 13px; font-weight: 700; text-align: center; }
#stage .goal { margin: 10px 0 2px; text-align: center; font-weight: 800; color: #ffe27a; font-size: 14px; }
#stage .daily { background: rgba(255,255,255,.14); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 4px; text-align: center; margin-bottom: 8px; } #stage .daily b { font-size: 18px; }
#stage .s-results .panel { position: relative; overflow-x: hidden; }
#stage .s-results .rhead { animation: hspop .45s cubic-bezier(.2,1.4,.4,1) both; } #stage .s-results .rhead.win { text-shadow: 0 3px 0 rgba(0,0,0,.4), 0 0 22px rgba(255,213,74,.55); }
#stage .s-results .bigscore { animation: hspop .4s .12s cubic-bezier(.2,1.3,.4,1) both; }
#stage .s-results .row, #stage .s-results .note, #stage .s-results .goal { animation: hsrise .35s ease-out both; } #stage .s-results .row:nth-child(2) { animation-delay: .08s; } #stage .s-results .row:nth-child(3) { animation-delay: .16s; } #stage .s-results .row:nth-child(n+4) { animation-delay: .24s; } #stage .s-results .note { animation-delay: .3s; } #stage .s-results .goal { animation-delay: .4s; }
#stage .s-results .nav .big { animation: hspulse 1.8s 1s ease-in-out 3; }
@keyframes hsrise { 0% { transform: translateY(10px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes hspulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes hsfall { 0% { transform: translateY(-14px) rotate(0); opacity: 1; } 100% { transform: translateY(420px) rotate(540deg); opacity: 0; } }
#stage .confetti { position: absolute; left: 0; right: 0; top: 0; height: 0; pointer-events: none; z-index: 2; } #stage .confetti i { position: absolute; top: 0; width: 8px; height: 12px; border-radius: 2px; animation: hsfall 1.9s ease-in both; }
@media (prefers-reduced-motion: reduce) { #stage * { animation: none !important; transition: none !important; } }

/* page chrome under the game */
.hs-bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: .75rem 0 .25rem; }
.hs-bar .btn { min-height: 44px; min-width: 44px; }
.hs-keys { text-align: center; font-size: .8rem; color: #64748b; margin: .25rem 0 0; }
.hs-guide { max-width: 640px; margin: 1.5rem auto; padding: 0 1rem; line-height: 1.6; }
.hs-guide h2 { font-size: 1.25rem; margin-bottom: .5rem; }
.hs-guide h3 { font-size: 1rem; margin: 1rem 0 .25rem; }
.hs-guide p { margin-bottom: .5rem; font-size: .95rem; }

/* ---- wave 3: full screen fit (native + immersive), landscape, finish ---- */
html.pip-immersive .game-wrap.pip-stage,
.game-wrap:fullscreen,
.game-wrap:-webkit-full-screen { display: flex; flex-direction: column; background: #0a1424; }
.game-wrap:fullscreen,
.game-wrap:-webkit-full-screen { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); overflow: hidden; }
html.pip-immersive .game-wrap.pip-stage { overflow: hidden; }
html.pip-immersive .hs-bar, html.pip-immersive .hs-keys, html.pip-immersive .hs-guide, html.pip-immersive .ad-well, html.pip-immersive .game-header,
html.pip-native .hs-bar, html.pip-native .hs-keys, html.pip-native .hs-guide, html.pip-native .game-header { display: none !important; }
html.pip-immersive .game-wrap.pip-stage #stage,
.game-wrap:fullscreen #stage,
.game-wrap:-webkit-full-screen #stage { flex: 1 1 auto; min-height: 0; width: 100%; height: auto; max-width: none; max-height: none; aspect-ratio: auto; border-radius: 0; margin: 0; }
html.pip-immersive .game-wrap.pip-stage #stage { margin-bottom: 0; }
/* soft vignette over the 3D canvas, under the UI layer; static, costs nothing per frame */
#stage #app::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, rgba(0,0,0,0) 58%, rgba(6,14,30,.34) 100%); }
#stage .scorebox, #stage .padbtn { text-shadow: 0 1px 0 rgba(0,0,0,.18); }
/* landscape phones: tighter HUD, compact pads, readable centred panels */
@media (orientation: landscape) and (max-height: 520px) {
  #stage .hud-sub { top: 56px; }
  #stage .padbtn { width: 64px; height: 64px; }
  #stage .pad { flex-direction: row; gap: 8px; bottom: max(8px, env(safe-area-inset-bottom)); }
  #stage .pad.left { left: max(12px, env(safe-area-inset-left)); } #stage .pad.right { right: max(12px, env(safe-area-inset-right)); }
  #stage .panel { max-width: 620px; margin-left: auto; margin-right: auto; }
  #stage .hint-bubble { top: 14%; width: min(84%, 420px); }
}
/* wave4: landscape full screen, level lists in two columns so every row is reachable without a long scroll */
@media (orientation: landscape) and (max-height: 520px) {
  html.pip-immersive #stage .rows, html.pip-native #stage .rows, .game-wrap:fullscreen #stage .rows { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  html.pip-immersive #stage .panel, html.pip-native #stage .panel, .game-wrap:fullscreen #stage .panel { padding-top: max(6px, env(safe-area-inset-top)); padding-bottom: 10px; }
  html.pip-immersive #stage .lead, html.pip-native #stage .lead, .game-wrap:fullscreen #stage .lead { margin: 0 0 6px; }
  html.pip-immersive #stage .phead, html.pip-native #stage .phead, .game-wrap:fullscreen #stage .phead { margin-bottom: 4px; }
  html.pip-immersive #stage .row, html.pip-native #stage .row, .game-wrap:fullscreen #stage .row { min-height: 48px; padding: 6px 10px; }
}
