:root { --bg:#0b1020; --panel:#131b30; --ink:#e8f1f5; --muted:#8fa7b5; --accent:#2ec4b6; --gold:#ffd166; --bad:#ef476f; }
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--ink); font:15px/1.5 system-ui,-apple-system,sans-serif; touch-action:manipulation; }
#app { max-width:940px; margin:0 auto; padding:12px; }
.topbar,.actions,.hud,.meter-label,#statusbar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.topbar { padding:6px 2px 10px; }
.title { font-size:20px; font-weight:750; letter-spacing:.2px; }
.title small { color:var(--accent); font-size:12px; font-weight:600; margin-left:6px; }
.spacer { flex:1; }
.hud { font-size:12px; color:var(--muted); }
.hud b { color:var(--ink); font-variant-numeric:tabular-nums; }
.opt { margin-left:8px; }
#stage { position:relative; background:var(--panel); border-radius:14px; padding:8px; overflow:hidden; }
canvas { display:block; width:100%; height:auto; border-radius:10px; touch-action:none; background:#0a1426; }
.hidden { display:none !important; }
#overlay { position:absolute; inset:0; display:grid; place-items:center; background:rgba(6,10,22,.72); }
.card { background:var(--panel); border:1px solid #2a3a55; border-radius:14px; padding:18px 22px; min-width:260px; text-align:center; box-shadow:0 12px 40px rgba(0,0,0,.4); }
.card-label { font-size:20px; font-weight:750; color:var(--gold); margin-bottom:10px; }
.card-body { display:flex; justify-content:space-around; gap:18px; margin-bottom:16px; }
.card-body div { display:flex; flex-direction:column; color:var(--muted); font-size:12px; }
.card-body b { color:var(--ink); font-size:20px; font-variant-numeric:tabular-nums; }
#meters { margin:10px 0; }
.meter { background:var(--panel); border-radius:12px; padding:10px 14px; }
.meter-label { justify-content:space-between; font-weight:650; }
.meter-label span { color:var(--gold); font-variant-numeric:tabular-nums; }
input[type=range] { width:100%; accent-color:var(--accent); min-height:36px; }
.bins { display:flex; justify-content:space-between; gap:2px; margin-top:2px; font-size:11px; color:var(--muted); }
.bins span { flex:1; text-align:center; padding:2px 0; border-radius:5px; }
.bins span.hi { color:#0b1020; background:var(--gold); font-weight:750; }
.bins span.lo { color:#0b1020; background:var(--accent); }
#statusbar { margin-top:8px; }
#status { flex:1 1 100%; min-height:22px; color:var(--muted); }
#status[data-tone=good] { color:var(--accent); }
#status[data-tone=bad] { color:var(--bad); }
.btn { min-height:44px; padding:8px 12px; border:1px solid #33445f; border-radius:10px; background:#1a2740; color:var(--ink); font-size:14px; font-weight:650; cursor:pointer; touch-action:manipulation; }
.btn:hover { background:#223657; }
.btn.primary { background:var(--accent); color:#06231f; border-color:var(--accent); }
.btn.wide { min-width:120px; }
.btn.icon { min-width:48px; font-size:18px; }
.btn.held { outline:3px solid var(--gold); }
.btn:disabled { opacity:.45; cursor:default; }
.hint { flex:1 1 100%; color:var(--muted); font-size:12px; }
.modal-card { max-width:620px; margin:8vh auto; background:var(--panel); border:1px solid #2a3a55; border-radius:14px; padding:20px 24px; }
#modal { position:fixed; inset:0; background:rgba(5,8,18,.82); overflow:auto; z-index:20; }
.modal-card h2 { margin-top:0; color:var(--gold); }
.modal-card ol { padding-left:20px; }
.modal-card li { margin:8px 0; }
.muted { color:var(--muted); font-size:13px; }
#toast { position:fixed; left:50%; bottom:24px; transform:translateX(-50%) translateY(20px); background:var(--accent); color:#06231f; padding:10px 18px; border-radius:10px; font-weight:700; opacity:0; pointer-events:none; transition:.2s; z-index:30; }
#toast.show { opacity:1; transform:translateX(-50%) translateY(0); }
@media (max-width:560px) {
  .title { font-size:17px; }
  .hud { font-size:11px; }
  .actions .btn { min-height:46px; padding:6px 8px; font-size:12px; }
  .btn.wide { min-width:90px; }
  .hint { font-size:11px; }
}
