/* Pre-K: big targets, big pictures, few words. Tokens only (styles.css). */
.pk-page { padding-top: var(--space-2); padding-bottom: var(--space-3); }
.pk-kicker { margin: 0; font-family: var(--font-display); font-size: var(--text-small); font-weight: 700; color: var(--coral-text); letter-spacing: .02em; }
.pk-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-2); margin: var(--space-2) 0 0; }
.pk-big-emoji { margin: 0; font-size: 72px; line-height: 1.1; }
.pk-petbox { width: 100%; max-width: 260px; }
.pk-petbox .gm-stage { aspect-ratio: 2 / 1; }

/* Home */
.pk-home { display: grid; grid-template-columns: minmax(160px, 230px) minmax(0, 1fr); grid-template-areas: "pet hello" "pet week" "lib lib"; column-gap: var(--space-3); row-gap: var(--space-2); align-items: center; }
.pk-top { display: contents; }
.pk-top .pk-petbox { grid-area: pet; }
.pk-hello { grid-area: hello; }
.pk-week { grid-area: week; }
.pk-library { grid-area: lib; }
.pk-hello h1 { margin: 2px 0; font-family: var(--font-display); font-size: clamp(24px, 3vw, 34px); line-height: 1.1; color: var(--ink); }
.pk-lede { margin: 0; max-width: 60ch; color: var(--muted); }
.pk-hello-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: var(--space-1) 0 0; }
.pk-album { display: inline-flex; align-items: center; gap: 6px; min-height: var(--target-min); padding: 4px 12px; border-radius: var(--radius-round); background: var(--paper); border: 1px solid var(--line); font-size: 20px; }
.pk-album b { font-size: var(--text-small); }
.pk-home .button, .pk-browse .button, .pk-shell .button { min-height: 64px; min-width: 64px; }
.pk-week { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: var(--space-2); margin: 0; padding: var(--space-2); border-radius: var(--radius-lg); background: var(--cream); border: 2px solid var(--yellow); box-shadow: var(--elevation-soft); }
.pk-week-num { margin: 0; font-weight: 700; color: var(--muted); font-size: var(--text-small); }
.pk-week h2 { margin: 2px 0; font-family: var(--font-display); font-size: clamp(22px, 2.6vw, 30px); color: var(--ink); }
.pk-week-sub { margin: 0; color: var(--muted); }
.pk-arrow { width: 64px; height: 64px; border-radius: var(--radius-round); border: 2px solid var(--line); background: var(--paper); color: var(--ink); font-size: 20px; cursor: pointer; }
.pk-arrow:disabled { opacity: .35; cursor: default; }
.pk-go { min-height: 64px; padding-inline: var(--space-3); font-size: 20px; }
.pk-library { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-2); }
.pk-strand-tile { display: grid; place-items: center; align-content: center; gap: var(--space-2); min-width: 0; min-height: 144px; padding: var(--space-2); border: 2px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); color: var(--ink); font-family: var(--font-display); font-size: 21px; font-weight: 700; line-height: 1.2; text-decoration: none; text-align: center; box-shadow: var(--elevation-soft); }
.pk-strand-emoji { font-size: 52px; line-height: 1; }
.pk-strand-tile, .pk-game-link { touch-action: manipulation; -webkit-touch-callout: none; user-select: none; }
.pk-strand-tile:hover, .pk-strand-tile:focus-visible, .pk-game-link:hover, .pk-game-link:focus-visible { background: var(--cream); border-color: var(--action-bg); }
.pk-browse { display: grid; gap: var(--space-3); }
.pk-browse-top { display: flex; align-items: center; gap: var(--space-3); }
.pk-browse-top h1 { margin: 0; flex: 1; font-family: var(--font-display); font-size: clamp(26px, 3vw, 34px); line-height: 1.15; }
.pk-browse-top .pk-petbox { max-width: 180px; }
.pk-games { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.pk-game-link { display: flex; align-items: center; gap: var(--space-2); min-width: 0; min-height: 112px; padding: var(--space-2) var(--space-3); border: 2px solid var(--line); border-radius: var(--radius-lg); text-decoration: none; color: var(--ink); font-weight: 700; font-size: 22px; background: var(--paper); box-shadow: var(--elevation-soft); }
.pk-game-emoji { font-size: 48px; line-height: 1; }
.pk-game-name { flex: 1; }
.pk-mini-stars { color: var(--coral-strong); font-size: 16px; }
.pk-browse-pages { display: flex; justify-content: center; align-items: center; gap: var(--space-3); }
.pk-browse-pages .button { min-width: 112px; }

/* Lesson and game layout: the pet and steps beside the activity */
.pk-shell { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: var(--space-3); align-items: start; }
.pk-side { display: grid; gap: var(--space-2); }
.pk-back { justify-self: start; }
.pk-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.pk-steps li { padding: 4px 8px; border-radius: var(--radius-md); }
.pk-steps li.is-now { background: var(--yellow); color: var(--ink); font-weight: 700; }
.pk-steps li.is-done { color: var(--green-text); }
.pk-steps li.is-done::after { content: " ✓"; }
.pk-main { min-width: 0; }
.pk-card { text-align: center; padding: var(--space-3); border-radius: var(--radius-lg); background: var(--paper); border: 1px solid var(--line); box-shadow: var(--elevation-soft); }
.pk-card h1 { margin: var(--space-1) auto; text-align: center; font-family: var(--font-display); font-size: clamp(22px, 2.8vw, 32px); color: var(--ink); }
.pk-hear-show { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-4); margin: var(--space-2) 0; }
.pk-hear-pair { display: inline-flex; align-items: center; gap: var(--space-2); }

/* The play screen */
.pk-play { display: grid; gap: var(--space-2); }
.pk-bar { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.pk-gtitle { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--ink); }
.pk-progress { display: inline-flex; gap: 6px; margin-inline: auto; }
.pk-progress i { width: 14px; height: 14px; border-radius: var(--radius-round); background: var(--line); }
.pk-progress i.is-done { background: var(--green); }
.pk-progress i.is-now { background: var(--coral); }
.pk-hear { min-height: var(--target-min); }
.pk-prompt { text-align: center; }
.pk-said { margin: 0 auto; max-width: 52ch; font-size: var(--text-body); color: var(--muted); }
.pk-show { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: var(--space-2); min-height: 0; margin-top: var(--space-1); }
.pk-show:empty { display: none; }
.pk-answer { display: grid; justify-items: center; }
.pk-answer.is-waiting { visibility: hidden; }

.pk-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); }
.pk-tiles.is-four { gap: var(--space-2); }
.pk-tile { position: relative; display: grid; place-items: center; min-width: 132px; min-height: 132px; padding: var(--space-2); border-radius: var(--radius-lg); border: 3px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; box-shadow: var(--elevation-soft); transition: transform var(--motion-quick) var(--ease-standard), border-color var(--motion-quick) var(--ease-standard); }
.pk-tile:hover:not(:disabled), .pk-tile:focus-visible { transform: translateY(-2px); border-color: var(--blue); }
.pk-tile.is-bubble { border-radius: var(--radius-round); background: var(--cream); }
.pk-tiles .pk-tile.is-right { border-color: var(--green-strong); background: var(--cream); transform: scale(1.06); }
.pk-tile.is-wrong { animation: pk-shake var(--motion-reveal) var(--ease-standard); opacity: .45; }
.pk-tiles .pk-tile.is-reveal { border-color: var(--green-strong); animation: pk-pulse var(--motion-celebrate) var(--ease-standard) infinite alternate; }
.pk-tile:disabled { cursor: default; }
.pk-order .pk-tile { min-width: 104px; min-height: 104px; }
.pk-order.is-many .pk-tile { min-width: 84px; min-height: 84px; }
.pk-order .pk-tile.is-placed { border-color: var(--green-strong); opacity: .7; }
.pk-badge { position: absolute; top: 4px; right: 8px; font-weight: 700; color: var(--green-text); }
.pk-level { min-width: 180px; text-align: center; gap: 4px; }
.pk-level-num { font-family: var(--font-display); font-size: 40px; font-weight: 700; color: var(--blue-strong); }
.pk-level-name { font-weight: 700; }
.pk-levels { display: grid; gap: var(--space-3); text-align: center; }

@keyframes pk-shake { 0%, 100% { translate: 0; } 25% { translate: -6px; } 75% { translate: 6px; } }
@keyframes pk-pulse { from { transform: scale(1); } to { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .pk-tile.is-wrong, .pk-tile.is-reveal, .pk-balloon { animation: none !important; transition: none !important; } }

/* Pictures */
.pk-emoji { display: inline-block; line-height: 1; }
.pk-xl { font-size: 96px; }
.pk-lg { font-size: 64px; }
.pk-md { font-size: 44px; }
.pk-sm { font-size: 28px; }
.pk-group { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 2px; max-width: 220px; }
.pk-gone { opacity: .25; filter: grayscale(1); }
.pk-op { font-family: var(--font-display); font-size: 44px; font-weight: 700; color: var(--muted); margin-inline: var(--space-1); }
.pk-glyph { font-family: var(--font-reading); font-weight: 700; color: var(--ink); line-height: 1; }
.pk-glyph-xl { font-size: 120px; }
.pk-glyph-lg { font-size: 72px; }
.pk-glyph-md { font-size: 48px; }
.pk-numcard { display: grid; justify-items: center; gap: 4px; }
.pk-numcard-dots { font-size: 12px; line-height: 1.2; color: var(--coral-strong); letter-spacing: 2px; }
.pk-dots { width: 150px; height: 150px; }
.pk-dotcard { fill: var(--cream); stroke: var(--line); stroke-width: 2; }
.pk-dot { fill: var(--coral-strong); }
.pk-shape { width: 96px; height: 96px; }
.pk-shape.pk-lg { width: 110px; height: 110px; }
.pk-tone-a { fill: var(--coral); }
.pk-tone-b { fill: var(--blue); }
.pk-tone-c { fill: var(--yellow); }
.pk-tone-d { fill: var(--green); }
.pk-paint { display: grid; place-items: center; width: 92px; height: 92px; border-radius: var(--radius-round); border: 4px solid var(--line); background: var(--paper); font-size: 64px; line-height: 1; }
.pk-scene { width: 150px; height: 135px; }
.pk-wood { fill: var(--coral-strong); }
.pk-box-open { fill: none; stroke: var(--coral-strong); stroke-width: 4; }
.pk-ball { fill: var(--blue); stroke: var(--ink); stroke-width: 1.5; }
.pk-floor { stroke: var(--line); stroke-width: 2; }
.pk-rope { width: 220px; height: 60px; }
.pk-rope-line { fill: none; stroke: var(--coral-strong); stroke-width: 4; stroke-linecap: round; }
.pk-rope-end { fill: var(--ink); }
.pk-train { display: inline-flex; align-items: center; gap: 6px; font-size: 56px; }
.pk-car { display: grid; place-items: center; width: 64px; height: 64px; border-radius: var(--radius-md); background: var(--yellow); border: 3px solid var(--ink); font-family: var(--font-reading); font-weight: 700; font-size: 40px; color: var(--ink); }
.pk-name-sign { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 100%; padding: 8px 12px; border-radius: var(--radius-md); background: var(--cream); border: 3px dashed var(--line); }
.pk-slot { display: grid; place-items: center; width: 52px; height: 60px; border-bottom: 4px solid var(--line); font-family: var(--font-reading); font-weight: 700; font-size: 40px; color: var(--line); }
.pk-slot.is-filled { color: var(--ink); border-color: var(--green-strong); }
.pk-pattern, .pk-lineup { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 8px 12px; border-radius: var(--radius-md); background: var(--cream); }
.pk-mystery { display: grid; place-items: center; min-width: 52px; border: 3px dashed var(--coral); border-radius: var(--radius-md); font-family: var(--font-display); color: var(--coral-text); }
.pk-blanket { display: grid; place-items: center; min-width: 160px; min-height: 110px; padding: 8px; border-radius: var(--radius-md); background: var(--cream); border: 3px dashed var(--coral); }
.pk-plates { display: inline-flex; gap: 10px; }
.pk-plate { display: grid; place-items: center; min-width: 80px; min-height: 80px; padding: 6px; border-radius: var(--radius-round); background: var(--cream); border: 3px solid var(--line); }
.pk-cover { display: grid; place-items: center; width: 150px; height: 150px; }
.pk-story { display: grid; justify-items: center; }

/* Count into the bowl */
.pk-count { display: grid; gap: var(--space-2); justify-items: center; width: 100%; }
.pk-pile { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 640px; }
.pk-treat { width: 64px; height: 64px; border-radius: var(--radius-md); border: 2px solid var(--line); background: var(--paper); font-size: 38px; line-height: 1; cursor: pointer; }
.pk-treat[hidden] { display: none; }
.pk-treat.is-in { width: 64px; height: 64px; font-size: 38px; background: var(--cream); }
.pk-bowl { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; min-width: min(100%, 420px); min-height: 84px; padding: 8px 56px; border-radius: 0 0 var(--radius-lg) var(--radius-lg); background: var(--cream); border: 3px solid var(--coral); }
.pk-bowl-art { position: absolute; left: 8px; font-size: 36px; }
.pk-bowl-items { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.pk-bowl-count { position: absolute; right: 12px; font-family: var(--font-display); font-size: 34px; font-weight: 700; color: var(--coral-text); }
.pk-done { min-height: 64px; font-size: 20px; }

/* Drum */
.pk-drum-box { display: grid; justify-items: center; gap: var(--space-1); }
.pk-drum { width: 150px; height: 150px; border-radius: var(--radius-round); border: 4px solid var(--coral); background: var(--cream); font-size: 88px; line-height: 1; cursor: pointer; }
.pk-drum.is-hit { animation: pk-pulse var(--motion-quick) var(--ease-standard) 2 alternate; }
.pk-claps { min-height: 48px; margin: 0; font-size: 40px; }

/* Trace */
.pk-trace-wrap { width: min(320px, 80vw); }
.pk-trace { position: relative; width: 100%; aspect-ratio: 1; border-radius: var(--radius-lg); background: var(--paper); border: 3px solid var(--line); touch-action: none; }
.pk-trace canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: var(--radius-lg); }
.pk-trace-ink { cursor: crosshair; }
.pk-trace.is-done { border-color: var(--green-strong); }
.pk-trace-meter { position: absolute; left: 12px; right: 12px; bottom: 8px; height: 8px; border-radius: var(--radius-round); background: var(--line); overflow: hidden; }
.pk-trace-meter span { display: block; width: 0; height: 100%; background: var(--green); transition: width var(--motion-quick) var(--ease-standard); }

/* Breathe */
.pk-breathe { display: grid; justify-items: center; gap: var(--space-2); min-height: 260px; }
.pk-balloon { font-size: 80px; line-height: 1; transition: transform 4s ease-in-out; transform: scale(.7); }
.pk-balloon.is-in { transform: scale(1.6); }
.pk-balloon.is-out { transform: scale(.7); }
.pk-breath-word { margin: var(--space-3) 0 0; font-family: var(--font-display); font-size: 26px; color: var(--ink); }

/* Results */
.pk-result { text-align: center; display: grid; gap: var(--space-1); justify-items: center; }
.pk-stars { font-size: 48px; color: var(--coral-strong); letter-spacing: 4px; }

/* Grown-ups */
.pk-gu-heading { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-2); }
.pk-grownups h1 { margin: var(--space-2) 0 var(--space-1); font-family: var(--font-display); font-size: clamp(26px, 3vw, 34px); line-height: 1.15; color: var(--ink); }
.pk-summary { margin: 0 0 var(--space-2); color: var(--muted); }
.pk-saved { margin: 0; color: var(--green-text); font-weight: 700; }
.pk-gu-grid { display: grid; grid-template-columns: minmax(240px, 1fr) 2fr; gap: var(--space-3); align-items: start; }
.pk-gu-panel { padding: var(--space-3); border-radius: var(--radius-lg); background: var(--paper); border: 1px solid var(--line); display: grid; gap: var(--space-1); }
.pk-gu-panel h2 { margin: 0; font-family: var(--font-display); font-size: 20px; color: var(--ink); }
.pk-gu-panel label { font-weight: 700; }
.pk-gu-panel input, .pk-gu-panel select { min-height: var(--target-min); padding: 4px 10px; border-radius: var(--radius-md); border: 1px solid var(--line); font: inherit; max-width: 100%; }
.pk-gu-panel .pk-row { justify-content: flex-start; margin: 0; }
.pk-note { margin: var(--space-1) 0 0; color: var(--muted); font-size: var(--text-small); }
.pk-gu-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.pk-gu-tabs button { min-height: 44px; padding: 4px 12px; border-radius: var(--radius-round); border: 1px solid var(--line); background: var(--cream); color: var(--ink); font-weight: 700; cursor: pointer; }
.pk-gu-tabs button.is-on { background: var(--yellow); border-color: var(--yellow); }
.pk-checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pk-checklist li { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: var(--space-2); padding: 6px 8px; border-radius: var(--radius-md); background: var(--cream); }
.pk-chip { justify-self: start; padding: 2px 10px; border-radius: var(--radius-round); font-size: 13px; font-weight: 700; background: var(--paper); border: 1px solid var(--line); color: var(--muted); }
.pk-chip.is-ready { background: var(--green); border-color: var(--green-strong); color: var(--ink); }
.pk-chip.is-practicing { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.pk-item small { color: var(--muted); }
.pk-tick { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 400; font-size: 14px; white-space: nowrap; cursor: pointer; }
.pk-tick input { width: 22px; height: 22px; min-height: 0; }
.pk-missing { padding: var(--space-4); text-align: center; }

/* Library card and home shortcut */
.home-shortcut-emoji { display: inline-grid; place-items: center; width: 28px; height: 28px; font-size: 24px; line-height: 1; }

@media (max-width: 1100px) {
  .pk-library { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pk-week { grid-template-columns: auto minmax(0, 1fr) auto; }
  .pk-week .pk-go { grid-column: 1 / -1; text-align: center; }
}
@media (max-width: 760px) {
  .pk-home { grid-template-columns: 1fr; grid-template-areas: "pet" "hello" "week" "lib"; }
  .pk-top .pk-petbox { max-width: 220px; justify-self: center; }
  .pk-week { grid-template-columns: auto minmax(0, 1fr) auto; }
  .pk-week .pk-go { grid-column: 1 / -1; justify-self: stretch; text-align: center; }
  .pk-library { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pk-browse-top { flex-wrap: wrap; gap: var(--space-2); }
  .pk-browse-top h1 { flex-basis: calc(100% - 140px); }
  .pk-browse-top .pk-petbox { max-width: 140px; margin-inline: auto; }
  .pk-games { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
  .pk-game-link { flex-direction: column; text-align: center; padding: var(--space-2); }
  .pk-browse-pages { gap: var(--space-2); }
  .pk-browse-pages .button { min-width: 64px; }
  .pk-shell { grid-template-columns: 1fr; }
  .pk-side { grid-template-columns: auto 1fr; align-items: center; }
  .pk-side .pk-petbox { max-width: 160px; justify-self: end; }
  .pk-steps { display: none; }
  .pk-gu-grid { grid-template-columns: 1fr; }
  .pk-gu-heading { flex-wrap: wrap; }
  .pk-checklist li { grid-template-columns: 1fr; }
  .pk-tile { min-width: 108px; min-height: 108px; }
  .pk-xl { font-size: 72px; }
  .pk-lg { font-size: 52px; }
  .pk-glyph-xl { font-size: 96px; }
  .pk-glyph-lg { font-size: 60px; }
}
@media (max-width: 400px) {
  .pk-library { grid-template-columns: 1fr; }
  .pk-week-body { grid-column: 1 / -1; grid-row: 1; text-align: center; }
  .pk-week [data-week-step="-1"] { grid-column: 1; }
  .pk-week [data-week-step="1"] { grid-column: 3; }
  .pk-week .pk-go { grid-row: 3; }
  .pk-games { grid-template-columns: 1fr; }
  .pk-game-link { flex-direction: row; min-height: 96px; text-align: left; }
  .pk-tiles { gap: var(--space-2); }
  .pk-tile { min-width: 92px; min-height: 92px; padding: 6px; }
  .pk-order.is-many .pk-tile { min-width: 64px; min-height: 64px; }
  .pk-lg { font-size: 44px; }
  .pk-md { font-size: 34px; }
  .pk-glyph-lg { font-size: 52px; }
  .pk-glyph-md { font-size: 40px; }
  .pk-treat { width: 64px; height: 64px; font-size: 38px; }
}
.library-prek { white-space: nowrap; }

.pk-sound-details { margin-top: var(--space-1); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 0 var(--space-2); background: var(--cream); }
.pk-sound-details summary { min-height: 44px; cursor: pointer; font-weight: 700; display: flex; align-items: center; }
.pk-sound-check { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; padding-bottom: var(--space-2); }
.pk-sound-check button { min-height: 44px; border-radius: var(--radius-md); border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-family: var(--font-reading); font-weight: 700; font-size: 16px; cursor: pointer; }
.pk-sound-check button:hover, .pk-sound-check button:focus-visible { background: var(--yellow); }
