:root { --bg:#10162b; --panel:#171f38; --ink:#eef3fb; --muted:#94a5c0; --accent:#6ee7b7; --gold:#ffd166; --bad:#fb7185; --line:#2b3a5c; }
* { 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:1000px; margin:0 auto; padding:12px; }
.topbar,.actions,.hud,#statusbar,.touchbar { 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:#0c1326; }
.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 var(--line); border-radius:14px; padding:18px 22px; min-width:270px; 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; }
#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); }
.touchbar { margin:10px 0; }
.touchbar .pad { flex:1; }
.btn { min-height:44px; padding:8px 12px; border:1px solid var(--line); border-radius:10px; background:#1c2846; color:var(--ink); font-size:14px; font-weight:650; cursor:pointer; touch-action:manipulation; }
.btn:hover { background:#25355c; }
.btn.primary { background:var(--accent); color:#06231f; border-color:var(--accent); }
.btn.icon { min-width:48px; font-size:18px; }
.btn.pad { min-height:56px; font-size:18px; user-select:none; -webkit-user-select:none; }
.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 var(--line); 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 .muted { color:var(--muted); font-size:13px; }
@media (max-width:520px) { .title { font-size:17px; } .hud { font-size:11px; } }
