/* Shadow Cast: paper theatre. Ink, cream, amber, vermillion. Own class prefix sc-. */
.sc{--ink:#15122a;--ink2:#241d4f;--cream:#fff6e0;--amber:#f2a93b;--red:#d9402b;--line:rgba(255,246,224,.18);
  -webkit-user-select:none;user-select:none;-webkit-touch-callout:none;color:var(--cream)}
.sc button{font-family:inherit;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.sc-hud{display:flex;align-items:center;justify-content:space-between;gap:.5rem;min-height:44px;padding:0 .1rem}
.sc-lv{font-weight:800;font-size:.95rem;letter-spacing:.01em;min-width:0;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sc-pips{display:flex;gap:6px;flex:none}
.sc-pips i{width:14px;height:14px;border-radius:3px;border:2px solid var(--amber);background:transparent;transform:rotate(45deg);transition:background .2s,transform .2s}
.sc-pips i.on{background:var(--amber)}
.sc-pips i.pop{transform:rotate(45deg) scale(1.5)}
.sc-cov{flex:none;min-width:3.4rem;text-align:right;font-weight:800;color:var(--amber);font-variant-numeric:tabular-nums}
.sc-status{min-height:2.6em;display:flex;align-items:center;justify-content:center;text-align:center;font-size:.9rem;line-height:1.3;padding:.15rem .25rem;color:#e9dfc4}
.sc-status.bad{color:#ff8b72}
.sc-status.good{color:var(--amber)}
.sc-stage{position:relative;display:flex;justify-content:center;background:radial-gradient(120% 90% at 50% 30%,#2a2360,#15122a 70%);box-shadow:inset 0 0 40px rgba(0,0,0,.35);border-radius:14px;overflow:hidden;border:1px solid var(--line)}
#sc-canvas{display:block;touch-action:none;cursor:crosshair;max-width:100%;-webkit-tap-highlight-color:transparent}
.sc-pane{position:absolute;inset:0;z-index:2;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:.6rem;padding:1rem;text-align:center;overflow-y:auto;overscroll-behavior:contain;
  background:rgba(21,18,42,.93);padding-top:max(1rem,env(safe-area-inset-top))}
.sc-pane::before,.sc-pane::after{content:"";flex:1 1 0}
.sc-pane[hidden]{display:none}
.sc-pane h2{font-size:1.9rem;font-weight:900;letter-spacing:.02em;color:var(--amber)}
.sc-pane p{font-size:.95rem;line-height:1.45;max-width:30ch;color:#e9dfc4}
.sc-pane .sc-btn{width:min(100%,240px)}
.sc-meta{font-size:.82rem;color:#c9bf9f;line-height:1.5}
.sc-btn{min-height:44px;min-width:44px;padding:.5rem .8rem;border-radius:10px;border:2px solid var(--line);background:var(--ink2);color:var(--cream);font-weight:700;font-size:.9rem;cursor:pointer;transition:transform .08s,background .15s}
.sc-btn:active{transform:translateY(1px) scale(.98)}
.sc-btn:disabled{opacity:.4;cursor:default}
.sc-btn:focus-visible,.sc-height input:focus-visible,.sc-lvbtn:focus-visible{outline:3px solid var(--amber);outline-offset:2px}
.sc-primary{background:var(--amber);color:#1a1530;border-color:var(--amber)}
.sc-height{display:grid;grid-template-columns:auto 1fr 2.4rem;align-items:center;gap:.6rem;min-height:48px;margin-top:.5rem;font-size:.85rem;font-weight:700}
.sc-height input{width:100%;height:44px;accent-color:var(--amber);touch-action:pan-y;background:transparent;margin:0}
.sc-height input:disabled{opacity:.4}
.sc-height output{text-align:right;color:var(--amber);font-variant-numeric:tabular-nums}
.sc-bar{display:grid;grid-template-columns:1.1fr 1fr 1fr 1fr 1.2fr;gap:6px;margin-top:.4rem}
.sc-bar .sc-btn{padding:.4rem .2rem;font-size:.82rem}
.sc{padding-bottom:env(safe-area-inset-bottom)}
.sc-pane .sc-btn.sc-primary{box-shadow:0 0 0 3px rgba(242,169,59,.25)}
.sc-keys{display:none;font-size:.75rem;color:#c9bf9f;margin-top:.6rem;text-align:center}
@media (hover:hover) and (pointer:fine){.sc-keys{display:block}}
.sc-tabs{display:flex;gap:4px;width:100%;flex-wrap:wrap;justify-content:center}
.sc-tabs button{min-height:44px;flex:1 1 30%;font-size:.72rem;padding:.2rem;border-radius:8px;border:2px solid var(--line);background:transparent;color:var(--cream);font-weight:700;cursor:pointer}
.sc-tabs button[aria-selected="true"]{background:var(--amber);color:#1a1530;border-color:var(--amber)}
.sc-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:5px;width:100%}
.sc-lvbtn{min-height:44px;border-radius:9px;border:2px solid var(--line);background:var(--ink2);color:var(--cream);font-weight:800;font-size:.85rem;cursor:pointer;line-height:1.1;padding:.1rem}
.sc-lvbtn small{display:block;font-size:.6rem;color:var(--amber);letter-spacing:-1px;min-height:.8em}
.sc-lvbtn:disabled{opacity:.35;cursor:default}
.sc-lvbtn.cur{border-color:var(--amber)}
.sc-stars{display:flex;gap:10px;justify-content:center;min-height:42px}
.sc-stars i{width:34px;height:34px;background:#3a3360;clip-path:polygon(50% 0,62% 36%,100% 38%,70% 60%,80% 100%,50% 76%,20% 100%,30% 60%,0 38%,38% 36%)}
.sc-stars i.on{background:var(--amber);animation:sc-star .5s ease both}
.sc-stars i.on:nth-child(2){animation-delay:.15s}
.sc-stars i.on:nth-child(3){animation-delay:.3s}
@keyframes sc-star{0%{transform:scale(0) rotate(-40deg)}70%{transform:scale(1.3) rotate(8deg)}100%{transform:scale(1) rotate(0)}}
.sc-pane:not([hidden]){animation:sc-in .25s ease both}
@keyframes sc-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.sc-status.pop{animation:sc-pop .3s ease}
@keyframes sc-pop{50%{transform:scale(1.06)}}
@media (prefers-reduced-motion:reduce){.sc *{animation:none!important;transition:none!important}}
@media (max-width:360px){.sc-bar{grid-template-columns:repeat(3,1fr)}.sc-grid{grid-template-columns:repeat(5,1fr)}}
/* Full screen: the board fills the stage below the dock; controls stay on screen. */
html.pip-immersive .sc-keys,html.pip-native .sc-keys{display:none}
html.pip-immersive .game-wrap,html.pip-native .game-wrap{display:flex;flex-direction:column;padding-left:.6rem;padding-right:.6rem;padding-bottom:max(.4rem,env(safe-area-inset-bottom))}
html.pip-immersive .game-wrap>.sc,html.pip-native .game-wrap>.sc{flex:1 1 0;min-height:0;display:flex;flex-direction:column;padding-bottom:0}
html.pip-immersive .game-wrap>.pip-actions,html.pip-native .game-wrap>.pip-actions{display:none}
html.pip-immersive .sc-stage,html.pip-native .sc-stage{flex:1 1 0;min-height:0;align-items:center}
html.pip-immersive .sc-status,html.pip-native .sc-status{min-height:1.8em;font-size:.85rem}
html.pip-immersive .sc-height,html.pip-native .sc-height{margin-top:.25rem}
html.pip-immersive .sc-pane,html.pip-native .sc-pane{padding-bottom:1rem}
@media (orientation:landscape) and (max-height:520px){
  html.pip-immersive .game-wrap>.sc,html.pip-native .game-wrap>.sc{display:grid;grid-template-columns:minmax(0,1fr) minmax(190px,36%);grid-template-rows:auto auto auto auto 1fr;column-gap:.6rem;align-content:start}
  html.pip-immersive .sc-stage,html.pip-native .sc-stage{grid-column:1;grid-row:1/-1}
  html.pip-immersive .sc-hud,html.pip-native .sc-hud,html.pip-immersive .sc-status,html.pip-native .sc-status,html.pip-immersive .sc-height,html.pip-native .sc-height,html.pip-immersive .sc-bar,html.pip-native .sc-bar{grid-column:2}
  html.pip-immersive .sc-bar,html.pip-native .sc-bar{grid-template-columns:repeat(2,1fr)}
}
.game-wrap:fullscreen{height:100%;max-width:none;box-sizing:border-box}
