/* Phase Runner: two-ink print look. Paper #f3ead4, ink #161a2e, red #e0432a, teal #2ec4b6 */
.stage{position:relative;width:100%;aspect-ratio:390/760;max-height:calc(100svh - 150px);min-height:440px;margin:0 auto;border-radius:14px;overflow:hidden;background:#161a2e;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;border:3px solid #161a2e;box-shadow:5px 5px 0 #e0432a}
#cv{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none}
.mute{position:absolute;top:calc(8px + env(safe-area-inset-top,0px));left:8px;z-index:3;width:44px;height:44px;border:2px solid #161a2e;border-radius:10px;background:#f3ead4;color:#161a2e;display:flex;align-items:center;justify-content:center;cursor:pointer;opacity:.85}
.mute .x{display:none}.mute.off .w{display:none}.mute.off .x{display:block}
.mute:focus-visible,.stage button:focus-visible{outline:3px solid #2ec4b6;outline-offset:2px}
.panel{position:absolute;inset:0;z-index:2;display:flex;align-items:center;justify-content:center;padding:14px 14px calc(14px + env(safe-area-inset-bottom,0px));background:rgba(22,26,46,.55);overflow:auto}
.panel[hidden],.nojs[hidden],.stage [hidden]{display:none!important}
.card{width:100%;max-width:340px;background:#f3ead4;color:#161a2e;border:3px solid #161a2e;border-radius:14px;padding:16px;box-shadow:5px 5px 0 #2ec4b6;text-align:center}
.logo{font-size:2rem;line-height:1;font-weight:900;letter-spacing:.02em;text-transform:uppercase;margin-bottom:8px}
.logo span:first-child{color:#e0432a}.logo span:last-child{color:#161a2e;text-shadow:2px 2px 0 #2ec4b6}
.lead{font-size:.95rem;line-height:1.35;margin-bottom:12px}
.tier{display:flex;align-items:center;gap:8px;margin-bottom:10px}
.tier-mid{flex:1;display:flex;flex-direction:column}.tier-mid b{font-size:1.15rem}.tier-mid small{font-size:.78rem;opacity:.75}
.stage button{font-family:inherit;cursor:pointer}
.sq{width:48px;height:48px;border:3px solid #161a2e;border-radius:10px;background:#fff8e6;color:#161a2e;font-size:1.5rem;font-weight:900}
.sq:disabled{opacity:.35;cursor:default}
.big{width:100%;min-height:56px;border:3px solid #161a2e;border-radius:12px;background:#e0432a;color:#fff8e6;font-size:1.3rem;font-weight:900;letter-spacing:.04em;text-transform:uppercase;box-shadow:4px 4px 0 #161a2e;margin-bottom:10px}
.big:active{transform:translate(3px,3px);box-shadow:1px 1px 0 #161a2e}
.alt{flex:1;min-height:48px;border:3px solid #161a2e;border-radius:12px;background:#2ec4b6;color:#161a2e;font-size:1rem;font-weight:800;padding:6px 8px;display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%}
.alt small{font-size:.72rem;font-weight:600;opacity:.8}
.row{display:flex;gap:8px}.row .alt{width:auto;font-size:.9rem}
.unlocks{list-style:none;margin:12px 0 4px;text-align:left;font-size:.8rem}
.unlocks li{padding:3px 0;border-top:1px dashed rgba(22,26,46,.35);opacity:.65}.unlocks li.got{opacity:1;font-weight:800;color:#b32d17}
.stat{font-size:.78rem;opacity:.8;margin-top:6px}
.over-head{font-size:1.25rem;font-weight:900;text-transform:uppercase}
.score{font-size:3rem;font-weight:900;line-height:1.1;color:#e0432a;text-shadow:2px 2px 0 #2ec4b6}
.best{font-weight:800;margin-bottom:4px}.unlock{font-weight:800;color:#0e7a70;min-height:1.2em;margin-bottom:8px}
.goal{font-size:.82rem;font-weight:800;margin:0 0 10px;padding:6px 8px;border:2px dashed #161a2e;border-radius:10px;background:#fff8e6}
.goal.done{border-style:solid;border-color:#0e7a70;color:#0e7a70}
.goal:empty{display:none}
.nojs{position:absolute;inset:0;color:#fff8e6;padding:2rem;z-index:4;background:#161a2e}
.how{font-size:.85rem;line-height:1.45;color:#475569;margin-top:.9rem}
@media (prefers-reduced-motion:reduce){.big:active{transform:none}}
@media (max-height:620px){.card{padding:10px}.logo{font-size:1.5rem}.lead{display:none}.unlocks{display:none}}
/* Full screen (shell native + immersive): stage fills the area under the dock, chrome hidden */
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;overflow:hidden}
html.pip-immersive .how,html.pip-native .how,html.pip-immersive .game-header,html.pip-immersive .ad-well,html.pip-native .ad-well{display:none}
html.pip-immersive .stage,html.pip-native .stage,.stage:fullscreen{aspect-ratio:auto;max-height:none;min-height:0;border:0;border-radius:0;box-shadow:none;margin:0}
html.pip-immersive .stage:not(.pip-stage),html.pip-native .stage:not(.pip-stage){flex:1 1 auto;width:100%;height:auto}
html.pip-immersive .mute,html.pip-native .mute{left:calc(8px + env(safe-area-inset-left,0px))}
html.pip-immersive .panel,html.pip-native .panel{padding-left:calc(14px + env(safe-area-inset-left,0px));padding-right:calc(14px + env(safe-area-inset-right,0px))}
/* polish: dimmed vignette behind panels and a quick pop-in for the card */
.panel{background:radial-gradient(ellipse at 50% 45%,rgba(22,26,46,.35),rgba(22,26,46,.78))}
.card{animation:cardIn .28s cubic-bezier(.2,.9,.3,1.2) both}
@keyframes cardIn{from{transform:translateY(14px) scale(.96);opacity:0}to{transform:none;opacity:1}}
@media (prefers-reduced-motion:reduce){.card{animation:none}}
/* landscape phone: compact card, nothing scrolls */
@media (orientation:landscape) and (max-height:520px){
.panel{padding-top:8px;padding-bottom:8px}.card{max-width:min(460px,92%);padding:8px 12px}
.logo{font-size:1.3rem;margin-bottom:4px}.stat,.goal,.unlocks,.lead{display:none}
.tier{margin-bottom:6px}.big{min-height:46px;margin-bottom:6px;font-size:1.1rem}.alt{min-height:44px}.score{font-size:2rem}}
