/* Layout: one full-bleed canvas playroom; chunky sticker-style controls float above it.
   The grown-ups corner is a paper sheet that slides over the game. */
@font-face { font-family: "Bagel Fat One"; src: url(fonts/bagel-fat-one.woff2) format("woff2"); font-display: block; }
@font-face { font-family: Fredoka; font-weight: 500; src: url(fonts/fredoka-500.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Fredoka; font-weight: 600; src: url(fonts/fredoka-600.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Fredoka; font-weight: 700; src: url(fonts/fredoka-700.woff2) format("woff2"); font-display: swap; }
/* Letters Fredoka and Bagel Fat One don't have (cs hu pl ro tr vi el ru uk): M PLUS Rounded 1c (OFL), bundled, so the game stays offline.
   Those languages draw in it throughout (html[lang] below + the canvas fonts in game.js): mixing two fonts inside one word looks broken.
   Every other language keeps it as a fallback after Fredoka/Bagel, e.g. for a second language of the lines. Subsets load only when a letter needs them. */
@font-face { font-family: "Bob Display Intl"; font-weight: 400; src: url(fonts/mplusr-900-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; font-display: block; }
@font-face { font-family: "Bob UI Intl"; font-weight: 500; src: url(fonts/mplusr-500-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; font-display: swap; }
@font-face { font-family: "Bob UI Intl"; font-weight: 600; src: url(fonts/mplusr-700-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; font-display: swap; }
@font-face { font-family: "Bob UI Intl"; font-weight: 700; src: url(fonts/mplusr-800-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; font-display: swap; }
@font-face { font-family: "Bob Display Intl"; font-weight: 400; src: url(fonts/mplusr-900-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; font-display: block; }
@font-face { font-family: "Bob UI Intl"; font-weight: 500; src: url(fonts/mplusr-500-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; font-display: swap; }
@font-face { font-family: "Bob UI Intl"; font-weight: 600; src: url(fonts/mplusr-700-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; font-display: swap; }
@font-face { font-family: "Bob UI Intl"; font-weight: 700; src: url(fonts/mplusr-800-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; font-display: swap; }
@font-face { font-family: "Bob Display Intl"; font-weight: 400; src: url(fonts/mplusr-900-vietnamese.woff2) format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; font-display: block; }
@font-face { font-family: "Bob UI Intl"; font-weight: 500; src: url(fonts/mplusr-500-vietnamese.woff2) format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; font-display: swap; }
@font-face { font-family: "Bob UI Intl"; font-weight: 600; src: url(fonts/mplusr-700-vietnamese.woff2) format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; font-display: swap; }
@font-face { font-family: "Bob UI Intl"; font-weight: 700; src: url(fonts/mplusr-800-vietnamese.woff2) format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; font-display: swap; }
@font-face { font-family: "Bob Display Intl"; font-weight: 400; src: url(fonts/mplusr-900-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; font-display: block; }
@font-face { font-family: "Bob UI Intl"; font-weight: 500; src: url(fonts/mplusr-500-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; font-display: swap; }
@font-face { font-family: "Bob UI Intl"; font-weight: 600; src: url(fonts/mplusr-700-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; font-display: swap; }
@font-face { font-family: "Bob UI Intl"; font-weight: 700; src: url(fonts/mplusr-800-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; font-display: swap; }
@font-face { font-family: "Bob Display Intl"; font-weight: 400; src: url(fonts/mplusr-900-greek.woff2) format("woff2"); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; font-display: block; }
@font-face { font-family: "Bob UI Intl"; font-weight: 500; src: url(fonts/mplusr-500-greek.woff2) format("woff2"); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; font-display: swap; }
@font-face { font-family: "Bob UI Intl"; font-weight: 600; src: url(fonts/mplusr-700-greek.woff2) format("woff2"); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; font-display: swap; }
@font-face { font-family: "Bob UI Intl"; font-weight: 700; src: url(fonts/mplusr-800-greek.woff2) format("woff2"); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; font-display: swap; }

:root {
  --ink: #2b1d3a; --paper: #fff6e3; --sun: #ffcf3f; --rug: #e25b5f; --sky: #5aa9ff; --mint: #8fd3c4;
  --muted: #6b5a79; --ok: #2f9e6b; --line: #e7dcc4;
  --display: "Bagel Fat One", "Bob Display Intl", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  --ui: Fredoka, "Bob UI Intl", "Trebuchet MS", system-ui, sans-serif;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  color-scheme: light;
}
html:is([lang="cs"], [lang="hu"], [lang="pl"], [lang="ro"], [lang="tr"], [lang="vi"], [lang="el"], [lang="ru"], [lang="uk"]) {
  --display: "Bob Display Intl", "Trebuchet MS", sans-serif; --ui: "Bob UI Intl", "Trebuchet MS", system-ui, sans-serif; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--mint); color: var(--ink); font-family: var(--ui); font-weight: 500;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none; touch-action: none; }
button { font-family: var(--ui); color: var(--ink); cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* ---------- HUD ---------- */
#hud { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start;
  padding-top: calc(var(--sat) + 12px); padding-left: max(14px, var(--sal)); padding-right: max(14px, var(--sar)); pointer-events: none; z-index: 2; }
#hud > * { pointer-events: auto; }
.hud-left { display: flex; gap: 10px; pointer-events: auto; }
.round { position: relative; width: 56px; height: 56px; border-radius: 50%; border: 3.5px solid var(--ink); background: var(--paper);
  box-shadow: 0 4px 0 var(--ink); display: grid; place-items: center; padding: 0; touch-action: none; }
.round:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.round canvas { width: 46px; height: 46px; pointer-events: none; }
#gearBtn { width: 46px; height: 46px; opacity: .85; }
#gearBtn svg { width: 22px; height: 22px; }
.hold-ring { position: absolute; inset: -8px; border-radius: 50%; border: 5px solid var(--sun); clip-path: inset(0 100% 0 0); pointer-events: none; }
.holding .hold-ring { animation: fillring var(--hold, 1.5s) linear forwards; }
@keyframes fillring { to { clip-path: inset(0 0 0 0); } }

/* ---------- tray ---------- */
#tray { position: fixed; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; gap: 10px; overflow-x: auto; overflow-y: hidden;
  padding: 16px max(14px, var(--sar)) calc(var(--sab) + 12px) max(14px, var(--sal)); scrollbar-width: none; touch-action: pan-x;
  scroll-snap-type: x proximity; }
#tray::-webkit-scrollbar { display: none; }
.tool { flex: 0 0 auto; width: 78px; height: 78px; border-radius: 24px; border: 3.5px solid var(--ink); background: var(--paper);
  box-shadow: 0 5px 0 var(--ink); padding: 0; display: grid; place-items: center; scroll-snap-align: start; transition: transform .12s ease, background .12s; touch-action: pan-x; }
.tool canvas { width: 64px; height: 64px; pointer-events: none; }
.tool.on { background: var(--sun); transform: translateY(-8px) rotate(-3deg); box-shadow: 0 13px 0 var(--ink); }
.tool.mine { border-style: dashed; }
@media (min-width: 900px) and (min-height: 600px) { .tool { width: 92px; height: 92px; } .tool canvas { width: 76px; height: 76px; } .round { width: 64px; height: 64px; } .round canvas { width: 52px; height: 52px; } }
@media (max-height: 520px) { #tray { padding-top: 10px; padding-bottom: calc(var(--sab) + 8px); gap: 8px; } .tool { width: 60px; height: 60px; border-radius: 18px; } .tool canvas { width: 48px; height: 48px; } .tool.on { transform: translateY(-5px) rotate(-3deg); box-shadow: 0 9px 0 var(--ink); } .round { width: 46px; height: 46px; } .round canvas { width: 38px; height: 38px; } #hud { padding-top: calc(var(--sat) + 8px); } }
body.sleeping #tray, body.sleeping .hud-left, body.sleeping .goal { opacity: 0; pointer-events: none; transition: opacity 1.5s; }

/* ---------- home ---------- */
#home { position: fixed; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(143, 211, 196, .5); backdrop-filter: blur(3px); transition: opacity .35s; padding: 16px; }
#home.gone { opacity: 0; pointer-events: none; }
.home-card { text-align: center; display: grid; justify-items: center; gap: 18px; position: relative; }
.home-card h1 { font-family: "Bagel Fat One", var(--display); /* the logo: always Bagel, it is plain Latin */ font-weight: 400; font-size: clamp(64px, 16vw, 128px); margin: 0; line-height: 1; color: var(--paper);
  -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 0 8px 0 var(--ink); }
.home-btns { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.big-btn { width: 140px; height: 148px; border-radius: 32px; border: 5px solid var(--ink); background: var(--paper); box-shadow: 0 8px 0 var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px; }
.big-btn .emo { font-size: 64px; line-height: 1; }
.big-btn b { font-family: var(--display); font-weight: 400; font-size: 17px; line-height: 1.05; max-width: 100%; overflow-wrap: anywhere; }
.big-btn.adv { background: var(--sun); width: 168px; height: 176px; animation: bob 1.6s ease-in-out infinite; }
.big-btn.adv .emo { font-size: 84px; }
.big-btn:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--ink); }
.big-btn.small { width: 84px; height: 84px; border-radius: 26px; }
.big-btn.small .emo { font-size: 40px; }
.big-btn.next { width: 112px; height: 112px; border-radius: 50%; background: var(--sun); animation: bob 1.4s ease-in-out infinite; }
.big-btn.next svg { width: 58px; height: 58px; margin-left: 8px; }
@keyframes bob { 50% { transform: translateY(-8px) scale(1.04); } }
.gift { align-self: center; flex: 0 0 auto; width: 86px; height: 86px; border-radius: 50%; border: 4px solid var(--ink); background: var(--pink, #ff5fa2); box-shadow: 0 6px 0 var(--ink); animation: wiggle 1.2s ease-in-out infinite; }
.gift .emo { font-size: 46px; }
@keyframes wiggle { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg) scale(1.08); } }
.emo { font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", sans-serif; line-height: 1; }
.round .emo { font-size: 28px; }

/* ---------- toddler mode ---------- */
#tapStart { position: fixed; inset: 0; z-index: 1; display: grid; place-items: center; cursor: pointer; }
.tap-hint { width: 170px; height: 170px; border-radius: 50%; background: rgba(255,246,227,.85); border: 5px solid var(--ink); box-shadow: 0 8px 0 var(--ink); display: grid; place-items: center; animation: tapPulse 1.2s ease-in-out infinite; margin-top: 30vh; }
.tap-hint .emo { font-size: 92px; animation: tapFinger 1.2s ease-in-out infinite; }
@keyframes tapPulse { 50% { transform: scale(1.12); box-shadow: 0 8px 0 var(--ink), 0 0 0 22px rgba(255,207,63,.45); } }
@keyframes tapFinger { 50% { transform: translateY(10px) scale(.92); } }
.overlay.clear { background: transparent; pointer-events: none; }
body.baby.mode-level #tray { display: none !important; }
body.baby.mode-level #homeBtn { display: none !important; }
/* Tickle Bob and Feed Bob: just a finger, no toys */
body.no-toys.mode-level #tray { display: none !important; }
body.baby .goal { transform: scale(1.15); }

/* ---------- mode-dependent HUD ---------- */
[class*="only-"] { display: none !important; }
body.mode-sandbox .only-sandbox, body.mode-map .only-map, body.mode-level .only-level { display: grid !important; }
body.mode-level .goal.only-level { display: flex !important; }
body.mode-map #tray, body.mode-home #tray { display: none; }
body.mode-home #hud .hud-left { visibility: hidden; }
/* on the home screen the gear (grown-ups corner + language flag) sits above the blurred home card, so a parent can open it there (it was visible but under the card and could not be pressed) */
body.mode-home #hud { z-index: 6; }
.hud-right { display: flex; gap: 10px; pointer-events: auto; }
.goal { gap: 6px; flex-wrap: wrap; justify-content: center; max-width: 52vw; padding: 8px 12px; background: var(--paper); border: 3.5px solid var(--ink); border-radius: 999px; box-shadow: 0 4px 0 var(--ink); pointer-events: none; }
.goal i { width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--ink); background: #fff; display: block; transition: background .2s, transform .2s; }
.goal i.on { background: var(--sun); transform: scale(1.15); }
.goal b { font-family: var(--display); font-weight: 400; font-size: 20px; font-variant-numeric: tabular-nums; }

/* ---------- overlays: results, book, gift ---------- */
.overlay { position: fixed; inset: 0; z-index: 8; display: grid; place-items: center; background: rgba(43, 29, 58, .45); padding: calc(var(--sat) + 12px) max(12px, var(--sar)) calc(var(--sab) + 12px) max(12px, var(--sal)); }
.res-card { display: grid; justify-items: center; gap: 18px; animation: popin .35s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes popin { from { transform: scale(.4); opacity: 0; } }
.res-stars { display: flex; gap: 6px; }
.res-stars span { font-size: 78px; filter: drop-shadow(0 5px 0 var(--ink)); animation: popin .4s cubic-bezier(.2, 1.6, .4, 1) both; }
.res-stars span.off { filter: grayscale(1) opacity(.45) drop-shadow(0 5px 0 var(--ink)); }
.res-stars span:nth-child(2) { animation-delay: .15s; transform: translateY(-14px); }
.res-stars span:nth-child(3) { animation-delay: .3s; }
.sticker { width: 120px; height: 120px; border-radius: 50%; background: #fff; border: 4px solid var(--ink); display: grid; place-items: center; box-shadow: 0 6px 0 var(--ink), 0 0 0 8px rgba(255,255,255,.6);
  font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", sans-serif; font-size: 70px; line-height: 1; animation: spinin .7s cubic-bezier(.2, 1.4, .4, 1) .45s both; }
.sticker.big { width: 170px; height: 170px; font-size: 104px; }
@keyframes spinin { from { transform: rotate(-200deg) scale(0); } }
.res-unlock { display: flex; gap: 12px; align-items: center; background: var(--sun); border: 4px solid var(--ink); border-radius: 28px; padding: 8px 18px; box-shadow: 0 6px 0 var(--ink); animation: popin .5s .8s both; }
.res-unlock canvas { width: 80px; height: 80px; }
.res-unlock .emo { font-size: 56px; }
.res-btns { display: flex; gap: 16px; align-items: center; }
.book-card { background: var(--paper); border: 4px solid var(--ink); border-radius: 28px; box-shadow: 0 8px 0 var(--ink); width: min(820px, 100%); max-height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.book-card header { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 3px solid var(--ink); }
.book-card h2 { font-family: var(--display); font-weight: 400; font-size: 28px; margin: 0; flex: 1; }
.book-count { font-family: var(--display); font-size: 22px; font-variant-numeric: tabular-nums; }
.book-pages { overflow-y: auto; padding: 12px 16px 24px; display: flex; flex-direction: column; gap: 18px; touch-action: pan-y; }
.book-page h3 { margin: 0 0 8px; font-family: var(--display); font-weight: 400; font-size: 20px; display: flex; gap: 8px; align-items: center; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; }
.book-grid span { aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-size: 40px; background: #fff; border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink);
  font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", sans-serif; line-height: 1; }
.book-grid span.miss { background: rgba(43,29,58,.08); border-style: dashed; box-shadow: none; filter: grayscale(1) brightness(0) opacity(.18); }
.book-grid span.trophy { background: var(--sun); }
.gift-card { display: grid; place-items: center; gap: 16px; }
.gift-box { font-size: 150px; animation: wiggle .8s ease-in-out infinite; cursor: pointer; font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", sans-serif; }

/* ---------- modals ---------- */
.modal { position: fixed; inset: 0; z-index: 10; background: rgba(43, 29, 58, .5); display: grid; place-items: center;
  padding: calc(var(--sat) + 12px) max(12px, var(--sar)) calc(var(--sab) + 12px) max(12px, var(--sal)); touch-action: auto; -webkit-user-select: text; user-select: text; }
.sheet { background: var(--paper); border: 4px solid var(--ink); border-radius: 26px; box-shadow: 0 8px 0 var(--ink); width: min(760px, 100%); max-height: 100%;
  display: flex; flex-direction: column; overflow: hidden; }
.sheet.small { width: min(440px, 100%); padding: 22px; gap: 12px; text-align: center; }
.sheet h2 { font-family: var(--display); font-weight: 400; font-size: 28px; margin: 0; line-height: 1.1; text-wrap: balance; }
.ph { display: flex; align-items: center; gap: 12px; padding: 16px 18px 12px; border-bottom: 3px solid var(--ink); }
.ph h2 { flex: 1; }
.tabs { display: flex; gap: 6px; padding: 10px 14px; overflow-x: auto; border-bottom: 2px solid var(--line); scrollbar-width: none; touch-action: pan-x; flex: 0 0 auto; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 0 0 auto; border: 2.5px solid var(--ink); background: #fff; border-radius: 999px; padding: 7px 14px; font-size: 15px; font-weight: 600; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.panes { overflow-y: auto; padding: 14px 18px 28px; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
section { display: flex; flex-direction: column; gap: 14px; }
section h3 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 10px 0 -4px; }
section h4 { margin: 4px 0 0; font-size: 16px; }
.lead { margin: 0; line-height: 1.45; max-width: 62ch; }
.note { color: var(--muted); font-size: 14px; margin: 0; line-height: 1.4; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 15px; min-width: 0; }
.field small { font-weight: 500; color: var(--muted); font-size: 13px; line-height: 1.35; }
.field output { font-weight: 500; color: var(--muted); margin-left: 6px; }
input[type=text], select { font-family: var(--ui); font-size: 16px; color: var(--ink); background: #fff; border: 2.5px solid var(--ink); border-radius: 12px; padding: 9px 11px; width: 100%; }
input[type=range] { width: 100%; accent-color: var(--ink); }
.emoji-in { font-size: 26px !important; text-align: center; }
.toggle { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.toggle input { width: 22px; height: 22px; accent-color: var(--ink); }
.btn { border: 3px solid var(--ink); background: var(--sun); border-radius: 14px; padding: 10px 16px; font-size: 16px; font-weight: 700; box-shadow: 0 4px 0 var(--ink); white-space: nowrap; }
.btn.ghost { background: #fff; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.chips, .swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 2.5px solid var(--ink); background: #fff; border-radius: 999px; padding: 6px 13px; font-size: 15px; font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--sun); }
.chip.emoji { font-size: 22px; padding: 2px 8px; }
/* Language picker: first thing in the grown-ups corner, big enough to find without reading. */
.lang-box { display: grid; gap: 10px; padding: 14px; margin-bottom: 18px; border: 3px solid var(--ink); border-radius: 18px; background: var(--paper); }
.lang-box h3 { margin: 0; }
.lang-box > small { color: var(--muted); font-size: 13px; }
.lang-chips .chip { font-size: 17px; padding: 8px 15px; }
.lang-jump { padding: 8px 12px; }
/* Grown-ups corner asks: the rating card (Play tab, after 5 days of play) and "Bob on Grandma's phone" (Voices tab). */
.ask-card { display: grid; gap: 10px; padding: 14px; margin: 0 0 18px; border: 3px solid var(--ink); border-radius: 18px; background: var(--paper); }
.ask-card h3 { margin: 0; }
.ask-card > small { color: var(--muted); font-size: 13px; }
.ask-card .row, .ask-card .msg { margin: 0; }
.ask-card .msg:empty { display: none; }
.rate-card { background: #fff3c4; }
.share-card { margin-top: 18px; }
/* language button: flag + name, so parents see at once where the language is changed */
.lang-jump { font-size: 16px; font-weight: 700; }
#pLangFlag { font-size: 20px; vertical-align: -2px; }
@media (max-width: 340px) { .lang-jump #pLangName { display: none; } }
/* the current language flag as a small badge on the gear (the grown-ups corner lives there) */
#gearBtn { position: relative; }
.gear-flag { position: absolute; right: -5px; bottom: -5px; font-size: 17px; line-height: 1; pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--ink); padding: 0; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--ink); }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.list li { display: flex; align-items: center; gap: 10px; background: #fff; border: 2px solid var(--ink); border-radius: 12px; padding: 8px 10px; }
.list li .t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.list li .e { font-size: 26px; }
.list li small { display: block; color: var(--muted); font-size: 12.5px; }
.list .mini { border: 2px solid var(--ink); background: var(--paper); border-radius: 10px; padding: 5px 10px; font-size: 13px; font-weight: 600; }
.list .mini.sure { background: var(--rug); color: #fff; }
.empty { color: var(--muted); font-size: 14px; }
.msg { min-height: 1.2em; margin: 0; font-weight: 600; color: var(--ok); font-size: 15px; }
.msg.err { color: var(--rug); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; padding: 10px 12px; }
.stat b { display: block; font-family: var(--display); font-weight: 400; font-size: 26px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.bedtime-banner { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: #2b2366; color: var(--paper); padding: 12px 18px; font-weight: 600; }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; line-height: 1.45; }
.howto { display: flex; flex-direction: column; gap: 8px; background: #fff; border: 2.5px solid var(--ink); border-radius: 16px; padding: 14px 16px; }
.install { display: flex; flex-direction: column; gap: 10px; }
.install p { margin: 0; }
body:not(.can-install) #installBtn { display: none; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.rec-row { display: flex; gap: 14px; align-items: center; }
.rec { width: 72px; height: 72px; border-radius: 50%; border: 4px solid var(--ink); background: #fff; display: grid; place-items: center; box-shadow: 0 4px 0 var(--ink); flex: 0 0 auto; }
.rec span { width: 30px; height: 30px; border-radius: 50%; background: var(--rug); transition: border-radius .15s, transform .15s; }
.rec.on span { border-radius: 6px; transform: scale(.85); }
.rec.on { animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 4px 0 var(--ink), 0 0 0 8px rgba(226, 91, 95, .25); } }
.rec-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.meter { height: 12px; border: 2.5px solid var(--ink); border-radius: 999px; overflow: hidden; background: #fff; }
.meter i { display: block; height: 100%; width: 0; background: var(--rug); }
.draft { display: flex; flex-direction: column; gap: 10px; background: #fff; border: 2.5px dashed var(--ink); border-radius: 16px; padding: 12px 14px; }
.gate-nums { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.gate-nums button { width: 82px; height: 82px; border-radius: 22px; border: 3.5px solid var(--ink); background: #fff; font-family: var(--display); font-size: 34px; box-shadow: 0 5px 0 var(--ink); }
.gate-nums button.done { background: var(--sun); opacity: .6; }
@media (max-width: 520px) { .stats { grid-template-columns: 1fr 1fr 1fr; } .stat b { font-size: 21px; } .ph h2 { font-size: 23px; }
  /* phones: title gets its own line (it squeezed into "Grown- / ups / corner"); the buttons go under it, right-aligned */
  .ph { flex-wrap: wrap; justify-content: flex-end; } .ph h2 { flex: 1 1 100%; }
  /* tabs wrap instead of scrolling sideways: a clipped "Toys & li" gave no hint that more tabs existed */
  .tabs { flex-wrap: wrap; overflow-x: visible; } }
@media (prefers-reduced-motion: reduce) { #playBtn { animation: none; } .rec.on { animation: none; } }
