/* =============================================================================
 * Mojn! Min Have — css/style.css
 * Kid-first visual system: HUGE rounded cream cards, a sky→meadow garden hub,
 * a big glowing fox-orange PLAY paw, juicy press/pop animations, the growing
 * collection grid + friends shelf, safe-area insets, prefers-reduced-motion
 * fallback, and TOUCH-FIRST affordances (NO hover-only anything).
 *
 * Zero web-font files (system rounded stack, degrades to system-ui).
 * Zero image files (everything is emoji glyph + CSS).
 * Palette + sizes taken verbatim from the spec styleGuide.
 *
 * The canvas overlay (#fx) styling is enforced in js/draw.js too; the rules
 * here are a belt-and-braces backup.
 * ========================================================================== */

/* ---------------------------------------------------------------------------
 * 1. Design tokens (styleGuide palette, hex-exact)
 * ------------------------------------------------------------------------- */
:root {
  /* Scene */
  --sky:        #bfe3f5;   /* himmelblå — hub gradient top */
  --meadow:     #d8f0c8;   /* soft meadow-green — hub gradient bottom */
  --primary:    #f08a3c;   /* fox-orange — PLAY paw, accents, Mojn */
  --primary-dk: #d9721f;   /* pressed / shadow of primary */
  --cream:      #fff6e9;   /* warm cream — card faces */
  --ink:        #3a2a1e;   /* deep cosy text / outline */
  --shimmer:    #ffd56b;   /* correct-shimmer gold */
  --shimmer-dp: #ffb347;
  --night:      #2b3a55;   /* night-mode dusk for the sleep ending */
  --firefly:    #ffe9a3;

  /* Form */
  --r-card:   32px;        /* card border-radius — no harsh edges anywhere */
  --r-pill:   999px;
  --card-shadow:     0 6px 0 rgba(58, 42, 30, .15);
  --card-shadow-dn:  0 2px 0 rgba(58, 42, 30, .15);
  --soft-shadow:     0 10px 30px rgba(58, 42, 30, .12);

  /* Motion */
  --pop: cubic-bezier(.34, 1.56, .64, 1);   /* springy bounce-in / pop */
  --ease: cubic-bezier(.2, .7, .3, 1);

  /* Safe-area insets (notch / rounded tablet corners) */
  --sa-t: env(safe-area-inset-top, 0px);
  --sa-r: env(safe-area-inset-right, 0px);
  --sa-b: env(safe-area-inset-bottom, 0px);
  --sa-l: env(safe-area-inset-left, 0px);
}

/* ---------------------------------------------------------------------------
 * 2. Reset & base
 * ------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;                 /* the app is a single fixed scene */
  overscroll-behavior: none;        /* no rubber-band on tablets */
  background: var(--sky);
  color: var(--ink);
  font-family: 'Nunito', 'Baloo 2', system-ui, -apple-system,
               'Segoe UI Rounded', 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;   /* no blue flash on tap */
  -webkit-touch-callout: none;
  text-rendering: optimizeLegibility;
}

/* Global touch-first defaults: nothing is selectable/draggable by the child. */
body {
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;       /* kill double-tap zoom delay */
}

img, svg, emoji { -webkit-user-drag: none; user-drag: none; }

/* App root fills the viewport including the safe-area, painting the garden. */
#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, var(--sky) 0%, var(--sky) 38%, var(--meadow) 100%);
  padding:
    var(--sa-t) var(--sa-r) var(--sa-b) var(--sa-l);
  overflow: hidden;
}

/* The celebration canvas overlay — on top, never intercepts taps. */
#fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* ---------------------------------------------------------------------------
 * 3. Screens (the engine swaps which one is .is-active)
 *    main.js / game.js own the markup; CSS just shows/hides + lays out.
 * ------------------------------------------------------------------------- */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  padding: calc(var(--sa-t) + 12px) calc(var(--sa-r) + 16px)
           calc(var(--sa-b) + 16px) calc(var(--sa-l) + 16px);
}
.screen.is-active { display: flex; }
.screen.is-active.fade-in { animation: screenIn .35s var(--ease) both; }

@keyframes screenIn {
  from { opacity: 0; transform: scale(.985); }
  to   { opacity: 1; transform: scale(1); }
}

/* ===========================================================================
 * 4. HOME HUB = "Min Have" (the persistent garden — never a menu)
 * ======================================================================== */
.hub {
  justify-content: space-between;
}

/* --- top: quiet settings cog (visually-quiet corner) --- */
.hub__top {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 56px;
}

.cog {
  width: 56px;
  height: 56px;
  border: none;
  border-radius: var(--r-pill);
  background: rgba(255, 246, 233, .55);
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--card-shadow-dn);
  transition: transform .12s var(--pop), background .15s var(--ease);
  touch-action: manipulation;
}
.cog:active { transform: scale(.9); background: rgba(255, 246, 233, .9); }

/* --- middle: the garden scene with Mojn + placed friends --- */
.garden {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

/* The "ground" band where placed friends roam (meadow strip). */
.garden__ground {
  position: absolute;
  left: 0; right: 0; bottom: 8%;
  top: 30%;
  pointer-events: none;
}

/* Friends placed permanently in the garden as emoji on patches. */
.garden__friend {
  position: absolute;
  font-size: 52px;
  line-height: 1;
  filter: drop-shadow(0 4px 4px rgba(58, 42, 30, .18));
  animation: roam 6s ease-in-out infinite;
  transform-origin: 50% 90%;
}
.garden__friend:nth-child(3n)   { animation-duration: 7.5s; }
.garden__friend:nth-child(3n+1) { animation-duration: 5.5s; }

@keyframes roam {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-8px) rotate(2deg); }
}

/* Newly-arrived friend bounce-in (game.js adds .is-new for one cycle). */
.garden__friend.is-new {
  animation: friendArrive .9s var(--pop) both;
}
@keyframes friendArrive {
  0%   { transform: scale(0) translateY(-40px); opacity: 0; }
  60%  { transform: scale(1.25) translateY(0);  opacity: 1; }
  100% { transform: scale(1); }
}

/* Empty glowing patch = a spoken-word anchor ("bring a friend home"). */
.patch {
  position: absolute;
  width: 96px;
  height: 96px;
  border-radius: var(--r-pill);
  background: radial-gradient(circle at 50% 45%,
              rgba(255, 213, 107, .55), rgba(255, 213, 107, 0) 70%);
  border: 4px dashed rgba(240, 138, 60, .5);
  display: grid;
  place-items: center;
  cursor: pointer;
  animation: patchGlow 2.4s var(--ease) infinite;
  touch-action: manipulation;
}
.patch::after { content: '🌱'; font-size: 40px; opacity: .85; }
@keyframes patchGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 213, 107, .5); transform: scale(1); }
  50%      { box-shadow: 0 0 26px 6px rgba(255, 213, 107, .35); transform: scale(1.05); }
}

/* The sun, sitting a notch higher after idle-bloom (main.js sets --sun). */
.garden__sun {
  position: absolute;
  top: calc(8% + (1 - var(--sun, .4)) * 18%);
  right: 12%;
  font-size: 64px;
  filter: drop-shadow(0 0 18px rgba(255, 213, 107, .8));
  transition: top 1.2s var(--ease);
  animation: sunPulse 5s ease-in-out infinite;
}
@keyframes sunPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}

/* --- Mojn the fox mascot (🦊 + CSS mood variants, zero assets) --- */
.mascot {
  position: relative;
  font-size: 96px;
  line-height: 1;
  display: inline-block;
  transform-origin: 50% 90%;
  filter: drop-shadow(0 6px 6px rgba(58, 42, 30, .22));
  will-change: transform, filter;
}

/* idle = slow breathing scale */
.mascot,
.mascot.is-idle { animation: mascotBreathe 4s ease-in-out infinite; }
@keyframes mascotBreathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.04); }
}

/* happy = gentle bob */
.mascot.is-happy { animation: mascotBob 1.1s var(--ease) infinite; }
@keyframes mascotBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* cheer = bigger bounce + brief brightness/hue lift */
.mascot.is-cheer {
  animation: mascotCheer .6s var(--pop) 2;
  filter: drop-shadow(0 8px 8px rgba(58, 42, 30, .22))
          brightness(1.12) saturate(1.15);
}
@keyframes mascotCheer {
  0%   { transform: translateY(0) scale(1) rotate(0); }
  40%  { transform: translateY(-26px) scale(1.18) rotate(-6deg); }
  70%  { transform: translateY(0) scale(.96) rotate(4deg); }
  100% { transform: translateY(0) scale(1) rotate(0); }
}

/* sleepy = slight tilt + dimming (session end / night) */
.mascot.is-sleepy {
  animation: mascotSleep 4s ease-in-out infinite;
  filter: drop-shadow(0 6px 6px rgba(58, 42, 30, .22))
          brightness(.85) saturate(.9);
}
@keyframes mascotSleep {
  0%, 100% { transform: rotate(-6deg) translateY(0); }
  50%      { transform: rotate(-10deg) translateY(4px); }
}

/* A little speech sparkle when Mojn talks (main.js toggles .is-speaking). */
.mascot.is-speaking::after {
  content: '🗨️';
  position: absolute;
  top: -8px; right: -28px;
  font-size: 36px;
  animation: popIn .3s var(--pop) both;
}
@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* --- the gift-box (kind-gacha) gently bouncing --- */
.giftbox {
  position: absolute;
  bottom: 14%;
  left: 12%;
  font-size: 64px;
  border: none;
  background: transparent;
  cursor: pointer;
  animation: giftBounce 1.6s var(--pop) infinite;
  touch-action: manipulation;
  filter: drop-shadow(0 6px 6px rgba(58, 42, 30, .2));
}
@keyframes giftBounce {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-16px) rotate(3deg); }
}
.giftbox:active { transform: scale(.9); }

/* --- bottom: the big glowing PLAY paw --- */
.hub__bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-bottom: 6px;
}

.play-paw {
  width: 160px;
  height: 160px;
  min-width: 160px;
  min-height: 160px;
  border: none;
  border-radius: var(--r-pill);
  background:
    radial-gradient(circle at 38% 32%, #ffb066 0%, var(--primary) 55%, var(--primary-dk) 100%);
  color: var(--cream);
  font-size: 84px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow:
    0 10px 0 var(--primary-dk),
    0 18px 36px rgba(240, 138, 60, .5);
  animation: pawPulse 1.8s var(--ease) infinite;
  transition: transform .1s var(--pop), box-shadow .1s var(--pop);
  touch-action: manipulation;
  position: relative;
}
.play-paw::after { content: '🐾'; }   /* the paw glyph (wordless PLAY) */
@keyframes pawPulse {
  0%, 100% { box-shadow: 0 10px 0 var(--primary-dk), 0 18px 36px rgba(240,138,60,.45); transform: scale(1); }
  50%      { box-shadow: 0 10px 0 var(--primary-dk), 0 22px 50px rgba(240,138,60,.65); transform: scale(1.05); }
}
.play-paw:active {
  transform: translateY(8px) scale(.97);
  box-shadow: 0 2px 0 var(--primary-dk), 0 6px 14px rgba(240, 138, 60, .4);
  animation: none;
}

/* Optional spoken-label-behind-the-paw text (only if showText). */
.play-label {
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
  opacity: .8;
}

/* --- friends shelf: FACES only, never numbers/scores --- */
.shelf {
  position: absolute;
  top: 50%;
  right: calc(var(--sa-r) + 6px);
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 70%;
  overflow-y: auto;
  padding: 10px 8px;
  border-radius: var(--r-card);
  background: rgba(255, 246, 233, .5);
  box-shadow: var(--card-shadow-dn);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.shelf::-webkit-scrollbar { display: none; }
.shelf__face {
  font-size: 36px;
  line-height: 1;
  filter: drop-shadow(0 2px 2px rgba(58, 42, 30, .15));
}
.shelf__face.is-new { animation: friendArrive .8s var(--pop) both; }

/* ===========================================================================
 * 5. ROUND screen — "Kald din ven hjem" (the no-fail mini-game)
 * ======================================================================== */
.round {
  align-items: center;
  justify-content: space-between;
}

/* Mojn presides over the round at the top, gazing toward the answer zone. */
.round__mascot {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

/* Big replay-the-word button (a speaker) — child can re-hear any time. */
.replay {
  width: 96px;
  height: 96px;
  border: none;
  border-radius: var(--r-pill);
  background: var(--cream);
  color: var(--ink);
  font-size: 48px;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--card-shadow);
  transition: transform .1s var(--pop), box-shadow .1s var(--pop);
  touch-action: manipulation;
}
.replay::after { content: '🔊'; }
.replay:active {
  transform: translateY(4px) scale(.96);
  box-shadow: var(--card-shadow-dn);
}

/* --- the answer-card area: huge cards, few choices, generous spacing --- */
.cards {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  align-content: center;
  gap: clamp(20px, 5vw, 48px);
  width: 100%;
  padding: 16px;
}

/* THE card: huge cream rounded square, ~30vw on tablet, min 120px. */
.card {
  /* sizing — target ~30vw, never below the 120px touch floor, capped sane */
  width: clamp(120px, 30vw, 260px);
  height: clamp(120px, 30vw, 260px);
  min-width: 120px;
  min-height: 120px;
  border: none;
  border-radius: var(--r-card);
  background: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: var(--card-shadow);
  /* juicy springy entrance */
  animation: cardIn .45s var(--pop) both;
  transition: transform .1s var(--pop), box-shadow .1s var(--pop),
              filter .2s var(--ease);
  touch-action: manipulation;
  user-select: none;
  position: relative;
  outline: none;
}

/* stagger the entrances a touch for delight */
.card:nth-child(2) { animation-delay: .06s; }
.card:nth-child(3) { animation-delay: .12s; }
.card:nth-child(4) { animation-delay: .18s; }

@keyframes cardIn {
  0%   { transform: scale(0) translateY(30px); opacity: 0; }
  100% { transform: scale(1) translateY(0);    opacity: 1; }
}

/* the emoji "picture" inside the card — OS native scale ~88px */
.card__emoji {
  font-size: clamp(56px, 14vw, 88px);
  line-height: 1;
  pointer-events: none;
}

/* optional gloss text under the card — OFF for the child (showText gates it) */
.card__label {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  opacity: .75;
  pointer-events: none;
}

/* JUICY PRESS: shadow compresses, card sinks (translateY 4px) */
.card:active {
  transform: translateY(4px) scale(.97);
  box-shadow: var(--card-shadow-dn);
}

/* CORRECT pop — game.js adds .is-correct on a right tap */
.card.is-correct {
  animation: cardPop .55s var(--pop) both;
  background: var(--shimmer);
}
@keyframes cardPop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.18) rotate(-2deg); }
  70%  { transform: scale(.96) rotate(1deg); }
  100% { transform: scale(1); }
}

/* The matching emoji's congruent micro-animation (e.g. the dog wags). */
.card.is-correct .card__emoji { animation: wag .5s var(--ease) 2; }
@keyframes wag {
  0%, 100% { transform: rotate(0); }
  25%      { transform: rotate(-12deg); }
  75%      { transform: rotate(12deg); }
}

/* ---- NO-FAIL SCAFFOLD (a wrong tap is NEVER punished) ---------------- */

/* Tier 1: wrong card = soft giggle/wobble. NO red, NO harsh grey. */
.card.is-wobble { animation: wobble .5s var(--ease) both; }
@keyframes wobble {
  0%, 100% { transform: translateX(0) rotate(0); }
  20%      { transform: translateX(-8px) rotate(-3deg); }
  40%      { transform: translateX(8px) rotate(3deg); }
  60%      { transform: translateX(-5px) rotate(-2deg); }
  80%      { transform: translateX(5px) rotate(2deg); }
}

/* Tier 1: correct card gets a soft gold shimmer hint. */
.card.is-hint {
  animation: shimmer 1.4s var(--ease) infinite;
}
@keyframes shimmer {
  0%, 100% { box-shadow: var(--card-shadow); }
  50%      { box-shadow: var(--card-shadow),
                         0 0 0 6px rgba(255, 213, 107, .55),
                         0 0 30px 8px rgba(255, 213, 107, .45); }
}

/* Tier 2: distractor gently dims (soft, not angry grey). */
.card.is-dimmed {
  filter: saturate(.6) brightness(.92);
  opacity: .65;
}

/* Tier 2: correct card pulses + plays its motion. */
.card.is-pulse {
  animation: cardPulse 1s var(--pop) infinite;
}
@keyframes cardPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.1); }
}

/* Tier 3: correct card GROWS to fill space & bounces toward the finger —
   the child literally cannot fail to eventually succeed. */
.card.is-rescue {
  animation: rescue 1.2s var(--pop) infinite;
  z-index: 5;
  box-shadow: var(--card-shadow),
              0 0 0 8px rgba(255, 213, 107, .6),
              0 0 40px 12px rgba(255, 213, 107, .5);
}
@keyframes rescue {
  0%, 100% { transform: scale(1.15) translateY(0); }
  50%      { transform: scale(1.35) translateY(14px); }
}

/* ===========================================================================
 * 6. NIGHT / SLEEP ending — garden goes to sleep on a high note
 * ======================================================================== */
#app.is-night {
  background: linear-gradient(180deg, var(--night) 0%, #1d2840 100%);
  color: var(--firefly);
  transition: background 1.6s var(--ease), color 1.6s var(--ease);
}
#app.is-night .card,
#app.is-night .replay { background: rgba(255, 246, 233, .85); }

/* Fireflies drift in during the sleep ending (main.js spawns .firefly nodes). */
.firefly {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--firefly);
  box-shadow: 0 0 12px 4px var(--firefly);
  pointer-events: none;
  animation: fly 6s ease-in-out infinite alternate;
  opacity: .9;
}
@keyframes fly {
  from { transform: translate(0, 0); opacity: .4; }
  to   { transform: translate(40px, -30px); opacity: 1; }
}

/* ===========================================================================
 * 7. MODAL / overlays — gift reveal, settings, parent-gate, parent-view
 * ======================================================================== */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: calc(var(--sa-t) + 16px) calc(var(--sa-r) + 16px)
           calc(var(--sa-b) + 16px) calc(var(--sa-l) + 16px);
  background: rgba(58, 42, 30, .35);
  z-index: 200;
  backdrop-filter: blur(2px);
}
.modal.is-open { display: flex; animation: screenIn .25s var(--ease) both; }

.sheet {
  width: min(520px, 100%);
  max-height: 90%;
  overflow-y: auto;
  background: var(--cream);
  border-radius: var(--r-card);
  padding: 24px;
  box-shadow: var(--soft-shadow);
  -webkit-overflow-scrolling: touch;
}
.sheet h2 {
  margin: 0 0 16px;
  font-size: 26px;
  font-weight: 900;
  color: var(--ink);
}

/* gift reveal — the surprise pops big */
.gift-reveal {
  width: min(420px, 100%);
  background: var(--cream);
  border-radius: var(--r-card);
  padding: 32px;
  text-align: center;
  box-shadow: var(--soft-shadow);
  animation: cardPop .6s var(--pop) both;
}
.gift-reveal__emoji {
  font-size: 120px;
  line-height: 1;
  animation: friendArrive 1s var(--pop) both;
}

/* big rounded buttons inside sheets (parent UI) */
.btn {
  appearance: none;
  border: none;
  border-radius: var(--r-pill);
  background: var(--primary);
  color: var(--cream);
  font-size: 22px;
  font-weight: 800;
  font-family: inherit;
  padding: 16px 28px;
  min-height: 60px;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--primary-dk);
  transition: transform .1s var(--pop), box-shadow .1s var(--pop);
  touch-action: manipulation;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--primary-dk); }
.btn--ghost {
  background: rgba(58, 42, 30, .08);
  color: var(--ink);
  box-shadow: none;
}
.btn--danger { background: #c0563a; box-shadow: 0 5px 0 #8f3c25; }

/* settings rows */
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 2px solid rgba(58, 42, 30, .08);
}
.row:last-child { border-bottom: none; }
.row__label { font-size: 20px; font-weight: 700; color: var(--ink); }

/* big number-pad / gate keys */
.gate-keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.gate-keys .btn { font-size: 28px; padding: 18px 0; }
.gate-display {
  text-align: center;
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 8px;
  min-height: 50px;
  color: var(--ink);
}

/* parent view: "Wörter, die dein Kind jetzt kennt" — collection grid */
.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 12px;
}
.collection-cell {
  background: rgba(58, 42, 30, .05);
  border-radius: var(--r-card);
  padding: 18px 12px;
  text-align: center;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.collection-cell__emoji { font-size: 56px; line-height: 1; }
.collection-cell__da { font-size: 20px; font-weight: 800; color: var(--ink); }
.collection-cell__de { font-size: 16px; color: var(--ink); opacity: .65; }
.collection-cell__count {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dk);
}
/* an un-collected word shows as a quiet locked patch */
.collection-cell.is-locked { opacity: .45; }
.collection-cell.is-locked .collection-cell__emoji { filter: grayscale(1); }

/* a native HTML range slider, sized for adult fingers */
input[type="range"] {
  width: 160px;
  accent-color: var(--primary);
  height: 36px;
}
/* native toggle */
input[type="checkbox"].toggle {
  width: 56px; height: 32px;
  accent-color: var(--primary);
  transform: scale(1.4);
}

/* ===========================================================================
 * 8. Utility
 * ======================================================================== */
.hidden { display: none !important; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ===========================================================================
 * 9. RESPONSIVE — phones, small tablets, landscape
 * ======================================================================== */

/* Narrow / portrait phone: shrink mascot & paw a touch, keep cards huge. */
@media (max-width: 480px) {
  .mascot { font-size: 76px; }
  .play-paw { width: 132px; height: 132px; min-width: 132px; min-height: 132px; font-size: 66px; }
  .shelf__face { font-size: 30px; }
}

/* Landscape tablet: cards side-by-side comfortably; paw stays reachable. */
@media (orientation: landscape) and (max-height: 560px) {
  .round__mascot { min-height: 84px; }
  .mascot { font-size: 72px; }
  .card { width: clamp(120px, 24vw, 220px); height: clamp(120px, 24vw, 220px); }
  .play-paw { width: 128px; height: 128px; min-width: 128px; min-height: 128px; font-size: 64px; }
}

/* ===========================================================================
 * 10. REDUCED MOTION — calm fallback (no big bounces / loops / pulses)
 *     Particles are also dialed down in js/draw.js. Here we replace springy
 *     transforms with gentle fades and stop all infinite ambient animation.
 * ======================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .12s !important;
    scroll-behavior: auto !important;
  }

  /* Keep entrances as a simple fade rather than a removed pop. */
  .card,
  .garden__friend.is-new,
  .shelf__face.is-new,
  .gift-reveal,
  .gift-reveal__emoji,
  .screen.is-active.fade-in,
  .modal.is-open {
    animation: gentleFade .25s ease both !important;
  }
  @keyframes gentleFade {
    from { opacity: 0; }
    to   { opacity: 1; }
  }

  /* Ambient idle/roam/pulse/glow loops stop — calm, static scene. */
  .mascot,
  .mascot.is-idle,
  .mascot.is-happy,
  .mascot.is-sleepy,
  .garden__friend,
  .garden__sun,
  .patch,
  .play-paw,
  .giftbox,
  .firefly,
  .card.is-hint,
  .card.is-pulse,
  .card.is-rescue {
    animation: none !important;
  }

  /* The no-fail scaffold still must READ clearly without motion: use a soft
     static glow on the helped card and a quiet dim on distractors. */
  .card.is-hint,
  .card.is-rescue {
    box-shadow: var(--card-shadow),
                0 0 0 6px rgba(255, 213, 107, .6),
                0 0 24px 8px rgba(255, 213, 107, .45) !important;
  }
  .card.is-rescue { transform: scale(1.15); }

  /* Press feedback stays (it's instant + important), just snappier. */
  .card:active,
  .play-paw:active,
  .btn:active { transition-duration: .06s !important; }
}

/* ===========================================================================
 * READING CHANNEL — prompt-word banner + karaoke glow, and home-button fix.
 * Added so the written Danish word is a visible channel from level 0 (passive
 * for the pre-reader, real for the parent/older learner), not voice-only.
 * ========================================================================= */

/* The spoken word, shown big above the cards. */
.prompt-word {
  align-self: center;
  margin: 6px auto 2px;
  padding: 6px 26px;
  font-size: clamp(30px, 7vw, 52px);
  font-weight: 900;
  letter-spacing: .5px;
  color: var(--primary-dk);
  background: var(--cream);
  border-radius: var(--r-pill);
  box-shadow: var(--card-shadow);
  text-shadow: 0 2px 0 rgba(255, 255, 255, .6);
  min-height: 1em;
  line-height: 1.1;
  transform: scale(1);
  transition: transform .2s var(--ease), color .2s var(--ease);
  pointer-events: none;
  user-select: none;
}

/* KARAOKE: glow + gentle pulse while Mojn is speaking the word. */
.prompt-word.is-speaking {
  animation: karaoke 1.15s var(--ease);
}
@keyframes karaoke {
  0%   { transform: scale(1);    color: var(--primary-dk); box-shadow: var(--card-shadow); }
  18%  { transform: scale(1.12); color: var(--primary);
         box-shadow: 0 6px 0 rgba(58,42,30,.15), 0 0 0 6px rgba(240,138,60,.25), 0 0 26px 6px var(--shimmer); }
  100% { transform: scale(1);    color: var(--primary-dk); box-shadow: var(--card-shadow); }
}

/* Home (leave-round) paw: cancel .replay's 🔊 ::after so only 🏡 shows. */
.replay.homebtn::after { content: none; }

@media (prefers-reduced-motion: reduce) {
  .prompt-word.is-speaking { animation: none; color: var(--primary); }
}
