:root {
  color-scheme: light;
  --jungle: #174f48;
  --jungle-dark: #0c3835;
  --leaf: #2b7a56;
  --leaf-light: #78bc65;
  --sky: #dff5ee;
  --paper: #fffdf4;
  --ink: #7650d8;
  --ink-deep: #5032af;
  --guide: #2f79ca;
  --guide-dark: #18518f;
  --sun: #ffc84b;
  --start: #27a657;
  --stop: #dc4f45;
  --text: #173d3a;
  --muted: #57716c;
  --line: #cfe2dc;
  --shadow: 0 16px 42px rgba(18, 67, 59, 0.18);
}

* { box-sizing: border-box; }

html,
body { margin: 0; min-width: 320px; min-height: 100%; }

body {
  overflow: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 5%, rgba(255,255,255,.72) 0 5%, transparent 17%),
    linear-gradient(155deg, #dff6ef 0%, #c4eadb 54%, #a9d6bd 100%);
  font-family: "Nunito", system-ui, sans-serif;
}

button,
select,
input { font: inherit; }

button,
select { min-height: 44px; }

button { cursor: pointer; }

button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 4px solid #ffb72f;
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 12px 16px;
  color: #fff;
  background: var(--jungle-dark);
  border-radius: 12px;
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.app-shell {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  padding: clamp(6px, 1.2vw, 16px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: clamp(6px, .9vw, 12px);
  overflow: hidden;
}

.topbar,
.lesson-strip,
.trace-board {
  width: min(100%, 1600px);
  margin-inline: auto;
}

.topbar {
  min-height: 58px;
  padding: 5px clamp(7px, 1.2vw, 18px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: clamp(6px, 1.2vw, 16px);
  color: #fff;
  background:
    linear-gradient(100deg, rgba(255,255,255,.06), transparent 40%),
    var(--jungle);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px;
  box-shadow: 0 9px 26px rgba(11, 62, 54, .2);
}

.brand-lockup {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: clamp(7px, 1vw, 13px);
}

.brand-lockup img {
  width: clamp(44px, 5.4vw, 70px);
  height: 45px;
  padding: 3px 6px;
  object-fit: contain;
  background: rgba(255,255,255,.94);
  border-radius: 12px;
}

.brand-kicker,
.dialog-kicker,
.stroke-kicker {
  margin: 0;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.brand-kicker { color: #bfe4cd; }

.topbar h1 {
  margin: 1px 0 0;
  overflow: hidden;
  font-family: "Fredoka", "Nunito", sans-serif;
  font-size: clamp(17px, 2vw, 26px);
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.safari-score {
  min-height: 44px;
  padding: 5px 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #123f39;
  background: #f2fff7;
  border: 2px solid #a6d7bd;
  border-radius: 15px;
  font-size: 17px;
  font-weight: 900;
}

.safari-score small { color: var(--muted); }
.score-stars { padding-left: 7px; border-left: 1px solid #bddaca; }
.score-stars > span { color: #e89415; }

.icon-button,
.close-button {
  min-width: 44px;
  min-height: 44px;
  border: 2px solid rgba(255,255,255,.42);
  border-radius: 14px;
}

.icon-button {
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #fff;
  background: rgba(255,255,255,.12);
  font-weight: 900;
}

.lesson-strip {
  min-height: 54px;
  padding: 5px clamp(6px, 1vw, 13px);
  display: grid;
  grid-template-columns: auto minmax(240px, 1fr) auto;
  align-items: center;
  gap: clamp(6px, 1vw, 14px);
  background: rgba(255,255,255,.85);
  border: 2px solid rgba(71, 126, 108, .22);
  border-radius: 18px;
  box-shadow: 0 7px 20px rgba(23, 80, 69, .1);
  backdrop-filter: blur(10px);
}

.letter-picker {
  min-height: 44px;
  padding-left: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.letter-picker select {
  min-width: 84px;
  padding: 0 32px 0 12px;
  color: var(--text);
  background: #fff;
  border: 2px solid #8ebcaf;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 900;
}

.lesson-steps {
  min-width: 0;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
}

.lesson-steps li {
  position: relative;
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #668078;
  font-size: clamp(10px, 1.1vw, 14px);
  font-weight: 900;
}

/* Keep the connector rail behind each label instead of letting it cut through the words. */
.lesson-steps li > span {
  position: relative;
  z-index: 2;
  padding-inline: 6px;
  background: rgba(255, 255, 255, .94);
  border-radius: 7px;
}

.lesson-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: calc(50% + 25px);
  right: calc(-50% + 25px);
  top: 21px;
  height: 3px;
  background: #cee0d9;
}

.lesson-steps b {
  position: relative;
  z-index: 1;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  color: #587269;
  background: #e7f0ed;
  border: 2px solid #b8d0c8;
  border-radius: 50%;
}

.lesson-steps .is-current { color: var(--jungle); }
.lesson-steps .is-current b { color: #fff; background: var(--jungle); border-color: var(--jungle); }
.lesson-steps .is-done b { color: #fff; background: var(--start); border-color: var(--start); }
.lesson-steps .is-done b::after { content: "✓"; }
.lesson-steps .is-done b { font-size: 0; }
.lesson-steps .is-done b::after { font-size: 15px; }

.word-card {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 900;
}

.animal-badge {
  width: 41px;
  height: 41px;
  display: grid;
  place-items: center;
  background: #fff4cf;
  border: 2px solid #efcb67;
  border-radius: 13px;
  font-size: 24px;
}

.word-card > span:last-child { display: grid; line-height: 1.05; }
.word-card strong { font-size: 15px; }
.word-card small { color: var(--muted); font-size: 11px; }

.trace-board {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: var(--paper);
  border: 2px solid rgba(74, 120, 105, .28);
  border-radius: clamp(18px, 2.2vw, 28px);
  box-shadow: var(--shadow);
}

.coach-bar {
  min-height: 62px;
  padding: 5px clamp(8px, 1.4vw, 18px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(8px, 1.2vw, 14px);
  background: linear-gradient(90deg, #f5fffa, #eef8f2);
  border-bottom: 2px solid #d5e6df;
}

.glyph-chip {
  width: 49px;
  height: 49px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #7758d7, #4f34ad);
  border: 3px solid #fff;
  border-radius: 16px;
  box-shadow: 0 4px 0 #372381;
  font-family: "Fredoka", sans-serif;
  font-size: 31px;
}

.coach-copy { min-width: 0; }
.stroke-kicker { color: #237153; }
.coach-copy h2 {
  margin: 0;
  font-family: "Fredoka", "Nunito", sans-serif;
  font-size: clamp(16px, 1.7vw, 23px);
  line-height: 1.08;
}
.coach-copy > p:last-child {
  margin: 1px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: clamp(11px, 1.05vw, 14px);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-badge {
  min-height: 40px;
  padding: 0 11px;
  display: grid;
  place-items: center;
  color: #2a5b4d;
  background: #dff3e9;
  border: 2px solid #acd4c2;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
}

.paper-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 22% 28%, rgba(255,255,255,.9) 0 2px, transparent 3px),
    linear-gradient(180deg, #fffdf5 0%, #fffaf0 100%);
}

.paper-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(40, 91, 80, .055) 1px, transparent 1px);
  background-size: 100% 20px;
}

.paper-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .075;
  background-image: url("assets/wellesley_logo_compact.png");
  background-repeat: repeat;
  background-size: 220px 110px;
  background-position: 24px 18px;
  filter: saturate(.7) contrast(.88);
  mix-blend-mode: multiply;
}

.canopy {
  position: absolute;
  z-index: 1;
  width: 110px;
  height: 80px;
  pointer-events: none;
  opacity: .85;
}

.canopy::before,
.canopy::after {
  content: "";
  position: absolute;
  width: 70px;
  height: 30px;
  background: #4d9b65;
  border-radius: 80% 20% 80% 20%;
  transform: rotate(28deg);
}

.canopy-left { left: -25px; bottom: -22px; transform: rotate(12deg); }
.canopy-right { right: -28px; top: -22px; transform: rotate(190deg); }
.canopy::after { left: 42px; top: 30px; background: #76b862; transform: rotate(-16deg); }

.trace-surface {
  position: absolute;
  z-index: 2;
  inset: 4px;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  display: block;
  overflow: visible;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.rule {
  vector-effect: non-scaling-stroke;
  stroke-width: 2.15px;
  stroke-dasharray: 6 5;
  stroke-linecap: round;
  opacity: .82;
}
.cap-rule { stroke: #9ab4dc; }
.x-rule { stroke: #9fb9df; }
.baseline-rule { stroke: #6f91ca; stroke-width: 2.8px; opacity: .9; }
.descender-rule { stroke: #a7bfdc; }

.guide-path,
.model-path,
.child-ink {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.guide-path {
  stroke: var(--guide);
  stroke-width: 19px;
  opacity: .42;
}

.guide-path.is-active {
  stroke: #2b83d5;
  stroke-width: 20px;
  opacity: .72;
  filter: drop-shadow(0 2px 0 rgba(19,76,133,.28));
}

.guide-path.is-future { stroke-dasharray: 2 6; opacity: .32; }
.guide-path.is-completed { stroke: #64a98b; opacity: .3; }

.model-path {
  stroke: #ffb832;
  stroke-width: 9px;
  opacity: .96;
  filter: drop-shadow(0 2px 1px rgba(121,73,4,.24));
}

.child-ink {
  stroke: var(--ink);
  stroke-width: 11px;
  opacity: .94;
  filter: drop-shadow(0 2px 0 rgba(55,31,126,.28));
}

.child-ink-dot {
  fill: var(--ink);
  stroke: #fff;
  stroke-width: 2px;
}

#completedInkLayer .child-ink { stroke: #3c66c4; opacity: .86; }

.start-halo,
.stop-halo { opacity: .16; }
.start-halo { fill: var(--start); }
.stop-halo { fill: var(--stop); }
.start-disc { fill: var(--start); stroke: #fff; stroke-width: 1.6; }
.start-number { fill: #fff; font: 900 5.6px "Nunito", sans-serif; text-anchor: middle; dominant-baseline: central; }
.marker-label { fill: #17643b; font: 900 4px "Nunito", sans-serif; text-anchor: middle; paint-order: stroke; stroke: #fffdf4; stroke-width: 1.8px; stroke-linejoin: round; }
.stop-disc { fill: var(--stop); stroke: #fff; stroke-width: 1.5; }
.stop-text { fill: #fff; font: 900 3.6px "Nunito", sans-serif; text-anchor: middle; dominant-baseline: central; }
.direction-arrow { fill: #d98c08; font: 900 10px "Nunito", sans-serif; text-anchor: middle; dominant-baseline: central; paint-order: stroke; stroke: #fffdf4; stroke-width: 2px; }
.future-start { opacity: .5; }
.completed-start { opacity: .42; }
.tap-ring { fill: none; stroke: var(--start); stroke-width: 2; stroke-dasharray: 3 2; }
.recovery-ring { fill: #ffd55f; opacity: .3; stroke: #dc8a12; stroke-width: 1.2; stroke-dasharray: 2 2; }
.recovery-core { fill: #f3a71d; stroke: #fff; stroke-width: 1.2; }
.recovery-label { fill: #87500d; font: 900 3.5px "Nunito", sans-serif; text-anchor: middle; paint-order: stroke; stroke: #fffdf4; stroke-width: 1.7px; }

.feedback-toast {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 8px;
  min-height: 44px;
  max-width: calc(100% - 24px);
  padding: 5px 13px 5px 6px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #244c44;
  background: rgba(255,255,255,.93);
  border: 2px solid #b9d4ca;
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(18,55,49,.14);
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 900;
  pointer-events: none;
}

.feedback-toast > span:first-child {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: #eaf7f1;
  border-radius: 12px;
  font-size: 18px;
}

.feedback-toast[data-tone="pause"] { color: #73451f; border-color: #e8b76f; }
.feedback-toast[data-tone="pause"] > span:first-child { background: #fff0d7; }
.feedback-toast[data-tone="success"] { color: #155d3a; border-color: #79c194; }
.feedback-toast[data-tone="success"] > span:first-child { background: #dcf5e6; }

.board-controls {
  min-height: 56px;
  padding: 5px clamp(6px, 1vw, 12px);
  display: grid;
  grid-template-columns: minmax(126px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  background: #f1f7f4;
  border-top: 2px solid #d5e3de;
}

.practice-picker {
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.practice-picker > span {
  color: #4f6861;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .04em;
  line-height: 1.05;
  text-transform: uppercase;
}
.practice-picker select {
  min-width: 126px;
  max-width: 170px;
  padding: 0 26px 0 9px;
  color: var(--text);
  background: #fff;
  border: 2px solid #9bbcaf;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 900;
}

.guide-controls {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(44px, 1fr));
}

.guide-controls button,
.retry-button {
  min-width: 44px;
  min-height: 44px;
  border: 2px solid #c1d4ce;
  color: #4f6861;
  background: #fff;
  font-size: clamp(10px, 1vw, 13px);
  font-weight: 900;
}

.guide-controls button { border-right-width: 0; }
.guide-controls button:first-child { border-radius: 13px 0 0 13px; }
.guide-controls button:last-child { border-right-width: 2px; border-radius: 0 13px 13px 0; }
.guide-controls button.is-selected { position: relative; z-index: 1; color: #fff; background: var(--guide-dark); border-color: var(--guide-dark); }

.retry-button {
  padding-inline: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #694d26;
  background: #fff1d3;
  border-color: #e4bb65;
  border-radius: 13px;
}
.retry-button > span:first-child { font-size: 19px; }

.app-shell[data-guide="Faded"] .guide-path { opacity: .12; }
.app-shell[data-guide="Faded"] .guide-path.is-active { opacity: .26; stroke-dasharray: 3 7; }
.app-shell[data-guide="Try"] .guide-path { opacity: .025; }
.app-shell[data-guide="Try"] .rule:not(.baseline-rule) { opacity: .35; }
.app-shell[data-watch="on"] .child-ink { opacity: .42; }
.app-shell[data-invalid="true"] .trace-surface { pointer-events: none; opacity: .45; }
.app-shell[data-practice-complete="true"] .trace-surface { pointer-events: none; }

.safari-dialog {
  width: min(92vw, 560px);
  max-height: min(90vh, 720px);
  padding: clamp(20px, 4vw, 38px);
  overflow: auto;
  color: var(--text);
  background:
    radial-gradient(circle at 92% 5%, #fff2c7 0 10%, transparent 25%),
    #fffdf7;
  border: 4px solid #fff;
  border-radius: 28px;
  box-shadow: 0 28px 90px rgba(3, 37, 31, .4);
  text-align: center;
}

.safari-dialog::backdrop {
  background: rgba(8, 46, 40, .72);
  backdrop-filter: blur(5px);
}

.safari-dialog h2 {
  margin: 4px 0 10px;
  font-family: "Fredoka", "Nunito", sans-serif;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.02;
}

.safari-dialog > p:not(.dialog-kicker) {
  max-width: 45ch;
  margin: 0 auto 18px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.45;
}

.dialog-kicker { color: #277354; }

.dialog-art {
  height: 74px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  font-size: 54px;
}
.dialog-art span:nth-child(2) { align-self: flex-start; font-size: 31px; }
.dialog-art span:nth-child(3) { font-size: 34px; }

.mini-route {
  margin: 16px 0 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 2vw, 16px);
  color: #4f6c64;
  font-size: 12px;
  font-weight: 900;
}
.mini-route span { min-width: 78px; padding: 8px; background: #edf7f3; border-radius: 14px; }
.mini-route b { display: block; color: var(--jungle); font-family: "Fredoka", sans-serif; font-size: 25px; }

.primary-button {
  min-width: 180px;
  min-height: 52px;
  padding: 0 24px;
  color: #fff;
  background: linear-gradient(#36b965, #22914c);
  border: 3px solid #fff;
  border-radius: 17px;
  box-shadow: 0 5px 0 #146e38, 0 8px 20px rgba(22,111,57,.24);
  font-size: 17px;
  font-weight: 900;
}
.primary-button:active { transform: translateY(3px); box-shadow: 0 2px 0 #146e38; }

.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; }
.dialog-heading h2 { font-size: 31px; }
.close-button { color: #345e55; background: #eaf4f0; border-color: #bfd8ce; font-size: 29px; }
.setting-row {
  min-height: 62px;
  margin-top: 10px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
  background: #eff7f3;
  border: 2px solid #d4e5df;
  border-radius: 15px;
}
.setting-row > span { display: grid; }
.setting-row small { color: var(--muted); }
.setting-row input { width: 44px; height: 44px; flex: 0 0 44px; accent-color: var(--jungle); }
.safari-dialog .settings-note { margin-top: 16px !important; font-size: 12px !important; }

.reward-burst { font-size: 28px; color: #ef9b19; }
.reward-burst span { display: inline-grid; width: 94px; height: 94px; place-items: center; background: #fff1bd; border: 4px solid #efc04c; border-radius: 28px; font-size: 60px; }
.reward-stars { margin: 5px 0 22px; color: #f2a822; font-size: clamp(34px, 7vw, 52px); letter-spacing: .12em; filter: drop-shadow(0 3px 0 #bc6b12); }

  .reward-dialog {
    width: min(92vw, 560px);
    max-height: min(90vh, 720px);
    padding: 0;
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  .reward-card > .reward-burst {
    position: relative;
    z-index: 3;
    width: calc(100% + 2 * var(--reward-pad));
    margin: 0 0 12px calc(-1 * var(--reward-pad));
    padding: 16px 0 12px;
    background:
      radial-gradient(circle at 92% 5%, #fff2c7 0 10%, transparent 25%),
      #fffdf7;
    border: 0;
    border-radius: 28px 28px 0 0;
    box-sizing: border-box;
  }
  .reward-card {
    --reward-pad: clamp(20px, 4vw, 38px);
    position: relative;
    z-index: 3;
    width: 100%;
    max-height: min(90vh, 720px);
    padding: 0 var(--reward-pad) var(--reward-pad);
    overflow: visible;
    color: var(--text);
    background:
      radial-gradient(circle at 92% 5%, #fff2c7 0 10%, transparent 25%),
      #fffdf7;
    border: 4px solid #fff;
    border-radius: 28px;
    box-shadow: 0 28px 90px rgba(3, 37, 31, .4);
    text-align: center;
    box-sizing: border-box;
  }
  .animal-parade {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    min-width: 100vw;
    min-height: 100vh;
    z-index: 4;
  overflow: hidden;
  pointer-events: none;
}
.animal-parade[hidden] { display: none; }
.animal-parade::before,
.animal-parade::after {
  content: "✦";
  position: absolute;
  color: #f2a822;
  font-size: clamp(18px, 2.4vw, 28px);
  opacity: 0;
  text-shadow: 0 2px 0 rgba(188, 107, 18, .16);
}
.animal-parade::before { top: 24%; left: 17%; }
.animal-parade::after { top: 73%; left: 42%; color: #54a875; font-size: clamp(14px, 2vw, 22px); }
.animal-parade.is-running::before {
  animation: animal-parade-spark 2400ms 180ms ease-out both;
}
.animal-parade.is-running::after {
  animation: animal-parade-spark 2600ms 520ms ease-out both;
}
.animal-parade-sprite {
  position: absolute;
  top: var(--swarm-top, 50%);
  left: 0;
  display: grid;
  width: clamp(36px, 5vw, 70px);
  height: clamp(36px, 5vw, 70px);
  place-items: center;
  font-size: clamp(27px, 4.3vw, 58px);
  opacity: 0;
  filter: drop-shadow(0 4px 4px rgba(47, 67, 58, .22));
  will-change: transform, opacity;
  transform: translate(-140px, calc(-50% + var(--swarm-y, 0px))) rotate(-8deg) scale(calc(.72 * var(--swarm-size, 1)));
}
  .animal-parade.is-running .animal-parade-sprite {
    animation: animal-parade-cross var(--swarm-duration, 3000ms) calc(var(--swarm-delay, 0ms) - 850ms) cubic-bezier(.22, .72, .24, 1) both;
  }
.animal-parade.is-running .animal-parade-sprite.is-reverse {
  animation-name: animal-parade-cross-reverse;
}
.animal-parade-sprite:nth-child(1) { --swarm-top: 9%; --swarm-delay: 0ms; --swarm-duration: 3000ms; --swarm-y: -4px; --swarm-bob: 10px; --swarm-size: .74; }
.animal-parade-sprite:nth-child(2) { --swarm-top: 18%; --swarm-delay: 180ms; --swarm-duration: 3350ms; --swarm-y: 8px; --swarm-bob: 17px; --swarm-size: .56; }
.animal-parade-sprite:nth-child(3) { --swarm-top: 27%; --swarm-delay: 420ms; --swarm-duration: 2800ms; --swarm-y: -6px; --swarm-bob: 14px; --swarm-size: .82; }
.animal-parade-sprite:nth-child(4) { --swarm-top: 37%; --swarm-delay: 80ms; --swarm-duration: 3600ms; --swarm-y: 12px; --swarm-bob: 22px; --swarm-size: .48; }
.animal-parade-sprite:nth-child(5) { --swarm-top: 45%; --swarm-delay: 620ms; --swarm-duration: 3000ms; --swarm-y: -10px; --swarm-bob: 19px; --swarm-size: .68; }
.animal-parade-sprite:nth-child(6) { --swarm-top: 53%; --swarm-delay: 300ms; --swarm-duration: 3200ms; --swarm-y: 3px; --swarm-bob: 14px; --swarm-size: .6; }
.animal-parade-sprite:nth-child(7) { --swarm-top: 61%; --swarm-delay: 860ms; --swarm-duration: 2700ms; --swarm-y: -6px; --swarm-bob: 16px; --swarm-size: .88; }
.animal-parade-sprite:nth-child(8) { --swarm-top: 69%; --swarm-delay: 140ms; --swarm-duration: 3500ms; --swarm-y: 10px; --swarm-bob: 23px; --swarm-size: .52; }
.animal-parade-sprite:nth-child(9) { --swarm-top: 77%; --swarm-delay: 540ms; --swarm-duration: 3100ms; --swarm-y: -8px; --swarm-bob: 20px; --swarm-size: .64; }
.animal-parade-sprite:nth-child(10) { --swarm-top: 86%; --swarm-delay: 990ms; --swarm-duration: 2600ms; --swarm-y: 4px; --swarm-bob: 13px; --swarm-size: .76; }
.animal-parade-sprite:nth-child(11) { --swarm-top: 13%; --swarm-delay: 760ms; --swarm-duration: 3200ms; --swarm-y: -3px; --swarm-bob: 15px; --swarm-size: .5; }
.animal-parade-sprite:nth-child(12) { --swarm-top: 23%; --swarm-delay: 250ms; --swarm-duration: 3450ms; --swarm-y: 7px; --swarm-bob: 24px; --swarm-size: .58; }
.animal-parade-sprite:nth-child(13) { --swarm-top: 33%; --swarm-delay: 1060ms; --swarm-duration: 2750ms; --swarm-y: -9px; --swarm-bob: 12px; --swarm-size: .7; }
.animal-parade-sprite:nth-child(14) { --swarm-top: 42%; --swarm-delay: 480ms; --swarm-duration: 3650ms; --swarm-y: 5px; --swarm-bob: 26px; --swarm-size: .46; }
.animal-parade-sprite:nth-child(15) { --swarm-top: 50%; --swarm-delay: 1250ms; --swarm-duration: 3000ms; --swarm-y: -4px; --swarm-bob: 18px; --swarm-size: .66; }
.animal-parade-sprite:nth-child(16) { --swarm-top: 58%; --swarm-delay: 680ms; --swarm-duration: 3350ms; --swarm-y: 9px; --swarm-bob: 20px; --swarm-size: .54; }
.animal-parade-sprite:nth-child(17) { --swarm-top: 66%; --swarm-delay: 110ms; --swarm-duration: 2900ms; --swarm-y: -7px; --swarm-bob: 13px; --swarm-size: .72; }
.animal-parade-sprite:nth-child(18) { --swarm-top: 74%; --swarm-delay: 900ms; --swarm-duration: 3500ms; --swarm-y: 5px; --swarm-bob: 25px; --swarm-size: .5; }
.animal-parade-sprite:nth-child(19) { --swarm-top: 82%; --swarm-delay: 360ms; --swarm-duration: 2850ms; --swarm-y: -3px; --swarm-bob: 17px; --swarm-size: .8; }
.animal-parade-sprite:nth-child(20) { --swarm-top: 91%; --swarm-delay: 1170ms; --swarm-duration: 3150ms; --swarm-y: 8px; --swarm-bob: 19px; --swarm-size: .56; }
.animal-parade-sprite:nth-child(21) { --swarm-top: 6%; --swarm-delay: 580ms; --swarm-duration: 3600ms; --swarm-y: 4px; --swarm-bob: 13px; --swarm-size: .44; }
.animal-parade-sprite:nth-child(22) { --swarm-top: 31%; --swarm-delay: 1320ms; --swarm-duration: 2750ms; --swarm-y: -10px; --swarm-bob: 22px; --swarm-size: .62; }
.animal-parade-sprite:nth-child(23) { --swarm-top: 70%; --swarm-delay: 720ms; --swarm-duration: 3300ms; --swarm-y: 6px; --swarm-bob: 18px; --swarm-size: .48; }
.animal-parade-sprite:nth-child(24) { --swarm-top: 94%; --swarm-delay: 1520ms; --swarm-duration: 2900ms; --swarm-y: -6px; --swarm-bob: 15px; --swarm-size: .7; }
@keyframes animal-parade-cross {
  0% { opacity: 0; transform: translate(-140px, calc(-50% + var(--swarm-y, 0px))) rotate(-12deg) scale(calc(.72 * var(--swarm-size, 1))); }
  10% { opacity: .86; }
  25% { transform: translate(22vw, calc(-50% + var(--swarm-y, 0px) - var(--swarm-bob, 0px))) rotate(8deg) scale(var(--swarm-size, 1)); }
  46% { transform: translate(46vw, calc(-50% + var(--swarm-y, 0px) + var(--swarm-bob, 0px))) rotate(-6deg) scale(calc(1.08 * var(--swarm-size, 1))); }
  68% { transform: translate(68vw, calc(-50% + var(--swarm-y, 0px) - var(--swarm-bob, 0px))) rotate(7deg) scale(var(--swarm-size, 1)); }
  90% { opacity: .86; transform: translate(90vw, calc(-50% + var(--swarm-y, 0px) + var(--swarm-bob, 0px))) rotate(-4deg) scale(calc(.96 * var(--swarm-size, 1))); }
  100% { opacity: 0; transform: translate(calc(100vw + 140px), calc(-50% + var(--swarm-y, 0px))) rotate(12deg) scale(calc(.78 * var(--swarm-size, 1))); }
}
@keyframes animal-parade-cross-reverse {
  0% { opacity: 0; transform: translate(140px, calc(-50% + var(--swarm-y, 0px))) rotate(12deg) scale(calc(.72 * var(--swarm-size, 1))); }
  10% { opacity: .86; }
  25% { transform: translate(-22vw, calc(-50% + var(--swarm-y, 0px) + var(--swarm-bob, 0px))) rotate(-8deg) scale(var(--swarm-size, 1)); }
  46% { transform: translate(-46vw, calc(-50% + var(--swarm-y, 0px) - var(--swarm-bob, 0px))) rotate(6deg) scale(calc(1.08 * var(--swarm-size, 1))); }
  68% { transform: translate(-68vw, calc(-50% + var(--swarm-y, 0px) + var(--swarm-bob, 0px))) rotate(-7deg) scale(var(--swarm-size, 1)); }
  90% { opacity: .86; transform: translate(-90vw, calc(-50% + var(--swarm-y, 0px) - var(--swarm-bob, 0px))) rotate(4deg) scale(calc(.96 * var(--swarm-size, 1))); }
  100% { opacity: 0; transform: translate(calc(-100vw - 140px), calc(-50% + var(--swarm-y, 0px))) rotate(-12deg) scale(calc(.78 * var(--swarm-size, 1))); }
}
@keyframes animal-parade-spark {
  0% { opacity: 0; transform: translate(-18vw, -50%) scale(.5) rotate(-20deg); }
  18% { opacity: .9; }
  72% { opacity: .55; transform: translate(58vw, -75%) scale(1.05) rotate(18deg); }
  100% { opacity: 0; transform: translate(106vw, -35%) scale(.7) rotate(42deg); }
}

@media (prefers-reduced-motion: reduce) {
  .animal-parade { display: none !important; }
}

.app-shell[data-motion="off"] .animal-parade { display: none !important; }

noscript { position: fixed; inset: 20px; z-index: 9999; padding: 30px; background: white; }

@keyframes tap-pulse {
  0%, 100% { opacity: .25; transform: scale(.88); transform-origin: center; }
  50% { opacity: .72; transform: scale(1.08); transform-origin: center; }
}
.tap-ring { animation: tap-pulse 1.2s ease-in-out infinite; }

@media (max-width: 760px) {
  .app-shell { padding: 6px; gap: 6px; }
  .topbar { min-height: 54px; padding: 4px 6px; border-radius: 17px; }
  .brand-lockup img { width: 43px; height: 40px; padding: 3px; }
  .brand-kicker { display: none; }
  .topbar h1 { max-width: 126px; font-size: 15px; white-space: normal; }
  .safari-score { padding: 3px 7px; gap: 4px; font-size: 13px; }
  .score-stars { padding-left: 4px; }
  .icon-button { width: 44px; padding: 0; }
  .settings-word { display: none; }

  .lesson-strip { min-height: 50px; padding: 3px 5px; grid-template-columns: auto minmax(0,1fr) auto; gap: 4px; border-radius: 15px; }
  .letter-picker { padding: 0; }
  .letter-picker > span { display: none; }
  .letter-picker select { min-width: 68px; width: 68px; padding-left: 8px; font-size: 14px; }
  .lesson-steps li { min-height: 44px; gap: 2px; font-size: 9px; }
  .lesson-steps li:not(:last-child)::after { left: calc(50% + 16px); right: calc(-50% + 16px); }
  .lesson-steps b { width: 24px; height: 24px; flex-basis: 24px; font-size: 11px; }
  .lesson-steps li span { display: none; }
  .animal-badge { width: 38px; height: 38px; font-size: 22px; }
  .word-card > span:last-child { display: none; }

  .coach-bar { min-height: 58px; padding: 4px 7px; gap: 7px; }
  .glyph-chip { width: 45px; height: 45px; border-radius: 14px; font-size: 28px; }
  .coach-copy h2 { font-size: 16px; }
  .coach-copy > p:last-child { font-size: 10px; }
  .case-badge { min-height: 36px; padding: 0 7px; font-size: 8px; }

  .board-controls { min-height: 54px; padding: 4px; gap: 4px; grid-template-columns: 104px minmax(0, 1fr) 48px; }
  .practice-picker { gap: 3px; }
  .practice-picker > span { display: none; }
  .practice-picker select { min-width: 104px; width: 104px; padding: 0 18px 0 7px; font-size: 10px; }
  .guide-controls button { padding: 0 3px; font-size: 9px; }
  .guide-controls button span { display: none; }
  .retry-button { width: 48px; padding: 0; }
  .retry-button span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .feedback-toast { bottom: 5px; font-size: 10px; }
}

@media (max-width: 390px) {
  .topbar h1 { max-width: 92px; font-size: 13px; }
  .safari-score > span:first-child { display: none; }
  .case-badge { display: none; }
  .coach-bar { grid-template-columns: auto minmax(0, 1fr); }
  .mini-route span { min-width: 68px; }
}

@media (max-height: 720px) {
  .app-shell { padding-block: 5px; gap: 5px; }
  .topbar { min-height: 52px; }
  .lesson-strip { min-height: 48px; }
  .coach-bar { min-height: 55px; }
  .board-controls { min-height: 52px; }
  .dialog-art { height: 58px; font-size: 43px; }
  .safari-dialog { padding-block: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

.app-shell[data-motion="off"] *,
.app-shell[data-motion="off"] *::before,
.app-shell[data-motion="off"] *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
}

@media (forced-colors: active) {
  .guide-path,
  .model-path,
  .child-ink,
  .rule,
  .start-disc,
  .stop-disc { forced-color-adjust: auto; }
  .guide-controls button.is-selected { outline: 3px solid ButtonText; outline-offset: -4px; }
}
