/* Offset: the children's app look. Loaded after desk.css on the children's page only (the parents' page keeps desk.css alone).
   Mostly ink and white; lime and violet are used deliberately; the offset shadow belongs to the wordmark and the character only. */
:root {
  --paper: #f6f7f9; --sheet: #ffffff; --wash: #eef0f4; --ink: #171b2b; --ink2: #555b6d; --rule: #d7dbe3;
  --biro: #6c3af2; --biro-ink: #ffffff; --hi: #c5ed42; --hi-ink: #171b2b; --margin: #b42336; --ok: #176b4d; --warn: #805000;
  --lime: #c5ed42; --violet: #6c3af2; --violet-soft: #eeeafe; --lime-soft: #f0f9d2; --char-ink: #0b0e1a;
  --display: "Outfit", system-ui, sans-serif; --body: "DM Sans", system-ui, sans-serif;
  --spring: cubic-bezier(.2, 1.35, .35, 1); --ease: cubic-bezier(.2, 0, 0, 1); --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #101320; --sheet: #1b2030; --wash: #242a3d; --ink: #f4f6fa; --ink2: #c3c8d4; --rule: #3a4257;
    --biro: #a997ff; --biro-ink: #101320; --hi-ink: #101320; --margin: #ff9ba8; --ok: #76e5b1; --warn: #ffd27a;
    --violet-soft: #30264d; --lime-soft: #29351c; --char-ink: #2b3250; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #101320; --sheet: #1b2030; --wash: #242a3d; --ink: #f4f6fa; --ink2: #c3c8d4; --rule: #3a4257;
  --biro: #a997ff; --biro-ink: #101320; --hi-ink: #101320; --margin: #ff9ba8; --ok: #76e5b1; --warn: #ffd27a;
  --violet-soft: #30264d; --lime-soft: #29351c; --char-ink: #2b3250; color-scheme: dark;
}

body { font-family: var(--body); }
h1 { font-weight: 800; letter-spacing: -0.03em; }
h1, h2, h3 { font-family: var(--display); }
h2 { font-weight: 700; font-size: 1.3rem; letter-spacing: -0.01em; }
.label { letter-spacing: 0.06em; }
.small { font-size: 0.9rem; }
:focus-visible { outline: 3px solid var(--biro); outline-offset: 3px; }

/* Wordmark: the offset print shadow lives here and on the character, nowhere else. */
/* The wordmark is vector outlines (public/img has the stand-alone files), so it stays sharp at any size and in dark mode. */
.brand { display: block; line-height: 0; color: var(--ink); }
.brand .wordmark { height: 26px; width: auto; display: block; }
.brand i { display: none; }
/* The wordmark is the letters plus one offset shadow behind them. The shadow's colour follows the background:
   light screens and lime panels: ink letters, violet shadow. Dark screens and violet panels: white letters, lime shadow. */
:root { --wm-shadow: #6c3af2; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --wm-shadow: #c5ed42; } }
:root[data-theme="dark"] { --wm-shadow: #c5ed42; }
.wm-shadow { fill: var(--wm-shadow); }
.on-violet { --wm-shadow: #c5ed42; color: #ffffff; }
.on-ink { --wm-shadow: #c5ed42; color: #ffffff; }
.on-lime { --wm-shadow: #6c3af2; color: #171b2b; }
.kids { background: transparent; padding: 0; }
.kids button { background: var(--wash) !important; color: var(--ink) !important; border-radius: 999px; min-height: 40px; }
.kids button span { color: var(--ink2) !important; opacity: 1 !important; }

/* Sections: a bottom bar on phones, quiet pills on wider screens. */
.tabs { border-bottom: 0; gap: 6px; }
.tabs button { border: 0; border-radius: 999px; padding: 10px 18px; color: var(--ink2); margin: 0; font-family: var(--display); font-weight: 700; }
.tabs button[aria-current="page"] { background: var(--ink); color: var(--paper); }
@media (max-width: 720px) {
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0;
    background: var(--sheet); border-top: 1px solid var(--rule); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
  .tabs button { border-radius: 14px; min-height: 52px; padding: 6px 4px; font-size: 0.95rem; }
  .tabs button[aria-current="page"] { background: var(--lime); color: var(--hi-ink); }
  .wrap { padding-bottom: calc(110px + env(safe-area-inset-bottom)) !important; }
  #toast { bottom: calc(84px + env(safe-area-inset-bottom)) !important; }
}

/* Buttons: lime with ink for the main action, quiet outlines for the rest. */
.btn { background: var(--lime); border: 2px solid var(--lime); color: var(--hi-ink); border-radius: 14px; padding: 11px 18px; min-height: 48px; font-weight: 700; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--biro); padding-inline: 8px; }
.btn.quiet { background: transparent; border-color: var(--rule); color: var(--ink); }
.btn.sm { min-height: 40px; padding: 7px 14px; border-radius: 12px; }
.btn.ink { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn:active:not([disabled]) { transform: translateY(1px) scale(0.99); }
.btn.wide { width: 100%; }
.back { color: var(--biro); min-height: 40px; }

.panel, .list { border-radius: 20px; }
.note { border-left-color: var(--violet); background: var(--violet-soft); }
.note.warn { border-left-color: var(--margin); background: var(--wash); }
.countchip { border-radius: 999px; padding: 8px 16px 8px 10px; background: var(--violet-soft); border-color: transparent; }
.countchip b { font-family: var(--display); font-weight: 800; min-width: 1.4em; text-align: center; }
.countchip.soon { background: var(--lime); color: var(--hi-ink); }
.pill.hot { background: var(--lime); color: var(--hi-ink); }
.meter i { background: var(--violet); }
.subtabs button { border-radius: 999px; min-height: 40px; }
.subtabs button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.stepno { background: var(--violet); color: #fff; }
.lesson .step.speaking { box-shadow: -12px 0 0 var(--sheet), -16px 0 0 var(--lime); }
.msg.you { background: var(--lime-soft); color: var(--ink); border-bottom-right-radius: 4px; }
.msg.coach { background: var(--violet-soft); border-bottom-left-radius: 4px; }
.msg { border-radius: 18px; }
/* Answers that feel like a game: chunky buttons that press down; right pops green, wrong shakes red. Green and red are kept
   apart from the lime buttons, so "your answer" never looks like "next". */
.opt { border-width: 2px; border-bottom-width: 5px; border-radius: 16px; min-height: 56px; font-weight: 600; box-shadow: none;
  transition: transform .08s, border-color .15s, background .15s, opacity .2s; -webkit-tap-highlight-color: transparent; }
.opt:not(:disabled):active { transform: translateY(3px); border-bottom-width: 2px; margin-bottom: 3px; }
.opt.right { border-color: var(--good); background: var(--good-soft); color: var(--good-edge); box-shadow: none; animation: pop .35s ease-out; opacity: 1; }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); color: var(--bad-edge); box-shadow: none; animation: shake .4s; opacity: 1; }
.opt .tag { font-weight: 800; }
.opt:disabled:not(.right):not(.wrong) { opacity: .5; }
.opt.pending { border-color: var(--violet); animation: pulse 1s ease-in-out infinite; opacity: 1 !important; }
#toast { background: var(--ink); color: var(--paper); border-radius: 14px; }
#toast.quiet { background: var(--wash); color: var(--ink); }
.earned { color: var(--ok); }

/* Flashcards: a clean card, no exercise-book rules. */
.card { background-image: none; border: 1px solid var(--rule); border-radius: 22px; padding: 28px 22px; min-height: 260px; text-align: center; align-items: center; }
.card::before { display: none; }
.card .face { font-family: var(--display); font-weight: 700; font-size: 1.6rem; line-height: 1.25; }
.card.flipped { background: var(--violet-soft); border-color: transparent; }
.card.flipped .face { font-family: var(--body); font-weight: 500; font-size: 1.2rem; line-height: 1.5; }
@media (prefers-reduced-motion: no-preference) { .card.flipin { animation: flipin 280ms var(--ease); } }
@keyframes flipin { from { transform: perspective(800px) rotateY(-70deg); opacity: .4; } to { transform: none; opacity: 1; } }

/* ---------- the character ---------- */
.buddy { position: relative; width: 100%; max-width: 300px; margin: 0 auto; display: block; border: 0; background: transparent; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.buddy svg { display: block; width: 100%; height: auto; overflow: visible; }
/* Rising never overshoots past the line (that showed a gap); the springiness comes from the squash and stretch instead. */
.buddy .rise { transition: transform 420ms cubic-bezier(.2, .9, .3, 1); }
.buddy .squash { transform-box: view-box; transform-origin: 160px 154px; }
.buddy.boing .squash { animation: boing 760ms ease-out both; }
.buddy.dip .squash { animation: dip 180ms ease-in both; }
@keyframes boing { 0% { transform: scale(.88, 1.18); } 28% { transform: scale(1.14, .84); } 46% { transform: scale(.94, 1.07); } 62% { transform: scale(1.05, .96); } 78% { transform: scale(.98, 1.02); } 100% { transform: none; } }
@keyframes dip { to { transform: scale(1.12, .84); } }
.buddy#buddy { touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.buddy.held .squash { transition: transform 110ms ease-out; }
.buddy.jelly .squash { animation: jelly 900ms ease-out both; }
@keyframes jelly { 0% { transform: var(--from); } 22% { transform: skewX(calc(var(--r) * 0.5)) scale(1.16, .82); } 40% { transform: skewX(calc(var(--r) * -0.3)) scale(.9, 1.12); } 56% { transform: scale(1.07, .94); } 72% { transform: scale(.97, 1.04); } 86% { transform: scale(1.01, .99); } 100% { transform: none; } }
.buddy[data-eyes="squint"] .eyes { transform: scaleY(0.35); }
.buddy[data-eyes="wide"] .eyes { transform: scale(1.15, 1.2) translateY(-4px); }
.buddy .eyes { transform-box: fill-box; transform-origin: center; transition: transform 160ms var(--ease); }
.buddy[data-pose="hidden"] .rise { transform: translateY(150px); transition-duration: 180ms; transition-timing-function: ease-in; }
.buddy[data-pose="shy"] .rise { transform: translateY(44px); }
.buddy[data-pose="peek"] .rise { transform: translateY(18px); }
.buddy[data-pose="up"] .rise { transform: translateY(0); }
.buddy[data-eyes="blink"] .eyes { transform: scaleY(0.09); transition-duration: 90ms; }
.buddy[data-eyes="glance"] .eyes { transform: translate(9px, -6px); }
.buddy[data-eyes="think"] .eyes { transform: translate(6px, -10px); }
.buddy[data-eyes="happy"] .eyes { transform: scaleY(0.45) translateY(12px); }
.buddy[data-eyes="sleepy"] .eyes { transform: scaleY(0.55) translateY(8px); }
.buddy.waving .tilt { animation: tilt 760ms ease-out both; transform-box: view-box; transform-origin: 160px 154px; }
.buddy.cheer .tilt { animation: cheer 820ms ease-out both; transform-box: view-box; transform-origin: 160px 154px; }
/* Every movement keeps the base on the line: slants and stretches anchored at the line, never rotations or jumps. */
@keyframes tilt { 0%, 100% { transform: none; } 15% { transform: skewX(14deg); } 35% { transform: skewX(-11deg); } 55% { transform: skewX(6deg); } 75% { transform: skewX(-3deg); } }
@keyframes cheer { 0% { transform: scale(.9, 1.15); } 35% { transform: scale(.86, 1.3); } 55% { transform: scale(1.18, .82); } 72% { transform: scale(.95, 1.08); } 87% { transform: scale(1.03, .97); } 100% { transform: none; } }
.buddy.small { max-width: 92px; margin: 0; }
@media (prefers-reduced-motion: reduce) {
  .buddy .rise, .buddy .eyes { transition: none !important; }
  .buddy.waving .tilt, .buddy.cheer .tilt, .buddy .squash { animation: none !important; transition: none !important; }
}

/* Today: the character peeks over the top edge of today's bite. */
.today-top { display: flex; flex-direction: column; gap: 4px; }
.today-top h1 { font-size: 2rem; }
.stagewrap { position: relative; margin-top: 8px; }
.speech { position: absolute; z-index: 3; right: 0; top: 0; max-width: 46%; background: var(--sheet); border: 1px solid var(--rule); border-radius: 16px 16px 16px 4px;
  padding: 8px 12px; font-size: 0.95rem; line-height: 1.35; font-weight: 500; opacity: 0; transform: translateY(6px); transition: opacity 200ms, transform 200ms var(--ease-out); pointer-events: none; }
.speech.on { opacity: 1; transform: none; }
.bite { margin-top: -2px; background: var(--sheet); border: 1px solid var(--rule); border-radius: 0 0 24px 24px; border-top: 0; padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; }
.bite h2 { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; }
.bite .kicker { font-family: var(--display); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--biro); }
.bite.done .kicker { color: var(--ok); }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week .day { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--ink2); }
.week .day b { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--rule); color: var(--ink2); font-weight: 700; font-size: 0.9rem; }
.week .day.done b { background: var(--lime); border-color: var(--lime); color: var(--hi-ink); }
.week .day.now b { outline: 2px solid var(--biro); outline-offset: 2px; }
.week .day.later b { border-style: dashed; }
.moneyline { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; text-align: left; border: 1px solid var(--rule); background: var(--sheet); border-radius: 16px; padding: 12px 16px; min-height: 52px; color: var(--ink); }
.moneyline b { font-family: var(--display); font-size: 1.25rem; }

/* The bite in progress, and its finish. */
.bitebar { display: flex; align-items: center; gap: 12px; }
.bitebar .progress { flex: 1; height: 10px; border-radius: 99px; background: var(--wash); overflow: hidden; }
.bitebar .progress i { display: block; height: 100%; background: var(--violet); border-radius: 99px; transition: width 260ms var(--ease); }
.closebtn { border: 1px solid var(--rule); background: var(--sheet); border-radius: 999px; width: 44px; height: 44px; font-size: 1.2rem; line-height: 1; flex: none; color: var(--ink); }
.twoup { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.twoup .btn { width: 100%; }
.finish { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding-top: 12px; }
.finish h1 { font-size: 2.1rem; }
.finish .stats { color: var(--ink2); }
.finish .week { width: 100%; max-width: 360px; }
.pinpanel .buddy { max-width: 220px; }
.coachhead { display: flex; align-items: flex-end; gap: 12px; }

/* Parents' page */
.phead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.phead .buddy.small { max-width: 84px; flex: none; }
.glance { gap: 14px; }
.glancerow { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--rule); }
.glancerow:first-of-type { border-top: 0; padding-top: 0; }
.glancehead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 12px; }
.glancehead b { font-family: var(--display); font-size: 1.15rem; }
.gstate { font-size: 0.9rem; font-weight: 700; border-radius: 999px; padding: 3px 12px; }
.g-ok { background: var(--lime); color: var(--hi-ink); }
.g-part { background: var(--violet-soft); color: var(--ink); }
.g-none { background: var(--wash); color: var(--ink2); }
.glance .week { max-width: 420px; }
.pinpanel .buddy { max-width: 200px; margin: 0 auto; }

/* Opened from the home screen: full screen, so keep clear of the clock and the notch. */
/* iPhones soften whatever sits just under the clock, so the header starts a little further down. */
.wrap { padding-top: max(20px, calc(env(safe-area-inset-top) + 28px)) !important; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.hometip { display: flex; gap: 12px; align-items: flex-start; background: var(--violet-soft); border-radius: 16px; padding: 14px 16px; }
.hometip p { margin: 0; }
.hometip .x { margin-left: auto; flex: none; border: 0; background: transparent; color: var(--ink2); font-size: 1.2rem; min-width: 32px; min-height: 32px; }

/* This week's pocket money in the header: small, always there, and it bumps when it goes up. */
.kids { gap: 8px; align-items: center; }
.kids .cashchip { border: 0; border-radius: 999px; min-height: 40px; padding: 6px 14px; background: var(--lime) !important; color: var(--hi-ink) !important; font-family: var(--display); font-weight: 800; font-size: 1rem; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: no-preference) { .cashchip.bump { animation: cashbump 600ms cubic-bezier(.2, 1.35, .35, 1); } }
@keyframes cashbump { 0% { transform: scale(1); } 30% { transform: scale(1.25); } 60% { transform: scale(.95); } 100% { transform: scale(1); } }

/* Parents' report: homework as short rows, each test as one tidy card. */
.duelist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.duelist li { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.duewhen { font-family: var(--display); font-weight: 700; font-size: 0.9rem; color: var(--ink2); }
.duewhen.hot { color: var(--ink); }
.testcards { display: flex; flex-direction: column; gap: 10px; }
.testcard { display: flex; flex-direction: column; gap: 8px; background: var(--paper); border-radius: 16px; padding: 14px 16px; }
.testhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.testhead b { font-family: var(--display); font-size: 1.05rem; line-height: 1.3; }
.testhead .status { flex: none; }
.srcnote { line-height: 1.45; }

/* ---------- Welcome to Offset: the one-page explainer (/welcome) ---------- */
.guide .wrap { max-width: 760px; }
.guide .lockup { text-align: center; padding: clamp(28px, 7vw, 56px) 0 clamp(32px, 7vw, 52px); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.guide .lockup-art { width: min(520px, 84%); height: auto; display: block; color: var(--ink); --dome: var(--char-ink); overflow: visible; }
.guide .lk-eyes { transform-box: fill-box; transform-origin: center 75%; transition: transform 90ms; }
.guide .lk-eyes.blink { transform: scaleY(0.1); }
.guide .lede { max-width: 34em; margin: clamp(26px, 6vw, 40px) auto 0; font-size: 1.08rem; color: var(--ink2); }
.guide h2 { font-family: Outfit, sans-serif; font-weight: 800; font-size: 1.5rem; margin: 0 0 12px; }
.guide h3 { font-family: Outfit, sans-serif; font-weight: 700; font-size: 1.1rem; margin: 22px 0 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.guide .perks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.guide .perks article { background: var(--sheet); border: 1px solid var(--rule); border-radius: 18px; padding: 14px 16px; display: grid; grid-template-columns: 38px 1fr; column-gap: 12px; align-items: start; }
.guide .perks article p { grid-column: 2; }
.guide .perks h3 { margin: 0 0 4px; align-self: center; min-height: 38px; display: flex; }
.guide .perks p { margin: 0; color: var(--ink2); font-size: 0.95rem; }
.guide .ico { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--violet-soft); color: var(--biro); font-family: Outfit, sans-serif; font-weight: 900; font-size: 1.05rem; }
.guide .perks article:nth-child(3n+2) .ico { background: var(--lime); color: var(--hi-ink); }
.guide .setup { background: var(--sheet); border: 1px solid var(--rule); border-radius: 20px; padding: 20px 18px; }
.guide .who { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; background: var(--ink); color: var(--paper); border-radius: 999px; padding: 4px 10px; }
.guide .howto.big li { padding-left: 4px; }
.guide .howto.big li::marker { font-family: Outfit, sans-serif; font-weight: 800; color: var(--violet); }
.guide .keepsync { background: var(--violet-soft); border-left: 4px solid var(--violet); border-radius: 14px; padding: 12px 16px; margin: 14px 0 6px; }
.guide .keepsync h4 { margin: 0 0 6px; font-family: Outfit, sans-serif; }
.guide .keepsync p, .guide .keepsync li { font-size: 0.95rem; }
.guide .keepsync ul { padding-left: 1.2em; margin: 6px 0; }
.guide .keepsync li { margin: 4px 0; }
.guide .keepsync p { margin: 6px 0; }
.guide .homescreen { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 20px 0 8px; }
.guide .homescreen > div { background: var(--lime-soft); border-radius: 14px; padding: 12px 14px; }
.guide .homescreen h4 { margin: 0 0 4px; font-family: Outfit, sans-serif; }
.guide .homescreen p { margin: 0; font-size: 0.95rem; }
.guide .key { display: inline-block; min-width: 1.6em; text-align: center; border: 1px solid var(--rule); border-radius: 6px; background: var(--sheet); font-size: 0.85em; padding: 0 4px; }
.guide .close { color: var(--ink2); font-size: 0.92rem; text-align: center; padding: 8px 0 24px; }
.guide .close a { color: var(--violet); }
@media print { .guide .setup, .guide .perks article { break-inside: avoid; } }

/* "Something wrong?": quiet under cards, questions and lessons; the reasons open in place. */
.reportlink { color: var(--ink2); font-weight: 500; font-size: 0.85rem; text-decoration: underline; text-underline-offset: 3px; align-self: center; margin-top: 6px; }
.reportbox { border: 1px dashed var(--rule); border-radius: 12px; padding: 10px 12px; margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.reportbox .actions { flex-wrap: wrap; }
.report { border-top: 1px solid var(--rule); padding-top: 12px; margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.report .qa { grid-template-columns: 1fr; }
.integrity .tiles { margin-top: 4px; }

/* Joining: confirmations, the first sync wait, and small text buttons. */
.note.ok { border-left-color: var(--ok); background: var(--lime-soft); }
.note p { margin: 4px 0; }
p > .spinner { display: inline-block; width: 16px; height: 16px; border-width: 2px; vertical-align: -3px; margin-right: 6px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--biro); text-decoration: underline; cursor: pointer; min-height: 32px; }
.linkbtn[disabled] { opacity: 0.6; cursor: default; }

/* QR codes: the links page at the end of joining, and the "made for your phone" banner on a computer. */
.qr { background: #fff; border-radius: 10px; padding: 4px; line-height: 0; }
.qr svg { width: 100%; height: auto; display: block; }
.qrgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; margin-top: 12px; }
.qrgrid figure { margin: 0; display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; }
.qrgrid .qr { width: 150px; border: 1px solid var(--rule); }
.qrgrid figcaption { display: flex; flex-direction: column; }
.phonenudge { display: flex; gap: 16px; align-items: center; background: var(--violet-soft); border-radius: 18px; padding: 14px 16px; margin: 0 0 16px; }
.phonenudge .qr { width: 112px; flex: none; }
.phonenudge p { margin: 4px 0 6px; }

/* Admin: how each family uses Offset. */
.activity h3 { margin: 14px 0 6px; font-size: 1rem; }
.tablewrap { overflow-x: auto; }
.acttable { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
.acttable th, .acttable td { text-align: left; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.acttable thead th { font-size: 0.8rem; color: var(--muted, #5f5a73); font-weight: 600; }
.acttable td.warn { color: var(--margin); font-weight: 700; }

/* Welcome: the way to the roadmap. */
.guide .soon a { display: block; text-decoration: none; color: #fff; background: radial-gradient(circle at 15% 0%, #3B2A8C 0%, #171B2B 60%); border-radius: 24px; padding: 20px 20px 22px; border-bottom: 6px solid #0B0E1A; }
.guide .soon .soonkick { display: inline-block; font: 800 .72rem Outfit, sans-serif; letter-spacing: .12em; text-transform: uppercase; background: #C5ED42; color: #171B2B; padding: 5px 10px; border-radius: 999px; }
.guide .soon b { display: block; font: 900 1.5rem/1.1 Outfit, sans-serif; margin: 10px 0 6px; }
.guide .soon span:last-child { color: #D9D4F7; }

/* ---------- game feel ---------- */
:root { --good: #1f9d5c; --good-soft: #dff5e8; --good-edge: #157a46; --bad: #d23c4b; --bad-soft: #fde4e6; --bad-edge: #a82633; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --good: #3ccf7f; --good-soft: #163626; --good-edge: #7fe3aa; --bad: #ff7b88; --bad-soft: #3a1c22; --bad-edge: #ffb3bb; } }
:root[data-theme="dark"] { --good: #3ccf7f; --good-soft: #163626; --good-edge: #7fe3aa; --bad: #ff7b88; --bad-soft: #3a1c22; --bad-edge: #ffb3bb; }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(4px); } }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px var(--violet-soft); } }
@keyframes sheetup { from { transform: translateY(110%); } to { transform: none; } }
.btn:not(:disabled):active { transform: translateY(2px); }
.qprog { display: block; height: 10px; border-radius: 99px; background: var(--wash, var(--violet-soft)); overflow: hidden; margin: 0 0 12px; }
.qprog i { display: block; height: 100%; background: var(--violet); border-radius: 99px; transition: width 300ms var(--ease, ease); }
/* The sheet: slides up after an answer and sits over the tab bar. */
.sheetspace { height: 340px; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; max-width: 560px; margin: 0 auto; max-height: 72vh; overflow-y: auto;
  padding: 18px 20px calc(34px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; box-shadow: 0 -8px 28px rgba(0,0,0,.14); }
.sheet.anim { animation: sheetup .3s cubic-bezier(.2,.9,.3,1.2); }
.sheet.good { background: var(--good-soft); color: var(--good-edge); }
.sheet.bad { background: var(--bad-soft); color: var(--bad-edge); }
.sheethead { display: flex; align-items: center; gap: 10px; font: 800 1.35rem var(--display); }
.sheethead .mark { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 1.05rem; }
.sheet.good .mark { background: var(--good); } .sheet.bad .mark { background: var(--bad); }
.combo { margin-left: auto; font: 700 .85rem var(--body); background: var(--sheet); color: #b45309; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.combo.hot { background: var(--lime); color: var(--hi-ink); animation: pop .4s ease-out; }
.sheetbody { color: var(--ink); margin: 8px 0 4px; line-height: 1.45; }
.sheetbody p { margin: 6px 0; }
.sheetbody .note { margin: 8px 0 0; }
.sheetmore { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 6px 0 12px; }
.sheetmore .reportlink, .linkish { background: none; border: 0; padding: 6px 0; color: var(--ink2, var(--ink)); text-decoration: underline; font: 500 .9rem var(--body); cursor: pointer; min-height: 0; }
.go { appearance: none; display: block; width: 100%; border: 0; border-bottom: 5px solid; border-radius: 16px; padding: 15px; font: 800 1.1rem var(--display); color: #fff; cursor: pointer; min-height: 56px; }
.go:active { transform: translateY(3px); border-bottom-width: 2px; }
.sheet.good .go { background: var(--good); border-color: color-mix(in srgb, var(--good) 70%, #000); }
.sheet.bad .go { background: var(--bad); border-color: color-mix(in srgb, var(--bad) 70%, #000); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sheet .go { color: #0b0e1a; } }
:root[data-theme="dark"] .sheet .go { color: #0b0e1a; }
/* The finish: a big score that pops. */
.bigscore { display: flex; align-items: baseline; gap: 12px; font-family: var(--display); margin: 2px 0 6px; }
.bigscore .num { font-size: 3.2rem; font-weight: 900; letter-spacing: -.03em; line-height: 1; }
.bigscore .verdict { font-weight: 800; font-size: 1.25rem; color: var(--ink2, var(--ink)); }
.bigscore.high .num { color: var(--good); animation: pop .5s ease-out; }
.bigscore.perfect .verdict { background: var(--lime); color: var(--hi-ink); padding: 3px 12px; border-radius: 999px; }
.finish h1.pop { animation: pop .5s ease-out; }
/* Confetti in the brand's squares. */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i { position: absolute; top: -20px; border-radius: 2px; animation-name: fall; animation-timing-function: cubic-bezier(.25,.5,.55,1); animation-fill-mode: forwards; }
@keyframes fall { to { transform: translate(var(--dx), 105vh) rotate(var(--r)); } }
@media (prefers-reduced-motion: reduce) { .opt.right, .opt.wrong, .opt.pending, .combo.hot, .bigscore .num, .finish h1.pop { animation: none !important; } .sheet.anim { animation: none; } }

/* Playing a bite: tighter spacing, so the question, the card and the buttons sit together on a phone screen. */
#view.stack.play { gap: 16px; }
#view.play .note.viewer { padding-top: 10px; padding-bottom: 10px; font-size: .88rem; }
#view.play .bitebar { margin-bottom: 4px; }
#view.play > .label + .question { margin-top: -10px; }
/* The question leads; the answers are lighter so it stands out. */
.question { font-family: var(--display); font-weight: 800; font-size: 1.55rem; line-height: 1.22; letter-spacing: -0.01em; color: var(--ink); margin: 0; }
.opts .opt { font-weight: 500; line-height: 1.4; }
.panel .question { margin: 2px 0 6px; }
