/* Eva's & Max's Sticker Life – overlay UI styles (title, map, level done,
   menu, toast). Same family look as the other Eva's & Max's games (see
   ../BRAND.md): Fredoka, chunky rounded buttons with a solid bottom edge, ink
   outlines and the wordmark. This game is the calm one, so its own accents
   are soft pastels (sage, peach, lavender, cream) and everything moves
   slowly. The 3D diorama (#scene) sits behind #ui; the play screen's own
   styles (tray, tweezers, HUD) are in play.css. */

@font-face { font-family: 'Fredoka'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/fredoka-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Fredoka'; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/fredoka-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Fredoka'; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/fredoka-latin-700-normal.woff2) format('woff2'); }

:root {
  --ink: #3d2c55;
  --ink-soft: #7d6c93;
  --paper: #fffaf2;
  --line: #efe3d2;
  --line-d: #e3d3bc;
  --green: #4cc76a;
  --green-d: #2f9a4c;
  --blue: #4dabf7;
  --blue-d: #2b84cc;
  --yellow: #ffd43b;
  --yellow-d: #dba600;
  --red: #ff6b6b;
  --red-d: #d14848;
  /* this game's own (calm) accents */
  --sage: #9ccaa0;
  --sage-d: #6fa678;
  --sage-l: #e5f3e3;
  --peach: #ffcdb2;
  --coral: #ff8f73;
  --coral-d: #e0674d;
  --peach-l: #fff0e6;
  --lavender: #c9b8f2;
  --lavender-d: #9d87d8;
  --lavender-l: #f1ecfd;
  --cream: #fff6e6;
  --sky-top: #f3ecfb;
  --sky-bottom: #fff3e6;
  --font: 'Fredoka', ui-rounded, 'SF Pro Rounded', 'Arial Rounded MT Bold', 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --shadow: 0 12px 34px rgba(61, 44, 85, 0.18);
  --edge: 14px;
  /* a die-cut sticker's white border round text (8px), with a thin ink line inside */
  --ink-ring: 2.5px 0 0 var(--ink), 2.2px 1.2px 0 var(--ink), 1.2px 2.2px 0 var(--ink), 0 2.5px 0 var(--ink), -1.2px 2.2px 0 var(--ink), -2.2px 1.2px 0 var(--ink), -2.5px 0 0 var(--ink), -2.2px -1.2px 0 var(--ink), -1.2px -2.2px 0 var(--ink), 0 -2.5px 0 var(--ink), 1.2px -2.2px 0 var(--ink), 2.2px -1.2px 0 var(--ink);
  --white-ring: 5px 0 0 #fff, 3.5px 3.5px 0 #fff, 0 5px 0 #fff, -3.5px 3.5px 0 #fff, -5px 0 0 #fff, -3.5px -3.5px 0 #fff, 0 -5px 0 #fff, 3.5px -3.5px 0 #fff,
    9px 0 0 #fff, 8.6px 2.8px 0 #fff, 7.3px 5.3px 0 #fff, 5.3px 7.3px 0 #fff, 2.8px 8.6px 0 #fff, 0 9px 0 #fff, -2.8px 8.6px 0 #fff, -5.3px 7.3px 0 #fff, -7.3px 5.3px 0 #fff, -8.6px 2.8px 0 #fff, -9px 0 0 #fff, -8.6px -2.8px 0 #fff, -7.3px -5.3px 0 #fff, -5.3px -7.3px 0 #fff, -2.8px -8.6px 0 #fff, 0 -9px 0 #fff, 2.8px -8.6px 0 #fff, 5.3px -7.3px 0 #fff, 7.3px -5.3px 0 #fff, 8.6px -2.8px 0 #fff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 205, 178, 0.45), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(156, 202, 160, 0.35), transparent 45%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 100%) fixed;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-font-smoothing: antialiased;
}

#scene { position: fixed; inset: 0; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }

button, a.btn { font-family: inherit; color: inherit; touch-action: manipulation; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 4px solid rgba(157, 135, 216, 0.75); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ---------- chunky buttons (shared brand style) ---------- */

.btn {
  --b: #fff;
  --bd: var(--line-d);
  --fg: var(--ink);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 0 22px;
  border: 0;
  border-radius: 18px;
  font-size: 21px;
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 55%), var(--b);
  box-shadow: 0 6px 0 var(--bd), 0 12px 18px rgba(61, 44, 85, 0.14);
  transition: transform 0.1s, box-shadow 0.1s, filter 0.2s, opacity 0.2s;
  white-space: nowrap;
}
.btn:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 var(--bd), 0 4px 8px rgba(61, 44, 85, 0.14); }
.btn:disabled { opacity: 0.5; filter: grayscale(0.6); cursor: default; }
.btn .ico { font-size: 0.95em; }
.btn-green { --b: var(--green); --bd: var(--green-d); --fg: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.15); }
.btn-blue { --b: var(--blue); --bd: var(--blue-d); --fg: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.15); }
.btn-red { --b: var(--red); --bd: var(--red-d); --fg: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.15); }
.btn-yellow { --b: var(--yellow); --bd: var(--yellow-d); --fg: #5a3d00; }
.btn-sage { --b: var(--sage); --bd: var(--sage-d); --fg: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.14); }
.btn-coral { --b: var(--coral); --bd: var(--coral-d); --fg: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.14); }
.btn-lavender { --b: #a48be4; --bd: #7c62c4; --fg: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.14); }
.btn-soft { --b: #fff; --bd: var(--line-d); --fg: var(--ink); }
.btn-big { min-height: 64px; font-size: 24px; border-radius: 20px; padding: 0 28px; }
.btn-huge { min-height: 72px; font-size: 29px; border-radius: 24px; box-shadow: 0 8px 0 var(--bd), 0 16px 24px rgba(61, 44, 85, 0.18); }
.btn-huge:active:not(:disabled) { transform: translateY(7px); }

.round-btn {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  background: #fff;
  box-shadow: 0 4px 0 var(--line-d), 0 6px 14px rgba(61, 44, 85, 0.14);
  transition: transform 0.1s, box-shadow 0.1s, opacity 0.2s, filter 0.2s;
}
.round-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line-d); }
.round-btn.off { opacity: 0.55; filter: grayscale(1); }
.round-btn.on { background: var(--yellow); box-shadow: 0 4px 0 var(--yellow-d), 0 6px 14px rgba(61, 44, 85, 0.14); }

/* a paper card with 28px corners (title, map, level done, menu) */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: 100%;
  background: var(--paper);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; background: #fff; box-shadow: 0 3px 0 var(--line-d); font-size: 18px; font-weight: 600; white-space: nowrap; }
.pill-sage { background: var(--sage-l); color: #3f7a4a; box-shadow: 0 3px 0 #c3e2c4; }
.pill-lavender { background: var(--lavender-l); color: #6a52b0; box-shadow: 0 3px 0 #dcd1f7; }

/* ---------- screens (overlays) ---------- */

.screen { position: absolute; inset: 0; opacity: 0; transition: opacity 0.45s; }
.screen.in { opacity: 1; }
.screen.out { opacity: 0; pointer-events: none; }

/* a sheet of stickers: pastel dots on peach with a scalloped bottom edge */
.sticker-strip {
  position: relative;
  height: 30px;
  flex: none;
  background:
    radial-gradient(circle, #fff 0 4px, transparent 4.5px) 0 0 / 28px 28px,
    radial-gradient(circle, var(--sage) 0 5px, transparent 5.5px) 14px 14px / 28px 28px,
    radial-gradient(circle, var(--lavender) 0 3px, transparent 3.5px) 7px 21px / 28px 28px,
    var(--peach);
}
.sticker-strip::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 9px;
  background: radial-gradient(circle at 50% 0, var(--peach) 0 9px, transparent 9.5px) 0 0 / 18px 9px repeat-x;
}

/* ---------- the wordmark ---------- */

.logo { margin: 6px 0 0; text-align: center; line-height: 1; }
.logo-top { display: block; font-size: 40px; font-weight: 700; letter-spacing: 0.5px; }
.logo-top .ltr {
  display: inline-block;
  color: var(--c);
  transform: rotate(var(--tilt));
  text-shadow: 3px 0 #fff, -3px 0 #fff, 0 3px #fff, 0 -3px #fff, 2px 2px #fff, -2px -2px #fff, 2px -2px #fff, -2px 2px #fff, 0 7px 0 rgba(61, 44, 85, 0.2);
  animation: letterIn 0.7s cubic-bezier(0.2, 1.6, 0.4, 1) calc(var(--i) * 55ms + 150ms) both;
}
.logo-top .sp { display: inline-block; width: 0.3em; }
.logo-game { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0 18px; margin-top: 8px; padding: 8px 0 10px; }
/* each word is a die-cut sticker: coloured letters, a thin ink line, a thick white border and a soft lift off the page */
.logo-sticker {
  position: relative;
  display: inline-block;
  font-size: 56px;
  font-weight: 700;
  letter-spacing: 3px;
  text-shadow: var(--ink-ring), var(--white-ring);
  filter: drop-shadow(0 5px 0 rgba(61, 44, 85, 0.16)) drop-shadow(0 8px 10px rgba(61, 44, 85, 0.14));
  animation: stickIn 0.8s cubic-bezier(0.2, 1.4, 0.4, 1) 0.75s both;
}
.logo-sticker.s1 { color: var(--coral); --rot: -4deg; transform: rotate(-4deg); }
.logo-sticker.s2 { color: #6fbf7d; --rot: 3deg; transform: rotate(3deg); animation-delay: 0.95s; }
/* a little sparkle stuck on the corner of LIFE */
.logo-sticker.s2::after {
  content: '✦';
  position: absolute;
  right: -14px;
  top: -14px;
  font-size: 26px;
  color: var(--yellow);
  letter-spacing: 0;
  text-shadow: var(--ink-ring);
  animation: twinkle 2.8s ease-in-out 2s infinite;
}
.tagline { margin: 14px 0 6px; text-align: center; font-size: 18px; color: var(--ink-soft); }

/* ---------- Eva and Max ---------- */

.kid { position: absolute; bottom: -6px; width: calc(var(--kid-h) * 0.8); height: var(--kid-h); overflow: visible; animation: kidIn 0.8s cubic-bezier(0.2, 1.5, 0.4, 1) 1.1s both; }
.kid-eva { left: -12px; }
.kid-max { right: -12px; animation-delay: 1.25s; }
.kid-shadow { fill: rgba(61, 44, 85, 0.14); animation: kidShadow 1.4s ease-in-out infinite alternate; }
.kid-body { animation: kidBob 1.4s ease-in-out infinite alternate; }
.kid-head { animation: kidTilt 2.6s ease-in-out infinite alternate; }
.kid-eyes { animation: kidBlink 4.8s infinite; }
.kid-pony { animation: kidPony 1.4s ease-in-out infinite alternate; }
.kid-eva .kid-wave { animation: kidWaveL 0.6s ease-in-out infinite alternate; }
.kid-max .kid-wave { animation: kidWaveR 0.6s ease-in-out -0.3s infinite alternate; }
.kid-max .kid-body, .kid-max .kid-shadow { animation-delay: -0.7s; }
.kid-max .kid-head { animation-delay: -1.3s; animation-direction: alternate-reverse; }
.kid-max .kid-eyes { animation-delay: 1.8s; }

/* ---------- title ---------- */

.title-screen { display: grid; place-items: center; padding: var(--edge); }
.title-card {
  width: min(580px, 100%);
  transform: translateY(24px) scale(0.97);
  transition: transform 0.6s cubic-bezier(0.2, 1.3, 0.4, 1);
}
.title-screen.in .title-card { transform: none; }
.title-home, .title-music { position: absolute; top: 46px; z-index: 2; }
.title-home { left: 16px; }
.title-music { right: 16px; }
.title-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 22px 26px 4px; }
.title-hero { --kid-h: 136px; position: relative; padding: 0 calc(var(--kid-h) * 0.62); min-width: 0; }
/* family mode: "Who's playing?" under the logo */
.who { margin: 12px 0 2px; text-align: center; }
.who-title { margin: 0 0 6px; font-size: 16px; font-weight: 700; color: var(--ink-soft); }
.who-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.who-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 76px; max-width: 120px; padding: 6px 10px 6px; border: 3px solid transparent; border-radius: 18px; background: #fff; box-shadow: 0 3px 0 var(--line-d); font: inherit; color: var(--ink); cursor: pointer; transition: transform 0.15s; }
.who-btn:active { transform: translateY(2px); }
.who-btn.me { border-color: var(--lavender, #9775fa); background: var(--lavender-l, #f1ecff); }
.who-btn .kid { position: static; width: 44px; height: 55px; animation: none; }
.who-btn .kid * { animation: none; }
.who-name { font-size: 15px; font-weight: 700; max-width: 100%; overflow-wrap: anywhere; line-height: 1.1; }
.title-how { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px; margin: 6px 0 4px; }
.title-how .pill { font-size: 15px; padding: 5px 12px; }
.title-actions { display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 16px 22px 22px; border-top: 3px dashed var(--line); }
.title-back { text-align: center; font-weight: 600; font-size: 18px; color: var(--ink, #3d2c55); text-decoration: underline; text-underline-offset: 3px; opacity: 0.8; padding: 6px; }
.title-back:hover { opacity: 1; }

/* ---------- map ---------- */

.map-screen { display: grid; place-items: center; padding: var(--edge); background: rgba(255, 246, 230, 0.55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.map-card {
  width: min(980px, 100%);
  transform: translateY(24px);
  transition: transform 0.55s cubic-bezier(0.2, 1.3, 0.4, 1);
}
.map-screen.in .map-card { transform: none; }
.map-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 18px 24px 24px; }
.map-head { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.map-title { flex: 1; margin: 0; font-size: 32px; text-align: center; }
.map-count { font-size: 18px; }
.map-count .num { font-weight: 700; }
.mini-sticker {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--coral);
  border: 3px solid #fff;
  box-shadow: 0 0 0 1.5px var(--ink), 0 2px 3px rgba(61, 44, 85, 0.25);
  font-size: 12px;
  transform: rotate(-8deg);
}

.map-path { display: flex; align-items: center; justify-content: center; gap: 0; margin: 22px 0 10px; padding: 8px 0 30px; }
.map-link {
  flex: 0 1 46px;
  min-width: 18px;
  height: 0;
  border-top: 6px dotted var(--lavender);
  margin: 0 2px;
}
.map-link:nth-of-type(odd) { transform: translateY(16px) rotate(22deg); }
.map-link:nth-of-type(even) { transform: translateY(16px) rotate(-22deg); }
.map-link.done { border-top-color: var(--sage); }

/* a level is a big sticker: paper inside a white die-cut edge */
.level-card {
  --tint: var(--peach-l);
  --tint-d: var(--peach);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 1 190px;
  min-width: 0;
  padding: 18px 12px 16px;
  border: 5px solid #fff;
  border-radius: 30px;
  background: var(--tint);
  box-shadow: 0 0 0 2.5px var(--ink), 0 7px 0 2.5px rgba(61, 44, 85, 0.16), 0 14px 22px rgba(61, 44, 85, 0.12);
  text-align: center;
  transition: transform 0.2s cubic-bezier(0.2, 1.4, 0.4, 1), filter 0.2s;
}
.level-card:nth-of-type(odd) { transform: rotate(-2deg); }
.level-card:nth-of-type(even) { transform: translateY(32px) rotate(2deg); }
.level-card:active:not(:disabled) { filter: brightness(0.97); }
.level-card:nth-of-type(odd):active:not(:disabled) { transform: rotate(-2deg) translateY(4px); }
.level-card:nth-of-type(even):active:not(:disabled) { transform: translateY(36px) rotate(2deg); }
.level-card.t1 { --tint: var(--peach-l); --tint-d: var(--peach); }
.level-card.t2 { --tint: var(--sage-l); --tint-d: #c7e3c6; }
.level-card.t3 { --tint: var(--lavender-l); --tint-d: #dcd1f7; }
.level-card.t4 { --tint: #fff7d6; --tint-d: #ffe9a3; }
.level-num {
  position: absolute;
  left: -14px;
  top: -14px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2.5px var(--ink), 0 3px 0 2.5px rgba(61, 44, 85, 0.16);
  font-size: 21px;
  font-weight: 700;
}
.level-emoji {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff, var(--tint-d));
  box-shadow: inset 0 -5px 0 rgba(61, 44, 85, 0.06);
  font-size: 54px;
  line-height: 1;
}
.level-name { margin-top: 10px; font-size: 21px; line-height: 1.1; }
.level-count { margin-top: 4px; font-size: 15px; color: var(--ink-soft); }
.level-badge {
  position: absolute;
  right: -12px;
  top: -12px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 700;
}
.level-card.done .level-badge { background: var(--sage); color: #fff; box-shadow: 0 0 0 3px #fff, 0 0 0 5.5px var(--ink); }
.level-card.locked { cursor: default; }
.level-card.locked .level-emoji { filter: grayscale(1) opacity(0.45); }
.level-card.locked .level-name, .level-card.locked .level-count { opacity: 0.55; }
.level-card.locked { background: #f4efe8; }
.level-card.locked .level-badge { background: #fff; font-size: 19px; box-shadow: 0 0 0 2.5px var(--ink), 0 3px 0 2.5px rgba(61, 44, 85, 0.16); }
.level-go {
  margin-top: 10px;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
  box-shadow: 0 4px 0 var(--green-d);
}
.level-card.current { animation: breathe 2.6s ease-in-out infinite; }
.level-card.current::before {
  content: '';
  position: absolute;
  inset: -14px;
  border-radius: 40px;
  background: radial-gradient(closest-side, rgba(255, 212, 59, 0.35), transparent);
  z-index: -1;
  animation: glow 2.6s ease-in-out infinite;
}

.rooms { margin-top: 26px; padding-top: 16px; border-top: 3px dashed var(--line); }
.section { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 4px; font-size: 22px; }
.section-sub { margin: 0 0 14px; text-align: center; font-size: 15px; color: var(--ink-soft); }
.room-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.room-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 250px;
  padding: 10px 22px 10px 10px;
  border: 0;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 0 0 3px var(--lavender), 0 6px 0 3px var(--lavender-d), 0 12px 18px rgba(61, 44, 85, 0.12);
  text-align: left;
  transition: transform 0.1s, box-shadow 0.1s;
}
.room-card:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 3px var(--lavender), 0 2px 0 3px var(--lavender-d); }
.room-emoji { display: grid; place-items: center; width: 58px; height: 58px; flex: none; border-radius: 18px; background: var(--lavender-l); font-size: 34px; }
.room-text { display: flex; flex-direction: column; gap: 2px; }
.room-text b { font-size: 21px; }
.room-text small { font-size: 14px; color: var(--ink-soft); }
.room-card.locked { cursor: default; background: #f4efe8; box-shadow: 0 0 0 3px var(--line), 0 6px 0 3px var(--line-d); }
.room-card.locked .room-emoji { filter: grayscale(1) opacity(0.45); background: #ebe4da; }
.room-card.locked b { opacity: 0.6; }

/* ---------- level done, menu ---------- */

.done-screen, .menu-screen { display: grid; place-items: center; padding: var(--edge); background: rgba(61, 44, 85, 0.14); }
.done-card, .menu-card {
  align-items: center;
  width: min(520px, 100%);
  overflow-y: auto;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.55s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.in > .done-card, .in > .menu-card { transform: none; }
.done-card .sticker-strip { width: 100%; }
.done-hero { --kid-h: 116px; position: relative; display: flex; flex-direction: column; justify-content: center; width: 100%; min-height: calc(var(--kid-h) + 20px); padding: 24px calc(var(--kid-h) * 0.72) 0; }
.done-hero .kid { animation-delay: 0.35s; }
.done-hero .kid-max { animation-delay: 0.5s; }
.done-hero .kid-eva { left: 16px; }
.done-hero .kid-max { right: 16px; }
.done-title {
  margin: 0;
  font-size: 50px;
  line-height: 1.1;
  color: var(--coral);
  text-shadow: var(--ink-ring), var(--white-ring);
  filter: drop-shadow(0 4px 0 rgba(61, 44, 85, 0.14));
  animation: stickIn 0.8s cubic-bezier(0.2, 1.4, 0.4, 1) 0.15s both;
  --rot: -3deg;
  transform: rotate(-3deg);
}
.done-sub { margin: 10px 0 0; font-size: 19px; color: var(--ink-soft); }
.done-new { margin: 18px 0 8px; font-size: 18px; font-weight: 600; }
.done-stickers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 10px 14px;
  margin: 0 18px;
  padding: 16px 18px;
  border-radius: 22px;
  background:
    radial-gradient(circle, rgba(201, 184, 242, 0.35) 0 2px, transparent 2.5px) 0 0 / 16px 16px,
    var(--lavender-l);
  box-shadow: inset 0 3px 0 rgba(61, 44, 85, 0.05);
}
.done-sticker { --tilt: 0deg; height: 54px; width: auto; max-width: 160px; object-fit: contain; animation: stickerPop 0.6s cubic-bezier(0.2, 1.6, 0.4, 1) var(--d) both; transform: rotate(var(--tilt)); filter: drop-shadow(0 3px 2px rgba(61, 44, 85, 0.15)); }
.done-actions { display: flex; flex-wrap: nowrap; justify-content: center; gap: 12px; width: 100%; margin-top: 22px; padding: 0 22px 24px; }
.done-actions .btn-green { flex: 1 1 0; }

.menu-card { gap: 14px; width: min(440px, 100%); padding: 0 0 24px; }
.menu-card .sticker-strip { width: 100%; }
.menu-card h2 { margin: 22px 0 0; font-size: 32px; }
.menu-toggles { display: flex; justify-content: center; gap: 18px; margin: 2px 0 6px; }
.toggle { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.toggle .round-btn { width: 60px; height: 60px; font-size: 28px; }
.menu-btns { display: flex; flex-direction: column; gap: 14px; width: 100%; padding: 0 24px; }
.menu-btns .btn { width: 100%; }

.toast { position: absolute; top: 86px; left: 50%; max-width: calc(100% - 32px); padding: 10px 22px; border-radius: 999px; background: #fff; color: var(--ink); font-size: 20px; font-weight: 600; box-shadow: 0 0 0 3px var(--lavender), 0 4px 0 3px var(--lavender-d), var(--shadow); transform: translate(-50%, -20px); opacity: 0; transition: 0.4s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none !important; }
.toast.in { transform: translate(-50%, 0); opacity: 1; }

/* ---------- small screens ---------- */

@media (max-width: 760px), (orientation: portrait) {
  .title-screen { padding: 10px; align-items: end; }
  .title-card { width: 100%; max-height: min(100%, 760px); }
}

@media (max-width: 760px) {
  .map-screen { padding: 10px; }
  .map-scroll { padding: 14px 16px 20px; }
  .map-head { flex-wrap: wrap; justify-content: center; }
  .map-title { order: 3; flex: 1 0 100%; font-size: 27px; }
  .map-head .round-btn { margin-right: auto; }
  /* the path winds down the screen instead of across it */
  .map-path { flex-direction: column; align-items: stretch; margin: 14px 0 0; padding: 10px 8px 0; }
  .map-link { flex: none; align-self: center; width: 0; height: 30px; margin: 4px 0; border-top: 0; border-left: 6px dotted var(--lavender); }
  .map-link.done { border-left-color: var(--sage); }
  .map-link:nth-of-type(odd) { transform: rotate(-30deg); }
  .map-link:nth-of-type(even) { transform: rotate(30deg); }
  .level-card { flex: none; flex-direction: row; align-items: center; gap: 12px; width: 90%; padding: 10px 10px 10px 12px; text-align: left; }
  .level-card:nth-of-type(odd) { align-self: flex-start; transform: rotate(-1deg); }
  .level-card:nth-of-type(even) { align-self: flex-end; transform: rotate(1deg); }
  .level-card:nth-of-type(odd):active:not(:disabled) { transform: rotate(-1deg) translateY(3px); }
  .level-card:nth-of-type(even):active:not(:disabled) { transform: rotate(1deg) translateY(3px); }
  .level-emoji { width: 58px; height: 58px; font-size: 34px; flex: none; }
  .level-text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
  .level-name { margin-top: 0; font-size: 19px; overflow-wrap: anywhere; }
  .level-count { margin-top: 2px; }
  .level-go { margin: 0 4px 0 0; flex: none; padding: 5px 12px; font-size: 17px; }
  .level-card.done .level-badge, .level-card.locked .level-badge { position: static; margin: 0 8px 0 0; flex: none; }
  .level-card.locked .level-badge { box-shadow: none; background: none; font-size: 24px; }
  .level-num { width: 34px; height: 34px; font-size: 18px; left: -12px; top: -12px; }
  .rooms { margin-top: 24px; }
  .room-card { min-width: 0; flex: 1 1 240px; }
}
/* the big layout stacks the name and count under the emoji; keep that wrapper invisible */
@media (min-width: 761px) { .level-text { display: contents; } }

@media (max-width: 640px) {
  :root { --edge: 10px; }
  .title-scroll { padding: 18px 16px 4px; }
  .title-hero { --kid-h: min(98px, 22vw); }
  .logo-top { font-size: min(32px, 7.6vw); }
  .logo-sticker { font-size: min(44px, 10.6vw); letter-spacing: 2px; }
  .logo-game { gap: 0 12px; }
  .title-home, .title-music { top: 40px; width: 42px; height: 42px; font-size: 19px; }
  .title-home { left: 8px; }
  .title-music { right: 8px; }
  .tagline { font-size: 16px; margin-top: 10px; }
  .title-how .pill { font-size: 13px; }
  .title-actions { padding: 14px 14px 14px; }
  .btn-huge { min-height: 64px; font-size: 25px; }
  .round-btn { width: 44px; height: 44px; font-size: 20px; }
  .done-hero { --kid-h: 86px; padding-left: 70px; padding-right: 70px; }
  .done-hero .kid-eva { left: 4px; }
  .done-hero .kid-max { right: 4px; }
  .done-title { font-size: 40px; }
  .done-sub { font-size: 16px; }
  .done-sticker { height: 46px; }
  .done-stickers { margin: 0 12px; padding: 12px; }
  .done-actions { padding: 0 14px 18px; }
  .toggle .round-btn { width: 56px; height: 56px; }
  .toast { font-size: 17px; top: 76px; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .title-hero { --kid-h: 96px; }
  .title-scroll { padding-top: 12px; }
  .logo-top { font-size: 30px; }
  .logo-sticker { font-size: 42px; }
  .title-how { display: none; }
  .title-actions { padding: 10px 18px 14px; }
  .map-path { margin-top: 12px; }
  .level-emoji { width: 66px; height: 66px; font-size: 40px; }
  .done-hero { --kid-h: 84px; }
}

/* ---------- animations (slow and soft: this is the calm game) ---------- */

@keyframes letterIn { from { opacity: 0; transform: translateY(-24px) rotate(var(--tilt)) scale(0.5); } to { opacity: 1; transform: rotate(var(--tilt)); } }
/* a sticker being pressed down onto the page */
@keyframes stickIn { 0% { opacity: 0; transform: translateY(-14px) rotate(calc(var(--rot, 0deg) - 10deg)) scale(1.25); } 60% { opacity: 1; transform: rotate(var(--rot, 0deg)) scale(0.96); } 100% { opacity: 1; transform: rotate(var(--rot, 0deg)); } }
@keyframes stickerPop { from { opacity: 0; transform: translateY(16px) rotate(calc(var(--tilt) - 14deg)) scale(0.4); } to { opacity: 1; transform: rotate(var(--tilt)); } }
@keyframes kidIn { from { opacity: 0; transform: translateY(40px) scale(0.3); } to { opacity: 1; transform: none; } }
@keyframes kidBob { from { transform: translateY(0); } to { transform: translateY(-4px); } }
@keyframes kidShadow { from { transform: scale(1); } to { transform: scale(0.88); } }
@keyframes kidTilt { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
@keyframes kidWaveL { from { transform: rotate(-18deg); } to { transform: rotate(-42deg); } }
@keyframes kidWaveR { from { transform: rotate(18deg); } to { transform: rotate(42deg); } }
@keyframes kidPony { from { transform: rotate(-7deg); } to { transform: rotate(8deg); } }
@keyframes kidBlink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.1); } }
@keyframes twinkle { 0%, 100% { transform: scale(1) rotate(0); opacity: 1; } 50% { transform: scale(0.7) rotate(20deg); opacity: 0.75; } }
@keyframes breathe { 0%, 100% { scale: 1; } 50% { scale: 1.04; } }
@keyframes glow { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
