/* Design: the "game" look (direction B2) — thick dark outlines, chunky buttons with a hard shadow, glossy
   gradients, Rubik. Two themes on <body data-theme>: "game" (kid side + landing, always the night sky) and
   "parent" (light, or dark when the system is dark). Use the tokens below; no new raw colours in rules. */

@font-face {
  font-family: Rubik; font-weight: 300 900; font-display: swap;
  src: url(/vendor/fonts/rubik-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Rubik; font-weight: 300 900; font-display: swap;
  src: url(/vendor/fonts/rubik-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* palette */
  --ink-dark: #0F0D2E;
  --navy: #1C1A47;
  --indigo-1: #3A36A0;
  --indigo-2: #2B2870;
  --indigo-3: #221E66;
  --indigo-4: #17154A;
  --indigo-5: #141238;
  --lilac: #C9C5FF;
  --lilac-2: #B9B5FF;
  --violet: #7C6CFF;
  --violet-hi: #B3A8FF;
  --violet-lo: #5A48E0;
  --yellow: #FFD23F;
  --yellow-hi: #FFF1A8;
  --yellow-lo: #F2B21A;
  --teal: #00D1B2;
  --teal-hi: #7FF7E4;
  --teal-lo: #00A88F;
  --pink: #FF4F86;
  --pink-hi: #FF7BA6;
  --orange: #FFB648;
  --orange-lo: #D9801A;
  --brown: #B8651B;
  --brown-lo: #8A4A12;
  --white: #FFFFFF;
  --cloud: #ECEAFF;

  /* parent theme, light */
  --bg: #F1EFFF;
  --surface: var(--white);
  --surface-2: #E4E1FF;
  --well: #E4E1FF;
  --ink: var(--navy);
  --muted: #5B57A6;
  --outline: var(--ink-dark);
  --accent: var(--yellow);
  --accent-ink: var(--ink-dark);
  --good: var(--teal);
  --good-ink: var(--ink-dark);
  --warn: var(--orange);
  --warn-soft: #FFF1DC;
  --bad: var(--pink);
  --head-bg: var(--navy);
  --head-ink: var(--white);
  --head-muted: var(--lilac-2);
  --gloss: rgb(255 255 255 / .45);
  --drop: 0 4px 0 var(--outline);
  --drop-big: 0 6px 0 var(--outline);

  --radius: 22px;
  --radius-s: 14px;
  --border: 3px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --tabbar-h: 76px;
  --z-sky: 0;
  --z-bar: 10;
  --z-fx: 50;
  --z-toast: 60;
  --z-modal: 70;
  --scrim: rgb(8 7 28 / .92);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--indigo-5);
    --surface: var(--indigo-2);
    --surface-2: var(--indigo-3);
    --well: var(--indigo-4);
    --ink: var(--white);
    --muted: var(--lilac);
    --outline: #08071C;
    --warn-soft: #4A3414;
    --head-bg: var(--ink-dark);
    --gloss: rgb(255 255 255 / .15);
    color-scheme: dark;
  }
}

/* The kid's side: always the night sky. */
body[data-theme=game] {
  --bg: var(--indigo-5);
  --surface: var(--indigo-2);
  --surface-2: var(--indigo-3);
  --well: var(--indigo-4);
  --ink: var(--white);
  --muted: var(--lilac);
  --outline: var(--ink-dark);
  --gloss: rgb(255 255 255 / .15);
  color-scheme: dark;
  background: radial-gradient(120% 70% at 50% 18%, var(--indigo-1) 0%, var(--indigo-3) 45%, var(--indigo-5) 100%) fixed;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 500 17px/1.4 Rubik, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

h1 { font-size: 28px; line-height: 1.15; font-weight: 900; margin: var(--space-4) 0 var(--space-2); }
h2 { font-size: 20px; font-weight: 800; margin: var(--space-6) 0 var(--space-3); }
h3 { font-size: 17px; font-weight: 800; margin: var(--space-2) 0; }
p { margin: var(--space-2) 0; }
b { font-weight: 800; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.empty { color: var(--muted); text-align: center; padding: var(--space-6) var(--space-4); font-weight: 600; }
.loading { display: grid; place-items: center; min-height: 60dvh; font-size: 40px; }
h2.section, .page > h2 {
  font-size: 14px; font-weight: 900; letter-spacing: .6px; text-transform: uppercase; color: var(--muted);
  margin: var(--space-6) 2px var(--space-3);
}

/* ── Layout ── */
#app { position: relative; z-index: 1; }
.page {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-4) var(--space-4) calc(var(--tabbar-h) + var(--space-8) + env(safe-area-inset-bottom));
}
.narrow { max-width: 440px; margin: 0 auto; padding: var(--space-6) var(--space-4); position: relative; }
.stack { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-4); }
.row { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }

.topbar {
  position: sticky; top: 0; z-index: var(--z-bar);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  padding: calc(var(--space-3) + env(safe-area-inset-top)) var(--space-4) var(--space-3);
  background: var(--head-bg); color: var(--head-ink);
  border-bottom: var(--border) solid var(--outline);
}
.topbar .link-btn { color: var(--head-muted); }
.brand { font-weight: 900; font-size: 19px; display: flex; align-items: center; gap: var(--space-1); }
.i-brand { width: 34px; height: 34px; margin: -6px 0; flex: none; }
.i-brand .sh { fill: var(--ink-dark); }
.i-brand .body { fill: url(#brand-gold); stroke: var(--ink-dark); stroke-width: 1.4; stroke-linejoin: round; }
.i-brand .g1 { stop-color: var(--yellow-hi); }
.i-brand .g2 { stop-color: var(--yellow); }
.i-brand .g3 { stop-color: var(--yellow-lo); }
.topbar-end { display: flex; gap: var(--space-3); align-items: center; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-bar);
  display: flex; justify-content: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: var(--border) solid var(--outline);
}
.tab {
  position: relative; flex: 1; max-width: 200px; min-height: 54px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border: var(--border) solid var(--outline); border-radius: var(--radius-s);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer;
}
.tab-icon { font-size: 20px; line-height: 1; }
.tab.on {
  background: linear-gradient(var(--yellow-hi), var(--yellow) 50%, var(--yellow-lo)); color: var(--accent-ink);
  box-shadow: inset 0 2px 0 var(--gloss), var(--drop);
}
.badge {
  position: absolute; top: -8px; right: -6px;
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--pink); color: var(--white); border: 2px solid var(--outline);
  font-size: 12px; font-weight: 900; line-height: 18px;
}

/* ── Controls: chunky, outlined, with a hard shadow that "presses" ── */
.btn {
  min-height: 50px; padding: 0 var(--space-5);
  border: var(--border) solid var(--outline); border-radius: var(--radius-s);
  font: inherit; font-weight: 900; cursor: pointer; white-space: nowrap;
  color: var(--ink); background: var(--surface);
  box-shadow: inset 0 2px 0 var(--gloss), var(--drop);
  transition: transform .08s, box-shadow .08s, opacity .2s;
}
.btn:active { transform: translateY(3px); box-shadow: inset 0 2px 0 var(--gloss), 0 1px 0 var(--outline); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.big { min-height: 58px; font-size: 18px; }
.btn.wide { width: 100%; }
.btn.primary { background: linear-gradient(var(--yellow-hi), var(--yellow) 50%, var(--yellow-lo)); color: var(--accent-ink); }
.btn.secondary { background: linear-gradient(var(--violet-hi), var(--violet) 55%, var(--violet-lo)); color: var(--white); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: none; }
.btn.danger { background: linear-gradient(var(--pink-hi), var(--pink) 55%, var(--pink)); color: var(--white); }
.link-btn.danger-link { color: var(--bad); }
.center-link { display: block; margin: var(--space-6) auto var(--space-2); }
.danger-box { border-color: var(--bad); }
.danger-box p { margin: var(--space-2) 0; }
.btn.busy { opacity: .6; }
.small-btn { min-height: 38px; padding: 0 var(--space-3); font-size: 14px; }
.link-btn { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 700; padding: var(--space-2) 0; cursor: pointer; }
.icon-btn {
  width: 40px; height: 40px; border: 2px solid var(--outline); border-radius: 12px;
  background: var(--surface-2); color: var(--ink); font-size: 16px; cursor: pointer; flex: none;
}
.icon-btn:disabled { opacity: .35; }

input, select, textarea {
  font: inherit; font-weight: 600; color: var(--ink); background: var(--surface);
  border: var(--border) solid var(--outline); border-radius: var(--radius-s);
  padding: var(--space-3); min-height: 50px; width: 100%;
  box-shadow: inset 0 3px 0 rgb(0 0 0 / .06);
}
body[data-theme=game] input { background: var(--well); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--violet); outline-offset: 1px; }
textarea { resize: vertical; }
input[type=number] { width: 72px; text-align: center; padding: var(--space-2); min-height: 42px; }
input[type=checkbox] { width: 22px; height: 22px; min-height: 0; accent-color: var(--violet); box-shadow: none; }
.field { display: flex; flex-direction: column; gap: var(--space-1); margin-top: var(--space-3); }
.field > span { font-size: 14px; font-weight: 800; color: var(--muted); }
.field.inline { flex-direction: row; align-items: center; justify-content: space-between; }
.mini { display: inline-flex; align-items: center; gap: var(--space-1); font-size: 14px; font-weight: 700; color: var(--muted); }
.code-input { text-align: center; font-size: 28px; letter-spacing: 6px; font-weight: 900; text-transform: uppercase; }
.emoji-input { width: 54px; flex: none; text-align: center; padding: var(--space-2); }
/* Step number: editor and the parent's review */
.step-num { flex: none; min-width: 26px; height: 26px; padding: 0 6px; display: grid; place-items: center;
  border: 2px solid var(--outline); border-radius: 13px; background: var(--surface-2); color: var(--ink);
  font-size: 14px; font-weight: 900; line-height: 1; }
.cost-input { width: 90px; }

/* ── Cards ── */
.card {
  background: var(--surface); border: var(--border) solid var(--outline); border-radius: var(--radius);
  padding: var(--space-4); margin-bottom: var(--space-4); box-shadow: var(--drop);
}
.card.attention { box-shadow: 0 0 0 3px var(--yellow), var(--drop-big); }
.card-head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-2); }
.title { font-weight: 900; font-size: 17px; }
.task-emoji, .kid-face {
  width: 46px; height: 46px; flex: none; display: grid; place-items: center; font-size: 24px;
  border: var(--border) solid var(--outline); border-radius: var(--radius-s);
  background: radial-gradient(circle at 35% 30%, var(--violet-hi), var(--violet) 60%, var(--violet-lo));
}
.kid-face { background: radial-gradient(circle at 35% 30%, var(--yellow-hi), var(--yellow) 60%, var(--yellow-lo)); }
.card .muted.small { font-weight: 700; }
.note { background: var(--warn-soft); border: 2px solid var(--outline); border-radius: var(--radius-s); padding: var(--space-2) var(--space-3); }
.card .row { margin-top: var(--space-3); }
.row .btn.grow { padding: var(--space-1) var(--space-3); white-space: normal; line-height: 1.15; }
.card > .btn.wide { margin-top: var(--space-3); }
.card > .link-btn { display: block; margin: var(--space-2) auto 0; }

.progress { display: flex; align-items: center; gap: var(--space-3); }
.bar { flex: 1; height: 14px; background: var(--well); border: 2px solid var(--outline); border-radius: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--teal); transition: width .4s; width: 0; }
/* Widths as classes: inline styles are blocked by the CSP. */
.bar .w5 { width: 5%; } .bar .w10 { width: 10%; } .bar .w15 { width: 15%; } .bar .w20 { width: 20%; }
.bar .w25 { width: 25%; } .bar .w30 { width: 30%; } .bar .w35 { width: 35%; } .bar .w40 { width: 40%; }
.bar .w45 { width: 45%; } .bar .w50 { width: 50%; } .bar .w55 { width: 55%; } .bar .w60 { width: 60%; }
.bar .w65 { width: 65%; } .bar .w70 { width: 70%; } .bar .w75 { width: 75%; } .bar .w80 { width: 80%; }
.bar .w85 { width: 85%; } .bar .w90 { width: 90%; } .bar .w95 { width: 95%; } .bar .w100 { width: 100%; }

.steps-list summary { cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 800; margin-top: var(--space-2); }
/* Tasks finished before today: one folded block, a heading per day inside */
.past-days > summary { list-style: none; cursor: pointer; }
.past-days > summary::-webkit-details-marker { display: none; }
.past-days .fold {
  display: inline-block; margin-left: 6px; vertical-align: middle; transition: transform .2s;
  border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 7px solid currentColor;
}
.past-days:not([open]) .fold { transform: rotate(-90deg); }
.day-head { margin: var(--space-4) 0 var(--space-2); font-size: 15px; color: var(--muted); }
.day-head::first-letter { text-transform: uppercase; }
.steps-list ol { margin: var(--space-2) 0 0; padding-left: var(--space-6); }
.steps-list li { margin: var(--space-1) 0; }
.steps-list li.done { color: var(--muted); text-decoration: line-through; }

.reward-list { list-style: none; padding: 0; margin: 0; }
.reward { display: flex; align-items: center; gap: var(--space-3); }

/* Kids strip on the parent's tasks tab */
.kids-strip { display: flex; gap: var(--space-2); overflow-x: auto; margin: 0 calc(-1 * var(--space-4)) var(--space-4); padding: 0 var(--space-4) var(--space-1); }
.kid-chip {
  display: flex; align-items: center; gap: var(--space-2); flex: none;
  background: var(--surface); border: var(--border) solid var(--outline); border-radius: var(--radius-s);
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-2); box-shadow: var(--drop);
}
.kid-chip .kid-face { width: 40px; height: 40px; font-size: 20px; border-width: 2px; border-radius: 10px; overflow: hidden; }
.kid-face .pet { --pet-size: 120%; margin: 4px 0 0 -10%; }
/* The kid's numbers in "Family": small tiles, the number big, what it is under it */
.kstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(52px, 1fr)); gap: 6px; margin: var(--space-3) 0; }
.kstat { display: grid; justify-items: center; align-content: start; gap: 2px; padding: var(--space-2) 2px; background: var(--well); border-radius: var(--radius-s); text-align: center; }
.kstat-v { display: inline-flex; align-items: center; gap: 3px; font-size: 18px; line-height: 1.1; }
.kstat-v b { font-weight: 800; color: var(--ink); }
.kstat-v svg { width: 18px; height: 18px; flex: none; }
.kstat-lvl { font-size: 10px; font-weight: 900; padding: 1px 5px; border-radius: 6px; background: linear-gradient(var(--teal-hi), var(--teal)); color: var(--ink-dark); border: 2px solid var(--outline); }
.kstat-emoji { font-size: 17px; }
.kstat-l { font-size: 11px; font-weight: 700; color: var(--muted); line-height: 1.15; }
.kid-phone { display: flex; align-items: center; column-gap: var(--space-4); row-gap: var(--space-1); flex-wrap: wrap; font-weight: 700; }
.kid-phone .phone-ok { flex: 1 0 100%; }
.kid-chip .small { font-weight: 700; }

/* ── Sign-in ── */

/* ── The landing page (app/pages/landing.html, public/js/landing.js): the night sky, one column on a phone,
   text and pictures side by side from 800px ── */
.lp { overflow-x: hidden; }
.lp a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.lp a.link-btn { text-decoration: none; }
.lp h2 { font-size: clamp(26px, 6vw, 36px); line-height: 1.15; font-weight: 900; margin: 0 0 var(--space-4); text-shadow: 0 3px 0 var(--outline); }
.lp h3 { font-size: 19px; }
.lp-muted, .lp-note { color: var(--muted); font-weight: 600; }
.lp-top, .lp-main, .lp-foot { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; padding-left: var(--space-4); padding-right: var(--space-4); }
.lp-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding-top: var(--space-3); padding-bottom: var(--space-3); }
.lp-brand { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--white); text-decoration: none; font-weight: 900; font-size: 22px; }
.lp-nav { display: flex; align-items: center; gap: var(--space-4); }
.lp-nav .btn.lp-signin { min-height: 42px; padding: 0 var(--space-4); font-size: 16px; }
.lp-main > section { margin: calc(var(--space-8) * 2) 0; }
.lp-main > .lp-hero { margin-top: var(--space-4); }
.lp-narrow { max-width: 720px; margin-left: auto !important; margin-right: auto !important; }

.lp-hero { display: flex; flex-direction: column-reverse; align-items: center; gap: var(--space-4); text-align: center; }
.lp-hero h1 { font-size: clamp(34px, 9vw, 52px); line-height: 1.05; margin: 0 0 var(--space-4); text-shadow: 0 4px 0 var(--outline); }
.lp-lead { font-size: clamp(18px, 4.6vw, 21px); font-weight: 600; color: var(--cloud); margin: 0 0 var(--space-6); }
/* Stacked, both as wide as the wider one (and at least 300px) */
.lp-ctas { display: inline-grid; gap: var(--space-3); min-width: min(100%, 300px); max-width: 100%; }
.lp-kid-link { color: var(--lilac); font-weight: 800; white-space: normal; }
.lp-note { font-size: 15px; margin-top: var(--space-4); }
.lp-pets { display: flex; justify-content: center; align-items: flex-end; font-size: 72px; line-height: 1; }
.lp-pets > span { cursor: pointer; }
.lp-pets > span:not(:has(.pet)) { animation: bob 2.4s ease-in-out infinite; }
.lp-pets .pet { --pet-size: min(31vw, 150px); }
.lp-pets > span:nth-child(2) .pet { --pet-size: min(38vw, 190px); }

.lp-why p { font-size: 18px; color: var(--cloud); }
.lp-story { margin-top: var(--space-5) !important; padding: var(--space-4) var(--space-5); border: var(--border) solid var(--outline);
  border-radius: var(--radius); background: linear-gradient(var(--indigo-1), var(--indigo-2)); box-shadow: var(--drop);
  color: var(--white) !important; font-weight: 700; }

.lp-split { display: grid; gap: var(--space-6); align-items: center; }
.lp-split-text > p { font-size: 18px; color: var(--cloud); }
.lp-points { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: grid; gap: var(--space-3); }
.lp-points li { display: flex; gap: var(--space-3); align-items: flex-start; }
.lp-points li > span { flex: none; width: 44px; height: 44px; display: grid; place-items: center; font-size: 24px;
  border: var(--border) solid var(--outline); border-radius: var(--radius-s); background: var(--indigo-2); box-shadow: 0 3px 0 var(--outline); }
.lp-points p { margin: var(--space-1) 0 0; font-weight: 600; }

.lp-phones { display: flex; justify-content: center; align-items: flex-start; gap: var(--space-4); }
.lp-phone { margin: 0; width: min(43vw, 250px); padding: 6px; border: 4px solid var(--outline); border-radius: 34px;
  background: var(--ink-dark); box-shadow: var(--drop-big); transform: rotate(-2deg); }
.lp-phone + .lp-phone { margin-top: var(--space-8); transform: rotate(2deg); }
.lp-phone img { display: block; width: 100%; height: auto; aspect-ratio: 390 / 844; object-fit: cover; object-position: top; border-radius: 26px; }

.lp-demo-box { width: 100%; max-width: 420px; justify-self: center; padding: var(--space-3); border: 4px solid var(--outline); border-radius: 30px;
  background: var(--indigo-4); box-shadow: var(--drop-big); }
.lp-demo-bar { display: flex; justify-content: flex-end; margin-bottom: var(--space-2); }
.lp-demo-box .mascot-area { margin-bottom: var(--space-3); min-height: 110px; }
.lp-demo-box .mascot { font-size: 64px; }
.lp-demo-box .mascot.has-art .pet { --pet-size: 120px; }
.lp-demo-box .bubble.lp-pop { animation: popin .4s both; }
.lp-demo-box .task-block { animation: none; }
.lp-demo-box .check-item.done .ci-meta { display: none; }
.lp-chest { font-size: 26px; line-height: 1; }
.lp-finished .task-block { box-shadow: 0 0 0 4px var(--yellow), 0 6px 0 var(--outline); }
.lp-finished .tb-bonus { color: var(--yellow); }
.lp-finished .lp-chest { animation: pop .6s; }
.lp-demo-again { display: flex; align-items: center; justify-content: center; gap: var(--space-2); margin: var(--space-4) auto 0; }
.lp-demo-again[hidden] { display: none; }

.lp-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); }
.lp-card { position: relative; padding: var(--space-5); border: var(--border) solid var(--outline); border-radius: var(--radius);
  background: linear-gradient(var(--indigo-1), var(--indigo-2) 60%); box-shadow: inset 0 2px 0 var(--gloss), var(--drop-big); }
.lp-card h3 { margin: var(--space-3) 0 var(--space-2); }
.lp-card p { margin: 0; color: var(--cloud); font-weight: 500; }
.lp-card-emoji { font-size: 40px; line-height: 1; }
.lp-steps { counter-reset: lp-step; }
.lp-steps .lp-card { counter-increment: lp-step; }
.lp-steps .lp-card::after { content: counter(lp-step); position: absolute; top: var(--space-4); right: var(--space-4); width: 36px; height: 36px;
  display: grid; place-items: center; border: var(--border) solid var(--outline); border-radius: 50%; font-weight: 900;
  background: linear-gradient(var(--yellow-hi), var(--yellow) 50%, var(--yellow-lo)); color: var(--ink-dark); box-shadow: 0 3px 0 var(--outline); }

.lp-qa { margin-bottom: var(--space-3); border: var(--border) solid var(--outline); border-radius: var(--radius-s); background: var(--indigo-2); box-shadow: var(--drop); }
.lp-qa summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); font-weight: 800; font-size: 18px; }
.lp-qa summary::-webkit-details-marker { display: none; }
.lp-qa summary::after { content: "+"; flex: none; font-size: 24px; line-height: 1; color: var(--yellow); }
.lp-qa[open] summary::after { content: "−"; }
.lp-qa p { margin: 0; padding: 0 var(--space-4) var(--space-4); color: var(--cloud); }

.lp-final { text-align: center; padding: var(--space-8) var(--space-5); border: 4px solid var(--outline); border-radius: 30px;
  background: radial-gradient(120% 120% at 50% 0%, var(--violet) 0%, var(--indigo-1) 55%, var(--indigo-2) 100%); box-shadow: var(--drop-big); }
.lp-final p { font-size: 18px; color: var(--cloud); margin: 0 0 var(--space-6); }
.lp-foot { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: var(--space-2) var(--space-4);
  padding-top: var(--space-4); padding-bottom: var(--space-8); color: var(--muted); font-size: 14px; font-weight: 600; }

@media (min-width: 720px) {
  .lp-how .lp-cards { grid-template-columns: repeat(3, 1fr); }
  .lp-care .lp-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .lp-care .lp-cards { grid-template-columns: repeat(3, 1fr); }  /* six cards: 3 + 3 (or 2 + 2 + 2 below) */
}
@media (min-width: 800px) {
  .lp-hero { flex-direction: row; text-align: left; gap: var(--space-8); }
  .lp-hero-text { flex: 1.15; }
  .lp-hero .lp-pets { flex: 1; }
  .lp-pets .pet { --pet-size: 150px; }
  .lp-pets > span:nth-child(2) .pet { --pet-size: 200px; }
  .lp-split { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
  .lp-flip .lp-split-text { order: 2; }
  .lp-phone { width: 230px; }
}
.big-emoji { font-size: 64px; text-align: center; margin-top: var(--space-4); }
.kid-theme h1, .kid-theme > p { text-align: center; }
.kid-theme h1 { text-shadow: 0 3px 0 var(--outline); }
.kid-theme .muted { font-weight: 600; }

/* ── Task editor ── */
.steps-edit { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.step-edit {
  background: var(--surface); border: var(--border) solid var(--outline); border-radius: var(--radius-s);
  padding: var(--space-3); margin-bottom: var(--space-3); box-shadow: var(--drop);
}
.small-controls { margin-top: var(--space-2); gap: var(--space-3); }
.mini.check { gap: var(--space-2); }
.editor .btn.wide { margin-top: var(--space-4); }
.editor-tools { margin-top: var(--space-4); }

/* Templates in the editor: the family's own as a short list of rows; three ready-made ideas as cards at the bottom */
.tpl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.tpl-item { display: flex; align-items: center; gap: var(--space-1); }
.tpl-use {
  flex: 1; min-width: 0; min-height: 48px; display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-3); border: var(--border) solid var(--outline); border-radius: var(--radius-s);
  background: var(--warn-soft); color: var(--ink); font: inherit; text-align: left; cursor: pointer; box-shadow: var(--drop);
}
.tpl-use .tpl-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-use .tpl-emoji { font-size: 22px; }
.tpl-more { margin-top: var(--space-2); }
.tpl-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); padding-bottom: var(--space-2); }
.tpl-card {
  min-height: 104px; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1);
  padding: var(--space-2); border: var(--border) solid var(--outline); border-radius: var(--radius-s);
  background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; box-shadow: var(--drop);
}
.tpl-use:active, .tpl-card:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--outline); }
.tpl-emoji { font-size: 26px; }
.tpl-title { font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.spin { display: inline-block; animation: spin 1.2s linear infinite; }

/* "When": now / on a day / repeating */
.seg { display: flex; gap: var(--space-2); }
.seg-btn, .day-chip, .wd {
  border: var(--border) solid var(--outline); border-radius: 12px; background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 800; cursor: pointer; box-shadow: 0 3px 0 var(--outline);
}
.seg-btn { flex: 1; min-height: 46px; }
.seg-btn.on, .day-chip.on, .wd.on { background: linear-gradient(var(--yellow-hi), var(--yellow) 50%, var(--yellow-lo)); color: var(--accent-ink); }
.day-chips { display: flex; gap: var(--space-2); overflow-x: auto; margin: var(--space-3) calc(-1 * var(--space-4)) 0; padding: 0 var(--space-4) var(--space-2); }
.day-chip { flex: none; min-height: 40px; padding: 0 var(--space-3); white-space: nowrap; }
.weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: var(--space-3) 0 var(--space-2); }
.wd { min-height: 44px; padding: 0; font-size: 14px; }
.mini.check.carry, .editor > .mini.check { display: flex; align-items: flex-start; margin-top: var(--space-3); line-height: 1.3; }
.mini.check input { flex: none; }
.card.plan.paused { opacity: .6; }
.move-slot:empty { display: none; }
.move-slot { margin-top: var(--space-3); }

/* ── Family / QR ── */
.qr-slot:empty { display: none; }
.qr { background: var(--white); border: var(--border) solid var(--outline); border-radius: var(--radius-s); padding: var(--space-3); max-width: 260px; margin: var(--space-4) auto var(--space-2); }
.qr svg { display: block; width: 100%; height: auto; }
.pair-code { text-align: center; font-size: 30px; font-weight: 900; letter-spacing: 4px; }
/* ── Photo reports ── */
.file-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.photo-pick { position: relative; display: flex; align-items: center; justify-content: center; text-align: center; gap: var(--space-2); }
.photo-pick.done-btn { font-size: 22px; line-height: 1.15; text-transform: none; white-space: normal; letter-spacing: 0; padding: var(--space-2) var(--space-4); }
.photo-hint { text-align: center; font-weight: 600; color: var(--muted); margin: var(--space-2) 0 0; }
.photo-preview { display: block; width: 100%; max-height: 50vh; object-fit: contain; margin: var(--space-3) 0;
  border: var(--border) solid var(--outline); border-radius: var(--radius-s); background: var(--outline); }
.step-card .photo-pick.secondary { margin-top: var(--space-3); }
.photo-thumbs { display: flex; gap: var(--space-2); flex-wrap: wrap; margin: var(--space-3) 0; }
.photo-thumb { padding: 0; width: 120px; height: 120px; border: var(--border) solid var(--outline);
  border-radius: var(--radius-s); overflow: hidden; background: var(--outline); cursor: zoom-in; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .2s; }
.photo-thumb img.ready { opacity: 1; }
@media (min-width: 720px) { .photo-thumb { width: 180px; height: 180px; } }
.photo-view { position: fixed; inset: 0; z-index: var(--z-modal); background: var(--scrim); display: flex;
  align-items: center; justify-content: center; padding: var(--space-4); cursor: zoom-out; }
.photo-view img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--radius-s); }
.photo-close { position: absolute; top: calc(var(--space-4) + env(safe-area-inset-top)); right: var(--space-4);
  color: var(--white); font-size: 28px; font-weight: 900; }

.adults { list-style: none; margin: 0 0 var(--space-3); padding: 0; }
.adult { display: flex; align-items: center; gap: var(--space-2); min-height: 40px; font-weight: 700; overflow-wrap: anywhere; }
.adult .link-btn { flex: none; }
.invite-link { width: 100%; margin-bottom: var(--space-3); font-size: 14px; }

/* ── Kid: the night sky ── */
.sky { position: fixed; inset: 0; z-index: var(--z-sky); pointer-events: none; }
.sky i { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: var(--white); animation: twinkle 2.6s infinite; }
.sky i:nth-child(1) { left: 10%; top: 18%; }
.sky i:nth-child(2) { left: 85%; top: 14%; width: 5px; height: 5px; background: var(--yellow-hi); animation-duration: 3.1s; animation-delay: .6s; }
.sky i:nth-child(3) { left: 74%; top: 28%; width: 3px; height: 3px; animation-duration: 2.2s; animation-delay: 1.1s; }
.sky i:nth-child(4) { left: 18%; top: 31%; width: 3px; height: 3px; background: var(--teal-hi); animation-duration: 2.8s; animation-delay: .3s; }
.sky i:nth-child(5) { left: 55%; top: 8%; width: 3px; height: 3px; animation-duration: 3.4s; animation-delay: 1.6s; }
.sky i:nth-child(6) { left: 92%; top: 46%; width: 4px; height: 4px; background: var(--pink-hi); animation-duration: 2.9s; animation-delay: .9s; }

/* HUD: stars, coins, streak, sound; level and the XP bar */
.kid-top {
  position: sticky; top: 0; z-index: var(--z-bar);
  display: flex; flex-direction: column; gap: var(--space-2);
  max-width: 640px; margin: 0 auto;
  padding: calc(var(--space-3) + env(safe-area-inset-top)) var(--space-4) var(--space-2);
  background: linear-gradient(var(--indigo-3) 70%, transparent);
}
.hud { display: flex; align-items: center; gap: var(--space-2); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px;
  background: linear-gradient(var(--indigo-1), var(--indigo-2)); color: var(--white);
  border: var(--border) solid var(--outline); border-radius: var(--radius-s);
  padding: 2px 12px 2px 8px; font: inherit; font-weight: 900; font-size: 19px;
  box-shadow: inset 0 2px 0 rgb(255 255 255 / .18), 0 3px 0 var(--outline);
}
.chip svg { width: 22px; height: 22px; flex: none; }
.chip.pop { animation: pop .5s; }
.chip.streak { background: linear-gradient(var(--pink-hi), var(--pink)); padding-right: 10px; }
.chip.streak svg { width: 18px; height: 20px; animation: floaty 1.6s ease-in-out infinite; }
.sound-btn { padding: 2px 8px; font-size: 17px; cursor: pointer; }
.xp-row { display: flex; align-items: center; gap: var(--space-2); }
.lvl {
  background: linear-gradient(var(--teal-hi), var(--teal)); color: var(--ink-dark);
  border: var(--border) solid var(--outline); border-radius: 12px; padding: 1px 8px;
  font-weight: 900; font-size: 14px; box-shadow: inset 0 2px 0 rgb(255 255 255 / .5); white-space: nowrap;
}
.xp-bar {
  flex: 1; height: 18px; background: var(--indigo-4); border: var(--border) solid var(--outline);
  border-radius: 10px; overflow: hidden; box-shadow: inset 0 3px 4px rgb(0 0 0 / .4);
}
.xp-bar i {
  display: block; position: relative; overflow: hidden; height: 100%; width: var(--xp, 0%); min-width: 6px;
  background: linear-gradient(var(--teal-hi), var(--teal)); border-radius: 6px;
  transition: width .9s cubic-bezier(.3, 1.4, .5, 1) .5s;
}
.xp-bar i::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 30%;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / .7), transparent);
  animation: shine 2.4s ease-in-out infinite;
}
.xp-num { font-size: 13px; font-weight: 800; color: var(--lilac); font-variant-numeric: tabular-nums; white-space: nowrap; }

.i-star path { fill: var(--yellow); stroke: var(--ink-dark); stroke-width: 1.6; stroke-linejoin: round; }
.i-coin circle { fill: var(--orange); stroke: var(--ink-dark); stroke-width: 1.8; }
.i-coin .ring { fill: none; stroke: var(--orange-lo); stroke-width: 1.4; }
.i-flame path { fill: var(--yellow); stroke: var(--ink-dark); stroke-width: 1.6; }
.i-flame .core { fill: var(--white); stroke: none; }

/* Mascot and its speech bubble */
.mascot-area { display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-4); min-height: 120px; }
.mascot {
  position: relative; flex: none; font-size: 72px; line-height: 1; width: 104px; height: 104px;
  border: var(--border) solid var(--outline); border-radius: 50%; background: var(--surface); box-shadow: var(--drop); cursor: pointer;
  animation: bob 3s ease-in-out infinite;
}
.mascot-area.sleepy .mascot { animation: none; filter: saturate(.7); }
.mascot.has-art, .mascot-area.sleepy .mascot.has-art {
  width: auto; height: auto; padding: 0; border: 0; background: none; box-shadow: none; border-radius: 0;
  animation: none; filter: none; -webkit-tap-highlight-color: transparent;
}
.mascot.has-art .pet { --pet-size: 150px; }
.mascot.has-art .heart { top: 10%; }
.mascot.jump { animation: jump .6s; }
.zzz { position: absolute; top: -6px; right: -6px; font-size: 24px; }
.heart { position: absolute; left: 50%; top: 0; font-size: 28px; animation: float-up 1s forwards; pointer-events: none; }
.bubble {
  position: relative; flex: 1; min-width: 0; margin-bottom: var(--space-8);
  background: linear-gradient(var(--white), var(--cloud)); color: var(--navy);
  border: var(--border) solid var(--outline); border-radius: 18px; padding: 10px 12px;
  font-weight: 800; font-size: 16px; line-height: 1.3; box-shadow: var(--drop);
  animation: popin .4s both;
}
/* The tail: an outline-coloured triangle, and a fill triangle with parallel edges on top of it that also covers
   the bubble's border where they join (fill ≈ the gradient's colour at that height). */
.bubble::before, .bubble::after {
  content: ""; position: absolute; clip-path: polygon(0 50%, 100% 0, 100% 100%);
}
.bubble::before { left: -14px; bottom: 10px; width: 14px; height: 22px; background: var(--outline); }
.bubble::after { left: -9px; bottom: 11.5px; width: 12px; height: 19px; background: color-mix(in srgb, var(--cloud) 75%, var(--white)); }
.mascot-name { display: none; }

/* One step */
.step-card {
  position: relative; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: var(--space-3);
  background: linear-gradient(var(--indigo-1), var(--indigo-2) 40%);
  border: 4px solid var(--outline); border-radius: 28px; padding: var(--space-4) 18px var(--space-5);
  box-shadow: inset 0 3px 0 rgb(255 255 255 / .15), 0 8px 0 var(--outline), 0 18px 30px rgb(0 0 0 / .35);
  animation: slide-in .45s cubic-bezier(.2, 1.2, .4, 1);
}
.step-card.leaving { animation: slide-out .4s ease-in forwards; }
.step-card.redo { box-shadow: 0 0 0 4px var(--orange), 0 8px 0 var(--outline); }
.stars-tag {
  position: absolute; top: -16px; right: 18px;
  background: linear-gradient(var(--yellow-hi), var(--yellow) 50%, var(--yellow-lo)); color: var(--ink-dark);
  border: var(--border) solid var(--outline); border-radius: 12px; padding: 2px 10px;
  font-weight: 900; font-size: 16px; box-shadow: 0 3px 0 var(--outline);
}
.step-task { font-size: 13px; font-weight: 800; color: var(--lilac); letter-spacing: .5px; text-transform: uppercase; }
.dots { display: flex; justify-content: center; gap: 6px; width: 100%; }
.dots i {
  flex: 1; max-width: 56px; min-width: 8px; height: 12px; border-radius: 6px;
  border: 2px solid var(--outline); background: var(--indigo-4); transition: background .4s;
}
.dots i.on { background: var(--teal); }
.dots i.now { background: var(--yellow); }
.step-icon {
  width: 104px; height: 104px; display: grid; place-items: center; font-size: 58px; line-height: 1;
  border: 4px solid var(--outline); border-radius: 30px;
  background: radial-gradient(circle at 35% 30%, var(--violet-hi), var(--violet) 55%, var(--violet-lo));
  box-shadow: inset 0 -6px 0 rgb(0 0 0 / .18), inset 0 4px 0 rgb(255 255 255 / .3);
  animation: floaty 2.4s ease-in-out infinite;
}
.step-title { margin: 0; font-size: 30px; line-height: 1.1; font-weight: 900; text-shadow: 0 3px 0 var(--outline); overflow-wrap: anywhere; }
.note { color: var(--navy); }
.timer-slot { min-height: 56px; display: flex; justify-content: center; }
.timer-btn {
  display: flex; align-items: center; gap: var(--space-3); border: 0; background: none; padding: 0;
  font: inherit; color: var(--lilac); font-size: 15px; font-weight: 700; text-align: left; cursor: pointer;
}
.timer-btn b { color: var(--white); }
.timer-btn svg { width: 54px; height: 54px; flex: none; transform: rotate(-90deg); }
.timer-btn circle { fill: none; stroke-width: 8; }
.timer-btn .track { stroke: var(--indigo-4); }
.timer-btn .hand { stroke: var(--teal); stroke-linecap: round; stroke-dasharray: 164; stroke-dashoffset: 30; }
.timer { position: relative; width: 140px; height: 140px; border: 0; background: none; padding: 0; cursor: pointer; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 12; }
.timer .track { stroke: var(--indigo-4); }
.timer .left { stroke: var(--teal); stroke-linecap: round; transition: stroke-dashoffset .5s linear; }
.timer.over .left { stroke: var(--orange); }
.timer .time { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; font-weight: 900; color: var(--white); }
.done-btn {
  width: 100%; min-height: 74px; border: 4px solid var(--outline); border-radius: 22px;
  background: linear-gradient(var(--teal-hi) 0%, var(--teal) 45%, var(--teal-lo) 100%); color: var(--ink-dark);
  font: inherit; font-size: 28px; font-weight: 900; letter-spacing: .5px; text-transform: uppercase;
  box-shadow: inset 0 4px 0 rgb(255 255 255 / .55), 0 7px 0 var(--outline); cursor: pointer;
  text-shadow: 0 1px 0 rgb(255 255 255 / .5); transition: transform .08s, box-shadow .08s;
}
.done-btn:active { transform: translateY(5px); box-shadow: inset 0 4px 0 rgb(255 255 255 / .55), 0 2px 0 var(--outline); }
.done-btn:disabled { opacity: .7; }
.step-card.rest { padding: var(--space-8) var(--space-4); }

.late-tag {
  margin-top: calc(-1 * var(--space-2)); font-size: 13px; font-weight: 800; color: var(--ink-dark);
  background: var(--lilac); border: 2px solid var(--outline); border-radius: 10px; padding: 1px 8px;
}

/* The week: a row per day (columns on a wide screen) */
.week { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.wday {
  display: flex; gap: var(--space-3); align-items: flex-start;
  background: var(--surface); border: var(--border) solid var(--outline); border-radius: var(--radius-s);
  padding: var(--space-2) var(--space-3); box-shadow: 0 3px 0 var(--outline);
}
.wday.today { box-shadow: 0 0 0 3px var(--yellow), 0 3px 0 var(--outline); }
.wday.past { background: var(--well); }
.wday-name { width: 34px; flex: none; display: flex; flex-direction: column; align-items: center; line-height: 1.1; padding-top: 2px; }
.wday-name span { font-size: 13px; color: var(--muted); font-weight: 700; }
.wday.today .wday-name b { color: var(--yellow); }
.wday-items { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.witem {
  font-size: 14px; font-weight: 700; padding: 3px 9px; border-radius: 10px;
  border: 2px solid var(--outline); background: var(--indigo-1); max-width: 100%; overflow-wrap: break-word; hyphens: auto;
}
.witem.done { background: var(--teal); color: var(--ink-dark); }
.witem.today { background: var(--white); color: var(--navy); }
.witem.late { background: var(--white); color: var(--navy); border-style: dashed; }
.witem.planned { opacity: .75; }
.witem.missed { opacity: .35; }
.witem.event { background: var(--pink-hi); color: var(--ink-dark); }
.wfree { font-size: 14px; color: var(--muted); padding: 3px 0; }

/* The chest at the end of a task */
.chest-card { overflow: hidden; animation: popin .5s both; }
.chest-card > * { position: relative; }
.chest-card .rays {
  position: absolute; left: 50%; top: 80px; width: 380px; height: 380px; margin: -190px 0 0 -190px;
  background: repeating-conic-gradient(rgb(255 210 63 / .22) 0 12deg, transparent 12deg 30deg);
  border-radius: 50%; animation: rays 12s linear infinite;
}
.i-chest { width: 150px; height: 130px; }
.i-chest .box { fill: var(--brown); stroke: var(--ink-dark); stroke-width: 4; }
.i-chest .band { fill: var(--brown-lo); }
.i-chest .lock, .i-chest .gold { fill: var(--yellow); stroke: var(--ink-dark); stroke-width: 3; }
.i-chest .gold.light { fill: var(--yellow-hi); }
.i-chest .lid path { fill: var(--orange-lo); stroke: var(--ink-dark); stroke-width: 4; stroke-linejoin: round; }
.i-chest .lid .shine { fill: none; stroke: var(--white); stroke-width: 3; opacity: .4; stroke-linecap: round; }
.i-chest .lid { transform-box: fill-box; transform-origin: 4% 100%; animation: lid .7s .3s both; }
.chest-text { color: var(--lilac); font-weight: 700; }

/* Level up: the mascot grew, what opened */
.levelup { position: fixed; inset: 0; z-index: var(--z-modal); background: var(--scrim); display: grid; place-items: center;
  padding: var(--space-4); overflow-y: auto; }
.levelup-card { width: min(420px, 100%); overflow: hidden; animation: popin .5s both; }
.levelup-card > * { position: relative; }
.levelup-card .rays {
  position: absolute; left: 50%; top: 110px; width: 420px; height: 420px; margin: -210px 0 0 -210px;
  background: repeating-conic-gradient(rgb(255 210 63 / .22) 0 12deg, transparent 12deg 30deg);
  border-radius: 50%; animation: rays 12s linear infinite;
}
.levelup-pet .pet { --pet-size: 190px; }
.levelup-text { color: var(--lilac); font-weight: 800; margin: 0; }
.new-items { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); }
.new-item { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); width: 96px;
  padding: var(--space-2); border: var(--border) solid var(--outline); border-radius: var(--radius-s);
  background: var(--indigo-2); color: var(--white); font-size: 14px; }
.new-item img { width: 60px; height: 48px; object-fit: contain; }

/* Wardrobe */
.mascot-area { position: relative; }
.wardrobe-btn { position: absolute; right: 0; bottom: 0; width: 44px; height: 44px; justify-content: center; font-size: 22px; padding: 0; cursor: pointer; }
.back-link { color: var(--lilac); }
.ward-title { text-align: center; text-shadow: 0 3px 0 var(--outline); margin-top: 0; }
.ward-pet .pet { --pet-size: 200px; }
.ward-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--space-2); }
.ward-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-1);
  min-height: 96px; padding: var(--space-2); font: inherit; font-size: 13px; font-weight: 800; color: var(--white);
  border: var(--border) solid var(--outline); border-radius: var(--radius-s); background: var(--indigo-2);
  box-shadow: 0 4px 0 var(--outline); cursor: pointer; text-align: center; }
.ward-item img { width: 64px; height: 44px; object-fit: contain; }
.ward-item.on { background: linear-gradient(var(--teal-hi), var(--teal) 45%, var(--teal-lo)); color: var(--ink-dark); }
.ward-item.locked { cursor: default; opacity: .55; box-shadow: none; }
.ward-item.locked img { filter: grayscale(1) brightness(.7); }
.ward-none { font-size: 30px; line-height: 44px; }

.queue { list-style: none; padding: 0; margin: 0; }
.queue li {
  display: flex; align-items: center; gap: var(--space-3);
  background: var(--surface); border: var(--border) solid var(--outline); border-radius: var(--radius-s);
  padding: var(--space-2) var(--space-3); margin-bottom: var(--space-2); font-weight: 700;
}
.queue.waiting li { background: var(--well); }
.q-emoji { font-size: 22px; }

.picker .mascot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); margin: var(--space-4) 0; }
.mascot-option {
  font-size: 52px; aspect-ratio: 1; border-radius: var(--radius); border: var(--border) solid var(--outline);
  background: linear-gradient(var(--indigo-1), var(--indigo-2)); box-shadow: var(--drop); cursor: pointer;
  transition: transform .15s; padding: 0;
}
.mascot-option.on { background: linear-gradient(var(--yellow-hi), var(--yellow) 50%, var(--yellow-lo)); transform: scale(1.06); }
.mascot-option .pet { --pet-size: 100%; }

.shop { list-style: none; padding: 0; margin: 0; }
.shop-item { display: flex; align-items: center; gap: var(--space-3); }
.shop-item.can { box-shadow: 0 0 0 3px var(--yellow), var(--drop); }
.shop-emoji {
  width: 56px; height: 56px; flex: none; display: grid; place-items: center; font-size: 30px;
  border: var(--border) solid var(--outline); border-radius: 16px;
  background: radial-gradient(circle at 35% 30%, var(--pink-hi), var(--pink) 70%);
}
.price { display: flex; align-items: center; gap: 4px; color: var(--yellow); font-weight: 900; }
.price svg { width: 18px; height: 18px; }
.need { color: var(--muted); font-size: 14px; font-weight: 800; white-space: nowrap; }

/* ── Animated mascot (pet.js): stacked picture layers ── */
.pet {
  position: relative; display: block; width: var(--pet-size, 160px); aspect-ratio: 1;
  isolation: isolate; margin: 0 auto;
}
.pet img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; user-select: none; -webkit-user-select: none;
}
.pet img.img-failed { visibility: hidden; }
.pet::after {   /* soft shadow on the floor */
  content: ""; position: absolute; left: 20%; right: 20%; bottom: 1%; height: 8%; z-index: -1;
  border-radius: 50%; background: radial-gradient(closest-side, rgb(0 0 0 / .35), transparent);
}
.pet-sit { position: absolute; inset: 0; transform-origin: 50% 96%; animation: pet-breathe 3.6s ease-in-out infinite; }
.pet-tail { transform-origin: 69% 80%;   /* the tail joint, printed by scripts/mascot_frames.py */ animation: pet-wag 3.2s ease-in-out infinite; }
.pet-sparrow .pet-tail { transform-origin: 78% 71%; }
.pet[data-face=happy] .pet-tail { animation: pet-wag-fast .45s ease-in-out infinite; }
.pet-face { opacity: 0; transition: opacity .1s; }
.pet[data-face=blink] .f-blink, .pet[data-face=happy] .f-happy,
.pet[data-face=wow] .f-wow, .pet[data-face=think] .f-think { opacity: 1; }
.pet[data-face=blink] .f-blink { transition: none; }
.pet-pose, .pet-zzz { opacity: 0; }
.pet.boing { animation: pet-boing .5s ease-out; }

.pet.pose-jump .pet-sit { opacity: 0; }
.pet.pose-jump .p-jump { opacity: 1; animation: pet-hop .9s cubic-bezier(.3, .7, .4, 1); transform-origin: 50% 95%; }
.pet.pose-jump::after { animation: pet-shadow .9s cubic-bezier(.3, .7, .4, 1); }

.pet.pose-sleep .pet-sit { opacity: 0; }
.pet.pose-sleep .p-sleep { opacity: 1; transform-origin: 50% 92%; animation: pet-sleep 4.8s ease-in-out infinite; }
.pet.pose-sleep .pet-zzz { opacity: 1; }
/* Accessories: anchor points per kind (% of the picture), and again for the jump pose. Sleep: taken off. */
.pet-fox { --head-x: 46%; --head-y: 21%; --head-w: 40%; --eyes-x: 46%; --eyes-y: 37%; --eyes-w: 47%; --neck-x: 46%; --neck-y: 55%; --neck-w: 40%; }
.pet-fox .p-jump { --head-x: 47%; --head-y: 22%; --eyes-x: 47%; --eyes-y: 34%; --neck-x: 47%; --neck-y: 52%; }
.pet-penguin { --head-x: 50%; --head-y: 18%; --head-w: 53%; --head-r: -7deg; --eyes-x: 52.5%; --eyes-y: 28.5%; --eyes-w: 50%; --eyes-r: -8deg; --neck-x: 50%; --neck-y: 48.5%; --neck-w: 44%; }
.pet-penguin .p-jump { --head-x: 50%; --head-y: 17%; --head-r: -10deg; --eyes-x: 53%; --eyes-y: 27.5%; --eyes-r: -12deg; --neck-x: 50%; --neck-y: 47%; --neck-r: -4deg; }
.pet-sparrow { --head-x: 43.5%; --head-y: 20%; --head-w: 50%; --eyes-x: 38%; --eyes-y: 40%; --eyes-w: 58%; --neck-x: 40%; --neck-y: 62%; --neck-w: 40%; }
.pet-sparrow .p-jump { --head-x: 48%; --head-y: 18%; --eyes-x: 44%; --eyes-y: 36%; --neck-x: 45%; --neck-y: 61%; }
.pet .p-jump { position: absolute; inset: 0; }
.pet img.pet-acc { right: auto; bottom: auto; height: auto; }
/* --*-r: the head's own tilt in the picture, so a hat or glasses follow it */
.pet-acc.acc-head { left: var(--head-x); top: var(--head-y); width: var(--head-w); transform: translate(-50%, -80%) rotate(var(--head-r, 0deg)); }
.pet-acc.acc-flowers { transform: translate(-50%, -55%) rotate(var(--head-r, 0deg)); }
.pet-acc.acc-wizard { width: calc(var(--head-w) * 1.1); transform: translate(-50%, -85%) rotate(var(--head-r, 0deg)); }
.pet-acc.acc-eyes { left: var(--eyes-x); top: var(--eyes-y); width: var(--eyes-w); transform: translate(-50%, -50%) rotate(var(--eyes-r, 0deg)); }
.pet-acc.acc-neck { left: var(--neck-x); top: var(--neck-y); width: var(--neck-w); transform: translate(-50%, -40%) rotate(var(--neck-r, 0deg)); }
.pet-acc.acc-bowtie { width: calc(var(--neck-w) * .62); }
.pet-acc.acc-medal { width: calc(var(--neck-w) * .55); transform: translate(-50%, -20%) rotate(var(--neck-r, 0deg)); }
.pet.pose-sleep .pet-acc { display: none; }

.pet-zzz { position: absolute; right: 12%; top: 6%; font-size: 14px; line-height: 1; font-weight: 900; color: var(--lilac); }
.pet-zzz i { position: absolute; font-style: normal; animation: pet-z 3s ease-in infinite; opacity: 0; }
.pet-zzz i:nth-child(2) { animation-delay: 1s; font-size: 1.3em; }
.pet-zzz i:nth-child(3) { animation-delay: 2s; font-size: 1.6em; }

/* ── Effects ── */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--space-6) + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px); opacity: 0; z-index: var(--z-toast);
  width: max-content; max-width: min(420px, calc(100vw - 32px));
  background: var(--navy); color: var(--white); border: var(--border) solid var(--outline);
  padding: var(--space-3) var(--space-5); border-radius: var(--radius-s); text-align: center; font-weight: 800;
  box-shadow: var(--drop); transition: opacity .3s, transform .3s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--pink); }

.fly-star {
  position: fixed; left: 0; top: 0; z-index: var(--z-fx); width: 30px; height: 30px; pointer-events: none;
  animation: fly 1s cubic-bezier(.5, -0.3, .7, 1) forwards;
}
.fly-star svg { width: 100%; height: 100%; }
.confetti {
  position: fixed; top: -12px; left: var(--x); width: 10px; height: 14px; z-index: var(--z-fx);
  background: var(--color); border-radius: 2px; pointer-events: none;
  animation: fall 2s ease-in forwards;
}

@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes jump { 0% { transform: scale(1); } 30% { transform: translateY(-18px) scale(1.1); } 60% { transform: translateY(0) scale(.95); } 100% { transform: scale(1); } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes popin { 0% { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.06); } 100% { transform: scale(1); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float-up { to { transform: translate(-50%, -60px); opacity: 0; } }
@keyframes slide-in { from { transform: translateX(60px) rotate(3deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slide-out { to { transform: translateX(-60px) scale(.9); opacity: 0; } }
@keyframes twinkle { 0%, 100% { opacity: .25; transform: scale(.7); } 50% { opacity: 1; transform: scale(1); } }
@keyframes shine { 0% { transform: translateX(-120%); } 100% { transform: translateX(320%); } }
@keyframes rays { to { transform: rotate(360deg); } }
@keyframes lid { 0% { transform: rotate(0); } 60% { transform: rotate(-38deg); } 100% { transform: rotate(-30deg); } }
@keyframes fly {
  from { transform: translate(var(--x0), var(--y0)) scale(1.4) rotate(0); opacity: 1; }
  to { transform: translate(var(--x1), var(--y1)) scale(.6) rotate(360deg); opacity: .2; }
}
@keyframes fall { to { transform: translate(var(--drift), 105vh) rotate(var(--rot)); } }
@keyframes pet-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.012, 1.028); } }
@keyframes pet-wag { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(4deg); } }
@keyframes pet-wag-fast { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(8deg); } }
@keyframes pet-boing {
  0% { transform: scale(1); } 30% { transform: scale(1.08, .92); } 60% { transform: scale(.96, 1.05); } 100% { transform: scale(1); }
}
@keyframes pet-hop {
  0% { transform: translateY(0) scale(1.08, .9); }
  15% { transform: translateY(-6%) scale(.95, 1.06); }
  45% { transform: translateY(-26%) scale(1); }
  80% { transform: translateY(0) scale(1.07, .92); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes pet-shadow { 45% { transform: scale(.55); opacity: .5; } }
@keyframes pet-sleep { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.02, 1.04); } }
@keyframes pet-z {
  0% { transform: translate(0, 0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translate(14px, -40px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Desktop: the same column, a bit roomier. */
@media (min-width: 800px) {
  .page { padding-top: var(--space-6); }
  .page:has(> .week) { max-width: 1040px; }
  .week { display: grid; grid-template-columns: repeat(7, 1fr); }
  .wday { flex-direction: column; min-height: 220px; }
  .wday-name { width: auto; flex-direction: row; gap: 6px; }
  .wday-items { flex-direction: column; }
  .witem { font-size: 13px; }
  .tabbar { left: 50%; right: auto; transform: translateX(-50%); width: 640px; border: var(--border) solid var(--outline); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; }
}

/* ── Kid: today's checklist (every task with all its steps, checked in any order) ── */
.do-main { display: flex; flex-direction: column; gap: var(--space-4); }
.task-blocks { display: flex; flex-direction: column; gap: var(--space-4); }
.task-block {
  background: linear-gradient(var(--indigo-1), var(--indigo-2) 40%);
  border: 4px solid var(--outline); border-radius: 24px; padding: var(--space-3);
  box-shadow: inset 0 3px 0 rgb(255 255 255 / .15), 0 6px 0 var(--outline);
  animation: slide-in .45s cubic-bezier(.2, 1.2, .4, 1);
}
.task-block.redo { box-shadow: 0 0 0 4px var(--orange), 0 6px 0 var(--outline); }
.task-block.done { background: var(--indigo-2); }
.tb-head { display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-1) var(--space-3); }
.tb-emoji { font-size: 32px; line-height: 1; }
.tb-title { margin: 0; font-size: 21px; line-height: 1.15; font-weight: 900; text-shadow: 0 2px 0 var(--outline); overflow-wrap: anywhere; }
.tb-head .late-tag { display: inline-block; margin-top: var(--space-1); }
.tb-count {
  flex: none; font-weight: 900; font-size: 15px; color: var(--ink-dark); background: var(--lilac);
  border: 2px solid var(--outline); border-radius: 12px; padding: 1px 9px;
}
.tb-bonus { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-3); padding: 0 var(--space-1);
  color: var(--lilac); font-weight: 800; font-size: 14px; }
.tb-bonus .i-chest { width: 34px; height: 30px; flex: none; }
.tb-bonus .i-chest .lid { animation: none; }

.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.check-item {
  display: flex; align-items: center; gap: var(--space-3); min-height: 68px;
  background: var(--indigo-3); border: var(--border) solid var(--outline); border-radius: 18px;
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3); transition: background .25s, opacity .25s;
}
.check-item.fix { background: var(--indigo-4); box-shadow: inset 4px 0 0 var(--orange); }
.check-item.done { background: var(--indigo-2); }
.check-item.done .ci-title { text-decoration: line-through; text-decoration-thickness: 3px; color: var(--lilac); }
.check-item.done .ci-emoji { opacity: .6; }
.ci-num { flex: none; min-width: 26px; height: 26px; padding: 0 6px; display: grid; place-items: center;
  border-radius: 13px; background: var(--indigo-5); color: var(--lilac); font-size: 14px; font-weight: 900; line-height: 1; }
.check-item.done .ci-num { opacity: .6; }
.ci-emoji { font-size: 28px; line-height: 1; flex: none; width: 34px; text-align: center; }
.ci-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.ci-title { font-size: 18px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.ci-note { align-self: flex-start; background: var(--white); color: var(--navy); border: 2px solid var(--outline);
  border-radius: 10px; padding: 2px 8px; font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
.ci-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: 14px; font-weight: 800; }
.ci-tag { color: var(--lilac); }
.ci-stars { color: var(--yellow); }
.play-btn {
  min-height: 34px; padding: 0 var(--space-3); border: 2px solid var(--outline); border-radius: 17px; cursor: pointer;
  background: linear-gradient(var(--yellow-hi), var(--yellow) 50%, var(--yellow-lo)); color: var(--ink-dark);
  font: inherit; font-size: 14px; font-weight: 900; box-shadow: 0 3px 0 var(--outline);
}
.play-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--outline); }
.timer.mini { width: 76px; height: 76px; }
.timer.mini .time { font-size: 17px; }

/* The round checkmark: big enough for a thumb; 📷 steps open the camera */
.tick {
  position: relative; flex: none; width: 52px; height: 52px; padding: 0; display: grid; place-items: center;
  border: 4px solid var(--outline); border-radius: 50%; cursor: pointer; font-size: 22px;
  background: var(--white); box-shadow: inset 0 -4px 0 rgb(0 0 0 / .12), 0 4px 0 var(--outline);
  transition: transform .08s, box-shadow .08s, background .2s;
}
.tick:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--outline); }
.tick.photo { background: linear-gradient(var(--yellow-hi), var(--yellow) 50%, var(--yellow-lo)); }
.tick svg { width: 30px; height: 30px; fill: none; stroke: var(--ink-dark); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.tick.on, .check-item.done .tick { background: linear-gradient(var(--teal-hi), var(--teal) 45%, var(--teal-lo)); animation: popin .3s both; }
.tick:disabled { opacity: 1; }

.levelup .step-card { width: min(420px, 100%); }
.photo-sheet .photo-preview { margin: 0; }
.photo-sheet .photo-pick { width: 100%; }

/* Parent: checking a task step by step */
.review-steps { list-style: none; margin: var(--space-3) 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.review-steps li { border-top: 1px solid var(--well); padding-top: var(--space-2); }
.review-steps li:first-child { border-top: 0; padding-top: 0; }
.review-steps li.open .grow { color: var(--muted); }
.rs-row { display: flex; align-items: center; gap: var(--space-2); font-weight: 700; min-height: 38px; }
.rs-row .grow { overflow-wrap: anywhere; }
.review-steps .photo-thumb { margin: var(--space-2) 0 0 var(--space-6); }
.review-steps .note { margin: var(--space-2) 0 0 var(--space-6); }
.redo-form { margin: var(--space-2) 0 0 var(--space-6); }
.redo-form textarea { width: 100%; }

/* Desktop: the mascot on the left, the tasks in two columns */
@media (min-width: 800px) {
  .kid-page:has(> .do-main) { max-width: 1080px; display: grid; grid-template-columns: 300px 1fr; gap: var(--space-6); align-items: start; }
  .do-side { position: sticky; top: var(--space-6); }
  .do-side .mascot-area { flex-direction: column; align-items: center; }
  .do-side .bubble { margin-bottom: 0; }
  .do-side .bubble::before, .do-side .bubble::after { display: none; }
  .do-side .wardrobe-btn { top: 0; bottom: auto; }
  .do-main .task-blocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); align-items: start; }
}

/* Parent: a look at the kid's mascot (game theme, look only) */
.kid-chip.peekable { font: inherit; color: inherit; text-align: left; cursor: pointer; transition: transform .08s; }
.kid-chip.peekable:active { transform: translateY(2px); }
.peek-go { font-size: 24px; font-weight: 900; color: var(--muted); margin-left: var(--space-1); }
.peek-bar { position: relative; display: flex; align-items: center; gap: var(--space-3); max-width: 640px; margin: 0 auto;
  padding: var(--space-3) var(--space-4) 0; }
.peek-bar .link-btn { color: var(--lilac); }
.peek-label { margin-left: auto; font-weight: 800; color: var(--lilac); font-size: 14px; }
.kid-page.peek { text-align: center; }
.kid-page.peek .mascot-area { justify-content: center; }
.kid-page.peek .mascot.has-art .pet { --pet-size: 210px; }
.peek-text { color: var(--lilac); font-weight: 800; margin: var(--space-2) 0 var(--space-4); }
.kid-page.peek .bubble { flex: 0 1 auto; }

/* ── Kid: "Домик" — the mascot's room (pet.js roomHTML), furnished for coins ──
   Spots are placed in % of the room (4:3); pictures stand on their bottom edge unless they hang. */
.room {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden; isolation: isolate;
  border: 4px solid var(--outline); border-radius: 24px; box-shadow: var(--drop-big); background: var(--indigo-1);
}
.room-wall { position: absolute; inset: 0 0 30% 0; background: linear-gradient(var(--indigo-2), var(--indigo-1)); }
.room.wall_stripes .room-wall, .thumb-wall.wall_stripes { background: url(/img/home/wall_stripes.svg) 0 0 / 30px, linear-gradient(var(--indigo-2), var(--indigo-1)); }
.room.wall_stars .room-wall, .thumb-wall.wall_stars { background: url(/img/home/wall_stars.svg) 0 0 / 60px, linear-gradient(var(--indigo-2), var(--indigo-1)); }
.room.wall_clouds .room-wall, .thumb-wall.wall_clouds { background: url(/img/home/wall_clouds.svg) 0 0 / 80px, linear-gradient(var(--indigo-2), var(--indigo-1)); }
.room.wall-preview .room-wall { animation: try-glow 1.2s ease-in-out infinite; }
.room-floor {
  position: absolute; inset: 70% 0 0 0; border-top: 4px solid var(--outline);
  background: linear-gradient(rgb(0 0 0 / .22), transparent 40%),
    repeating-linear-gradient(90deg, var(--brown) 0 44px, var(--brown-lo) 44px 47px);
}
.room > .spot, .room-window, .room-pet, .room-treat { position: absolute; }
.room-window { left: 6%; top: 9%; width: 21%; z-index: 1; pointer-events: none; }
.spot { display: block; padding: 0; border: 0; background: none; font: inherit; color: inherit; }
button.spot { cursor: pointer; }
.spot img { display: block; width: 100%; height: auto; pointer-events: none; user-select: none; -webkit-user-select: none; }
.spot-light { left: 50%; top: 0; width: 9%; transform: translateX(-50%); z-index: 2; }
.spot-light.thing-light_moon { width: 11%; }
.spot-light.thing-light_garland { width: 72%; }
.spot-picture { left: 67%; top: 12%; width: 17%; z-index: 1; }
.spot-shelf { right: 3%; bottom: 22%; width: 20%; z-index: 2; }
.spot-shelf.thing-shelf_arcade { width: 17%; }
.spot-bed { left: 2%; bottom: 9%; width: 36%; z-index: 3; }
.spot-rug { left: 50%; bottom: 3%; width: 46%; transform: translateX(-50%); z-index: 2; }
.spot-toy { left: 27%; bottom: 3%; width: 9%; z-index: 5; }
.spot-plant { right: 2%; bottom: 3%; width: 10%; z-index: 5; }
.spot-plant.thing-plant_monstera { width: 14%; }
/* An empty spot in the kid's own room: a soft "+" to tap */
.spot.empty {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%;
  border: 3px dashed rgb(255 255 255 / .45); background: rgb(255 255 255 / .08); z-index: 6;
}
.spot-light.empty { top: 6%; }
.spot-picture.empty { left: 72%; top: 18%; }
.spot-shelf.empty { right: 8%; bottom: 36%; }
.spot-bed.empty { left: 12%; bottom: 14%; }
.spot-rug.empty { bottom: 2%; transform: translateX(110%); }
.spot-plant.empty { right: 4%; }
.spot-plus { color: var(--white); opacity: .8; font-size: 24px; font-weight: 900; line-height: 1; animation: twinkle 2.6s infinite; }
.spot.preview img { animation: try-bob 1.2s ease-in-out infinite; filter: drop-shadow(0 0 6px var(--yellow)); }
.spot.landed img { animation: land .6s cubic-bezier(.3, 1.5, .5, 1); transform-origin: 50% 100%; }
.room-pet { left: 50%; bottom: 5%; width: 30%; transform: translateX(-50%); z-index: 4; padding: 0; border: 0; background: none; cursor: pointer; }
.room-pet .pet { --pet-size: 100%; }
.room-pet .pet-emoji { font-size: 64px; }
.room-treat { left: 61%; bottom: 5%; width: 9%; z-index: 6; pointer-events: none; animation: treat-eat 1.7s ease-in both; transform-origin: 50% 100%; }
.bubble.room-bubble {
  position: absolute; left: 50%; bottom: 56%; transform: translateX(-50%); z-index: 7; margin: 0;
  width: max-content; max-width: 70%; font-size: 15px; text-align: center; pointer-events: none;
  opacity: 0; animation: none; transition: opacity .25s;
}
.bubble.room-bubble.show { opacity: 1; animation: popin .4s both; }
.room-bubble::before, .room-bubble::after { display: none; }

.home-tab { display: flex; flex-direction: column; gap: var(--space-3); }
button.chip { cursor: pointer; }
/* Stars vs coins, at the top of the home: open until the kid folds it once */
.money-card {
  color: var(--white); background: linear-gradient(var(--indigo-1), var(--indigo-2));
  border: var(--border) solid var(--outline); border-radius: var(--radius-s); box-shadow: var(--drop);
  padding: var(--space-2) var(--space-3);
}
.money-card summary { display: flex; align-items: center; gap: 6px; font-weight: 900; cursor: pointer; list-style: none; min-height: 32px; }
.money-card summary::-webkit-details-marker { display: none; }
.money-card summary::after { content: "▾"; margin-left: auto; color: var(--lilac); transition: transform .2s; }
.money-card:not([open]) summary::after { transform: rotate(-90deg); }
.money-card summary svg { width: 22px; height: 22px; flex: none; }
.money-card p { margin: var(--space-2) 0 0; line-height: 1.35; }
.money-card p svg { width: 1.1em; height: 1.1em; vertical-align: -0.2em; }
.money-card .money-note { color: var(--lilac); font-weight: 700; }
.home-panel { display: flex; flex-direction: column; gap: var(--space-3); }
.spot-chips { display: flex; gap: var(--space-2); overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.spot-chips::-webkit-scrollbar { display: none; }
.spot-chip {
  flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 66px;
  padding: 6px 8px; border: var(--border) solid var(--outline); border-radius: var(--radius-s);
  background: var(--indigo-2); color: var(--white); font: inherit; font-size: 12px; font-weight: 800;
  box-shadow: 0 4px 0 var(--outline); cursor: pointer;
}
.spot-chip.on { background: linear-gradient(var(--yellow-hi), var(--yellow) 50%, var(--yellow-lo)); color: var(--ink-dark); }
.spot-icon { font-size: 22px; line-height: 1.1; }
.home-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.home-row .ward-item { min-height: 104px; padding: var(--space-1); font-size: 12px; }
.ward-item.trying { box-shadow: 0 0 0 4px var(--yellow), 0 4px 0 var(--outline); }
.thumb { display: grid; place-items: center; width: 64px; height: 44px; }
.thumb img { max-width: 100%; max-height: 100%; }
.thumb-wall { width: 54px; border: 2px solid var(--outline); border-radius: 8px; }
.price-tag { display: inline-flex; align-items: center; gap: 3px; color: var(--yellow); font-weight: 900; font-size: 14px; }
.price-tag svg { width: 16px; height: 16px; }
.price-tag.short { color: var(--lilac); opacity: .75; }
.buy-bar {
  position: sticky; bottom: calc(var(--tabbar-h) + var(--space-2) + env(safe-area-inset-bottom)); z-index: 5;
  display: flex; flex-direction: column; align-items: center; gap: var(--space-1); margin-top: var(--space-2);
}
.buy-bar .btn { width: 100%; gap: 6px; }
.buy-bar .btn svg { width: 24px; height: 24px; vertical-align: -5px; }
.buy-bar .link-btn { color: var(--lilac); }
.need-coins {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin: 0;
  padding: var(--space-3) var(--space-4); border: var(--border) solid var(--outline); border-radius: var(--radius-s);
  background: var(--indigo-2); color: var(--lilac); font-weight: 800; box-shadow: 0 4px 0 var(--outline);
}
.need-coins svg { width: 20px; height: 20px; }
.home-hint { margin: 0; color: var(--lilac); font-weight: 700; font-size: 14px; text-align: center; }
.kid-page.peek .room { margin: 0 0 var(--space-4); }

@keyframes try-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes try-glow { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.18); } }
@keyframes land { 0% { transform: translateY(-40px) scale(.6); opacity: 0; } 60% { transform: translateY(0) scale(1.08, .92); opacity: 1; } 100% { transform: none; } }
@keyframes treat-eat {
  0% { transform: translateY(-30px) scale(.3); opacity: 0; } 20% { transform: none; opacity: 1; }
  55% { transform: scale(1); opacity: 1; } 80% { transform: scale(.2) translateX(-60%); opacity: 0; } 100% { opacity: 0; }
}

@media (min-width: 800px) {
  .kid-page:has(> .home-tab) { max-width: 1080px; }
  .home-tab { display: grid; grid-template-columns: 1.25fr 1fr; gap: var(--space-6); align-items: start; }
  .home-tab > .money-card { grid-column: 1 / -1; }
  .home-room { position: sticky; top: var(--space-6); }
  .spot-chips { flex-wrap: wrap; overflow: visible; }
}

/* Parent: the week summary */
.sum-nav { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-2) 0 var(--space-4); }
.sum-range { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; }
.sum-grid { display: grid; gap: var(--space-4); }
@media (min-width: 900px) { .sum-grid { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; } }
.sum-card h3 { margin: var(--space-4) 0 var(--space-2); font-size: 15px; }
.sum-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); margin-top: var(--space-3); }
.sum-stats div { display: flex; flex-direction: column; align-items: center; padding: var(--space-2); border-radius: var(--radius-s); background: var(--well); }
.sum-stats b { font-size: 22px; }
.sum-stats span { font-size: 12px; color: var(--muted); font-weight: 700; }
.sum-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--space-2); margin-top: var(--space-4); }
.sum-day { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); }
.sum-n { font-size: 12px; font-weight: 700; min-height: 15px; }
.sum-bar { width: 100%; max-width: 28px; height: 70px; display: flex; align-items: flex-end; border-radius: 8px; background: var(--well); overflow: hidden; }
.sum-bar i { display: block; width: 100%; background: linear-gradient(var(--teal-hi), var(--teal)); border-top: var(--border) solid var(--outline); }
.sum-bar i.h0 { height: 0; border: 0; }
.sum-bar i.h1 { height: 10%; } .sum-bar i.h2 { height: 20%; } .sum-bar i.h3 { height: 30%; } .sum-bar i.h4 { height: 40%; }
.sum-bar i.h5 { height: 50%; } .sum-bar i.h6 { height: 60%; } .sum-bar i.h7 { height: 70%; } .sum-bar i.h8 { height: 80%; }
.sum-bar i.h9 { height: 90%; } .sum-bar i.h10 { height: 100%; }
.sum-wd { font-size: 12px; color: var(--muted); font-weight: 700; }
.sum-day.today .sum-wd { color: var(--ink); text-decoration: underline; }
.sum-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.sum-list li { display: flex; gap: var(--space-2); align-items: flex-start; }

/* Parent: praise sheet; the 💌 button next to each kid in the strip */
.modal { position: fixed; inset: 0; z-index: var(--z-modal); background: rgb(8 7 28 / .55); display: grid; place-items: center; padding: var(--space-4); }
.sheet { width: min(440px, 100%); display: grid; gap: var(--space-3); animation: popin .25s both; }
.sheet h2 { margin: 0; }
.sheet p { margin: 0; }
.emoji-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-2); }
.emoji-opt { font-size: 28px; padding: var(--space-2); border: var(--border) solid var(--outline); border-radius: var(--radius-s); background: var(--surface); cursor: pointer; box-shadow: var(--drop); }
.emoji-opt.on { background: linear-gradient(var(--yellow-hi), var(--yellow)); transform: translateY(2px); box-shadow: 0 2px 0 var(--outline); }
.praise-btn { flex: none; align-self: center; width: 44px; height: 44px; margin-left: calc(-1 * var(--space-1)); border: var(--border) solid var(--outline); border-radius: 50%; background: var(--surface); font-size: 20px; cursor: pointer; box-shadow: var(--drop); }
.praise-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--outline); }

/* Kid: praise from a parent, shown big */
.praise-card .praise-emoji { font-size: 84px; line-height: 1; animation: popin .5s both; }
.praise-card .praise-words { font-size: 22px; font-weight: 800; color: var(--white); margin: 0; }
.praise-card .praise-for { color: var(--lilac); font-weight: 700; margin: 0; }

/* Kid: 🔊 read a step aloud */
.speak-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; margin-left: var(--space-1); vertical-align: middle;
  border: 2px solid var(--outline); border-radius: 50%; background: var(--teal-hi); font-size: 16px; cursor: pointer; box-shadow: 0 2px 0 var(--outline); }
.speak-btn:active { transform: translateY(2px); box-shadow: none; }

/* Kid: ❄️ freezes (header chip, the Home's freeze card), vacation note */
.freeze-chip { border: 0; font: inherit; cursor: pointer; }
.freeze-card { display: grid; gap: var(--space-3); justify-items: center; text-align: center; padding: var(--space-3) var(--space-2); color: var(--white); }
.freeze-card p { margin: 0; }
.freeze-card .buy-bar { width: 100%; }
.freeze-card .need-coins svg { width: 20px; height: 20px; vertical-align: -4px; }
.freeze-stock { display: flex; gap: var(--space-3); font-size: 40px; }
.freeze-stock span { opacity: .25; filter: grayscale(1); }
.freeze-stock span.on { opacity: 1; filter: none; animation: popin .4s both; }
.vacation-note { margin: 0 0 var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--radius-s); background: rgb(255 255 255 / .1); color: var(--lilac); font-weight: 700; text-align: center; }

/* Kid: mini-games (games.js) — full screen in the night sky */
.game-ready { display: block; margin: var(--space-3) auto 0; animation: popin .4s both; }
.game-screen { position: fixed; inset: 0; z-index: var(--z-modal); display: flex; flex-direction: column; overflow: hidden;
  background: radial-gradient(120% 80% at 50% 0%, var(--indigo-1), var(--indigo-3) 55%, var(--indigo-5)); color: var(--white); }
.game-hud { position: relative; display: flex; align-items: center; justify-content: space-between; padding: var(--space-4) var(--space-4) var(--space-2); font-weight: 800; font-size: 18px; }
.game-score { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-1) var(--space-3); border: var(--border) solid var(--outline); border-radius: 999px; background: var(--indigo-4); }
.game-score svg { width: 22px; height: 22px; }
.game-time { position: relative; height: 12px; margin: 0 var(--space-4); border: var(--border) solid var(--outline); border-radius: 999px; background: var(--indigo-4); overflow: hidden; }
.game-time i { display: block; height: 100%; width: var(--left, 100%); background: linear-gradient(var(--yellow-hi), var(--yellow)); }
.game-area { position: relative; flex: 1; touch-action: none; user-select: none; -webkit-user-select: none; }
.g-item { position: absolute; left: 0; top: 0; transform: translate(calc(var(--x) - 50%), calc(var(--y) - 50%)); pointer-events: auto; }
.g-stars svg { width: 40px; height: 40px; filter: drop-shadow(0 0 8px rgb(255 210 63 / .8)); }
.g-stars.caught { transition: transform .25s, opacity .25s; opacity: 0; }
.g-bubbles { width: var(--size); height: var(--size); border-radius: 50%; cursor: pointer;
  background: radial-gradient(circle at 30% 30%, rgb(255 255 255 / .9) 0 8%, rgb(127 247 228 / .35) 30%, rgb(124 108 255 / .25) 70%);
  border: 3px solid rgb(255 255 255 / .85); box-shadow: 0 0 14px rgb(127 247 228 / .5); }
.g-bubbles.pop { transition: transform .25s, opacity .25s; opacity: 0; transform: translate(calc(var(--x) - 50%), calc(var(--y) - 50%)) scale(1.6); }
.g-feed { font-size: 46px; cursor: pointer; animation: popin .25s both; }
.g-feed.fade { transition: opacity .25s; opacity: 0; }
.g-feed.eaten { transition: transform .35s ease-in; transform: translate(calc(var(--tx) - 50%), calc(var(--ty) - 50%)) scale(.3); }
.game-pet { position: absolute; bottom: 0; left: var(--x, 50%); transform: translateX(-50%); pointer-events: none; transition: left .06s linear; }
.game-pet .pet { --pet-size: 150px; }
.game-card { position: absolute; inset: auto var(--space-4) 30%; margin: 0 auto; max-width: 380px; padding: var(--space-5); display: grid; gap: var(--space-3); justify-items: center; text-align: center;
  border: 4px solid var(--outline); border-radius: var(--radius); background: var(--indigo-2); box-shadow: var(--drop-big); animation: popin .3s both; }
.game-card h1 { margin: 0; font-size: 24px; }
.game-card p { margin: 0; color: var(--lilac); font-weight: 700; }
.game-prize { font-size: 32px; font-weight: 900; color: var(--yellow) !important; display: flex; align-items: center; gap: var(--space-2); }
.game-prize svg { width: 34px; height: 34px; }

/* Kid: 🎯 focus — one step, big */
.focus-btn { display: block; width: 100%; margin-bottom: var(--space-4); }
.focus-card { width: min(440px, 100%); display: grid; gap: var(--space-3); justify-items: center; text-align: center; animation: popin .3s both; }
.focus-emoji { font-size: 96px; line-height: 1; animation: popin .4s both; }
.focus-card .step-title { margin: 0; }
.focus-card .done-btn { width: 100%; }
.focus-card .btn.secondary { width: 100%; }
.focus-meta { display: flex; gap: var(--space-2); justify-content: center; min-height: 4px; }

/* Parent: what's new (🔔) */
.updates-btn { position: relative; font-size: 18px; }
.updates-dot { position: absolute; top: 6px; right: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); border: 2px solid var(--head-bg); }
.updates-dot.inline { position: static; display: inline-block; margin-right: var(--space-2); vertical-align: middle; border-color: var(--bg); }
.updates { max-width: 720px; }
.upd-day { padding-bottom: var(--space-4); border-bottom: 2px solid var(--surface-2); }
.upd-kind { margin: var(--space-3) 0 var(--space-2); font-size: 14px; color: var(--muted); }
.upd-items { margin: 0; padding-left: var(--space-5); display: grid; gap: var(--space-2); line-height: 1.45; }

/* "?" hints (core.js hint()): a small round button, a bubble on tap */
.hint-btn { display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; margin-left: var(--space-1); vertical-align: 2px;
  border: 2px solid currentColor; border-radius: 50%; background: transparent; color: var(--muted); font: 800 13px/1 inherit; font-family: inherit; cursor: pointer; opacity: .8; }
.hint-btn:hover, .hint-btn[aria-expanded=true] { opacity: 1; color: var(--ink); }
body[data-theme=game] .hint-btn { color: var(--lilac); }
body[data-theme=game] .hint-btn[aria-expanded=true] { color: var(--white); }
.hint-pop { position: fixed; z-index: calc(var(--z-modal) + 5); left: var(--left); top: var(--top); width: var(--w); padding: var(--space-3) var(--space-4);
  border: var(--border) solid var(--outline); border-radius: var(--radius-s); background: var(--surface); color: var(--ink);
  box-shadow: var(--drop); font-size: 14px; font-weight: 500; line-height: 1.45; text-transform: none; letter-spacing: 0; animation: popin .15s both; }
body[data-theme=game] .hint-pop { background: var(--white); color: var(--ink-dark); }

/* The parent's side reads lighter than the game look (Stas, 2026-12-06): Rubik is variable (300–900) */
body[data-theme=parent] h1 { font-weight: 800; }
body[data-theme=parent] h2, body[data-theme=parent] h3 { font-weight: 700; }
body[data-theme=parent] .page > h2, body[data-theme=parent] h2.section { font-weight: 700; letter-spacing: .8px; }
body[data-theme=parent] .title { font-weight: 700; }
body[data-theme=parent] .field > span, body[data-theme=parent] .steps-list summary { font-weight: 700; }
