/* Little Stars — pre-K / kindergarten learning app */

@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url("../fonts/fredoka-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url("../fonts/fredoka-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #fffaf3;
  --ink: #3b2a1a;
  --ink-soft: #6b5344;
  --white: #ffffff;
  --coral: #ff6b57;
  --sun: #ffcc3e;
  --sky: #4da6ff;
  --mint: #2fce86;
  --grape: #9b7aee;
  --pink: #ff7eb6;
  --peach: #ff9f6b;
  --cream: #ffe9b8;
  --line: rgba(59, 42, 26, 0.12);
  --shadow: 0 7px 0 rgba(59, 42, 26, 0.14);
  --shadow-sm: 0 4px 0 rgba(59, 42, 26, 0.12);
  --radius: 28px;
  --radius-sm: 20px;
  --font: "Fredoka", "Trebuchet MS", "Segoe UI Rounded", "Arial Rounded MT Bold", "Segoe UI", system-ui, sans-serif;
  --topbar-h: 72px;
  --footer-h: 56px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background: #8ecbff;
  -webkit-tap-highlight-color: transparent;
  tap-highlight-color: transparent;
}

body {
  overflow: hidden;
  touch-action: manipulation;
}

[hidden] { display: none !important; }

button, input, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  appearance: none;
  -webkit-appearance: none;
}

img, svg { display: block; max-width: 100%; }

/* Sky backdrop */
.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, #7ec8ff 0%, #c7e9ff 38%, #fff3c4 70%, #c8efb0 100%);
  overflow: hidden;
}

.sun {
  position: absolute;
  top: 18px;
  right: 24px;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff7c2, #ffcc3e 55%, #ff9f1a);
  box-shadow: 0 0 0 10px rgba(255, 204, 62, 0.28), 0 0 40px rgba(255, 180, 40, 0.45);
  animation: sun-pulse 6s ease-in-out infinite;
}

.cloud {
  position: absolute;
  background: #fff;
  border-radius: 40px;
  opacity: 0.86;
  box-shadow: 24px 8px 0 -4px #fff, -22px 10px 0 -8px #fff, 0 12px 0 -6px #fff;
  height: 36px;
  width: 90px;
}

.c1 { top: 70px; left: 8%; width: 110px; animation: drift 28s linear infinite; }
.c2 { top: 120px; left: 55%; width: 80px; height: 28px; animation: drift 36s linear infinite reverse; opacity: 0.7; }
.c3 { top: 40px; left: 38%; width: 70px; height: 24px; animation: drift 42s linear infinite; opacity: 0.65; }

.hills {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -40px;
  height: 180px;
  background:
    radial-gradient(ellipse 70% 100% at 20% 100%, #8fd98a 0 60%, transparent 61%),
    radial-gradient(ellipse 80% 120% at 70% 100%, #6fc976 0 58%, transparent 59%),
    radial-gradient(ellipse 50% 80% at 95% 100%, #9ee08a 0 60%, transparent 61%);
}

@keyframes sun-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes drift {
  0% { transform: translateX(0); }
  50% { transform: translateX(40px); }
  100% { transform: translateX(0); }
}

#app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 880px;
  margin: 0 auto;
  padding: calc(var(--safe-t) + 8px) calc(var(--safe-r) + 14px) calc(var(--safe-b) + 8px) calc(var(--safe-l) + 14px);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--topbar-h);
  padding: 4px 0 8px;
}

.topbar-title {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.topbar-title h1 {
  margin: 0;
  font-size: clamp(1.35rem, 4.5vw, 2rem);
  font-weight: 650;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.5);
  line-height: 1.15;
}

.page-sub {
  margin: 2px 0 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
  font-weight: 550;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  font-size: 1.6rem;
  display: grid;
  place-items: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  flex-shrink: 0;
}

.icon-btn:hover { transform: translateY(-1px); }
.icon-btn:active,
.icon-btn.is-pressed {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(59, 42, 26, 0.12);
}

.icon-btn:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 3px;
}

.star-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--white);
  border-radius: 999px;
  padding: 8px 12px 8px 10px;
  font-weight: 700;
  font-size: 1.15rem;
  box-shadow: var(--shadow-sm);
  min-width: 64px;
  justify-content: center;
}

.star-chip.is-pop { animation: pop 0.45s ease; }

.main {
  flex: 1;
  overflow: auto;
  padding: 4px 2px 12px;
  -webkit-overflow-scrolling: touch;
}

.footer {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: var(--footer-h);
  padding-top: 4px;
}

/* Who is playing */
.who-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 12px 8px 28px;
}

.who-hello {
  font-size: clamp(1.6rem, 6vw, 2.3rem);
  margin: 8px 0 0;
  text-align: center;
}

.who-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  width: 100%;
  max-width: 520px;
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border-radius: 32px;
  padding: 28px 16px 22px;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  min-height: 200px;
}

.profile-card:active {
  transform: translateY(5px);
  box-shadow: 0 2px 0 rgba(59, 42, 26, 0.12);
}

.profile-avatar {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 4rem;
  background: linear-gradient(180deg, #fff, #ffe9c2);
  box-shadow: inset 0 -6px 0 rgba(59, 42, 26, 0.06);
  line-height: 1;
}

.profile-name {
  font-size: 1.45rem;
  font-weight: 650;
}

/* Home menu */
.home-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 0 14px;
}

.player-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border-radius: 999px;
  padding: 6px 14px 6px 6px;
  box-shadow: var(--shadow-sm);
  font-weight: 650;
  font-size: 1.05rem;
}

.player-pill .av { font-size: 1.5rem; line-height: 1; }

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

@media (min-width: 640px) {
  .menu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}

.activity-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 132px;
  padding: 16px 10px 14px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  overflow: hidden;
}

.activity-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 10px;
  background: var(--card-color, var(--sky));
}

.activity-card:active {
  transform: translateY(5px);
  box-shadow: 0 2px 0 rgba(59, 42, 26, 0.12);
}

.activity-card:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 3px;
}

.activity-icon { font-size: 2.7rem; line-height: 1; }
.activity-label { font-size: 1.15rem; font-weight: 650; }
.activity-stars {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-soft);
}

/* Activity chrome */
.activity-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border-radius: 999px;
  padding: 8px 14px;
  box-shadow: var(--shadow-sm);
  font-weight: 600;
  font-size: 1rem;
}

.pill.is-on {
  background: var(--ink);
  color: #fff;
  box-shadow: none;
}

.seg {
  display: inline-flex;
  background: var(--white);
  border-radius: 999px;
  padding: 4px;
  box-shadow: var(--shadow-sm);
  gap: 2px;
}

.seg button {
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 650;
  font-size: 0.95rem;
}

.seg button.is-on {
  background: var(--ink);
  color: #fff;
}

.prompt {
  text-align: center;
  font-size: clamp(1.35rem, 5vw, 1.9rem);
  font-weight: 650;
  margin: 4px 0 16px;
  line-height: 1.25;
  text-shadow: 0 2px 0 rgba(255,255,255,0.45);
}

.progress-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0 0 14px;
}

.progress-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(59, 42, 26, 0.18);
}

.progress-dots span.is-done { background: var(--sun); box-shadow: 0 0 0 3px rgba(255, 204, 62, 0.35); }
.progress-dots span.is-now { background: var(--sky); transform: scale(1.2); }

/* Visuals */
.objects {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 10px;
  margin: 0 auto 18px;
  max-width: 560px;
  min-height: 120px;
  padding: 10px;
  background: rgba(255,255,255,0.55);
  border-radius: var(--radius);
}

.objects .obj {
  font-size: clamp(2.1rem, 8vw, 3.2rem);
  line-height: 1;
  display: inline-block;
  animation: pop-in 0.35s ease both;
}

.math-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
}

.math-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  background: rgba(255,255,255,0.7);
  border-radius: 22px;
  padding: 12px;
  min-width: 100px;
  min-height: 80px;
  align-items: center;
}

.math-group .obj { font-size: 2.1rem; line-height: 1; }
.math-op {
  font-size: 2.4rem;
  font-weight: 700;
  padding: 0 4px;
}

.obj.is-gone {
  opacity: 0.28;
  filter: grayscale(0.5);
}

/* Choices */
.choices {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 8px auto 16px;
  max-width: 640px;
}

.choice {
  min-width: 86px;
  min-height: 86px;
  padding: 12px 16px;
  border-radius: 24px;
  background: var(--white);
  box-shadow: var(--shadow);
  font-size: 2rem;
  font-weight: 700;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.2s ease;
  display: grid;
  place-items: center;
  line-height: 1;
}

.choice.wide {
  min-width: 140px;
  font-size: 1.6rem;
  padding: 18px 22px;
}

.choice.pic {
  min-width: 120px;
  min-height: 120px;
  flex-direction: column;
  gap: 4px;
  font-size: 2.6rem;
  padding: 14px 12px 10px;
}

.choice.pic .word {
  font-size: 1.15rem;
  font-weight: 650;
}

.choice:active { transform: translateY(5px); box-shadow: 0 2px 0 rgba(59, 42, 26, 0.12); }
.choice:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }

.choice.is-correct {
  background: #c9f7d6;
  box-shadow: 0 7px 0 #2fce86;
  animation: pop 0.4s ease;
}

.choice.is-wrong {
  background: #ffe1c8;
  animation: shake 0.45s ease;
}

.choice.is-disabled { pointer-events: none; opacity: 0.55; }

/* Shapes grid */
.shapes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 420px;
  margin: 0 auto 16px;
}

@media (min-width: 520px) {
  .shapes-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.shape-btn {
  aspect-ratio: 1;
  border-radius: 24px;
  background: var(--white);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  padding: 12px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.shape-btn:active { transform: translateY(5px); box-shadow: 0 2px 0 rgba(59, 42, 26, 0.12); }
.shape-btn:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.shape-btn.is-correct { background: #c9f7d6; animation: pop 0.4s ease; }
.shape-btn.is-wrong { background: #ffe1c8; animation: shake 0.45s ease; }
.shape-btn svg, .shape-btn .shape-emoji { width: 72%; height: 72%; font-size: 3.4rem; }

.shapes-grid .choice {
  aspect-ratio: 1;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: auto;
  padding: 14px;
}
.shapes-grid .choice svg {
  width: 80%;
  height: 80%;
}

/* Alphabet */
.letter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0 auto 16px;
  max-width: 560px;
}

@media (min-width: 520px) {
  .letter-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}

.letter-tile {
  aspect-ratio: 1;
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  font-size: clamp(1.3rem, 4.8vw, 1.9rem);
  font-weight: 700;
  display: grid;
  place-items: center;
  transition: transform 0.1s ease;
}

.letter-tile:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(59, 42, 26, 0.12); }
.letter-tile:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

.letter-card {
  background: var(--white);
  border-radius: 32px;
  box-shadow: var(--shadow);
  padding: 22px 16px 20px;
  text-align: center;
  max-width: 420px;
  margin: 0 auto 16px;
}

.letter-big {
  font-size: clamp(5rem, 22vw, 8rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0.02em;
}

.letter-word {
  font-size: 1.8rem;
  font-weight: 650;
  margin-top: 4px;
}

.letter-word .em { font-size: 2.4rem; }

.blend-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 8px 0 18px;
}

.blend-tile {
  width: 84px;
  height: 96px;
  border-radius: 22px;
  background: var(--white);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  font-size: 2.8rem;
  font-weight: 700;
  transition: transform 0.2s ease, background 0.2s ease;
}

.blend-tile.is-lit {
  background: var(--sun);
  transform: scale(1.08);
}

.pattern-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 8px 0 20px;
  font-size: clamp(2.4rem, 8vw, 3.4rem);
}

.pattern-slot {
  width: 1.35em;
  height: 1.35em;
  border-radius: 18px;
  background: var(--white);
  box-shadow: inset 0 0 0 4px rgba(59, 42, 26, 0.12);
  display: grid;
  place-items: center;
  animation: pulse-slot 1.2s ease-in-out infinite;
}

@keyframes pulse-slot {
  0%, 100% { box-shadow: inset 0 0 0 4px rgba(77, 166, 255, 0.35); }
  50% { box-shadow: inset 0 0 0 6px rgba(77, 166, 255, 0.7); }
}

/* Tracing */
.trace-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.trace-board {
  width: min(92vw, 420px);
  aspect-ratio: 1;
  background: var(--white);
  border-radius: 32px;
  box-shadow: var(--shadow);
  touch-action: none;
  cursor: crosshair;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 56px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  font-weight: 650;
  font-size: 1.1rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(59, 42, 26, 0.12); }
.btn:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }

.btn.primary {
  background: var(--sky);
  color: #fff;
  box-shadow: 0 6px 0 #2c7ad4;
}

.btn.good {
  background: var(--mint);
  color: #133d28;
  box-shadow: 0 6px 0 #1ea368;
}

.btn.warn {
  background: var(--peach);
  box-shadow: 0 6px 0 #e07a40;
}

/* Stickers */
.sticker-album {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 520px;
  margin: 0 auto 20px;
}

@media (min-width: 560px) {
  .sticker-album { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.sticker {
  aspect-ratio: 1;
  border-radius: 24px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 2.5rem;
}

.sticker.is-locked {
  background: rgba(255,255,255,0.55);
  filter: grayscale(1);
  opacity: 0.55;
  font-size: 2rem;
}

.sticker .need {
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--ink-soft);
}

.stats-line {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 16px;
}

/* Parent corner */
.parent-panel {
  background: rgba(255,255,255,0.92);
  border-radius: 28px;
  padding: 18px 16px 22px;
  box-shadow: var(--shadow);
  max-width: 560px;
  margin: 0 auto 20px;
}

.parent-panel h2 {
  margin: 0 0 6px;
  font-size: 1.5rem;
}

.parent-panel p.hint {
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-weight: 500;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field label { font-weight: 650; font-size: 1rem; }

.field input[type="text"] {
  min-height: 52px;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: #fff;
  padding: 8px 14px;
  font-size: 1.2rem;
  font-weight: 600;
  width: 100%;
}

.field input[type="text"]:focus {
  outline: 3px solid var(--sky);
  border-color: transparent;
}

.avatar-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.avatar-picks button {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: #fff8ea;
  font-size: 1.7rem;
  box-shadow: var(--shadow-sm);
}

.avatar-picks button.is-on {
  background: var(--sun);
  box-shadow: 0 0 0 3px var(--ink);
}

.parent-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 8px;
}

.parent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

/* Grown-ups hold button */
.parent-hold {
  position: relative;
  overflow: hidden;
  min-height: 40px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.55);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.85rem;
  min-width: 132px;
}

.parent-hold-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: rgba(77, 166, 255, 0.45);
  transition: width 0.05s linear;
}

.parent-hold-label { position: relative; z-index: 1; }

.parent-hold.is-holding { background: rgba(255,255,255,0.9); }

/* Feedback toast */
.feedback {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-b));
  transform: translateX(-50%) translateY(20px);
  background: var(--white);
  border-radius: 999px;
  padding: 14px 22px;
  font-size: 1.25rem;
  font-weight: 700;
  box-shadow: var(--shadow);
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  text-align: center;
  max-width: calc(100vw - 32px);
}

.feedback.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.feedback.is-good { background: #c9f7d6; }
.feedback.is-try { background: #fff0c9; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(40, 24, 10, 0.35);
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-card {
  background: var(--white);
  border-radius: 32px;
  padding: 28px 22px 22px;
  box-shadow: var(--shadow);
  text-align: center;
  max-width: 400px;
  width: 100%;
  animation: pop 0.4s ease;
}

.modal-card h2 { margin: 0 0 8px; font-size: 1.7rem; }
.modal-card p { margin: 0 0 16px; font-size: 1.15rem; font-weight: 550; }
.modal-sticker { font-size: 4.5rem; line-height: 1; margin: 4px 0 10px; }

.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 25;
}

/* Animations */
@keyframes pop {
  0% { transform: scale(0.7); }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes pop-in {
  from { transform: scale(0.4) rotate(var(--r, 0deg)); opacity: 0; }
  to { transform: scale(1) rotate(var(--r, 0deg)); opacity: 1; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

@keyframes star-fly {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.4); }
}

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

/* Landscape compact */
@media (max-height: 500px) and (orientation: landscape) {
  :root { --topbar-h: 56px; }
  .icon-btn { width: 48px; height: 48px; }
  .objects { min-height: 70px; padding: 6px; }
  .objects .obj, .math-group .obj { font-size: 1.7rem; }
  .choice { min-width: 70px; min-height: 64px; font-size: 1.5rem; }
  .activity-card { min-height: 100px; }
  .hills { height: 80px; }
}

/* High contrast / readability */
@media (prefers-contrast: more) {
  .choice, .activity-card, .icon-btn, .letter-tile {
    box-shadow: 0 0 0 2px var(--ink), var(--shadow);
  }
}
