:root {
  --chord-root: var(--accent);
  --chord-third: #6facff;
  --chord-fifth: #ffc169;
}

/* ── Hand shape card ───────────────────────────────────────── */
.hand-shape-card {
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}

.hand-shape-card h2 {
  margin: 4px 0 18px;
}

.hand-shape-row {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
}

.hand-diagram-svg {
  width: 100%;
  max-width: 220px;
  height: auto;
  justify-self: center;
}

.hand-palm {
  fill: rgba(255, 255, 255, 0.07);
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 2;
}

.finger-line {
  stroke-linecap: round;
  stroke-width: 24;
}

.finger-line-1 { stroke: var(--chord-root); stroke-width: 26; }
.finger-line-3 { stroke: var(--chord-third); stroke-width: 26; }
.finger-line-5 { stroke: var(--chord-fifth); }
.finger-line-2,
.finger-line-4 {
  stroke: rgba(255, 255, 255, 0.14);
}

.finger-badge-svg circle {
  fill: rgba(255, 255, 255, 0.14);
}

.finger-badge-svg text {
  font-size: 18px;
  font-weight: 800;
  text-anchor: middle;
  fill: rgba(255, 255, 255, 0.55);
}

.finger-badge-1 circle { fill: var(--chord-root); }
.finger-badge-3 circle { fill: var(--chord-third); }
.finger-badge-5 circle { fill: var(--chord-fifth); }
.finger-badge-1 text,
.finger-badge-3 text,
.finger-badge-5 text {
  fill: #0b1220;
}

.hand-shape-copy p {
  margin: 0 0 14px;
  line-height: 1.7;
}

.finger-key {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.finger-key li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

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

.finger-dot-1 { background: var(--chord-root); }
.finger-dot-3 { background: var(--chord-third); }
.finger-dot-5 { background: var(--chord-fifth); }

.hand-shape-note {
  margin: 0 !important;
  font-size: 0.88rem;
  color: var(--muted);
}

/* ── Progress strip ───────────────────────────────────────── */
.progress-strip {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.progress-pill {
  min-width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

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

.progress-pill.is-current {
  border-color: var(--accent);
  background: rgba(78, 204, 163, 0.14);
}

.progress-pill.is-learned {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
  border-color: transparent;
  color: #0b1220;
}

.progress-pill .pill-check {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-strong);
  color: #0b1220;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
}

/* ── Chord card ────────────────────────────────────────────── */
.chord-card {
  border-radius: var(--radius-lg);
  padding: 26px;
  text-align: center;
  transition: box-shadow 200ms ease;
}

.chord-card h2 {
  margin: 4px 0 6px;
  font-size: 2rem;
}

.chord-notes {
  margin: 0 0 18px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.chord-card .piano-wrap {
  max-width: 640px;
  margin: 0 auto;
}

.chord-tip {
  margin: 16px auto 0;
  max-width: 52ch;
  color: var(--muted);
}

.chord-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.play-chord-btn {
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #0b1220;
  font-weight: 800;
  font-size: 1.05rem;
  padding: 16px 36px;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(78, 204, 163, 0.24);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.play-chord-btn:hover,
.play-chord-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(78, 204, 163, 0.32);
  outline: none;
}

.text-button {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 6px 10px;
}

.text-button:hover,
.text-button:focus-visible {
  color: var(--text);
  outline: none;
}

.mark-learned-btn {
  margin-top: 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 14px 28px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 140ms ease;
}

.mark-learned-btn:hover,
.mark-learned-btn:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.mark-learned-btn.is-learned {
  background: rgba(78, 204, 163, 0.16);
  border-color: rgba(78, 204, 163, 0.5);
  color: #cffff0;
}

/* ── Stepper nav ───────────────────────────────────────────── */
.stepper-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 20px 0;
}

.stepper-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--surface-soft);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 14px 22px;
  font-weight: 700;
  cursor: pointer;
  transition: background 140ms ease, transform 140ms ease, opacity 140ms ease;
}

.stepper-btn:hover:not(:disabled),
.stepper-btn:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.stepper-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.stepper-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  flex: 1;
}

/* ── Celebration card ──────────────────────────────────────── */
.celebration-card {
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  background: linear-gradient(160deg, rgba(78, 204, 163, 0.14), rgba(255, 215, 106, 0.1));
  border: 1px solid rgba(78, 204, 163, 0.35) !important;
  margin-bottom: 20px;
}

.celebration-card h2 {
  margin: 0 0 10px;
}

.celebration-card p {
  margin: 0 auto 8px;
  max-width: 56ch;
  color: var(--text);
}

.celebration-note {
  color: var(--muted) !important;
  font-size: 0.9rem;
}

@media (max-width: 760px) {
  .hand-shape-row {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .finger-key {
    align-items: center;
  }

  .hand-diagram-svg {
    max-width: 170px;
  }

  .chord-card {
    padding: 20px 16px;
  }

  .chord-card h2 {
    font-size: 1.6rem;
  }

  .play-chord-btn {
    width: 100%;
  }

  .stepper-nav {
    flex-wrap: wrap;
  }

  .stepper-hint {
    order: 3;
    flex-basis: 100%;
  }

  .stepper-btn {
    flex: 1 1 auto;
  }
}
