/* Puka Puka: felt & yarn look, laid out on a 390 x 844 stage that app.js scales to the screen. */

:root {
  --cream: #FFF3E3;
  --paper: #FFF8EE;
  --coral: #D9502F;
  --coral-deep: #C2412A;
  --coral-dark: #A63B22;
  --brick: #8E2E1D;
  --pink: #F2A39A;
  --teal: #3C7EA8;
  --green-deep: #3F7650;
  --cocoa: #5A3322;
  --muted: #8F5A47;
  --sand: #E3BF94;
  --sky-edge: #BFD3E0;
  --coral-text: var(--coral-deep);
  --card: #FFFFFF;
  --card-edge: #F0DCC8;
  --soft: #F6E6D6;
  --display: 'Fredoka', 'Trebuchet MS', sans-serif;
  --body: 'Nunito', 'Trebuchet MS', sans-serif;
}

/* Dark mode: a dim room at night with the lamp on. The script at the top of index.html sets data-theme before the
   first paint, and app.js keeps it up to date. The cards and buttons turn to dark felt; the felt drawings keep their
   colors, and the lamp light falls on them (see "Dark mode" below). */
:root[data-theme="dark"] {
  --paper: #322D4E;
  --cocoa: #F6E8D8;
  --muted: #B9A7BE;
  --sand: #1D1A31;
  --sky-edge: #151A2C;
  --teal: #8CC2E6;
  --coral-text: #F59478;
  --card: #3B3559;
  --card-edge: #241F38;
  --soft: #4A4270;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }

body {
  position: fixed;
  inset: 0;
  font-family: var(--body);
  color: var(--cocoa);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

body.scr-feed {
  background-color: var(--cream);
  background-image:
    linear-gradient(90deg, rgba(242, 163, 154, 0.22) 50%, transparent 50%),
    linear-gradient(rgba(242, 163, 154, 0.22) 50%, transparent 50%);
  background-size: 40px 40px;
}

body.scr-reward, body.scr-unlock {
  background: #3474A0 url("assets/floral-tile.svg") 0 0 / 64px 64px;
}

body.scr-book, body.scr-spoons {
  background-color: #EEF4F7;
  background-image:
    linear-gradient(90deg, rgba(60, 126, 168, 0.13) 50%, transparent 50%),
    linear-gradient(rgba(60, 126, 168, 0.13) 50%, transparent 50%);
  background-size: 40px 40px;
}

button { font: inherit; color: inherit; }

[hidden] { display: none !important; }

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Stage & screens ---------- */

.stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 390px;
  height: 844px;
  transform-origin: 0 0;
}

.screen { position: absolute; inset: 0; animation: screen-in 0.3s ease both; }

.decor, .hill { position: absolute; pointer-events: none; overflow: visible; }
#feed .decor { left: -400px; top: 0; }
#reward .decor, #unlock .decor { left: 0; top: 0; }
.hill { left: -600px; top: 574px; }

/* ---------- Feeding ---------- */

.baby {
  position: absolute;
  left: 45px;
  top: 196px;
  width: 300px;
  height: 460px;
  z-index: 5;
  pointer-events: none;
  transform-origin: 50% 90%;
  will-change: transform;
}
.baby-body, .baby-part { position: absolute; left: 0; top: 0; }
.baby-part { overflow: visible; }

/* She is never quite still. Each part sits at its own spot in the 300 x 460 drawing and turns
   around a joint: the head around her neck, each arm and hand around its shoulder. Moving whole
   layers keeps the felt filters from being redrawn every frame. Durations don't line up, so the
   pattern never visibly repeats. */
.baby-head {
  left: 40px;
  top: 28px;
  transform-origin: 110px 210px;
  animation:
    baby-tilt 6.4s ease-in-out -2.3s infinite alternate,
    baby-sway 3.9s ease-in-out -1.1s infinite alternate,
    baby-nod 4.7s ease-in-out -0.6s infinite alternate;
}
.baby-arm-l, .baby-hand-l { animation: baby-arm-l 7.4s ease-in-out infinite; }
.baby-arm-r, .baby-hand-r { animation: baby-arm-r 9.3s ease-in-out -3.1s infinite; }
.baby-arm-l { left: 60px; top: 236px; transform-origin: 40px 20px; }
.baby-arm-r { left: 176px; top: 236px; transform-origin: 24px 20px; }
.baby-hand-l { left: 58px; top: 316px; transform-origin: 42px -60px; }
.baby-hand-r { left: 186px; top: 316px; transform-origin: 14px -60px; }
.baby-bib { left: 88px; top: 236px; }
.baby-tray { top: 314px; }

.pupils { transition: transform 0.35s ease; }

.yum { position: absolute; inset: 0; z-index: 14; pointer-events: none; }
.yum-row { position: absolute; left: 0; right: 0; top: 182px; display: flex; justify-content: center; }
.yum-bubble {
  padding: 6px;
  background: var(--paper);
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--sand), 0 10px 18px rgba(90, 51, 34, 0.18);
}
.yum-text {
  padding: 4px 26px 6px;
  border: 2.5px dashed var(--pink);
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 38px;
  line-height: 1.1;
  color: var(--coral-text);
}
.heart { position: absolute; }
.heart-a { left: 92px; top: 300px; }
.heart-b { left: 70px; top: 360px; }

.spoon {
  position: absolute;
  left: 0;
  top: 0;
  width: 90px;
  height: 290px;
  z-index: 12;
  pointer-events: none;
  transform-origin: 45px 44px;
  transform: translate(255px, 886px) rotate(-34deg);
  transition: transform 0.38s cubic-bezier(0.34, 1.45, 0.64, 1);
  will-change: transform;
}

.fly {
  position: absolute;
  left: 0;
  top: 0;
  width: 64px;
  height: 64px;
  z-index: 40;
  pointer-events: none;
  transition: transform 0.65s cubic-bezier(0.55, -0.3, 0.35, 1.2);
  will-change: transform;
}
.fly-inner { width: 64px; height: 64px; }

.hint {
  position: absolute;
  left: 0;
  right: 0;
  top: 688px;
  display: flex;
  justify-content: center;
  z-index: 8;
  pointer-events: none;
}
.hint-pill {
  padding: 5px;
  background: var(--paper);
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--green-deep), 0 8px 14px rgba(0, 0, 0, 0.12);
}
.hint-text {
  padding: 6px 20px 7px;
  border: 2px dashed #9CCB9F;
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.2;
}

.tapzone {
  position: absolute;
  left: 0;
  top: 0;
  width: 390px;
  height: 844px;
  z-index: 20;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}
.tapzone:focus { outline: none; }
.tapzone:focus-visible { outline: 4px dashed var(--teal); outline-offset: -12px; }

.feed-header {
  position: absolute;
  left: 0;
  top: 0;
  width: 390px;
  height: 176px;
  z-index: 30;
  pointer-events: none;
}
.title-row { position: absolute; left: 0; right: 0; top: 24px; display: flex; justify-content: center; }
.title-patch {
  transform: rotate(-2deg);
  padding: 5px;
  background: var(--coral);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--coral-dark), 0 10px 16px rgba(90, 51, 34, 0.2);
}
.title-text {
  margin: 0;
  padding: 4px 22px 6px;
  border: 2px dashed rgba(255, 243, 227, 0.85);
  border-radius: 12px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: 0.5px;
  color: var(--cream);
}

.band {
  position: absolute;
  left: 16px;
  top: 104px;
  width: 358px;
  height: 60px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  border: 0;
  border-radius: 20px;
  box-shadow: 0 4px 0 var(--sand), 0 8px 14px rgba(90, 51, 34, 0.12);
  pointer-events: auto;
  cursor: pointer;
  text-align: left;
}
.band-stitch {
  position: absolute;
  inset: 5px;
  border: 2px dashed var(--pink);
  border-radius: 16px;
  pointer-events: none;
}
.band-slots { display: flex; gap: 8px; }
.band-spacer { flex-grow: 1; }
.band-count {
  margin-left: 2px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  white-space: nowrap;
}
.band-book { flex-shrink: 0; }
.slot {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* The small stamp she lost when the spoon went away: it slips out of its slot and tumbles down past the strip. */
.slot-drop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  animation: pk-drop 1s cubic-bezier(0.45, 0, 0.8, 0.6) both;
}
.slot-empty {
  width: 34px;
  height: 34px;
  border: 2px dashed #D9A99A;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
}

.parent-corner {
  position: absolute;
  left: 16px;
  top: 772px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mic-btn {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 4px 0 var(--green-deep), 0 8px 12px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: none;
  -webkit-touch-callout: none;
}
.mic-stitch {
  position: absolute;
  inset: 5px;
  border: 2px dashed #9CCB9F;
  border-radius: 50%;
  pointer-events: none;
}
.hold-ring { position: absolute; left: 0; top: 0; transform: rotate(-90deg); pointer-events: none; }
.hold-ring circle {
  fill: none;
  stroke: var(--coral-text);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 150.8;
  stroke-dashoffset: 150.8;
}
.mic-btn.holding .hold-ring circle { transition: stroke-dashoffset 0.6s linear; stroke-dashoffset: 0; }
.voice-pill {
  padding: 8px 14px;
  background: rgba(255, 248, 238, 0.95);
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  max-width: 230px;
  pointer-events: none;
}

/* ---------- Yum! reward ---------- */

.banner-row {
  position: absolute;
  left: 0;
  right: 0;
  top: 42px;
  display: flex;
  justify-content: center;
  filter: drop-shadow(0 5px 0 var(--brick));
}
.banner {
  width: 300px;
  height: 84px;
  background: var(--coral-deep);
  clip-path: polygon(0 0, 100% 0, 93% 50%, 100% 100%, 0 100%, 7% 50%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.banner-text {
  margin: 0;
  width: 246px;
  height: 62px;
  border-top: 2.5px dashed rgba(255, 243, 227, 0.8);
  border-bottom: 2.5px dashed rgba(255, 243, 227, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 40px;
  line-height: 1;
  color: var(--cream);
}
.big-stamp { position: absolute; left: 80px; top: 148px; width: 230px; height: 276px; transform: rotate(-4deg); }
.big-stamp-inner {
  position: relative;
  width: 230px;
  height: 276px;
  animation-delay: 0.12s;
}
.big-stamp-inner > svg { display: block; filter: drop-shadow(0 8px 10px rgba(20, 40, 60, 0.35)); }
.reward-baby { position: absolute; left: 14px; top: 330px; width: 124px; height: 124px; transform: rotate(-8deg); }

.reward-card {
  position: absolute;
  left: 24px;
  top: 492px;
  width: 342px;
  padding: 18px 18px 16px;
  background: var(--paper);
  border-radius: 22px;
  box-shadow: 0 5px 0 var(--sand), 0 12px 20px rgba(20, 40, 60, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.stitch-inset {
  position: absolute;
  inset: 6px;
  border: 2px dashed var(--pink);
  border-radius: inherit;
  pointer-events: none;
}
.reward-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.15;
  color: var(--coral-text);
}
.reward-slots { display: flex; gap: 8px; }
.rslot { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
.reward-count { font-size: 14px; font-weight: 800; text-align: center; }

.pill-btn {
  position: absolute;
  left: 24px;
  width: 342px;
  height: 64px;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
  cursor: pointer;
}
.pill-btn-primary {
  background: var(--coral-deep);
  color: var(--cream);
  box-shadow: 0 5px 0 var(--brick), 0 12px 18px rgba(20, 40, 60, 0.25);
}
.pill-btn-primary .stitch-inset { border-color: rgba(255, 243, 227, 0.7); }
.pill-btn-soft {
  height: 56px;
  background: var(--paper);
  color: var(--cocoa);
  font-weight: 600;
  font-size: 20px;
  box-shadow: 0 5px 0 var(--sand), 0 12px 18px rgba(20, 40, 60, 0.2);
}
.pill-btn:active, .round-btn:active, .band:active { transform: translateY(2px); }

/* ---------- New spoon ---------- */

.unlock-glow { position: absolute; left: 35px; top: 154px; overflow: visible; }
.unlock-rays { animation: pk-spin 40s linear infinite; }
.unlock-spoon { position: absolute; left: 141px; top: 140px; width: 108px; height: 348px; transform: rotate(-30deg); }
.unlock-spoon-inner {
  width: 108px;
  height: 348px;
  filter: drop-shadow(0 8px 10px rgba(20, 40, 60, 0.35));
  animation-delay: 0.12s;
}
.unlock-spoon-inner svg { display: block; transform-origin: 50% 15%; animation: spoon-sway 2.6s ease-in-out 0.7s infinite alternate; }
.unlock-card { top: 500px; }

/* ---------- Stamp book ---------- */

.round-btn {
  position: absolute;
  left: 16px;
  top: 24px;
  width: 52px;
  height: 52px;
  z-index: 2;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 4px 0 var(--sky-edge), 0 8px 12px rgba(20, 40, 60, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.round-stitch { position: absolute; inset: 5px; border: 2px dashed #A9CFE6; border-radius: 50%; pointer-events: none; }
.round-btn-end { left: auto; right: 16px; }
.round-art { position: relative; }
.book-title {
  position: absolute;
  left: 0;
  right: 0;
  top: 30px;
  margin: 0;
  text-align: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 30px;
  line-height: 1.2;
}
.count-card {
  position: absolute;
  left: 16px;
  top: 96px;
  width: 358px;
  padding: 16px 20px 18px;
  background: var(--paper);
  border-radius: 20px;
  box-shadow: 0 4px 0 var(--sky-edge), 0 8px 14px rgba(20, 40, 60, 0.1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.count-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.count-total { font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.1; }
.count-page { font-size: 13px; font-weight: 800; color: var(--muted); }
.track {
  position: relative;
  height: 14px;
  margin: 0 8px;
  border-radius: 7px;
  background: #F3E3D3;
  box-shadow: inset 0 1px 2px rgba(90, 51, 34, 0.15);
}
.track-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 7px;
  background-color: var(--coral);
  background-image: repeating-linear-gradient(-45deg, rgba(255, 243, 227, 0.35) 0 4px, transparent 4px 9px);
  transition: width 0.6s ease;
}
.yarn-ball { position: absolute; top: -7px; left: 0; margin-left: -14px; width: 28px; height: 28px; transition: left 0.6s ease; }

.book-cover {
  position: absolute;
  left: 16px;
  top: 198px;
  width: 358px;
  height: 540px;
  padding: 12px;
  background: var(--coral);
  border-radius: 26px;
  box-shadow: 0 5px 0 var(--coral-dark), 0 14px 22px rgba(20, 40, 60, 0.18);
  touch-action: none; /* app.js turns the pages with a sideways swipe */
}
.cover-stitch { position: absolute; inset: 5px; border: 2px dashed rgba(255, 243, 227, 0.75); border-radius: 22px; pointer-events: none; }
/* The pages lie on top of each other in the stack. Its perspective is PERSPECTIVE in app.js. */
.book-stack { position: relative; height: 100%; perspective: 2200px; }
.book-page { position: absolute; inset: 0; padding: 20px; background: var(--paper); border-radius: 16px; }
/* The page dips a little into the spine along its left edge. */
.book-page::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 24px;
  border-radius: 16px 0 0 16px;
  background: linear-gradient(to right, rgba(90, 51, 34, 0.13), rgba(90, 51, 34, 0));
  pointer-events: none;
}
.page-stitch { position: absolute; inset: 6px; border: 2px dashed var(--pink); border-radius: 12px; pointer-events: none; }
.book-grid { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.page-num {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  min-width: 40px;
  padding: 1px 12px 2px;
  border: 2px dashed #E2B8A6;
  border-radius: 999px;
  text-align: center;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
  color: var(--muted);
}

/* The pages still to come peek out along the right and bottom edges (up to two). */
.page-edge {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: #F3E3D3;
  box-shadow: 0 1px 2px rgba(90, 51, 34, 0.18);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.page-edge-1 { transform: translate(2px, 2px); }
.page-edge-2 { transform: translate(4px, 4px); background: #EAD3BE; }
.book-stack[data-ahead="1"] .page-edge-1, .book-stack[data-ahead="2"] .page-edge { opacity: 1; }

/* The bottom corners turn the page. Each shows a chevron while there is a page that way (it pops in when it appears).
   Hovering a corner with a mouse, or pressing and holding it (app.js adds .bent), folds it over in place of the
   chevron. Under the fold is the next page; only the first corner back on page 2 (.to-cover) shows the cover. */
.page-corner {
  position: absolute;
  bottom: 0;
  width: 52px;
  height: 52px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0 0 16px 0;
  background: none;
  cursor: pointer;
}
.page-corner-prev { left: 0; border-radius: 0 0 0 16px; }
.page-corner { color: var(--muted); }
.page-corner-next { right: 0; }
.page-corner svg { display: block; }
.corner-chevron {
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 0.15s ease;
  animation: corner-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.corner-fold {
  transform-box: view-box;
  transform: scale(0);
  transition: transform 0.26s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.page-corner-next .corner-fold { transform-origin: 52px 52px; }
.page-corner-prev .corner-fold { transform-origin: 0 52px; }
.corner-under { fill: #F3E3D3; }
.page-corner.to-cover .corner-under { fill: var(--coral); }
.page-corner.bent .corner-fold { transform: scale(1); }
.page-corner.bent .corner-chevron { opacity: 0; }
@media (hover: hover) {
  .page-corner:hover .corner-fold { transform: scale(1); }
  .page-corner:hover .corner-chevron { opacity: 0; }
}
/* The copy of a chevron on a turning page stays still. */
.leaf .corner-chevron { animation: none; }

/* The shadow a turning page casts on the page under it. app.js moves it along with the page's free edge. */
.flip-shade-clip { position: absolute; inset: 0; overflow: hidden; border-radius: 16px; pointer-events: none; }
.flip-shade {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 90px;
  background: linear-gradient(to right, rgba(90, 51, 34, 0.32), rgba(90, 51, 34, 0));
  opacity: 0;
  will-change: transform, opacity;
}

/* The turning page. app.js sets its turn and its shading on every frame, and shows one face at a time. */
.leaf { position: absolute; inset: 0; transform-origin: 0 50%; transform-style: preserve-3d; pointer-events: none; will-change: transform; }
.leaf-face { position: absolute; inset: 0; border-radius: 16px; }
.leaf-back { transform: rotateY(180deg); background: #F6E6D5; }
.leaf-shine { position: absolute; inset: 0; border-radius: inherit; opacity: 0; pointer-events: none; will-change: opacity; }
.leaf-front .leaf-shine { background: linear-gradient(to left, rgba(90, 51, 34, 0.4), rgba(90, 51, 34, 0.1) 55%, rgba(90, 51, 34, 0)); }
.leaf-back .leaf-shine { background: linear-gradient(to left, rgba(90, 51, 34, 0.35), rgba(90, 51, 34, 0.05)); }

/* No page that way: the open page lifts a little (or shifts a little) and settles back. */
.book-page.nudge-next { transform-origin: 0 50%; animation: nudge-next 0.5s ease-out; }
.book-page.nudge-prev { animation: nudge-prev 0.45s ease-out; }
.cell { height: 80px; display: flex; align-items: center; justify-content: center; }
.cell-stamp { display: block; width: 62px; height: 74px; margin: 0; padding: 0; border: 0; border-radius: 4px; background: none; cursor: pointer; }
.cell-stamp > div { position: relative; width: 62px; height: 74px; }
/* The shadow goes on the drawing, which stays still, so it is drawn once: on the box around it, it would be drawn
   again on every frame of a sparkly stamp's shimmer. */
.cell-stamp > div > svg { display: block; filter: drop-shadow(0 3px 3px rgba(90, 51, 34, 0.25)); }
.cell-stamp:active > div { scale: 0.94; }
.cell-empty {
  width: 58px;
  height: 70px;
  border: 2px dashed #E2B8A6;
  border-radius: 6px;
  background: rgba(242, 163, 154, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
  color: var(--muted);
}

/* ---------- Spoon drawer ---------- */

.spoons-card { gap: 10px; }
.spoons-next { margin: 0; font-size: 13px; font-weight: 800; line-height: 1.3; color: var(--muted); }
.drawer {
  position: absolute;
  left: 16px;
  top: 222px;
  width: 358px;
  height: 522px;
  padding: 12px;
  background: #C98B5A;
  border-radius: 26px;
  box-shadow: 0 5px 0 #A86E44, 0 14px 22px rgba(20, 40, 60, 0.18);
}
.drawer-stitch { position: absolute; inset: 5px; border: 2px dashed #F7E2C6; border-radius: 22px; pointer-events: none; }
.drawer-lining {
  position: relative;
  height: 100%;
  padding: 0 10px;
  background: var(--paper);
  border-radius: 16px;
  overflow: hidden;
}
.drawer-lining .page-stitch { z-index: 1; }
/* Four to a row; the last spoon sits in the middle. The drawer holds more rows than it shows, so it scrolls, and
   the tops of the next row peek out at the bottom edge. */
.spoons-grid {
  position: relative;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: 14px 0 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-start;
  gap: 10px 6px;
  -webkit-mask-image: linear-gradient(transparent, #000 6px, #000 calc(100% - 12px), transparent);
  mask-image: linear-gradient(transparent, #000 6px, #000 calc(100% - 12px), transparent);
}
/* Scrolled down: the row going out at the top fades away under the stitching. */
.spoons-grid.is-scrolled {
  -webkit-mask-image: linear-gradient(transparent 4px, #000 30px, #000 calc(100% - 12px), transparent);
  mask-image: linear-gradient(transparent 4px, #000 30px, #000 calc(100% - 12px), transparent);
}
.spoons-grid::-webkit-scrollbar { display: none; }
.spoon-cell {
  width: 72px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.spoon-slot {
  position: relative;
  width: 56px;
  height: 126px;
  border-radius: 28px;
  background: #F6E6D6;
  box-shadow: inset 0 2px 5px rgba(90, 51, 34, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.spoon-slot svg { display: block; rotate: var(--tilt, 0deg); filter: drop-shadow(0 2px 2px rgba(90, 51, 34, 0.25)); }
.spoon-cell:active .spoon-slot { transform: translateY(2px); }
.spoon-cell.is-on .spoon-slot { background: #FDE3D8; box-shadow: inset 0 2px 5px rgba(90, 51, 34, 0.2), 0 0 0 3px var(--coral-deep); }
.spoon-check {
  position: absolute;
  right: -7px;
  top: -7px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--coral-deep);
  box-shadow: 0 2px 0 var(--brick);
  display: none;
  align-items: center;
  justify-content: center;
}
.spoon-cell.is-on .spoon-check { display: flex; }
/* Locked: a plain spoon's shadow (app.js keeps the animal a surprise) with a padlock, until its page is full. */
.spoon-cell.is-locked .spoon-slot svg { filter: brightness(0); opacity: 0.14; }
.spoon-lock {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 2px 0 var(--sand);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}
.spoon-label { font-size: 12px; font-weight: 800; line-height: 1.25; white-space: nowrap; }
.spoon-cell.is-locked .spoon-label { color: var(--muted); }

/* ---------- Focus ---------- */

.band:focus-visible, .mic-btn:focus-visible, .pill-btn:focus-visible, .round-btn:focus-visible,
.btn:focus-visible, .icon-btn:focus-visible, .stepper button:focus-visible, .cell-stamp:focus-visible, .spoon-cell:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
}
#reward .pill-btn:focus-visible, #unlock .pill-btn:focus-visible, .viewer .icon-btn:focus-visible { outline-color: var(--cream); }
.page-corner:focus-visible { outline: 3px solid var(--teal); outline-offset: -3px; }

/* ---------- One big stamp, full size ---------- */

.viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  border: 0;
  background: rgba(90, 51, 34, 0.62);
  color: var(--cream);
  /* Browsers give a modal dialog overflow: auto, so the pop's overshoot made it scrollable for a moment on
     narrow screens. Clip it instead: the dialog covers the whole screen, so nothing visible is lost. */
  overflow: hidden;
  overflow: clip;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none; /* app.js handles the sideways swipe */
}
.viewer[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  animation: screen-in 0.25s ease both;
}
.viewer::backdrop { background: transparent; }
.viewer-close { position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px; color: var(--cocoa); }
/* As big as the screen allows, leaving room for the caption row and the close button.
   The stamps sit on top of each other in the track; app.js slides each one sideways, one screen width apart. */
.viewer-track {
  position: relative;
  flex-shrink: 0;
  width: min(86vw, calc((100vh - 190px) / 1.2), 560px);
  width: min(86vw, calc((100dvh - 190px) / 1.2), 560px);
  aspect-ratio: 120 / 144;
  cursor: grab;
  transition: scale 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}
/* Held under a finger: lifted a little off the page. */
.viewer-track.held { scale: 1.025; cursor: grabbing; }
.viewer-slide { position: absolute; inset: 0; will-change: transform; }
.viewer-slide > svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 10px 14px rgba(30, 15, 8, 0.45)); }
.viewer-bar { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 420px; }
.viewer-nav { width: 48px; height: 48px; color: var(--cocoa); transition: opacity 0.2s ease; }
.viewer-nav:active { transform: translateY(2px); }
.viewer-nav[aria-disabled="true"] { opacity: 0.35; cursor: default; }
.viewer-nav[aria-disabled="true"]:active { transform: none; }
.viewer-bar.single .viewer-nav { visibility: hidden; }
.viewer-caption {
  flex: 1;
  margin: 0;
  text-align: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 26px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 rgba(90, 51, 34, 0.5);
}

/* ---------- Parent corner sheet ---------- */

.sheet {
  width: min(440px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  border-radius: 26px;
  background: var(--paper);
  color: var(--cocoa);
  box-shadow: 0 6px 0 var(--sand), 0 24px 48px rgba(40, 20, 10, 0.35);
  overflow: auto;
  -webkit-user-select: none;
  user-select: none;
}
.sheet::backdrop { background: rgba(90, 51, 34, 0.45); }
.sheet[open] { animation: sheet-in 0.25s ease both; }
.sheet-inner {
  position: relative;
  margin: 8px;
  padding: 18px 16px 16px;
  border: 2px dashed var(--pink);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 26px; color: var(--coral-text); }
.card {
  padding: 14px;
  background: var(--card);
  border-radius: 18px;
  box-shadow: 0 3px 0 var(--card-edge);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card h3 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 19px; }
.muted { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--muted); }

.icon-btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: var(--soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn {
  min-height: 48px;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 17px;
  cursor: pointer;
}
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 140px; }
.btn-soft { background: var(--soft); color: var(--cocoa); }
.btn-danger { color: #A3301C; }
.btn-primary { background: var(--coral-deep); color: var(--cream); box-shadow: 0 4px 0 var(--brick); }
.btn-wide { width: 100%; min-height: 54px; font-size: 20px; }
.btn-rec {
  min-height: 64px;
  font-size: 20px;
  background: var(--coral-deep);
  color: var(--cream);
  box-shadow: 0 4px 0 var(--brick);
  touch-action: none;
  -webkit-touch-callout: none;
}
.btn-rec.recording { background: #A3301C; animation: rec-pulse 0.9s ease-in-out infinite; }

.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 16px; font-weight: 700; }
.stepper { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.stepper button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--soft);
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.stepper output { min-width: 56px; text-align: center; font-family: var(--display); font-weight: 600; font-size: 18px; }

/* ---------- Sparkly (holographic) big stamps ---------- */
/* app.js lays this over the stamp's drawing, the same size: rainbow stripes that drift across the stamp and a glint
   that sweeps over it now and then, both cut to the stamp's perforated edge, and sparkles that twinkle in turn.
   The stripes are laid on twice: tinting (multiply) shows them on the pale paper, and overlay shows them on the
   fabric while keeping its color. --holo-delay puts each stamp at its own point in the loop. */
.holo { position: absolute; inset: 0; pointer-events: none; --holo-delay: 0s; }
.holo-foil {
  position: absolute;
  inset: 0;
  overflow: hidden;
  -webkit-mask: url(assets/stamp-mask.svg) 0 0 / 100% 100% no-repeat;
  mask: url(assets/stamp-mask.svg) 0 0 / 100% 100% no-repeat;
  mix-blend-mode: overlay;
  opacity: 0.45;
}
.holo-tint { mix-blend-mode: multiply; opacity: 0.22; }
.holo-foil::before, .holo-foil:not(.holo-tint)::after { content: ''; position: absolute; will-change: transform; }
.holo-foil::before {
  inset: -30% -100%;
  background: repeating-linear-gradient(115deg,
    #FF7FA8 0%, #FFC46B 2.5%, #FFF27A 5%, #8CF0A0 7.5%, #6FD8FF 10%, #9E8CFF 12.5%, #F28CFF 15%, #FF7FA8 17.5%);
  animation: holo-drift 7s ease-in-out var(--holo-delay) infinite alternate;
}
.holo-foil:not(.holo-tint)::after {
  inset: -10% -50%;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.95) 50%, transparent 60%);
  transform: translateX(-70%);
  animation: holo-glint 4.6s ease-in-out var(--holo-delay) infinite;
}
.holo-sparks { position: absolute; inset: 0; }
/* app.js places each sparkle by its middle and sets its width; sparkle.svg has its glow drawn in. */
.holo-spark {
  position: absolute;
  aspect-ratio: 1;
  translate: -50% -50%;
  background: url(assets/sparkle.svg) center / 100% 100% no-repeat;
  animation: holo-spark 2.6s ease-in-out infinite;
  animation-delay: calc(var(--holo-delay) + var(--i) * 0.55s);
}
/* A stamp in the book is small: three sparkles are plenty there. */
.cell-stamp .holo-spark:nth-child(n+4) { display: none; }
/* Covered by the full-size view, the book's sparkly stamps hold still. */
.holo-paused .holo-foil::before, .holo-paused .holo-foil::after, .holo-paused .holo-spark { animation-play-state: paused; }

/* ---------- Dark mode ---------- */
/* The room goes dark and the lamp over her chair lights her up. The light is one still layer of gradients: plain
   see-through color, no blend modes and no filters, so it is painted once and the moving baby and spoon under it cost
   no more than in the light. It reaches far past the stage, so a wide screen goes dark all the way to its edges.
   Its positions are measured from the middle of the stage (195, 422). */

.night-only { display: none; }
[data-theme="dark"] .night-only { display: block; }
[data-theme="dark"] .day-only { display: none; }

.night-light { position: absolute; inset: -1000px -1200px; pointer-events: none; }
/* Feeding: over the scene. The bulb glows, a warm pool falls on her, and the corners of the room fall into shadow. */
#feed .night-light {
  z-index: 15;
  background:
    radial-gradient(circle at calc(50% + 143px) calc(50% - 198px),
      rgba(255, 228, 165, 0.5), rgba(255, 200, 120, 0.2) 28px, rgba(255, 190, 110, 0.07) 80px, rgba(255, 190, 110, 0) 150px),
    radial-gradient(230px 280px at calc(50% + 25px) calc(50% - 60px),
      rgba(255, 184, 100, 0.26), rgba(255, 184, 100, 0.1) 55%, rgba(255, 184, 100, 0)),
    radial-gradient(290px 350px at calc(50% + 30px) calc(50% - 70px),
      rgba(13, 12, 32, 0) 22%, rgba(13, 12, 32, 0.42) 58%, rgba(13, 12, 32, 0.76));
}
/* The other screens: a warm glow on the wall behind what she is looking at. */
#reward .night-light {
  background: radial-gradient(circle at 50% calc(50% - 136px),
    rgba(255, 210, 140, 0.45), rgba(255, 190, 110, 0.16) 150px, rgba(255, 190, 110, 0) 290px);
}
#unlock .night-light {
  background: radial-gradient(circle at 50% calc(50% - 108px),
    rgba(255, 210, 140, 0.4), rgba(255, 190, 110, 0.14) 160px, rgba(255, 190, 110, 0) 300px);
}
#book .night-light, #spoons .night-light {
  background: radial-gradient(380px 320px at 50% calc(50% - 400px),
    rgba(255, 204, 130, 0.24), rgba(255, 190, 110, 0.08) 55%, rgba(255, 190, 110, 0));
}

/* The lamp, the felt moon and the glow-in-the-dark stars sit over the light, so they glow. */
.lamp { position: absolute; left: 296px; top: -640px; z-index: 16; pointer-events: none; overflow: visible; }
.night-sky { position: absolute; inset: 0; z-index: 16; pointer-events: none; }
.night-sky svg { position: absolute; overflow: visible; }
/* Each star is its own small layer that only fades, so the browser twinkles it without drawing it again. */
.night-star { animation: star-glow 3.4s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -1.3s); will-change: opacity; }

[data-theme="dark"] body.scr-feed {
  background-color: #262341;
  background-image:
    linear-gradient(90deg, rgba(150, 136, 210, 0.13) 50%, transparent 50%),
    linear-gradient(rgba(150, 136, 210, 0.13) 50%, transparent 50%);
}
[data-theme="dark"] body.scr-reward, [data-theme="dark"] body.scr-unlock {
  background:
    linear-gradient(rgba(16, 14, 38, 0.66), rgba(16, 14, 38, 0.66)),
    #3474A0 url("assets/floral-tile.svg") 0 0 / 64px 64px;
}
[data-theme="dark"] body.scr-book, [data-theme="dark"] body.scr-spoons {
  background-color: #1C2036;
  background-image:
    linear-gradient(90deg, rgba(110, 150, 210, 0.1) 50%, transparent 50%),
    linear-gradient(rgba(110, 150, 210, 0.1) 50%, transparent 50%);
}

[data-theme="dark"] .decor-clouds { fill: #4A4774; }
[data-theme="dark"] .decor-cloud-stitch { stroke: #6F6CA3; }
[data-theme="dark"] .hint { z-index: 16; }
[data-theme="dark"] .slot-empty { border-color: #7D6B93; background: rgba(255, 255, 255, 0.05); }
[data-theme="dark"] .voice-pill { background: rgba(50, 45, 78, 0.92); }
[data-theme="dark"] .round-stitch { border-color: #5B7DA3; }
[data-theme="dark"] .track { background: #221E37; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4); }

[data-theme="dark"] .book-page::before { background: linear-gradient(to right, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0)); }
[data-theme="dark"] .page-num, [data-theme="dark"] .cell-empty { border-color: #66597F; }
[data-theme="dark"] .cell-empty { background: rgba(242, 163, 154, 0.05); }
[data-theme="dark"] .page-edge { background: #2A2643; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
[data-theme="dark"] .page-edge-2 { background: #24203A; }
[data-theme="dark"] .corner-under { fill: #2A2643; }
[data-theme="dark"] .page-corner stop:first-child { stop-color: #433C66; }
[data-theme="dark"] .page-corner stop:last-child { stop-color: #2E2949; }
[data-theme="dark"] .fold-stitch { stroke: #6E5F86; }
[data-theme="dark"] .flip-shade { background: linear-gradient(to right, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0)); }
[data-theme="dark"] .leaf-back { background: #2C2846; }
[data-theme="dark"] .leaf-front .leaf-shine { background: linear-gradient(to left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.14) 55%, rgba(0, 0, 0, 0)); }
[data-theme="dark"] .leaf-back .leaf-shine { background: linear-gradient(to left, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.08)); }

[data-theme="dark"] .drawer { background: #A8744A; box-shadow: 0 5px 0 #7A5233, 0 14px 22px rgba(0, 0, 0, 0.3); }
[data-theme="dark"] .drawer-stitch { border-color: #E9C9A2; }
[data-theme="dark"] .spoon-slot { background: #28233F; box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.4); }
[data-theme="dark"] .spoon-cell.is-on .spoon-slot { background: #4A2C40; box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.4), 0 0 0 3px var(--coral-text); }
/* A locked spoon's shadow, in pale light so it shows on the dark slot. */
[data-theme="dark"] .spoon-cell.is-locked .spoon-slot svg { filter: brightness(0) invert(1); opacity: 0.16; }

[data-theme="dark"] .viewer { background: rgba(10, 9, 26, 0.8); }
[data-theme="dark"] .viewer-caption { text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5); }
[data-theme="dark"] .sheet { color-scheme: dark; box-shadow: 0 6px 0 var(--sand), 0 24px 48px rgba(0, 0, 0, 0.5); }
[data-theme="dark"] .sheet::backdrop { background: rgba(6, 5, 16, 0.6); }
[data-theme="dark"] .btn-danger { color: #FF9C84; }

/* Parent corner: Auto, Light or Dark. */
.theme-row .btn { flex: 1 1 0; }
.theme-row .btn[aria-pressed="true"] { background: var(--coral-deep); color: var(--cream); box-shadow: 0 3px 0 var(--brick); }

/* ---------- Motion ---------- */

@keyframes pk-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes pk-wiggle { 0%, 100% { transform: rotate(-1.6deg) translateY(-2px); } 50% { transform: rotate(1.6deg) translateY(-7px); } }
@keyframes pk-pop { 0% { transform: scale(0) rotate(-14deg); } 65% { transform: scale(1.15) rotate(4deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes pk-float { 0% { transform: translateY(0) scale(0.5); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-110px) scale(1.1); opacity: 0; } }
@keyframes pk-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes pk-twinkle { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.7); opacity: 0.6; } }
@keyframes screen-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes rec-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
@keyframes pk-shake {
  0%, 100% { transform: none; }
  20% { transform: translateX(-5px) rotate(-3deg); }
  40% { transform: translateX(4px) rotate(2deg); }
  60% { transform: translateX(-3px) rotate(-1deg); }
  80% { transform: translateX(2px); }
}
@keyframes pk-drop {
  0% { transform: none; opacity: 1; }
  18% { transform: translate(-3px, -8px) rotate(-12deg); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(14px, 170px) rotate(50deg) scale(0.85); opacity: 0; }
}
@keyframes pk-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes pk-spin { to { transform: rotate(360deg); } }
@keyframes spoon-sway { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }

/* Head: a slow tilt, a quicker small sway on top of it and a soft nod add up to an easy wobble. */
@keyframes baby-tilt { from { rotate: -1.1deg; } to { rotate: 1.2deg; } }
@keyframes baby-sway { from { transform: rotate(-0.45deg); } to { transform: rotate(0.5deg); } }
@keyframes baby-nod { from { translate: 0 0.5px; } to { translate: 0 -0.9px; } }
/* Arms: mostly resting on the tray, with a slow drift and now and then a little lift and pat.
   rotate swings the hand sideways; scaleY below 1 lifts it, like a slight bend at the elbow. */
@keyframes baby-arm-l {
  0%, 100% { transform: rotate(0deg) scaleY(1); }
  30% { transform: rotate(0.8deg) scaleY(1); }
  46% { transform: rotate(-1.2deg) scaleY(0.97); }
  54% { transform: rotate(-0.9deg) scaleY(1); }
  61% { transform: rotate(-1.1deg) scaleY(0.985); }
  68% { transform: rotate(-0.8deg) scaleY(1); }
}
@keyframes baby-arm-r {
  0%, 100% { transform: rotate(0deg) scaleY(1); }
  20% { transform: rotate(0.9deg) scaleY(0.98); }
  34% { transform: rotate(1.1deg) scaleY(1); }
  64% { transform: rotate(-0.7deg) scaleY(1); }
  76% { transform: rotate(-0.4deg) scaleY(0.975); }
  84% { transform: rotate(-0.6deg) scaleY(1); }
}

/* Stamp book pages */
@keyframes corner-in { from { scale: 0; } to { scale: 1; } }
@keyframes nudge-next { 0%, 100% { transform: none; } 35% { transform: rotateY(-10deg); } 70% { transform: rotateY(2deg); } }
@keyframes nudge-prev { 0%, 100% { transform: none; } 30% { transform: translateX(8px); } 65% { transform: translateX(-2px); } }

/* Sparkly stamps */
@keyframes holo-drift { from { transform: translateX(-12%); } to { transform: translateX(12%); } }
@keyframes holo-glint { 0% { transform: translateX(-70%); } 35%, 100% { transform: translateX(70%); } }
@keyframes holo-spark {
  0%, 100% { transform: scale(0) rotate(0deg); opacity: 0; }
  45% { transform: scale(1) rotate(45deg); opacity: 1; }
  70% { transform: scale(0.3) rotate(70deg); opacity: 0.6; }
}

/* Dark mode */
@keyframes star-glow { from { opacity: 1; } to { opacity: 0.4; } }

.pk-bob { animation: pk-bob 3.2s ease-in-out infinite; }
.pk-wiggle { animation: pk-wiggle 0.45s ease-in-out infinite; }
.pk-pop { animation: pk-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.pk-float { animation: pk-float 1.4s ease-out both; }
.pk-float2 { animation: pk-float 1.4s ease-out 0.25s both; }
.pk-pulse { animation: pk-pulse 1.8s ease-in-out infinite; }
.pk-twinkle { animation: pk-twinkle 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.pk-shake { animation: pk-shake 0.45s ease both; }
.big-stamp-inner.pk-pop { animation-delay: 0.12s; }
.cell-stamp.pk-pop { animation-delay: 0.2s; }

@media (prefers-reduced-motion: reduce) {
  .pk-bob, .pk-wiggle, .pk-pulse, .pk-twinkle, .btn-rec.recording, .baby-part { animation: none; }
  .screen, .sheet[open], .viewer[open] { animation: none; }
  .viewer-track, .viewer-nav { transition: none; }
  .unlock-rays, .unlock-spoon-inner svg, .pk-shake { animation: none; }
  .slot-drop { animation: pk-fade-out 0.6s ease both; }
  .corner-chevron, .book-page.nudge-next, .book-page.nudge-prev { animation: none; }
  .corner-fold, .corner-chevron { transition: none; }
  .page-edge { transition: none; }
  /* A sparkly stamp keeps its rainbow and its sparkles, standing still. */
  .holo-foil::before, .holo-spark { animation: none; will-change: auto; }
  .holo-foil::after { display: none; }
  .night-star { animation: none; will-change: auto; }
}
