/* Beginner, in Learn (web/kids.js): big buttons and a big board for a child of six.
   Research behind the sizes: tap targets of 2 cm or more, text of 14 points or more, loud and
   simple feedback (docs/research/learn-buckets-2026-11-28/beginner-research.md). Stars, rings and
   crosses are told by shape and fill, never by colour alone. Colours come from the site's tokens. */

.kids, .kids-game { --kids-star: hsl(45 95% 52%); --kids-ink: #1b1b1b; }
.kids { font-size: 17px; }
.kids h1 { font-size: 34px; }
.kids .box__top .sub { margin-top: 0.3em; font-size: 15px; }
.kids-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.8em; }
.kids-back { margin: 0 0 0.3em; font-size: 15px; }
.kids-tools { display: flex; gap: 0.5em; flex-wrap: wrap; }
.kids-hear, .kids-quiet {
  display: inline-flex; align-items: center; gap: 0.45em; min-height: 52px; padding: 0 1em;
  border-radius: 26px; border: 2px solid var(--c-border); background: var(--c-bg-box);
  color: var(--c-font-clear); font-size: 17px; font-weight: 600; cursor: pointer;
}
.kids-hear svg { width: 26px; height: 26px; fill: currentColor; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.kids-hear svg path:last-child { fill: none; }
.kids-quiet[aria-pressed="true"] { border-style: dashed; }
.kids-hear:hover, .kids-quiet:hover { border-color: var(--c-primary); }

/* Stars: a filled shape won, an outlined shape not yet. */
.kids-star path { fill: none; stroke: var(--c-font-dim); stroke-width: 0.06; stroke-linejoin: round; }
.kids-star.on path { fill: var(--kids-star); stroke: var(--kids-ink); }
.kids-stars { display: inline-flex; gap: 0.1em; }

/* The path of lessons. */
.kids-path { display: grid; gap: 12px; margin: 0.5em calc(var(--box-pad) / 2) 1em; }
.kids-card {
  display: flex; align-items: center; gap: 0.9em; min-height: 84px; padding: 0.7em 1em;
  border: 2px solid var(--c-border); border-radius: 16px; background: var(--c-bg-box); color: var(--c-font);
}
a.kids-card:hover { border-color: var(--c-primary); color: var(--c-font); }
.kids-card.locked { border-style: dashed; opacity: 0.7; }
.kids-card.done { border-width: 3px; }
.kids-card__n { flex: 0 0 auto; width: 2em; height: 2em; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid currentColor; font-weight: 700; font-size: 16px; }
.kids-card__text { display: flex; flex-direction: column; gap: 0.2em; flex: 1 1 auto; min-width: 0; }
.kids-card__text b { font-size: 21px; color: var(--c-font-clear); }
.kids-card__text span { line-height: 1.35; }
.kids-card__bar { display: block; height: 8px; border-radius: 4px; border: 1px solid var(--c-border); overflow: hidden; margin-top: 0.3em; max-width: 16em; }
.kids-card__bar i { display: block; height: 100%; background: var(--c-font-dim); }
.kids-card__mark { font-size: 30px; font-weight: 700; color: var(--c-font-clear); }
.kids-lock { width: 30px; height: 30px; flex: 0 0 auto; fill: none; stroke: var(--c-font-dim); stroke-width: 2; }
.kids-pic { position: relative; display: inline-block; width: 64px; height: 64px; flex: 0 0 auto; }
.kids-pic piece { position: absolute; inset: 0; width: 100%; height: 100%; background-size: cover; }
.kids-ready { margin: 0.5em calc(var(--box-pad) / 2); padding: 0.8em 1em; border: 2px solid var(--c-good); border-radius: 12px; font-size: 18px; }
.kids-note { margin: 0 calc(var(--box-pad) / 2) 1.5em; }

/* One lesson. */
.kids-intro { display: flex; flex-wrap: wrap; gap: 1.2em; align-items: center; margin: 0.5em calc(var(--box-pad) / 2) 1em; }
.kids-intro > .kids-pic { width: 140px; height: 140px; }
.kids-demo { position: relative; width: min(340px, 100%); aspect-ratio: 1; }
.kids-demo .cg-wrap { position: absolute; inset: 0; }
.kids-words { flex: 1 1 260px; font-size: 20px; line-height: 1.45; }
.kids-words p { margin: 0 0 0.4em; }
.kids-go { display: inline-flex; align-items: center; min-height: 60px; padding: 0 1.6em; margin-top: 0.6em; font-size: 20px; border-radius: 30px; }
.kids-levels { display: flex; flex-wrap: wrap; gap: 12px; margin: 0.5em calc(var(--box-pad) / 2) 1.5em; }
.kids-level {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2em;
  width: 96px; height: 96px; border: 2px solid var(--c-border); border-radius: 50%; background: var(--c-bg-box); color: var(--c-font-clear);
}
.kids-level b { font-size: 28px; line-height: 1; }
.kids-level .kids-star { width: 1.1em; height: 1.1em; }
a.kids-level:hover { border-color: var(--c-primary); }
.kids-level.locked { border-style: dashed; opacity: 0.65; }
.kids-exam-note { margin: 0 calc(var(--box-pad) / 2) 1.5em; font-size: 19px; }

/* One level: the board as big as the screen allows, the words under it on a phone. */
.kids-game { display: grid; grid-template-columns: minmax(0, 640px) minmax(240px, 1fr); grid-template-areas: "head head" "board side"; gap: 14px 22px; align-items: start; font-size: 18px; }
.kids-game__head { grid-area: head; display: flex; align-items: center; gap: 1em; flex-wrap: wrap; }
.kids-game__head b { font-size: 20px; color: var(--c-font-clear); }
.kids-game__head .kids-hear { margin-left: auto; }
.kids-game__board { grid-area: board; position: relative; width: 100%; aspect-ratio: 1; }
.kids-game__board .cg-wrap { position: absolute; inset: 0; }
.kids-game__side { grid-area: side; display: flex; flex-direction: column; gap: 0.8em; }
.kids-ask { font-size: 26px; font-weight: 600; line-height: 1.3; color: var(--c-font-clear); margin: 0; }
.kids-count { display: flex; flex-direction: column; gap: 0.3em; }
.kids-count small { color: var(--c-font-dim); font-size: 16px; }
.kids-took { display: inline-grid; place-items: center; width: 1.4em; height: 1.4em; margin-right: 0.15em; border: 2px dashed var(--c-font-dim); border-radius: 50%; font-weight: 700; }
.kids-took.on { border-style: solid; border-color: var(--c-font-clear); }
.kids-msg { font-size: 20px; line-height: 1.4; min-height: 1.4em; }
.kids-msg.bad { padding-left: 0.7em; border-left: 5px dashed var(--c-bad); }
.kids-msg.good { padding-left: 0.7em; border-left: 5px solid var(--c-good); }
.kids-win { display: flex; flex-direction: column; gap: 0.35em; }
.kids-win .kids-star { width: 2.4em; height: 2.4em; }
.kids-win b { font-size: 22px; color: var(--c-font-clear); }
.kids-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.kids-btn { min-height: 60px; padding: 0 1.4em; font-size: 19px; border-radius: 30px; }

/* The marks drawn over the board (web/kids.js draws them in square units, 8 by 8). */
.kids-over { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; overflow: visible; }
.kids-over.taps { pointer-events: auto; cursor: pointer; }
.kids-board-star { fill: var(--kids-star, hsl(45 95% 52%)); stroke: #1b1b1b; stroke-width: 0.045; stroke-linejoin: round;
  filter: drop-shadow(0 0 0.04px #fff); }
.kids-dot { fill: #1b1b1b; fill-opacity: 0.55; stroke: #fff; stroke-width: 0.04; }
.kids-found { fill: #1b1b1b; fill-opacity: 0.7; stroke: #fff; stroke-width: 0.06; }
/* A found piece on "See the board": a thick ring around it, so the piece still shows. */
.kids-found-ring { fill: none; stroke: #1b1b1b; stroke-width: 0.1; filter: drop-shadow(0 0 0.03px #fff) drop-shadow(0 0 0.03px #fff); }
.kids-x path { stroke: #1b1b1b; stroke-width: 0.11; stroke-linecap: round; fill: none; }
.kids-x { filter: drop-shadow(0 0 0.03px #fff) drop-shadow(0 0 0.03px #fff); }
.kids-x.miss path { stroke-width: 0.15; }
.kids-ring { fill: none; stroke: #1b1b1b; stroke-width: 0.09; stroke-dasharray: 0.16 0.1; }
.kids-ring.hint { stroke-dasharray: none; stroke-width: 0.11; }

/* Bigger move dots on the board, for small fingers. */
.kids-game cg-board square.move-dest { background: radial-gradient(rgba(20, 30, 0, 0.5) 26%, rgba(0, 0, 0, 0) 28%); }
.kids-game cg-board square.oc.move-dest { background: radial-gradient(transparent 0%, transparent 72%, rgba(20, 30, 0, 0.45) 72%); }

@media (max-width: 799px) {
  .kids { font-size: 16px; }
  .kids-game { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "board" "side"; gap: 10px; }
  .kids-ask { font-size: 22px; }
  .kids-path, .kids-levels, .kids-intro, .kids-note, .kids-exam-note, .kids-ready { margin-left: 12px; margin-right: 12px; }
  .kids-level { width: 80px; height: 80px; }
}

/* The file letters inside the bottom row, at each square's right edge. Chessground draws them
   24px to the right of the board, which ran past a phone's edge (the layout check's catch). */
/* The coordinates stand in a strip outside the board (looks.css, .coords-out), since 29 November 2026. */
.kids-demo.coords-out { width: min(340px, 100% - var(--cg-gutter)); margin-left: var(--cg-gutter); margin-bottom: var(--cg-gutter); }
.kids-game__board.coords-out { width: calc(100% - var(--cg-gutter)); margin: 0 0 var(--cg-gutter) var(--cg-gutter); }

/* Next steps (web/kids.js, site/bridge.py): a child of about eight, on the same board. The turn
   bar names the side to move with its king; the reply arrow is dashed and a hint arrow solid, so
   the two are told apart by their line and not by colour; a board from an earlier lesson has a
   dashed circle. */
.kids-turn { display: inline-flex; align-items: center; gap: 0.4em; font-size: 17px; font-weight: 600; color: var(--c-font-clear); }
.kids-turn .kids-pic { width: 34px; height: 34px; }
.kids-top-note { margin: 0.2em calc(var(--box-pad) / 2) 0.6em; font-size: 16px; }
.kids-level.review { border-style: dashed; }
.kids-arrow line { stroke: #1b1b1b; stroke-width: 0.13; stroke-linecap: round; }
.kids-arrow polygon { fill: #1b1b1b; }
.kids-arrow.dashed line { stroke-dasharray: 0.22 0.16; stroke-width: 0.11; }
.kids-arrow { filter: drop-shadow(0 0 0.04px #fff) drop-shadow(0 0 0.04px #fff); opacity: 0.85; }
.kids--bridge h1 { font-size: 30px; }
.kids-pick line { stroke: #1b1b1b; stroke-width: 0.07; stroke-linecap: round; }
.kids-pick circle { fill: none; stroke: #1b1b1b; stroke-width: 0.07; }
.kids-pick { filter: drop-shadow(0 0 0.03px #fff) drop-shadow(0 0 0.03px #fff); opacity: 0.8; }

/* ---------- the six-month course (29 November 2026) ---------- */
/* The map is a column of a chessboard: each month a row, the pawn on this month's row. Every
   state is told by shape and words as well as shade: a solid edge is this row, a tick is done,
   a dashed edge and a lock is not open yet. Targets are at least 56px for a child's finger. */
.kids-today { display: flex; gap: 1em; align-items: center; margin: 0.6em calc(var(--box-pad) / 2) 1em; padding: 1em 1.2em;
  border: 3px solid var(--c-font-clear); border-radius: 18px; background: var(--c-bg-box, transparent); }
.kids-today > .kids-pic { width: 96px; height: 96px; }
.kids-today__text { display: flex; flex-direction: column; gap: 0.3em; min-width: 0; }
.kids-today__text b { font-size: 26px; color: var(--c-font-clear); line-height: 1.2; }
.kids-today__line { font-size: 20px; line-height: 1.4; margin: 0; }
.kids-today .kids-go { margin-top: 0.2em; align-self: flex-start; }
.kids-row__n { font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-font-dim); font-weight: 700; }
.kids-map { list-style: none; padding: 0; margin: 0.4em calc(var(--box-pad) / 2) 1em; display: grid; gap: 10px; }
.kids-row { display: grid; grid-template-columns: minmax(120px, 30%) 1fr; gap: 14px; align-items: center; padding: 10px;
  border: 2px dashed var(--c-border); border-radius: 14px; }
.kids-row.past { border-style: solid; }
.kids-row.here { border: 4px solid var(--c-font-clear); }
.kids-row.crown .kids-row__text b { font-size: 22px; }
.kids-row__board { position: relative; display: grid; grid-template-columns: repeat(8, 1fr); aspect-ratio: 8 / 1; border-radius: 6px; overflow: hidden;
  border: 1px solid #b59a72; }
.kids-row__board i.lt { background: #F4EBDB; }
.kids-row__board i.dk { background: #DCC3A0; }
/* g2 keeps the light square's colour; /web/g2.css lights its border and presses the letters g2 into it. */
.kids-row__pawn { position: absolute; left: 56.25%; top: 50%; transform: translate(-50%, -62%); }
.kids-row__pawn .kids-pic { width: 54px; height: 54px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35)); }
.kids-row__text { display: flex; flex-direction: column; gap: 0.2em; min-width: 0; }
.kids-row__text > b { font-size: 21px; color: var(--c-font-clear); }
.kids-weeks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 0.4em; }
.kids-week { display: inline-flex; align-items: center; justify-content: center; gap: 0.2em; min-width: 56px; height: 56px; padding: 0 0.5em;
  border: 2px dashed var(--c-border); border-radius: 28px; font-size: 20px; color: var(--c-font); text-decoration: none; }
a.kids-week { border-style: solid; border-color: var(--c-font-dim); }
a.kids-week:hover { border-color: var(--c-primary); }
.kids-week.done { border-width: 3px; border-color: var(--c-font-clear); }
.kids-week.now { border-width: 4px; border-color: var(--c-font-clear); font-weight: 700; }
.kids-week.locked { opacity: 0.6; }
.kids-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 0.4em calc(var(--box-pad) / 2) 1em; }
.kids-chip { display: inline-flex; align-items: center; gap: 0.5em; min-height: 60px; padding: 0.2em 1em 0.2em 0.4em; border: 2px solid var(--c-font-dim);
  border-radius: 30px; color: var(--c-font); text-decoration: none; font-size: 18px; }
.kids-chip .kids-pic { width: 48px; height: 48px; }
.kids-home { margin: 0.5em calc(var(--box-pad) / 2) 1.5em; padding: 0.9em 1.1em; border: 2px solid var(--c-border); border-radius: 14px; font-size: 18px; line-height: 1.45; }
.kids-home p { margin: 0.3em 0 0; }
.kids-film { display: block; width: min(640px, calc(100% - var(--box-pad))); margin: 0.4em calc(var(--box-pad) / 2) 1em; border-radius: 14px; background: #000; }

/* The box the lone king is shut in: shaded, with a dashed edge, never told by colour alone. */
.kids-box { fill: rgba(31, 41, 55, 0.16); stroke: #1F2937; stroke-width: 0.035; stroke-dasharray: 0.12 0.08; }

/* The tray of pieces to set up: big buttons, the chosen one with a thick solid edge. */
.kids-tray { display: flex; flex-wrap: wrap; gap: 8px; }
.kids-tray__p { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 72px; height: 72px; padding: 0;
  border: 2px dashed var(--c-font-dim); border-radius: 14px; background: transparent; cursor: pointer; }
.kids-tray__p .kids-pic { width: 58px; height: 58px; }
.kids-tray__p span { position: absolute; right: 4px; bottom: 2px; font-size: 16px; font-weight: 700; color: var(--c-font-clear); }
.kids-tray__p.on { border: 4px solid var(--c-font-clear); }

@media (max-width: 720px) {
  .kids-today { flex-direction: column; align-items: flex-start; margin-left: 12px; margin-right: 12px; }
  .kids-today > .kids-pic { width: 72px; height: 72px; }
  .kids-map, .kids-chips, .kids-home { margin-left: 12px; margin-right: 12px; }
  .kids-row { grid-template-columns: 1fr; }
  .kids-row__pawn .kids-pic { width: 40px; height: 40px; }
  .kids-film { width: calc(100% - 24px); margin-left: 12px; }
}
.kids-catch { display: flex; flex-wrap: wrap; gap: 2px; min-height: 36px; }
.kids-pic--s { width: 34px; height: 34px; }
.kids-guide { width: 96px; height: auto; flex: 0 0 auto; }
.kids-guide--s { width: 46px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35)); }
@media (max-width: 720px) { .kids-today > .kids-guide { width: 72px; } }
/* A child's buttons: a solid edge and full-strength words on any theme (the site's outline
   button is too faint for a six-year-old), and the answers to "mate or stalemate" as big cards. */
.kids-game .kids-btn.button-empty, .kids .kids-btn.button-empty { border: 2px solid var(--c-font-dim); color: var(--c-font-clear); }
.kids-actions .kids-choice { flex: 1 1 calc(50% - 10px); min-height: 72px; font-size: 21px; border: 3px solid var(--c-font-clear); color: var(--c-font-clear); }

/* ---------- the games kept: the list, and a game played again (29 November 2026) ---------- */
.kids-kept a { font-weight: 700; }
.kids-replay .kids-ask { font-size: 20px; }
.kids-moves { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(11em, 1fr)); gap: 2px 10px; max-height: 18em; overflow-y: auto; }
.kids-moves li { display: grid; grid-template-columns: 2.4em 1fr 1fr; align-items: center; gap: 4px; }
.kids-move__n { color: var(--c-font-dim); font-size: 15px; text-align: right; }
.kids-move { font: inherit; font-size: 16px; padding: 3px 6px; border: 2px solid transparent; border-radius: 6px; background: none; color: var(--c-font); cursor: pointer; text-align: left; }
.kids-move.mine { font-weight: 700; color: var(--c-font-clear); }
.kids-move:hover { border-color: var(--c-border); }
/* The move shown: a solid frame; a marked move: a dashed underline and a "?" (never colour alone). */
.kids-move.now { border-color: var(--c-font-clear); }
.kids-move.marked { text-decoration: underline dashed; text-underline-offset: 3px; }
.kids-move__mark { margin-left: 2px; font-weight: 800; }
.kids-move.empty { cursor: default; color: var(--c-font-dim); }
.kids-marks { border-top: 1px solid var(--c-border); padding-top: 0.5em; }
.kids-marks ul { margin: 0.3em 0 0; padding-left: 1.1em; }
.kids-marks li { margin: 0.25em 0; }
.kids-mark { font: inherit; font-weight: 700; padding: 0; border: 0; background: none; color: var(--c-font-clear); text-decoration: underline; cursor: pointer; }
/* Keep my games, Keep this game, No thanks (30 November 2026): small buttons inside a line of words. */
.kids-kept .button.kids-keep { display: inline-block; margin: 0.25em 0.4em 0 0; padding: 0.35em 0.8em; font-size: inherit; line-height: 1.3; vertical-align: baseline; }
.kids-kept .kids-keep-why { color: var(--c-font-clear); }
#kids-kept { display: block; }
/* From the story (30 November 2026): one scene of the film under a lesson's words. */
.kids-story { margin: 0.4em calc(var(--box-pad) / 2) 1.2em; }
.kids-story h2 { font-size: 18px; font-weight: 600; margin: 0 0 0.5em; color: var(--c-font-clear); }
.kids-story .kids-film { width: min(560px, 100%); margin: 0; }
.kids-story .kids-note { margin: 0.5em 0 0; }

/* Which piece a pawn becomes at the far side (web/kids_play.js `pick`): four big buttons over the
   board, each a picture of the piece with its name under it. */
.kids-newpiece { position: absolute; inset: 0; z-index: 30; display: grid; place-content: center; gap: 12px; padding: 12px;
  background: color-mix(in srgb, var(--c-bg-box) 88%, transparent); border-radius: 8px; text-align: center; }
.kids-newpiece__ask { margin: 0; font-size: 24px; font-weight: 700; color: var(--c-font-clear); }
.kids-newpiece__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kids-newpiece__btn { display: grid; justify-items: center; gap: 4px; min-width: 108px; min-height: 108px; padding: 10px;
  border: 3px solid var(--c-border); border-radius: 18px; background: var(--c-bg-box); color: var(--c-font-clear);
  font-size: 18px; cursor: pointer; }
.kids-newpiece__btn:hover, .kids-newpiece__btn:focus-visible { border-color: var(--c-primary); }
/* A piece picture here is not the board: the rule that stretches the board to its frame is undone. */
.kids-newpiece .kids-newpiece__btn .kids-pic.cg-wrap { position: relative; inset: auto; width: 64px; height: 64px; }
