/* Signal-box blueprint: ink board, cream chalk, lamp amber. */
.game-wrap{padding-left:max(1rem,env(safe-area-inset-left));padding-right:max(1rem,env(safe-area-inset-right));padding-bottom:max(1rem,env(safe-area-inset-bottom))}
.game-header{display:flex;justify-content:space-between;align-items:center;padding:.75rem 1rem;background:#0f1c20;color:#f1e8cf}
.game-header a{color:#f1e8cf;text-decoration:none;font-weight:600;min-height:44px;display:inline-flex;align-items:center}
.game-tag{font-size:.85rem;opacity:.8}
.game-title p{font-size:.8rem;margin-bottom:.15rem}
.game-title a{color:#12242a}
.game-title h1{font-size:1.5rem;margin-bottom:.6rem}
footer{padding:1rem;text-align:center;font-size:.85rem}
footer a{color:#12242a}

.js-root{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.js-stage{position:relative;height:clamp(440px,calc(100svh - 230px),640px);border-radius:14px;overflow:hidden;background:#0f1c20;box-shadow:0 0 0 3px #0f1c20,0 0 0 5px #8a7c55;touch-action:none}
#board{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none;cursor:pointer}
.js-hud{position:absolute;left:0;right:0;top:0;display:flex;justify-content:space-between;align-items:center;padding:8px 10px 10px;pointer-events:none;color:#f1e8cf}
.js-hud-l,.js-hud-r{display:flex;align-items:center;gap:10px}
.js-lvl{font-weight:800;letter-spacing:.04em;text-transform:uppercase;font-size:.8rem}
.js-score{font-variant-numeric:tabular-nums;font-weight:800;font-size:1.1rem;min-width:3ch;text-align:right}
.js-lives{display:flex;gap:5px}
.js-lives i{width:12px;height:12px;border-radius:50%;display:block;border:2px solid #ffb62e}
.js-lives i.on{background:#ffb62e;box-shadow:0 0 8px #ffb62e}
.js-lives i.off{background:transparent;opacity:.4}
.js-prog{position:absolute;left:10px;right:10px;bottom:0;height:3px;background:#243a40;border-radius:2px;overflow:hidden}
.js-prog i{display:block;height:100%;width:0;background:#2ed3b7;transition:width .25s}
.js-ib{pointer-events:auto;width:44px;height:44px;border-radius:10px;border:2px solid #566b66;background:#16292f;color:#f1e8cf;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.js-ib .js-x{display:none}
.js-ib.off .js-w{display:none}
.js-ib.off .js-x{display:block}
.js-hint{position:absolute;left:10px;right:10px;bottom:10px;padding:8px 10px;border-radius:10px;background:#f1e8cf;color:#12242a;font-size:.84rem;font-weight:600;line-height:1.25;pointer-events:none;box-shadow:0 2px 0 #8a7c55}
.js-ov{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:12px;background:rgba(15,28,32,.78);overflow-y:auto}
.js-ov[hidden],.js-hint[hidden],.js-stars[hidden],.js-btn[hidden]{display:none}
.js-card{width:100%;max-width:330px;max-height:100%;background:#f1e8cf;color:#12242a;border-radius:12px;padding:16px;border:3px solid #0f1c20;outline:2px solid #8a7c55;outline-offset:2px;text-align:center;overflow-y:auto}
.js-card h2{font-size:1.4rem;letter-spacing:.01em;margin-bottom:.4rem}
.js-sub{font-size:.9rem;line-height:1.4;margin-bottom:.8rem}
.js-best{font-size:.82rem;margin:.6rem 0}
.js-stars{font-size:1.8rem;color:#c98300;letter-spacing:.2em;margin-bottom:.3rem}
.js-btn{display:block;width:100%;min-height:48px;margin-top:8px;border:2px solid #12242a;border-radius:10px;background:#f7f1de;color:#12242a;font:inherit;font-weight:800;font-size:1rem;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;box-shadow:0 3px 0 #12242a}
.js-btn:active{transform:translateY(2px);box-shadow:0 1px 0 #12242a}
.js-pri{background:#ffb62e}
.js-quiet{background:transparent;box-shadow:none;border-color:#8a7c55}
.js-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:6px;max-height:112px;overflow-y:auto;padding:2px}
.js-lv{min-height:44px;border:2px solid #12242a;border-radius:8px;background:#f7f1de;font:inherit;font-weight:800;color:#12242a;cursor:pointer;touch-action:manipulation}
.js-lv[data-stars="3"]{background:#bfeadf}
.js-lv[data-stars="2"],.js-lv[data-stars="1"]{background:#ffe3a1}
.js-lv:disabled{opacity:.35;cursor:default}
.js-btn:focus-visible,.js-lv:focus-visible,.js-ib:focus-visible{outline:3px solid #2ed3b7;outline-offset:2px}
.js-keys{font-size:.78rem;margin-top:.6rem;opacity:.75}
.js-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
@media (max-width:360px){.js-grid{grid-template-columns:repeat(5,1fr)}}
@media (prefers-reduced-motion:reduce){.js-prog i{transition:none}.js-btn:active{transform:none}}

.js-lv.cur{box-shadow:0 0 0 3px #ffb62e}

/* Full screen: stage fills the dock-clear area, no scroll, safe areas honoured. */
html.pip-immersive .js-keys,html.pip-native .js-keys,html.pip-immersive .game-header,html.pip-immersive .ad-well,html.pip-immersive footer{display:none}
html.pip-immersive .game-wrap,html.pip-native .game-wrap,html.pip-immersive .js-root,html.pip-native .js-root{display:flex;flex-direction:column;min-height:0;overflow:hidden}
html.pip-immersive .js-root,html.pip-native .js-root{flex:1 1 auto;height:100%}
html.pip-immersive .js-stage,html.pip-native .js-stage{flex:1 1 auto;height:auto;min-height:0;border-radius:0;box-shadow:none}
html.pip-immersive .js-hud,html.pip-native .js-hud{padding-top:max(8px,env(safe-area-inset-top));padding-left:max(10px,env(safe-area-inset-left));padding-right:max(10px,env(safe-area-inset-right))}
html.pip-immersive .js-hint,html.pip-native .js-hint{bottom:max(10px,env(safe-area-inset-bottom))}
html.pip-immersive .js-card,html.pip-native .js-card{max-height:100%}
@media (orientation:landscape) and (max-height:500px){
html.pip-immersive .js-card,html.pip-native .js-card{max-width:420px;padding:10px 14px}
html.pip-immersive .js-grid,html.pip-native .js-grid{max-height:64px;grid-template-columns:repeat(10,1fr)}
html.pip-immersive .js-btn,html.pip-native .js-btn{min-height:44px;margin-top:6px}
}
