/* =============================================================================
   COMPONENTS
   Every interactive target is at least var(--tap-min) tall.
   ============================================================================= */

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: var(--tap-min);
  padding: var(--s-3) var(--s-5);
  border: var(--border-w) solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface-raised);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--t-md);
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sticker);
  transition: transform var(--dur-fast) var(--ease-bounce),
              box-shadow var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
/* Pressing physically pushes the button onto the page — the single cheapest
   bit of tactility, and children notice it immediately. */
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 rgba(107,79,52,.28); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
/* A link dressed as a button is a button: no browser underline. */
a.btn { text-decoration: none; }

.btn--primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn--accent  { background: var(--accent);  color: #fff;               border-color: var(--accent); }
.btn--ghost   { background: transparent; border-color: var(--line); box-shadow: none; }
.btn--big     { min-height: 72px; font-size: var(--t-lg); padding: var(--s-4) var(--s-7); }
.btn--icon    { min-width: var(--tap-min); padding: var(--s-3); border-radius: var(--r-md); }
.btn--block   { width: 100%; }

/* --- cards ---------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: var(--border-w) solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  box-shadow: var(--shadow-soft);
}
.card--flat { box-shadow: none; }

.panel {
  background: var(--surface-sunken);
  border-radius: var(--r-md);
  padding: var(--s-4);
}

/* --- the four skills ------------------------------------------------------ */

.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--s-4);
}

.skill-card {
  --tint: var(--skill-reading);
  --tint-soft: var(--skill-reading-soft);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  min-height: 150px;
  padding: var(--s-4);
  border: var(--border-w) solid var(--tint);
  border-radius: var(--r-lg);
  background: var(--tint-soft);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sticker);
  transition: transform var(--dur-fast) var(--ease-bounce);
}
.skill-card:hover { transform: translateY(-3px) rotate(-0.6deg); }
.skill-card[data-skill='speaking']  { --tint: var(--skill-speaking);  --tint-soft: var(--skill-speaking-soft); }
.skill-card[data-skill='listening'] { --tint: var(--skill-listening); --tint-soft: var(--skill-listening-soft); }
.skill-card[data-skill='reading']   { --tint: var(--skill-reading);   --tint-soft: var(--skill-reading-soft); }
.skill-card[data-skill='writing']   { --tint: var(--skill-writing);   --tint-soft: var(--skill-writing-soft); }

.skill-card__icon { font-size: 2.4rem; line-height: 1; }
.skill-card__name { font-family: var(--font-display); font-size: var(--t-lg); font-weight: 700; }

/* --- progress ------------------------------------------------------------- */

.bar {
  height: 14px;
  border-radius: var(--r-pill);
  background: var(--surface-sunken);
  border: 2px solid var(--line);
  overflow: hidden;
}
.bar__fill {
  height: 100%;
  background: var(--tint, var(--primary));
  border-radius: var(--r-pill);
  transition: width var(--dur-slow) var(--ease-out);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: var(--s-1) var(--s-3);
  border-radius: var(--r-pill);
  background: var(--surface-sunken);
  border: 2px solid var(--line);
  font-size: var(--t-sm);
  font-weight: 600;
}
/* Chips in the top bar are links; they should look like chips, not like
   blue underlined browser links. */
a.chip { color: var(--ink); text-decoration: none; }
a.chip:hover { border-color: var(--primary); }
.chip--level { background: var(--sun-100); border-color: var(--sun-400); color: var(--bark-900); }

/* --- option tiles (the workhorse of every exercise) ----------------------- */

.options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--s-3);
}
.options--wide { grid-template-columns: 1fr; }

.option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  flex-direction: column;
  min-height: 96px;
  padding: var(--s-4);
  border: var(--border-w) solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface-raised);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--t-lg);
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sticker);
  transition: transform var(--dur-fast) var(--ease-bounce),
              border-color var(--dur-fast), background-color var(--dur-fast);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.option:hover:not(:disabled) { transform: translateY(-2px); }
.option__emoji { font-size: 3rem; line-height: 1; }

.option[aria-pressed='true'] {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(1px);
}
/* Marking states are colour AND a glyph AND a label — never colour alone. */
.option[data-state='correct'] { border-color: var(--correct); background: var(--correct-soft); }
.option[data-state='notyet']  { border-color: var(--notyet);  background: var(--notyet-soft); }
.option[data-state='answer']  { border-color: var(--correct); border-style: dashed; }
.option__mark { font-size: var(--t-lg); }

/* --- feedback ------------------------------------------------------------- */

.feedback {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-lg);
  border: var(--border-w) solid var(--line);
  background: var(--surface-raised);
}
.feedback--celebrate { border-color: var(--correct); background: var(--correct-soft); }
.feedback--encourage { border-color: var(--notyet);  background: var(--notyet-soft); }
.feedback__art { font-size: 2.6rem; line-height: 1; flex-shrink: 0; }
.feedback__title { font-family: var(--font-display); font-size: var(--t-lg); font-weight: 700; margin: 0; }

/* --- the reading passage -------------------------------------------------- */

.passage {
  font-family: var(--font-reading);
  font-size: var(--t-lg);
  line-height: 1.95;
  background: var(--surface-raised);
  border: var(--border-w) solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}
.passage p { margin: 0 0 var(--s-2); }

/* --- the article / fill-in-the-blank -------------------------------------- */

.article {
  font-family: var(--font-reading);
  font-size: var(--t-lg);
  line-height: 2.4;
  background: var(--surface-raised);
  border: var(--border-w) solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}

.blank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  min-height: 44px;
  margin: 0 4px;
  padding: 0 var(--s-3);
  border: none;
  border-bottom: 3px solid var(--line-strong);
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  background: var(--surface-sunken);
  font-family: var(--font-display);
  font-size: var(--t-md);
  font-weight: 700;
  color: var(--ink-faint);
  cursor: pointer;
  vertical-align: middle;
  transition: background-color var(--dur-fast), border-color var(--dur-fast);
}
.blank:hover { background: var(--primary-soft); }
.blank[data-filled='true'] { color: var(--ink); background: var(--primary-soft); border-bottom-color: var(--primary); }
.blank[aria-expanded='true'] { background: var(--accent-soft); border-bottom-color: var(--accent); }
.blank[data-state='correct'] { background: var(--correct-soft); border-bottom-color: var(--correct); color: var(--ink); }
.blank[data-state='notyet']  { background: var(--notyet-soft);  border-bottom-color: var(--notyet);  color: var(--ink); }

/* Choice popover, positioned under the blank the child tapped. */
.blank-choices {
  position: absolute;
  z-index: 40;
  display: grid;
  gap: var(--s-2);
  min-width: 210px;
  padding: var(--s-3);
  background: var(--surface-raised);
  border: var(--border-w) solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-soft);
}
.blank-choices button {
  min-height: 48px;
  padding: var(--s-2) var(--s-4);
  border: 2px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-family: var(--font-display);
  font-size: var(--t-md);
  font-weight: 700;
  cursor: pointer;
}
.blank-choices button:hover { background: var(--primary-soft); border-color: var(--primary); }

/* --- matching ------------------------------------------------------------- */

.match {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
}
.match__col { display: grid; gap: var(--s-3); align-content: start; }
.match__head { font-family: var(--font-display); font-weight: 700; color: var(--ink-soft); font-size: var(--t-sm); }

.match__item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 72px;
  padding: var(--s-3);
  border: var(--border-w) solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface-raised);
  font-family: var(--font-display);
  font-size: var(--t-lg);
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sticker);
  transition: transform var(--dur-fast) var(--ease-bounce);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.match__item .option__emoji { font-size: 3.2rem; line-height: 1.1; }
.match__item[aria-pressed='true'] { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.03); }
.match__item[data-linked='true']  { border-color: var(--primary); background: var(--primary-soft); }
.match__item[data-state='correct'] { border-color: var(--correct); background: var(--correct-soft); }
.match__item[data-state='notyet']  { border-color: var(--notyet);  background: var(--notyet-soft); }
.match__pairnum {
  font-size: var(--t-sm);
  background: var(--primary);
  color: var(--primary-ink);
  border-radius: var(--r-pill);
  padding: 2px 10px;
}

/* --- audio ---------------------------------------------------------------- */

.audio {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4);
  border-radius: var(--r-lg);
  background: var(--skill-listening-soft);
  border: var(--border-w) solid var(--skill-listening);
}
.audio__play {
  width: 84px; height: 84px;
  border-radius: 50%;
  border: var(--border-w) solid var(--skill-listening);
  background: var(--surface-raised);
  font-size: 2.4rem;
  cursor: pointer;
  box-shadow: var(--shadow-sticker);
  flex-shrink: 0;
}
.audio__play:active { transform: translateY(2px); }
.audio__play--small { width: 52px; height: 52px; font-size: 1.5rem; }

/* One sound per question, sitting right above its pictures. */
.listen-q { position: relative; display: flex; justify-content: center; padding-top: var(--s-2); }
.listen-q__play { width: 76px; height: 76px; font-size: 2.1rem; }
.listen-q__play[data-playing='true'] { background: var(--skill-listening-soft); animation: drop-bob 1s var(--ease-out) infinite; }
.listen-q__n {
  position: absolute;
  left: 0;
  top: 0;
  min-width: 34px;
  height: 34px;
  padding: 0 var(--s-2);
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-pill);
  background: var(--skill-listening-soft);
  color: var(--skill-listening);
  font-family: var(--font-display);
  font-weight: 800;
}

/* --- read aloud ------------------------------------------------------------ */

.readaloud__text { font-size: var(--t-xl, 1.6rem); font-weight: 700; line-height: 1.3; margin: 0; }
/* Write it yourself (exercises/writing.js) */
.writing__prompt { font-size: var(--t-lg, 1.25rem); font-weight: 700; line-height: 1.35; }
.writing__art { font-size: 2.4rem; line-height: 1; flex: none; }
.writing__art img { width: 2.6rem; height: 2.6rem; }
.writing__box { width: 100%; box-sizing: border-box; min-height: 9rem; resize: vertical; padding: var(--s-3);
  font: inherit; font-size: var(--t-lg, 1.2rem); line-height: 1.5; border-radius: var(--r-md, 12px);
  border: var(--border-w) solid var(--line-strong); background: var(--surface); color: var(--ink); }
.writing__box:focus { outline: 3px solid var(--primary); outline-offset: 2px; }
.writing [data-state='short'] { color: var(--notyet-ink); }
.readaloud__tools { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.readaloud__rate { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center;
  border-top: 1px dashed var(--line); padding-top: var(--s-2); }
.readaloud__rate .btn[aria-pressed='true'] { border-color: var(--primary); background: var(--primary-soft); }
.readaloud[data-state='correct'] { border-color: var(--correct); }
.readaloud[data-state='notyet'] { border-color: var(--notyet); }

/* --- the record button ---------------------------------------------------- */

.mic {
  width: 128px; height: 128px;
  border-radius: 50%;
  border: 4px solid var(--skill-speaking);
  background: var(--skill-speaking-soft);
  font-size: 3.4rem;
  cursor: pointer;
  box-shadow: var(--shadow-lift);
  transition: transform var(--dur-fast) var(--ease-bounce);
}
.mic[data-recording='true'] { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { transform: scale(1);    box-shadow: 0 0 0 0 color-mix(in srgb, var(--skill-speaking) 45%, transparent); }
  50%      { transform: scale(1.06); box-shadow: 0 0 0 18px transparent; }
}

/* --- sticker burst -------------------------------------------------------- */

.burst {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  overflow: hidden;
}
.burst__bit {
  position: absolute;
  font-size: 2.2rem;
  /* Composited transform+opacity only, so a cheap tablet keeps 60fps. */
  will-change: transform, opacity;
  animation: fly var(--fly-dur, 1100ms) var(--ease-out) forwards;
}
@keyframes fly {
  0%   { transform: translate(0,0) scale(0.2) rotate(0deg); opacity: 0; }
  12%  { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1) rotate(var(--rot)); opacity: 0; }
}

/* --- sticker book --------------------------------------------------------- */

.stickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: var(--s-3); }
.sticker {
  display: flex; flex-direction: column; align-items: center; gap: var(--s-1);
  padding: var(--s-3);
  border: var(--border-w) dashed var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface-raised);
  text-align: center;
}
.sticker__art { font-size: 2.6rem; }
.sticker__name { font-family: var(--font-display); font-weight: 700; font-size: var(--t-sm); }
.sticker__count { font-size: var(--t-xs); color: var(--ink-soft); }

/* --- avatar picker -------------------------------------------------------- */

.avatars { display: flex; gap: var(--s-3); flex-wrap: wrap; }
.avatar-btn {
  width: 84px; height: 84px;
  border-radius: 50%;
  border: var(--border-w) solid var(--line);
  background: var(--surface-raised);
  font-size: 2.4rem;
  cursor: pointer;
}
.avatar-btn[aria-pressed='true'] { border-color: var(--primary); background: var(--primary-soft); }

/* --- type the word ------------------------------------------------------- */

.typing { align-items: center; text-align: center; }
.typing__picture { font-size: 4rem; line-height: 1; }
.typing__input {
  width: min(100%, 16rem);
  min-height: var(--tap-min);
  padding: var(--s-3) var(--s-4);
  border: var(--border-w) solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-raised);
  color: var(--ink);
  font-size: var(--t-lg, 1.4rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
}
.typing__input:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.typing__input[data-state='correct'] { border-color: var(--correct); background: var(--correct-soft); }
.typing__input[data-state='notyet']  { border-color: var(--notyet);  background: var(--notyet-soft); }

/* --- forms ---------------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: var(--s-2); }
.field label { font-weight: 700; font-size: var(--t-sm); }
.field input, .field select {
  min-height: var(--tap-min);
  padding: var(--s-3) var(--s-4);
  border: var(--border-w) solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-raised);
}
.field__hint { font-size: var(--t-xs); color: var(--ink-soft); }
.field__error { font-size: var(--t-sm); color: var(--accent); font-weight: 600; }

/* --- notice --------------------------------------------------------------- */

.notice {
  display: flex; gap: var(--s-3);
  padding: var(--s-4);
  border-radius: var(--r-md);
  border: 2px solid var(--notyet);
  background: var(--notyet-soft);
  font-size: var(--t-sm);
}
.notice--info { border-color: var(--skill-listening); background: var(--skill-listening-soft); }

/* --- video ---------------------------------------------------------------- */

.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s-4); }
.video-card video, .video-card iframe {
  width: 100%; aspect-ratio: 16/9; border: 0;
  border-radius: var(--r-md); background: #000;
}

/* --- small screens -------------------------------------------------------- */

@media (max-width: 560px) {
  :root { --t-2xl: 1.75rem; --t-3xl: 2.1rem; }
  .main { padding: var(--s-4) var(--s-3) var(--s-8); }
  .options { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
  .match { gap: var(--s-2); }
  .card { padding: var(--s-4); }
}

/* --- privacy policy page ---------------------------------------------------- */

.policy { max-width: 780px; margin: 0 auto; line-height: 1.6; }
.policy h1 { margin-bottom: 0; }
.policy h2 { margin-top: var(--s-6, 2rem); font-size: 1.25rem; scroll-margin-top: 90px; }
.policy h3 { margin-top: var(--s-4, 1rem); font-size: 1.05rem; }
.policy ul { padding-left: 1.3em; }
.policy li { margin: 0.35em 0; }
.policy-summary {
  border: var(--border-w) solid var(--line);
  border-radius: var(--r-md);
  background: var(--primary-soft);
  padding: var(--s-3) var(--s-4);
}
.policy-table { width: 100%; border-collapse: collapse; }
.policy-table th, .policy-table td {
  text-align: left;
  vertical-align: top;
  padding: var(--s-2) var(--s-3);
  border-bottom: 1px solid var(--line);
}
.policy-links { display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* --- video cards (click to load) ---------------------------------------------- */

.video-card__frame { position: relative; aspect-ratio: 16 / 9; width: 100%; }
.video-card__frame iframe, .video-card__frame video {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: var(--r-md);
}
.video-card__poster {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  border: var(--border-w) solid var(--line); border-radius: var(--r-md);
  background: var(--primary-soft); cursor: pointer; font: inherit;
}
.video-card__poster--locked { cursor: default; opacity: 0.8; }
.video-card__emoji { font-size: 4rem; }
.video-card__play {
  position: absolute; right: 12px; bottom: 12px; width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: var(--surface-raised); font-size: 1.4rem;
}

/* --- grown-up progress report ------------------------------------------------ */
/* Shared with the admin panel, which is why these live here and not admin.css. */

.admin-grid { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat {
  border: var(--border-w) solid var(--line); border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4); background: var(--surface-raised);
}
.stat__n { font-size: 1.8rem; font-weight: 800; line-height: 1.1; }
.stat__label { font-size: var(--t-sm); color: var(--ink-soft); }

.spark { display: flex; align-items: flex-end; gap: 4px; height: 110px; }
.spark__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.spark__bar { width: 100%; border-radius: var(--r-sm, 6px) var(--r-sm, 6px) 0 0; background: var(--primary); min-height: 4px; }
.spark__bar[data-empty='true'] { background: var(--line); }
.spark__label { font-size: 10px; color: var(--ink-soft); }

/* --- the garden (home) -------------------------------------------------------- */
/* Acorn Grove is about growing — Acorn, Sprout, Sapling, Oak — so home is a
   garden. Each skill is a bed; each lesson a plant that grows from a seed to
   a flower as its activities are done. Colour is never the only signal: every
   stage has its own glyph and every plant a spoken label. */

.garden-page { display: flex; flex-direction: column; gap: var(--s-6); }

/* The gate: who you are, the one next step, today's water, how tall you are. */
.gate {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-5);
  padding: var(--s-5);
  border: var(--border-w) solid var(--line);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--sky-wash) 0%, var(--surface) 62%);
  box-shadow: var(--shadow-soft);
}
@media (min-width: 900px) {
  .gate {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 0.9fr);
    grid-template-areas: 'who next water' 'growth growth growth';
    align-items: center;
  }
  .gate__who   { grid-area: who; }
  .gate__next  { grid-area: next; }
  .gate__water { grid-area: water; }
  .growth      { grid-area: growth; }
}

.gate__who { display: flex; align-items: center; gap: var(--s-4); }
.gate__avatar {
  flex: none;
  width: 84px; height: 84px;
  display: flex; align-items: center; justify-content: center;
  font-size: 3.2rem; line-height: 1;
  border-radius: 50%;
  background: var(--surface-raised);
  border: var(--border-w) solid var(--line);
  box-shadow: var(--shadow-sticker);
}
.gate__hello { margin: 0 0 var(--s-2); font-size: var(--t-2xl); }

.gate__next { display: flex; flex-direction: column; gap: var(--s-2); }
.gate__label {
  margin: 0;
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.gate__title { margin: 0; font-size: var(--t-xl); }

.gate__water {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-4);
  border-radius: var(--r-lg);
  background: var(--surface-raised);
  border: 2px dashed var(--line);
}
.drops { display: flex; gap: var(--s-2); font-size: 2rem; line-height: 1; }
/* An empty drop is a ghost of a full one: the shape says "to come". */
.drop[data-full='false'] { filter: grayscale(1); opacity: 0.3; }

/* How tall you have grown: the level ladder as a row of growth stages. */
.growth {
  list-style: none;
  margin: 0;
  padding: var(--s-3) 0 0;
  display: flex;
  justify-content: space-between;
  gap: var(--s-2);
  border-top: 2px dashed var(--line);
  position: relative;
}
.growth__step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}
.growth__art {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; line-height: 1;
  border-radius: 50%;
  background: var(--surface-sunken);
}
.growth__name { font-family: var(--font-display); font-weight: 700; font-size: var(--t-sm); color: var(--ink-soft); }
.growth__step[data-state='later'] .growth__art { filter: grayscale(1); opacity: 0.45; }
.growth__step[data-state='grown'] .growth__art { background: var(--primary-soft); }
.growth__step[data-state='here'] .growth__art {
  width: 64px; height: 64px;
  font-size: 2.3rem;
  background: var(--sun-100);
  outline: 4px solid var(--sun-400);
  outline-offset: 2px;
}
.growth__step[data-state='here'] .growth__name { color: var(--ink); }

/* The beds. */
.garden {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-5);
}
@media (min-width: 760px) {
  .garden { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.bed {
  --tint: var(--skill-reading);
  --tint-soft: var(--skill-reading-soft);
  display: flex;
  flex-direction: column;
  border: var(--border-w) solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sticker);
}
.bed[data-skill='speaking']  { --tint: var(--skill-speaking);  --tint-soft: var(--skill-speaking-soft); }
.bed[data-skill='listening'] { --tint: var(--skill-listening); --tint-soft: var(--skill-listening-soft); }
.bed[data-skill='reading']   { --tint: var(--skill-reading);   --tint-soft: var(--skill-reading-soft); }
.bed[data-skill='writing']   { --tint: var(--skill-writing);   --tint-soft: var(--skill-writing-soft); }

/* The sign on the bed. A strip of the skill's colour, like a painted post. */
.bed__sign {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--tint-soft);
  border-bottom: 5px solid var(--tint);
}
.bed__icon { font-size: 2rem; line-height: 1; }
.bed__words { flex: 1; min-width: 0; }
.bed__name { margin: 0; font-size: var(--t-lg); }
.bed__count { margin: 0; font-size: var(--t-sm); color: var(--ink-soft); }
.bed__all {
  flex: none;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-pill);
  border: 2px solid var(--line);
  background: var(--surface-raised);
  color: var(--ink);
  font-size: var(--t-sm);
  font-weight: 700;
  text-decoration: none;
}
.bed__all:hover { border-color: var(--tint); }

/* The soil: a speckled bed of earth the plants stand in, drawn from tokens so
   it is warm in daylight and dark loam at night. */
.bed__soil {
  list-style: none;
  margin: 0;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(66px, 1fr));
  gap: var(--s-3) var(--s-2);
  padding: var(--s-4);
  background-color: var(--soil);
  background-image:
    radial-gradient(var(--soil-speck) 1.5px, transparent 1.6px),
    radial-gradient(var(--soil-speck) 1px, transparent 1.1px);
  background-size: 18px 18px, 11px 11px;
  background-position: 0 0, 6px 9px;
}
.bed__soil--empty { display: block; color: var(--ink-soft); font-size: var(--t-sm); }

.plant-spot { display: flex; flex-direction: column; align-items: center; gap: 2px; }

.plant {
  position: relative;
  width: 62px;
  height: 62px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 10px;
  border-radius: var(--r-md);
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-bounce);
  -webkit-tap-highlight-color: transparent;
}
/* The little mound of earth every plant sits in. */
.plant::before {
  content: '';
  position: absolute;
  left: 8px; right: 8px; bottom: 4px;
  height: 14px;
  border-radius: 50% 50% 8px 8px;
  background: var(--soil-mound);
}
.plant__art { position: relative; line-height: 1; font-size: 2.1rem; transform-origin: 50% 100%; }
.plant[data-stage='seed'] .plant__art { font-size: 1.35rem; margin-bottom: 4px; }
.plant[data-stage='sprout'] .plant__art { font-size: 1.8rem; }
.plant[data-stage='flower'] .plant__art { font-size: 2.5rem; }
.plant:hover { transform: translateY(-3px); }
.plant:hover .plant__art { animation: plant-sway 0.7s var(--ease-out); }

/* The plant that wants water: a gentle sway, a drop above it, a ring. */
.plant[data-next='true'] {
  background: color-mix(in srgb, var(--surface-raised) 70%, transparent);
  outline: 3px solid var(--tint);
  outline-offset: 2px;
}
.plant[data-next='true'] .plant__art { animation: plant-sway 2.4s var(--ease-out) infinite; }
.plant__water {
  position: absolute;
  top: -12px;
  right: -8px;
  font-size: 1.3rem;
  line-height: 1;
  animation: drop-bob 1.6s var(--ease-out) infinite;
}

.plant__tag {
  font-size: var(--t-xs);
  font-weight: 700;
  color: var(--ink-soft);
}

@keyframes plant-sway {
  0%, 100% { transform: rotate(0deg); }
  30% { transform: rotate(-6deg); }
  65% { transform: rotate(4deg); }
}
@keyframes drop-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.chip--streak { background: var(--sun-100); border-color: var(--sun-400); color: var(--bark-900); }

/* --- a bed up close, and a lesson as one plant --------------------------------- */

/* Any screen about one skill carries that skill's colour to everything in it. */
[data-skill='speaking']  { --tint: var(--skill-speaking);  --tint-soft: var(--skill-speaking-soft); }
[data-skill='listening'] { --tint: var(--skill-listening); --tint-soft: var(--skill-listening-soft); }
[data-skill='reading']   { --tint: var(--skill-reading);   --tint-soft: var(--skill-reading-soft); }
[data-skill='writing']   { --tint: var(--skill-writing);   --tint-soft: var(--skill-writing-soft); }

.back-link { align-self: flex-start; }

.bed--big .bed__name { font-size: var(--t-2xl); }
.bed__soil--named {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--s-3);
}

.plant-card {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  height: 100%;
  padding: var(--s-3);
  border: var(--border-w) solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-sticker);
  transition: transform var(--dur-fast) var(--ease-bounce);
}
.plant-card:hover { transform: translateY(-2px); }
.plant-card:hover .plant__art { animation: plant-sway 0.7s var(--ease-out); }
.plant-card[data-next='true'] { border-color: var(--tint); box-shadow: 0 4px 0 var(--tint); }
.plant--static { flex: none; }
.plant--static[data-next='true'] { outline: none; background: none; }
.plant-card__words { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.plant-card__n { font-size: var(--t-xs); font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; }
.plant-card__title { font-family: var(--font-display); font-weight: 700; font-size: var(--t-md); line-height: 1.2; }
.plant-card__goal { font-size: var(--t-xs); color: var(--ink-soft); }
.plant-card__drops { flex: none; font-size: var(--t-xs); font-weight: 700; color: var(--ink-soft); }

/* The lesson: its plant in a big pot of soil, and the words beside it. */
.pot {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-5);
  padding: var(--s-5);
  border: var(--border-w) solid var(--line);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--tint-soft) 0%, var(--surface) 70%);
  box-shadow: var(--shadow-soft);
}
@media (min-width: 760px) {
  .pot { grid-template-columns: 220px minmax(0, 1fr); align-items: center; }
}
.pot__plant {
  position: relative;
  height: 190px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-radius: var(--r-lg);
  background-color: var(--soil);
  background-image: radial-gradient(var(--soil-speck) 1.5px, transparent 1.6px);
  background-size: 16px 16px;
}
.pot__art {
  position: relative;
  z-index: 1;
  margin-bottom: 26px;
  font-size: 5.5rem;
  line-height: 1;
  transform-origin: 50% 100%;
  animation: plant-sway 3.2s var(--ease-out) infinite;
}
.pot__art[data-stage='seed'] { font-size: 3rem; margin-bottom: 30px; }
.pot__art[data-stage='sprout'] { font-size: 4.2rem; }
.pot__mound {
  position: absolute;
  left: 22%; right: 22%; bottom: 18px;
  height: 34px;
  border-radius: 50% 50% 14px 14px;
  background: var(--soil-mound);
}
@media (max-width: 759.98px) {
  .pot__plant { height: 140px; }
  .pot__art { font-size: 4.2rem; margin-bottom: 20px; }
}
.pot__words { display: flex; flex-direction: column; gap: var(--s-3); }
.pot__title { margin: 0; font-size: var(--t-2xl); }
.pot__water { display: flex; flex-direction: column; gap: var(--s-1); }
.pot__water .drops { flex-wrap: wrap; font-size: 1.7rem; }

/* The activities: each one a drop of water for the plant. */
.waterings { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-3); }
.watering {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 76px;
  padding: var(--s-3) var(--s-4);
  border: var(--border-w) solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-sticker);
  transition: transform var(--dur-fast) var(--ease-bounce);
}
.watering:hover { transform: translateX(4px); }
.watering[data-state='next'] { border-color: var(--tint); background: var(--tint-soft); box-shadow: 0 4px 0 var(--tint); }
.watering__n {
  flex: none;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--surface-sunken);
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--ink-soft);
}
.watering[data-state='done'] .watering__n { background: var(--sun-100); color: var(--bark-900); }
.watering__art { flex: none; font-size: 2rem; line-height: 1; }
.watering__words { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.watering__title { font-family: var(--font-display); font-weight: 700; font-size: var(--t-lg); line-height: 1.2; }
.watering__how { font-size: var(--t-sm); color: var(--ink-soft); }
.watering__state { flex: none; font-size: 1.4rem; font-weight: 800; font-family: var(--font-display); color: var(--tint); }
.watering[data-state='todo'] .watering__state { filter: grayscale(1); opacity: 0.35; }

/* --- the grown-up gate, corner and "Me" -------------------------------------- */

.field__label { font-weight: 700; font-size: var(--t-sm); }

.gate-page { max-width: 520px; margin: 0 auto; width: 100%; }
.gate-lock__art { font-size: 3.4rem; line-height: 1; }
.gate-card { align-items: stretch; }

.pin-dots { display: flex; gap: var(--s-3); justify-content: center; }
.pin-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: var(--border-w) solid var(--line-strong);
  background: transparent;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.pin-dot[data-full='true'] { background: var(--primary); border-color: var(--primary); }
.pin-dots[data-wrong='true'] { animation: pin-shake 0.45s var(--ease-out); }
@keyframes pin-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 76px);
  gap: var(--s-3);
  justify-content: center;
}
.pin-pad[data-busy='true'] { opacity: 0.6; pointer-events: none; }
.pin-key {
  width: 76px; height: 64px;
  border: var(--border-w) solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-raised);
  font-family: var(--font-display);
  font-size: var(--t-xl);
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-sticker);
}
.pin-key:active { transform: translateY(2px); box-shadow: none; }

.gu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--s-4);
}
.gu-tile {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4);
  border: var(--border-w) solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-sticker);
  transition: transform var(--dur-fast) var(--ease-bounce);
}
.gu-tile:hover { transform: translateY(-2px); border-color: var(--primary); }
.gu-tile__icon { font-size: 2.2rem; line-height: 1; }
.gu-tile__words { display: flex; flex-direction: column; }
.gu-tile__title { font-family: var(--font-display); font-weight: 700; font-size: var(--t-lg); }
.gu-tile__text { font-size: var(--t-sm); color: var(--ink-soft); }

.me-avatar {
  width: 84px; height: 84px;
  display: flex; align-items: center; justify-content: center;
  font-size: 3.2rem; line-height: 1;
  border-radius: 50%;
  background: var(--surface-raised);
  border: var(--border-w) solid var(--line);
  box-shadow: var(--shadow-sticker);
}

.chip--grownup { background: var(--primary-soft); border-color: var(--moss-300); color: var(--primary); cursor: pointer; font: inherit; font-size: var(--t-sm); font-weight: 700; }

/* --- sign in with Google (2026-10-08) ------------------------------------------ */
/* Google's own button look (white with a grey line, or near-black in dark),
   so it reads as Google's and not as one of ours. */
.btn.btn--google {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 48px;
  border: 1px solid var(--google-line);
  background: var(--google-bg);
  color: var(--google-ink);
  font-weight: 700;
  text-decoration: none;
  box-shadow: none;
}
.btn.btn--google:hover:not(:disabled) { box-shadow: var(--shadow-sticker); transform: none; }
.btn--google__g { display: inline-flex; }
.or-line {
  display: flex; align-items: center; gap: var(--s-3);
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--t-sm);
}
.or-line::before, .or-line::after { content: ''; flex: 1; border-top: 1px solid var(--line); }

/* --- show / hide a password (ui.js enablePasswordReveal) ----------------------- */
.reveal { position: relative; display: block; }
.reveal > input { width: 100%; padding-right: 52px; box-sizing: border-box; }
.reveal__btn {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 12px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}
.reveal__btn:hover, .reveal__btn[aria-pressed='true'] { color: var(--ink); background: var(--surface-sunken); }
.reveal__btn:focus-visible { outline: 3px solid var(--primary); outline-offset: 1px; }

/* --- interface language menu (ui.js langMenu) ------------------------------
   A clay chip (globe + code) opening a small clay card of the three languages,
   each written in its own words. */
.langmenu { position: relative; display: inline-flex; }
.langmenu__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 4px 12px 4px 6px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--clay-surface);
  box-shadow: var(--clay-sm);
  color: var(--clay-primary-deep);
  font: inherit;
  font-weight: 900;
  font-size: var(--t-sm);
  letter-spacing: .04em;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.langmenu__btn:hover { transform: translateY(-1px); }
.langmenu__btn:active, .langmenu.is-open .langmenu__btn { box-shadow: var(--clay-pressed); transform: none; }
.langmenu__globe { display: inline-grid; place-items: center; width: 32px; height: 32px; font-size: 1.35rem; }
.langmenu__globe .art { width: 30px; height: 30px; }
.langmenu__caret { font-size: .8em; opacity: .7; transition: transform var(--dur-fast) var(--ease-out); }
.langmenu.is-open .langmenu__caret { transform: rotate(180deg); }

.langmenu__card {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 60;
  min-width: 200px;
  padding: 8px;
  display: grid;
  gap: 4px;
  border-radius: var(--r-clay);
  background: var(--clay-surface);
  box-shadow: var(--clay);
  transform-origin: top right;
  animation: langmenu-in var(--dur-fast) var(--ease-out);
}
.langmenu__card[hidden] { display: none; }
@keyframes langmenu-in {
  from { opacity: 0; transform: translateY(-6px) scale(.96); }
  to { opacity: 1; transform: none; }
}
.langmenu__item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 12px 6px 6px;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.langmenu__item:hover, .langmenu__item:focus-visible { background: var(--surface-sunken); outline: none; }
.langmenu__item:focus-visible { box-shadow: 0 0 0 3px var(--primary); }
.langmenu__item[aria-checked='true'] { background: var(--primary-soft); color: var(--clay-primary-deep); }
.langmenu__badge {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 28px;
  border-radius: var(--r-pill);
  background: var(--clay-surface);
  box-shadow: var(--clay-sm);
  font-size: var(--t-xs);
  font-weight: 900;
  letter-spacing: .05em;
  color: var(--clay-primary-deep);
}
.langmenu__tick { font-weight: 900; color: var(--clay-primary-deep); }
@media (prefers-reduced-motion: reduce) {
  .langmenu__card { animation: none; }
  .langmenu__btn, .langmenu__caret { transition: none; }
}
/* In a settings card the menu opens from the left edge. */
.langmenu--start .langmenu__card { right: auto; left: 0; transform-origin: top left; }
/* An exercise stays English, whatever the interface language. */
[data-screen="focus"] .topbar__lang { display: none; }
/* With a child playing, the top bar is full, and the language is a grown-up
   setting: it lives in Grown-ups → Permissions & settings instead. */
.app--nav .topbar__lang { display: none; }
