@font-face {
  font-family: 'Strato';
  src: url('../fretboard-coach/strato.regular.ttf') format('truetype');
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:        #07090f;
  --fg:        #dce8f8;
  --accent:    #00c8aa;
  --accent2:   #3d9eff;
  --muted:     #4a6880;
  --border:    #1a2d42;
  --surface:   #0d1520;
  --surface2:  #121e2e;
  --surface3:  #060c14;
  --correct:   #3ddc84;
  --wrong:     #ff5252;
  --hint:      #a78bfa;
  --dot-bg:    #0d1828;
  --dot-border:#1e3550;
}

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'IBM Plex Mono', monospace;
  min-height: 100vh;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 14px 40px;
  gap: 16px;
  background-image:
    radial-gradient(ellipse at 50% -10%, rgba(0,200,170,0.12) 0%, rgba(61,158,255,0.06) 35%, transparent 65%),
    radial-gradient(ellipse at 50% 110%, rgba(61,158,255,0.07) 0%, transparent 55%);
  background-attachment: fixed;
}

/* ── Header ──────────────────────────────────────────── */
.header-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  max-width: 680px;
  position: relative;
  margin-top: 20px;
}

header { text-align: center; }

h1 {
  font-family: 'Strato', 'Bebas Neue', cursive;
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  letter-spacing: 0.06em;
  color: #f0f8ff;
  line-height: 1;
  margin-bottom: 8px;
  text-shadow: 0 0 32px rgba(0,200,170,0.35), 0 2px 4px rgba(0,0,0,.6);
}

.subtitle {
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  opacity: 0.8;
}

/* ── Lang / Back ─────────────────────────────────────── */
.lang-btn {
  position: absolute;
  right: 0;
  top: 56px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 14px;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
  transition: all 0.15s;
}
.lang-btn:hover { border-color: var(--accent); color: var(--accent); }

.back-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-decoration: none;
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  width: 100%;
  max-width: 680px;
  transition: all 0.15s;
}
.back-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Mode bar ─────────────────────────────────────────── */
.mode-bar {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 680px;
}

.mode-btn {
  flex: 1;
  padding: 11px 6px;
  border-radius: 5px;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: all 0.15s;
}
.mode-btn.active {
  background: var(--surface2);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 10px rgba(0,200,170,0.12);
}
.mode-btn:hover:not(.active) { border-color: var(--muted); color: var(--fg); }

/* ── Score bar ───────────────────────────────────────── */
.score-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}
.score-bar b { color: var(--fg); }

/* ── Progress dots ───────────────────────────────────── */
.progress {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 4px;
}

.prog-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dot-bg);
  border: 1px solid var(--dot-border);
}
.prog-dot.correct { background: var(--correct); border-color: var(--correct); }
.prog-dot.wrong   { background: var(--wrong);   border-color: var(--wrong); }
.prog-dot.active  {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 7px var(--accent);
}

/* ── Piano ───────────────────────────────────────────── */
.piano-wrap {
  width: 100%;
  max-width: 680px;
  background: var(--surface3);
  border-radius: 8px;
  padding: 18px 18px 12px;
  border: 1px solid var(--border);
  display: flex;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.03);
}

.piano-wrap svg {
  display: block;
  width: 100%;
  max-width: 580px;
  overflow: visible;
}

/* ── Play area ───────────────────────────────────────── */
.play-area {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  max-width: 680px;
}

.play-btn {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #000;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s, transform 0.1s;
  box-shadow: 0 0 16px rgba(0,200,170,0.25);
}
.play-btn:hover  { opacity: 0.85; }
.play-btn:active { transform: scale(0.92); }

@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0   rgba(0,200,170,0.55); }
  70%  { box-shadow: 0 0 0 16px rgba(0,200,170,0); }
  100% { box-shadow: 0 0 0 0   rgba(0,200,170,0); }
}
.play-btn.playing { animation: pulse-ring 1.1s ease-out infinite; }

.play-side {
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}

.replay-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--muted);
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 8px 14px;
  text-align: left;
  transition: all 0.15s;
}
.replay-btn:hover { border-color: var(--accent2); color: var(--accent2); }

.dir-bar {
  display: flex;
  gap: 7px;
}

.dir-btn {
  flex: 1;
  padding: 7px 4px;
  border-radius: 5px;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: all 0.15s;
}
.dir-btn.active {
  background: var(--surface2);
  border-color: var(--accent2);
  color: var(--accent2);
}
.dir-btn:hover:not(.active) { border-color: var(--muted); color: var(--fg); }

/* ── Question box ────────────────────────────────────── */
.question-box {
  width: 100%;
  max-width: 680px;
}

.question-type {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.question-text {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.5rem, 4.5vw, 2.1rem);
  letter-spacing: 0.05em;
  line-height: 1.25;
  color: var(--fg);
}

.question-text .hl {
  color: var(--accent);
}

/* ── Answers ─────────────────────────────────────────── */
.answers {
  width: 100%;
  max-width: 680px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.answer-btn {
  padding: 16px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
  transition: all 0.12s;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg);
}
.answer-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface2);
}
.answer-btn:disabled { cursor: default; }

.answer-btn.correct {
  background: var(--surface2);
  border-color: var(--correct);
  color: var(--correct);
  box-shadow: 0 0 12px rgba(61,220,132,0.15);
}
.answer-btn.reveal {
  background: var(--surface2);
  border-color: var(--correct);
  color: var(--correct);
  opacity: .6;
}
.answer-btn.wrong {
  background: var(--surface2);
  border-color: var(--wrong);
  color: var(--wrong);
}

/* ── Feedback ────────────────────────────────────────── */
.feedback {
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-align: center;
  min-height: 24px;
  color: var(--muted);
}
.feedback.correct { color: var(--correct); }
.feedback.wrong   { color: var(--wrong); }

/* ── Mnemonic hint ───────────────────────────────────── */
.mnemonic {
  font-size: 0.8rem;
  letter-spacing: 0.07em;
  text-align: center;
  min-height: 20px;
  color: var(--hint);
  font-style: italic;
  opacity: 0.9;
}

/* ── Next button ─────────────────────────────────────── */
.next-btn {
  display: none;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 6px;
  padding: 14px 50px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.25rem;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: opacity 0.15s;
}
.next-btn.visible { display: block; }
.next-btn:hover { opacity: 0.85; }

/* ── Footer ──────────────────────────────────────────── */
.site-footer {
  margin-top: 24px;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-align: center;
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* ── Chord controls (stage + voicing, chord mode only) ─ */
.diff-bar,
.voicing-bar {
  display: none;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 680px;
  margin-top: -4px;
}
.diff-bar.visible,
.voicing-bar.visible { display: flex; }

.diff-label {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Stage number buttons sit inside a nested flex container */
.diff-stages {
  display: flex;
  gap: 5px;
}

.diff-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 5px;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.diff-btn.active {
  background: var(--surface2);
  border-color: var(--accent2);
  color: var(--accent2);
  box-shadow: 0 0 8px rgba(61,158,255,0.12);
}
.diff-btn:hover:not(.active) { border-color: var(--muted); color: var(--fg); }

/* Stage description (e.g. "Dur / Moll") */
.diff-desc {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--accent2);
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Voicing buttons – same shape as diff-btn but slightly wider */
.voicing-btn {
  flex: 1;
  padding: 7px 6px;
  border-radius: 5px;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: all 0.15s;
}
.voicing-btn.active {
  background: var(--surface2);
  border-color: var(--hint);
  color: var(--hint);
  box-shadow: 0 0 8px rgba(167,139,250,0.12);
}
.voicing-btn:hover:not(.active) { border-color: var(--muted); color: var(--fg); }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 560px) {
  .answers { grid-template-columns: 1fr; }
  .header-row { flex-direction: column; align-items: center; gap: 10px; }
  .lang-btn { position: static; }
  .play-btn { width: 54px; height: 54px; font-size: 1.2rem; }
  .dir-btn  { font-size: 0.6rem; padding: 6px 3px; }
}
