/* MoMo English YLE design system
   Storybook look: warm paper, ink outlines that match the hand-drawn characters, muted forest / ochre / terracotta.
   Child rules: tap targets >= 64px with >= 12px gaps, no red crosses, gentle motion. */

/* ======================================================================
   Tokens
   ====================================================================== */
:root {
  --paper: #fbf6ec;
  --paper-2: #f4ecdc;
  --paper-3: #ebe0ca;
  --card: #fffdf8;
  --line: #e4d8c3;
  --line-strong: #d3c3a6;
  --ink: #3a2e28;
  --ink-soft: #75685e;
  --ink-faint: #a89a8c;

  --primary: #2f6b4f;
  --primary-deep: #22513b;
  --primary-soft: #e3efe7;
  --primary-tint: #cfe3d6;
  --ochre: #d99a2b;
  --ochre-deep: #a8731a;
  --ochre-soft: #fbedd0;
  --terracotta: #c4613a;
  --terracotta-deep: #9c4826;
  --terracotta-soft: #f8e1d5;
  --sky: #5f8fb8;
  --sky-deep: #456f94;
  --sky-soft: #e2edf6;
  --berry: #8c5a8f;
  --berry-deep: #6c4170;
  --berry-soft: #f0e4f0;
  --sage: #6f9a62;
  --sage-deep: #557a4a;
  --sage-soft: #e8f0df;

  --accent: var(--primary);
  --accent-deep: var(--primary-deep);
  --accent-soft: var(--primary-soft);

  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --shadow-card: 0 1px 0 rgba(58, 46, 40, 0.04), 0 10px 28px -16px rgba(58, 46, 40, 0.35);
  --shadow-lift: 0 2px 0 rgba(58, 46, 40, 0.05), 0 18px 40px -18px rgba(58, 46, 40, 0.45);
  --tap: 64px;
  --gap: 12px;
  --sidebar-w: 256px;
  --appbar-h: 76px;
  --tabbar-h: 80px;

  --font: "Nunito", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --font-zh: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}

/* ======================================================================
   Base
   ====================================================================== */
*, *::before, *::after { box-sizing: border-box; }

* {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

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

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(rgba(58, 46, 40, 0.035) 1px, transparent 1px),
    radial-gradient(rgba(58, 46, 40, 0.025) 1px, transparent 1px);
  background-size: 22px 22px, 22px 22px;
  background-position: 0 0, 11px 11px;
  overscroll-behavior-y: none;
}

.kid-zone, .kid-zone * {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 900; letter-spacing: 0.01em; }
p { margin: 0; }
img { -webkit-user-drag: none; max-width: 100%; }
a { color: inherit; text-decoration: none; }

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

button:disabled { cursor: default; }

:focus-visible { outline: 3px solid var(--ochre); outline-offset: 3px; border-radius: 12px; }
[tabindex="-1"]:focus { outline: none; }

.icon { flex: 0 0 auto; display: inline-block; vertical-align: -0.15em; }

.muted { color: var(--ink-soft); }
.eyebrow {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ======================================================================
   Buttons
   ====================================================================== */
.btn {
  --btn-bg: var(--card);
  --btn-fg: var(--ink);
  --btn-edge: var(--line-strong);
  min-height: var(--tap);
  padding: 0 28px;
  border-radius: 18px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  box-shadow: 0 4px 0 var(--btn-edge);
  font-size: 1.15rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.15s ease;
  white-space: nowrap;
}

.btn:hover:not(:disabled) { filter: brightness(1.03); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--btn-edge); }
.btn:disabled { opacity: 0.5; }
.btn .icon { width: 1.35em; height: 1.35em; }

.btn-primary { --btn-bg: var(--primary); --btn-fg: #fffaf0; --btn-edge: var(--primary-deep); }
.btn-accent { --btn-bg: var(--ochre); --btn-fg: #3a2a10; --btn-edge: var(--ochre-deep); }
.btn-secondary { --btn-bg: var(--card); --btn-fg: var(--ink); --btn-edge: var(--line-strong); border: 2px solid var(--line); }
.btn-light { --btn-bg: #fffaf0; --btn-fg: var(--primary-deep); --btn-edge: rgba(0, 0, 0, 0.22); }
.btn-ghost {
  --btn-bg: transparent;
  --btn-edge: transparent;
  color: var(--ink-soft);
  box-shadow: none;
  font-weight: 700;
}
.btn-ghost:hover:not(:disabled) { background: var(--paper-2); }
.btn-danger { --btn-bg: var(--card); --btn-fg: var(--terracotta-deep); --btn-edge: var(--terracotta-soft); border: 2px solid var(--terracotta-soft); }
.btn-lg { min-height: 80px; padding: 0 36px; font-size: 1.4rem; border-radius: 22px; }
.btn-on-dark {
  --btn-bg: rgba(255, 250, 240, 0.12);
  --btn-fg: #fffaf0;
  --btn-edge: rgba(0, 0, 0, 0.18);
  border: 1.5px solid rgba(255, 250, 240, 0.3);
}
.btn-sm { min-height: 48px; padding: 0 18px; font-size: 1rem; border-radius: 14px; box-shadow: 0 3px 0 var(--btn-edge); }
.btn-block { width: 100%; }

.icon-btn {
  width: var(--tap);
  height: var(--tap);
  border-radius: 18px;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: 0 3px 0 var(--line);
  display: inline-grid;
  place-items: center;
  color: var(--ink);
  flex: 0 0 auto;
  transition: transform 0.08s ease;
}
.icon-btn .icon { width: 30px; height: 30px; }
.icon-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.icon-btn-accent { color: var(--primary); }

/* ======================================================================
   Surfaces
   ====================================================================== */
.card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 24px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px 0 12px;
  border-radius: 999px;
  background: var(--card);
  border: 1.5px solid var(--line);
  font-weight: 800;
  font-size: 1.05rem;
  white-space: nowrap;
}
.chip .icon { width: 24px; height: 24px; }
.chip-streak .icon { color: var(--terracotta); }
.chip-cookie .icon { color: var(--ochre); }
.chip-shield .icon { color: var(--sky); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  background: var(--paper-2);
  color: var(--ink-soft);
  white-space: nowrap;
}
.badge .icon { width: 14px; height: 14px; }
.badge-free { background: var(--primary-soft); color: var(--primary-deep); }
.badge-trial { background: var(--ochre-soft); color: var(--ochre-deep); }
.badge-locked { background: var(--paper-2); color: var(--ink-soft); }
.badge-done { background: var(--primary); color: #fffaf0; }

.progress {
  height: 10px;
  border-radius: 999px;
  background: var(--paper-3);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.4s ease;
}

.word-picture { display: block; width: 100%; height: 100%; object-fit: contain; }

/* Course colour themes */
.theme-abc { --accent: var(--sage); --accent-deep: var(--sage-deep); --accent-soft: var(--sage-soft); }
.theme-starters { --accent: var(--sky); --accent-deep: var(--sky-deep); --accent-soft: var(--sky-soft); }
.theme-movers { --accent: var(--ochre); --accent-deep: var(--ochre-deep); --accent-soft: var(--ochre-soft); }
.theme-flyers { --accent: var(--berry); --accent-deep: var(--berry-deep); --accent-soft: var(--berry-soft); }

/* ======================================================================
   Loading
   ====================================================================== */
.loading {
  display: grid;
  place-items: center;
  gap: 16px;
  padding: 64px 16px;
  color: var(--ink-soft);
  font-weight: 700;
}
.loading-face { width: 96px; height: 96px; object-fit: contain; animation: breathe 1.8s ease-in-out infinite; }
.spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 4px solid var(--paper-3);
  border-top-color: var(--primary);
  animation: spin 0.9s linear infinite;
}

/* ======================================================================
   App shell (child area)
   ====================================================================== */
.app {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px 16px;
  background: var(--paper-2);
  border-right: 1.5px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 20px;
  min-height: var(--tap);
}
.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--card);
  border: 1.5px solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
}
.brand-mark img { width: 120%; height: 120%; object-fit: cover; object-position: 50% 20%; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 1.3rem; font-weight: 900; font-family: var(--font-zh); }
.brand-sub { font-size: 0.78rem; font-weight: 800; color: var(--ink-soft); letter-spacing: 0.04em; }

.nav-list { display: flex; flex-direction: column; gap: var(--gap); }

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: var(--tap);
  padding: 0 16px;
  border-radius: 18px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink-soft);
  transition: background-color 0.15s ease, color 0.15s ease;
  text-align: left;
  width: 100%;
}
.nav-item .icon { width: 30px; height: 30px; }
.nav-item:hover { background: var(--paper-3); color: var(--ink); }
.nav-item.active { background: var(--card); color: var(--primary-deep); box-shadow: inset 0 0 0 1.5px var(--line), var(--shadow-card); }
.nav-item.active .icon { color: var(--primary); }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--gap); }

.app-main { min-width: 0; display: flex; flex-direction: column; }

.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--appbar-h);
  display: flex;
  align-items: center;
  gap: var(--gap);
  padding: 0 clamp(16px, 3vw, 40px);
  background: rgba(251, 246, 236, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1.5px solid transparent;
}
.appbar .brand { display: none; padding: 0; }
.appbar-spacer { flex: 1; }
.appbar-stats { display: flex; gap: 8px; }

.account-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 0 18px 0 12px;
  border-radius: 18px;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: 0 3px 0 var(--line);
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}
.account-btn .icon { width: 30px; height: 30px; color: var(--primary); }
.account-btn.signed-in .icon { color: var(--sage); }
.account-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.account-sub { display: block; font-size: 0.75rem; font-weight: 700; color: var(--ink-soft); line-height: 1.1; }
.account-label { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }

.page {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px clamp(16px, 3vw, 40px) 48px;
  flex: 1;
}

.tabbar { display: none; }

/* Page header */
.page-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 8px 0 28px;
}
.page-head-text { flex: 1; min-width: 0; }
.page-title { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-family: var(--font-zh); outline: none; }
.page-sub { color: var(--ink-soft); font-weight: 700; margin-top: 4px; font-size: 1.05rem; }

.section-title {
  font-size: 1.25rem;
  font-family: var(--font-zh);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---- Tablet: icon rail ---- */
@media (max-width: 1023px) {
  :root { --sidebar-w: 104px; }
  .sidebar { padding: 20px 10px; align-items: stretch; }
  .sidebar .brand { justify-content: center; padding: 0 0 16px; }
  .sidebar .brand-text { display: none; }
  .nav-item { flex-direction: column; justify-content: center; gap: 2px; padding: 8px 4px; min-height: 76px; font-size: 0.85rem; text-align: center; }
  .sidebar-foot .nav-item span { font-size: 0.8rem; }
}

/* ---- Phone: top app bar + bottom tab bar ---- */
@media (max-width: 639px) {
  :root { --appbar-h: 72px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .appbar { padding: 0 12px; gap: 8px; }
  .appbar .brand { display: flex; min-width: var(--tap); }
  .appbar .brand-text { display: none; }
  .appbar .brand-mark { width: 48px; height: 48px; }
  .appbar-stats { gap: 6px; }
  .appbar .chip { height: 40px; padding: 0 12px 0 8px; font-size: 1rem; }
  .account-btn { width: var(--tap); padding: 0; justify-content: center; }
  .account-btn .account-label { display: none; }
  .page { padding: 4px 16px calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom)); }
  .page-head { margin: 4px 0 20px; }

  .tabbar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255, 253, 248, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1.5px solid var(--line);
  }
  .tab {
    min-height: var(--tap);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--ink-soft);
  }
  .tab .icon { width: 28px; height: 28px; }
  .tab.active { background: var(--primary-soft); color: var(--primary-deep); }
  .tab.active .icon { color: var(--primary); }
}

/* ======================================================================
   Focus shell (welcome, onboarding, play)
   ====================================================================== */
.focus {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ======================================================================
   Character speaker
   ====================================================================== */
.speaker {
  display: flex;
  align-items: center;
  gap: 16px;
}
.speaker-reverse { flex-direction: row-reverse; }
.speaker-avatar { flex: 0 0 auto; line-height: 0; border-radius: 50%; }
.speaker-avatar img { display: block; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(58, 46, 40, 0.16)); }
.speaker-sm .speaker-avatar img { width: 88px; height: 88px; }
.speaker-md .speaker-avatar img { width: 132px; height: 132px; }
.speaker-lg .speaker-avatar img { width: clamp(150px, 22vw, 220px); height: clamp(150px, 22vw, 220px); }

.speech-bubble {
  position: relative;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 22px;
  padding: 14px 40px 14px 18px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  min-width: 0;
  max-width: 520px;
}
.speech-bubble::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 50%;
  width: 16px;
  height: 16px;
  background: var(--card);
  border-left: 1.5px solid var(--line);
  border-bottom: 1.5px solid var(--line);
  transform: translateY(-50%) rotate(45deg);
}
.speaker-reverse .speech-bubble::before { left: auto; right: -9px; transform: translateY(-50%) rotate(-135deg); }
.speech-name { font-size: 0.8rem; font-weight: 900; color: var(--accent); letter-spacing: 0.04em; }
.speech-zh { font-size: 1.1rem; font-weight: 700; font-family: var(--font-zh); }
.speech-en { font-size: 1rem; font-weight: 800; color: var(--ink-soft); margin-top: 2px; }
.speech-play { position: absolute; right: 10px; bottom: 8px; color: var(--ink-faint); width: 18px; height: 18px; }

/* ======================================================================
   Dialog
   ====================================================================== */
.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(46, 36, 30, 0.42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade-in 0.2s ease-out;
}
.dialog {
  width: min(480px, 100%);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 32px;
  box-shadow: var(--shadow-lift);
  padding: 32px 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  animation: rise-in 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.dialog-wide { width: min(600px, 100%); }
.dialog-title { font-size: 1.5rem; font-family: var(--font-zh); }
.dialog-text { color: var(--ink-soft); font-weight: 600; font-size: 1.05rem; }
.dialog-hero { width: 120px; height: 120px; object-fit: contain; margin-top: -8px; }
.dialog-actions { display: flex; flex-direction: column; gap: var(--gap); width: 100%; }
.dialog-icon {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
}
.dialog-icon .icon { width: 40px; height: 40px; }
.dialog-icon.ochre { background: var(--ochre-soft); color: var(--ochre-deep); }

@media (max-width: 639px) {
  .dialog-backdrop { place-items: end stretch; padding: 0; }
  .dialog {
    width: 100%;
    max-height: 92dvh;
    border-radius: 28px 28px 0 0;
    border-bottom: none;
    padding: 28px 20px calc(20px + env(safe-area-inset-bottom));
    animation: sheet-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
  }
  .dialog::before {
    content: "";
    width: 44px;
    height: 5px;
    border-radius: 999px;
    background: var(--line);
    margin: -14px auto 4px;
  }
}

/* Parental gate */
.gate-question { font-size: 1.15rem; font-weight: 700; font-family: var(--font-zh); }
.gate-question strong { color: var(--primary-deep); font-size: 1.3rem; }
.gate-display {
  min-width: 160px;
  height: 64px;
  display: grid;
  place-items: center;
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
}
.gate-display.empty { color: var(--ink-faint); }
.keypad { display: grid; grid-template-columns: repeat(3, 76px); gap: var(--gap); }
.key {
  height: 68px;
  border-radius: 18px;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: 0 3px 0 var(--line);
  font-size: 1.6rem;
  font-weight: 900;
  display: grid;
  place-items: center;
}
.key:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.key .icon { width: 30px; height: 30px; }
.key-muted { background: var(--paper-2); color: var(--ink-soft); }
.key-ok { background: var(--primary); border-color: var(--primary); color: #fffaf0; box-shadow: 0 3px 0 var(--primary-deep); }

/* Login reward */
.reward-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; width: 100%; }
.reward-day {
  position: relative;
  border-radius: 16px;
  padding: 10px 2px 8px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ink-soft);
}
.reward-day .reward-pic { width: 34px; height: 34px; }
.reward-day.past { opacity: 0.55; }
.reward-day.today { background: var(--ochre-soft); border-color: var(--ochre); color: var(--ink); box-shadow: 0 0 0 3px rgba(217, 154, 43, 0.25); }
.reward-check {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
}
.reward-check .icon { width: 14px; height: 14px; }
.reward-got { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; }
.reward-got .icon { width: 26px; height: 26px; color: var(--ochre); }

@media (max-width: 420px) {
  .reward-days { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ======================================================================
   Welcome & onboarding
   ====================================================================== */
.welcome {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 48px) clamp(20px, 4vw, 48px) 24px;
  display: flex;
  flex-direction: column;
}
.welcome-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.welcome-top .brand { padding: 0; }
.welcome-body {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
  padding: 32px 0;
}
.welcome-copy { display: flex; flex-direction: column; gap: 20px; }
.welcome-title {
  font-family: var(--font-zh);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.15;
}
.welcome-title em { font-style: normal; color: var(--primary); }
.welcome-lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--ink-soft); font-weight: 600; max-width: 34em; }
.welcome-ctas { display: flex; flex-wrap: wrap; gap: var(--gap); margin-top: 8px; }
.welcome-note { font-size: 0.95rem; color: var(--ink-soft); font-weight: 600; }
.welcome-points { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.welcome-points li { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--ink-soft); }
.welcome-points .icon { width: 22px; height: 22px; color: var(--primary); }

.welcome-art { position: relative; aspect-ratio: 1; width: 100%; max-width: 520px; justify-self: center; }
.welcome-art::before {
  content: "";
  position: absolute;
  inset: 6%;
  border-radius: 46% 54% 52% 48% / 52% 44% 56% 48%;
  background: radial-gradient(circle at 35% 30%, #fffaf0 0, var(--primary-soft) 60%, var(--primary-tint) 100%);
  border: 2px solid var(--line);
}
.welcome-art img { position: absolute; object-fit: contain; filter: drop-shadow(0 10px 12px rgba(58, 46, 40, 0.18)); }
.welcome-art .art-main { width: 54%; left: 23%; top: 18%; z-index: 2; }
.welcome-art .art-a { width: 30%; left: 2%; top: 8%; }
.welcome-art .art-b { width: 30%; right: 2%; top: 6%; }
.welcome-art .art-c { width: 28%; left: 4%; bottom: 6%; }
.welcome-art .art-d { width: 30%; right: 3%; bottom: 4%; }

.disclaimer { text-align: center; color: var(--ink-faint); font-size: 0.85rem; font-weight: 600; padding: 12px 0; }

.onboard { display: flex; flex-direction: column; align-items: center; gap: 28px; padding: 24px 0; }
.onboard .speaker { max-width: 640px; }
.buddy-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; width: 100%; max-width: 920px; }
.buddy-card {
  position: relative;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 0 var(--line);
  padding: 18px 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.buddy-card img { width: 100%; max-width: 180px; aspect-ratio: 1; object-fit: contain; }
.buddy-card span { font-size: 1.25rem; font-weight: 900; }
.buddy-card:hover { transform: translateY(-3px); }
.buddy-card.picked { border-color: var(--primary); box-shadow: 0 4px 0 var(--primary-deep), 0 0 0 5px var(--primary-soft); }
.buddy-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  animation: pop-in 0.25s ease-out;
}
.buddy-check .icon { width: 22px; height: 22px; }

@media (max-width: 1023px) {
  .welcome-body { grid-template-columns: 1fr; text-align: center; padding-top: 8px; }
  .welcome-copy { align-items: center; order: 2; }
  .welcome-ctas, .welcome-points { justify-content: center; }
  .welcome-art { order: 1; max-width: 360px; }
}

@media (max-width: 639px) {
  .welcome-ctas { flex-direction: column; width: 100%; }
  .welcome-ctas .btn { width: 100%; }
  .welcome-art { max-width: 280px; }
  .buddy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
  .onboard .speaker { flex-direction: column; text-align: center; }
  .onboard .speech-bubble::before { display: none; }
}

/* ======================================================================
   Home dashboard
   ====================================================================== */
.dash {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.dash-main, .dash-side { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  padding: clamp(24px, 3vw, 36px);
  min-height: 320px;
  background:
    radial-gradient(circle at 85% 20%, rgba(255, 250, 240, 0.16) 0, transparent 40%),
    linear-gradient(140deg, #2f6b4f 0%, #3a7a5b 55%, #4a8a66 100%);
  color: #fffaf0;
  box-shadow: var(--shadow-lift);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
}
.hero-card::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -90px;
  width: 360px;
  height: 260px;
  border-radius: 50%;
  background: rgba(255, 250, 240, 0.1);
}
.hero-copy { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 14px; align-self: center; }
.hero-eyebrow { font-size: 0.85rem; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; color: #cfe3d6; display: flex; align-items: center; gap: 8px; }
.hero-eyebrow .icon { width: 18px; height: 18px; }
.hero-title { font-size: clamp(1.9rem, 3.6vw, 2.6rem); font-family: var(--font-zh); }
.hero-bubble {
  align-self: flex-start;
  max-width: 420px;
  background: rgba(255, 250, 240, 0.14);
  border: 1.5px solid rgba(255, 250, 240, 0.25);
  border-radius: 18px;
  padding: 12px 16px;
  font-weight: 700;
  font-family: var(--font-zh);
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-align: left;
}
.hero-bubble .icon { width: 22px; height: 22px; margin-top: 2px; color: #cfe3d6; }
.hero-bubble small { display: block; color: #cfe3d6; font-weight: 800; font-family: var(--font); font-size: 0.9rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; margin-top: 6px; }
.hero-note { display: flex; align-items: center; gap: 8px; font-weight: 700; color: #e8f2ec; font-size: 0.98rem; }
.hero-note .icon { width: 22px; height: 22px; color: #f4c56a; }
.hero-buddy { position: relative; z-index: 1; width: clamp(150px, 20vw, 240px); margin: 0 -8px -16px 0; cursor: pointer; }
.hero-buddy .buddy-avatar { width: 100%; }
.hero-buddy img { width: 100%; height: auto; filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.25)); }

.tile-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tile-row .stat-card { padding: 18px; color: inherit; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.tile-row .stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }

.continue-card { display: flex; flex-direction: column; gap: 16px; }
.continue-head { display: flex; align-items: center; gap: 16px; }
.continue-cover {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 14px;
}
.continue-title { font-size: 1.3rem; font-family: var(--font-zh); }
.continue-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 800; color: var(--ink-soft); font-size: 0.95rem; }

.stat-card { display: flex; flex-direction: column; gap: 14px; }
.stat-head { display: flex; align-items: center; gap: 14px; }
.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.stat-icon .icon { width: 32px; height: 32px; }
.stat-icon.tone-terracotta { background: var(--terracotta-soft); color: var(--terracotta); }
.stat-icon.tone-ochre { background: var(--ochre-soft); color: var(--ochre); }
.stat-icon.tone-sky { background: var(--sky-soft); color: var(--sky); }
.stat-value { font-size: 2rem; font-weight: 900; line-height: 1; }
.stat-value small { font-size: 1rem; color: var(--ink-soft); font-weight: 800; margin-left: 4px; }
.stat-label { font-weight: 700; color: var(--ink-soft); font-size: 0.95rem; }
.stat-label .icon { width: 18px; height: 18px; color: var(--sky); }
.stat-link { margin-top: auto; }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week-day { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 0.75rem; font-weight: 800; color: var(--ink-faint); }
.week-dot {
  width: 100%;
  max-width: 36px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--paper-2);
  border: 1.5px dashed var(--line-strong);
  display: grid;
  place-items: center;
}
.week-dot .icon { width: 60%; height: 60%; }
.week-day.on .week-dot { background: var(--terracotta); border: none; color: #fff7ef; }
.week-day.today { color: var(--ink); }
.week-day.today .week-dot { box-shadow: 0 0 0 3px var(--terracotta-soft); }

.notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 18px;
  background: var(--terracotta-soft);
  color: var(--terracotta-deep);
  font-weight: 800;
}
.notice .icon { width: 26px; height: 26px; flex: 0 0 auto; }
.notice-info { background: var(--sky-soft); color: var(--sky-deep); }
.notice-success { background: var(--primary-soft); color: var(--primary-deep); }

@media (max-width: 1279px) {
  .dash { grid-template-columns: minmax(0, 1fr); }
  .dash-side { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: stretch; }
}

@media (max-width: 767px) {
  .dash-side { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 639px) {
  .hero-card { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-top: 20px; }
  .hero-buddy { position: absolute; right: -6px; top: 4px; width: 128px; margin: 0; }
  .hero-copy { padding-top: 4px; }
  .hero-eyebrow, .hero-title { padding-right: 120px; }
  .hero-actions .btn { width: 100%; }
  .tile-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
  .tile-row .card { padding: 16px; }
  .stat-value { font-size: 1.6rem; }
  .stat-icon { width: 48px; height: 48px; }
}

/* ======================================================================
   Courses
   ====================================================================== */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 24px; }
.course-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.course-cover {
  position: relative;
  height: 168px;
  background:
    radial-gradient(circle at 20% 110%, rgba(255, 255, 255, 0.6) 0, transparent 50%),
    var(--accent-soft);
  border-bottom: 1.5px solid var(--line);
  overflow: hidden;
}
.course-cover::before {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  right: -30px;
  bottom: -70px;
  background: var(--accent);
  opacity: 0.18;
}
.course-host { position: absolute; right: 10px; bottom: -6px; width: 150px; height: 150px; object-fit: contain; }
.course-level {
  position: absolute;
  left: 18px;
  top: 18px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--card);
  color: var(--accent-deep);
  font-weight: 900;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
}
.course-pic { position: absolute; left: 18px; bottom: 18px; width: 64px; height: 64px; }
.course-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.course-title { font-size: 1.3rem; font-family: var(--font-zh); font-weight: 900; }
.course-sub { color: var(--ink-soft); font-weight: 800; font-size: 0.95rem; margin-top: -6px; }
.course-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; }
.course-stat { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--ink-soft); font-size: 0.9rem; }
.course-stat .icon { width: 18px; height: 18px; color: var(--accent); }

@media (max-width: 639px) {
  .course-grid { grid-template-columns: 1fr; gap: 16px; }
  .course-cover { height: 140px; }
  .course-host { width: 128px; height: 128px; }
}

/* Course banner + island grid */
.banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 24px 28px;
  border-radius: 32px;
  background: var(--accent-soft);
  border: 1.5px solid var(--line);
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}
.banner-back { margin-bottom: 12px; }
.banner-title { font-size: clamp(1.7rem, 3vw, 2.3rem); font-family: var(--font-zh); }
.banner-sub { color: var(--ink-soft); font-weight: 800; margin: 2px 0 14px; }
.banner-progress { display: flex; align-items: center; gap: 12px; font-weight: 800; color: var(--accent-deep); max-width: 420px; }
.banner-progress .progress { flex: 1; background: rgba(255, 255, 255, 0.7); }
.banner .speaker { justify-self: end; }

.island-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 20px; }
.island-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 16px 18px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.island-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.island-num {
  position: absolute;
  left: 14px;
  top: 14px;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--paper-2);
  font-weight: 900;
  font-size: 0.95rem;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
}
.island-pic {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: var(--accent-soft);
  padding: 20px;
  border: 2px solid var(--card);
  box-shadow: 0 0 0 1.5px var(--line);
}
.island-name { font-size: 1.1rem; font-weight: 900; font-family: var(--font-zh); }
.island-theme { font-size: 0.85rem; font-weight: 800; color: var(--ink-faint); margin-top: -8px; }
.island-meta { display: flex; align-items: center; gap: 8px; width: 100%; font-size: 0.85rem; font-weight: 800; color: var(--ink-soft); }
.island-meta .progress { flex: 1; height: 8px; }
.island-meta .icon { width: 18px; height: 18px; color: var(--accent); }
.island-card.locked .island-pic, .island-card.soon .island-pic { filter: grayscale(0.9); opacity: 0.55; }
.island-card.locked, .island-card.soon { background: var(--paper); box-shadow: none; }
.island-lock {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--ink-soft);
  display: grid;
  place-items: center;
}
.island-lock .icon { width: 20px; height: 20px; }
.island-card.done .island-lock { background: var(--primary); color: #fff; }

@media (max-width: 1023px) {
  .banner { grid-template-columns: 1fr; }
  .banner .speaker { justify-self: start; }
}

@media (max-width: 639px) {
  .banner { padding: 18px; border-radius: 24px; }
  .island-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
  .island-card { padding: 18px 10px 14px; }
  .island-pic { width: 84px; height: 84px; padding: 16px; }
  .island-name { font-size: 1rem; }
}

/* Island page */
.island-layout { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr); gap: 28px; align-items: start; }
.island-intro { display: flex; flex-direction: column; gap: 18px; position: sticky; top: calc(var(--appbar-h) + 8px); }
.island-intro .island-pic { width: 120px; height: 120px; padding: 24px; }
.island-intro-head { display: flex; align-items: center; gap: 18px; }
.vocab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; }
.vocab-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px 8px;
  min-height: var(--tap);
  border-radius: 16px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  font-size: 0.85rem;
  font-weight: 800;
}
.vocab-chip .word-picture { width: 40px; height: 40px; }

.stage-list { display: flex; flex-direction: column; gap: var(--gap); }
.stage-item {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 88px;
  padding: 14px 18px 14px 14px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-card);
  text-align: left;
  width: 100%;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.stage-item:hover:not(.closed) { transform: translateX(4px); box-shadow: var(--shadow-lift); }
.stage-icon {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-deep);
  flex: 0 0 auto;
}
.stage-icon .icon { width: 32px; height: 32px; }
.stage-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.stage-kind { font-size: 0.8rem; font-weight: 900; color: var(--ink-faint); letter-spacing: 0.04em; }
.stage-title { font-size: 1.15rem; font-weight: 900; font-family: var(--font-zh); }
.shields { display: inline-flex; gap: 4px; }
.shields .icon { width: 22px; height: 22px; }
.shield-on { color: var(--ochre); }
.shield-off { color: var(--paper-3); }
.stage-go {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fffaf0;
  flex: 0 0 auto;
}
.stage-go .icon { width: 22px; height: 22px; }
.stage-item.closed { background: var(--paper); box-shadow: none; }
.stage-item.closed .stage-icon { background: var(--paper-2); color: var(--ink-faint); }
.stage-item.closed .stage-go { background: var(--paper-2); color: var(--ink-faint); }
.stage-item.current { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft), var(--shadow-card); }
.stage-item.boss { background: linear-gradient(90deg, var(--ochre-soft), var(--card) 60%); }
.stage-item.boss .stage-icon { background: var(--ochre); color: #fffaf0; }

@media (max-width: 1023px) {
  .island-layout { grid-template-columns: 1fr; }
  .island-intro { position: static; }
  .island-layout .stage-list { order: -1; }
}

@media (max-width: 639px) {
  .stage-item { gap: 12px; padding: 12px; }
  .stage-icon { width: 52px; height: 52px; }
  .vocab-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ======================================================================
   Play
   ====================================================================== */
.play {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px clamp(16px, 3vw, 32px) 32px;
}
.play-bar { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.play-progress { flex: 1; display: flex; gap: 6px; }
.play-progress span { flex: 1; height: 12px; border-radius: 999px; background: var(--paper-3); transition: background-color 0.3s ease; }
.play-progress span.done { background: var(--primary); }
.play-progress span.now { background: var(--ochre); }
.play-stage { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-bottom: 96px; }

.intro-card {
  width: min(640px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  padding: 36px 28px 32px;
}
.intro-icon {
  width: 104px;
  height: 104px;
  border-radius: 32px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
}
.intro-icon .icon { width: 60px; height: 60px; }
.intro-icon.boss { background: var(--ochre-soft); color: var(--ochre-deep); }
.intro-title { font-size: clamp(1.6rem, 3vw, 2.2rem); font-family: var(--font-zh); }
.intro-en { font-size: clamp(1.3rem, 2.4vw, 1.7rem); font-weight: 900; color: var(--primary); }
.intro-card .speaker { text-align: left; }

.buddy-react {
  position: fixed;
  left: 24px;
  bottom: 20px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
  z-index: 10;
}
.buddy-react img { width: 112px; height: 112px; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(58, 46, 40, 0.18)); }
.buddy-says {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 18px 18px 18px 4px;
  padding: 10px 16px;
  font-weight: 800;
  font-family: var(--font-zh);
  box-shadow: var(--shadow-card);
  margin-bottom: 70px;
  max-width: 260px;
  animation: pop-in 0.25s ease-out;
}

.coming-soon { display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }

@media (max-width: 639px) {
  .play { padding: 10px 14px calc(24px + env(safe-area-inset-bottom)); }
  .play-bar { gap: 10px; }
  .play-progress span { height: 10px; }
  .buddy-react { left: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); }
  .buddy-react img { width: 76px; height: 76px; }
  .buddy-says { margin-bottom: 44px; font-size: 0.95rem; }
  .intro-card { padding: 28px 18px 24px; }
  .intro-card .speaker { flex-direction: column; text-align: center; }
  .intro-card .speech-bubble::before { display: none; }
}

/* Result */
.result-shields { display: flex; gap: 14px; }
.result-shield { width: 64px; height: 64px; opacity: 0; animation: shield-in 0.5s forwards; color: var(--ochre); }
.result-shield.empty { color: var(--paper-3); animation-name: shield-in-dim; }
.result-rewards { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.reward-pop { animation: pop-in 0.45s 1.3s both; }
.result-note { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink-soft); }
.result-note .icon { width: 22px; height: 22px; color: var(--ochre); }

/* ======================================================================
   Games
   ====================================================================== */
.game { display: flex; flex-direction: column; align-items: center; gap: 24px; width: 100%; }

.listen-btn {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: var(--primary);
  color: #fffaf0;
  box-shadow: 0 6px 0 var(--primary-deep), 0 0 0 10px var(--primary-soft);
  display: grid;
  place-items: center;
}
.listen-btn .icon { width: 52px; height: 52px; }
.listen-btn:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--primary-deep), 0 0 0 10px var(--primary-soft); }

.prompt-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: var(--tap);
  max-width: 100%;
  padding: 10px 24px 10px 12px;
  border-radius: 999px;
  background: var(--card);
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow-card);
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 900;
  text-align: left;
}
.prompt-pill .pill-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.prompt-pill .pill-icon .icon { width: 24px; height: 24px; }
.prompt-pill small { color: var(--ink-soft); font-family: var(--font-zh); font-weight: 700; margin-left: 4px; }

.letter-tile {
  min-width: 168px;
  min-height: 168px;
  padding: 12px 32px;
  border-radius: 36px;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: 0 6px 0 var(--line);
  font-size: 6rem;
  font-weight: 900;
  line-height: 1;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.letter-tile .small-letter { font-size: 0.65em; color: var(--ochre); margin-left: 14px; }

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 200px));
  gap: 20px;
  justify-content: center;
  width: 100%;
}
.choice-grid.three { grid-template-columns: repeat(3, minmax(0, 200px)); }
.choice-card {
  aspect-ratio: 1;
  border-radius: 32px;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: 0 6px 0 var(--line);
  display: grid;
  place-items: center;
  padding: 18%;
  animation: float 4s ease-in-out infinite;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.choice-card:hover:not(:disabled) { border-color: var(--primary-tint); }
.choice-card:active:not(:disabled) { transform: translateY(3px); }
.choice-letter { font-size: clamp(3.4rem, 10vw, 5rem); font-weight: 900; color: var(--primary); line-height: 1; }
.choice-card.correct { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 6px 0 var(--primary-deep); animation: correct-pop 0.6s ease-out forwards; }
.choice-card:disabled:not(.correct) { opacity: 0.45; animation: none; }

.hint-glow {
  border-color: var(--ochre) !important;
  box-shadow: 0 6px 0 var(--ochre-deep), 0 0 0 8px rgba(217, 154, 43, 0.3) !important;
  animation: wiggle 0.9s ease-in-out infinite !important;
}

/* Letter intro */
.word-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 210px)); gap: 18px; justify-content: center; width: 100%; }
.word-card {
  position: relative;
  padding: 18px 14px 16px;
  border-radius: 28px;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: 0 5px 0 var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.word-card .word-picture { width: 88px; height: 88px; }
.word-card.heard { border-color: var(--primary-tint); background: var(--primary-soft); }
.word-card.waiting { animation: nudge 2.4s ease-in-out infinite; }
.word-text { font-size: 1.7rem; font-weight: 900; }
.word-text strong { color: var(--ochre-deep); }
.word-zh { color: var(--ink-soft); font-weight: 700; font-family: var(--font-zh); }
.word-heard {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
}
.word-heard .icon { width: 18px; height: 18px; }

/* Detective */
.statement {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 100%;
  padding: 12px 22px 12px 12px;
  border-radius: 24px;
  background: var(--card);
  border: 2px solid var(--ochre);
  box-shadow: 0 5px 0 var(--ochre-soft);
  font-size: clamp(1.3rem, 3.4vw, 1.8rem);
  font-weight: 800;
  text-align: left;
}
.statement-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--ochre-soft);
  color: var(--ochre-deep);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.statement-icon .icon { width: 30px; height: 30px; }
.karaoke-on { background: var(--ochre-soft); border-radius: 8px; color: var(--ochre-deep); }

.yes-no { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: 20px; justify-content: center; width: 100%; }
.yes-no .btn { min-height: 104px; font-size: 1.8rem; flex-direction: column; gap: 4px; border-radius: 28px; }
.yes-no .btn .icon { width: 40px; height: 40px; }
.btn-yes { --btn-bg: var(--primary); --btn-fg: #fffaf0; --btn-edge: var(--primary-deep); }
.btn-no { --btn-bg: var(--sky); --btn-fg: #fffaf0; --btn-edge: var(--sky-deep); }
.yes-no .chosen { box-shadow: 0 5px 0 var(--btn-edge), 0 0 0 8px var(--ochre-soft); transform: scale(1.04); }

/* Scene */
.scene {
  position: relative;
  width: 100%;
  max-width: 760px;
  aspect-ratio: 16 / 10;
  border-radius: 28px;
  overflow: hidden;
  container-type: inline-size;
  border: 2px solid var(--line);
  box-shadow: var(--shadow-card);
  background: linear-gradient(180deg, #dcecf3 0 55%, #cfe0b8 55% 100%);
}
.backdrop-zoo {
  background:
    radial-gradient(ellipse 22% 14% at 72% 80%, #b9d6e6 0 98%, transparent 100%),
    linear-gradient(180deg, #dcecf3 0 52%, #cfe0b8 52% 100%);
}
.backdrop-home { background: linear-gradient(180deg, #f7ead6 0 62%, #e2cba7 62% 100%); }
.backdrop-school { background: linear-gradient(180deg, #e6eef4 0 62%, #dccbab 62% 100%); }
.backdrop-sea { background: linear-gradient(180deg, #e0eef4 0 36%, #a9cbe0 36% 100%); }
.scene-object {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: var(--tap);
  min-height: var(--tap);
  display: grid;
  place-items: center;
  line-height: 1;
}
.scene-object .word-picture { width: 100%; height: auto; }
.scene-object.uncoloured .word-picture { filter: grayscale(1) brightness(1.18) contrast(0.85); }
.scene-object.coloured .word-picture { animation: paint-in 0.5s ease-out; }
.scene-focus .scene-object { opacity: 0.5; }
.scene-highlight {
  position: absolute;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 5px solid var(--ochre);
  box-shadow: 0 0 0 2000px rgba(46, 36, 30, 0.35);
  animation: focus-in 0.6s ease-out;
  pointer-events: none;
}
.hint-glow-scene { animation: wiggle 0.9s ease-in-out infinite; filter: drop-shadow(0 0 10px var(--ochre)) drop-shadow(0 0 4px var(--ochre)); }

/* Palette */
.palette { display: grid; grid-template-columns: repeat(8, var(--tap)); gap: var(--gap); justify-content: center; }
.swatch {
  width: var(--tap);
  height: 80px;
  border-radius: 20px;
  background: var(--swatch);
  border: 4px solid var(--card);
  box-shadow: 0 0 0 1.5px var(--line), 0 4px 0 rgba(58, 46, 40, 0.18);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 6px;
  transition: transform 0.15s ease;
}
.swatch.selected { transform: translateY(-8px); box-shadow: 0 0 0 3px var(--ink), 0 8px 0 rgba(58, 46, 40, 0.2); }
.swatch-label {
  font-size: 0.72rem;
  font-weight: 900;
  color: #fff;
  background: rgba(0, 0, 0, 0.28);
  padding: 1px 6px;
  border-radius: 999px;
}

@media (max-width: 639px) {
  .palette { grid-template-columns: repeat(4, var(--tap)); }
}

/* Spell train */
.word-pic {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 36px;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: 0 6px 0 var(--line);
  display: grid;
  place-items: center;
  padding: 26px;
}
.word-pic.static { cursor: default; }
.word-pic .listen-mini {
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fffaf0;
  display: grid;
  place-items: center;
  border: 3px solid var(--card);
}
.word-pic .listen-mini .icon { width: 24px; height: 24px; }

.train {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  justify-content: center;
  flex-wrap: nowrap;
  max-width: 100%;
  transition: transform 1.1s ease-in, opacity 1.1s;
}
.train.depart { transform: translateX(130%); opacity: 0.2; }
.engine {
  width: 76px;
  height: 76px;
  border-radius: 20px 28px 14px 14px;
  background: var(--terracotta);
  color: #fff7ef;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 0 var(--terracotta-deep);
  flex: 0 0 auto;
}
.engine .icon { width: 44px; height: 44px; }
.carriage {
  width: 60px;
  height: 68px;
  border-radius: 16px;
  background: var(--card);
  border: 3px dashed var(--line-strong);
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary-deep);
  flex: 0 1 auto;
  min-width: 36px;
}
.carriage.next { border-color: var(--ochre); background: var(--ochre-soft); }
.carriage.filled { border: 3px solid var(--primary); background: var(--primary-soft); animation: pop-in 0.25s ease-out; }

.letter-tiles { display: flex; flex-wrap: wrap; gap: var(--gap); justify-content: center; max-width: 560px; }
.letter-btn {
  width: 76px;
  height: 80px;
  border-radius: 22px;
  font-size: 2.3rem;
  font-weight: 900;
  color: var(--ink);
  background: var(--sky-soft);
  border: 2px solid #c9dbea;
  box-shadow: 0 5px 0 #c9dbea;
  animation: float 3.4s ease-in-out infinite;
}
.letter-btn:nth-child(3n) { background: var(--ochre-soft); border-color: #efd7a6; box-shadow: 0 5px 0 #efd7a6; animation-delay: 0.5s; }
.letter-btn:nth-child(3n + 1) { background: var(--sage-soft); border-color: #cfdfc2; box-shadow: 0 5px 0 #cfdfc2; animation-delay: 1s; }
.letter-btn.gone { visibility: hidden; }
.letter-btn:active:not(:disabled) { transform: translateY(3px); }

@media (max-width: 639px) {
  .engine { width: 60px; height: 60px; }
  .engine .icon { width: 34px; height: 34px; }
  .carriage { width: 48px; height: 58px; font-size: 1.6rem; }
  .letter-btn { width: 68px; height: 72px; font-size: 2rem; }
}

/* Letter trace */
.trace-card { padding: 12px; border-radius: 32px; background: var(--card); border: 2px solid var(--line); box-shadow: 0 6px 0 var(--line); }
.trace-canvas { display: block; width: min(400px, 80vw); aspect-ratio: 1; border-radius: 22px; background: var(--paper); touch-action: none; }
.trace-card.trace-done { border-color: var(--primary); box-shadow: 0 6px 0 var(--primary-deep), 0 0 0 6px var(--primary-soft); }
.trace-progress { width: min(400px, 80vw); }

/* Magic microphone */
.mic-btn {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  background: var(--primary);
  color: #fffaf0;
  box-shadow: 0 7px 0 var(--primary-deep), 0 0 0 12px var(--primary-soft);
  display: grid;
  place-items: center;
}
.mic-btn .icon { width: 68px; height: 68px; }
.mic-btn.listening { background: var(--ochre); box-shadow: 0 7px 0 var(--ochre-deep), 0 0 0 12px var(--ochre-soft); animation: ripple 1.2s ease-out infinite; }
.mic-hint { font-size: 1.25rem; font-weight: 800; color: var(--ink-soft); font-family: var(--font-zh); }

@media (max-width: 639px) {
  .choice-grid { gap: 14px; }
  .choice-grid.three { grid-template-columns: repeat(2, minmax(0, 200px)); }
  .letter-tile { min-width: 132px; min-height: 132px; font-size: 4.6rem; }
  .word-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
  .word-card .word-picture { width: 68px; height: 68px; }
  .word-text { font-size: 1.4rem; }
  .yes-no { gap: 14px; }
  .yes-no .btn { min-height: 96px; font-size: 1.5rem; }
}

/* ======================================================================
   Shop
   ====================================================================== */
.shop-layout { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 28px; align-items: start; }
.shop-stage {
  position: sticky;
  top: calc(var(--appbar-h) + 8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  background:
    radial-gradient(ellipse 70% 18% at 50% 88%, rgba(58, 46, 40, 0.08) 0, transparent 70%),
    linear-gradient(180deg, var(--ochre-soft), var(--card) 70%);
}
.shop-stage .shop-buddy { width: min(260px, 80%); }
.shop-buddy .buddy-avatar { width: 100%; }
.shop-buddy .buddy-avatar img { width: 100%; height: auto; }
.shop-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.shop-wallet { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
.shop-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px 16px;
  min-height: 180px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 26px;
  box-shadow: 0 5px 0 var(--line);
  transition: transform 0.12s ease;
}
.shop-item:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--line); }
.shop-pic { width: 72px; height: 72px; display: grid; place-items: center; }
.shop-pic .icon { width: 60px; height: 60px; color: var(--sky); }
.shop-name { font-weight: 900; font-size: 1.1rem; font-family: var(--font-zh); }
.shop-price { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; color: var(--ochre-deep); }
.shop-price .icon { width: 20px; height: 20px; color: var(--ochre); }
.shop-item.worn { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 5px 0 var(--primary-deep); }
.shop-item.owned .shop-price { color: var(--primary-deep); }
.shop-item.poor { opacity: 0.6; }

@media (max-width: 1023px) {
  .shop-layout { grid-template-columns: 1fr; }
  .shop-stage { position: static; flex-direction: row; text-align: left; }
  .shop-stage .shop-buddy { width: 160px; flex: 0 0 auto; }
}

@media (max-width: 639px) {
  .shop-stage { flex-direction: column; text-align: center; }
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
}

/* ======================================================================
   Sticker album
   ====================================================================== */
.album-summary { display: flex; align-items: center; gap: 18px; margin-bottom: 28px; }
.album-summary .progress { flex: 1; max-width: 420px; height: 14px; }
.album-summary .progress-fill { background: var(--ochre); }
.section-title .word-picture { width: 32px; height: 32px; }
.album-section { margin-bottom: 36px; }
.album-tabs { display: flex; flex-wrap: wrap; gap: var(--gap); margin-bottom: 24px; }
.album-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 0 18px 0 12px;
  border-radius: 18px;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: 0 3px 0 var(--line);
  font-weight: 800;
  font-family: var(--font-zh);
}
.album-tab .word-picture { width: 32px; height: 32px; }
.album-tab-count { font-family: var(--font); font-size: 0.85rem; color: var(--ink-soft); }
.album-tab.active { background: var(--accent-soft); border-color: var(--accent); box-shadow: 0 3px 0 var(--accent-deep); color: var(--accent-deep); }
.album-tab.active .album-tab-count { color: var(--accent-deep); }
.album-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.album-count { font-weight: 900; color: var(--accent-deep); }
.sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; }
.sticker {
  position: relative;
  aspect-ratio: 0.9;
  border-radius: 22px;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: 0 4px 0 var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px 10px;
}
.sticker .word-picture { width: 58%; height: auto; flex: 0 0 auto; }
.sticker-word { font-weight: 900; font-size: 0.98rem; }
.sticker-new { background: var(--paper); border-style: dashed; box-shadow: none; }
.sticker-new .word-picture { filter: brightness(0) opacity(0.14); }
.sticker-new .sticker-word { color: var(--ink-faint); }
.sticker-seen .word-picture { filter: grayscale(1); opacity: 0.55; }
.sticker-got { background: linear-gradient(180deg, var(--card), var(--ochre-soft)); border-color: #efd7a6; box-shadow: 0 4px 0 #efd7a6; }
.sticker-star { position: absolute; top: 8px; right: 8px; color: var(--ochre); }
.sticker-star .icon { width: 22px; height: 22px; }

@media (max-width: 639px) {
  .album-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .album-tab { padding: 6px 10px; gap: 8px; font-size: 0.92rem; flex-wrap: wrap; align-content: center; }
  .album-tab .word-picture { width: 26px; height: 26px; }
  .sticker-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .sticker-word { font-size: 0.85rem; }
}

/* ======================================================================
   Parent area
   ====================================================================== */
.kid-zone .parent, .kid-zone .parent * { user-select: text; -webkit-user-select: text; }
.parent-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.parent-grid .span-2 { grid-column: 1 / -1; }
.parent-card h2 { font-size: 1.2rem; font-family: var(--font-zh); display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.parent-card h2 .icon { width: 26px; height: 26px; color: var(--primary); }
.parent-card p + p { margin-top: 8px; }
.parent-actions { display: flex; flex-wrap: wrap; gap: var(--gap); margin-top: 16px; align-items: center; }
.account-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: center; }
.account-hero img { width: 96px; height: 96px; object-fit: contain; }
.account-email { font-size: 1.15rem; font-weight: 900; word-break: break-all; }
.google-button { min-height: 44px; margin-top: 16px; }
.stat-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.stat-tile { padding: 16px; border-radius: 18px; background: var(--paper); border: 1.5px solid var(--line); }
.stat-tile .stat-value { font-size: 1.7rem; }
.stat-tile .stat-label { font-size: 0.88rem; }
.segmented { display: inline-grid; grid-auto-flow: column; gap: 6px; padding: 6px; border-radius: 20px; background: var(--paper-2); }
.segmented button { min-height: 56px; padding: 0 22px; border-radius: 15px; font-size: 1.05rem; font-weight: 800; color: var(--ink-soft); }
.segmented button.active { background: var(--card); color: var(--primary-deep); box-shadow: var(--shadow-card); }
.plan-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.plan-list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--paper); border: 1.5px solid var(--line); border-radius: 14px; font-weight: 700; }
.cloud-message { margin-top: 12px; }
.parent-banner { margin-bottom: 24px; }
.notice-text { flex: 1; }
.parent-card .spaced { margin-top: 16px; }

@media (max-width: 1023px) {
  .parent-grid { grid-template-columns: 1fr; }
}

@media (max-width: 639px) {
  .account-hero { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .parent-actions .btn { flex: 1 1 auto; }
}

/* ======================================================================
   Not found / boot / error
   ====================================================================== */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; padding: 48px 16px; }
.empty-state img { width: 180px; height: 180px; object-fit: contain; }
.empty-state h1 { font-family: var(--font-zh); font-size: 1.8rem; }

.boot { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 18px; }
.boot img { width: 120px; height: 120px; object-fit: contain; animation: breathe 1.8s ease-in-out infinite; }
.boot-name { font-family: var(--font-zh); font-weight: 900; font-size: 1.3rem; color: var(--ink); }

#blazor-error-ui {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 1000;
  max-width: 520px;
  margin: 0 auto;
  padding: 14px 18px;
  border-radius: 18px;
  background: var(--card);
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow-lift);
  font-weight: 700;
  color: var(--ink);
}
#blazor-error-ui .reload { color: var(--primary); text-decoration: underline; margin-left: 8px; }

/* ======================================================================
   Buddy accessories
   ====================================================================== */
.buddy-avatar { position: relative; display: inline-block; line-height: 0; }
.accessory-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }

/* ======================================================================
   Motion
   ====================================================================== */
.bounce { animation: bounce 0.5s ease-out; }
.spin { animation: spin 0.9s linear infinite; }
.game-host { width: 100%; }
.banner-back { display: inline-grid; }
.shake { animation: shake 0.45s ease-in-out; }
.nudge { animation: nudge 2.4s ease-in-out infinite; }

@keyframes bounce { 0% { transform: scale(0.94); } 55% { transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes nudge { 0%, 80%, 100% { transform: translateY(0); } 88% { transform: translateY(-5px); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-4deg) scale(1.04); } 75% { transform: rotate(4deg) scale(1.04); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes correct-pop { 0% { transform: scale(1); } 40% { transform: scale(1.1); } 100% { transform: scale(1); } }
@keyframes pop-in { 0% { transform: scale(0.7); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes rise-in { 0% { transform: translateY(16px) scale(0.97); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes sheet-in { 0% { transform: translateY(100%); } 100% { transform: none; } }
@keyframes fade-in { 0% { opacity: 0; } 100% { opacity: 1; } }
@keyframes shield-in { 0% { opacity: 0; transform: scale(1.8) rotate(-16deg); } 100% { opacity: 1; transform: scale(1); } }
@keyframes shield-in-dim { 0% { opacity: 0; } 100% { opacity: 1; } }
@keyframes paint-in { 0% { opacity: 0.4; transform: scale(0.85); } 100% { opacity: 1; transform: scale(1); } }
@keyframes focus-in { 0% { transform: translate(-50%, -50%) scale(2.2); opacity: 0; } 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
@keyframes ripple { 0% { box-shadow: 0 7px 0 var(--ochre-deep), 0 0 0 0 rgba(217, 154, 43, 0.45); } 100% { box-shadow: 0 7px 0 var(--ochre-deep), 0 0 0 28px rgba(217, 154, 43, 0); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes spin { to { transform: rotate(360deg); } }

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