:root { --bg:#0e1a12; --panel:rgba(12,22,16,.92); --ink:#f3f1e8; --dim:#a9b4a6; --accent:#e9c46a; --red:#e76f51; --line:rgba(255,255,255,.12); }
* { box-sizing: border-box; }
html, body { margin:0; height:100%; background:var(--bg); color:var(--ink); font:16px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; overflow:hidden; }
canvas#scene { position:fixed; inset:0; width:100%; height:100%; display:block; }
[hidden] { display:none !important; }
.panel { position:fixed; left:50%; top:50%; transform:translate(-50%,-50%); width:min(460px, calc(100% - 32px)); max-height:calc(100% - 32px); overflow:auto;
  background:var(--panel); border:1px solid var(--line); border-radius:16px; padding:24px; backdrop-filter:blur(6px); }
h1 { margin:0 0 4px; font-size:28px; } h2 { margin:0 0 8px; }
.sub { color:var(--dim); margin:8px 0; } .err { color:var(--red); min-height:1.2em; margin:8px 0 0; }
.big { font-size:40px; font-weight:700; margin:8px 0; }
.card { border:1px solid var(--line); border-radius:12px; padding:12px; margin:12px 0; }
.row { display:flex; gap:8px; margin-top:8px; } .row.wrap { flex-wrap:wrap; } .row > * { flex:1; }
button { font:inherit; font-weight:600; border:0; border-radius:10px; padding:10px 14px; background:var(--accent); color:#1b1b1b; cursor:pointer; }
button.ghost { background:transparent; color:var(--ink); border:1px solid var(--line); }
button.small { padding:6px 10px; font-size:13px; }
button:disabled { opacity:.4; cursor:not-allowed; }
button:focus-visible, input:focus-visible, select:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
input, select { font:inherit; width:100%; padding:10px; margin:4px 0; border-radius:8px; border:1px solid var(--line); background:#0a130d; color:var(--ink); }
label { display:flex; flex-direction:column; font-size:13px; color:var(--dim); min-width:110px; }
.list { display:flex; flex-direction:column; gap:6px; margin:8px 0 16px; }
.list button { text-align:left; display:flex; justify-content:space-between; }
.list button small { color:#555; font-weight:400; }
ol { padding-left:24px; } ol li { padding:4px 0; border-bottom:1px solid var(--line); }
#hud { position:fixed; inset:12px 12px auto 12px; display:flex; align-items:center; gap:16px; pointer-events:none; }
#hud .hud-btns { margin-left:auto; display:flex; gap:8px; } #hud button { pointer-events:auto; background:var(--panel); }
.score { background:var(--panel); border-radius:12px; padding:8px 14px; font-size:26px; font-weight:700; display:flex; gap:10px; align-items:baseline; }
.score small { font-size:14px; color:var(--dim); font-weight:400; }
.balls { display:flex; gap:4px; } .balls span { min-width:28px; height:28px; border-radius:14px; background:var(--panel); display:grid; place-items:center; font-size:13px; font-weight:700; padding:0 6px; }
.balls .w { background:var(--red); } .balls .b { background:#2a9d8f; } .balls .s { background:var(--accent); color:#111; }
.meter { width:120px; height:8px; background:var(--panel); border-radius:4px; overflow:hidden; } .meter.big { width:100%; height:14px; margin:12px 0; }
.meter div { height:100%; width:0; background:var(--accent); transition:width .06s; }
#toast { position:fixed; left:50%; top:30%; transform:translateX(-50%); text-align:center; pointer-events:none; text-shadow:0 2px 12px #000; }
#toast b { display:block; font-size:64px; } #toast span { font-size:20px; color:var(--ink); }
@media (max-width:600px) { #toast b { font-size:44px; } .score { font-size:20px; } .meter { display:none; } }

/* aiming: the panel sits to one side so the player demonstrating the pose stays in view */
#s-calib { left:auto; right:4%; top:50%; transform:translateY(-50%); width:min(400px, 42%); }
#s-calib.left { right:auto; left:4%; }
@media (max-aspect-ratio: 1/1) { #s-calib, #s-calib.left { left:50%; right:auto; top:auto; bottom:16px; transform:translateX(-50%); width:calc(100% - 32px); } }

.note { color:var(--accent); margin:4px 0; } .note:empty { display:none; }
#hud button.update, button.update { background:var(--accent); color:#1b1b1b; border:0; }

/* inside the TV app: a remote moves the focus, so make it obvious */
body.tv button:focus, body.tv select:focus, body.tv input:focus { outline:3px solid #fff; outline-offset:2px; }
body.tv button:focus:not(.ghost) { box-shadow:0 0 0 6px rgba(233,196,106,.35); }

#aimchip { position:fixed; left:50%; bottom:28px; transform:translateX(-50%); background:var(--panel); border:1px solid var(--line); border-radius:999px; padding:8px 18px; font-weight:600; pointer-events:none; max-width:calc(100% - 32px); text-align:center; }
