/* Learning Garden: tablet-first, big targets, calm colors. Material colors
   follow the Casa conventions (blue vowels, red consonants, golden beads,
   green/blue/red place values, grammar symbol colors). */

:root {
  --paper: #f6f1e4;
  --card: #fffdf7;
  --ink: #2b2a26;
  --muted: #6b665a;
  --line: #ddd3bc;
  --green: #2f5d3a;
  --green-soft: #dcebd9;
  --gold: #e3a92b;
  --gold-dark: #a8740f;
  --vowel: #1f5fbf;
  --consonant: #c62828;
  --team: #2e7d32;
  --right: #2e7d32;
  --right-soft: #e1f2df;
  --try: #a35c00;
  --try-soft: #fdf0d9;
  --units: #2e8b3e;
  --tens: #1f5fbf;
  --hundreds: #c62828;
  --thousands: #2e8b3e;
  --radius: 18px;
  --tap: 64px;
  --font:
    ui-rounded, "SF Pro Rounded", "Avenir Next", "Segoe UI", system-ui,
    sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom)
    env(safe-area-inset-left);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.4;
  background: var(--paper);
  overscroll-behavior-y: none;
}

button,
select,
input {
  font: inherit;
  color: inherit;
}

button {
  touch-action: manipulation;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

button:disabled {
  cursor: default;
}

:focus-visible {
  outline: 4px solid var(--vowel);
  outline-offset: 3px;
}

h1:focus,
h2:focus {
  outline: none;
}

/* Site tool header ------------------------------------------------------- */

.tool-header {
  position: sticky;
  z-index: 50;
  top: 0;
  padding-top: env(safe-area-inset-top);
  background: var(--green);
}

.tool-nav {
  display: flex;
  gap: 16px;
  align-items: center;
  width: 100%;
  padding: 12px 16px;
}

.tool-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.tool-nav__link:hover {
  text-decoration: underline;
}

/* Added to the Home Screen, it's a full-screen app with no way off-site. */
@media (display-mode: standalone) {
  .tool-header {
    display: none;
  }

  body {
    padding-top: env(safe-area-inset-top);
  }
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 20px 40px;
}

.note {
  color: var(--muted);
  font-size: 0.95rem;
}

.emoji {
  font-family:
    "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-style: normal;
  line-height: 1;
}

/* Shared buttons ---------------------------------------------------------- */

.primary,
.secondary {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  min-height: var(--tap);
  padding: 0 28px;
  font-size: 1.3rem;
  font-weight: 700;
  border: 0;
  border-radius: 999px;
}

.primary {
  color: #fff;
  background: var(--green);
  box-shadow: 0 4px 0 #1d3d25;
}

.primary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #1d3d25;
}

.primary:disabled {
  opacity: 0.45;
}

.secondary {
  color: var(--green);
  background: var(--card);
  border: 2px solid var(--green);
}

.secondary--quiet {
  min-width: 0;
  min-height: 52px;
  color: var(--muted);
  font-size: 1rem;
  border-color: var(--line);
}

.gate {
  max-width: 460px;
  margin: 40px auto;
}

.gate input {
  max-width: 160px;
  font-size: 1.6rem;
}

.sound-note {
  text-align: center;
}

.secondary--small {
  align-self: flex-start;
  min-width: 0;
  min-height: 48px;
  margin-top: 6px;
  font-size: 1rem;
}

.icon-button {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  font-size: 1.8rem;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 50%;
}

.icon-button:active {
  background: var(--green-soft);
}

.hold {
  position: relative;
  touch-action: none;
  min-height: 56px;
  padding: 0 24px;
  overflow: hidden;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
  background: var(--card);
  border: 2px dashed var(--line);
  border-radius: 999px;
}

.hold__fill {
  position: absolute;
  inset: 0;
  background: var(--green-soft);
  transform: scaleX(0);
  transform-origin: left;
}

.hold--active .hold__fill {
  transform: scaleX(1);
  transition: transform var(--hold-duration, 1600ms) linear;
}

.hold__label {
  position: relative;
}

.hold--danger {
  color: var(--consonant);
}

/* Home -------------------------------------------------------------------- */

.home__hello {
  margin-bottom: 8px;
  text-align: center;
}

.home__title {
  margin: 8px 0 4px;
  color: var(--green);
  font-size: clamp(2rem, 6vw, 3rem);
}

.home__greeting {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin: 0 0 12px;
  font-size: 1.35rem;
}

.areas {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
}

.area {
  margin: 14px 0;
}

.area--language,
.area--math {
  grid-column: 1 / -1;
}

.area--language .tiles,
.area--math .tiles {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .area--language .tiles,
  .area--math .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.area--world .tiles,
.area--peace .tiles {
  grid-template-columns: minmax(0, 1fr);
}

.area__title {
  margin: 0 0 10px;
  font-size: 1.4rem;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  padding: 16px;
  font-size: 1.3rem;
  font-weight: 700;
  background: var(--card);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 4px 0 var(--line);
}

.tile:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--line);
}

.area--language .tile {
  border-color: #b9cdea;
  box-shadow: 0 4px 0 #b9cdea;
}

.area--math .tile {
  border-color: #ecd096;
  box-shadow: 0 4px 0 #ecd096;
}

.area--world .tile {
  border-color: #b7d8b2;
  box-shadow: 0 4px 0 #b7d8b2;
}

.area--peace .tile {
  border-color: #f0c2b8;
  box-shadow: 0 4px 0 #f0c2b8;
}

.tile__emoji {
  font-size: 3.4rem;
}

.home__grownups {
  margin-top: 36px;
  text-align: center;
}

/* Play frame -------------------------------------------------------------- */

.play__bar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.play__title {
  flex: 1;
  margin: 0;
  font-size: clamp(1.3rem, 4vw, 1.8rem);
}

.dots {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dots__dot {
  width: 16px;
  height: 16px;
  border: 2px solid var(--green);
  border-radius: 50%;
}

.dots__dot--done {
  background: var(--green);
}

.dots__dot--now {
  box-shadow: 0 0 0 4px var(--green-soft);
}

.stage {
  min-height: 360px;
  padding: 20px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
}

.feedback {
  min-height: 3.6em;
  margin: 14px 0 6px;
  padding: 12px 18px;
  font-size: 1.25rem;
  text-align: center;
  border-radius: var(--radius);
}

.feedback__text {
  margin: 0;
}

.feedback[data-tone="good"] {
  color: #1d4d21;
  background: var(--right-soft);
}

.feedback[data-tone="try"] {
  color: #6b3c00;
  background: var(--try-soft);
}

.play__actions {
  display: flex;
  justify-content: center;
  min-height: var(--tap);
}

.hint-text {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1rem;
  text-align: center;
}

/* Pictures and choices ---------------------------------------------------- */

.picture {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto 16px;
  padding: 12px 28px;
  background: none;
  border: 0;
  border-radius: var(--radius);
}

.picture:active {
  background: var(--green-soft);
}

.picture__emoji {
  font-size: clamp(5rem, 16vw, 8rem);
}

.picture__name {
  margin-top: 6px;
  font-size: 1.6rem;
  font-weight: 700;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
}

.choice {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  min-height: 150px;
  padding: 12px;
  font-size: 1.15rem;
  font-weight: 700;
  background: #fff;
  border: 3px solid var(--line);
  border-radius: var(--radius);
}

.choice__emoji {
  font-size: 4.5rem;
}

.choice--wide {
  flex-direction: row;
  gap: 14px;
  min-width: 260px;
  min-height: 96px;
  font-size: 1.25rem;
}

.choice--wide .choice__emoji {
  font-size: 2.6rem;
}

.choice--number {
  min-width: 140px;
  min-height: 100px;
  font-size: 2.2rem;
}

.choice--picked {
  background: var(--green-soft);
  border-color: var(--green);
}

.choice--right {
  background: var(--right-soft);
  border-color: var(--right);
  box-shadow: 0 0 0 4px var(--right);
}

.choice--wrong {
  opacity: 0.4;
}

/* Word Builder ------------------------------------------------------------ */

.letter {
  min-width: 76px;
  height: 84px;
  padding: 0 10px;
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 3px 0 var(--line);
}

.letter:disabled {
  opacity: 0.2;
}

.letter--vowel {
  color: var(--vowel);
}

.letter--consonant {
  color: var(--consonant);
}

.letter--team {
  color: var(--team);
}

.slots {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 24px;
}

.slot {
  min-width: 84px;
  height: 96px;
  font-size: 3rem;
  background: var(--paper);
  border: 3px dashed var(--line);
  border-radius: 14px;
}

.slot.letter {
  border-style: solid;
}

.slot--ghost {
  color: #c9bfa7;
}

.slot--wrong {
  border-color: var(--try);
  animation: wiggle 0.4s ease-in-out 2;
}

.slots--correct .slot {
  background: var(--right-soft);
  border-color: var(--right);
}

.tray {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

@keyframes wiggle {
  25% {
    transform: rotate(-4deg);
  }

  75% {
    transform: rotate(4deg);
  }
}

/* Read & Match ------------------------------------------------------------ */

.read-word {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: 8px 0 0;
  font-size: clamp(3.5rem, 12vw, 5.5rem);
  font-weight: 700;
  line-height: 1.1;
}

.sound {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 4px;
  border-radius: 12px;
  transition: background 0.2s;
}

.sound--lit {
  background: #fff2c2;
}

.sound__mark {
  display: block;
  height: 14px;
  margin-top: 6px;
}

.sound--dot .sound__mark {
  width: 14px;
  background: var(--ink);
  border-radius: 50%;
}

.sound--bar .sound__mark {
  width: 80%;
  background: var(--ink);
  border-radius: 7px;
}

.sound--magic .sound__letters {
  color: var(--muted);
}

.sound--magic .sound__mark {
  width: 14px;
  background: none;
  border: 3px solid var(--muted);
  border-radius: 50%;
}

.read-match .choices {
  margin-top: 20px;
}

/* Grammar Symbols --------------------------------------------------------- */

.gsym {
  display: inline-block;
  flex: none;
}

.gsym--noun {
  width: 46px;
  height: 40px;
  background: #111;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.gsym--article {
  width: 26px;
  height: 23px;
  background: #7fb6dc;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.gsym--adjective {
  width: 36px;
  height: 31px;
  background: #1f3a93;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.gsym--verb {
  width: 42px;
  height: 42px;
  background: #d42a2a;
  border-radius: 50%;
}

.palette {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}

.palette__button {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: var(--tap);
  padding: 8px 18px;
  font-size: 1.1rem;
  font-weight: 700;
  background: #fff;
  border: 3px solid var(--line);
  border-radius: 999px;
}

.palette__button--on {
  background: #fff8db;
  border-color: var(--gold-dark);
}

.sentence {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.sentence__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: var(--tap);
  padding: 6px 12px 10px;
  background: none;
  border: 3px solid transparent;
  border-radius: 14px;
}

.sentence__item:active {
  background: var(--paper);
}

.sentence__item--wrong {
  border-color: var(--try);
  border-style: dashed;
}

.sentence__symbol {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 48px;
}

.sentence__word {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 700;
}

.grammar__actions,
.beads__actions {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

/* Golden Beads ------------------------------------------------------------ */

.beads__target {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  margin: 0 0 18px;
  font-size: 1.5rem;
  font-weight: 700;
}

.numeral {
  display: inline-flex;
  padding: 2px 18px;
  font-size: clamp(3rem, 10vw, 4.5rem);
  font-variant-numeric: tabular-nums;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 12px;
}

.numeral__digit--units {
  color: var(--units);
}

.numeral__digit--tens {
  color: var(--tens);
}

.numeral__digit--hundreds {
  color: var(--hundreds);
}

.numeral__digit--thousands {
  color: var(--thousands);
}

.bead-tray {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 12px;
}

.bead-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 6px;
  background: var(--paper);
  border: 3px solid transparent;
  border-radius: 14px;
}

.bead-column--look {
  border-color: var(--try);
}

.bead-column__label {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
}

.bead-column__count {
  margin: 8px 0;
  font-size: 2rem;
  font-weight: 700;
}

.bead-column__count--hidden {
  visibility: hidden;
}

.pile {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  place-content: flex-end center;
  width: 100%;
  min-height: 160px;
}

.pile--units {
  max-width: 76px;
}

.pile--hundreds,
.pile--thousands {
  flex-flow: column-reverse nowrap;
  gap: 0;
  align-items: center;
  justify-content: flex-start;
}

.bead {
  --bead: 14px;

  display: block;
  flex: none;
  background-image: radial-gradient(
    circle at 40% 35%,
    #ffe9a8 0,
    var(--gold) 45%,
    var(--gold-dark) 70%,
    transparent 72%
  );
  background-size: var(--bead) var(--bead);
}

.bead--unit {
  width: var(--bead);
  height: var(--bead);
}

.bead--ten {
  width: var(--bead);
  height: calc(var(--bead) * 10);
  border-radius: 7px;
}

.bead--hundred,
.bead--thousand {
  --bead: 7px;

  width: calc(var(--bead) * 10);
  height: calc(var(--bead) * 10);
  margin-top: -54px;
  border: 1px solid var(--gold-dark);
  border-radius: 3px;
}

.bead--hundred:last-child,
.bead--thousand:last-child {
  margin-top: 0;
}

.bead--thousand {
  box-shadow:
    4px -4px 0 var(--gold-dark),
    8px -8px 0 #c98f1d;
}

.stepper {
  display: flex;
  gap: 8px;
}

.stepper__button {
  width: var(--tap);
  height: var(--tap);
  font-size: 2rem;
  font-weight: 700;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 50%;
}

.stepper__button:disabled {
  opacity: 0.35;
}

.exchange {
  min-width: 0;
  min-height: 52px;
  margin-top: 10px;
  padding: 0 16px;
  font-size: 1rem;
}

.bead-tray--read {
  margin-bottom: 20px;
}

/* Make Ten ---------------------------------------------------------------- */

.bars {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: center;
  min-height: 64px;
}

.bars__plus {
  font-size: 2.4rem;
  font-weight: 700;
}

.bar {
  display: inline-flex;
  gap: 3px;
  padding: 5px 8px;
  background: #e9e1cc;
  border-radius: 999px;
}

.bar__bead {
  width: 44px;
  height: 44px;
  background: var(--bead-color);
  background: radial-gradient(
    circle at 35% 30%,
    rgb(255 255 255 / 75%) 0,
    var(--bead-color) 38%,
    color-mix(in srgb, var(--bead-color) 70%, #000) 100%
  );
  border: 1px solid rgb(0 0 0 / 25%);
  border-radius: 50%;
}

.bar__bead--empty {
  background: transparent;
  border: 3px dashed #b9ad90;
}

.bar__bead--moved {
  animation: pop 0.35s ease-out both;
}

.bar__bead--gone {
  opacity: 0.15;
}

.bar__bead--count {
  outline: 4px solid var(--gold-dark);
  outline-offset: 2px;
}

.keypad__button .bar {
  gap: 1px;
  padding: 2px 3px;
}

.keypad__button .bar__bead {
  width: 7px;
  height: 7px;
  border: 0;
}

.equation {
  margin: 20px 0;
  font-size: clamp(2.4rem, 8vw, 3.5rem);
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 96px));
  gap: 12px;
  justify-content: center;
}

.keypad--8 {
  grid-template-columns: repeat(4, minmax(0, 110px));
}

.keypad__button {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  min-height: 88px;
  font-size: 2rem;
  font-weight: 700;
  background: #fff;
  border: 3px solid var(--line);
  border-radius: 16px;
}

.keypad__button.choice--wrong {
  opacity: 0.35;
}

/* Nature Sort ------------------------------------------------------------- */

.picture--card {
  min-width: 220px;
  background: #fff;
  border: 3px solid var(--line);
}

.nature__question {
  margin: 0 0 16px;
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
}

.bins {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.bin {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
  min-height: 130px;
  padding: 12px;
  font-size: 1.25rem;
  font-weight: 700;
  background: #fff;
  border: 3px solid var(--line);
  border-radius: var(--radius);
}

.bin__emoji {
  font-size: 3rem;
}

.bin:not(:has(.bin__emoji)) {
  font-size: 1.6rem;
}

/* Number Path ------------------------------------------------------------- */

.path-setup {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
}

.path-setup__title {
  margin: 8px 0 0;
  font-size: 1.4rem;
}

.track-scroller {
  overflow-x: auto;
  padding: 8px 4px 16px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.track {
  display: flex;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.track > li {
  display: flex;
  flex: 1 1 0;
  min-width: 40px;
}

.track > .track__square--start {
  flex: 0 0 72px;
}

.track__square {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  height: 132px;
  padding: 8px 0;
  background: #fff;
  border: 2px solid var(--ink);
  border-left-width: 0;
}

.track > li:nth-child(odd) .track__square {
  background: #fff8e3;
}

.track__square--start {
  display: flex;
  flex: 0 0 72px;
  width: 72px;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 132px;
  padding: 8px 4px;
  background: var(--green-soft);
  border: 2px solid var(--ink);
  border-radius: 14px 0 0 14px;
}

.track > li:last-child .track__square {
  background: #ffe9a8;
  border-radius: 0 14px 14px 0;
}

.track__square--next {
  outline: 4px solid var(--gold-dark);
  outline-offset: -6px;
}

.track__number {
  font-size: 1.6rem;
  font-weight: 700;
}

.track__square--start .track__number {
  font-size: 1rem;
}

.track__tokens {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 64px;
  font-size: 1.7rem;
  line-height: 1;
}

.path__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
}

.path__turn {
  min-width: 200px;
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
}

.spinner {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  font-size: 3rem;
  font-weight: 700;
  background: #fff;
  border: 4px solid var(--gold);
  border-radius: 50%;
}

/* Feelings ---------------------------------------------------------------- */

.feelings {
  text-align: center;
}

.scene {
  margin: 0;
  font-size: 5rem;
}

.story {
  max-width: 640px;
  margin: 8px auto 16px;
  font-size: 1.45rem;
}

.feelings__question {
  margin: 8px 0 14px;
  font-size: 1.4rem;
}

.faces {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 150px));
  gap: 12px;
  justify-content: center;
}

.face {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  min-height: 116px;
  font-size: 1.05rem;
  font-weight: 700;
  background: #fff;
  border: 3px solid var(--line);
  border-radius: var(--radius);
}

.face__emoji {
  font-size: 3.2rem;
}

.say-this {
  display: inline-block;
  padding: 14px 22px;
  font-size: 1.6rem;
  font-weight: 700;
  background: #fff8db;
  border-radius: var(--radius);
}

.balloon {
  margin: 20px auto;
  font-size: 5rem;
  transform: scale(0.8);
  transition: transform 4s ease-in-out;
}

.balloon--in {
  transform: scale(1.9);
}

.balloon--still {
  transition: opacity 1s;
  transform: none;
  opacity: 0.55;
}

.balloon--still.balloon--in {
  transform: none;
  opacity: 1;
}

/* Free work ------------------------------------------------------------- */

.slots--free {
  flex-wrap: wrap;
  min-height: 96px;
}

.slots__placeholder {
  align-self: center;
  color: var(--muted);
  font-size: 1.2rem;
}

.free-writing__actions,
.bank__header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.tray--alphabet .letter,
.tray--teams .letter {
  min-width: 62px;
  height: 66px;
  font-size: 2.1rem;
}

.tray--teams {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px dashed var(--line);
}

.bank__total {
  margin: 0;
}

.tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.tokens__button {
  width: 76px;
  height: 76px;
  background: #fff;
  border: 3px solid var(--line);
  border-radius: 50%;
}

.tokens__button--picked {
  background: var(--green-soft);
  border-color: var(--green);
}

.tokens__emoji {
  font-size: 2.4rem;
}

/* Your work ------------------------------------------------------------- */

.work {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 16px 0;
  padding: 0;
  list-style: none;
}

.work__piece {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 52px;
  padding: 8px 16px;
  font-size: 1.3rem;
  font-weight: 700;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 14px;
  animation: pop 0.4s ease-out both;
}

.work__piece--button {
  color: var(--ink);
}

.work__emoji {
  font-size: 1.8rem;
}

.work--inline .work__piece {
  font-size: 1.1rem;
}

/* Gentle movement: a little pop when something fits, a hop on the path. */

@keyframes pop {
  0% {
    transform: scale(0.85);
  }

  60% {
    transform: scale(1.08);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes hop {
  0%,
  100% {
    transform: translateY(0);
  }

  45% {
    transform: translateY(-18px);
  }
}

.choice--right,
.slots--correct .slot {
  animation: pop 0.35s ease-out both;
}

.token--hop {
  display: inline-block;
  animation: hop 0.35s ease-out;
}

/* Set done ---------------------------------------------------------------- */

.done {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.done__emoji {
  margin: 12px 0 0;
  font-size: 5rem;
}

.done h1 {
  margin: 4px 0;
  color: var(--green);
  font-size: clamp(1.8rem, 5vw, 2.4rem);
}

.done__say {
  font-size: 1.35rem;
}

.together {
  margin: 20px 0;
  padding: 16px 20px;
  font-size: 1rem;
  text-align: left;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
}

.together h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.done__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

/* Grown-ups --------------------------------------------------------------- */

.grownups {
  max-width: 820px;
  margin: 0 auto;
  font-size: 1rem;
}

.panel {
  margin: 16px 0;
  padding: 16px 20px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
}

.panel h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.panel li {
  margin-bottom: 6px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 12px 0;
}

.field--inline {
  flex-direction: row;
  gap: 10px;
  align-items: center;
}

.field input[type="text"],
.field select {
  min-height: 48px;
  padding: 8px 12px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 10px;
}

.field input[type="checkbox"] {
  width: 28px;
  height: 28px;
  accent-color: var(--green);
}

.activity-card {
  margin: 10px 0;
  padding: 0 14px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 14px;
}

.activity-card summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  min-height: 56px;
  cursor: pointer;
}

.activity-card__meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.topics h3 {
  margin: 12px 0 6px;
  font-size: 1rem;
}

.topic__check {
  display: block;
  color: var(--muted);
}

.research {
  padding-left: 20px;
}

.research li {
  margin-bottom: 14px;
}

.research p {
  margin: 2px 0;
}

.credits {
  margin: 24px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.credits a,
.research a {
  color: var(--green);
}

/* Smaller screens and portrait phones ------------------------------------ */

@media (max-width: 640px) {
  :root {
    --tap: 56px;
  }

  .areas {
    grid-template-columns: minmax(0, 1fr);
  }

  .area--language .tiles,
  .area--math .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .container {
    padding: 12px 12px 32px;
  }

  .stage {
    padding: 14px 10px;
  }

  .letter {
    min-width: 60px;
    height: 70px;
    font-size: 2.2rem;
  }

  .slot {
    min-width: 64px;
    height: 76px;
    font-size: 2.4rem;
  }

  .choice {
    min-width: 100px;
    min-height: 110px;
  }

  .choice__emoji {
    font-size: 3.2rem;
  }

  .bar__bead {
    width: 30px;
    height: 30px;
  }

  .faces {
    grid-template-columns: repeat(2, minmax(0, 160px));
  }

  .dots {
    display: none;
  }

  .bead-tray {
    gap: 6px;
  }
}

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

  .balloon {
    transition: opacity 1s;
  }
}
