/* Rail Rout: signal-box blueprint look. Ink green paper, chalk rails, amber signals. */
.game-header{display:flex;justify-content:space-between;align-items:center;gap:.5rem;padding:.6rem 1rem;background:#10222b;border-bottom:1px solid #2c4a55;font-size:.85rem}
.game-header a{color:#ffc23d;text-decoration:none;min-height:44px;display:inline-flex;align-items:center}
.game-tag{color:#8fa7ad}
.game-title p{font:700 .72rem ui-monospace,Consolas,monospace;letter-spacing:.14em;text-transform:uppercase;color:#8fa7ad}
.game-title h1{font:800 1.7rem/1.1 ui-monospace,Consolas,monospace;color:#ffc23d;margin:.1rem 0 .6rem;letter-spacing:.02em}
.hud{display:grid;grid-template-columns:1.3fr .8fr .8fr 1.1fr;gap:.3rem;margin-bottom:.4rem}
.hcell{background:#10222b;border:1px solid #2c4a55;padding:.3rem .5rem;min-width:0}
.hcell.wide{display:flex;flex-direction:column;justify-content:center;gap:.1rem}
.hl{display:block;font:600 .62rem ui-monospace,Consolas,monospace;letter-spacing:.12em;text-transform:uppercase;color:#8fa7ad}
.hcell b{display:block;font:700 .92rem ui-monospace,Consolas,monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pips{display:flex;gap:.22rem;flex-wrap:wrap;padding:2px 0}
.pip{width:.55rem;height:.55rem;border:2px solid #2c4a55;background:transparent;display:block;transform:rotate(45deg)}
.pip.on{background:#3ec9b0;border-color:#9ff3ee}
.stage{position:relative;width:100%;background:#10222b;border:2px solid #2c4a55;overflow:hidden}
#field{display:block;width:100%;height:100%;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;cursor:pointer}
.overlay{position:absolute;inset:0;background:rgba(8,18,23,.88);display:flex;align-items:center;justify-content:center;padding:.8rem .8rem max(.8rem,env(safe-area-inset-bottom));overflow:auto;animation:rrfade .2s ease-out}
@keyframes rrfade{from{opacity:0}to{opacity:1}}
.overlay[hidden]{display:none}
.card{margin:auto;width:100%;max-width:330px;display:flex;flex-direction:column;gap:.55rem;text-align:center}
.card h2{font:800 1.4rem ui-monospace,Consolas,monospace;color:#e8e2cf}
.card h2.wm{font-size:2.1rem;color:#ffc23d;letter-spacing:.06em;text-transform:uppercase;border-top:3px double #d9d2bc;border-bottom:3px double #d9d2bc;padding:.3rem 0}
.card h2.win{color:#7be0b0}.card h2.lose{color:#ff6b6b}
.card .kicker{font:700 .7rem ui-monospace,Consolas,monospace;letter-spacing:.14em;text-transform:uppercase;color:#8fa7ad}
.chips{display:flex;flex-wrap:wrap;gap:.35rem;justify-content:center}
.chip{font:700 .74rem ui-monospace,Consolas,monospace;padding:.2rem .5rem;border:1px solid #2c4a55;background:#0d1d24;color:#cfd6d2}
.chip.hot,.small.hot{color:#ffc23d;border-color:#7a5a1a}
.small.hot{border:0}
.card h2.win,.card h2.lose{animation:rrpop .35s ease-out}
@keyframes rrpop{from{transform:scale(.7);opacity:0}to{transform:scale(1);opacity:1}}
.lead{font-size:.92rem;color:#cfd6d2}
.small{font-size:.78rem;color:#8fa7ad}
.rb{font:700 1rem system-ui,sans-serif;min-height:48px;padding:.5rem 1rem;background:#1d3640;color:#e8e2cf;border:2px solid #5d727a;border-radius:4px;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.rb.go{background:#ffc23d;color:#10222b;border-color:#ffe08a}
.rb:active{transform:translateY(1px)}
.rb:focus-visible,.lv:focus-visible{outline:3px solid #9ff3ee;outline-offset:2px}
.rb.sm{min-height:44px;flex:1;font-size:.88rem;padding:.3rem .5rem}
.bar{display:flex;gap:.4rem;margin:.5rem 0}
.hint{min-height:2.6em;font-size:.88rem;color:#cfd6d2;margin-top:.5rem;border-left:3px solid #ffc23d;padding-left:.6rem}
.grid{display:grid;grid-template-columns:repeat(4,1fr);gap:.4rem}
.lv{min-height:56px;background:#1d3640;color:#e8e2cf;border:2px solid #5d727a;border-radius:4px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.2rem;cursor:pointer;font-family:inherit;touch-action:manipulation}
.lv b{font:800 1rem ui-monospace,Consolas,monospace}
.lv.lock{opacity:.4;cursor:default}
.stars{display:inline-flex;gap:3px;justify-content:center}
.st{width:11px;height:11px;background:#2c4a55;clip-path:polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%);display:block}
.st.on{background:#ffc23d}
.card>.stars{margin:.2rem 0}
.card>.stars .st{width:28px;height:28px}
.how{margin-top:1rem;color:#aab8bb;font-size:.85rem}
.how h2{font:700 1rem ui-monospace,Consolas,monospace;color:#e8e2cf;margin-bottom:.3rem}
.how p{margin-bottom:.5rem}
footer{text-align:center;padding:1rem;color:#8fa7ad;font-size:.8rem}
footer a{color:#ffc23d}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
/* full screen (native and immersive both set html.pip-immersive): board fills the stage */
html.pip-immersive .game-wrap.pip-stage{display:flex;flex-direction:column;overflow:hidden;padding-left:8px;padding-right:8px;padding-bottom:6px;gap:6px}
html.pip-immersive .game-wrap.pip-stage>.how,html.pip-immersive .game-wrap.pip-stage>.game-title{display:none}
html.pip-immersive .game-wrap.pip-stage>.hud{margin:0;flex:none}
html.pip-immersive .game-wrap.pip-stage>#stage{flex:1 1 0;min-height:0;height:auto!important;width:100%}
html.pip-immersive .game-wrap.pip-stage>.hint{flex:none;min-height:0;margin:0;font-size:.8rem;max-height:2.6em;overflow:hidden}
html.pip-immersive .game-wrap.pip-stage>.bar{flex:none;margin:0}
@media (orientation:landscape) and (max-height:520px){
html.pip-immersive .game-wrap.pip-stage{display:grid;grid-template-columns:minmax(0,1fr) minmax(150px,200px);grid-template-rows:auto 1fr auto;column-gap:8px;padding-top:6px!important;align-content:stretch}
html.pip-immersive .game-wrap.pip-stage>#stage{grid-column:1;grid-row:1/4}
html.pip-immersive .game-wrap.pip-stage>.hud{grid-column:2;grid-row:1;grid-template-columns:1fr 1fr}
html.pip-immersive .game-wrap.pip-stage>.hud .hcell.wide{grid-column:1/3}
html.pip-immersive .game-wrap.pip-stage>.hint{grid-column:2;grid-row:2;align-self:start;max-height:none}
html.pip-immersive .game-wrap.pip-stage>.bar{grid-column:2;grid-row:3;flex-wrap:wrap}
}
