/* CHALK: the kids' room. Same building as the arcade, but the lamp is on:
   deep blue evening, chunky bright buttons, big tap targets (56px+). */
@font-face { font-family: "VT323"; src: url("../fonts/vt323-latin.woff2") format("woff2"); font-display: swap; }
/* FONT TEST 2026-11-10: three candidates beside VT323, picked on the portal (stored as chalk.font). size-adjust keeps layouts close to VT323, which runs small. */
@font-face { font-family: "Pixelify Sans"; src: url("../fonts/pixelify-sans-400-latin.woff2") format("woff2"); font-display: swap; size-adjust: 82%; }
@font-face { font-family: "Fredoka"; src: url("../fonts/fredoka-500-latin.woff2") format("woff2"); font-display: swap; size-adjust: 78%; }
@font-face { font-family: "Baloo 2"; src: url("../fonts/baloo-2-600-latin.woff2") format("woff2"); font-display: swap; size-adjust: 78%; }
/* 1 (default) is Baloo 2, set in :root below; 2 to 4 are the others still in the test */
html[data-font="2"] { --pixel: "VT323", ui-monospace, monospace; }
html[data-font="3"] { --pixel: "Pixelify Sans", ui-monospace, monospace; }
html[data-font="4"] { --pixel: "Fredoka", system-ui, sans-serif; }
/* Body text: Baloo 2 regular at its natural size (IBM Plex Mono draws ß in the old long-s form, which reads as "fz" to a child). */
@font-face { font-family: "Baloo Body"; src: url("../fonts/baloo-2-400-latin.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/ibm-plex-mono-400-latin.woff2") format("woff2"); font-display: swap; }
:root {
  --bg: #14182b; --bg2: #1d2340; --card: #262d52; --line: #3a4273;
  --ink: #f4efe2; --dim: #b9b6c9;
  --sun: #ffd166; --rose: #ef7a92; --cyan: #6fd6dc; --lime: #a7d86d; --violet: #b79cf2; --orange: #f5a05a;
  --pixel: "Baloo 2", system-ui, sans-serif; --mono: "Baloo Body", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0; color: var(--ink); font: 400 20px/1.45 var(--mono);
  background: radial-gradient(80vw 60vh at 50% -10%, #2a3160, transparent 70%), var(--bg);
  background-attachment: fixed; min-height: 100vh; overflow-x: hidden; touch-action: manipulation;
}
a { color: var(--sun); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }

.bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: rgba(20, 24, 43, 0.9); border-bottom: 2px solid var(--line); position: sticky; top: 0; z-index: 10; }
.bar h1 { margin: 0; font: 400 30px/1 var(--pixel); letter-spacing: 0.05em; color: var(--sun); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip { min-width: 48px; min-height: 48px; padding: 0 12px; display: inline-grid; place-items: center; border-radius: 12px; border: 2px solid var(--line); background: var(--card); font: 24px/1 var(--pixel); text-decoration: none; color: var(--ink); cursor: pointer; }
.chip:hover { border-color: var(--sun); }
.stars { font: 26px/1 var(--pixel); color: var(--sun); white-space: nowrap; }

.wrap { max-width: 860px; margin: 0 auto; padding: 18px 14px 40px; }
.lead { color: var(--dim); margin: 0 0 18px; }
.big { font: 400 clamp(44px, 12vw, 96px)/1 var(--pixel); letter-spacing: 0.04em; text-align: center; margin: 10px 0; }
.say { font-size: clamp(64px, 18vw, 120px); line-height: 1.1; text-align: center; }
.row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.opt {
  min-width: 96px; min-height: 72px; padding: 8px 18px; border-radius: 16px; cursor: pointer;
  border: 3px solid var(--tint, var(--cyan)); background: color-mix(in srgb, var(--tint, var(--cyan)) 16%, var(--card));
  font: 400 clamp(30px, 7vw, 46px)/1 var(--pixel); letter-spacing: 0.04em; color: var(--ink);
  transition: transform 120ms ease, background 120ms ease;
}
.opt:hover { transform: translateY(-2px); }
.opt:active { transform: scale(0.96); }
.opt.good { background: var(--lime); border-color: var(--lime); color: #14182b; }
.opt.bad { background: #3a2030; border-color: var(--rose); color: var(--rose); animation: shake 300ms linear 1; pointer-events: none; opacity: 0.7; }
.opt[disabled] { cursor: default; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.pill { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pill button { min-height: 48px; min-width: 48px; padding: 0 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--card); font: 22px/1 var(--pixel); cursor: pointer; }
.pill button[aria-pressed="true"] { background: var(--sun); border-color: var(--sun); color: #14182b; }
.pill button.rated { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 6px 14px 5px; }
.pill .rate { font: 600 11px/1 system-ui, sans-serif; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 6px; border-radius: 999px; color: #14182b; }
.pill .rate-e { background: var(--lime); } .pill .rate-m { background: var(--orange); } .pill .rate-h { background: var(--rose); }
.pill button[aria-pressed="true"] .rate { box-shadow: 0 0 0 2px #14182b; }
.settings { display: grid; gap: 12px; margin: 0 0 18px; padding: 14px; border: 2px dashed var(--line); border-radius: 14px; }
.settings label { font: 22px/1 var(--pixel); letter-spacing: 0.06em; color: var(--dim); display: block; margin-bottom: 6px; text-transform: uppercase; }
.go { min-height: 64px; padding: 0 28px; border-radius: 18px; border: 0; background: var(--sun); color: #14182b; font: 34px/1 var(--pixel); letter-spacing: 0.06em; cursor: pointer; }
.go:hover { background: #ffe09a; }
.hud { display: flex; justify-content: space-between; align-items: center; font: 24px/1 var(--pixel); color: var(--dim); margin-bottom: 8px; }
.end { text-align: center; padding: 30px 0; }
.end .big { color: var(--sun); }
.hidden { display: none !important; }

/* portal */
.shelf { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.game { display: grid; gap: 6px; padding: 16px; border-radius: 18px; border: 3px solid var(--tint); background: color-mix(in srgb, var(--tint) 14%, var(--card)); color: var(--ink); text-decoration: none; min-height: 150px; transition: transform 140ms ease; }
li:hover > .game { transform: translateY(-3px); }
.game .ico { font-size: 44px; line-height: 1; }
.game .name { font: 32px/1 var(--pixel); letter-spacing: 0.04em; color: var(--tint); }
.game .what { font-size: 18px; color: var(--dim); }
.game .got { font: 22px/1 var(--pixel); color: var(--sun); }
.h2 { font: 400 30px/1 var(--pixel); letter-spacing: 0.06em; text-transform: uppercase; margin: 6px 0 12px; }
.foot { color: var(--dim); font-size: 16px; border-top: 2px solid var(--line); padding-top: 14px; }
/* A little life in the pictures (Chalk.liven / Chalk.cheer in kit.js): small and slow. */
.alive-inline { display: inline-block; }
.alive-fly { animation: lv-hover 2.6s ease-in-out infinite; }
.alive-drive { animation: lv-rumble 1.8s ease-in-out infinite; }
.alive-swim { animation: lv-swim 3.2s ease-in-out infinite; }
.alive-duck { animation: lv-bob 1.6s ease-in-out infinite; transform-origin: 50% 90%; }
.alive-animal { animation: lv-breathe 2.8s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes lv-hover { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-5px) rotate(2deg); } }
@keyframes lv-rumble { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-2px) translateY(-1px); } 75% { transform: translateX(2px); } }
@keyframes lv-swim { 0%, 100% { transform: translateX(-4px) rotate(-3deg); } 50% { transform: translateX(4px) rotate(3deg); } }
@keyframes lv-bob { 0%, 100% { transform: rotate(-5deg) translateY(0); } 50% { transform: rotate(5deg) translateY(-2px); } }
@keyframes lv-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.04, 0.97); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* 2026-11-10: fill the screen. The round sits in the middle, buttons are big. */
.stage { min-height: calc(100vh - 190px); display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.opt { min-width: clamp(96px, 22vw, 150px); min-height: clamp(76px, 14vh, 112px); font-size: clamp(36px, 8vw, 58px); }
.row { gap: clamp(12px, 3vw, 22px); }

/* mastery: one level across every game */
.badge { display: flex; align-items: center; gap: 16px; padding: 14px 18px; margin: 0 0 22px; border-radius: 18px; border: 3px solid var(--sun); background: color-mix(in srgb, var(--sun) 10%, var(--card)); }
.badge > div { flex: 1; min-width: 0; }
.badge-ico { font-size: 56px; line-height: 1; }
.badge-name { font: 34px/1 var(--pixel); color: var(--sun); letter-spacing: 0.04em; }
.badge-bar { height: 16px; border-radius: 8px; background: #10142a; overflow: hidden; margin: 8px 0 4px; }
.badge-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), var(--sun)); border-radius: 8px; }
.badge-num { font: 20px/1 var(--pixel); color: var(--dim); }
.mastery { font: 30px/1.2 var(--pixel); color: var(--cyan); margin: 0; }
.levelup { display: grid; justify-items: center; gap: 4px; margin: 6px 0; padding: 12px 22px; border-radius: 20px; border: 3px solid var(--sun);
  background: radial-gradient(circle at 50% 0, rgba(255, 209, 102, 0.35), rgba(255, 209, 102, 0.06) 70%); box-shadow: 0 0 28px rgba(255, 209, 102, 0.45); animation: lvpop 700ms cubic-bezier(.2, 1.6, .4, 1) 1; }
.levelup b { font: 400 clamp(40px, 9vw, 64px)/1 var(--pixel); color: var(--sun); letter-spacing: 0.06em; text-shadow: 0 4px 0 #b45309; }
.levelup span { font: 400 clamp(22px, 4.5vw, 30px)/1.2 var(--pixel); color: var(--ink); }
@keyframes lvpop { 0% { transform: scale(0.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.novoice { margin: 0; padding: 8px 14px; font-size: 16px; color: var(--dim); background: #10142a; border-bottom: 2px solid var(--line); text-align: center; }
body.playing .novoice { display: none; }

/* drawn pictures (Chalk.pic): one box, the size of an emoji, built from parts */
.face.drawn { display: flex; align-items: flex-end; justify-content: center; gap: 0.06em; height: 1.15em; font-style: normal; }
.face.drawn i { font-style: normal; line-height: 1; display: block; }
.sz { opacity: 0.28; filter: grayscale(0.6); }
.sz-small { font-size: 0.38em; } .sz-mid { font-size: 0.62em; } .sz-big { font-size: 0.95em; }
.sz.lit { opacity: 1; filter: none; box-shadow: 0 0.06em 0 0 var(--sun); padding-bottom: 0.03em; }
.drawn-count { flex-wrap: wrap; align-content: center; align-items: center; }
.drawn-count i { font-size: 0.42em; } .drawn-count.many { max-width: 2.6em; } .drawn-count.many i { font-size: 0.3em; }
.blob { width: 0.95em; height: 0.85em; align-self: center; border-radius: 46% 54% 52% 48% / 55% 45% 55% 45%; box-shadow: inset -0.08em -0.1em 0 rgba(0, 0, 0, 0.22), inset 0.07em 0.08em 0 rgba(255, 255, 255, 0.3); }
.ring { width: 0.9em; height: 0.9em; align-self: center; border-radius: 50%; border: 0.1em solid var(--ink); }
.glass { position: relative; width: 0.62em; height: 0.95em; align-self: center; border: 0.07em solid var(--ink); border-top: 0; border-radius: 0 0 0.14em 0.14em; overflow: hidden; }
.glass .drink { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: var(--cyan); }
.glass .drink.full { height: 86%; }
.bar-pic { height: 0.26em; align-self: center; border-radius: 0.13em; background: var(--orange); }
.bar-pic.long { width: 1.9em; } .bar-pic.short { width: 0.5em; }
.bar-pic.thick { width: 1.5em; height: 0.62em; border-radius: 0.2em; } .bar-pic.thin { width: 1.5em; height: 0.08em; border-radius: 0.04em; }
/* black and white blobs need an edge to show on the matching background */
.drawn-color .blob { outline: 0.03em solid var(--line); outline-offset: 0.02em; }
/* each word game has its own sign between the big word and the choices */
.mode { text-align: center; font: 400 clamp(34px, 8vw, 56px)/1 var(--pixel); color: var(--sun); margin: 0; letter-spacing: 0.1em; }

/* listen-first choices: the tapped one lifts and gets a ring until tapped again */
.opt.picked { transform: translateY(-4px) scale(1.04); box-shadow: 0 0 0 4px var(--sun); background: color-mix(in srgb, var(--tint, var(--cyan)) 40%, var(--card)); }

/* options panel on the portal */
.options { margin: 26px 0 18px; padding: 16px; border: 3px solid var(--line); border-radius: 18px; background: var(--card); }
/* label on its own line, then the choices in one row of equal buttons: never wraps on a phone */
.optrow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; }
.optname { grid-column: 1 / -1; font: 24px/1 var(--pixel); color: var(--dim); }
.optrow .chip { min-width: 0; width: 100%; padding: 0 4px; }
.options .chip.on { border-color: var(--sun); color: var(--sun); background: color-mix(in srgb, var(--sun) 14%, var(--card)); }
.optnote { margin: -4px 0 12px; color: var(--dim); font-size: 16px; }
.optsample { margin: 6px 0 0; font: 34px/1.2 var(--pixel); color: var(--ink); }

.foot.credit { border-top: 0; padding-top: 0; margin-top: -6px; }

/* who is playing: four places on the portal */
.who { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 6px; }
.whobtn { display: grid; justify-items: center; gap: 2px; padding: 10px 4px 8px; border-radius: 18px; border: 3px solid var(--line); background: var(--card); color: var(--dim); cursor: pointer; font: inherit; touch-action: manipulation; opacity: 0.75; }
.whobtn.on { border-color: var(--sun); background: color-mix(in srgb, var(--sun) 16%, var(--card)); color: var(--ink); opacity: 1; transform: translateY(-3px); box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25); }
.whoface { font-size: clamp(34px, 10vw, 56px); line-height: 1.1; }
.wholv { font: 22px/1 var(--pixel); }
.whohint { margin: 0 0 18px; color: var(--dim); font-size: 16px; text-align: center; }

/* The report button: small and quiet, bottom left, out of the games' way. */
.bugbtn { position: fixed; left: 8px; bottom: 8px; z-index: 40; width: 34px; height: 34px; padding: 0; border-radius: 50%; border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.35); font-size: 16px; line-height: 1; opacity: .5; cursor: pointer; }
.bugbtn:hover, .bugbtn:focus-visible { opacity: 1; }
.bugveil { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.bugbox { width: min(460px, 100%); max-height: 100%; overflow: auto; background: #1b1f3a; color: #fff; border: 2px solid rgba(255,255,255,.25); border-radius: 16px; padding: 16px 18px; }
.bugbox h2 { margin: 0 0 4px; font-size: 1.3rem; }
.bugbox .bughint { margin: 0 0 10px; opacity: .8; font-size: .95rem; }
.bugbox .bughint.small { margin: 10px 0 0; font-size: .8rem; }
.bugbox .bugmsg { min-height: 1.2em; margin: 6px 0; font-size: .95rem; }
.bugnote { width: 100%; box-sizing: border-box; font: inherit; font-size: 1rem; padding: 10px; border-radius: 10px; border: 2px solid rgba(255,255,255,.3); background: #fff; color: #111; resize: vertical; }
.bugbox .ghost { min-height: 64px; padding: 0 20px; border-radius: 18px; border: 2px solid rgba(255,255,255,.4); background: transparent; color: #fff; font: inherit; cursor: pointer; }

/* The player's animal and its speech bubble: bottom right, pops up when it has something to say. */
.mascot { position: fixed; right: 10px; bottom: 10px; z-index: 45; display: flex; align-items: flex-end; flex-direction: row-reverse; gap: 8px; max-width: min(92vw, 520px);
  pointer-events: none; opacity: 0; transform: translateY(16px) scale(.9); transition: opacity .18s ease, transform .18s ease; }
.mascot.on { opacity: 1; transform: none; }
.mascot-face { font-size: 54px; line-height: 1; filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); }
.mascot-say { background: #fff; color: #14182b; border-radius: 18px 18px 4px 18px; padding: 10px 16px; font: 600 1.15rem/1.25 "Baloo 2", system-ui, sans-serif; box-shadow: 0 6px 14px rgba(0,0,0,.45); }
.hintline { margin: 14px auto 0; max-width: 34ch; text-align: center; background: rgba(255, 209, 102, .14); border: 2px solid rgba(255, 209, 102, .5); border-radius: 14px; padding: 10px 14px; font-size: 1.1rem; }
@media (prefers-reduced-motion: reduce) { .mascot { transition: none; } }

/* the home page logo in the top bar */
.bar h1.logo { display: flex; align-items: center; gap: 10px; overflow: visible; }
.logomark { display: inline-flex; flex: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.45)); }
.logoword { font: 600 34px/1 "Baloo 2", system-ui, sans-serif; letter-spacing: .01em; white-space: nowrap; text-shadow: 0 2px 0 rgba(0,0,0,.35); }
@media (max-width: 480px) { .logoword { font-size: 26px; } .logomark svg { width: 34px; height: 34px; } }

/* the volume slider that drops down under the sound button */
.sndwrap { position: relative; display: inline-flex; }
.volpop { position: absolute; top: 100%; right: 0; z-index: 20; display: none; padding: 14px 12px 10px; margin-top: 2px; background: var(--card); border: 2px solid var(--sun); border-radius: 12px; box-shadow: 0 8px 18px rgba(0,0,0,.5); }
.sndwrap:hover .volpop, .sndwrap:focus-within .volpop, .sndwrap.open .volpop { display: block; }
.volpop::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }   /* no gap for the mouse to fall through */
.volslider { display: block; width: 44px; height: 150px; margin: 0; writing-mode: vertical-lr; direction: rtl; accent-color: var(--sun); cursor: pointer; }

/* Phones (owner's reports 2026-11-18 from a 360 x 595 screen): a smaller animal and bubble,
   and less air around the round so the board and its buttons fit without scrolling. */
@media (max-width: 520px) {
  .mascot { right: 6px; bottom: 6px; gap: 4px; max-width: 70vw; }
  .mascot-face { font-size: 38px; }
  .mascot-say { padding: 6px 12px; font-size: 1rem; }
}
@media (max-height: 720px) {
  .bar { padding: 6px 10px; }
  .wrap { padding-top: 8px; padding-bottom: 16px; }
  .hud { margin-bottom: 2px; font-size: 20px; }
  .stage { min-height: calc(100vh - 150px); gap: 8px; }
  .hintline { margin-top: 6px; padding: 6px 10px; font-size: 1rem; }
}
