:root {
  color-scheme: light dark;
  --bg: #faf8f5;
  --panel-bg: #ffffff;
  --text: #23201c;
  --muted-text: #6b6459;
  --accent: #b5502f;
  --border: #ddd4c8;
  --dot: #b5502f;
  --good: #2e7d32;
  --bad: #c62828;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1a17;
    --panel-bg: #262320;
    --text: #f2ede4;
    --muted-text: #b3a999;
    --accent: #e2825a;
    --border: #443e35;
    --dot: #e2825a;
    --good: #66bb6a;
    --bad: #ef5350;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  padding: 24px 16px 48px;
}

.page {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.subtitle {
  color: var(--muted-text);
  margin-top: 0;
  margin-bottom: 20px;
}

.difficulty-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.diff-label {
  font-size: 0.9rem;
  color: var(--muted-text);
  font-weight: 600;
}

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 26px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.switch-track::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  background: var(--panel-bg);
  border-radius: 50%;
  transition: transform 0.15s;
}

.switch input:checked + .switch-track {
  background: var(--accent);
}

.switch input:checked + .switch-track::before {
  transform: translateX(20px);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.scoreboard {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
}

.score {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.score-label {
  font-size: 0.8rem;
  color: var(--muted-text);
}

.score-value {
  font-size: 1.8rem;
  font-weight: 700;
}

.score-good .score-value {
  color: var(--good);
}

.score-bad .score-value {
  color: var(--bad);
}

.question {
  font-size: 1.3rem;
  margin-bottom: 24px;
}

.question span {
  color: var(--accent);
  font-weight: 700;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.choice-card {
  background: var(--panel-bg);
  border: 3px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  width: 200px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}

.choice-card:hover:not(.disabled) {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.choice-card.disabled {
  cursor: default;
}

.choice-name {
  display: none;
  margin-top: 8px;
  font-weight: 700;
  color: var(--accent);
}

.choice-card.disabled .choice-name {
  display: block;
}

.choice-card.correct {
  border-color: var(--good);
}

.choice-card.incorrect {
  border-color: var(--bad);
}

.feedback-area {
  min-height: 80px;
}

.feedback {
  font-size: 1.1rem;
  font-weight: 600;
  min-height: 1.5em;
}

.feedback.good {
  color: var(--good);
}

.feedback.bad {
  color: var(--bad);
}

.next-btn {
  font-size: 1rem;
  padding: 10px 24px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: white;
  cursor: pointer;
}

.next-btn:hover {
  opacity: 0.9;
}

.choice-card svg {
  display: block;
  margin: 0 auto;
  width: 100%;
  height: auto;
  aspect-ratio: 220 / 300;
}

.chord-nut {
  fill: var(--text);
}

.chord-fret-line,
.chord-string-line {
  stroke: var(--muted-text);
  stroke-width: 1.5;
}

.chord-barre {
  stroke: var(--dot);
  stroke-width: 14;
  stroke-linecap: round;
  opacity: 0.9;
}

.chord-dot {
  fill: var(--dot);
}

.chord-finger-label {
  fill: var(--panel-bg);
  font-size: 11px;
  font-weight: 700;
}

.chord-open-mute {
  fill: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.chord-string-name {
  fill: var(--muted-text);
  font-size: 11px;
}

.chord-fret-label {
  fill: var(--muted-text);
  font-size: 12px;
}

.chord-missing {
  fill: var(--muted-text);
  font-size: 12px;
}

@media (max-width: 540px) {
  .choices {
    flex-direction: column;
    align-items: center;
  }
}
