/* Language ID's own look, after the shell every tool shares (../shell/shell.css: the brand, the name card, the score,
   the list down the left with its sub-rows, 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: the round play button on its
   plate, what to listen for in a language, Explore's language and the chart of every lesson, a lesson's card, and the
   buttons under the board (the same sizes as Dog Breeds' and Car Brands' answers). Colours and fonts are the shell's
   variables. */

/* the subject, in the middle column under the name card */
.board {
  flex: 1; min-height: 0; overflow: auto; box-sizing: border-box; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: clamp(14px, 2.6vh, 26px) clamp(14px, 2vw, 26px);
  background: radial-gradient(80% 60% at 50% 22%, #13222c 0%, #0c141b 72%);
  border: 1px solid var(--line-strong); border-radius: 18px;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
  container-type: inline-size;
}
.board > :first-child { margin-top: auto; }
.board > :last-child { margin-bottom: auto; }
.board .note { color: var(--muted); text-align: center; max-width: 52ch; line-height: 1.55; margin: 0; }

/* the play button: tap to hear the recording (again); its ring pulses while it plays */
.listen {
  position: relative; flex: none; width: clamp(104px, 17vh, 140px); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; color: var(--bone); margin-bottom: 22px;
  background: radial-gradient(circle at 50% 40%, #1b2a35 0%, #111b23 70%);
  border: 1px solid var(--line-strong); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}
.listen:hover { border-color: var(--scan); }
.listen .glyph { width: 100%; }
.listen .glyph svg { width: 36%; height: auto; display: block; margin: 0 auto; fill: currentColor; transform: translateX(6%); }
.listen .cap {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.listen .ring { position: absolute; inset: -1px; border-radius: 50%; border: 2px solid var(--scan); opacity: 0; pointer-events: none; }
.listen.is-playing { border-color: var(--scan); color: var(--scan); }
.listen.is-playing .ring { animation: lid-ring 1.2s ease-out infinite; }
@keyframes lid-ring { from { opacity: .7; transform: scale(1); } to { opacity: 0; transform: scale(1.3); } }
@media (prefers-reduced-motion: reduce) { .listen.is-playing .ring { animation: none; opacity: .6; } }
.voice { font-family: var(--f-mono); font-size: 11px; color: var(--muted); min-height: 1em; }

/* a question: the play button on its plate; what to listen for appears under it after an answer */
.plate { display: grid; justify-items: center; gap: 18px; width: min(100%, 720px); }
.feedback { display: grid; gap: 10px; width: 100%; }
@container (min-width: 640px) { .feedback.two { grid-template-columns: 1fr 1fr; } }

/* what a language is and what to listen for in it */
.cue { background: var(--bg-lift); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 8px; align-content: start; box-sizing: border-box; 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 span { font-size: 12.5px; color: var(--muted); }
.cue p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--fg); }
.cue p em { font-style: normal; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--scan); }
.cue .act.hear { justify-self: start; }

/* Explore: the language, and beside it every lesson's languages */
.explore { display: grid; gap: 22px; width: min(100%, 1040px); align-items: start; }
@container (min-width: 640px) { .explore { grid-template-columns: minmax(250px, 1fr) minmax(0, 1fr); } }
.detail { display: grid; justify-items: center; gap: 12px; padding: 24px 18px 18px; background: var(--bg-lift); border: 1px solid var(--line); border-radius: 16px; }
.detail .listen { margin-bottom: 18px; }
.detail .cue { background: transparent; border: 0; padding: 4px 2px 0; text-align: start; width: 100%; }
.chart { display: grid; gap: 14px; min-width: 0; }
.lgroup { display: grid; gap: 7px; }
.lgroup.is-later { opacity: .5; }
.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; }
.chips.wide { justify-content: center; width: min(100%, 760px); }
.chip { font: inherit; color: var(--fg); cursor: pointer; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; }
.chip b { font-size: 13.5px; 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); }
span.chip { cursor: default; }

/* a lesson's card: its languages, each with what to listen for and a recording */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 10px; width: min(100%, 980px); }

/* after a test, under its result: the misses */
.summary { display: grid; gap: 10px; justify-items: center; width: min(100%, 640px); }
.summary .chips { justify-content: center; }

/* 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); }
.act.hear { min-height: 34px; padding: 6px 12px; font-size: 13px; flex: none; }

@media (max-width: 900px) {
  .board { border-radius: 14px; gap: 14px; padding: 12px; }
  .act { padding: 10px 11px; font-size: 14px; min-height: 44px; }
  .act kbd { display: none; }
  .actions.row > .act { min-width: 0; flex: 1 1 0; }
  .cue { padding: 12px 13px; }
  .cue p { font-size: 13.5px; }
  .detail { padding: 18px 12px 12px; }
}
