:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #14141f;
  --bg-tertiary: #1e1e2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent: #00d4ff;
  --accent-secondary: #00ff88;
  --danger: #ff4466;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --radius-md: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 600px; height: 600px; overflow: hidden;
  background: #000;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
#app { width: 100%; height: 100%; position: relative; }
.screen { width: 100%; height: 100%; position: absolute; top: 0; left: 0; display: flex; flex-direction: column; }
.screen.hidden { display: none; }
.focusable { transition: all 0.15s ease; border: 2px solid transparent; cursor: pointer; outline: none; }
.focusable:focus { border-color: var(--focus-ring); box-shadow: 0 0 20px var(--focus-glow); }
.hidden { display: none !important; }

/* ---- Bars / headers ---- */
.bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; background: var(--bg-primary);
  border-bottom: 1px solid #23232f; flex: 0 0 auto;
}
.bar h2 { font-size: 26px; font-weight: 700; }
.game-bar { font-size: 20px; color: var(--text-secondary); font-weight: 600; }
.game-bar #scoreLabel { color: var(--accent); }
.hint-bar {
  flex: 0 0 auto; text-align: center; padding: 12px;
  color: var(--text-muted); font-size: 15px; letter-spacing: 0.3px;
  background: var(--bg-primary);
}

/* ---- Home hero ---- */
.hero { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.hero-clef { font-size: 96px; line-height: 1; color: var(--accent); text-shadow: 0 0 24px rgba(0,212,255,0.4); }
.hero h1 { font-size: 40px; font-weight: 800; text-align: center; line-height: 1.05; letter-spacing: 0.5px; }
.subtitle { color: var(--text-secondary); font-size: 17px; margin-top: 4px; }

/* ---- Menu ---- */
.menu { display: flex; flex-direction: column; gap: 12px; padding: 16px 24px; flex: 0 0 auto; }
.menu.grow { flex: 1 1 auto; justify-content: center; }
.menu.compact { padding-bottom: 20px; }
.menu-item {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 76px; border-radius: var(--radius-md);
  background: var(--bg-secondary); color: var(--text-primary);
  font-size: 23px; font-weight: 600; font-family: inherit;
  padding: 10px 22px; text-align: center;
}
.menu-item.start { justify-content: space-between; }
.menu-item .mi-label { font-weight: 700; }
.mode-tag {
  font-size: 14px; font-weight: 600; color: #04121a; background: var(--accent);
  padding: 5px 12px; border-radius: 999px; white-space: nowrap;
}
.menu-item.two { flex-direction: column; gap: 4px; min-height: 84px; }
.menu-item.two b { font-size: 24px; }
.menu-item.two small { font-size: 15px; color: var(--text-secondary); font-weight: 500; }

/* ---- Game ---- */
.prompt { text-align: center; color: var(--text-secondary); font-size: 19px; padding: 12px 0 4px; flex: 0 0 auto; }
.staff-wrap {
  flex: 1 1 auto; min-height: 0; margin: 4px 18px; border-radius: var(--radius-md);
  background: var(--bg-primary); border: 1px solid #20202c;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
#staff { width: 100%; height: 100%; }
.staff-line { stroke: #b6bccb; stroke-width: 2; stroke-linecap: round; }
.note-head { fill: #ffffff; filter: drop-shadow(0 0 7px rgba(255,255,255,0.55)); }
.note-stem { stroke: #ffffff; stroke-width: 3.5; stroke-linecap: round; }
.clef { fill: var(--accent); }
.clef-stroke { stroke: var(--accent); stroke-width: 6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.clef-dot { fill: var(--accent); }

.feedback { flex: 0 0 auto; height: 34px; text-align: center; font-size: 21px; font-weight: 700; color: var(--text-muted); }
.feedback.ok { color: var(--accent-secondary); }
.feedback.bad { color: var(--danger); }

.answers { flex: 0 0 auto; display: flex; justify-content: center; gap: 9px; padding: 4px 16px 6px; }
.note-btn {
  width: 66px; height: 78px; border-radius: 12px;
  background: var(--bg-secondary); color: var(--text-primary);
  font-size: 30px; font-weight: 700; font-family: inherit;
}
.note-btn.correct { background: rgba(0,255,136,0.22); border-color: var(--accent-secondary); color: var(--accent-secondary); }
.note-btn.wrong { background: rgba(255,68,102,0.22); border-color: var(--danger); color: var(--danger); }

/* ---- Result ---- */
.result-body { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.score-big { font-size: 88px; font-weight: 800; color: var(--accent); line-height: 1; }
.score-sub { font-size: 19px; color: var(--text-secondary); }
.res-msg { font-size: 24px; font-weight: 700; margin-top: 10px; color: var(--accent-secondary); }

/* ---- How to ---- */
.doc { flex: 1 1 auto; overflow-y: auto; padding: 18px 24px; font-size: 18px; line-height: 1.5; color: var(--text-secondary); }
.doc b { color: var(--text-primary); }
.doc p { margin-bottom: 14px; }
.doc-small { font-size: 16px; }
.mnemo { background: var(--bg-secondary); border-radius: var(--radius-md); padding: 16px 18px; margin-bottom: 16px; }
.mnemo-row { display: flex; justify-content: space-between; font-size: 21px; color: var(--text-primary); font-weight: 700; margin-top: 6px; }
.mnemo-row .mnemo-k { color: var(--accent); }
.mnemo-sub { font-size: 15px; margin-bottom: 6px; }

/* ---- Stats ---- */
.stats-grid { flex: 1 1 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 22px 24px; align-content: center; }
.stat { background: var(--bg-secondary); border-radius: var(--radius-md); padding: 22px; text-align: center; }
.stat-num { font-size: 46px; font-weight: 800; color: var(--accent); line-height: 1; }
.stat-cap { font-size: 15px; color: var(--text-secondary); margin-top: 8px; text-transform: uppercase; letter-spacing: 1px; }
