/* Sparkle kit: sticker pill, sticker book, celebration, WhatsApp, activity bar, print card. */

/* ---- WhatsApp chat (every page) */
.wa { position: fixed; z-index: 90; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 18px 0 14px; border-radius: var(--r-pill); background: #1F7A4D; color: #FFFFFF; font-weight: 800; text-decoration: none; box-shadow: 0 6px 16px rgba(31,122,77,0.32); transition: transform 160ms var(--sc-ease-out); }
.wa svg { width: 24px; height: 24px; }
.wa:hover { transform: translateY(-2px); }
.wa:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
@media (max-width: 640px) { .wa span { display: none; } .wa { width: 54px; padding: 0; justify-content: center; } }
body.has-buybar .wa { bottom: calc(86px + env(safe-area-inset-bottom)); }
@media (min-width: 761px) { body.has-buybar .wa { bottom: calc(16px + env(safe-area-inset-bottom)); } }
.btn--wa svg { color: #1F7A4D; }

/* ---- sticker pill */
.stkpill { position: fixed; z-index: 90; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 14px 6px 8px; border-radius: var(--r-pill); border: 2px solid var(--ink); background: var(--paper-raised); color: var(--ink); font-weight: 800; cursor: pointer; box-shadow: var(--sticker), var(--sc-e2); }
.stkpill img { width: 38px; height: 38px; }
.stkpill b { min-width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: var(--r-pill); background: var(--star); font-size: 0.95rem; }
@media (max-width: 640px) { .stkpill span { display: none; } }
.is-night .stkpill { background: var(--night-raised); color: var(--on-plum); border-color: var(--star); }

/* ---- sticker book */
.sbook { position: fixed; inset: 0; z-index: 170; display: none; place-items: center; padding: 16px; background: rgba(30,23,41,0.55); }
.sbook.is-on { display: grid; }
.sbook__panel { width: min(640px, 100%); max-height: calc(100svh - 32px); overflow: auto; padding: clamp(18px, 4vw, 32px); border-radius: var(--r-lg); background: var(--paper-raised); color: var(--ink); box-shadow: var(--sc-e3); }
.sbook__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sbook__head h2 { font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.3rem); }
.sbook__lede { margin: 8px 0 18px; }
.sbook__grid { list-style: none; margin: 0; padding: 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; border-radius: var(--r-md); background: var(--paper-sunk); background-image: radial-gradient(var(--line) 1.2px, transparent 1.4px); background-size: 18px 18px; }
.sbook__grid li { aspect-ratio: 1 / 1.1; }
.sbook__grid button, .sbook__empty { width: 100%; height: 100%; display: grid; justify-items: center; align-content: center; gap: 4px; padding: 6px; border: 0; border-radius: var(--r-md); background: transparent; cursor: pointer; font-weight: 800; font-size: 0.78rem; color: var(--ink); text-align: center; line-height: 1.15; }
.sbook__grid img { width: 78%; height: auto; }
.sbook__grid .is-got img { filter: drop-shadow(0 3px 0 rgba(53,42,70,0.15)); }
.sbook__empty { cursor: default; border: 2px dashed var(--line-strong); }
.sbook__empty img { filter: grayscale(1) brightness(1.25) contrast(0.35); opacity: 0.45; }
.sbook__empty span { color: var(--ink-muted); }
.sbook__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 18px; }
.sbook__fine { margin: 12px 0 0; font-size: 0.85rem; color: var(--ink-muted); }
@media (max-width: 420px) { .sbook__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---- celebration */
.cel { position: fixed; inset: 0; z-index: 180; display: none; place-items: center; padding: 16px; background: rgba(30,23,41,0.6); }
.cel.is-on { display: grid; }
.cel__card { position: relative; width: min(440px, 100%); padding: 28px 24px 24px; border-radius: var(--r-xl); background: var(--paper-raised); color: var(--ink); text-align: center; box-shadow: var(--sc-e3); animation: cel-in 420ms var(--sc-ease-out) both; }
.cel__stk { width: 190px; height: auto; margin: -96px auto 8px; filter: drop-shadow(0 8px 0 rgba(53,42,70,0.18)); animation: cel-pop 700ms cubic-bezier(0.34, 1.56, 0.64, 1) 120ms both; }
.cel__eyebrow { margin: 0; font-weight: 800; color: var(--tangerine); }
.cel h2 { margin: 6px 0 4px; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem); }
.cel__count { margin: 0 0 18px; color: var(--ink-muted); font-weight: 700; }
.cel__btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.cel__burst { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.cel__bit { position: absolute; top: 30%; width: 10px; height: 14px; border-radius: 3px; opacity: 0; animation: cel-bit var(--d) cubic-bezier(0.2, 0.6, 0.4, 1) 150ms forwards; }
@keyframes cel-in { from { transform: translateY(24px) scale(0.96); opacity: 0; } }
@keyframes cel-pop { from { transform: scale(0.2) rotate(-25deg); opacity: 0; } }
@keyframes cel-bit { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(calc(var(--x) * 220px), 260px) rotate(var(--r)); } }
@media (prefers-reduced-motion: reduce) { .cel__card, .cel__stk { animation: none; } }

/* ---- activity bar */
.actbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 2px dashed var(--line); }
.actbar .btn.is-running { --b: var(--meadow); --t: #FFFFFF; font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .actbar .btn { flex: 1 1 calc(50% - 8px); } }

/* ---- print just the activity card */
.print-only { display: none; }
@media print {
  .print-card body * { visibility: hidden !important; }
  .print-card .is-printing, .print-card .is-printing * { visibility: visible !important; }
  .print-card .is-printing { position: absolute; left: 0; top: 0; width: 100%; border: 3px solid #352A46 !important; border-radius: 18px; padding: 24px !important; }
  .print-card .is-printing .actbar, .print-card .is-printing .act__again, .print-card .is-printing .act__pair, .print-card .is-printing .pair-card, .print-card .is-printing .nav-row { display: none !important; }
  .print-card .is-printing .print-only { display: block !important; }
  .wa, .stkpill, .hdr, .ribbon { display: none !important; }
}

/* ------------------------------------------------------------ v2.1: moments row ---- */
.moments { margin-bottom: clamp(48px, 7vw, 96px); }
.moments__title { font-size: clamp(2rem, 1.2rem + 2.8vw, 3.4rem); margin-bottom: 22px; }
.moments__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 20px); }
.moment { position: relative; display: grid; align-content: end; min-height: 230px; padding: 18px; border-radius: var(--r-lg); border: 2px solid var(--ink); color: var(--ink); text-decoration: none; overflow: hidden; box-shadow: var(--sticker); transition: transform 160ms var(--sc-ease-out); }
.moment img { position: absolute; right: 10px; top: 10px; width: 46%; height: auto; transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1); }
@media (hover: hover) and (pointer: fine) { .moment:hover { transform: translateY(-3px) rotate(-0.5deg); } .moment:hover img { transform: rotate(8deg) scale(1.06); } }
.moment__q { font-family: var(--sc-font-display); font-weight: 600; font-size: clamp(1.4rem, 1rem + 1vw, 1.9rem); line-height: 1.05; max-width: 11ch; }
.moment__a { margin-top: 6px; font-weight: 700; line-height: 1.35; }
.moment--bored { background: var(--star); }
.moment--feel { background: var(--coral); }
.moment--bed { background: var(--night-raised); color: var(--on-plum); border-color: var(--night-raised); }
.moment--make { background: var(--meadow-soft); }
@media (max-width: 960px) { .moments__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .moment { min-height: 170px; padding: 14px; } .moment img { width: 40%; } .moment__a { font-size: 0.9rem; } }

/* Kid pages on phones: keep the bottom of the screen clear for big buttons and page turns. */
@media (max-width: 640px) {
  .kids .wa { display: none; }
  .kids .stkpill { left: auto; right: 12px; bottom: auto; top: calc(var(--hdr-h) + 10px); min-height: 44px; padding: 4px 10px 4px 6px; }
  .kids .stkpill img { width: 30px; height: 30px; }
  .kids .tool-head { padding-right: 70px; }
}

/* v2.3: floating buttons step aside while scrolling down */
.wa, .stkpill { transition: transform 260ms var(--sc-ease-out), opacity 200ms var(--sc-ease-out); }
.fab-hide .wa, .fab-hide .stkpill { transform: translateY(160%); opacity: 0; pointer-events: none; }
.kids .stkpill { transition: transform 260ms var(--sc-ease-out), opacity 200ms; }
@media (max-width: 640px) { .fab-hide .kids .stkpill, .kids.fab-hide .stkpill { transform: translateY(-160%); } }
.moments__more { margin: 16px 0 0; font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .wa, .stkpill { transition: none; } }
