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

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

:root {
  --bg:             #0d0200;
  --fg:             #ffe4b0;
  --accent:         #ff9500;
  --muted:          #a06020;
  --border:         #6a2800;
  --surface:        #1a0500;
  --surface2:       #2a0800;
  --surface3:       #0a0200;
  --correct:        #7ec850;
  --wrong:          #ff5020;
  --third:          #4fc3f7;
  --fifth:          #d070ff;
  --str-color:      rgba(255,160,40,0.65);
  --fret-color:     #6a3010;
  --str-label:      #d07030;
  --dot-bg:         #3a1000;
  --dot-border:     #7a3010;
  --pos-dot-fill:   #4a1500;
  --pos-dot-stroke: #9a3515;
}

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% -5%, #e89000 0%, #8b3000 28%, #3d0900 55%, #0d0200 80%);
  background-attachment: fixed;
}

.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', cursive;
  font-size: clamp(2.5rem, 8vw, 3.8rem);
  letter-spacing: 0.04em;
  color: #f8f4e8;
  line-height: 1;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0,0,0,.5);
}

.subtitle {
  color: #f8f4e8;
  font-size: 1.1rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-top: 3px;
}

.question-box { width: 100%; max-width: 680px; }

.question-type {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  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.04em;
  line-height: 1.25;
}

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

.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: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  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);
}

.answer-btn:disabled { cursor: default; }

.answer-btn.reveal {
  background: var(--surface2);
  border-color: var(--correct);
  color: var(--correct);
  opacity: .75;
}

.answer-btn.correct {
  background: var(--surface2);
  border-color: var(--correct);
  color: var(--correct);
}

.answer-btn.wrong {
  background: var(--surface2);
  border-color: var(--wrong);
  color: var(--wrong);
}

.answers.shape-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 18px;
  max-width: 980px;
  margin: 0 auto;
  align-items: stretch;
}

.shape-btn {
  padding: 12px;
  height: auto;
  line-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shape-btn.wrong { opacity: 0.35; }

.feedback {
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-align: center;
  min-height: 24px;
  color: var(--muted);
}

.feedback.correct { color: var(--correct); }
.feedback.wrong { color: var(--wrong); }

.next-btn {
  display: none;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 6px;
  padding: 15px 50px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 0.12em;
  cursor: pointer;
}

.next-btn.visible { display: block; }
.next-btn:hover { opacity: 0.88; }

.score-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  color: var(--fg);
  font-weight: 600;
}

.score-bar b { color: var(--accent); }

.lang-btn {
  position: absolute;
  right: 0;
  top: 60px;
  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.1em;
  color: var(--muted);
}

.lang-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.back-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  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;
}

.back-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.mode-bar {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 680px;
  margin-bottom: 10px;
}

.mode-btns {
  display: flex;
  gap: 10px;
  flex: 1;
}

.mode-menu-btn {
  display: none;
}

.mode-btn {
  flex: 1;
  padding: 12px 6px;
  border-radius: 5px;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}

.mode-btn.active {
  background: var(--surface2);
  border-color: var(--accent);
  color: var(--accent);
}

.progress {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 10px;
}

.prog-dot {
  width: 10px;
  height: 10px;
  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 6px var(--accent);
}

.fretboard-wrap {
  width: 100%;
  max-width: 680px;
  background: var(--surface3);
  border-radius: 6px;
  padding: 20px 18px 6px;
  border: 1px solid var(--border);
}

.fretboard-wrap svg {
  display: block;
  width: 100%;
  overflow: visible;
}

.fret-numbers {
  position: relative;
  height: 20px;
  margin-top: 3px;
}

.triad-legend {
  display: none;
  gap: 14px;
  width: 100%;
  max-width: 680px;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  justify-content: center;
  margin-top: 10px;
  margin-bottom: 10px;
}

.triad-legend.visible { display: flex; }
.triad-legend.scale-context .tl-item { display: none; }

.tl-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.tl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tl-dot.tl-root  { background: var(--accent); }
.tl-dot.tl-third { background: var(--third); }
.tl-dot.tl-fifth { background: var(--fifth); }

.tl-root  { color: var(--accent); }
.tl-third { color: var(--third); }
.tl-fifth { color: var(--fifth); }

.inversion-label {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 2px;
}

@media (max-width: 900px) {
  .answers.shape-mode {
    max-width: 760px;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }
}

@media (max-width: 700px) {
  .answers.shape-mode {
    grid-template-columns: 1fr;
    max-width: 520px;
  }
}

@media (max-width: 560px) {
  .answers { grid-template-columns: 1fr; }
  .header-row { flex-direction: column; align-items: center; gap: 10px; }
  .lang-btn { position: static; }

  .mode-bar { flex-direction: column; gap: 0; position: relative; }

  .mode-menu-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--accent);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
  }
  .mode-menu-btn:hover { border-color: var(--accent); }
  .mode-menu-arrow { transition: transform 0.2s; display: inline-block; }
  .mode-bar.open .mode-menu-arrow { transform: rotate(180deg); }

  .mode-btns {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding-top: 6px;
  }
  .mode-bar.open .mode-btns { display: flex; }

  .mode-btn {
    flex: none;
    width: 100%;
    padding: 10px 14px;
    text-align: left;
  }
}

/* ── Feedback widget ───────────────────────────────────── */
.feedback-trigger {
  margin-top: 8px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  padding: 7px 18px;
  cursor: pointer;
}
.feedback-trigger:hover { border-color: var(--accent); color: var(--accent); }

.feedback-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.feedback-modal.open { display: flex; }

.feedback-modal-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.feedback-modal-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.1em;
  color: var(--fg);
}
.feedback-textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--fg);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9rem;
  padding: 10px 12px;
  resize: vertical;
  width: 100%;
}
.feedback-textarea:focus { outline: none; border-color: var(--accent); }
.feedback-modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.feedback-cancel {
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--muted);
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  padding: 8px 16px;
}
.feedback-cancel:hover { border-color: var(--wrong); color: var(--wrong); }
.feedback-send {
  background: var(--accent);
  border: none;
  border-radius: 5px;
  color: #000;
  cursor: pointer;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.08em;
  padding: 8px 20px;
}
.feedback-send:hover { opacity: 0.85; }

/* ── Footer ────────────────────────────────────────────── */
.site-footer {
  margin-top: 24px;
  font-size: 0.7rem;
  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);
}