/* Bird Sounds' own look, after the shell every tool shares (../shell/shell.css: the brand, the name card, the score,
   the list down the left, the settings and their "i", the windows, the result, the phone layout, and the wide middle
   column every trainer has). Only this tool's subject goes here: a clip (a play button over its spectrogram, a line
   that crosses it as it plays, its credit), the four clips to pick from, what a bird sounds like in words, Explore's
   sounds, every lesson's chips, a lesson's cards, and the buttons under the board (the same sizes as the field
   guides' and Language ID's answers). Colours and fonts are the shell's variables. */

.board {
  container-type: inline-size;
  flex: 1; min-height: 0; overflow: auto; box-sizing: border-box; width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 14px;
  padding: 12px;
  background: #0b1219; border: 1px solid var(--line-strong); border-radius: 18px;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.board .note { color: var(--muted); text-align: center; max-width: 56ch; line-height: 1.55; margin: 0; font-size: 13px; }
.board .note.tap { color: var(--scan); }

/* ---------- a clip: the play button over its spectrogram, the line that crosses it, its credit ---------- */
.clip { display: grid; gap: 4px; width: 100%; min-width: 0; }
.clip-play {
  position: relative; display: block; width: 100%; height: 132px; padding: 0; overflow: hidden; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; background: #070b12; color: var(--bone); font: inherit;
}
.clip-play:hover { border-color: var(--scan); }
.clip .spec { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .25s; image-rendering: auto; }
.clip.has-pic .spec { opacity: 1; }
.clip .playhead { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; background: var(--bone); opacity: 0; pointer-events: none; }
.clip.is-playing .playhead { opacity: .95; }
.clip.is-playing .clip-play { border-color: var(--scan); }
/* the play mark: a disc with a triangle, two bars while it plays */
.clip .glyph {
  position: absolute; inset-inline-start: 10px; bottom: 10px; width: 38px; height: 38px; border-radius: 50%;
  background: rgba(7, 11, 18, 0.78); border: 1px solid var(--line-strong); box-sizing: border-box;
}
.clip .glyph::before {
  content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-36%, -50%);
  border-style: solid; border-width: 8px 0 8px 13px; border-color: transparent transparent transparent currentColor;
}
.clip.is-playing .glyph::before { transform: translate(-50%, -50%); width: 4px; height: 14px; border-width: 0 4px; border-color: transparent currentColor; }
.clip .tag {
  position: absolute; inset-inline-start: 8px; top: 8px; font-family: var(--f-mono); font-size: 11.5px; font-weight: 600; line-height: 1.3;
  padding: 2px 8px; border-radius: 6px; background: rgba(7, 11, 18, 0.78); color: var(--bone);
}
.clip .by { font-family: var(--f-mono); font-size: 10.5px; line-height: 1.3; color: var(--muted); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: end; }
.clip a.by:hover { color: var(--fg); }
.clip.main .clip-play { height: clamp(170px, calc(34vh / var(--room, 1)), 330px); }
.clip.main .glyph { width: 58px; height: 58px; inset-inline-start: 14px; bottom: 14px; }
.clip.main .glyph::before { border-width: 12px 0 12px 19px; }
.clip.main.is-playing .glyph::before { width: 6px; height: 20px; border-width: 0 6px; }
.board.has-fb .clip.main .clip-play { height: clamp(120px, calc(20vh / var(--room, 1)), 200px); }
.clip.small .clip-play { height: clamp(74px, calc(13vh / var(--room, 1)), 120px); }
.plate { display: grid; gap: 8px; width: 100%; justify-items: center; }

/* ---------- four clips to pick from: each with its button ---------- */
.four { display: grid; gap: 8px; width: 100%; }
.opt { display: grid; grid-template-columns: minmax(0, 1fr) minmax(104px, 24%); gap: 8px; align-items: start; }
.opt .pickbtn { height: clamp(74px, calc(13vh / var(--room, 1)), 120px); min-height: 0; justify-content: center; text-align: center; }
.opt.is-right .clip-play { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok); }
.opt.is-wrong .clip-play { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
.opt.is-rest { opacity: .6; }
.board.has-fb .clip.small .clip-play, .board.has-fb .opt .pickbtn { height: 58px; }

/* ---------- what a bird sounds like, in words ---------- */
.feedback { display: grid; gap: 10px; width: 100%; }
@container (min-width: 600px) { .feedback.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cue { background: var(--bg-lift); border: 1px solid var(--line); border-radius: 14px; padding: 13px 16px; display: grid; gap: 8px; width: 100%; box-sizing: border-box; align-content: start; text-align: start; min-width: 0; }
.cue-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.cue-head b { font-size: 16px; color: var(--bone); }
.cue-head .sci { font-size: 12.5px; color: var(--muted); font-style: italic; }
.cue p, .said { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--fg); text-wrap: pretty; text-align: start; }
.cue p em, .said em { font-style: normal; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--scan); }
/* a small play button before a sound's words: hear it */
.hear {
  position: relative; width: 26px; height: 26px; margin-inline-end: 8px; vertical-align: middle; border-radius: 50%; cursor: pointer; padding: 0;
  background: var(--panel); border: 1px solid var(--line-strong); color: var(--bone);
}
.hear::before { content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-36%, -50%); border-style: solid; border-width: 5px 0 5px 8px; border-color: transparent transparent transparent currentColor; }
.hear:hover { border-color: var(--scan); }

/* ---------- Explore: each sound, its words and its clips ---------- */
.sounds { display: grid; gap: 16px; width: 100%; }
.sound { display: grid; gap: 8px; min-width: 0; }
.clips { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 8px; }

/* ---------- every lesson's chips (Explore), and the misses after a test ---------- */
.chart { display: grid; gap: 14px; min-width: 0; width: 100%; padding-top: 2px; }
.lgroup { display: grid; gap: 7px; }
.lgroup.is-later { opacity: .55; }
.ghead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--scan); }
.ghead em { font-style: normal; color: var(--muted); letter-spacing: 0; }
.ghead em.done { color: var(--ok); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; color: var(--fg); cursor: pointer; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; }
.chip b { font-size: 13px; font-weight: 600; }
.chip:hover { border-color: var(--scan); }
.chip.is-on { border-color: var(--bone); box-shadow: 0 0 0 1px var(--bone); background: var(--bg-lift); }
.chip.is-known b::after { content: " ✓"; color: var(--ok); }
.summary { display: grid; gap: 10px; justify-items: center; width: min(100%, 640px); }
.summary .chips { justify-content: center; }

/* ---------- a lesson's cards: each new bird, a clip to hear and what to listen for ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 10px; width: 100%; }
.cue.icard { padding: 11px 13px; }
.cue.icard p { font-size: 13.5px; }

/* ---------- the buttons under the board: the answers (two by two) or a row of actions ---------- */
.actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; width: 100%; }
.actions:empty { display: none; }
.actions.row { display: flex; flex-wrap: wrap; justify-content: center; }
.act {
  font: inherit; font-weight: 700; font-stretch: 102%; font-size: 15px; color: var(--fg); cursor: pointer; text-align: start;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 9px; padding: 11px 14px; min-height: 46px;
  display: flex; align-items: center; gap: 10px; position: relative; line-height: 1.2;
}
.act kbd { font-family: var(--f-mono); font-weight: 500; font-size: 10.5px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 4px; flex: none; }
.act .txt { flex: 1; min-width: 0; }
.actions.row > .act { justify-content: center; text-align: center; flex: 0 1 auto; min-width: 120px; }
.act:hover:not(:disabled) { border-color: var(--scan); }
.act:disabled { opacity: .32; cursor: default; }
.act.primary { background: var(--bone); color: #1b1610; border-color: var(--bone); }
.act.primary kbd { color: #5d5345; border-color: #a99c84; }
.act.is-right { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok); opacity: 1; }
.act.is-wrong { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); opacity: 1; }
.actions:not(.row) > .act.primary { grid-column: 1 / -1; justify-self: center; justify-content: center; width: min(100%, 360px); }
.opt .pickbtn .txt { flex: 0 1 auto; }

@media (max-width: 900px) {
  .board { border-radius: 14px; gap: 10px; padding: 8px; }
  .clip.main .clip-play { height: clamp(150px, 27vh, 250px); }
  .board.has-fb .clip.main .clip-play { height: clamp(96px, 15vh, 150px); }
  .clip-play { height: 104px; }
  .opt { grid-template-columns: minmax(0, 1fr) 92px; }
  .clip.small .clip-play, .opt .pickbtn { height: clamp(62px, 9.6vh, 92px); }
  .clip.small .glyph { width: 32px; height: 32px; inset-inline-start: 7px; bottom: 7px; }
  .act { padding: 9px 10px; font-size: 13.5px; min-height: 42px; }
  .act kbd { display: none; }
  .actions.row > .act { min-width: 0; flex: 1 1 0; }
  .cue { padding: 11px 13px; }
  .cue p, .said { font-size: 13.5px; }
}
/* clean view: the recording takes the room the chips leave */
body.clean .chart { display: none; }
