:root { --bg:#0b1220; --panel:#111a2e; --ink:#e7ecf5; --muted:#9aa6bf; --accent:#2f9e56; --accent2:#ffd166; }
* { box-sizing: border-box; }
html, body { margin:0; padding:0; height:100%; background:var(--bg); color:var(--ink); font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; overscroll-behavior:none; }
#app { height:100dvh; max-width:680px; margin:0 auto; padding:6px 8px; display:flex; flex-direction:column; gap:5px; }
.topbar { display:flex; align-items:baseline; gap:8px; flex-wrap:wrap; flex:0 0 auto; }
.title { font-weight:700; font-size:14px; }
.title small { color:var(--muted); font-weight:400; font-size:11px; margin-left:4px; }
.spacer { flex:1 1 auto; }
.hud { font-size:12px; white-space:nowrap; }
.hud b { color:var(--accent2); }
.hud b.under { color:#7ee081; }
.hud b.over { color:#ff8a8f; }
.sep { color:var(--muted); margin:0 3px; opacity:.6; }
#status { font-size:12px; color:var(--muted); min-height:16px; flex:0 0 auto; line-height:1.35; }
.stagewrap { flex:1 1 auto; min-height:0; display:flex; align-items:center; justify-content:center; }
.playcol { display:flex; flex-direction:column; gap:8px; align-items:center; max-height:100%; min-height:0; }
canvas { display:block; background:#2a6c3a; border-radius:10px; touch-action:none; }
#statusbar { display:flex; justify-content:center; flex:0 0 auto; }
.actions { display:flex; gap:8px; }
.btn { background:var(--panel); color:var(--ink); border:1px solid #2a3550; padding:5px 14px; border-radius:8px; font-size:13px; cursor:pointer; }
.btn.primary { background:var(--accent); border-color:var(--accent); color:#fff; }
.btn:active { transform:translateY(1px); }
.legend { font-size:11px; color:var(--muted); text-align:center; line-height:1.4; flex:0 0 auto; }
#toast { position:fixed; left:50%; bottom:16px; transform:translateX(-50%); background:#111a2e; color:#e7ecf5; padding:7px 12px; border-radius:8px; opacity:0; transition:opacity .2s; pointer-events:none; font-size:13px; }
#toast.show { opacity:1; }
@media (max-height:430px) {
  .legend { display:none; }
  .title small { display:none; }
  #status { font-size:11px; min-height:14px; }
  .btn { padding:3px 10px; font-size:12px; }
}
@media (max-width:420px) {
  .title small { display:none; }
  .hud { font-size:11px; }
}
