/* Pet games (#play and play/<game>). Tokens only. One job per screen; the stage and the controls sit side by side on a laptop. */
.gm-shell { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.gm-screen { display: flex; flex-direction: column; gap: var(--space-3); max-width: 1120px; margin: 0 auto; }
.gm-screen h1 { max-width: none; }
.gm-visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.gm-kicker { margin: 0; color: var(--blue-dark); font-weight: 700; font-size: var(--text-small); text-transform: uppercase; letter-spacing: .06em; }
.gm-head h1 { font-family: var(--font-display); font-size: clamp(28px, 3.4vw, 38px); line-height: 1.1; margin: 0; }
.gm-lede { margin: var(--space-1) 0 0; color: var(--muted); }
.gm-note { margin: 0; color: var(--muted); font-size: var(--text-small); }
.gm-crumbs { margin-bottom: var(--space-1); }

.gm-button { min-height: var(--target-min); border: 2px solid var(--transparent); border-radius: var(--radius-md); padding: var(--space-2) var(--space-4); font: inherit; font-weight: 700; font-size: 17px; cursor: pointer; background: var(--transparent); color: var(--ink); }
.gm-button:disabled { opacity: .5; cursor: default; }
.gm-button:focus-visible, .gm-link:focus-visible, .gm-level:focus-visible, .gm-row:focus-visible, .gm-tile:focus-visible, .gm-chip:focus-visible, .gm-choice:focus-visible, .gm-input:focus-visible, .gm-slider:focus-visible { outline: 3px solid var(--blue-dark); outline-offset: 2px; }
.gm-primary { background: var(--blue-strong); color: var(--paper); }
.gm-secondary { background: var(--paper); border-color: var(--line); }
.gm-secondary.is-nudged { border-color: var(--blue-strong); box-shadow: var(--elevation-soft); }
.gm-link { min-height: var(--target-min); padding: 0 var(--space-1); border: 0; background: var(--transparent); color: var(--blue-dark); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.gm-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

/* Menu and list */
.gm-levels { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.gm-level { width: 100%; height: 100%; display: flex; flex-direction: column; gap: var(--space-1); align-items: flex-start; text-align: left; padding: var(--space-4); background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--elevation-soft); font: inherit; color: var(--ink); cursor: pointer; }
.gm-level:hover { border-color: var(--blue); }
.gm-level strong { font-family: var(--font-display); font-size: 22px; }
.gm-level-n { color: var(--blue-dark); font-weight: 700; font-size: var(--text-small); text-transform: uppercase; letter-spacing: .06em; }
.gm-level-blurb { color: var(--muted); }
.gm-level-best, .gm-stars { color: var(--yellow); letter-spacing: .12em; font-size: 22px; }
.gm-resume { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; padding: var(--space-3) var(--space-4); background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius-md); }
.gm-resume p { margin: 0; font-weight: 700; }
/* The hub and the subject lists: compact one-row buttons, paginated, never a long page */
.gm-hubhead, .gm-subjecthead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-2) var(--space-4); }
.gm-hubhead .gm-lede, .gm-subjecthead .gm-lede { margin-top: 2px; }
.gm-titleline { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-4); }
.gm-titleline .gm-crumbs, .gm-titleline .gm-lede { margin: 0; }
.gm-subjecthead { align-items: center; }
.gm-subjecthead h1 { font-size: clamp(24px, 3vw, 32px); }
.gm-search { display: flex; align-items: center; gap: var(--space-2); min-height: var(--target-min); padding: 0 var(--space-3); background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius-md); width: min(100%, 340px); }
.gm-search:focus-within { border-color: var(--blue-dark); outline: 3px solid var(--blue-dark); outline-offset: 2px; }
.gm-search input { flex: 1; min-width: 0; min-height: 40px; border: 0; background: var(--transparent); font: inherit; color: var(--ink); outline: none; }
.gm-hub [data-gm-body] { display: flex; flex-direction: column; gap: var(--space-4); }
.gm-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-3); }
.gm-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: var(--space-3); background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--elevation-soft); font: inherit; color: var(--ink); cursor: pointer; min-width: 0; }
.gm-tile:hover { border-color: var(--blue); }
.gm-tile strong { font-family: var(--font-display); font-size: 20px; }
.gm-tile span { color: var(--muted); font-size: var(--text-small); }
.gm-tile .gm-tile-icon { width: 32px; height: 32px; }
.gm-tile .gm-tile-stars { color: var(--ink); font-weight: 700; }
.gm-hubrow { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.gm-featured h2, .gm-played h2, .gm-group h2 { font-family: var(--font-display); font-size: 20px; margin: 0 0 var(--space-2); }
.gm-group h2 span { font-family: var(--font-body, inherit); font-size: var(--text-small); font-weight: 500; color: var(--muted); }
.gm-featured ul, .gm-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.gm-played { background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-3) var(--space-4); }
.gm-played-line { margin: 0 0 var(--space-1); font-size: 18px; }
.gm-row { width: 100%; min-height: var(--target-min); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; text-align: left; padding: var(--space-1) var(--space-3); background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius-md); font: inherit; color: var(--ink); cursor: pointer; }
.gm-row:hover { border-color: var(--blue); }
.gm-row .gm-row-icon { width: 28px; height: 28px; }
.gm-screen .gm-heading-icon { width: 36px; height: 36px; vertical-align: middle; }
.gm-bar .gm-heading-icon { width: 26px; height: 26px; }
.gm-screen .gm-action-icon { width: 24px; height: 24px; vertical-align: middle; }
.gm-row-text { display: flex; flex-direction: column; min-width: 0; }
.gm-row-text strong { font-family: var(--font-display); font-size: 17px; line-height: 1.2; overflow-wrap: anywhere; }
.gm-row-text span { color: var(--muted); font-size: 13px; line-height: 1.2; }
.gm-row-best { color: var(--yellow); letter-spacing: .08em; font-size: 16px; white-space: nowrap; }
.gm-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.gm-chip { min-height: 40px; padding: 0 var(--space-3); border: 2px solid var(--line); border-radius: 999px; background: var(--paper); font: inherit; font-size: 15px; font-weight: 700; color: var(--ink); cursor: pointer; }
.gm-chip[aria-current="true"] { background: var(--blue-strong); border-color: var(--blue-strong); color: var(--paper); }
.gm-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); align-items: start; }
.gm-col { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.gm-results-line { margin: 0; font-weight: 700; }
.gm-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-3); margin-top: var(--space-3); }
.gm-pager[hidden] { display: none; }
.gm-pager-status { margin: 0; font-weight: 700; text-align: center; min-width: 0; }
.gm-pager-status:focus, .gm-pager-status:focus-visible { outline: none; }
.library-play { white-space: nowrap; }

/* Round */
.gm-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); }
.gm-bar-title { margin: 0; font-family: var(--font-display); font-size: 22px; line-height: 1.2; }
.gm-bar-level { color: var(--muted); font-weight: 500; font-size: var(--text-small); }
.gm-progress { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); font-weight: 700; font-size: var(--text-small); }
.gm-progress progress { width: 110px; height: 10px; }
.gm-main { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.gm-panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--elevation-soft); padding: var(--space-3) var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.gm-promptrow { display: flex; gap: var(--space-3); align-items: flex-start; justify-content: space-between; }
.gm-prompt { font-size: 19px; line-height: 1.35; min-width: 0; }
.gm-prompt:focus, .gm-prompt:focus-visible { outline: none; }
.gm-prompt p { margin: 0; }
.gm-prompt p + p { margin-top: var(--space-1); }
.gm-read { min-height: 40px; font-size: 15px; padding: var(--space-1) var(--space-3); white-space: nowrap; }
.gm-feedback { min-height: 2.8em; font-weight: 700; color: var(--muted); }
.gm-feedback.is-right { color: var(--green-text); }
.gm-feedback.is-wrong { color: var(--coral-text); }
.gm-feedback.is-info { color: var(--ink); }
.gm-mark { font-weight: 800; }
.gm-nav { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: flex-end; }
.gm-nav[hidden] { display: none; }
.gm-bar .gm-stuck { min-height: 44px; font-size: 16px; padding: var(--space-1) var(--space-4); }
.gm-nav .gm-button { min-height: 44px; }

/* Stage */
.gm-stage { position: relative; width: 100%; aspect-ratio: 2 / 1; border-radius: var(--radius-lg); overflow: hidden; border: 3px solid var(--paper); box-shadow: var(--elevation-soft); background: var(--cream); }
.gm-stage.is-small { aspect-ratio: 5 / 2; }
.gm-scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.gm-sky { fill: var(--cream); }
.gm-ground { fill: var(--green); opacity: .38; }
.gm-horizon { stroke: var(--green-strong); stroke-width: .5; opacity: .5; }
.gm-pets, .gm-overlay { position: absolute; inset: 0; pointer-events: none; }
.gm-overlay { z-index: 2; }
.gm-drop { position: absolute; top: 58%; bottom: 0; border-radius: var(--radius-md); }
.gm-drop.is-over { background: var(--yellow); opacity: .35; }
.gm-actor { position: absolute; z-index: 1; will-change: transform; }
.gm-pet-body { position: absolute; inset: 0; display: block; }
.gm-pet-body.is-flipped { transform: scaleX(-1); }
.gm-pet-layer { position: absolute; inset: 0; display: block; background-repeat: no-repeat; image-rendering: pixelated; }
.gm-bubble { position: absolute; left: 50%; top: 4%; transform: translate(-50%, -100%); padding: 2px 8px; border-radius: var(--radius-md); background: var(--paper); border: 1px solid var(--line); font-size: 18px; white-space: nowrap; box-shadow: var(--elevation-soft); }
.gm-bubble[hidden] { display: none; }

/* Pictures */
.gm-apple { fill: var(--coral-strong); stroke: var(--coral-strong-shadow); stroke-width: .35; }
.gm-art .gm-apple { stroke-width: 1.5; }
.gm-apple-faint { fill: var(--transparent); stroke: var(--coral-strong); stroke-width: 2; stroke-dasharray: 5 4; }
.gm-stem { fill: none; stroke: var(--green-strong); stroke-width: .8; stroke-linecap: round; }
.gm-art .gm-stem { stroke-width: 2.5; }
.gm-plate { fill: var(--paper); stroke: var(--line); stroke-width: 1; }
.gm-art .gm-plate { stroke-width: 2; }
.gm-slice-cut { stroke: var(--paper); stroke-width: 2.5; }
.gm-tone-1 { fill: var(--blue-strong); }
.gm-tone-2 { fill: var(--green-strong); }
.gm-tone-3 { fill: var(--coral-display); }
.gm-art { width: 100%; height: auto; max-height: 100%; display: block; }
.gm-art-text { font-family: var(--font-reading); font-size: 17px; fill: var(--ink); }
.gm-art-text.is-strong { font-weight: 700; }
.gm-art-note { font-family: var(--font-reading); font-size: 14px; fill: var(--muted); }
.gm-art-line { fill: none; stroke: var(--blue-strong); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.gm-art-grid { stroke: var(--line); stroke-width: 1; }
.gm-art-axis { stroke: var(--ink); stroke-width: 2; }
.gm-art-dot { fill: var(--coral-strong); stroke: var(--paper); stroke-width: 2; }

/* Teaching */
.gm-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--elevation-soft); padding: var(--space-3) var(--space-4); }
.gm-teach { display: flex; flex-direction: column; gap: var(--space-3); }
.gm-teach-head { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); align-items: center; }
.gm-teach-head progress { flex: 1 1 120px; max-width: 260px; height: 10px; }
.gm-step-count { margin: 0; color: var(--blue-dark); font-weight: 700; font-size: var(--text-small); }
.gm-teach-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: var(--space-4); align-items: center; }
.gm-teach-text h2 { font-family: var(--font-display); font-size: 24px; margin: var(--space-1) 0 var(--space-2); line-height: 1.2; }
.gm-teach-text h2:focus, .gm-teach-text h2:focus-visible { outline: none; }
.gm-say { font-size: 19px; line-height: 1.4; }
.gm-say p { margin: 0 0 var(--space-2); }
.gm-visual { min-width: 0; display: flex; justify-content: center; align-items: center; }
.gm-visual svg { width: 100%; height: auto; max-height: 300px; }
/* Phones can use page height: keep teaching/question diagrams at the available
   width instead of shrinking them to a laptop's fixed-height picture slot. */
@media (max-width: 700px) {
  .gm-teach-body .gm-visual svg,
  .gm-panel :is(.pt-want, .cg-want, .pr-graph, .pr-figure, .ps-card-svg) svg {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: none !important;
  }
  .gm-panel .pr-graph { max-height: none; }
}
.gm-step-nav { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); align-items: center; }
.gm-step-nav .gm-button { min-height: 44px; font-size: 16px; padding: var(--space-1) var(--space-4); }
.gm-choices { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-2); }
.gm-choice { display: flex; gap: var(--space-2); align-items: center; text-align: left; min-height: var(--target-min); padding: var(--space-1) var(--space-3); background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius-md); font: inherit; font-size: 18px; color: var(--ink); cursor: pointer; }
@media (hover: hover) { :where(:root:not([data-hover-rest])) .gm-choice:hover:not(:disabled) { border-color: var(--blue); } }
.gm-choice.is-right { border-color: var(--green-strong); }
.gm-choice.is-wrong { border-color: var(--coral-strong); }
.gm-choice-key { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius-round); background: var(--cream); font-weight: 700; flex: none; }
.gm-input-row { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-top: var(--space-2); }
.gm-input { min-height: var(--target-min); width: 9em; max-width: 100%; padding: var(--space-1) var(--space-3); border: 2px solid var(--line); border-radius: var(--radius-md); font: inherit; font-size: 20px; color: var(--ink); background: var(--paper); }
.gm-input.is-right { border-color: var(--green-strong); }
.gm-input.is-wrong { border-color: var(--coral-strong); }
.gm-verdict { margin: var(--space-2) 0 0; font-weight: 700; }
.gm-verdict.is-right { color: var(--green-text); }
.gm-verdict.is-wrong { color: var(--coral-text); }

/* Result */
.gm-result { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-4); align-items: center; }
.gm-result h2 { margin: 0; font-family: var(--font-display); }
.gm-result h2:focus, .gm-result h2:focus-visible { outline: none; }
.gm-stars { font-size: 48px; }
.gm-result-line { font-size: 20px; margin: var(--space-2) 0; }

/* Controls shared by several games */
.gm-field { display: flex; flex-direction: column; gap: var(--space-1); }
.gm-field label, .gm-field-label { font-weight: 700; font-size: var(--text-small); }
.gm-slider-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2); align-items: center; }
.gm-slider { width: 100%; min-height: var(--target-min); accent-color: var(--blue-strong); }
.gm-readout { min-width: 4.5em; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.gm-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.gm-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.gm-option { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); padding: var(--space-1); background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius-md); font: inherit; color: var(--ink); cursor: pointer; min-height: var(--target-min); }
.gm-option[aria-pressed="true"], .gm-option.is-picked { border-color: var(--blue-strong); box-shadow: var(--elevation-soft); }
.gm-option:focus-visible { outline: 3px solid var(--blue-dark); outline-offset: 2px; }
.gm-option svg { width: 100%; height: auto; max-height: 96px; }
.gm-option strong { font-size: var(--text-small); }
.gm-unit { color: var(--muted); font-weight: 700; }

/* Fair Share */
.fs { display: flex; flex-direction: column; gap: var(--space-2); }
.fs-pile { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-1) var(--space-3); background: var(--cream); border: 2px dashed var(--line); border-radius: var(--radius-md); touch-action: none; }
.fs-pile-art { width: min(270px, 62%); height: auto; flex: none; }
.fs-pile-count { margin: 0; font-weight: 700; font-size: 16px; }
.fs-pile.is-empty { opacity: .7; }
.fs-apple { cursor: grab; }
.fs-ghost { position: fixed; z-index: 1000; width: 44px; height: 44px; pointer-events: none; }
.fs-rows { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-1); }
.fs-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: var(--space-2); align-items: center; padding: 0 var(--space-2); border-radius: var(--radius-md); border: 2px solid var(--transparent); }
.fs-row.is-over { border-color: var(--yellow); background: var(--cream); }
.fs-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-held { min-width: 6.5em; text-align: right; font-variant-numeric: tabular-nums; }
.fs-step { min-width: var(--target-min); padding: 0; font-size: 22px; }
.fs-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.fs-actions .gm-button { min-height: 44px; font-size: 16px; }

/* Catapult */
.ct { display: flex; flex-direction: column; gap: var(--space-2); }
.ct-readout { margin: 0; font-size: var(--text-small); color: var(--muted); }
.ct-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.ct-actions .gm-button { min-height: 44px; font-size: 16px; }

/* Pet Run */
.pr { display: flex; flex-direction: column; gap: var(--space-2); }
.pr-graph { max-height: 190px; }
.pr-graph svg { width: 100%; height: auto; max-height: 190px; display: block; }
.pr-stepper { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: var(--space-2); align-items: center; }
.pr-stepper output { font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; }
.pr-stepper .gm-button { min-width: var(--target-min); padding: 0; font-size: 22px; }

/* Young learners: larger type and targets */
.gm-young .gm-prompt { font-size: 22px; }
.gm-young .gm-button { font-size: 19px; }
.gm-young .gm-say { font-size: 22px; }
.gm-young .fs-name { font-size: 19px; }
.gm-young .fs-held { font-size: 18px; }

@media (max-width: 860px) {
  .gm-main, .gm-result, .gm-teach-body { grid-template-columns: minmax(0, 1fr); }
  .gm-levels, .gm-hubrow { grid-template-columns: minmax(0, 1fr); }
  .gm-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gm-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gm-progress { margin-left: 0; }
  .gm-panel, .gm-card { padding: var(--space-3); }
}
@media (max-width: 420px) {
  .gm-promptrow { flex-direction: column; }
  .fs-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .fs-held { grid-column: 1 / -1; grid-row: 2; text-align: left; min-width: 0; }
  .gm-button { padding-left: var(--space-3); padding-right: var(--space-3); }
}
@media (prefers-reduced-motion: reduce) {
  .gm-actor { will-change: auto; }
}

/* Catapult and Pet Run pictures (stage scene units and teaching art) */
.ct-trail { fill: none; stroke-width: .9; stroke-dasharray: 2 1.4; stroke-linecap: round; }
.ct-trail.is-art { stroke-width: 3; stroke-dasharray: 8 6; }
.ct-trail-shot, .ct-trail-a { stroke: var(--blue-strong); }
.ct-trail-b { stroke: var(--coral-strong); }
.ct-trail-stub { stroke: var(--ink); opacity: .55; }
.ct-trail-hint { stroke: var(--green-strong); }
.ct-trunk { fill: var(--ink); opacity: .55; }
.ct-crown { fill: var(--green-strong); opacity: .78; }
.ct-toy { fill: var(--yellow); stroke: var(--ink); stroke-width: .5; }
.gm-art .ct-toy { stroke-width: 2; }
.ct-launcher { stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; }
.ct-wheel, .ct-ball { fill: var(--ink); }
.ct-tick { stroke: var(--ink); stroke-width: .4; opacity: .6; }
.ct-measure { stroke: var(--muted); stroke-width: 2; stroke-dasharray: 5 4; }
.ct-option-note { color: var(--muted); font-size: var(--text-small); }
.gm-option.is-picked { border-color: var(--blue-strong); box-shadow: var(--elevation-soft); }
.pr-track { fill: var(--ink); opacity: .25; }
.pr-triangle { fill: none; stroke: var(--coral-strong); stroke-width: 2.5; stroke-dasharray: 6 4; }
.gm-art-note.is-strong { font-weight: 700; fill: var(--ink); }
.gm-art-note.is-accent { fill: var(--coral-text); font-weight: 700; }
.gm-art-note.is-tiny { font-size: 10px; }
.pr-figure svg { width: 100%; height: auto; max-height: 230px; display: block; }

/* The "Play with your pet" row on a practice hub */
.mp-head { position: relative; }
.mp-games { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.mp-games[hidden] { display: none; }
.mp-games-label { margin: 0; color: var(--muted); font-size: var(--text-small); font-weight: 700; }
.mp-games .mp-game-label-icon, .mp-games .mp-game-icon { width: 24px; height: 24px; vertical-align: middle; }
.mp-games .mp-game { min-height: 40px; font-size: 15px; padding: var(--space-1) var(--space-3); }
.mp-head .mp-games { position: static; margin-top: var(--space-2); }

/* Dial template (dl-*) and the Chemistry games (chem-*) */
.dl { display: flex; flex-direction: column; gap: var(--space-2); }
.dl-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-1); }
.dl-label { font-weight: 700; font-size: var(--text-small); }
.dl-track { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--space-2); align-items: center; }
.dl-step { min-width: var(--target-min); padding: 0; font-size: 22px; }
.dl-out { text-align: left; min-width: 0; }
.dl-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.dl-typed { width: 8em; }
.dl-actions .gm-button { min-height: 44px; font-size: 16px; }
.chem-el-0 { fill: var(--blue-strong); background: var(--blue-strong); }
.chem-el-1 { fill: var(--coral-display); background: var(--coral-display); }
.chem-el-2 { fill: var(--green-strong); background: var(--green-strong); }
.chem-el-3 { fill: var(--yellow); background: var(--yellow); }
.chem-el-4 { fill: var(--blue); background: var(--blue); }
.chem-dot { stroke: var(--ink); stroke-width: .25; }
.gm-art .chem-dot { stroke-width: 1; }
.chem-dot-sm { display: inline-block; width: 10px; height: 10px; border-radius: var(--radius-round); }
.chem-bar.is-match, .chem-ok { fill: var(--green-strong); }
.chem-bar.is-off, .chem-no { fill: var(--coral-strong); }
.chem-bk { display: flex; flex-direction: column; gap: var(--space-2); }
.chem-eqline { margin: 0; font-size: 20px; font-weight: 700; text-align: center; overflow-wrap: anywhere; }
.chem-bk-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: var(--space-3); align-items: start; }
.chem-tally { border-collapse: collapse; width: 100%; font-size: var(--text-small); font-variant-numeric: tabular-nums; }
.chem-tally th, .chem-tally td { padding: 2px 6px; text-align: left; border-bottom: 1px solid var(--line); }
.chem-tally tr.is-match td:last-child { color: var(--green-text); font-weight: 700; }
.chem-tally tr.is-off td:last-child { color: var(--coral-text); font-weight: 700; }
.chem-side { color: var(--muted); font-size: var(--text-caption); font-weight: 400; margin-left: var(--space-1); }
@media (max-width: 560px) { .chem-bk-grid { grid-template-columns: minmax(0, 1fr); } }

/* Counter rows (core/games/templates/counter-rows.js), shared by Make-Ten Bowls, Coin Purse, Count the Hops and Array Garden */
.cr { display: flex; flex-direction: column; gap: var(--space-2); }
.cr-status { margin: 0; font-weight: 700; font-size: 18px; min-height: 1.4em; }
.cr-rows { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-1); }
.cr-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: var(--space-2); align-items: center; padding: 0 var(--space-2); border-radius: var(--radius-md); border: 2px solid var(--transparent); }
.cr-row.is-fixed { grid-template-columns: minmax(0, 1fr) auto; background: var(--cream); min-height: var(--target-min); }
.cr-name { font-weight: 700; overflow-wrap: anywhere; }
.cr-value { min-width: 5.5em; text-align: right; font-variant-numeric: tabular-nums; }
.cr-step { min-width: var(--target-min); padding: 0 var(--space-2); font-size: 22px; display: inline-flex; align-items: center; justify-content: center; }
.cr-step.has-art { padding: 0 var(--space-1); }
.cr-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.cr-actions .gm-button { min-height: 44px; font-size: 16px; }
.gm-young .cr-name { font-size: 19px; }
.gm-young .cr-value { font-size: 18px; }
@media (max-width: 420px) {
  .cr-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .cr-row.is-fixed { grid-template-columns: minmax(0, 1fr); }
  .cr-value { grid-column: 1 / -1; grid-row: 2; text-align: left; min-width: 0; }
}

/* Make-Ten Bowls */
.mtb-bowl { stroke: var(--ink); stroke-width: .5; }
.mtb-bowl-blue { fill: var(--blue); }
.mtb-bowl-red { fill: var(--coral); }
.mtb-treat { fill: var(--yellow); stroke: var(--coral-strong-shadow); stroke-width: .4; }
.mtb-cell { fill: var(--paper); stroke: var(--line); stroke-width: 2; }
.mtb-cell.is-ghost { stroke: var(--coral-strong); stroke-dasharray: 5 3; }
.mtb-dot { fill: var(--blue-strong); }
.mtb-dot.is-ghost { fill: var(--transparent); stroke: var(--coral-strong); stroke-width: 2; stroke-dasharray: 4 3; }

/* Coin Purse */
.cp-coin { stroke: var(--ink); stroke-width: .5; }
.gm-art .cp-coin { stroke-width: 1.5; }
.cp-penny { fill: var(--coral-display); }
.cp-nickel, .cp-dime, .cp-quarter { fill: var(--line); }
.cp-quarter { fill: var(--blue); }
.cp-coin-text { font-family: var(--font-reading); font-weight: 700; fill: var(--ink); }
.cp-face { width: 36px; height: 36px; display: block; }
.cp-counter { fill: var(--ink); opacity: .28; }
.cp-counter-top { fill: var(--cream); stroke: var(--line); stroke-width: .4; }

/* Count the Hops */
.cth-line { stroke: var(--ink); stroke-width: .7; }
.cth-tick { stroke: var(--ink); stroke-width: .4; }
.cth-num { font-family: var(--font-reading); font-size: 4.2px; fill: var(--ink); }
.cth-hop { fill: none; stroke-width: .9; stroke-linecap: round; }
.cth-hop-0 { stroke: var(--blue-strong); }
.cth-hop-1 { stroke: var(--coral-strong); }
.cth-pole { stroke: var(--ink); stroke-width: .9; }
.cth-flag { fill: var(--coral-strong); }
.cth-start { fill: var(--blue-strong); }

/* Array Garden */
.ag-soil { fill: var(--ink); opacity: .22; }
.ag-flower.ag-a { fill: var(--coral-strong); }
.ag-flower.ag-b { fill: var(--blue-strong); }
.ag-center { fill: var(--yellow); }
.ag-row { fill: var(--transparent); stroke: var(--yellow); stroke-width: 2; }

/* Balance Scale template (Mystery Box Scale): stage scene and teaching pictures */
.bs-post { stroke: var(--ink); stroke-width: 1.4; opacity: .75; }
.bs-base { fill: var(--ink); opacity: .75; }
.bs-beam { stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; }
.bs-pivot { fill: var(--yellow); stroke: var(--ink); stroke-width: .6; }
.bs-string { fill: none; stroke: var(--muted); stroke-width: .5; }
.bs-pan { fill: var(--paper); stroke: var(--ink); stroke-width: .7; }
.bs-box { fill: var(--yellow); stroke: var(--ink); stroke-width: .5; }
.bs-ribbon { fill: none; stroke: var(--coral-strong); stroke-width: .9; }
.bs-q { font-family: var(--font-reading); font-weight: 800; font-size: 5.6px; text-anchor: middle; fill: var(--ink); }
.bs-weight { fill: var(--blue-strong); stroke: var(--paper); stroke-width: .3; }
.bs-ghost { fill: none; stroke: var(--coral-strong); stroke-width: .5; stroke-dasharray: 1 .8; }
.bs-text { font-family: var(--font-reading); font-weight: 700; font-size: 7px; text-anchor: middle; fill: var(--ink); }
.bs-art { max-height: 280px; }
.gm-art .bs-box { stroke-width: 1.5; }
.gm-art rect.bs-box { fill: var(--yellow); stroke: var(--ink); }
.bs-group { fill: var(--cream); stroke: var(--line); stroke-width: 2; stroke-dasharray: 8 6; }
.bs-bigq { font-family: var(--font-reading); font-weight: 800; font-size: 26px; fill: var(--ink); }
.ms { display: flex; flex-direction: column; gap: var(--space-2); }
.ms-eq { margin: 0; font-weight: 700; font-size: 16px; }
.ms-ops { display: flex; flex-direction: column; gap: var(--space-1); align-items: flex-start; }
.ms-op, .ms-guess { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.ms label { font-weight: 700; }
.ms-num { width: 4.5em; }
.ms-unit { color: var(--muted); }
.ms-op .gm-button, .ms-guess .gm-button { min-height: 44px; font-size: 16px; }
.ms-reset { align-self: flex-start; }

/* Sort Bins template (Shape Sorter) */
.sb { display: flex; flex-direction: column; gap: var(--space-2); }
.sb-chute { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-1) var(--space-3); background: var(--cream); border: 2px dashed var(--line); border-radius: var(--radius-md); }
.sb-count { margin: 0; font-weight: 700; flex: 1 1 auto; }
.sb-card { flex: none; width: 132px; height: 132px; display: grid; place-items: center; animation: sb-drop .35s ease-out; }
.sb-card.is-shaking { animation: sb-shake .35s; }
.sb-svg { width: 100%; height: 100%; }
.sb-done { margin: 0; font-weight: 800; text-align: center; }
.sb-bins { display: grid; grid-template-columns: repeat(var(--sb-cols, 3), minmax(0, 1fr)); gap: var(--space-2); }
.sb-bin { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 84px; padding: var(--space-3) var(--space-1) var(--space-1); background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius-md); font: inherit; color: var(--ink); cursor: pointer; }
.sb-bin:hover:not(:disabled) { border-color: var(--blue); }
.sb-bin:focus-visible { outline: 3px solid var(--blue-dark); outline-offset: 2px; }
.sb-bin:disabled { opacity: .6; cursor: default; }
.sb-key { position: absolute; top: 3px; left: 5px; font-size: 13px; font-weight: 700; color: var(--muted); }
.sb-icon { width: 42px; height: 42px; }
.sb-bin-label { font-weight: 700; font-size: 16px; text-align: center; overflow-wrap: anywhere; }
.sb-slot { fill: var(--paper); stroke: var(--line); stroke-width: .6; stroke-dasharray: 1.4 1; }
.sb-slot.is-full { stroke-dasharray: none; stroke: var(--green-strong); }
.sh { stroke: var(--ink); stroke-width: 2.4; stroke-linejoin: round; }
.sh-light { fill: var(--paper); opacity: .4; stroke: none; }
.sh-dark { fill: var(--ink); opacity: .22; stroke: none; }
.gm-young .sb-bin-label { font-size: 18px; }
@keyframes sb-drop { from { transform: translateY(-14px); opacity: .2; } to { transform: none; opacity: 1; } }
@keyframes sb-shake { 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
@media (prefers-reduced-motion: reduce) { .sb-card, .sb-card.is-shaking { animation: none; } }

/* Treasure Grid and the coordinate grid template */
.tg { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: center; }
.tg-map { flex: 0 1 240px; width: 240px; max-width: 100%; border-radius: var(--radius-md); touch-action: manipulation; }
.tg-map:focus-visible { outline: 3px solid var(--blue-dark); outline-offset: 2px; }
.tg-side { flex: 1 1 190px; display: flex; flex-direction: column; gap: var(--space-2); align-items: flex-start; min-width: 0; }
.tg-readout { margin: 0; font-size: 18px; }
.tg-pad { display: grid; grid-template-columns: repeat(3, var(--target-min)); grid-template-areas: ". up ." "left down right"; gap: var(--space-1); }
.tg-pad .gm-button { padding: 0; min-width: var(--target-min); font-size: 18px; }
.tg-up { grid-area: up; } .tg-left { grid-area: left; } .tg-down { grid-area: down; } .tg-right { grid-area: right; }
.tg-fields { display: grid; grid-template-columns: auto 5em; gap: var(--space-1) var(--space-2); align-items: center; }
.tg-fields label { font-weight: 700; }
.tg-num { width: 5em; }
.tg-side .gm-button.gm-primary { min-height: 44px; }
.cg-svg { width: 100%; height: auto; display: block; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); }
.cg-line { stroke: var(--line); stroke-width: 1; }
.cg-axis { stroke: var(--ink); stroke-width: 2; }
.cg-tick { font-family: var(--font-reading); font-size: 11.5px; fill: var(--muted); text-anchor: middle; }
.cg-tick-y { text-anchor: end; }
.cg-name { font-family: var(--font-reading); font-size: 13px; font-weight: 700; fill: var(--ink); text-anchor: middle; }
.cg-cursor { fill: var(--blue-strong); fill-opacity: .35; stroke: var(--blue-strong); stroke-width: 2.5; }
.cg-guess { fill: var(--transparent); stroke: var(--blue-strong); stroke-width: 2.5; stroke-dasharray: 3 2; }
.cg-from { fill: var(--muted); stroke: var(--paper); stroke-width: 1.5; }
.cg-to { fill: var(--green-strong); stroke: var(--paper); stroke-width: 1.5; }
.cg-treasure circle { fill: var(--yellow); stroke: var(--ink); stroke-width: 1; }
.cg-treasure path { fill: none; stroke: var(--coral-strong); stroke-width: 3; stroke-linecap: round; }
.tg-mound { fill: var(--ink); opacity: .35; }
.tg-x { fill: none; stroke: var(--coral-strong); stroke-width: 2; stroke-linecap: round; }
.tg-chest { fill: var(--coral-strong); stroke: var(--ink); stroke-width: .6; }
.tg-lid { fill: var(--coral-display); stroke: var(--ink); stroke-width: .6; }
.tg-coin { fill: var(--yellow); stroke: var(--ink); stroke-width: .4; }
.tg-glint { fill: var(--yellow); }
@media (max-width: 420px) { .tg-map { flex-basis: 100%; width: 100%; max-width: 240px; margin: 0 auto; } .sb-card { width: 92px; height: 92px; } }

/* Atom Builder (chem-ab) */
.chem-p, .chem-ring-p { fill: var(--coral-display); background: var(--coral-display); }
.chem-n { fill: var(--muted); background: var(--muted); }
.chem-e { fill: var(--blue-strong); background: var(--blue-strong); }
.chem-ring { fill: none; stroke: var(--line); stroke-width: .35; }
.chem-ab { display: flex; flex-direction: column; gap: var(--space-2); }
.chem-readout { margin: 0; font-size: var(--text-small); color: var(--muted); }
.chem-peek { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; font-size: var(--text-small); }
.chem-peek .gm-button { min-height: 40px; font-size: 15px; }
.chem-peek-text[hidden] { display: none; }

/* State Spa (chem-sp) */
.chem-sp-wrap { display: flex; flex-direction: column; gap: var(--space-2); }
.chem-box { fill: var(--paper); stroke: var(--ink); stroke-width: .7; opacity: .95; }
.chem-streak { stroke: var(--muted); stroke-width: .5; stroke-linecap: round; }
.chem-part { stroke: var(--ink); stroke-width: .25; }
.chem-part-solid { fill: var(--blue-strong); }
.chem-part-liquid { fill: var(--green-strong); }
.chem-part-gas { fill: var(--coral-display); }
.chem-tube { fill: var(--paper); stroke: var(--ink); stroke-width: .5; }
.chem-mercury { fill: var(--coral-strong); }
.chem-zone-solid { fill: var(--blue-strong); opacity: .28; }
.chem-zone-liquid { fill: var(--green-strong); opacity: .28; }
.chem-zone-gas { fill: var(--coral-display); opacity: .28; }
.chem-edge { stroke: var(--ink); stroke-width: 1.5; }
.chem-pointer { fill: var(--coral-strong); }

/* pH Potion (chem-ph) */
.chem-ph-a3 { fill: var(--coral); background: var(--coral); }
.chem-ph-a2 { fill: var(--alkali); background: var(--alkali); }
.chem-ph-a1 { fill: var(--alkaline); background: var(--alkaline); }
.chem-ph-n { fill: var(--green); background: var(--green); }
.chem-ph-b1 { fill: var(--nonmetal); background: var(--nonmetal); }
.chem-ph-b2 { fill: var(--noble); background: var(--noble); }
.chem-ph-b3 { fill: var(--halogen); background: var(--halogen); }
.chem-glass { fill: none; stroke: var(--ink); stroke-width: .9; stroke-linecap: round; stroke-linejoin: round; }
.chem-swatch { stroke: var(--paper); stroke-width: 1; }
.chem-liquid { stroke: none; }
.chem-pot { display: flex; flex-direction: column; gap: var(--space-2); }
.chem-pot .gm-art { max-height: 74px; }
.chem-bottles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.chem-bottle { flex-direction: row; justify-content: flex-start; text-align: left; padding: var(--space-1) var(--space-2); gap: var(--space-2); }
.chem-bottle .chem-sw { flex: none; width: 28px; height: 28px; border-radius: var(--radius-round); border: 2px solid var(--ink); }
.chem-bottle[disabled] { opacity: .5; cursor: default; }
.chem-bottle-text { display: flex; flex-direction: column; align-items: flex-start; }
.chem-bottle-text small { color: var(--muted); font-size: var(--text-caption); }

/* Half-life Popcorn (chem-hl) */
.chem-kernel { fill: var(--yellow); stroke: var(--ink); stroke-width: .25; }
.gm-art .chem-kernel { stroke-width: 1; }
.chem-puff { fill: var(--paper); stroke: var(--line); stroke-width: .3; }
.chem-hl { display: flex; flex-direction: column; gap: var(--space-2); }
.chem-hl .gm-art { max-height: 150px; }

/* ---- Biology games (bio-*) and the ORDER / PICK / LINK templates (js/core/games/templates) ---- */
.gm-thumb { display: block; width: 100%; height: 100%; background-repeat: no-repeat; background-color: var(--cream); }
.gm-tone-bg-1 { background: var(--blue-strong); color: var(--paper); }
.gm-tone-bg-2 { background: var(--green-strong); color: var(--paper); }
.gm-tone-bg-3 { background: var(--coral-strong); color: var(--paper); }
.gm-tone-bg-4 { background: var(--yellow); color: var(--ink); }
.gm-tone-bg-5 { background: var(--blue-dark); color: var(--paper); }
.gm-tone-bg-6 { background: var(--coral-text); color: var(--paper); }

/* ORDER: numbered slots over a tray of cards */
.ord { display: flex; flex-direction: column; gap: var(--space-2); --ord-w: 76px; --ord-art: 44px; }
.ord-line, .ord-tray { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--ord-w), 1fr)); gap: var(--space-1); }
.ord-slot { position: relative; min-height: calc(var(--ord-art) + 48px); border: 2px dashed var(--line); border-radius: var(--radius-md); background: var(--cream); display: flex; }
.ord-slot.is-filled { border-style: solid; border-color: var(--line); background: var(--paper); }
.ord-slot.is-right { border-color: var(--green-strong); }
.ord-slot.is-wrong { border-color: var(--coral-strong); }
.ord-n { position: absolute; top: 2px; left: 4px; z-index: 1; font-size: var(--text-caption); font-weight: 700; color: var(--muted); }
.ord-empty { flex: 1; }
.ord-card { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; padding: 14px 3px 3px; background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius-md); font: inherit; font-size: 13px; line-height: 1.15; color: var(--ink); cursor: pointer; position: relative; min-height: calc(var(--ord-art) + 48px); }
.ord-slot .ord-card { border-color: var(--transparent); }
.ord-card:hover:not(:disabled) { border-color: var(--blue); }
.ord-card:focus-visible { outline: 3px solid var(--blue-dark); outline-offset: 2px; }
.ord-card:disabled { cursor: default; }
.ord-art { display: grid; place-items: center; width: var(--ord-art); height: var(--ord-art); overflow: hidden; border-radius: var(--radius-sm); font-size: 30px; line-height: 1; }
.ord-art svg { width: 100%; height: 100%; }
.ord-label { font-weight: 700; text-align: center; overflow-wrap: anywhere; hyphens: auto; }
.ord-flag { position: absolute; top: 1px; right: 4px; font-weight: 800; font-size: 14px; }
.ord-slot.is-right .ord-flag { color: var(--green-text); }
.ord-slot.is-wrong .ord-flag { color: var(--coral-text); }
.ord-loop { margin: 0; color: var(--muted); font-size: var(--text-small); font-weight: 700; }
.ord-actions, .pt-actions, .lp-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.ord-actions .gm-button, .pt-actions .gm-button, .lp-actions .gm-button { min-height: 44px; font-size: 16px; }
.gm-young .ord { --ord-w: 96px; --ord-art: 56px; }
.gm-young .ord-card { font-size: 17px; }
.gm-young .ord-art { font-size: 44px; }

/* PICK: tiles to choose from */
.pt { display: flex; flex-direction: column; gap: var(--space-2); }
.pt-grid { display: grid; grid-template-columns: repeat(var(--pt-cols, 2), minmax(0, 1fr)); gap: var(--space-2); }
.pt-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--target-min); padding: var(--space-1) var(--space-2); background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius-md); font: inherit; font-size: 17px; font-weight: 700; color: var(--ink); cursor: pointer; }
@media (hover: hover) { :where(:root:not([data-hover-rest])) .pt-tile:hover:not(:disabled) { border-color: var(--blue); } }
.pt-tile:focus-visible { outline: 3px solid var(--blue-dark); outline-offset: 2px; }
.pt-tile.is-picked { border-color: var(--blue-strong); box-shadow: var(--elevation-soft); }
.pt-tile.is-tried { opacity: .55; text-decoration: line-through; }
.pt-tile.is-right { border-color: var(--green-strong); }
.pt-tile:disabled { cursor: default; }
.pt-art { display: grid; place-items: center; font-size: 34px; line-height: 1; }
.pt-art svg { width: 56px; height: 56px; }
.pt-art:empty { display: none; }
.pt-label { text-align: center; line-height: 1.2; }
.pt-flag { position: absolute; top: 2px; right: 6px; font-weight: 800; }
.pt-tile.is-right .pt-flag { color: var(--green-text); }
.gm-young .pt-tile { font-size: 20px; min-height: 56px; }
.gm-young .pt-art svg { width: 64px; height: 64px; }
.gm-young .pt-art { font-size: 44px; }
.pt-want { max-width: 100%; }

/* LINK: join a left item to its right partner */
.lp { display: flex; flex-direction: column; gap: var(--space-2); }
.lp-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.lp-head { margin: 0 0 2px; color: var(--muted); font-size: var(--text-small); font-weight: 700; }
.lp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.lp-item { width: 100%; display: flex; align-items: center; gap: var(--space-2); min-height: 44px; padding: 2px var(--space-2); background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius-md); font: inherit; font-size: 15px; line-height: 1.15; text-align: left; color: var(--ink); cursor: pointer; }
.lp-item:hover:not(:disabled) { border-color: var(--blue); }
.lp-item:focus-visible { outline: 3px solid var(--blue-dark); outline-offset: 2px; }
.lp-item.is-picked { border-color: var(--blue-strong); background: var(--cream); box-shadow: var(--elevation-soft); }
.lp-item.is-linked { border-color: var(--blue-dark); }
.lp-item.is-right { border-color: var(--green-strong); }
.lp-item.is-wrong { border-color: var(--coral-strong); }
.lp-art { flex: none; width: 34px; height: 34px; display: grid; place-items: center; overflow: hidden; border-radius: var(--radius-sm); font-size: 24px; }
.lp-text { display: flex; flex-direction: column; min-width: 0; }
.lp-label { font-weight: 700; overflow-wrap: anywhere; }
.lp-sub { color: var(--muted); font-size: var(--text-small); }
.lp-badge { margin-left: auto; flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: var(--radius-round); font-size: 13px; font-weight: 800; }
.lp-count { color: var(--muted); font-size: var(--text-small); font-weight: 700; }
.cc-emoji { font-size: 24px; line-height: 1; }

/* Punnett Pups (pp) */
.pp { display: flex; flex-direction: column; gap: var(--space-2); }
.pp-legend { margin: 0; color: var(--muted); font-size: var(--text-small); font-weight: 700; }
.pp-square { display: grid; grid-template-columns: 40px repeat(2, minmax(0, 120px)); gap: var(--space-1); align-items: center; justify-content: start; }
.pp-edge { text-align: center; font-weight: 800; font-size: 22px; font-family: var(--font-display); }
.pp-box { min-height: 48px; font: inherit; font-size: 20px; font-weight: 700; text-align: center; border: 2px solid var(--line); border-radius: var(--radius-md); background: var(--paper); color: var(--ink); padding: 0 var(--space-2); }
.pp-box:focus-visible { outline: 3px solid var(--blue-dark); outline-offset: 2px; }
.pp-box.is-wrong { border-color: var(--coral-strong); }
.pp-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.pp-actions .gm-button { min-height: 44px; font-size: 16px; }
.pp .bv-punnett { margin: 0; }
.pp .bv-punnett table { border-spacing: 4px; }
.pp .bv-punnett th { height: 30px; font-size: 22px; }
.pp .bv-punnett td { height: 50px; padding: 2px; }
.pp .bv-punnett td strong { font-size: 24px; }
.pp .bv-punnett td small { font-size: 12px; }
.pp-basket { fill: var(--yellow); stroke: var(--ink); stroke-width: .5; opacity: .75; }
.pp-basket-rim { fill: none; stroke: var(--ink); stroke-width: .8; }
.pp-q { font-size: 14px; font-weight: 800; fill: var(--ink); }
.pp-paw-dom { fill: var(--ink); }
.pp-paw-rec { fill: var(--paper); stroke: var(--ink); stroke-width: .5; }

/* Food Web Hunt (fw) */
.fw { display: flex; flex-direction: column; gap: var(--space-2); }
.fw-hint { margin: 0; color: var(--muted); font-size: var(--text-small); font-weight: 700; min-height: 1.3em; }
.fw-nodes { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-1); }
.fw-node { display: flex; align-items: center; gap: var(--space-1); min-height: 44px; padding: 2px var(--space-2) 2px var(--space-1); background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius-md); font: inherit; font-size: 15px; font-weight: 700; color: var(--ink); cursor: pointer; }
.fw-node:hover:not(:disabled) { border-color: var(--blue); }
.fw-node:focus-visible, .fw-x:focus-visible { outline: 3px solid var(--blue-dark); outline-offset: 2px; }
.fw-node.is-picked { border-color: var(--blue-strong); background: var(--cream); box-shadow: var(--elevation-soft); }
.fw-img { width: 32px; height: 32px; object-fit: contain; }
.fw-paw { font-size: 24px; width: 32px; text-align: center; }
.fw-arrows { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-1); }
.fw-chip { display: inline-flex; align-items: center; gap: var(--space-1); padding: 0 0 0 var(--space-2); background: var(--cream); border: 2px solid var(--line); border-radius: var(--radius-round); font-size: 14px; font-weight: 700; }
.fw-chip.is-wrong { border-color: var(--coral-strong); }
.fw-none { color: var(--muted); font-size: var(--text-small); }
.fw-x { min-width: 36px; min-height: 36px; border: 0; background: var(--transparent); color: var(--ink); font: inherit; font-weight: 800; cursor: pointer; border-radius: var(--radius-round); }
.fw-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.fw-actions .gm-button { min-height: 44px; font-size: 16px; }
.fw-scene-icon { font-size: 8px; }
.fw-scene-arrow { stroke: var(--blue-strong); stroke-width: .8; stroke-linecap: round; }
.fw-scene-head { fill: var(--blue-strong); }
.fw-arrow line { stroke: var(--blue-strong); stroke-width: 4; stroke-linecap: round; }
.fw-arrow polygon { fill: var(--blue-strong); }
.fw-arrow.is-hi line { stroke: var(--coral-strong); }
.fw-arrow.is-hi polygon { fill: var(--coral-strong); }
.fw-pet-disc { fill: var(--cream); stroke: var(--ink); stroke-width: 2; }

/* Life Cycle Ring (lc), Oxygen Trail (ot), Cell City (cc), Plant Needs Garden (pg) */
.lc-sun { fill: var(--yellow); }
.lc-slot { fill: var(--paper); stroke: var(--line); stroke-width: .6; }
.lc-slot.is-on { stroke: var(--green-strong); }
.lc-arrow { stroke: var(--muted); stroke-width: .8; fill: none; stroke-linecap: round; }
.lc-ring svg { width: 100%; height: auto; max-height: 150px; display: block; }
.ot-path { stroke: var(--line); stroke-width: 1.4; fill: none; stroke-linecap: round; }
.ot-stone { fill: var(--paper); stroke: var(--ink); stroke-width: .5; }
.ot-stone.is-on { fill: var(--blue-strong); }
.ot-gas { fill: var(--coral-strong); stroke: var(--paper); stroke-width: .5; }
.cc-street { stroke: var(--ink); stroke-width: .6; }
.cc-tower { fill: var(--line); stroke: var(--ink); stroke-width: .4; }
.cc-tower.is-on { fill: var(--yellow); }
.pg-spark { font-size: 10px; }
.pg-want { display: flex; align-items: center; gap: var(--space-3); }
.pg-plant svg { width: 64px; height: 64px; }
.pg-has { min-width: 0; }
.pg-has-title { margin: 0; color: var(--muted); font-size: var(--text-small); font-weight: 700; }
.pg-has ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.pg-has li { display: flex; align-items: center; gap: 4px; font-size: 17px; font-weight: 700; }
.pg-has li svg { width: 34px; height: 34px; }
.pg-tick { color: var(--green-text); }
.pg-pair { display: flex; align-items: center; gap: var(--space-2); font-size: 26px; }
.pg-potmini { display: flex; flex-direction: column; align-items: center; font-size: 22px; line-height: 1.1; }
.pg-vs { font-size: 14px; color: var(--muted); font-weight: 700; }

@media (max-width: 420px) {
  .lp-cols { grid-template-columns: minmax(0, 1fr); }
  .pt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pp-square { grid-template-columns: 32px repeat(2, minmax(0, 1fr)); }
}

/* Physics games: Lamp Circuit, Seesaw Pals, Push or Pull, Mirror Bounce, Float or Sink (pg-, wr-, wc-, ss-, ps-, mb-, fl-) */
.pg-lead { stroke: var(--ink); stroke-width: 3; fill: none; stroke-linecap: round; }
.pg-battery { fill: var(--yellow); stroke: var(--ink); stroke-width: 2; }
.pg-sign { font: 700 15px var(--font-reading); fill: var(--ink); }
.pg-note { font: 700 12px var(--font-reading); fill: var(--muted); }
.pg-note-lg { font: 700 18px var(--font-reading); fill: var(--ink); }
.pg-dot { fill: var(--ink); }
.pg-bulb { fill: var(--paper); stroke: var(--ink); stroke-width: 2.5; }
.pg-bulb.is-dim { fill: var(--yellow); fill-opacity: .5; }
.pg-bulb.is-bright { fill: var(--yellow); }
.pg-glow { fill: var(--yellow); }
.pg-filament { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.pg-letter { font: 700 16px var(--font-reading); fill: var(--ink); }
.pg-emoji { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.pg-emoji-sm { font-size: 20px; }
.pg-mark { font: 700 11px var(--font-reading); }
.pg-mark.is-yes { fill: var(--green-text); }
.pg-mark.is-no { fill: var(--coral-text); }
.pg-ground { stroke: var(--line); stroke-width: 3; stroke-linecap: round; }
.pg-answer { font: 800 13px var(--font-reading); }
.pg-answer.is-push, .pg-answer.is-less, .pg-answer.is-go, .pg-answer.is-float { fill: var(--blue-dark); }
.pg-answer.is-pull, .pg-answer.is-more, .pg-answer.is-stop, .pg-answer.is-sink { fill: var(--coral-text); }
.pg-answer.is-turn { fill: var(--green-text); }
.pg-stand { stroke: var(--ink); stroke-width: .8; opacity: .6; }
.pg-stand-base { fill: var(--ink); opacity: .6; }
.pg-shade { fill: var(--paper); stroke: var(--ink); stroke-width: .7; }
.pg-shade.is-dim { fill: var(--yellow); fill-opacity: .5; }
.pg-shade.is-bright { fill: var(--yellow); }

.wr-svg { width: 100%; height: auto; max-height: 175px; display: block; margin: 0 auto; }
.wr-link { cursor: pointer; outline: none; }
.wr-link.is-locked { cursor: default; }
.wr-hit { fill: none; stroke: var(--transparent); stroke-width: 22; stroke-linecap: round; pointer-events: stroke; }
.wr-line { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.wr-line.is-on { stroke: var(--ink); stroke-width: 5; }
.wr-line.is-off { stroke: var(--muted); stroke-width: 3; stroke-dasharray: 3 7; opacity: .75; }
.wr-flow { fill: none; stroke: var(--yellow); stroke-width: 2.4; stroke-dasharray: 2 10; stroke-linecap: round; animation: wr-run 1.1s linear infinite; }
.wr-badge circle { fill: var(--paper); stroke: var(--blue-strong); stroke-width: 2; }
.wr-badge text { font: 800 12px var(--font-reading); fill: var(--ink); }
.wr-link:focus-visible .wr-badge circle { stroke: var(--blue-dark); stroke-width: 4; }
.wr-link:focus-visible .wr-line { stroke: var(--blue-dark); }
.wr-link:hover:not(.is-locked) .wr-badge circle { fill: var(--cream); }
.wc { display: flex; flex-direction: column; gap: var(--space-2); }
.wc-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.wc-actions .gm-button { min-height: 44px; font-size: 16px; }
.wc-tight .wr-svg { max-height: 135px; }
.wc-items { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
.wc-item { padding: var(--space-1); }
.wc-item strong { font-size: 13px; text-align: center; overflow-wrap: anywhere; }
.wc-emoji { font-size: 24px; line-height: 1; }
.wc-gap { fill: var(--cream); stroke: var(--line); stroke-width: 2; stroke-dasharray: 4 3; }
.pg-board { max-height: 230px; }
@keyframes wr-run { to { stroke-dashoffset: -24; } }

.ss-plank { fill: var(--ink); opacity: .78; }
.ss-pivot { fill: var(--ink); opacity: .32; }
.ss-axle { fill: var(--yellow); stroke: var(--ink); stroke-width: .6; }
.gm-art .ss-axle { stroke-width: 2; }
.ss-tick { stroke: var(--paper); stroke-width: .5; opacity: .9; }
.gm-art .ss-tick { stroke: var(--ink); stroke-width: 2; opacity: .6; }
.ss-block { fill: var(--blue-strong); stroke: var(--paper); stroke-width: .3; }
.ss-weight { fill: var(--cream); stroke: var(--blue-strong); stroke-width: 3; }
.ss-weight.is-unknown { stroke: var(--coral-strong); stroke-dasharray: 5 4; }

.ps-card { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); text-align: center; max-width: 100%; }
.ps-card-svg svg { width: 100%; max-width: 220px; max-height: 76px; }
.ps-emoji { font-size: 52px; line-height: 1; }
.ps-name { font-weight: 700; font-size: 20px; line-height: 1.2; }
.ps-bin-svg { width: 100%; max-width: 100px; height: 40px; display: block; margin: 0 auto; }
.ps-arrow { stroke: var(--coral-strong); stroke-width: 5; stroke-linecap: round; fill: none; }
.ps-arrow-head { fill: var(--coral-strong); }
.ps-mark { stroke: var(--muted); stroke-width: 2; stroke-dasharray: 3 3; }
.ps-wall { fill: var(--ink); opacity: .5; }
.ps-curve { fill: none; stroke: var(--coral-strong); stroke-width: 4; stroke-linecap: round; }
.ps-finish { stroke: var(--green-strong); stroke-width: .8; stroke-dasharray: 2 1.5; }
.sb-chute:has(.ps-card), .sb-chute:has(.fl-card) { flex-wrap: wrap; }
.sb-card:has(> .ps-card), .sb-card:has(> .fl-card) { flex: 1 1 140px; width: auto; min-width: 0; max-width: 100%; height: auto; min-height: 112px; padding: var(--space-1) var(--space-2); }
.ps-name { overflow-wrap: anywhere; }
.sb-bin-art { display: block; width: 100%; }
.gm-young .ps-name { font-size: 22px; }

.fl-liquid { opacity: .4; }
.fl-liquid.is-water { fill: var(--blue); }
.fl-liquid.is-salt { fill: var(--blue-strong); opacity: .5; }
.fl-liquid.is-oil { fill: var(--yellow); opacity: .45; }
.fl-liquid.is-honey { fill: var(--yellow); opacity: .85; }
.fl-surface { stroke: var(--blue-strong); stroke-width: .5; }
.gm-art .fl-surface { stroke-width: 2; }
.fl-glass { fill: none; stroke: var(--ink); stroke-width: .8; opacity: .6; }
.fl-card { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.fl-rho { font-weight: 800; color: var(--blue-dark); font-size: 16px; }
.fl-zone-float { fill: var(--blue); opacity: .18; }
.fl-zone-sink { fill: var(--coral); opacity: .18; }
.fl-liquid-mark { stroke: var(--blue-strong); stroke-width: 2; }
.fl-cube { stroke: var(--ink); stroke-width: 2.5; }
.fl-cube.is-light { fill: var(--cream); }
.fl-cube.is-heavy { fill: var(--line); }

.mb-mirror { fill: var(--blue); fill-opacity: .55; stroke: var(--ink); stroke-width: .5; }
.gm-art .mb-mirror { stroke-width: 2; }
.mb-sheen { stroke: var(--paper); stroke-width: .6; }
.mb-normal { stroke: var(--muted); stroke-width: .5; stroke-dasharray: 2 1.6; }
.gm-art .mb-normal { stroke-width: 2; stroke-dasharray: 6 5; }
.mb-beam { fill: none; stroke: var(--coral-strong); stroke-width: .9; stroke-linecap: round; stroke-linejoin: round; }
.gm-art .mb-beam { stroke-width: 3.5; }
.mb-beam.is-out { stroke: var(--blue-strong); }
.mb-beam.is-right { stroke: var(--green-strong); }
.mb-beam.is-old { opacity: .4; }
.mb-beam.is-stub { stroke: var(--ink); stroke-dasharray: 2 1.4; opacity: .6; }
.mb-torch { fill: var(--yellow); stroke: var(--ink); stroke-width: .5; }
.gm-art .mb-torch { stroke-width: 2; }
.mb-stand { stroke: var(--ink); stroke-width: .6; opacity: .6; }
.gm-art .mb-stand { stroke-width: 2; }
.mb-stand.is-image, .mb-bell.is-image { opacity: .45; stroke-dasharray: 3 3; }
.mb-bell { fill: var(--yellow); stroke: var(--ink); stroke-width: .6; }
.gm-art .mb-bell { stroke-width: 2; }
.mb-bell.is-lit { fill: var(--green); }
.mb-bell.is-image { fill: none; }
.mb-image-line { stroke: var(--coral-strong); stroke-width: 2; stroke-dasharray: 6 4; }
.mb-dim { stroke: var(--muted); stroke-width: 1.5; }
.mb-arc { fill: none; stroke: var(--coral-text); stroke-width: 2.5; }
.mb-arc.is-surface { stroke: var(--muted); stroke-dasharray: 4 3; }

@media (max-width: 420px) {
  .wc-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ps-emoji { font-size: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .wr-flow { animation: none; }
}

/* English word games: reading cards, highlights and the text templates (text-sort, text-match, text-order, text-slip) */
.gm-hl { background: var(--alkaline); color: var(--ink); border-radius: 4px; padding: 0 3px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.gm-hl-green { background: var(--post-transition); font-weight: 700; }
.gm-hl-blue { background: var(--noble); }
.gm-hl-coral { background: var(--alkali); }
.gm-hl-wrong { background: var(--transparent); color: var(--coral-strong); font-weight: 700; text-decoration: underline wavy var(--coral-strong); text-underline-offset: 3px; }
.en-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); font-family: var(--font-reading); font-size: 19px; line-height: 1.45; }
.en-card p { margin: 0; }
.en-card-body { display: flex; flex-direction: column; gap: var(--space-2); }
.en-card-cap { margin: var(--space-2) 0 0; color: var(--muted); font-size: var(--text-small); }
.en-para { margin: 0; }
.en-big { font-size: 22px; font-weight: 700; margin: 0; }
.en-quote { font-size: 21px; margin: 0; font-style: italic; }
.en-line { display: block; }
.en-lines { display: flex; flex-direction: column; gap: var(--space-2); }
.en-stack { display: flex; flex-direction: column; gap: var(--space-2); width: 100%; }
.en-hill svg { width: 100%; height: auto; max-height: 150px; display: block; }
.en-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.en-chip { display: inline-flex; flex-direction: column; padding: var(--space-1) var(--space-3); border: 2px solid var(--line); border-radius: var(--radius-md); background: var(--paper); }
.en-chip small { color: var(--muted); }
.en-flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: var(--space-2); font-family: var(--font-reading); font-size: 18px; }
.en-flow-box { display: flex; flex-direction: column; gap: 2px; padding: var(--space-2) var(--space-3); border: 2px solid var(--line); border-radius: var(--radius-md); background: var(--paper); min-width: 0; flex: 1 1 8em; }
.en-flow-box small { color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: 12px; }
.en-flow-arrow { align-self: center; color: var(--muted); }
.en-answers { display: flex; flex-direction: column; gap: var(--space-2); }
.en-answer { display: grid; grid-template-columns: minmax(0, 1.3fr) auto minmax(0, 1fr); gap: var(--space-2); align-items: center; font-size: 17px; }
.en-answer-arrow { color: var(--muted); }
.wj-tok { display: inline-flex; flex-direction: column; align-items: center; vertical-align: top; line-height: 1.2; }
.wj-tok small { font-size: 12px; color: var(--muted); font-weight: 700; }

/* text-sort: a card of words, a question, and 2 to 4 choices */
.en-ts { display: flex; flex-direction: column; gap: var(--space-2); }
.en-ts-card .en-card { padding: var(--space-2) var(--space-3); font-size: 18px; line-height: 1.4; }
.en-ts-count { margin: 0; color: var(--blue-dark); font-weight: 700; font-size: var(--text-small); }
.en-ts-count[hidden], .en-ts-ask[hidden] { display: none; }
.en-ts-ask { margin: 0; font-weight: 700; }
.en-ts-done { margin: 0; font-weight: 700; }
.en-ts-bins { display: grid; grid-template-columns: repeat(var(--ts-cols, 2), minmax(0, 1fr)); gap: var(--space-2); }
.en-ts-bin, .en-sl-fix { display: flex; align-items: center; gap: var(--space-2); min-height: var(--target-min); padding: var(--space-1) var(--space-3); background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius-md); font: inherit; font-size: 18px; font-weight: 700; color: var(--ink); text-align: left; cursor: pointer; }
.en-ts-bin:hover:not(:disabled), .en-sl-fix:hover, .en-tm-card:hover:not(:disabled), .en-to-move:hover:not(:disabled) { border-color: var(--blue); }
.en-ts-bin:disabled { opacity: .55; cursor: default; }
.en-ts-bin:focus-visible, .en-sl-fix:focus-visible, .en-sl-word:focus-visible, .en-tm-card:focus-visible, .en-to-move:focus-visible { outline: 3px solid var(--blue-dark); outline-offset: 2px; }
.en-ts-key { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: var(--radius-round); background: var(--cream); font-size: 14px; flex: none; }

/* text-match: two columns of cards */
.en-tm-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.en-tm-head { margin: 0 0 var(--space-1); color: var(--blue-dark); font-weight: 700; font-size: var(--text-small); text-transform: uppercase; letter-spacing: .05em; }
.en-tm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.en-tm-card { display: flex; align-items: center; gap: var(--space-2); width: 100%; min-height: var(--target-min); padding: var(--space-1) var(--space-2); background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius-md); font: inherit; font-size: 16px; color: var(--ink); text-align: left; cursor: pointer; }
.en-tm-card.is-picked { border-color: var(--blue-strong); box-shadow: var(--elevation-soft); background: var(--cream); }
.en-tm-card.is-matched { border-color: var(--green-strong); opacity: .9; cursor: default; }
.en-tm-card:disabled { color: var(--ink); }
.en-tm-key { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: var(--radius-round); background: var(--cream); font-size: 13px; font-weight: 700; flex: none; }
.en-tm-ok { margin-left: auto; color: var(--green-text); font-weight: 800; }
.en-tone-0.is-matched { background: var(--noble); }
.en-tone-1.is-matched { background: var(--post-transition); }
.en-tone-2.is-matched { background: var(--alkaline); }
.en-tone-3.is-matched { background: var(--alkali); }

/* text-order: sentences with up and down buttons */
.en-to { display: flex; flex-direction: column; gap: var(--space-2); }
.en-to-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.en-to-row { display: grid; grid-template-columns: 6.5em minmax(0, 1fr) auto; gap: var(--space-2); align-items: center; padding: var(--space-1) var(--space-2); border: 2px solid var(--line); border-radius: var(--radius-md); background: var(--paper); }
.en-to-row.is-done { border-color: var(--green-strong); }
.en-to-slot { display: flex; align-items: center; gap: var(--space-1); color: var(--blue-dark); font-weight: 700; font-size: 13px; line-height: 1.15; }
.en-to-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: var(--radius-round); background: var(--cream); flex: none; }
.en-to-text { font-family: var(--font-reading); font-size: 16px; line-height: 1.3; }
.en-to-moves { display: flex; gap: var(--space-1); }
.en-to-move { min-width: var(--target-min); min-height: var(--target-min); border: 2px solid var(--line); border-radius: var(--radius-md); background: var(--paper); font: inherit; color: var(--ink); cursor: pointer; }
.en-to-move:disabled { opacity: .35; cursor: default; }
.en-to-actions { display: flex; gap: var(--space-2); }
.en-to-actions .gm-button { min-height: 44px; font-size: 16px; }

/* text-slip: a note of tappable words */
.en-sl { display: flex; flex-direction: column; gap: var(--space-2); }
.en-sl-tip { margin: 0; font-weight: 700; min-height: 1.3em; }
.en-sl-note { display: flex; flex-wrap: wrap; gap: 2px; padding: var(--space-2); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); font-family: var(--font-reading); }
.en-sl-sentence { display: contents; }
.en-sl-word { min-height: var(--target-min); padding: 0 6px; border: 2px solid var(--transparent); border-radius: var(--radius-sm); background: var(--transparent); font: inherit; font-size: 19px; color: var(--ink); cursor: pointer; }
.en-sl-word:hover:not(:disabled) { border-color: var(--blue); background: var(--cream); }
.en-sl-word:disabled { cursor: default; color: var(--ink); }
.en-sl-word.is-found { border-color: var(--coral-strong); background: var(--cream); }
.en-sl-word.is-fixed { background: var(--post-transition); font-weight: 700; }
.en-sl-fixes { display: flex; flex-direction: column; gap: var(--space-2); }
.en-sl-fixes[hidden] { display: none; }

@media (max-width: 420px) {
  .en-tm-cols { grid-template-columns: minmax(0, 1fr); }
  .en-to-row { grid-template-columns: minmax(0, 1fr) auto; }
  .en-to-slot { grid-column: 1 / -1; }
  .en-answer { grid-template-columns: minmax(0, 1fr); }
  .en-answer-arrow { display: none; }
  .en-ts-bins { grid-template-columns: minmax(0, 1fr); }
}

/* Balance Kitchen layout: counters on the left; tally and the Cook button stacked on the right */
.chem-bk-grid { grid-template-areas: "rows tally" "rows act"; align-items: start; }
.chem-bk-grid > div[data-bk-counters], .chem-bk-grid .cr { display: contents; }
.chem-bk-grid .cr-rows { grid-area: rows; }
.chem-bk-grid .chem-tally { grid-area: tally; }
.chem-bk-grid .cr-actions { grid-area: act; }
.chem-bk .cr-name { overflow-wrap: normal; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-2); }
.chem-bk .cr-value, .chem-ab .cr-value { min-width: 2.2em; }
.chem-formula { white-space: nowrap; }
.chem-ab .cr-name { overflow-wrap: normal; }
@media (max-width: 560px) {
  .chem-bk-grid { grid-template-areas: "rows" "tally" "act"; }
}

/* Game lists on narrow screens: one column, two subject tiles across; the page may reflow downward */
@media (max-width: 600px) {
  .gm-cols { grid-template-columns: minmax(0, 1fr); }
  .gm-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gm-search { width: 100%; }
}

/* Math games for grades 6-12 (js/subjects/math/games/upper-kit.js): a picture beside the controls */
.mu-split { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: center; }
.mu-pic { flex: 0 1 240px; width: 240px; max-width: 100%; min-width: 0; }
.mu-pic.is-wide { flex-basis: 300px; width: 300px; }
.mu-ctl { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.mu-svg { width: 100%; height: auto; display: block; }
.mu-pic .mu-svg { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); }
.mu-curve { fill: none; stroke: var(--blue-strong); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.mu-curve.is-goal { stroke: var(--green-strong); stroke-dasharray: 6 4; stroke-width: 2.5; }
.mu-curve.is-ghost { stroke: var(--muted); stroke-dasharray: 3 4; stroke-width: 2; }
.mu-pt { fill: var(--coral-strong); stroke: var(--paper); stroke-width: 2; }
.mu-pt.is-goal { fill: var(--yellow); stroke: var(--ink); stroke-width: 1.5; }
.mu-pt.is-blue { fill: var(--blue-strong); }
.mu-seg { stroke: var(--coral-strong); stroke-width: 2.5; stroke-linecap: round; fill: none; }
.mu-seg.is-run { stroke: var(--blue-strong); }
.mu-seg.is-dash { stroke-dasharray: 5 4; stroke-width: 2; }
.mu-seg.is-green { stroke: var(--green-strong); }
.mu-note { font-family: var(--font-reading); font-size: 12px; font-weight: 700; fill: var(--ink); }
.mu-note.is-coral { fill: var(--coral-text); }
.mu-note.is-blue { fill: var(--blue-dark); }
.mu-note.is-end { text-anchor: end; } .mu-note.is-mid { text-anchor: middle; }
.mu-box { fill: var(--cream); stroke: var(--ink); stroke-width: 2; }
.mu-box.is-gold { fill: var(--yellow); }
.mu-box.is-blue { fill: var(--blue); fill-opacity: .25; stroke: var(--blue-strong); }
.mu-fill { fill: var(--blue); fill-opacity: .55; stroke: var(--ink); stroke-width: 1.5; }
.mu-fill.is-red { fill: var(--coral-display); fill-opacity: .85; }
.mu-fill.is-green { fill: var(--green); fill-opacity: .7; }
.mu-fill.is-off { fill: var(--cream); fill-opacity: 1; }
.mu-fill.is-gold { fill: var(--yellow); fill-opacity: 1; }
.mu-line { stroke: var(--ink); stroke-width: 2; fill: none; }
.mu-shade { fill: var(--ink); opacity: .22; }
.mu-readout { margin: 0; font-weight: 700; font-size: 17px; }
.mu-hint { margin: 0; color: var(--muted); font-size: var(--text-small); }
.mu-ctl .gm-button.gm-primary { min-height: 44px; }
.mu-tag { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.mu-scene-ink { fill: none; stroke: var(--ink); stroke-width: 1; opacity: .55; }
.mu-scene-soft { fill: var(--ink); opacity: .18; }
.mu-scene-gold { fill: var(--yellow); stroke: var(--ink); stroke-width: .6; }
.mu-scene-blue { fill: var(--blue); fill-opacity: .6; stroke: var(--ink); stroke-width: .6; }
.mu-scene-coral { fill: var(--coral-display); stroke: var(--ink); stroke-width: .6; }
.mu-ctl .dl-row { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.mu-ctl .dl-row .dl-label { grid-column: 1; grid-row: 1; }
.mu-ctl .dl-row .dl-out { grid-column: 2; grid-row: 1; }
.mu-ctl .dl-row .dl-track { grid-column: 1 / -1; grid-row: 2; }
.mu-ctl.is-stacked .cr-row { grid-template-columns: minmax(0, 1fr) auto auto; }
.mu-ctl.is-stacked .cr-name { grid-column: 1 / -1; }
.mu-ctl.is-stacked .cr-value { grid-column: 1; grid-row: 2; text-align: left; min-width: 0; }
.mu-pic.is-short .gm-art { height: 96px; width: auto; max-width: 100%; margin: 0 auto; }
@media (max-width: 420px) { .mu-pic, .mu-pic.is-wide { flex-basis: 100%; width: 100%; max-width: 300px; margin: 0 auto; } }

/* Physics games, set two (pz-): Ski Hill, Bumper Carts, Orbit Launch, Swing Timer, Bath Mixer, Static Fur, Motor Pet, Energy Chain.
   Strokes do not scale, so one drawing looks right on the 200 x 100 stage and on a teaching picture. */
.pz-line { fill: none; stroke: var(--ink); stroke-width: 2.5px; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; }
.pz-line.is-thin { stroke-width: 1.5px; }
.pz-line.is-soft { stroke: var(--muted); stroke-width: 1.5px; }
.pz-line.is-dash { stroke-dasharray: 6 5; }
.pz-line.is-blue { stroke: var(--blue-strong); }
.pz-line.is-coral { stroke: var(--coral-strong); }
.pz-line.is-green { stroke: var(--green-strong); }
.pz-line.is-faint { opacity: .4; }
.pz-fill { fill: var(--yellow); stroke: var(--ink); stroke-width: 2px; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.pz-fill.is-blue { fill: var(--blue); }
.pz-fill.is-coral { fill: var(--coral); }
.pz-fill.is-green { fill: var(--green); }
.pz-fill.is-paper { fill: var(--paper); }
.pz-fill.is-cream { fill: var(--cream); }
.pz-fill.is-ink { fill: var(--ink); }
.pz-fill.is-ground { fill: var(--green); fill-opacity: .55; }
.pz-fill.is-faint { fill-opacity: .35; stroke-opacity: .5; }
.pz-fill.is-none { fill: var(--transparent); }
.pz-head { stroke: none; fill: var(--ink); }
.pz-head.is-blue { fill: var(--blue-strong); }
.pz-head.is-coral { fill: var(--coral-strong); }
.pz-head.is-green { fill: var(--green-strong); }
.pz-emoji { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.pz-sign { font: 800 7px var(--font-reading); fill: var(--ink); }
.pz-sign.is-art { font-size: 22px; }
.pz-readout { font-variant-numeric: tabular-nums; }

/* Chemistry games, second batch (cg-*): Element Hotel, Bond Sort, Size Lineup, Balloon Pump, Mixture Rescue, Hand Warmer, Collision Park, Mole Bakery */
.cg-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-2); text-align: center; max-width: 100%; min-width: 0; }
.cg-tile { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 76px; padding: 4px 10px; background: var(--paper); border: 3px solid var(--ink); border-radius: var(--radius-md); line-height: 1.15; }
.cg-tile-sm { min-width: 70px; padding: 2px 8px; }
.cg-sym { font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--ink); }
.cg-tile small { font-size: 14px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.cg-tile .cg-num { color: var(--muted); font-weight: 400; }
.cg-plus { font-size: 24px; font-weight: 700; color: var(--muted); }
.cg-thermo { flex-direction: column; gap: 2px; }
.cg-react { font-weight: 700; font-size: 17px; line-height: 1.25; overflow-wrap: anywhere; }
.cg-temps { font-size: 20px; }
.cg-bin-emoji { font-size: 30px; line-height: 1; }
.sb-chute:has(.cg-card) { flex-wrap: wrap; }
.sb-card:has(> .cg-card) { flex: 1 1 200px; width: auto; min-width: 0; max-width: 100%; height: auto; min-height: 96px; padding: var(--space-1) var(--space-2); }
.cg-mini-diagram { width: 100%; max-width: 230px; height: auto; max-height: 100px; }
.cg-answers { display: flex; flex-direction: column; gap: var(--space-1); width: 100%; }
.cg-ans { display: grid; grid-template-columns: minmax(0, 1.3fr) auto minmax(0, 1fr); gap: var(--space-2); align-items: center; padding: 2px var(--space-2); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper); }
.cg-ans .cg-card { justify-content: flex-start; }
.cg-ans .cg-tile { min-width: 56px; padding: 1px 6px; border-width: 2px; }
.cg-ans .cg-sym { font-size: 20px; }
.cg-ans .cg-tile small { font-size: 12px; }
.cg-ans .cg-react { font-size: 14px; }
.cg-ans .cg-temps { font-size: 14px; }
.cg-ans .cg-mini-diagram { max-height: 56px; max-width: 120px; }
.cg-ans-arrow { color: var(--muted); font-weight: 700; }
.cg-ans-word { font-size: 14px; line-height: 1.2; overflow-wrap: anywhere; }
@media (max-width: 420px) { .cg-ans { grid-template-columns: minmax(0, 1fr); } .cg-ans-arrow { display: none; } }
.cg-tile-box { fill: var(--paper); stroke: var(--ink); stroke-width: 2; }
.cg-tile-sym { font-family: var(--font-display); font-size: 24px; font-weight: 700; fill: var(--ink); }
.cg-tile-name { font-size: 9.5px; font-weight: 700; fill: var(--ink); }
.cg-ordtile { width: 100%; height: 100%; }
.cg-hotel { fill: var(--paper); stroke: var(--ink); stroke-width: 1.2; }
.cg-roof { fill: var(--coral-strong); stroke: var(--ink); stroke-width: 1; }
.cg-door { fill: var(--blue-strong); }
.cg-win { fill: var(--line); stroke: var(--ink); stroke-width: .6; }
.cg-win.is-lit { fill: var(--yellow); }
.cg-bead { fill: var(--line); stroke: var(--ink); stroke-width: .6; }
.cg-bead.is-lit { fill: var(--blue-strong); }
.cg-string { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 1.6; }
.cg-atom-a { fill: var(--blue-strong); stroke: var(--ink); stroke-width: 1; }
.cg-atom-b { fill: var(--coral-display); stroke: var(--ink); stroke-width: 1; }
.cg-share { fill: var(--yellow); stroke: var(--ink); stroke-width: .8; }
.cg-binsvg { width: 72px; height: 34px; }
.cg-zone-a { fill: var(--green-strong); opacity: .35; }
.cg-zone-b { fill: var(--yellow); opacity: .5; }
.cg-zone-c { fill: var(--coral-display); opacity: .4; }
.cg-mark { fill: var(--ink); stroke: var(--paper); stroke-width: 2; }
.cg-bar { stroke: var(--ink); stroke-width: 1.5; }
.cg-ground { stroke: var(--ink); stroke-width: 1; }
.cg-balloon { stroke: var(--ink); stroke-width: .8; }
.cg-balloon.c0 { fill: var(--blue); } .cg-balloon.c1 { fill: var(--coral); } .cg-balloon.c2 { fill: var(--green); }
.cg-balloon-t { font-size: 7px; font-weight: 700; fill: var(--ink); }
.cg-gas { fill: var(--blue-strong); }
.cg-barrel { fill: var(--paper); stroke: var(--ink); stroke-width: 1; }
.cg-gasbox { fill: var(--blue); opacity: .3; }
.cg-plunger { fill: var(--muted); stroke: var(--ink); stroke-width: .8; }
.cg-rod { stroke: var(--ink); stroke-width: 1.4; }
.cg-ghost { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 1.5; }
.cg-balloon-big { fill: var(--coral); stroke: var(--ink); stroke-width: 1; }
.cg-bath { fill: var(--blue); }
.cg-bath.is-hot { fill: var(--coral-display); }
.cg-emoji { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.cg-pbox { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.cg-pbox-svg { width: 100%; max-width: 150px; height: auto; }
.pt-art .cg-pbox-svg { width: 130px; height: auto; }
.cg-bond { stroke: var(--ink); stroke-width: 3; }
.cg-atom-t { font-size: 10px; font-weight: 700; fill: var(--paper); }
.cg-boxrow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.cg-fig { margin: 0; text-align: center; font-size: 14px; font-weight: 700; }
.cg-want { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); }
.cg-want .gm-art { max-height: 130px; }
.cg-task { margin: 0; font-weight: 700; }
.cg-bowl { fill: var(--yellow); stroke: var(--ink); stroke-width: 1.2; }
.cg-bowl-shadow { fill: var(--ink); opacity: .12; }
.cg-bit.a { fill: var(--coral-display); } .cg-bit.b { fill: var(--blue-strong); }
.cg-tube { fill: var(--paper); stroke: var(--ink); stroke-width: 1.2; }
.cg-mercury { fill: var(--coral-strong); }
.cg-level { stroke: var(--blue-strong); stroke-width: 2.5; }
.cg-level.is-alt { stroke: var(--coral-strong); }
.cg-curve { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 1.5; }
.cg-spark { font-size: 9px; fill: var(--yellow); stroke: var(--ink); stroke-width: .3; }
.cg-catalyst { fill: var(--yellow); stroke: var(--ink); stroke-width: .6; }
.cg-dot { stroke: var(--ink); stroke-width: .5; }
.cg-plate { fill: var(--muted); stroke: var(--ink); stroke-width: .8; }
.cg-pile { fill: var(--yellow); stroke: var(--ink); stroke-width: .8; }
@media (max-width: 420px) { .sb-card:has(> .cg-card) { flex-basis: 100%; } .cg-boxrow { grid-template-columns: minmax(0, 1fr); } }
.pz-want { text-align: center; }
.pz-want .gm-art { max-height: 120px; width: auto; max-width: 100%; margin: 0 auto; }
/* English word games: lesson tables in "Review the basics" wrap inside a 320px page. */
.gm-teach .mv-table { max-width: 100%; }
@media (max-width: 420px) { .gm-teach .mv-table th, .gm-teach .mv-table td { padding: 4px 5px; font-size: 14px; overflow-wrap: anywhere; } }
/* Collision Park: three dials stay on one line each on a laptop so feedback and Next fit */
.chem-cp .dl-row { grid-template-columns: minmax(0, 8.5em) minmax(0, 1fr) 4.5em; align-items: center; column-gap: var(--space-2); }
.chem-cp .dl-label { grid-column: 1; }
@media (max-width: 640px) { .chem-cp .dl-row { grid-template-columns: minmax(0, 1fr); } }
.pt-art svg.pz-tile { width: auto; max-width: 100%; height: 92px; }
