/* Peepsule Autism & ABA — Core Visual & Interactive System
   Warm paper palette, floating tactile cards, accessible touch targets,
   full animations with automatic Calm Mode & prefers-reduced-motion support. */

:root {
  --ink: #263e37;
  --ink-soft: #5c7167;
  --paper: #fbf8f1;
  --card: #ffffff;
  --line: #dce3d5;
  --accent: #cc6245;
  --accent-2: #3f6d54;
  --ring: #3f6d54;
  --pressed: #e7eedf;
  --radius: 24px;
  --shadow: 0 8px 24px #2943370c;
  --pad: 20px;
  color-scheme: light;
}

@font-face {
  font-family: 'Autism Emoji';
  src: url('fonts/emoji.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  padding-bottom: calc(116px + env(safe-area-inset-bottom));
  color: var(--ink);
  font-family: Fredoka, system-ui, 'Apple Color Emoji', 'Segoe UI Emoji', 'Autism Emoji', sans-serif;
  font-weight: 500;
  line-height: 1.35;
  background: radial-gradient(ellipse at 90% 0, #e9efdd85, transparent 48%), var(--paper);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.activity-icon, .emoji, .big-emoji, .room-art, .feature-art, .garden-sun, .garden-flower, .stamp-button, .face {
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Autism Emoji', sans-serif;
}

button {
  font: inherit; color: inherit; border: 0; background: none; cursor: pointer;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
button:focus-visible, [role="button"]:focus-visible {
  outline: 3px solid var(--ring); outline-offset: 4px;
}

.skip-link {
  position: fixed; top: -100px; left: 20px; z-index: 9999;
  padding: 16px 20px; background: #fff; color: var(--ink);
  border: 2px solid var(--ring); border-radius: 12px; font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* ---------- Keyframe Animations ---------- */
@keyframes play-wiggle {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-7deg) scale(1.06); }
  75% { transform: rotate(7deg) scale(1.06); }
}
@keyframes play-pop {
  0% { transform: scale(0.88); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
@keyframes play-swirl {
  0% { transform: scale(0.9) rotate(-10deg); }
  60% { transform: scale(1.07) rotate(6deg); }
  100% { transform: scale(1) rotate(0deg); }
}
@keyframes confetti-fall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateY(102vh) rotate(540deg); opacity: 0; }
}

.wiggle { animation: play-wiggle 320ms cubic-bezier(.36,.07,.19,.97); }
.pop { animation: play-pop 340ms cubic-bezier(.34,1.56,.64,1); }
.swirl { animation: play-swirl 420ms ease-out; }

.confetti {
  position: fixed; inset: 0; z-index: 120;
  pointer-events: none; overflow: hidden;
}
.confetti i {
  position: absolute; top: -18px;
  width: 12px; height: 16px; border-radius: 3px;
  animation-name: confetti-fall;
  animation-timing-function: cubic-bezier(.25,.46,.45,.94);
  animation-fill-mode: forwards;
}

/* ---------- Header ---------- */
.top {
  max-width: 1180px; margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px 20px; padding: 24px var(--pad) 16px;
}
.brand {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  border-radius: 16px; padding: 4px 8px 4px 0;
}
.mark {
  width: 38px; height: 42px; flex: none; border: 0;
  border-radius: 50% 50% 45% 45%;
  background:
    radial-gradient(circle at 35% 42%, #263e37 0 2.2px, transparent 2.7px),
    radial-gradient(circle at 65% 42%, #263e37 0 2.2px, transparent 2.7px),
    radial-gradient(ellipse at 50% 62%, #ce7950 0 4px, transparent 4.5px),
    #e8c375;
  box-shadow: inset -5px -4px 0 #d4aa4e40;
}
.brand h1 {
  margin: 0; color: var(--ink);
  font-size: clamp(28px, 4.5vw, 34px); font-weight: 600; letter-spacing: -0.8px; line-height: 1.1;
}
.brand-dot { color: #bc6848; }
.brand-caption {
  display: block; font-size: 10px; letter-spacing: 1.8px; font-weight: 600; color: var(--ink-soft);
}
.status {
  margin: 0; padding: 10px 18px;
  background: #fffdf9; border: 1px solid var(--line); border-radius: 24px;
  max-width: 34rem; font-size: 16px; font-weight: 500; color: var(--ink);
  box-shadow: 0 3px 10px #263e3708;
}

#app { width: 100%; }
.page { max-width: 1180px; margin: 0 auto; padding: 12px var(--pad) 28px; }

.back {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 54px; margin: 0 0 16px; padding: 10px 22px;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  font-size: 19px; font-weight: 500;
  transition: transform 140ms ease, background-color 140ms ease;
}
.back::before { content: "\2190"; }
.back:hover { background: #f4f7ee; }
.back:active { background: var(--pressed); transform: scale(0.98); }

/* ---------- Shared Room Elements ---------- */
.mat { display: grid; gap: 18px; }
.stage {
  display: grid; place-items: center; gap: 10px; text-align: center;
  min-height: clamp(165px, 30vw, 240px);
  padding: clamp(20px, 4vw, 38px);
  background: var(--card);
  border: 1px solid var(--line); border-radius: 30px; box-shadow: var(--shadow);
}
.big-emoji { font-size: clamp(64px, 18vw, 108px); line-height: 1.05; }
.big-letter { font-size: clamp(72px, 20vw, 124px); font-weight: 600; line-height: 0.95; }
.big-word { font-size: clamp(22px, 4.8vw, 32px); font-weight: 600; max-width: 24ch; }
.hint { margin: 0; font-size: 17px; font-weight: 500; color: var(--ink-soft); }

.room-h { margin: 10px 0 2px; text-align: left; font-size: 22px; font-weight: 600; color: var(--ink); }

.grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
}
.tile {
  display: grid; place-items: center; gap: 2px;
  min-width: 74px; min-height: 74px; aspect-ratio: 1; padding: 8px;
  background: var(--pressed); color: var(--ink) !important;
  border: 1px solid var(--line); border-radius: 20px;
  font-size: 38px; font-weight: 600;
  transition: transform 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}
.tile:hover { transform: translateY(-2px); box-shadow: 0 5px 12px #263e3710; }
.tile:active { background: #d8e4cb; transform: scale(0.96); }
.tile small { font-size: 0.38em; font-weight: 500; color: var(--ink-soft); line-height: 1.15; text-align: center; }
.tile .face, .tile.emoji-tile { font-size: clamp(32px, 7.5vw, 44px); line-height: 1; }

/* ---------- Numbers & Counting ---------- */
.things { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 6px; }
.thing {
  position: relative;
  width: 68px; height: 68px; min-width: 58px; min-height: 58px;
  display: grid; place-items: center; font-size: 34px;
  background: var(--card); border: 2px solid var(--line); border-radius: 20px;
  box-shadow: 0 4px 0 #dce3d560;
  transition: transform 140ms ease, background-color 140ms ease;
}
.thing:hover { transform: translateY(-2px); }
.thing.tapped { background: var(--pressed); outline: 3px solid var(--accent-2); outline-offset: 2px; }
.thing.tapped::after {
  content: "\2713"; position: absolute; top: -7px; right: -7px;
  width: 24px; height: 24px; display: grid; place-items: center;
  background: var(--accent-2); color: #fff; border-radius: 50%;
  font-size: 13px; font-weight: 600;
}

.hundredsbox { display: grid; gap: 12px; }
.hundreds-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hundreds { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; width: 100%; max-width: 620px; margin: 0 auto; }
.hcell {
  aspect-ratio: 1; display: grid; place-items: center;
  font-size: clamp(12px, 2.5vw, 16px); font-weight: 600;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  transition: transform 120ms ease, background-color 120ms ease;
}
.hcell.ten { background: var(--pressed); }
.hcell.lit { background: var(--accent-2); color: #fff; transform: scale(1.08); border-color: var(--accent-2); z-index: 2; }

/* ---------- Colors & Shapes ---------- */
.blobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 14px; }
.blob {
  aspect-ratio: 1; border-radius: 24px; border: 3px solid #fff;
  box-shadow: 0 6px 16px #263e3718, 0 0 0 1px var(--line);
  transition: transform 150ms ease;
}
.blob:hover { transform: scale(1.04); }
.color-word { font-size: clamp(26px, 6vw, 38px); font-weight: 600; text-transform: capitalize; }

.shape-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 14px; }
.shapebtn {
  min-height: 96px; padding: 14px; display: grid; place-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
  transition: transform 150ms ease;
}
.shapebtn:hover { transform: translateY(-3px); }
.shapebtn:active { background: var(--pressed); }
.shapebtn svg { width: 64px; height: 64px; }
.shapebtn small { font-size: 14px; color: var(--ink-soft); font-weight: 500; text-transform: capitalize; }
.shape-big svg { width: clamp(120px, 32vw, 190px); height: auto; }

.animal-name { font-size: clamp(24px, 5vw, 34px); font-weight: 600; text-transform: capitalize; }
.says { font-size: clamp(19px, 4vw, 25px); color: var(--ink-soft); font-weight: 500; }

/* ---------- Music Room ---------- */
.music-now { min-height: 150px; }
.music-now .big-emoji, .music-now .big-letter { font-size: clamp(54px, 13vw, 84px); }
.xylo {
  display: grid; grid-template-columns: repeat(8, minmax(54px, 1fr));
  align-items: end; gap: 10px; width: 100%; max-width: 920px; margin: 0 auto;
}
@media (max-width: 720px) { .xylo { grid-template-columns: repeat(4, minmax(54px, 1fr)); } }
.note {
  width: 100%; min-width: 54px;
  height: calc(92px + var(--scale, 1) * 76px);
  border-radius: 18px; border: 2px solid #ffffff90;
  color: #263e37 !important;
  font-weight: 600; font-size: 17px;
  display: grid; align-items: end; justify-content: center; padding-bottom: 12px;
  box-shadow: 0 6px 0 #263e3718;
  transition: transform 100ms ease;
}
.note:active, .note.hit { transform: translateY(3px); outline: 3px solid var(--accent-2); outline-offset: 2px; }

.pads { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 680px) { .pads { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 980px) { .pads { grid-template-columns: repeat(5, 1fr); } }
.pad {
  --tint: var(--pressed);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 110px; padding: 14px 8px;
  background: color-mix(in srgb, var(--tint) 24%, #fff);
  border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
  transition: transform 120ms ease, background-color 140ms ease;
}
.pad:hover { transform: translateY(-2px); }
.pad .face { font-size: clamp(36px, 7.5vw, 46px); line-height: 1; }
.pad small { font-size: 15px; font-weight: 500; color: var(--ink); }
.pad:active, .pad.hit { background: var(--pressed); transform: scale(0.96); }

.songbox { display: grid; gap: 14px; }
.songlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.song {
  min-height: 54px; padding: 13px 20px; text-align: left;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
  font-size: 18px; font-weight: 500;
  transition: transform 120ms ease, background-color 140ms ease;
}
.song:hover { background: #f6f9f1; transform: translateY(-1px); }
.song:active { background: var(--pressed); transform: scale(0.98); }
.lyrics {
  display: flex; flex-wrap: wrap; gap: 8px 12px;
  font-size: clamp(22px, 4.5vw, 30px); font-weight: 600;
  padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  min-height: 68px; align-items: center;
}
.lyrics:empty { display: none; }
.lyrics .w { opacity: 0.42; transition: opacity 140ms ease, color 140ms ease, transform 140ms ease; }
.lyrics .w.now { opacity: 1; color: var(--accent-2); transform: scale(1.08); }

.beatbox { display: grid; gap: 12px; background: var(--card); padding: 20px; border-radius: 24px; border: 1px solid var(--line); }
.beatgrid { display: grid; gap: 8px; }
.beatrow { display: grid; grid-template-columns: 60px repeat(8, 1fr); gap: 6px; align-items: center; }
.beatlabel { display: grid; place-items: center; font-size: 22px; line-height: 1; }
.beatlabel small { font-size: 11px; font-weight: 500; color: var(--ink-soft); margin-top: 2px; }
.beatcell {
  aspect-ratio: 1; min-height: 36px; border-radius: 12px;
  background: var(--pressed); border: 1px solid var(--line);
  transition: transform 100ms ease, background-color 100ms ease;
}
.beatcell.on { background: var(--accent-2); border-color: var(--accent-2); box-shadow: inset 0 -3px 0 #00000025; }
.beatcell.step { outline: 3px solid var(--accent); outline-offset: 2px; }
.beatctl { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.beatplay, .beatclear {
  min-height: 52px; padding: 10px 20px; border-radius: 18px; font-size: 17px; font-weight: 600;
}
.beatplay { background: var(--accent-2); color: #fff; }
.beatclear { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }

/* ---------- Match Game ---------- */
.board {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  max-width: 560px; margin: 0 auto; width: 100%;
}
.board.cols-3 { grid-template-columns: repeat(3, 1fr); max-width: 440px; }
.mem { aspect-ratio: 1; perspective: 700px; background: none; box-shadow: none; }
.mem .in {
  position: relative; width: 100%; height: 100%;
  transition: transform 240ms cubic-bezier(.4,.2,.2,1);
  transform-style: preserve-3d;
}
.mem.up .in { transform: rotateY(180deg); }
.mem .face {
  position: absolute; inset: 0; display: grid; place-items: center;
  border-radius: 22px; border: 2px solid var(--line);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 5px 0 #dce3d570;
}
.mem .front { background: var(--accent-2); color: #fff; font-size: 1.8rem; font-weight: 600; }
.mem .back { background: var(--card); transform: rotateY(180deg); font-size: clamp(32px, 8vw, 48px); }
.mem.done .back { background: var(--pressed); outline: 3px solid var(--accent-2); }

/* ---------- AAC / I Want ---------- */
.grid.wants { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.aac { gap: 14px; }
.aac-strip {
  min-height: 86px; display: flex; align-items: center; padding: 12px 16px;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.aac-words { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; width: 100%; }
.aac-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
  background: var(--pressed); border: 1px solid var(--line); border-radius: 999px;
  font-size: clamp(18px, 3.8vw, 22px); font-weight: 600; cursor: pointer;
}
.aac-ph { color: var(--ink-soft); font-size: 18px; font-weight: 500; }
.aac-controls { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }
.aac-ctrl {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 64px; border-radius: 20px; color: #fff;
  font-size: clamp(22px, 5vw, 26px); font-weight: 600;
}
.aac-ctrl small { font-size: 0.45em; font-weight: 600; }
.aac-ctrl.speak { background: var(--accent-2); }
.aac-ctrl.undo { background: #dce5d3; color: var(--ink); }
.aac-ctrl.clear { background: var(--accent); }
.aac-ctrl:active { filter: brightness(0.95); }
.aac-quick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
@media (max-width: 600px) { .aac-quick { grid-template-columns: repeat(3, 1fr); } }
.aac-q {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 76px; padding: 8px; background: var(--card);
  border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
}
.aac-q .face { font-size: 32px; line-height: 1; }
.aac-q small { font-size: 14px; font-weight: 500; color: var(--ink-soft); }
.aac-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.aac-tab {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 82px; min-height: 64px; padding: 8px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  font-size: 22px; color: var(--ink);
}
.aac-tab small { font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.aac-tab[aria-selected="true"], .aac-tab[aria-pressed="true"] {
  background: var(--accent-2); color: #fff; border-color: var(--accent-2);
}
.aac-tab[aria-selected="true"] small, .aac-tab[aria-pressed="true"] small { color: #fff; }
.aac-grid .tile { min-height: 98px; aspect-ratio: auto; padding: 12px 8px; }

/* ---------- My Day ---------- */
.day { display: grid; gap: 10px; }
.step {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  min-height: 68px; padding: 12px 18px; text-align: left;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
  font-size: 20px; font-weight: 500;
  transition: background-color 140ms ease, transform 120ms ease;
}
.step:hover { transform: translateY(-1px); }
.step .face { font-size: 34px; line-height: 1; }
.step .check {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  border: 2px solid var(--line); font-size: 18px; color: transparent;
}
.step.done { background: var(--pressed); }
.step.done .steplabel { text-decoration: line-through; text-decoration-thickness: 2px; opacity: 0.72; }
.step.done .check { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }

/* ---------- Calm / Breathe Room ---------- */
.calmroom { justify-items: center; gap: 18px; }
.breathcue { font-size: clamp(22px, 5vw, 30px); font-weight: 600; color: var(--accent-2); min-height: 2.2em; text-align: center; margin: 0; }
.breath {
  display: grid; place-items: center;
  width: min(64vw, 270px); height: min(64vw, 270px);
  border-radius: 50%;
  background: radial-gradient(circle, #e7eedf 0%, transparent 70%);
}
.orb {
  font-size: clamp(68px, 22vw, 120px); line-height: 1;
  transform: scale(0.55); transition: transform 3.8s ease-in-out;
}
.orb.in { transform: scale(1.12); }
.orb.out { transform: scale(0.55); }
.bigbtn {
  min-height: 56px; padding: 14px 28px;
  background: var(--accent-2); color: #fff;
  border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow);
  font-size: 20px; font-weight: 600;
  transition: transform 120ms ease, background-color 120ms ease;
}
.bigbtn:hover { filter: brightness(1.05); }
.bigbtn:active { transform: scale(0.97); }

/* ---------- Reading Room ---------- */
.readbody { margin-top: 4px; }
.buildbox { display: grid; gap: 16px; justify-items: center; padding: 14px 0; }
.slots { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.slot {
  width: 74px; height: 74px; display: grid; place-items: center;
  border: 2px dashed var(--accent-2); border-radius: 20px; background: var(--card);
  font-size: 38px; font-weight: 600;
}
.tray { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.buildtile { width: 76px; height: 76px; aspect-ratio: auto; font-size: 36px; }
.buildtile.used { opacity: 0.32; }
.readbtn { text-align: center; width: fit-content; }
.wordtile { font-size: 26px; font-weight: 600; aspect-ratio: auto; min-height: 76px; }
.wordbig { font-size: clamp(52px, 16vw, 96px); }

/* ---------- Pip Buddy ---------- */
.buddywrap { display: flex; align-items: center; gap: 14px; margin: 4px 0 18px; }
.buddy {
  display: grid; place-items: center; flex: none;
  width: 72px; height: 72px; padding: 0;
  background: transparent; border: 0; border-radius: 0;
}
.buddyface { display: grid; width: 72px; height: 72px; }
.buddyface svg { width: 72px; height: 72px; display: block; }
.buddyface.wiggle .wing { transform-box: fill-box; transform-origin: center; animation: wing 200ms ease 2; }
@keyframes wing { 50% { transform: rotate(-18deg); } }
.buddysay {
  margin: 0; padding: 10px 16px;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
  font-size: 16px; font-weight: 500;
}

/* ---------- Bottom Navigation Dock ---------- */
.bar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 50;
  width: min(480px, calc(100% - 24px));
  display: flex; gap: 4px; padding: 7px;
  background: #fffcf5f2; color: var(--ink);
  border: 1px solid #dbdfd3; border-radius: 28px;
  box-shadow: 0 12px 45px #23392c22;
  backdrop-filter: blur(16px);
}
.barbtn {
  flex: 1; display: grid; place-items: center; gap: 2px;
  min-height: 62px; padding: 6px 4px;
  border-radius: 20px; font-size: 22px; line-height: 1; color: var(--ink);
  transition: background-color 140ms ease, transform 120ms ease;
}
.barbtn span { font-size: 12px; font-weight: 600; color: var(--ink); }
.barbtn:active { background: var(--pressed); transform: scale(0.95); }
.barbtn[aria-current="page"], .barbtn[aria-pressed="true"] {
  background: #e3ebdb; color: var(--accent-2);
}
.barbtn[aria-current="page"] span, .barbtn[aria-pressed="true"] span {
  color: var(--accent-2);
}

/* ---------- Grown-ups Footer ---------- */
.grown {
  max-width: 1140px; margin: 12px auto 8px; padding: 18px 22px;
  background: #f1f1e7; border: 1px solid #e0e4d5; border-radius: 20px;
  color: var(--ink-soft);
}
.grown summary {
  cursor: pointer; min-height: 36px; display: flex; align-items: center;
  font-size: 14px; font-weight: 600; color: var(--ink);
}
.grown p { font-size: 14px; line-height: 1.7; margin: 10px 0 0; }

/* ---------- Learning Path, Quests, Certificates & My Room ---------- */
.pathstats { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.pathstats .stat {
  padding: 8px 16px; background: var(--pressed);
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 17px; font-weight: 600;
}

.pathmap {
  position: relative; display: grid; gap: 16px;
  max-width: 580px; margin: 0 auto; padding: 12px 0 28px; width: 100%;
}
.pathmap::before {
  content: ""; position: absolute; top: 0; bottom: 28px; left: 50%;
  width: 6px; transform: translateX(-50%); border-radius: 3px;
  background: repeating-linear-gradient(#c6d3bc 0 10px, transparent 10px 22px);
}
.pzone {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 10px; justify-content: center; flex-wrap: wrap;
  width: fit-content; margin: 10px auto 2px; padding: 10px 20px;
  background: var(--card); border: 2px solid var(--line); border-radius: 999px; box-shadow: var(--shadow);
}
.pzonemark { font-size: 28px; line-height: 1; }
.pzonename { font-size: 20px; font-weight: 600; }
.pzonebadge { font-size: 24px; line-height: 1; }
.pzonecert {
  padding: 4px 12px; border-radius: 999px; background: #fff4d6; border: 1px solid #e8b04b;
  font-size: 13px; font-weight: 600; color: #6e4f12;
}
.pstone {
  position: relative; z-index: 1;
  width: 88px; height: 88px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card); border: 3px solid var(--line); box-shadow: var(--shadow);
  font-size: 30px; font-weight: 600; color: var(--ink-soft);
  transition: transform 150ms ease;
}
.pstone:hover { transform: scale(1.06); }
.pstone:not(.done):not(.now) { opacity: 0.58; }
.pstone.done { background: linear-gradient(145deg, #FFEDBE, #FFD166); border-color: #E8B04B; color: var(--ink); }
.pstone.now { border-color: var(--accent-2); border-width: 4px; color: var(--ink); animation: stonepulse 1.6s ease-in-out infinite; }
@keyframes stonepulse { 0%, 100% { box-shadow: 0 0 0 0 #3f6d5455; } 50% { box-shadow: 0 0 0 14px transparent; } }
.pstone span { pointer-events: none; }

.quest { display: grid; gap: 16px; }
.questhead { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.questhead .back { margin: 0; min-height: 52px; font-size: 18px; }
.questtag { font-size: 17px; font-weight: 600; color: var(--ink-soft); text-align: center; }
.qstage { min-height: 0; gap: 10px; padding: clamp(18px, 4vw, 30px); }
.qprompt { font-size: clamp(26px, 5.8vw, 40px); font-weight: 600; }
.qprompt.done { color: var(--accent-2); }
.qfeed { display: grid; gap: 12px; justify-items: center; min-height: 1.8em; }
.qwin { margin: 0; font-size: clamp(20px, 4.5vw, 26px); font-weight: 600; color: var(--accent-2); }
.qnext { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.qopts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  width: 100%; max-width: 640px; margin: 0 auto;
}
.qopt {
  display: grid; place-items: center;
  min-height: clamp(112px, 24vw, 160px); padding: 12px;
  background: var(--card); border: 3px solid var(--line); border-radius: 26px; box-shadow: var(--shadow);
  font-size: clamp(44px, 12vw, 72px); font-weight: 600; line-height: 1;
  transition: transform 140ms ease, background-color 140ms ease;
}
.qopt:hover { transform: translateY(-2px); }
.qopt:active { background: var(--pressed); }
.qopt small { font-size: 0.28em; font-weight: 500; color: var(--ink-soft); }
.qopt.qcolor { min-height: clamp(96px, 22vw, 150px); }
.qopt.qshape svg { width: clamp(64px, 16vw, 110px); height: auto; }
.qopt.qanimal { font-size: clamp(52px, 14vw, 84px); }
.qopt.pop { outline: 4px solid #E8B04B; background: #FFF6DC; }
.qmapbtn { background: var(--card); color: var(--ink); border: 1px solid var(--line); }

.certwrap {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 20px;
  background: #263e3775; backdrop-filter: blur(4px);
}
.cert {
  width: min(560px, 100%); text-align: center; padding: 28px 24px;
  background: #FFFDF5; border: 6px solid #E8B04B; border-radius: 26px;
  box-shadow: 0 20px 60px #263e3744;
}
.cert-emoji { font-size: 64px; line-height: 1; }
.cert-title { margin: 8px 0 4px; font-size: clamp(30px, 7vw, 42px); font-weight: 600; }
.cert-zone { margin: 4px 0; font-size: 24px; font-weight: 600; color: var(--accent-2); }
.cert-line { margin: 4px 0 12px; font-size: 20px; color: var(--ink-soft); }
.cert-stars { font-size: 26px; letter-spacing: 6px; }
.cert-date { margin: 12px 0 18px; font-size: 16px; color: var(--ink-soft); }
.cert-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cert-btns .bigbtn { min-height: 58px; }
@media print {
  body > *:not(.certprint) { display: none !important; }
  .certwrap { position: static; background: none; padding: 0; }
  .cert { box-shadow: none; }
  .cert-btns { display: none !important; }
}

/* ---------- My Room ---------- */
.roomfloor {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: center;
  min-height: 220px; padding: 26px 20px 20px;
  background: linear-gradient(#ffffff 0 58%, #e4ecdc 58%);
  border: 2px solid var(--line); border-radius: 28px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
  transition: background 300ms ease;
}
.roomfloor.theme-treehouse {
  background: linear-gradient(#dff2f9 0 56%, #c8d8a6 56%, #b2936b 75%);
}
.roomfloor.theme-starlight {
  background: linear-gradient(#23304c 0 60%, #4b5d78 60%);
  color: #fff;
}
.roomfloor.theme-starlight .roomempty { color: #d8e2f5; }
.roomfloor.theme-ocean {
  background: linear-gradient(#7fd1e8 0 62%, #ebd49a 62%);
}
.roomtoy {
  display: grid; place-items: center;
  width: clamp(74px, 18vw, 102px); height: clamp(74px, 18vw, 102px);
  font-size: clamp(46px, 11vw, 64px); line-height: 1;
  background: #ffffff90; border-radius: 24px; border: 1px solid #ffffffb0;
  box-shadow: 0 6px 14px #00000010;
  transition: transform 150ms ease;
}
.roomtoy:hover { transform: translateY(-4px) scale(1.05); }
.roomtoy:active { transform: scale(0.93); }
.roomempty { margin: auto; text-align: center; font-size: 19px; font-weight: 500; color: var(--ink-soft); }
.grownreset {
  justify-self: center; min-height: 44px; padding: 8px 16px;
  font-size: 14px; font-weight: 500; color: var(--ink-soft);
  background: none; border: 1px dashed var(--line); border-radius: 14px;
}
.shopgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 14px; }
.shopitem {
  display: grid; gap: 6px; place-items: center;
  min-height: 136px; padding: 14px 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
  transition: transform 140ms ease;
}
.shopitem:hover { transform: translateY(-3px); }
.shopitem .emoji { font-size: 44px; line-height: 1; }
.shopitem small { font-weight: 500; font-size: 15px; color: var(--ink); }
.shopitem .cost { padding: 4px 12px; border-radius: 999px; background: var(--pressed); font-size: 14px; font-weight: 600; }
.shopitem:active { background: var(--pressed); }

/* ---------- Art Studio ---------- */
.drawing-canvas {
  width: 100%; height: auto; display: block; touch-action: none;
  border: 2px solid var(--line); border-radius: 22px; background: #fffdf7;
  box-shadow: var(--shadow); cursor: crosshair;
}
.drawing-tools, .drawing-actions, .drawing-stamps {
  display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0;
}
.paint-color {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--paint); border: 4px solid #fff;
  box-shadow: 0 2px 6px #00000018, 0 0 0 1px #ccc;
  transition: transform 120ms ease;
}
.paint-color.rainbow-brush {
  background: conic-gradient(#df5260, #ed9a32, #f3d34a, #2e966f, #388bbd, #7756b8, #df5260);
}
.paint-color[aria-pressed="true"] {
  box-shadow: 0 0 0 3px var(--ink); transform: scale(1.12);
}
.brush-size {
  background: var(--pressed); border: 1px solid var(--line); border-radius: 16px;
  padding: 10px 16px; min-height: 46px; font-size: 15px; font-weight: 500;
}
.brush-size[aria-pressed="true"] {
  background: var(--accent-2); color: #fff; border-color: var(--accent-2);
}
.stamp-button {
  font-size: 34px; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; min-height: 58px; min-width: 58px;
  box-shadow: 0 3px 0 #dce3d570;
  transition: transform 120ms ease;
}
.stamp-button:hover { transform: translateY(-2px); }
.stamp-button.selected { outline: 3px solid var(--accent-2); background: var(--pressed); }
.art-studio h2 { text-align: center; font-size: clamp(26px, 4vw, 34px); margin: 0; }
.drawing-actions .song { min-height: 48px; font-size: 16px; }

/* ---------- Calm Mode & Reduced Motion ---------- */
body.calm {
  --ink: #353b37;
  --ink-soft: #5f6761;
  --paper: #f1f0ec;
  --card: #faf9f6;
  --line: #d6d8d2;
  --accent: #5b695e;
  --accent-2: #526356;
  --ring: #526356;
  --pressed: #e4e6e0;
  --shadow: none;
  background: #f1f0ec;
}
body.calm .note { background: #e4e6e0 !important; box-shadow: none; }
body.calm .buddyface svg ellipse,
body.calm .buddyface svg .wing { fill: #ded8c7; }
body.calm .buddyface svg path { fill: #8e7868; }
body.calm * { animation: none !important; transition: none !important; }
body.calm .orb { transition: transform 4s ease-in-out !important; }
body.calm .pstone.now { animation: none; }
body.calm .pstone.done { background: var(--pressed); border-color: var(--line); }
body.calm .qopt.pop { background: var(--pressed); outline-color: var(--line); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .orb { transition: transform 4s ease-in-out !important; }
}
