.practice-stage {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border-radius: calc(var(--radius-lg) - 6px);
  padding: 18px;
  margin-top: 22px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

#quiz-card.is-correct .practice-stage {
  border-color: rgba(78, 204, 163, 0.5);
  box-shadow: 0 0 0 1px rgba(78, 204, 163, 0.22), 0 20px 40px rgba(78, 204, 163, 0.1);
}

#quiz-card.is-wrong .practice-stage {
  border-color: rgba(233, 69, 96, 0.5);
  box-shadow: 0 0 0 1px rgba(233, 69, 96, 0.18), 0 20px 40px rgba(233, 69, 96, 0.1);
}

.practice-stage .piano-wrap,
.practice-stage .fretboard-wrap {
  margin-top: 14px;
}

.playback-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.piano-key.is-veiled,
.fret-cell.is-veiled .fret-note-dot {
  filter: blur(0.3px);
}

/* ── Answer area ───────────────────────────────────────────── */
.answer-area {
  margin-top: 22px;
  display: grid;
  gap: 10px;
}

.answer-area.layout-count {
  grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
}

.answer-area.layout-choice {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-btn {
  border: none;
  border-radius: 18px;
  background: linear-gradient(180deg, #243a6f 0%, #1c2d55 100%);
  color: white;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 14px 30px rgba(0, 0, 0, 0.2);
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, opacity 140ms ease;
  padding: 16px 14px;
  text-align: left;
}

.choice-btn:hover,
.choice-btn:focus-visible {
  transform: translateY(-2px);
  outline: none;
}

.choice-btn:disabled {
  cursor: not-allowed;
  opacity: 0.88;
}

.choice-btn.is-correct {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
}

.choice-btn.is-wrong {
  background: linear-gradient(180deg, var(--danger-strong) 0%, var(--danger) 100%);
}

.choice-name {
  display: block;
  font-weight: 800;
  font-size: 1rem;
}

.choice-sub {
  display: block;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.72);
  margin-top: 3px;
}

.count-btn {
  min-height: 56px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(180deg, #243a6f 0%, #1c2d55 100%);
  color: white;
  cursor: pointer;
  font-weight: 800;
  font-size: 1.05rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 10px 22px rgba(0, 0, 0, 0.2);
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, opacity 140ms ease;
}

.count-btn:hover,
.count-btn:focus-visible {
  transform: translateY(-2px);
  outline: none;
}

.count-btn:disabled {
  cursor: not-allowed;
  opacity: 0.88;
}

.count-btn.is-correct {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
}

.count-btn.is-wrong {
  background: linear-gradient(180deg, var(--danger-strong) 0%, var(--danger) 100%);
}

/* ── Progress layout ───────────────────────────────────────── */
.progress-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.9fr);
  gap: 24px;
  margin-top: 24px;
}

.mastery-card,
.badges-card {
  border-radius: var(--radius-lg);
  padding: 24px;
}

.badges-card h2 {
  margin: 4px 0 16px;
}

.badge-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}

.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: 12px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  opacity: 0.4;
  filter: grayscale(1);
  transition: opacity 200ms ease, filter 200ms ease, transform 200ms ease;
}

.badge-item.is-earned {
  opacity: 1;
  filter: none;
  border-color: rgba(255, 215, 106, 0.5);
  background: rgba(255, 215, 106, 0.1);
}

.badge-icon {
  font-size: 1.6rem;
}

.badge-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
}

@media (max-width: 980px) {
  .progress-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .answer-area.layout-choice {
    grid-template-columns: 1fr;
  }

  .playback-row {
    flex-direction: column;
    align-items: stretch;
  }

  .playback-row .mode-toggle {
    justify-content: center;
  }
}
