/* Anatomy Words' 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 word's card (what it means, where it comes from,
   its opposite, the names it is in), a name taken apart word by word, Explore's two views (the lessons' chips; any
   name searched for and taken apart), the figure the directions are asked on, and the buttons under the board (the
   same sizes as Braille's, Bird Sounds' and the field guides' 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: 62ch; line-height: 1.55; margin: 0; font-size: 13px; text-wrap: pretty; }

/* ---------- a word's card ---------- */
.cue { background: var(--bg-lift); border: 1px solid var(--line); border-radius: 14px; padding: 13px 16px; display: grid; gap: 9px; 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: 17px; color: var(--bone); }
.cue-head .kind { font-style: normal; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.cue p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--fg); text-wrap: pretty; }
.cue p em { font-style: normal; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--scan); margin-inline-end: 4px; }
.cue p.means { font-size: 18px; font-weight: 650; color: var(--fg); line-height: 1.35; }
.cue p.from, .cue p.note2, .cue p.uses, .cue p.more { color: var(--muted); font-size: 13.5px; }
.cue p.rel { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cue.main { padding: 18px 20px; gap: 11px; }
.cue.main p.means { font-size: 21px; }
.cue .ex { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.cue .ex li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font-size: 14px; line-height: 1.4; border-top: 1px solid var(--line); padding-top: 5px; }
.cue .ex .atl { font-family: var(--f-mono); font-size: 11px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.cue .ex .atl:hover { color: var(--scan); }
.nm mark { background: none; color: var(--scan); font-weight: 700; }
.cue.icard { padding: 11px 13px; }
.cue.icard p.means { font-size: 15.5px; }
.cue.icard p { font-size: 13px; }

/* Explore: the card beside its figure, when the word is a direction */
.lookbox { display: grid; gap: 12px; width: 100%; }
@container (min-width: 640px) { .lookbox.has-fig { grid-template-columns: minmax(0, 1fr) 230px; align-items: start; } }

/* ---------- Explore: the two views ---------- */
.tabs { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); flex: none; max-width: 100%; }
.tab { font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); background: none; border: 0; border-radius: 8px; padding: 7px 13px; cursor: pointer; }
.tab:hover { color: var(--fg); }
.tab[aria-selected="true"] { background: var(--bg-lift); color: var(--bone); box-shadow: inset 0 0 0 1px var(--line-strong); }
/* every lesson's words, 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; display: inline-flex; align-items: center; gap: 9px; text-align: start; }
.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); }
.chip.small { padding: 3px 8px; border-radius: 7px; }
.chip.small b { font-size: 12.5px; }
.summary { display: grid; gap: 10px; justify-items: center; width: min(100%, 640px); }
.summary .chips { justify-content: center; }

/* Read a name: the search, its hits, the name taken apart */
.names { display: grid; gap: 12px; justify-items: center; width: min(100%, 760px); }
.typebox { width: min(100%, 520px); display: flex; gap: 6px; }
.type {
  flex: 1; min-width: 0; box-sizing: border-box; font: inherit; font-size: 16px; font-weight: 600; text-align: center;
  color: var(--fg); background: var(--bg-lift); border: 1px solid var(--line-strong); border-radius: 9px; padding: 11px 12px; outline: none;
}
.type::placeholder { font-size: 14px; color: var(--muted); font-weight: 500; }
.type:focus { border-color: var(--scan); }
.hits { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; width: 100%; }
.hit { font: inherit; cursor: pointer; color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; display: inline-grid; gap: 1px; text-align: start; }
.hit b { font-size: 13px; font-weight: 600; }
.hit i { font-style: normal; font-family: var(--f-mono); font-size: 10px; color: var(--muted); }
.hit:hover { border-color: var(--scan); }
.hit.is-on { border-color: var(--bone); box-shadow: 0 0 0 1px var(--bone); }
.opened { display: grid; gap: 12px; justify-items: center; width: 100%; padding-top: 4px; }
.reads { margin: 0; font-size: 15px; line-height: 1.5; text-align: center; color: var(--fg); }
.reads em { font-style: normal; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--scan); margin-inline-end: 6px; }

/* a name taken apart: each word over what it means there */
.apart { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 8px; width: 100%; }
.pw { display: inline-grid; justify-items: center; align-content: start; gap: 4px; padding: 7px 9px; border-radius: 10px; min-width: 40px; max-width: 200px; }
.pw .tk { font: 700 17px/1.2 var(--f-display); color: var(--fg); background: none; border: 0; padding: 0; }
.pw button.tk { cursor: pointer; color: var(--scan); text-decoration: underline; text-decoration-color: rgba(111, 208, 232, .35); text-underline-offset: 3px; }
.pw i { font-style: normal; font-size: 12.5px; line-height: 1.3; color: var(--fg); text-align: center; text-wrap: balance; }
.pw.is-word { background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px var(--line); }
.pw.is-plain i, .pw.is-other i { color: var(--muted); font-family: var(--f-mono); font-size: 10.5px; }
.pw.is-focus { box-shadow: inset 0 0 0 1px var(--bone); }
.pw .in { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.readbox { width: 100%; padding-top: 4px; border-top: 1px solid var(--line); }

/* ---------- a question ---------- */
.plate { flex: 1 0 auto; display: grid; place-items: center; width: 100%; padding: 18px 6px; box-sizing: border-box; }
.ask-word { margin: 0; font: 800 clamp(34px, calc(6vw / var(--room, 1)), 58px)/1.1 var(--f-display); font-stretch: 110%; color: var(--bone); text-align: center; overflow-wrap: anywhere; }
.ask-name { display: grid; gap: 10px; justify-items: center; }
.ask-name .words { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 12px; }
.ask-name .words span { font: 750 clamp(22px, calc(3.6vw / var(--room, 1)), 34px)/1.2 var(--f-display); color: var(--bone); padding: 4px 10px; border-radius: 9px; background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px var(--line); }
.ask-name .atl { margin: 0; font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ask-means { margin: 0; font-size: clamp(19px, calc(3.2vw / var(--room, 1)), 26px); font-weight: 650; text-align: center; color: var(--bone); max-width: 30ch; text-wrap: balance; line-height: 1.3; }
.feedback { display: grid; gap: 12px; width: 100%; }
@container (min-width: 640px) { .feedback.has-fig { grid-template-columns: minmax(0, 1fr) 230px; align-items: start; } }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 10px; width: 100%; }

/* ---------- the figure ---------- */
.figbox { display: grid; place-items: center; width: 100%; }
.figbox.ask { flex: 1 0 auto; }
.fig { width: min(100%, 230px); height: auto; overflow: visible; }
.figbox.ask .fig { width: auto; height: clamp(250px, calc(44vh / var(--room, 1)), 420px); max-width: 100%; }
.fig .body { fill: #1c2a36; stroke: #3d566b; stroke-width: 1.5; }
.fig .limb { fill: none; stroke: #1c2a36; stroke-width: 18; stroke-linecap: round; }
.fig .limb.leg { stroke-width: 22; }
.fig .eye { fill: #3d566b; }
.fig .mid { stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 5 6; opacity: .7; }
.fig .skin { fill: #3a2f2a; }
.fig .fat { fill: #4a4030; }
.fig .muscle { fill: #5a2d2d; }
.fig .seam { stroke: #3a1f1f; stroke-width: 1.5; fill: none; }
.fig .bonecut { fill: var(--bone); }
.fig .marrow { fill: #b89a6a; }
.fig .lbl { font: 600 12px var(--f-mono); fill: var(--fg); paint-order: stroke; stroke: #0b1219; stroke-width: 3px; }
.fig .dot { fill: var(--bone); stroke: #0b1219; stroke-width: 2; }
.fig .arrow line { stroke: var(--scan); stroke-width: 4; stroke-linecap: round; }
.fig .arrow path { fill: var(--scan); }
.fig .arrow .num { fill: #0b1219; stroke: var(--scan); stroke-width: 2; }
.fig .arrow text { font: 700 13px var(--f-mono); fill: var(--fg); }
.fig .arrow text.name { font: 600 12.5px var(--f-display); fill: var(--fg); paint-order: stroke; stroke: #0b1219; stroke-width: 4px; }
.fig .arrow.numbered { cursor: pointer; }
.fig .arrow.numbered:hover line { stroke-width: 5.5; }
.fig .arrow.is-right line { stroke: var(--ok); }
.fig .arrow.is-right path { fill: var(--ok); }
.fig .arrow.is-right .num { stroke: var(--ok); }
.fig .arrow.is-wrong line { stroke: var(--bad); }
.fig .arrow.is-wrong path { fill: var(--bad); }
.fig .arrow.is-wrong .num { stroke: var(--bad); }

/* ---------- the buttons under the board: the answers (a column: meanings are long) 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.25;
}
.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; }
.actions.row > .act .txt { flex: 0 1 auto; }
.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); }
/* a name read word by word is long: one answer to a line */
.actions.answers:has(.choice .txt:not(:empty)) .choice { font-weight: 600; }

@media (max-width: 900px) {
  .board { border-radius: 14px; gap: 10px; padding: 8px; }
  .actions { grid-template-columns: minmax(0, 1fr); }
  .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; }
  /* once answered, only the right answer and the pick stay: the word's card needs the room */
  .actions.answers > .choice:disabled:not(.is-right):not(.is-wrong) { display: none; }
  .cue { padding: 11px 13px; }
  .cue.main { padding: 14px; }
  .cue p { font-size: 13.5px; }
  .cue p.means { font-size: 16px; }
  .cue.main p.means { font-size: 18px; }
  .tab { padding: 7px 9px; font-size: 12.5px; }
  .figbox.ask .fig { height: clamp(200px, 36vh, 320px); }
  .fig { width: min(70%, 200px); }
  .pw { padding: 5px 6px; }
  .pw .tk { font-size: 15px; }
  .typebox { width: 100%; }
}
/* clean view: the subject takes the room the chips leave */
body.clean .chart, body.clean .tabs { display: none; }
