/* Acordes */
.chord-stage { gap: 18px; padding-top: var(--space-3); }

/* Cabecera: dado · símbolo · play */
.chord-head { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: var(--space-2); width: 100%; max-width: 560px; }
.chord-dice.is-roll svg { animation: chord-roll .5s var(--ease); }
@keyframes chord-roll { 0% { transform: rotate(0); } 60% { transform: rotate(250deg) scale(1.15); } 100% { transform: rotate(360deg); } }

.chord-title { text-align: center; }
.chord-title p { margin: 0; }
.chord-title__symbol {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(3.6rem, 11vw, 6rem);
  line-height: .95;
  letter-spacing: -0.02em;
}
.chord-title__name { margin-top: 10px !important; font-weight: 700; color: var(--color-ink-soft); font-size: 1rem; }

.chord-notes { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chord-note {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 68px;
  padding: 8px 10px 10px;
  border-radius: var(--radius-media);
  background: var(--color-surface-2);
  border: 1px solid var(--color-hairline);
}
.chord-note__deg { font-size: .72rem; font-weight: 700; letter-spacing: .06em; color: var(--color-gray); }
.chord-note__lat { font-family: var(--font-heading); font-weight: 700; font-size: 1.4rem; line-height: 1.15; }
.chord-note__en { font-size: .78rem; font-weight: 700; color: var(--color-gray); }
.chord-note.is-root { border-color: var(--color-accent); background: var(--color-accent-dim); }
.chord-note.is-root .chord-note__lat, .chord-note.is-root .chord-note__deg { color: var(--color-accent); }
.chord-note { box-shadow: var(--shadow-sm); transition: transform .15s var(--ease), background .15s ease; }
.chord-note.is-flash { transform: translateY(-4px); background: var(--color-surface-3); transition: none; }
.chord-note.is-root.is-flash { background: rgba(0, 205, 156, .3); }

.chord-formula { margin: -4px 0 0; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: .85rem; color: var(--color-gray); }
#formula { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 2px 16px; }
.chord-formula b { color: var(--color-ink-soft); margin-right: 4px; }

.chord-piano { width: 100%; max-width: 620px; }
.chord-piano svg { width: 100%; height: auto; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.chord-piano .key { cursor: pointer; }
.chord-piano .key--white rect { fill: #E9E7E1; stroke: #121212; stroke-width: 1.5; transition: fill .12s ease; }
.chord-piano .key--black rect { fill: #1A1917; stroke: #000; stroke-width: 1; transition: fill .12s ease; }
.chord-piano .key--white:hover rect { fill: #FFFFFF; }
.chord-piano .key--black:hover rect { fill: #2E2D28; }
.chord-piano .key--white.is-chord rect { fill: #7FE6CD; }
.chord-piano .key--white.is-root rect { fill: var(--color-accent); }
.chord-piano .key--black.is-chord rect { fill: #0E7F63; }
.chord-piano .key--black.is-root rect { fill: var(--color-accent); }
.chord-piano .key text { font: 700 10px var(--font-body); fill: #121212; text-anchor: middle; pointer-events: none; }
.chord-piano .key circle { fill: #F2F1ED; pointer-events: none; }
.chord-piano .key.is-flash rect { fill: #FFFFFF !important; transition: none; }
.chord-piano .key--black.is-flash rect { fill: #9AF0DA !important; }


.chord-roots { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.chord-root {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 4px 2px;
  border-radius: var(--radius-media);
  border: 1px solid var(--color-hairline);
  background: var(--color-surface-2);
  color: var(--color-ink);
  touch-action: manipulation;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.chord-root { box-shadow: var(--shadow-sm); }
.chord-root:hover { border-color: var(--color-accent); }
.chord-root:active { transform: scale(.96); }
.chord-root__lat { font-family: var(--font-heading); font-weight: 700; font-size: 1.1rem; line-height: 1.1; white-space: nowrap; }
.chord-root__alt { font-size: .7rem; font-weight: 700; color: var(--color-gray); white-space: nowrap; }
.chord-root[aria-pressed="true"] { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-bg); }
.chord-root[aria-pressed="true"] .chord-root__alt { color: rgba(18, 18, 18, .7); }

.chord-group__label { margin: 0; font-size: .78rem; font-weight: 700; color: var(--color-gray); }
.panel > .seg + .chord-group__label { margin-top: 14px; }
.panel > .chord-group__label + .seg { margin-top: 8px; }
#mode button, #inv button { padding: 0 8px; }

@media (max-width: 600px) {
  .chord-stage { gap: 12px; padding-top: 14px; }
  .chord-head { grid-template-columns: 48px minmax(0, 1fr) 64px; gap: 8px; }
  .chord-dice.icon-btn--lg { width: 48px; height: 48px; }
  .chord-stage .play { width: 64px; height: 64px; }
  .chord-stage .play svg { width: 26px; height: 26px; }
  .chord-title__symbol { font-size: clamp(2.6rem, 13vw, 3.4rem); }
  .chord-title__name { margin-top: 4px !important; font-size: .82rem; line-height: 1.3; }
  .chord-notes { gap: 6px; }
  .chord-note { min-width: 52px; padding: 4px 6px 6px; }
  .chord-note__deg { font-size: .64rem; }
  .chord-note__lat { font-size: 1.1rem; }
  .chord-note__en { font-size: .7rem; }
  .chord-formula { font-size: .78rem; margin: 0; }
  .chord-root { min-height: 46px; }
  .chord-root__lat { font-size: 1rem; }
  .chord-roots { gap: 5px; }
}

/* Alteraciones (♯ ♭): ni Gentium ni Karla las incluyen */
.acc { font-family: "Segoe UI Symbol", "Apple Symbols", "Noto Music", "Noto Sans Symbols 2", "DejaVu Sans", sans-serif; font-weight: 400; font-size: .72em; vertical-align: .3em; line-height: 0; margin-left: .04em; letter-spacing: 0; }
svg .acc { font-size: .9em; }
.chord-inv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chord-title__symbol .acc { font-size: .55em; vertical-align: .55em; }
