/* Layout: one phone-width column, one task per screen; big tap targets; the word is the hero. */
@font-face { font-family: 'Andika'; font-weight: 400; font-display: swap; src: url('fonts/andika-400.woff2') format('woff2'); }
@font-face { font-family: 'Andika'; font-weight: 700; font-display: swap; src: url('fonts/andika-700.woff2') format('woff2'); }

:root {
  --sky: #e6f1ff;        /* page ground */
  --paper: #ffffff;      /* cards and tiles */
  --ink: #1b2a4a;        /* text */
  --ink-soft: #55658a;   /* secondary text */
  --line: #c9d8f0;       /* borders */
  --blue: #2f6fdb;       /* primary action */
  --blue-ink: #ffffff;
  --sun: #ffc83d;        /* progress, stars */
  --sun-deep: #e8a500;
  --leaf: #2fa866;       /* right answer */
  --leaf-soft: #dff5e8;
  --coral: #e2614f;      /* delete only */
  --mark: #fff0b3;       /* word highlight in sentences */
  --shadow: 0 3px 0 #c3d3ec;
  --font: 'Andika', 'Comic Neue', 'Trebuchet MS', system-ui, sans-serif;
  --r: 22px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sky: #111b33; --paper: #1c2a4d; --ink: #eef3ff; --ink-soft: #a9b8d9; --line: #2f4170;
    --blue: #5b93f2; --blue-ink: #0d1530; --sun: #ffcf4d; --sun-deep: #ffb300; --leaf: #49c483;
    --leaf-soft: #17402c; --coral: #ff7d6b; --mark: #5a4a10; --shadow: 0 3px 0 #0a1124; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --sky: #111b33; --paper: #1c2a4d; --ink: #eef3ff; --ink-soft: #a9b8d9; --line: #2f4170;
  --blue: #5b93f2; --blue-ink: #0d1530; --sun: #ffcf4d; --sun-deep: #ffb300; --leaf: #49c483;
  --leaf-soft: #17402c; --coral: #ff7d6b; --mark: #5a4a10; --shadow: 0 3px 0 #0a1124; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--sky); color: var(--ink); font-family: var(--font); font-size: 18px; line-height: 1.4;
  -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 4px solid var(--sun); outline-offset: 3px; }

.app {
  height: 100%; max-width: 560px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.screen { min-height: 100%; display: flex; flex-direction: column; gap: 18px; padding-block: 16px 24px; }
.loading { margin: auto; color: var(--ink-soft); }

/* ---------- shared buttons ---------- */
.big-btn {
  min-height: 72px; border: 0; border-radius: var(--r); background: var(--blue); color: var(--blue-ink);
  font-size: 30px; font-weight: 700; padding: 0 28px; box-shadow: 0 5px 0 color-mix(in srgb, var(--blue) 60%, #000);
  transition: transform .08s;
}
.big-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 color-mix(in srgb, var(--blue) 60%, #000); }
.mid-btn {
  min-height: 64px; border: 3px solid var(--line); border-radius: var(--r); background: var(--paper);
  font-size: 24px; font-weight: 700; padding: 0 18px; box-shadow: var(--shadow);
}
.round-btn {
  width: 60px; height: 60px; flex: none; border: 3px solid var(--line); border-radius: 50%;
  background: var(--paper); font-size: 26px; display: grid; place-items: center; box-shadow: var(--shadow);
}
.round-spacer { width: 60px; flex: none; }
.pill-btn {
  min-height: 44px; border: 2px solid var(--line); border-radius: 999px; background: var(--paper);
  padding: 6px 16px; font-size: 16px; font-weight: 700;
}
.pill-btn.primary { background: var(--blue); color: var(--blue-ink); border-color: var(--blue); }
.pill-btn.danger { background: var(--coral); color: #fff; border-color: var(--coral); }

/* ---------- home ---------- */
.home-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { margin: 0; font-size: 34px; letter-spacing: .5px; }
.brand::first-letter { color: var(--blue); }
.speak-chip { width: 60px; height: 60px; border-radius: 50%; border: 3px solid var(--line); background: var(--paper); font-size: 26px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tile {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 8px 16px;
  background: var(--paper); border: 3px solid var(--line); border-radius: 28px; box-shadow: 0 6px 0 var(--line);
  min-height: 180px; justify-content: center;
}
.tile:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--line); }
.tile-icon { font-size: 68px; line-height: 1; }
.tile-name { font-size: 26px; font-weight: 700; overflow-wrap: anywhere; text-align: center; }
.tile-level { font-size: 17px; font-weight: 700; color: var(--ink); background: var(--sun); border-radius: 999px; padding: 2px 12px; }
.empty { margin: auto 0; text-align: center; display: grid; gap: 10px; }
.empty-big { font-size: 30px; font-weight: 700; margin: 0; }
.empty-small { color: var(--ink-soft); margin: 0; }
.home-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gate { position: relative; width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--line); background: var(--paper); font-size: 22px; display: grid; place-items: center; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.gate-ring { position: absolute; inset: -2px; width: calc(100% + 4px); height: calc(100% + 4px); transform: rotate(-90deg); pointer-events: none; }
.gate-ring circle { fill: none; stroke: var(--blue); stroke-width: 4; stroke-dasharray: 120; stroke-dashoffset: 120; }
.gate.holding .gate-ring circle { transition: stroke-dashoffset 3s linear; stroke-dashoffset: 0; }
.gate-hint { font-size: 14px; color: var(--ink-soft); }
.warn { color: var(--coral); font-size: 15px; margin: 0; flex-basis: 100%; }
.ok { color: var(--leaf); font-weight: 700; }

/* ---------- child start ---------- */
.bar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.who-icon { font-size: 40px; }
.who-name { font-size: 28px; font-weight: 700; overflow-wrap: anywhere; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--paper); border: 2px solid var(--line); border-radius: 18px; padding: 10px 6px; display: grid; justify-items: center; }
.stat-n { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-l { font-size: 15px; color: var(--ink-soft); }
.map { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px 4px; }
.stop { display: grid; justify-items: center; gap: 1px; }
.stop-dot {
  width: 100%; max-width: 42px; aspect-ratio: 1; border-radius: 50%; border: 2px dashed var(--line);
  display: grid; place-items: center; font-size: 22px; background: transparent;
}
.stop.done .stop-dot { border: 2px solid var(--sun-deep); background: var(--sun); }
.stop.next .stop-dot { border: 3px solid var(--blue); background: var(--paper); animation: bob 1.6s ease-in-out infinite; }
.stop-lv { font-size: 11px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.today-line { margin: 0; text-align: center; color: var(--ink-soft); font-weight: 700; }
.start-btn { margin-top: auto; min-height: 96px; font-size: 40px; }
@keyframes bob { 50% { transform: translateY(-4px); } }

/* ---------- play ---------- */
.play-top { display: flex; align-items: center; gap: 10px; }
.progress { flex: 1; height: 26px; border-radius: 999px; background: var(--paper); border: 2px solid var(--line); overflow: hidden; }
.progress-fill { height: 100%; background: var(--sun); border-radius: 999px; transition: width .4s ease; }
.progress.full .progress-fill { background: linear-gradient(90deg, var(--sun), var(--sun-deep)); }
.counter { font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 64px; text-align: right; }

.listen { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 32px; }
.speaker {
  width: 120px; height: 120px; border-radius: 50%; border: 0; background: var(--blue); color: var(--blue-ink);
  font-size: 56px; box-shadow: 0 6px 0 color-mix(in srgb, var(--blue) 60%, #000);
}
.speaker:active { transform: translateY(4px); box-shadow: 0 2px 0 color-mix(in srgb, var(--blue) 60%, #000); }
.cards { width: 100%; display: grid; gap: 18px; }
.card {
  min-height: 120px; border-radius: 28px; border: 4px solid var(--line); background: var(--paper);
  font-size: clamp(48px, 15vw, 64px); font-weight: 700; box-shadow: 0 6px 0 var(--line);
  transition: transform .1s, opacity .3s, background .2s;
}
.card:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 var(--line); }
.card:disabled { cursor: default; }
.card.right { background: var(--leaf-soft); border-color: var(--leaf); box-shadow: 0 6px 0 var(--leaf); animation: pop .35s ease; }
.card.dim { opacity: .35; }
@keyframes pop { 40% { transform: scale(1.06); } }

.explore { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.tag { margin: 0; font-weight: 700; padding: 4px 14px; border-radius: 999px; font-size: 17px; }
.new-tag { background: var(--sun); color: #1b2a4a; }
.ok-tag { background: var(--leaf-soft); color: var(--leaf); }
.try-tag { background: var(--paper); color: var(--ink-soft); border: 2px solid var(--line); }
.pic { font-size: 72px; line-height: 1; }
.word-big {
  border: 0; background: none; font-size: clamp(64px, 22vw, 104px); font-weight: 700; line-height: 1.1;
  padding: 8px 16px; border-radius: var(--r); overflow-wrap: anywhere;
}
.word-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: min(100%, 280px); }
.step { height: 18px; border-radius: 999px; background: var(--paper); border: 2px solid var(--line); }
.step.on { background: var(--leaf); border-color: var(--leaf); }
.step.just { animation: fill .5s ease; }
.word-steps.full .step { background: var(--sun); border-color: var(--sun-deep); }
@keyframes fill { from { transform: scaleX(.2); opacity: .3; } }
.explain {
  width: 100%; background: var(--paper); border: 3px solid var(--line); border-radius: var(--r);
  padding: 16px 18px; font-size: 26px; line-height: 1.35;
}
.explain mark { background: var(--mark); color: inherit; font-weight: 700; padding: 0 4px; border-radius: 6px; }
.explore-btns { width: 100%; margin-top: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.explore-btns .next-btn { grid-column: 1 / -1; }
.explore-btns .mid-btn:only-child, .explore-btns > :first-child:nth-last-child(2) { grid-column: auto; }

/* ---------- celebration ---------- */
.celebrate {
  position: fixed; inset: 0; z-index: 10; display: grid; place-items: center;
  background: color-mix(in srgb, var(--sky) 70%, transparent); backdrop-filter: blur(3px);
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.celebrate-card {
  position: relative; width: min(100%, 420px); background: var(--paper); border: 4px solid var(--sun);
  border-radius: 32px; padding: 28px 22px; text-align: center; display: grid; gap: 10px; animation: rise .4s ease;
}
.celebrate-card h2 { margin: 0; font-size: 40px; }
.celebrate-card p { margin: 0 0 8px; font-size: 22px; }
.celebrate-art { font-size: 72px; line-height: 1.1; letter-spacing: 4px; }
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confetti i {
  position: absolute; top: -20px; left: calc(var(--i) * 4.2%); width: 10px; height: 16px; border-radius: 3px;
  background: var(--sun); animation: fall 2.6s linear calc(var(--i) * -0.11s) infinite;
}
.confetti i:nth-child(3n) { background: var(--blue); }
.confetti i:nth-child(3n+1) { background: var(--leaf); }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }
@keyframes rise { from { transform: translateY(30px) scale(.9); opacity: 0; } }

/* ---------- parent ---------- */
.parent { gap: 14px; font-size: 16px; }
.parent-head { display: flex; align-items: center; justify-content: space-between; }
.parent-head h1 { margin: 0; font-size: 26px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { flex: none; min-height: 44px; border: 2px solid var(--line); background: transparent; border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 16px; }
.tab.on { background: var(--ink); color: var(--sky); border-color: var(--ink); }
.parent-body { display: grid; gap: 14px; }
.panel { background: var(--paper); border: 2px solid var(--line); border-radius: 18px; padding: 16px; display: grid; gap: 10px; min-width: 0; }
.panel h2 { margin: 0; font-size: 20px; }
.note { margin: 0; color: var(--ink-soft); font-size: 15px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 44px; border: 2px solid var(--line); background: var(--paper); border-radius: 999px; padding: 4px 14px; font-weight: 700; }
.chip.on { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 15%, var(--paper)); }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kpi { display: grid; }
.kpi-n { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-l { font-size: 14px; color: var(--ink-soft); }
.boxes { display: grid; gap: 6px; }
.box-row { display: grid; grid-template-columns: 80px 1fr 40px; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.box-l { font-size: 14px; color: var(--ink-soft); }
.box-bar { height: 14px; background: var(--sky); border-radius: 999px; overflow: hidden; }
.box-bar span { display: block; height: 100%; background: var(--sun); border-radius: 999px; }
.box-row.known .box-bar span { background: var(--leaf); }
.box-n { text-align: right; font-weight: 700; }
.word-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.word-chips li { border: 2px solid var(--line); border-radius: 999px; padding: 2px 4px 2px 12px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.word-chips li:not(:has(button)) { padding-right: 12px; }
.word-chips small { font-weight: 400; color: var(--ink-soft); }
.x-btn { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--sky); font-size: 18px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: 15px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--ink-soft); font-weight: 700; }
.child-list, .lookup { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.child-list li, .lookup li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
.cl-icon { font-size: 34px; }
.cl-main { flex: 1; min-width: 0; display: grid; }
.cl-main small, .lookup small { color: var(--ink-soft); }
.cl-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.child-list { gap: 0; }
.child-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 12px; padding-block: 12px; border-bottom: 1px solid var(--line); }
.child-list .cl-btns, .reset-note { grid-column: 1 / -1; }
.reset-note { color: var(--coral); }
.child-form label, .inline-form label, .label { font-weight: 700; font-size: 15px; }
.child-form input[type="text"], .child-form #cf-name, .inline-form input, textarea {
  width: 100%; min-height: 48px; border: 2px solid var(--line); border-radius: 12px; padding: 8px 12px; background: var(--sky);
}
.inline-form { display: grid; gap: 6px; }
.inline-form .pill-btn { justify-self: start; margin-top: 4px; }
.icon-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.icon-opt { aspect-ratio: 1; border: 2px solid var(--line); border-radius: 14px; background: var(--sky); font-size: 28px; padding: 0; }
.icon-opt.on { border: 3px solid var(--blue); background: color-mix(in srgb, var(--blue) 18%, var(--paper)); }
.stepper { display: grid; gap: 4px; }
.stepper-ctl { display: flex; align-items: center; gap: 8px; }
.stepper input { width: 80px; min-height: 48px; text-align: center; border: 2px solid var(--line); border-radius: 12px; background: var(--sky); font-weight: 700; font-size: 20px; }
.step-btn { width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--line); background: var(--paper); font-size: 24px; font-weight: 700; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.switch { display: flex; align-items: center; gap: 10px; font-weight: 700; min-height: 44px; }
.switch input { width: 24px; height: 24px; }
.seg { display: flex; gap: 6px; }
.seg-btn { min-height: 44px; flex: 1; border: 2px solid var(--line); border-radius: 12px; background: var(--paper); font-weight: 700; text-transform: capitalize; }
.seg-btn.on { background: var(--blue); color: var(--blue-ink); border-color: var(--blue); }
.file-btn { position: relative; display: inline-flex; align-items: center; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.about p { margin: 0; }

/* ---------- print (flashcards) ---------- */
.print-only { display: none; }
@media print {
  body { background: #fff; }
  .app > *:not(.screen), .screen > *:not(.parent-body), .parent-body > *:not(#print-area) { display: none !important; }
  #print-area { display: grid !important; grid-template-columns: 1fr 1fr; gap: 0; }
  .flash { border: 2px dashed #999; height: 3.2in; display: grid; place-items: center; font: 700 72px var(--font); color: #000; break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .confetti { display: none; }
}
@media (max-height: 640px) {
  .speaker { width: 96px; height: 96px; font-size: 44px; }
  .card { min-height: 96px; }
  .listen { gap: 20px; }
}

/* ---------- reward games ---------- */
.game-btn { animation: bob 1.4s ease-in-out infinite; border-color: var(--sun-deep); background: var(--sun); }
.game-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.game-tile {
  min-height: 120px; border: 3px solid var(--line); border-radius: var(--r); background: var(--sky);
  display: grid; place-items: center; gap: 2px; font-size: 22px; font-weight: 700; box-shadow: var(--shadow);
}
.game-tile span { font-size: 48px; line-height: 1; }
.switch-menu { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.switch-menu[hidden] { display: none; }
.switch-menu span { font-size: 22px; }
.shell-stage { --swap: 500ms; position: relative; flex: 1; min-height: 260px; max-height: 60vh; border-radius: var(--r); background: linear-gradient(#bfe6ff, #f6e7c8 62%, #ecd3a4); border: 3px solid var(--line); overflow: hidden; }
.shell { position: absolute; bottom: 18%; left: calc(var(--slot) * 33.333% + 16.667%); width: 30%; height: 46%; transform: translateX(-50%);
  border: 0; background: none; padding: 0; cursor: pointer; transition: left var(--swap) ease-in-out; -webkit-tap-highlight-color: transparent; }
.shell-cup { position: absolute; inset: 0; display: grid; place-items: end center; font-size: clamp(64px, 20vw, 110px); line-height: 1; transition: transform .35s ease-out; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .12)); }
.shell-gem { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); font-size: clamp(30px, 9vw, 48px); opacity: 0; transition: opacity .2s; }
.shell.lifted .shell-cup { transform: translateY(-58%); }
.shell.lifted.has-gem .shell-gem { opacity: 1; }
.shell.wrong .shell-cup { filter: drop-shadow(0 0 10px rgba(229, 80, 57, .7)); }
.shell.right .shell-cup { filter: drop-shadow(0 0 12px rgba(255, 210, 63, .95)); }
.shell.arc-up { animation: shell-up var(--swap) ease-in-out; }
.shell.arc-down { animation: shell-down var(--swap) ease-in-out; }
@keyframes shell-up { 50% { transform: translateX(-50%) translateY(-22%) scale(.92); } }
@keyframes shell-down { 50% { transform: translateX(-50%) translateY(12%) scale(1.06); } }
.game-frame { flex: 1; width: 100%; min-height: 72vh; border: 3px solid var(--line); border-radius: var(--r); background: #fff; }
.game { position: relative; gap: 12px; }
.game-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.switch-btn { min-height: 56px; font-size: 18px; padding: 6px 16px; white-space: nowrap; }
.switch-btn span { font-size: 24px; }
.game-timer { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--paper); border: 2px solid var(--line); border-radius: 999px; padding: 4px 14px; }
.game-area { flex: 1; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.game-hint, .game-score { margin: 0; text-align: center; font-size: 22px; font-weight: 700; }
.game-end { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: color-mix(in srgb, var(--sky) 75%, transparent); backdrop-filter: blur(3px); }
.game-next { color: var(--ink-soft); font-size: 18px !important; }

.match-grid { flex: 1; display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); grid-template-rows: repeat(var(--rows, 4), minmax(60px, 1fr)); gap: 8px; max-height: 72vh; }
.mcard { border: 0; padding: 0; background: none; perspective: 600px; min-height: 60px; }
.mcard-inner { position: relative; display: block; width: 100%; height: 100%; transition: transform .35s; transform-style: preserve-3d; }
.mcard.up .mcard-inner { transform: rotateY(180deg); }
.mcard-back, .mcard-front { position: absolute; inset: 0; border-radius: 18px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: grid; place-items: center; }
.mcard-back {
  background: var(--blue); border: 3px solid color-mix(in srgb, var(--blue) 70%, #000);
  background-image: radial-gradient(circle at 50% 50%, var(--sun) 0 14%, transparent 15%);
  background-size: 34px 34px;
}
.mcard-front { transform: rotateY(180deg); background: var(--paper); border: 3px solid var(--line); font-size: clamp(30px, calc(46px - (var(--rows, 4) - 4) * 6px), 46px); }
.mcard.done .mcard-front { border-color: var(--leaf); background: var(--leaf-soft); }

.pong-score { display: flex; justify-content: space-between; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pong-score b { font-size: 30px; }
.pong-wrap { position: relative; flex: 1; min-height: 360px; touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; }
.pong-wrap canvas { position: absolute; inset: 0; display: block; }
.pong-msg { margin: 0; min-height: 1.4em; text-align: center; font-weight: 700; font-size: 20px; }
.game-area { position: relative; }
.board-done {
  position: absolute; inset: 30% 8% auto; z-index: 3; display: grid; justify-items: center; gap: 4px;
  background: var(--paper); border: 4px solid var(--sun); border-radius: 28px; padding: 22px 16px;
  font-size: 28px; font-weight: 700; text-align: center; animation: rise .35s ease;
}
.board-done span { font-size: 56px; line-height: 1; }
.board-done small { font-size: 20px; color: var(--ink-soft); }
