/* Intervalos */
.ear-stage { gap: 20px; padding-top: var(--space-3); }

/* Modo + marcador en una sola franja */
.ear-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); width: 100%; flex-wrap: wrap; }
.ear-mode { flex-wrap: nowrap; }
.ear-mode button { min-width: 100px; }
.ear-score { display: flex; gap: 6px; text-align: center; }
.ear-score > div {
  display: flex; flex-direction: column; gap: 3px; min-width: 64px; padding: 6px 10px;
  border-radius: var(--radius-media); background: var(--color-surface-2); border: 1px solid var(--color-hairline);
  box-shadow: var(--shadow-sm);
}
.ear-score__val { font-family: var(--font-heading); font-weight: 700; font-size: 1.3rem; line-height: 1; font-variant-numeric: tabular-nums; }
.ear-score__lbl { font-size: .6rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--color-gray); }
.ear-score__streak { transition: border-color .2s ease, background .2s ease; }
.ear-score__streak.is-hot { border-color: var(--color-warn); background: rgba(242, 181, 68, .12); }
.ear-score__streak.is-hot .ear-score__val { color: var(--color-warn); }
.ear-score__streak.is-party { animation: ear-party .7s var(--ease); }
@keyframes ear-party { 0% { transform: scale(1); } 30% { transform: scale(1.22) rotate(-4deg); } 60% { transform: scale(.96) rotate(2deg); } 100% { transform: none; } }
.ear-stage.is-explore .ear-top { justify-content: center; }

/* Mini teclado: neutro hasta que respondes */
.ear-keys { width: 100%; max-width: 440px; }
.ear-keys svg { width: 100%; height: auto; }
.ear-keys .kw { fill: #3A3934; stroke: #121212; stroke-width: 1; transition: fill .2s ease; }
.ear-keys .kb { fill: #151513; stroke: #000; stroke-width: .8; transition: fill .2s ease; }
.ear-keys.is-revealed .kw { fill: #DAD8D1; }
.ear-keys.is-revealed .kb { fill: #1A1917; }
.ear-keys .kw.is-a, .ear-keys .kb.is-a { fill: var(--color-accent); }
.ear-keys .kw.is-b, .ear-keys .kb.is-b { fill: var(--color-warn); }
.ear-keys .k.is-flash { fill: #FFFFFF; transition: none; }

.ear-prompt { text-align: center; min-height: 96px; display: flex; flex-direction: column; justify-content: center; gap: 4px; max-width: 520px; }
.ear-prompt p { margin: 0; }
.ear-prompt__title { font-family: var(--font-heading); font-weight: 700; font-size: clamp(1.7rem, 4.4vw, 2.4rem); line-height: 1.1; }
.ear-prompt__title.is-right { color: var(--color-accent); }
.ear-prompt__title.is-wrong { color: var(--color-danger); }
.ear-prompt__notes { font-weight: 700; color: var(--color-ink-soft); font-size: 1.02rem; }
.ear-prompt__song { color: var(--color-gray); font-size: .92rem; min-height: 1.4em; }

.ear-actions { display: flex; align-items: center; justify-content: center; gap: var(--space-3); }
.ear-stage .play.is-waiting { box-shadow: 0 0 0 10px var(--color-accent-dim); }
.ear-stage .play .icon-stop { display: none !important; }
.ear-stage .play .icon-play { display: block !important; }

.ear-answers { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; width: 100%; }
.ear-answer {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 72px;
  padding: 10px 6px;
  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, opacity .2s ease, transform .1s ease;
}
.ear-answer:hover { border-color: var(--color-accent); }
.ear-answer:active { transform: scale(.97); }
.ear-answer__abbr { font-family: var(--font-heading); font-weight: 700; font-size: 1.45rem; line-height: 1; }
.ear-answer__name { font-size: .74rem; font-weight: 700; color: var(--color-gray); text-align: center; line-height: 1.2; }
.ear-answer__key { position: absolute; top: 6px; left: 8px; font-size: .64rem; font-weight: 700; color: var(--color-gray); opacity: .8; }
@media (hover: none) { .ear-answer__key { display: none; } }
.ear-answer { box-shadow: var(--shadow-sm); }
.ear-answer.is-right { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-bg); animation: ear-pop .35s var(--ease); box-shadow: var(--shadow-glow); }
.ear-answer.is-wrong { animation: ear-shake .35s ease; }
@keyframes ear-pop { 0% { transform: scale(1); } 45% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes ear-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
.ear-prompt__title.is-right, .ear-prompt__title.is-wrong { animation: ear-in .3s var(--ease); }
@keyframes ear-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.ear-answer.is-right .ear-answer__name, .ear-answer.is-right .ear-answer__key { color: var(--color-bg); }
.ear-answer.is-wrong { border-color: var(--color-danger); background: rgba(255, 107, 94, .14); }
.ear-answer.is-wrong .ear-answer__abbr { color: var(--color-danger); }
.ear-answer.is-dim { opacity: .45; }
.ear-answer.is-selected { border-color: var(--color-accent); background: var(--color-accent-dim); }
.ear-answer.is-selected .ear-answer__abbr { color: var(--color-accent); }

.ear-stats { display: grid; gap: 8px; }
.ear-stat { display: grid; grid-template-columns: 34px minmax(0, 1fr) 42px 46px; align-items: center; gap: 10px; font-size: .85rem; }
.ear-stat__id { font-family: var(--font-heading); font-weight: 700; font-size: 1.05rem; }
.ear-stat__bar { height: 8px; border-radius: 999px; background: var(--color-surface-3); overflow: hidden; }
.ear-stat__bar span { display: block; height: 100%; border-radius: inherit; background: var(--color-accent); }
.ear-stat.is-mid .ear-stat__bar span { background: var(--color-warn); }
.ear-stat.is-low .ear-stat__bar span { background: var(--color-danger); }
.ear-stat__pct { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.ear-stat__n { color: var(--color-gray); text-align: right; font-variant-numeric: tabular-nums; }

#pick .chip { min-width: 52px; }
#dir button { padding: 0 10px; }

@media (max-width: 600px) {
  .ear-stage { gap: 12px; padding-top: 12px; }
  .ear-top { gap: 8px; justify-content: center; }
  .ear-mode button { min-width: 0; padding: 0 16px; min-height: 36px; font-size: .82rem; }
  .ear-score { gap: 4px; width: 100%; }
  .ear-score > div { flex: 1 1 0; min-width: 0; padding: 4px 6px; flex-direction: row; align-items: baseline; justify-content: center; gap: 6px; }
  .ear-score__val { font-size: 1.05rem; }
  .ear-score__lbl { font-size: .52rem; letter-spacing: .08em; }
  .ear-prompt { min-height: 76px; }
  .ear-prompt__title { font-size: 1.45rem; }
  .ear-prompt__notes { font-size: .92rem; }
  .ear-prompt__song { font-size: .82rem; }
  .ear-keys { max-width: 300px; }
  .ear-actions { gap: var(--space-2); }
  .ear-actions .icon-btn--lg { width: 48px; height: 48px; }
  .ear-stage .play { width: 64px; height: 64px; }
  .ear-stage .play svg { width: 26px; height: 26px; }
  .ear-answers { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .ear-answer { min-height: 56px; padding: 6px 4px; }
  .ear-answer__abbr { font-size: 1.2rem; }
  .ear-answer__name { font-size: .64rem; }
  #dir { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 360px) {
  .ear-score__lbl { display: none; }
}

/* 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; }
