/* Fingerprint Trainer's 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: the prints (on white, like a card, with the
   examiner's marks drawn on them), a question's plate (the print, and what to look for beside it after an answer when
   there is room), the cards that explain a pattern or a detail, Explore's print beside every lesson's chips, 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 marks have their own, picked to show on white paper. */

.board {
  --mk-core: #e0362c;     /* a core: a red circle */
  --mk-delta: #1668c9;    /* a delta: a blue triangle */
  --mk-line: #f08c00;     /* the ridge-count line and its counted ridges */
  --mk-ring: #c2188a;     /* a detail */
  --mk-rare: #0b8f6a;     /* a rare detail, in a comparison */
  --mk-ok: #11914f;
  --mk-bad: #e0362c;
  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: 18px;
  padding: clamp(14px, 2.6vh, 26px) clamp(14px, 2vw, 26px);
  background: radial-gradient(80% 60% at 50% 25%, #13222c 0%, #0c141b 72%);
  border: 1px solid var(--line-strong); border-radius: 18px;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.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; }

/* a print: the picture on white, as on a card; tap to see it bigger, tap again (or Esc) for back */
.fig { margin: 0; display: grid; gap: 6px; justify-items: center; min-width: 0; }
.fig svg.fp {
  /* --ph: the picture's height when there is room; the width follows from its shape, and gives way on a narrow screen */
  --ph: clamp(220px, 46vh, 430px); --ar: calc(360 / 440);
  display: block; width: calc(var(--ph) * var(--ar)); max-width: 100%; height: auto; aspect-ratio: 360 / 440;
  background: #f7f6f2; border-radius: 12px; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
}
.fig svg.fp .paper { fill: #f7f6f2; }
.fig svg.latent { --ar: 1; aspect-ratio: 1; background: #d9d9d6; }
.fig svg.zoom { --ar: 1; aspect-ratio: 1; }
.fig figcaption { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.fig.can-zoom svg { cursor: zoom-in; }
.fig.is-big {
  position: fixed; inset: 0; z-index: 60; place-content: center; background: rgba(5, 9, 12, 0.94); padding: 3vh 3vw;
}
.fig.is-big svg.fp { --ph: min(92vh, 1100px); max-width: 94vw; cursor: zoom-out; }
.fig.is-big figcaption { color: var(--fg); }
svg.fp.tappable { cursor: crosshair; }

/* the examiner's marks */
.mk { fill: none; stroke-width: 2.4; paint-order: stroke; vector-effect: non-scaling-stroke; }
.mk.core { stroke: var(--mk-core); stroke-width: 2.8; }
.mk.delta { stroke: var(--mk-delta); stroke-width: 2.8; stroke-linejoin: round; }
.mk.ok { stroke: var(--mk-ok); stroke-width: 3; }
.mk.show { stroke-width: 3; }
.mk.line { stroke: var(--mk-line); stroke-width: 2; stroke-dasharray: 5 4; }
.mk.tick { fill: var(--mk-line); stroke: #fff; stroke-width: 1.2; }
.mk.tap { fill: var(--mk-bad); stroke: #fff; stroke-width: 1.4; }
.mk.ring { stroke: var(--mk-ring); stroke-width: 2.6; }
.mk.ring.rare { stroke: var(--mk-rare); }
.mk.ring.bad { stroke: var(--mk-bad); stroke-dasharray: 4 3; }
.mk.num { fill: #fff; stroke: #10202b; stroke-width: 3.5px; font: 700 15px var(--f-mono); vector-effect: none; }
svg.zoom .mk.num, svg.latent .mk.num { font-size: 22px; }

/* a question's plate: the print; after an answer, what to look for beside it when there is room (under it when not) */
.plate { display: grid; gap: 16px; width: min(100%, 980px); justify-items: center; align-items: center; }
.plate > .cue, .plate > .feedback { width: min(100%, 520px); }
@container (min-width: 600px) {
  .plate.has-fb:not(.stack) { grid-template-columns: max-content minmax(260px, 440px); justify-content: center; }
}
.plate.stack .feedback { width: min(100%, 640px); }

/* two prints side by side: the latent and the inked print (matching), or the whole print and a close look (counts) */
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, auto)); gap: 16px; justify-content: center; align-items: end; width: 100%; }
.pair svg.fp { --ph: clamp(200px, 42vh, 400px); }

/* the cards that say what something is */
.feedback { display: grid; gap: 10px; width: 100%; }
.cue { background: var(--bg-lift); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 7px; width: 100%; box-sizing: border-box; max-width: 640px; align-content: start; }
.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-head .rare { color: var(--ok); }
.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.rule { border-color: var(--line-strong); background: rgba(111, 208, 232, 0.06); }
.cue.has-sketch { grid-template-columns: 64px 1fr; align-items: center; gap: 14px; }
.sketch { width: 64px; height: 64px; background: #f7f6f2; border-radius: 10px; }
.sketch path { fill: none; stroke: #1a1a1a; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }

/* Explore: the print (or close looks at a detail), and beside it what it is and every lesson's chips */
.explore { display: grid; gap: 22px; width: min(100%, 1040px); align-items: start; justify-items: center; }
@container (min-width: 600px) { .explore:not(.one) { grid-template-columns: minmax(0, 1.1fr) minmax(280px, 1fr); justify-items: stretch; } }
/* a detail's close looks need the width: they go across the top, what it is and the chart under them */
.explore.one { width: min(100%, 680px); }
.detail { display: grid; gap: 12px; justify-items: center; align-content: start; min-width: 0; }
.side { display: grid; gap: 12px; align-content: start; min-width: 0; width: 100%; }
.side .cue { max-width: none; }
.zooms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; }
.zooms svg.fp { width: 100%; }
.chart { display: grid; gap: 14px; min-width: 0; padding-top: 4px; }
.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; }
.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: each new pattern or detail, a print of it and what it is */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 14px; justify-content: center; width: min(100%, 1040px); }
/* a detail's card has its drawing beside its words, so it needs a wider column */
.cards.wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); width: min(100%, 760px); }
.icard { display: grid; gap: 10px; justify-items: center; align-content: start; min-width: 0; }
.icard .fig { width: 100%; }
.icard svg.fp { width: 100%; max-width: calc(clamp(180px, 34vh, 320px) * var(--ar)); }
.icard .cue { padding: 12px 13px; }
.icard .cue p { font-size: 13.5px; }
.board > .cue { width: min(100%, 720px); }

/* 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, four by two for many) or a row of actions; a small one inside */
.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; }
@media (min-width: 901px) { .actions.many { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.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.small { min-height: 34px; padding: 6px 14px; font-size: 13px; flex: none; }

@media (max-width: 900px) {
  .board { border-radius: 14px; gap: 14px; padding: 12px; }
  .fig svg.fp { --ph: clamp(180px, 34vh, 330px); }
  .plate { gap: 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; }
  .pair { gap: 8px; }
  .pair svg.fp { width: 100%; }
}
