/* Skyhop Courier 3D - stage and in-game UI, scoped under #stage so site styles never leak in. */
html.pip-big, html.pip-big body { overflow: hidden; }
#stage { --ink:#1d2b48; --sky:#1a8cff; --sun:#ffc21a; --green:#3fcf6a; --red:#ff5a4a; --card:#ffffff; --muted:#5b6b88;
  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(#5db4ff, #cfeaff); 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 [hidden] { display: none !important; }
#stage #app { position: absolute; inset: 0; }
#stage #app canvas { display: block; width: 100%; height: 100%; touch-action: none; }
#stage #ui { position: absolute; inset: 0; pointer-events: 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(#1a8cff, #cfeaff); }
#stage .load-in { display: flex; flex-direction: column; align-items: center; gap: 10px; color: #fff; text-shadow: 0 2px 0 rgba(10,40,110,.4); text-align: center; padding: 0 18px; }
#stage .load-in b { font-size: clamp(20px, 6vw, 30px); letter-spacing: 2px; }
#stage .spinner { width: 42px; height: 42px; border-radius: 50%; border: 6px solid rgba(255,255,255,.35); border-top-color: var(--sun); animation: ddspin .8s linear infinite; }
@keyframes ddspin { 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(20,32,70,.88); color: #fff; font-weight: 700; }

/* controls */
#stage .controls { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
#stage .stick-zone { position: absolute; left: 0; top: 18%; bottom: 0; width: 62%; pointer-events: auto; touch-action: none; }
#stage .controls.flip .stick-zone { left: auto; right: 0; }
#stage .stick-base { position: absolute; width: 104px; height: 104px; margin: -52px 0 0 -52px; border-radius: 50%; background: rgba(255,255,255,.25); border: 3px solid rgba(255,255,255,.7); pointer-events: none; }
#stage .stick-knob { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgba(255,255,255,.9); box-shadow: 0 2px 6px rgba(0,0,0,.3); }
#stage .alt-btn { position: absolute; right: 12px; width: 68px; height: 78px; border-radius: 18px; border: 3px solid #fff; background: rgba(26,140,255,.82); color: #fff; font-size: 26px; font-weight: 800; pointer-events: auto; touch-action: none; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; box-shadow: 0 4px 0 rgba(10,40,110,.35); }
#stage .alt-btn span { font-size: 11px; letter-spacing: 1px; margin-top: 3px; }
#stage .alt-up { bottom: 108px; } #stage .alt-dn { bottom: 18px; background: rgba(255,138,31,.85); }
#stage .alt-btn.on { transform: translateY(3px); filter: brightness(1.15); }
#stage .controls.flip .alt-btn { right: auto; left: 12px; }

/* hud */
#stage .hud { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
#stage .hud-top { position: absolute; left: 8px; right: 8px; top: 8px; display: flex; gap: 8px; align-items: center; justify-content: space-between; }
#stage .bat { display: flex; align-items: center; gap: 6px; background: rgba(20,32,70,.6); color: #fff; padding: 5px 8px; border-radius: 12px; font-size: 12px; font-weight: 700; }
#stage .bat-bar { width: 58px; height: 12px; border-radius: 6px; background: rgba(255,255,255,.25); overflow: hidden; }
#stage .bat-fill { height: 100%; width: 100%; background: var(--green); transition: width .15s linear; }
#stage .bat-fill.mid { background: var(--sun); } #stage .bat-fill.low { background: var(--red); } #stage .bat-fill.chg { background: #5de0ff; }
#stage .hud-mid { display: flex; flex-direction: column; align-items: center; color: #fff; text-shadow: 0 2px 0 rgba(10,40,110,.55); font-weight: 800; }
#stage .hud-time { font-size: 22px; } #stage .hud-time.warn { color: #ffd0ca; }
#stage .hud-goal { font-size: 11px; }
#stage .hud-right { display: flex; align-items: center; gap: 6px; color: #fff; font-weight: 800; text-shadow: 0 2px 0 rgba(10,40,110,.55); }
#stage .icon-btn { pointer-events: auto; width: 44px; height: 44px; border-radius: 12px; border: 3px solid #fff; background: rgba(20,32,70,.7); color: #fff; font-weight: 800; font-size: 15px; }
#stage .minimap { position: absolute; right: 8px; top: 62px; width: 84px; height: 84px; border-radius: 10px; border: 2px solid rgba(255,255,255,.85); background: #4b5565; opacity: .92; }
#stage .arrow-box { position: absolute; left: 8px; top: 62px; width: 74px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: #fff; font-size: 11px; font-weight: 800; text-shadow: 0 1px 0 rgba(0,0,0,.6); }
#stage .arrow { width: 44px; height: 44px; border-radius: 50%; background: rgba(20,32,70,.6); position: relative; }
#stage .arrow-tip { position: absolute; left: 50%; top: 5px; margin-left: -8px; border: 8px solid transparent; border-bottom: 18px solid var(--sun); border-top: 0; }
#stage .orders { position: absolute; left: 8px; top: 124px; display: flex; flex-direction: column; gap: 4px; max-width: 58%; }
#stage .order { display: flex; align-items: center; gap: 6px; background: rgba(20,32,70,.6); color: #fff; padding: 3px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; }
#stage .order.carried { background: rgba(30,120,60,.75); } #stage .order.late { outline: 2px solid var(--red); }
#stage .o-dot { width: 10px; height: 10px; border-radius: 3px; background: #c98b4a; flex: none; }
#stage .clock-out { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); pointer-events: auto; min-height: 44px; padding: 0 16px; border-radius: 22px; border: 3px solid #fff; background: var(--green); color: #fff; font-weight: 800; z-index: 6; }
#stage .hint { position: absolute; left: 12%; right: 12%; bottom: 26%; text-align: center; background: rgba(255,255,255,.92); color: var(--ink); padding: 8px 12px; border-radius: 14px; font-weight: 700; font-size: 14px; }
#stage .toast { position: absolute; left: 50%; top: 40%; transform: translateX(-50%); background: rgba(20,32,70,.82); color: #fff; padding: 6px 14px; border-radius: 16px; font-weight: 800; font-size: 15px; white-space: nowrap; }
#stage .toast.good { background: rgba(30,140,70,.9); } #stage .toast.bad { background: rgba(200,60,50,.9); }
#stage .lowflash { position: absolute; inset: 0; box-shadow: inset 0 0 60px rgba(255,60,40,.55); }

/* screens */
#stage .screen { position: absolute; inset: 0; z-index: 10; pointer-events: auto; overflow-y: auto; overflow-x: hidden; touch-action: pan-y; background: rgba(15,30,70,.45); -webkit-overflow-scrolling: touch; padding: 12px; }
#stage .panel { background: var(--card); border-radius: 18px; padding: 14px; box-shadow: 0 8px 0 rgba(10,40,110,.25); max-width: 380px; margin: 0 auto; }
#stage .panel h2 { font-size: 22px; margin: 4px 0 8px; } #stage .panel h3 { font-size: 15px; margin: 12px 0 6px; }
#stage .logo { font-size: 26px; text-align: center; color: var(--sky); }
#stage .tag { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 10px; }
#stage .topbar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
#stage .chip { background: #eaf3ff; border-radius: 12px; padding: 4px 10px; font-weight: 800; font-size: 13px; } #stage .chip.coin { background: #fff3c7; }
#stage .xp { flex: 1; height: 8px; border-radius: 4px; background: #dde6f5; overflow: hidden; } #stage .xp i { display: block; height: 100%; background: var(--sky); }
#stage .cards, #stage .list, #stage .col, #stage .skins { display: flex; flex-direction: column; gap: 8px; }
#stage .skins { flex-direction: row; flex-wrap: wrap; }
#stage .mode-card, #stage .shift { text-align: left; border: 3px solid #cfe0f7; background: #f5faff; border-radius: 14px; padding: 10px 12px; min-height: 56px; color: var(--ink); display: flex; flex-direction: column; gap: 2px; }
#stage .mode-card b, #stage .shift b { font-size: 16px; } #stage .mode-card span, #stage .sub, #stage .mini { font-size: 12px; color: var(--muted); }
#stage .mode-card.locked, #stage .shift.locked { opacity: .55; }
#stage .shift { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
#stage .shift .sub { width: 100%; }
#stage .stars i { font-style: normal; color: #cdd6e6; font-size: 20px; } #stage .stars i.on { color: var(--sun); text-shadow: 0 1px 0 #b27d00; }
#stage .lock { font-size: 12px; font-weight: 800; color: var(--muted); }
#stage .goal { margin: 10px 0; font-size: 13px; font-weight: 700; color: #1f6f3c; background: #e6f8ec; padding: 6px 10px; border-radius: 10px; }
#stage .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
#stage .btn { min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: 12px; border: 3px solid var(--ink); background: #fff; color: var(--ink); font-weight: 800; font-size: 15px; flex: 1; display: inline-flex; align-items: center; justify-content: center; margin: 0; }
#stage .btn.go { background: var(--green); color: #fff; border-color: #17803c; } #stage .btn.ghost { background: #eef3fb; border-color: #b8c8e2; }
#stage .btn.small { min-height: 44px; font-size: 13px; flex: none; } #stage .btn.danger { background: var(--red); color: #fff; border-color: #a02a20; }
#stage .btn.buy { background: var(--sun); border-color: #b27d00; flex: none; min-width: 74px; } #stage .btn.buy.off { opacity: .45; }
#stage .lines { padding-left: 18px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
#stage .up { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 3px solid #e1ebf8; border-radius: 12px; padding: 8px; }
#stage .up-t { display: flex; flex-direction: column; gap: 2px; } #stage .maxed { font-weight: 800; color: #17803c; padding: 0 8px; }
#stage .pips { display: flex; gap: 3px; } #stage .pips i { width: 14px; height: 6px; border-radius: 3px; background: #d4deef; } #stage .pips i.on { background: var(--sky); }
#stage .skin { flex: 1 1 28%; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 3px solid #e1ebf8; background: #fff; border-radius: 12px; padding: 8px 4px; min-height: 76px; color: var(--ink); font-size: 12px; font-weight: 700; }
#stage .skin i { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--ink); } #stage .skin em { font-style: normal; font-size: 11px; color: var(--muted); }
#stage .skin.sel { border-color: var(--sky); } #stage .skin.locked { opacity: .5; }
#stage .ach { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; border: 3px solid #e1ebf8; border-radius: 12px; padding: 8px; }
#stage .ach.got { background: #e6f8ec; border-color: #9fdcb4; } #stage .ach em { font-style: normal; font-weight: 800; grid-row: 1 / 3; grid-column: 2; align-self: center; }
#stage .set { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; font-weight: 700; }
#stage .seg { display: flex; border: 3px solid var(--ink); border-radius: 12px; overflow: hidden; }
#stage .seg button { min-height: 44px; min-width: 52px; border: 0; background: #fff; font-weight: 800; color: var(--ink); } #stage .seg button.on { background: var(--sky); color: #fff; }
#stage .table { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; } #stage .table div { display: flex; justify-content: space-between; border-bottom: 1px dashed #d4deef; padding: 3px 0; font-size: 14px; }
#stage .newbest, #stage .ach-new { margin: 4px 0; font-weight: 800; color: #b27d00; font-size: 14px; }
#stage .results .stars { display: block; text-align: center; } #stage .results .stars i { font-size: 36px; }
@media (max-height: 560px) { #stage .alt-btn { height: 62px; } #stage .alt-up { bottom: 90px; } #stage .minimap { width: 70px; height: 70px; } }
#stage.is-big .stick-zone { top: 14%; }

/* page chrome outside the stage */
.dd-bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: .75rem 0 .25rem; }
.dd-bar .btn { min-height: 44px; min-width: 44px; }
.dd-keys { text-align: center; font-size: .8rem; color: #64748b; margin: .25rem 0 0; }
.dd-guide { max-width: 640px; margin: 1.5rem auto; padding: 0 1rem; line-height: 1.6; }
.dd-guide h2 { font-size: 1.25rem; margin-bottom: .5rem; }
.dd-guide h3 { font-size: 1rem; margin: 1rem 0 .25rem; }
.dd-guide p { margin-bottom: .5rem; font-size: .95rem; }

/* full screen from the site shell (native or immersive): the stage fills the whole play area */
html.pip-immersive .game-wrap.pip-stage, html.pip-native .game-wrap.pip-stage, .game-wrap.pip-stage:fullscreen { display: flex; flex-direction: column; padding: 0; margin: 0; }
html.pip-immersive .dd-bar, html.pip-immersive .dd-keys, html.pip-native .dd-bar, html.pip-native .dd-keys, .game-wrap.pip-stage:fullscreen .dd-bar, .game-wrap.pip-stage:fullscreen .dd-keys { display: none; }
html.pip-immersive #stage, html.pip-native #stage, .game-wrap.pip-stage:fullscreen #stage { flex: 1 1 auto; min-height: 0; width: 100%; max-width: none; aspect-ratio: auto; border-radius: 0; margin: 0; }
html.pip-immersive #stage .stick-zone, html.pip-native #stage .stick-zone { top: 14%; }
