/* Layout: the Chalkboard's slate in a wooden frame, recolored a dusty rose with a pale birch frame.
   Deliberately single-theme (a chalkboard is always dark). Big touch targets for small fingers. */
:root {
  --board: #4a2f3a;
  --board-2: #573844;
  --chalk: #f8efea;
  --chalk-dim: #cdb0ba;
  --yellow: #f5d98e;
  --pink: #f4b4c4;
  --rose: #e597ab;
  --blue: #bcd6ec;
  --green: #bfe0b4;
  --orange: #f3c19c;
  --wood: #d2ad8c;
  --wood-dark: #a9805f;
  --room: #2b1a21;
  --font: "Andika", "Trebuchet MS", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
body { background: var(--room); color: var(--chalk); font-family: var(--font); font-size: 18px; line-height: 1.45; margin: 0; padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); padding-block: max(20px, env(safe-area-inset-top)) max(40px, env(safe-area-inset-bottom)); -webkit-tap-highlight-color: transparent; }
.wrap { max-width: 820px; margin: 0 auto; }
.board {
  background:
    radial-gradient(ellipse at 20% 15%, rgba(255,255,255,.06), transparent 55%),
    radial-gradient(ellipse at 85% 80%, rgba(255,255,255,.04), transparent 50%),
    var(--board);
  border: 14px solid var(--wood);
  border-bottom-width: 22px;
  border-bottom-color: var(--wood-dark);
  border-radius: 10px;
  box-shadow: inset 0 0 40px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.4);
  padding: clamp(16px, 4vw, 34px);
  min-height: 520px;
  display: flex; flex-direction: column; gap: 20px;
}
@media (max-width: 520px) { .board { border-width: 8px; border-bottom-width: 14px; } body { font-size: 17px; } }
h1, h2 { margin: 0; font-weight: 700; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 6vw, 2.6rem); color: var(--pink); line-height: 1.1; }
h2 { font-size: 1.05rem; color: var(--chalk-dim); letter-spacing: .06em; text-transform: uppercase; }
h2 small { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 6px; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.link { background: none; border: none; color: var(--chalk-dim); text-decoration: underline; text-underline-offset: 4px; padding: 6px 2px; font-size: .95rem; }
.link:hover { color: var(--chalk); }
.meta { color: var(--chalk-dim); margin: 0; font-size: .95rem; }
.note { color: var(--chalk-dim); font-size: .88rem; margin: 0; }
section { display: flex; flex-direction: column; gap: 12px; }

/* buttons */
.start { align-self: flex-start; background: var(--pink); color: var(--board); border: none; font-weight: 700; font-size: 1.35rem; padding: 14px 30px; border-radius: 16px 12px 18px 10px; box-shadow: 0 4px 0 #b97a8b; display: inline-flex; align-items: center; gap: 12px; }
.start:active { transform: translateY(3px); box-shadow: 0 1px 0 #b97a8b; }
.start svg { width: 30px; height: 30px; }
.big-start { align-self: center; font-size: 1.7rem; padding: 20px 46px; }
.big-start svg { width: 40px; height: 40px; }
.round-btn { width: 92px; height: 92px; padding: 0; justify-content: center; border-radius: 50% 46% 52% 48%; align-self: center; }
.round-btn svg { width: 46px; height: 46px; }
.ghost { background: transparent; border: 2px solid rgba(248,239,234,.35); border-radius: 12px; padding: 10px 20px; font-weight: 700; }
.row-btns { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.danger { color: var(--pink); border-color: rgba(244,180,196,.5); }
.danger-text { color: var(--pink); }

/* home: star jar and game chips */
.jar-row { display: flex; align-items: flex-end; justify-content: center; gap: 18px; flex-wrap: wrap; }
.jar { width: 120px; height: 160px; }
.jar .glass { fill: rgba(248,239,234,.06); stroke: var(--chalk); stroke-width: 3; }
.jar .lid { fill: var(--wood); }
.full-jars { display: flex; gap: 6px; flex-wrap: wrap; max-width: 220px; }
.mini-jar { width: 30px; height: 38px; border: 2px solid var(--chalk-dim); border-radius: 6px 6px 8px 8px; display: grid; place-items: center; color: var(--yellow); font-size: 1.1rem; }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.chip { text-align: left; background: transparent; border: 2px solid rgba(248,239,234,.22); border-radius: 14px 10px 16px 9px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.chip-icon { font-size: 1.5rem; line-height: 1.2; }
.chip small { color: var(--chalk-dim); font-size: .8rem; }
.chip[aria-pressed="true"] { border-color: var(--pink); background: rgba(244,180,196,.1); }
.chip[aria-pressed="true"] strong { color: var(--pink); }
.lvlbar { display: flex; gap: 3px; margin-top: auto; padding-top: 8px; width: 100%; }
.seg-bar { flex: 1; height: 7px; border-radius: 4px; background: rgba(248,239,234,.14); overflow: hidden; }
.seg-bar i { display: block; height: 100%; background: var(--chalk-dim); border-radius: 4px; }
.chip[aria-pressed="true"] .seg-bar i { background: var(--pink); }
.lvlbar.done .seg-bar i { background: var(--yellow) !important; }

/* play */
.play-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ticks { display: flex; gap: 6px; }
.ticks span { width: 18px; height: 8px; border-radius: 4px; background: rgba(248,239,234,.15); }
.ticks span.done { background: var(--yellow); }
.ticks span.now { background: var(--pink); }
.skill-label { color: var(--chalk-dim); font-size: .85rem; }
.say { background: transparent; border: 2px solid rgba(188,214,236,.55); color: var(--blue); border-radius: 999px; width: 60px; height: 60px; display: grid; place-items: center; flex: none; }
.say svg { width: 30px; height: 30px; }
.ask { margin: 0; text-align: center; color: var(--chalk-dim); font-size: 1.05rem; }
.problem { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.problem:empty { display: none; }

.choices { display: grid; grid-template-columns: repeat(var(--n, 2), 1fr); gap: 14px; }
.choices.n2 { --n: 2; } .choices.n3 { --n: 3; } .choices.n4 { --n: 4; }
@media (max-width: 560px) { .choices.n4 { --n: 2; } }
.choices.stack { grid-template-columns: 1fr; }
.choices.wide { grid-template-columns: 1fr 1fr; }
.choice { min-width: 0; overflow: hidden; background: rgba(255,255,255,.03); border: 3px solid rgba(248,239,234,.5); border-radius: 22px 14px 24px 13px; padding: 14px 8px; min-height: 130px; display: flex; align-items: center; justify-content: center; transition: opacity .2s; }
.choices.stack .choice { min-height: 80px; justify-content: flex-start; padding-inline: 18px; }
.choice:hover:not(:disabled) { border-color: var(--pink); background: rgba(244,180,196,.08); }
.choice.no { opacity: .25; }
.choice.ok { border-color: var(--yellow); background: rgba(245,217,142,.16); box-shadow: 0 0 0 4px rgba(245,217,142,.25); }
.choice:disabled { cursor: default; }
.feedback { min-height: 2.6em; text-align: center; font-size: 1.1rem; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.feedback .big { font-weight: 700; font-size: 1.35rem; }
.feedback .good { color: var(--yellow); }
.feedback .try { color: var(--pink); }
.feedback .how { color: var(--chalk-dim); }
.next-row { display: flex; justify-content: center; }
@keyframes wobble { 0%,100% { transform: translateX(0) } 25% { transform: translateX(-6px) } 75% { transform: translateX(6px) } }
.shake { animation: wobble .25s ease 2; }
@media (prefers-reduced-motion: reduce) { .shake { animation: none; } .choice { transition: none; } }

/* pictures */
.pile { --s: 1; display: flex; flex-direction: column; align-items: center; gap: calc(6px * var(--s)); }
.pile.left { align-items: flex-start; }
.prow { display: flex; gap: calc(8px * var(--s)); }
.thing { font-size: calc(2.6rem * var(--s)); line-height: 1.15; background: none; border: none; padding: 0; display: inline-block; position: relative; }
button.thing { border-radius: 50%; padding: 4px; min-width: 60px; min-height: 60px; }
button.thing.marked::after { content: ''; position: absolute; inset: 0; border: 4px solid var(--yellow); border-radius: 50%; }
.pile.scatter { display: grid; grid-template-columns: repeat(var(--cols), auto); grid-template-rows: repeat(var(--rows), auto); gap: calc(4px * var(--s)) calc(10px * var(--s)); }
.cell { display: grid; place-items: center; }
.plate { display: flex; align-items: center; justify-content: center; padding: 10px 14px; border-radius: 50%; background: radial-gradient(ellipse, rgba(248,239,234,.10) 55%, rgba(248,239,234,.04) 56%); min-width: 120px; min-height: 90px; }
.plate.row { border-radius: 14px; background: none; padding: 0; min-height: 0; justify-content: flex-start; }
.choices.stack .plate.row .prow { gap: 14px; }
.plate.wide { padding: 18px 22px; }
.bearplate { display: flex; align-items: center; gap: 10px; }
.bear { font-size: 3.2rem; }
.numcard { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; }
.numcard b { font-size: 3rem; line-height: 1; color: var(--chalk); }
.mini { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.mini span { display: flex; gap: 4px; }
.mini i { width: 12px; height: 12px; border-radius: 50%; background: var(--yellow); }
.dice { width: 130px; height: 130px; }
.die { fill: var(--chalk); }
.pip { fill: var(--board); }
.peek { min-height: 134px; display: grid; place-items: center; }
.sized { line-height: 1; }
.tower { width: 58px; height: auto; }
.blk { stroke: rgba(0,0,0,.25); stroke-width: 1.5; }
.blk.b0 { fill: var(--pink); } .blk.b1 { fill: var(--yellow); } .blk.b2 { fill: var(--blue); }
.ground { stroke: var(--chalk-dim); stroke-width: 2; stroke-dasharray: 4 5; }
.snake { width: 100%; max-width: 330px; height: auto; }
.snake-body { stroke: var(--green); stroke-width: 12; stroke-linecap: round; }
.snake-head { fill: var(--green); }
.snake-eye { fill: var(--board); }
.bears { display: flex; align-items: flex-end; gap: 14px; line-height: 1; }
.shape { height: auto; display: block; }
.balloon { width: 64px; height: auto; }
.balloon .string { fill: none; stroke: var(--chalk-dim); stroke-width: 1.5; }
.hoop { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 14px 26px; border: 3px dashed var(--chalk-dim); border-radius: 999px; flex-wrap: wrap; }
.hoop .emo { font-size: 2.6rem; }
.emo { font-size: 3rem; line-height: 1; }
.pattern { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.pattern .emo { font-size: 2.3rem; }
.cdot { display: inline-block; width: 44px; height: 44px; border-radius: 50%; box-shadow: inset -3px -4px 0 rgba(0,0,0,.18); }
.choice .cdot { width: 64px; height: 64px; }
.qbox { display: inline-grid; place-items: center; width: 52px; height: 52px; border: 4px dashed var(--pink); border-radius: 12px; color: var(--pink); font-weight: 700; font-size: 1.6rem; }
.scene { width: 100%; max-width: 200px; height: auto; }
.scene .wood { fill: var(--wood); }
.scene .box { fill: #b88a5f; stroke: #7d5a3a; stroke-width: 2; }
.choices.line { display: flex; align-items: center; justify-content: center; gap: 8px; }
.choices.line .choice { min-height: 90px; min-width: 76px; padding: 8px; flex: 0 1 100px; }
.house { font-size: 3.6rem; margin-right: 6px; }

/* give me some */
.give { --s: 1; display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.who { display: flex; align-items: center; gap: 16px; }
.animal { font-size: 4rem; line-height: 1; }
.wants { border: 3px solid var(--chalk-dim); border-radius: 16px; padding: 8px 14px; }
.food { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; min-height: 68px; }
.basket { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 2px; width: min(100%, 420px); min-height: 96px; border: 4px solid var(--wood); border-top-width: 2px; border-radius: 10px 10px 40px 40px; background: repeating-linear-gradient(45deg, rgba(210,173,140,.14) 0 8px, transparent 8px 16px); padding: 8px; }

/* done */
.done-h { text-align: center; font-size: clamp(2.2rem, 8vw, 3rem); }
.stars { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.big-stars svg { width: 64px; height: 64px; }
.done-h + .stars + .jar-row + .row-btns { justify-content: center; }
.ups { margin: 0; padding-left: 1.2em; color: var(--yellow); }
.hands { border: 2px dashed rgba(191,224,180,.5); border-radius: 14px; padding: 14px 18px; }
.hands h2 { color: var(--green); }
.hands ul, .tips { margin: 0; padding-left: 1.1em; display: flex; flex-direction: column; gap: 8px; }
.tips { font-size: .92rem; color: var(--chalk-dim); }
.tips strong { color: var(--chalk); }

/* grown-ups */
.levels { display: flex; flex-direction: column; gap: 2px; }
.lvl { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed rgba(248,239,234,.18); }
.lvl > div { min-width: 0; }
.lvl small { display: block; color: var(--chalk-dim); font-size: .85rem; }
.stepper { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.stepper button { width: 38px; height: 38px; border-radius: 10px; background: transparent; border: 2px solid rgba(248,239,234,.35); font-weight: 700; }
.stepper button:disabled { opacity: .25; cursor: default; }
.seg { display: inline-flex; border: 2px solid rgba(248,239,234,.3); border-radius: 10px; overflow: hidden; }
.seg button { background: transparent; border: none; padding: 6px 14px; }
.seg button[aria-pressed="true"] { background: var(--chalk); color: var(--board); font-weight: 700; }
.list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: .95rem; }
.list li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed rgba(248,239,234,.12); padding-bottom: 4px; }
.list li span:last-child { color: var(--chalk-dim); text-align: right; }
.pick { font: inherit; font-size: .95rem; background: var(--board-2); color: var(--chalk); border: 2px solid rgba(248,239,234,.3); border-radius: 10px; padding: 6px 10px; max-width: 100%; min-width: 0; }
.code-input { width: 11em; letter-spacing: .08em; text-transform: uppercase; }
.sync-code { font-size: 1.5rem; letter-spacing: .12em; color: var(--yellow); user-select: all; }
input:focus-visible, select:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.name-form { display: flex; flex-direction: column; gap: 8px; }
.name-form label { font-weight: 700; }
.name-input { width: 12em; font-size: 1.1rem; }
.tag { font-weight: 700; border-radius: 999px; padding: 1px 8px; font-size: .78rem; color: var(--board); }
.tag.again { background: var(--pink); }
.tag.stretch { background: var(--yellow); }

/* Persie's frog friend */
.frog-friend { font-size: 3.4rem; line-height: 1; align-self: flex-end; }
.friends { display: flex; justify-content: center; align-items: flex-end; gap: 18px; font-size: 4.4rem; line-height: 1; }
.hop { display: inline-block; animation: hop 1.1s ease-in-out 3; }
@keyframes hop { 0%, 100% { transform: translateY(0) } 35% { transform: translateY(-38px) rotate(-8deg) } 60% { transform: translateY(0) scale(1.08, .92) } }
.plod { display: inline-block; animation: plod 2.4s ease-in-out 2; }
@keyframes plod { 0%, 100% { transform: translateX(0) } 50% { transform: translateX(-16px) } }
@media (prefers-reduced-motion: reduce) { .hop, .plod { animation: none; } }
