/* ── Learn page: compact bird-picker triggers + visualizer panels, stacked
   so both panels stay visible together without scrolling; the full
   selector/fact-card lives in a shared pop-out modal instead of taking up
   inline vertical space. ── */

.learn-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.viz-toggle {
  display: flex;
  gap: 0.5rem;
}

/* Segmented-control active state — borrowed from wild_tracks_studio's
   theme.css, which calls_of_the_wild's trimmed theme.css doesn't carry. */
.btn.toggled {
  box-shadow: var(--neu-in);
  color: var(--accent-deep);
}
:root[data-theme="dark"] .btn.toggled { color: var(--accent); }

.learn-panels {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.learn-panel {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.learn-player { min-width: 0; }

.learn-trigger-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.panel-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Compact bird-picker trigger (the whole left column in normal view) ── */
.selector-trigger {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--neu-out);
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  transition: box-shadow 0.2s;
}

.selector-trigger:hover,
.selector-trigger:focus-visible {
  box-shadow: var(--neu-out), 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent);
  outline: none;
}

.selector-trigger-thumb {
  width: 100%;
  margin: 0 auto;
}

.selector-trigger-name {
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.25;
}

.selector-trigger-variant {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.selector-trigger-hint {
  font-size: 0.66rem;
}

/* ── Bird-picker modal (adapted from wild_tracks_studio's .modal-backdrop/
   .modal, which calls_of_the_wild's trimmed theme.css doesn't carry) ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(20, 24, 18, 0.45);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--neu-out);
  width: 100%;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.selector-modal {
  max-width: 760px;
  max-height: 85vh;
}

.selector-modal-body {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.25rem;
  min-height: 0;
}

/* ── Selector list (adapted from wild_tracks_studio's library panel) ── */
.selector-list {
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.lib-group-title {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.lib-group-title:first-child { margin-top: 0; }

.sample-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--neu-out-sm);
  cursor: pointer;
  transition: box-shadow 0.2s;
  background: var(--bg);
}

.sample-item:hover { box-shadow: var(--neu-out); }
.sample-item.selected { box-shadow: var(--neu-in); }
.sample-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sample-item .swatch {
  width: 12px;
  height: 32px;
  border-radius: 6px;
  flex: none;
}

.sample-item .titles { min-width: 0; }
.sample-item .titles .sp { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sample-item .titles .variant { font-size: 0.75rem; color: var(--text-muted); }

/* ── Fact card additions (base card/.fc-tip-* styling already in game.css/theme.css) ── */
.fact-card .status { font-size: 0.8rem; }
.fact-card .credit { font-size: 0.72rem; color: var(--text-muted); }
.chip.static { cursor: default; }

.fact-stats {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.fact-stat {
  font-size: 0.78rem;
  color: var(--text);
}

.fact-stat-label {
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 0.3rem;
}

/* ── Spectrogram canvas (live AnalyserNode view, alternate to .viz-main's pitch trail) ── */
.viz-spectrogram {
  display: block;
  width: 100%;
  height: 130px;
  transition: opacity 0.3s ease;
}

/* Live view has nothing to show once the clip isn't playing — dim it
   rather than let it read as frozen/broken. */
.viz-spectrogram.idle { opacity: 0.45; }

/* ── Mobile gate (matches wild_tracks_studio's studio.html pattern) ── */
.mobile-gate { display: none; }

@media (max-width: 820px) {
  #learn-layout { display: none !important; }
  .mobile-gate { display: flex; }
}

