:root { --bg:#10222b; --panel:#17313c; --ink:#e9f1f3; --muted:#9fb6bb; --teal:#35c1bd; --coral:#f0705c; --line:#2a4753; }
* { box-sizing: border-box; }
html, body { margin:0; height:100%; background:var(--bg); color:var(--ink); font: 15px/1.45 -apple-system, "Helvetica Neue", Arial, sans-serif; }
h1 { font-size: 20px; margin: 0 0 4px; } h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; }
button { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; cursor: pointer; }
button.on { background: var(--teal); color: #06272a; border-color: var(--teal); font-weight: 700; }
button:disabled { opacity: .45; cursor: default; }
.muted { color: var(--muted); } .mono { font-family: ui-monospace, Menlo, monospace; }

/* ---- screen ---- */
.screen { display:grid; grid-template-columns: 300px 1fr 360px; gap:16px; padding:16px; height:100%; }
.panel { background: var(--panel); border:1px solid var(--line); border-radius:14px; padding:14px; overflow:auto; }
.qr { background:#fff; border-radius:10px; padding:8px; width:100%; aspect-ratio:1; }
.qr img { width:100%; height:100%; display:block; }
.code { font: 700 34px ui-monospace, Menlo, monospace; letter-spacing:.2em; text-align:center; margin:8px 0 2px; }
.url { font-size:12px; word-break: break-all; }
.stage { position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:28px; }
.scene { width:260px; height:260px; perspective:900px; }
.cube { width:100%; height:100%; position:relative; transform-style:preserve-3d; }
.cube div { position:absolute; inset:30px; border:2px solid rgba(255,255,255,.35); border-radius:14px; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:22px; opacity:.92; }
.f1{background:#35c1bd;transform:translateZ(100px)} .f2{background:#1d8f8c;transform:rotateY(180deg) translateZ(100px)}
.f3{background:#f0705c;transform:rotateY(90deg) translateZ(100px)} .f4{background:#c9503e;transform:rotateY(-90deg) translateZ(100px)}
.f5{background:#f2c14e;color:#3a2c00;transform:rotateX(90deg) translateZ(100px)} .f6{background:#7d8fa0;transform:rotateX(-90deg) translateZ(100px)}
#flash { width:220px; height:90px; border-radius:14px; border:2px solid var(--line); display:flex; align-items:center; justify-content:center; color:var(--muted); }
#flash.hit { background:#fff; color:#000; border-color:#fff; }
table.stats { width:100%; border-collapse:collapse; font-size:13px; }
table.stats td { padding:4px 0; border-bottom:1px solid var(--line); } table.stats td:last-child { text-align:right; font-family: ui-monospace, Menlo, monospace; }
.row { display:flex; gap:8px; flex-wrap:wrap; margin:8px 0; }
.big { font: 700 28px ui-monospace, Menlo, monospace; }
.counts { display:grid; grid-template-columns: repeat(3,1fr); gap:8px; text-align:center; margin:8px 0; }
.counts div { background:var(--bg); border-radius:10px; padding:8px 4px; } .counts span { display:block; font-size:11px; color:var(--muted); }
canvas { width:100%; height:120px; background:var(--bg); border-radius:10px; display:block; }
.pill { display:inline-block; padding:2px 10px; border-radius:99px; font-size:12px; font-weight:700; background:#3a4f59; }
.pill.ok { background: var(--teal); color:#06272a; } .pill.warn { background: var(--coral); color:#2b0a05; }
@media (max-width: 1100px) { .screen { grid-template-columns: 1fr; height:auto; } }

/* ---- controller ---- */
.ctl { display:flex; flex-direction:column; height:100%; padding:14px; gap:12px; touch-action:none; user-select:none; -webkit-user-select:none; }
.ctl #start { font-size:22px; padding:26px; background:var(--teal); color:#06272a; font-weight:700; border:0; }
#tap { flex:1; border-radius:18px; border:2px dashed var(--line); display:flex; align-items:center; justify-content:center; font-size:22px; color:var(--muted); min-height:160px; }
#tap.hit { background:#fff; color:#000; border-color:#fff; }
#pocket { position:fixed; inset:0; background:#000; color:#333; display:none; align-items:center; justify-content:center; text-align:center; font-size:16px; padding:30px; z-index:10; touch-action:none; }
#pocket.show { display:flex; }
#status { font-size:13px; color:var(--muted); min-height:38px; }
