/* Animal Tracks' 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 photos (in a dark frame, credited on the photo,
   tap for bigger), a question's plate (the photo or trail, and what to look for beside it after an answer when there is
   room), the trails of the Gaits skill, the track groups' drawings, the cards that explain, Explore's viewer beside
   every lesson's chips, a lesson's card, and the buttons under the board (the same sizes as Fingerprint Trainer's and
   Dog Breeds' answers). Colours and fonts are the shell's variables. */

.board {
  --frame: #0b1217;
  --ground: #1b1712;     /* a trail's ground: dark, warm, like damp sand */
  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 { color: var(--scan); }

/* ---------- a photo: in a dark frame, its credit along the bottom; tap for bigger, tap again (or Esc) for back ---------- */
.photo {
  position: relative; margin: 0; overflow: hidden; display: grid; place-items: center; cursor: zoom-in;
  background: var(--frame); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.4);
}
.photo img { width: 100%; height: 100%; object-fit: contain; display: block; opacity: 0; transition: opacity .2s; }
.photo img.is-in { opacity: 1; }
.photo .wait { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; text-align: center; color: var(--muted); font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; pointer-events: none; }
.photo .credit-line {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 12px 7px; text-align: end;
  font-size: 11px; color: rgba(232, 237, 240, 0.8); background: linear-gradient(transparent, rgba(5, 9, 12, 0.8));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default;
}
.photo .credit-line a { color: inherit; text-decoration: underline; text-decoration-color: rgba(232, 237, 240, 0.4); }
.photo.main { width: min(100%, 760px); height: clamp(240px, 52vh, 600px); }
.photo.thumb { width: 100%; aspect-ratio: 4 / 3; }
.photo.thumb .credit-line { font-size: 9.5px; padding: 12px 7px 4px; }
.photo.is-big {
  position: fixed; inset: 0; z-index: 60; width: auto; height: auto; aspect-ratio: auto; border-radius: 0; border: 0;
  background: rgba(5, 9, 12, 0.96); padding: 2vh 2vw 34px; cursor: zoom-out;
}
.photo.is-big .credit-line { font-size: 12px; }

/* ---------- a trail (Gaits): the prints on dark ground, fronts filled, hinds outlined, travelling up ---------- */
.trailfig { margin: 0; display: grid; gap: 8px; justify-items: center; }
svg.trail {
  display: block; height: clamp(260px, 52vh, 560px); width: auto; max-width: 100%;
  background: var(--ground); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.4);
}
svg.trail .print.front { fill: var(--bone); }
svg.trail .print.hind { fill: none; stroke: var(--scan); stroke-width: 0.075; }
svg.trail .drag { fill: none; stroke: rgba(232, 237, 240, 0.35); stroke-width: 0.06; stroke-linecap: round; }
svg.trail .arrow { fill: none; stroke: var(--muted); stroke-width: 0.07; stroke-linecap: round; stroke-linejoin: round; }
svg.trail .foot { font: 600 0.3px var(--f-mono); fill: var(--bone); }
svg.trail .foot.to-left { text-anchor: end; }
svg.trail .foot.h { fill: var(--scan); }
.trailfig figcaption { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.trailfig .key { width: 10px; height: 12px; border-radius: 50%; display: inline-block; }
.trailfig .key.front { background: var(--bone); }
.trailfig .key.hind { border: 1.5px solid var(--scan); box-sizing: border-box; margin-inline-start: 8px; }
.trailfig .sep { width: 10px; }

/* ---------- a track group's drawing: its front and hind print ---------- */
.feetfig { margin: 0; display: grid; gap: 6px; justify-items: center; width: 100%; }
svg.feet { display: block; width: min(100%, 420px); height: auto; background: var(--bg-lift); border: 1px solid var(--line); border-radius: 14px; padding: 10px 6px 4px; box-sizing: border-box; }
svg.feet.small { width: min(100%, 240px); padding: 6px 4px 2px; }
svg.feet .pad { fill: var(--bone); }
svg.feet .claw { stroke: var(--bone); stroke-width: 3.2; stroke-linecap: round; }
svg.feet .faint { fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-dasharray: 4 3; }
svg.feet .lbl { font: 600 10px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; fill: var(--muted); text-anchor: middle; }
.feetfig figcaption { font-size: 12px; color: var(--muted); text-align: center; }
.feetmini { display: grid; justify-items: center; }

/* ---------- a question's plate: the picture; after an answer, what to look for beside it when there is room ---------- */
.plate { display: grid; gap: 14px; width: min(100%, 1060px); justify-items: center; align-items: center; }
.plate > .photo.main { width: min(100%, 820px); }
/* after the answer the picture makes room, so what to look for shows under it without scrolling */
.plate.has-fb > .photo.main { height: clamp(180px, 34vh, 420px); }
.plate.has-fb svg.trail { height: clamp(200px, 36vh, 440px); }
.plate .feedback { width: min(100%, 760px); }
@container (min-width: 600px) { .feedback.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- 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 .sci { font-size: 12.5px; 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: .12em; text-transform: uppercase; color: var(--scan); }
.cue .note-line, .cue .size-line { font-size: 13px; color: var(--muted); }
.cue .src { font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.cue.rule { border-color: var(--line-strong); background: rgba(111, 208, 232, 0.06); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 4px 0 0; font-size: 13.5px; line-height: 1.45; }
.facts dt { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.facts dd { margin: 0; color: var(--fg); }
.alikes { display: grid; gap: 8px; }
.alike { display: grid; gap: 4px; padding: 9px 10px; border-radius: 9px; background: rgba(10, 15, 20, 0.45); border: 1px solid rgba(232, 237, 240, 0.07); justify-items: start; }
.alike .who { font: inherit; font-size: 12.5px; font-weight: 650; color: var(--scan); background: none; border: 1px solid var(--line-strong); border-radius: 6px; padding: 2px 8px; cursor: pointer; }
.alike .who:hover { border-color: var(--scan); }
.alike p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }

/* ---------- Explore: the picture, and beside it what it is and every lesson's chips ---------- */
.explore { display: grid; gap: 22px; width: min(100%, 1120px); align-items: start; justify-items: center; }
@container (min-width: 620px) { .explore { grid-template-columns: minmax(0, 1.15fr) minmax(260px, 1fr); justify-items: stretch; } }
.detail { display: grid; gap: 12px; justify-items: center; align-content: start; min-width: 0; }
.detail .photo.main { width: 100%; height: clamp(240px, 54vh, 620px); }
.viewer { display: grid; gap: 8px; width: 100%; justify-items: center; }
.viewer-nav { display: flex; align-items: center; gap: 12px; }
.viewer-nav .count { font-family: var(--f-mono); font-size: 11.5px; color: var(--muted); min-width: 9ch; text-align: center; }
.thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
.side { display: grid; gap: 12px; align-content: start; min-width: 0; width: 100%; }
.side .cue { max-width: none; }
.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: 7px 11px; }
.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); }
span.chip { cursor: default; }

/* ---------- a lesson's card: each new item, a picture of it and what to look for ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 14px; justify-content: center; width: min(100%, 1100px); }
.cards.wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.icard { display: grid; gap: 10px; justify-items: center; align-content: start; min-width: 0; }
.icard .cue { padding: 12px 13px; }
.icard .cue p { font-size: 13.5px; }
.icard svg.trail { height: clamp(200px, 34vh, 320px); }

/* ---------- 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, three by two for many) 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; }
@media (min-width: 901px) { .actions.many { grid-template-columns: repeat(3, 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: 10px; }
  .photo.main, .detail .photo.main { height: clamp(200px, 40vh, 420px); }
  .plate.has-fb > .photo.main { height: clamp(160px, 30vh, 320px); }
  svg.trail { height: clamp(220px, 40vh, 420px); }
  .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; }
  .facts { grid-template-columns: 1fr; gap: 2px 0; }
  .facts dd { margin-bottom: 6px; }
}

/* Right to left (Arabic, Persian, Hebrew), an animal's notes stay English: each takes its direction from its own first
   letter, so its full stop stays at its end */
[dir="rtl"] :is(.cue p, .alike p, .facts dd) { unicode-bidi: plaintext; }
