:root { --bg:#0b0d12; --text:#e8ecf4; --panel:#141823; --border:#232a3a; --muted:#6f7a94; --board:#07090d; --boardborder:#2a3248; --overlay:#07090dec; --btn:#1b2132; --btnborder:#2e3852; --btnhover:#26304a; --muted2:#8b96b3; --accent:#42afe1; --yellow:#f6d03c; --grid:#141a26; }
:root[data-theme="light"] { --bg:#eef1f6; --text:#1a2030; --panel:#fff; --border:#d3d9e6; --muted:#6a7490; --board:#f8f9fc; --boardborder:#b8c0d4; --overlay:#f8f9fcec; --btn:#fff; --btnborder:#c3cbdd; --btnhover:#e6ecf8; --muted2:#5b6580; --accent:#1f8fc4; --yellow:#b88a00; --grid:#e1e6f0; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: "Segoe UI", system-ui, sans-serif; user-select: none; }
body { display: flex; align-items: center; justify-content: center; }
#app { display: flex; gap: 18px; align-items: flex-start; }
.side { width: 150px; display: flex; flex-direction: column; gap: 12px; }
.left { align-items: flex-end; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 8px; width: 100%; }
.panel h4 { margin: 0 0 6px; font-size: 11px; letter-spacing: .15em; color: var(--muted); text-align: center; }
.panel canvas { display: block; margin: 0 auto; }
.stats { display: flex; flex-direction: column; gap: 8px; }
.stat { display: flex; flex-direction: column; text-align: right; }
.stat .label { font-size: 10px; letter-spacing: .15em; color: var(--muted); }
.stat span:last-child { font-size: 20px; font-variant-numeric: tabular-nums; }
.stat.big span:last-child { font-size: 24px; }
#action { min-height: 90px; width: 100%; text-align: right; font-weight: 700; line-height: 1.25; }
#action .a1 { font-size: 15px; color: var(--text); }
#action .a2 { font-size: 13px; color: var(--yellow); }
#action .a3 { font-size: 13px; color: var(--accent); }
#action.pop { animation: fade 1.6s forwards; }
@keyframes fade { 0% { opacity: 1; transform: translateX(6px); } 10% { transform: none; } 70% { opacity: 1; } 100% { opacity: 0; } }

.boardwrap { position: relative; width: 300px; height: 600px; border: 2px solid var(--boardborder); background: var(--board); box-shadow: 0 0 40px #000a; }
#board { display: block; }
#center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 72px; font-weight: 800; pointer-events: none; text-shadow: 0 0 20px var(--accent); }

.overlay { position: absolute; inset: 0; background: var(--overlay); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; overflow-y: auto; }
.overlay.hidden { display: none; }
.overlay h1 { margin: 0 0 14px; letter-spacing: .2em; font-size: 26px; }
.overlay h2 { margin: 0 0 6px; letter-spacing: .15em; }
.overlay h3 { margin: 6px 0 0; font-size: 12px; letter-spacing: .15em; color: var(--muted); }
.overlay h3 small { text-transform: none; letter-spacing: 0; }
button { width: 100%; background: var(--btn); color: var(--text); border: 1px solid var(--btnborder); border-radius: 6px; padding: 10px; font-size: 15px; font-weight: 700; letter-spacing: .1em; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
button small { font-weight: 400; font-size: 11px; letter-spacing: 0; color: var(--muted2); margin-top: 2px; }
button:hover { background: var(--btnhover); border-color: var(--accent); }
button.alt { background: transparent; }
.pb { font-size: 12px; color: var(--muted2); text-align: center; line-height: 1.6; margin-top: 8px; }
#resBody { text-align: center; line-height: 1.8; font-size: 15px; margin-bottom: 8px; }
#resBody b { color: var(--yellow); font-size: 22px; }

.sliders { width: 100%; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.sliders label { display: flex; flex-direction: column; gap: 2px; }
.sliders label span { color: var(--accent); float: right; }
.sliders label.chk { flex-direction: row; align-items: center; gap: 8px; }
#keys { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; font-size: 12px; align-items: center; }
#keys button { padding: 4px; font-size: 11px; letter-spacing: 0; }
#keys button.listening { border-color: var(--yellow); color: var(--yellow); }

.hint { font-size: 12px; color: var(--muted); line-height: 1.8; }
.hint b { color: var(--text); }
