/* calibri-font: the book's font (Calibri, sent by the user) */
@font-face { font-family: "Calibri Book"; src: url("fonts/calibri-regular.woff2") format("woff2"); font-weight: 100 549; font-style: normal; font-display: swap; size-adjust: 114%; }
@font-face { font-family: "Calibri Book"; src: url("fonts/calibri-bold.woff2") format("woff2"); font-weight: 550 950; font-style: normal; font-display: swap; size-adjust: 114%; }
/* مصباح المعرفة — interactive book styles (from book 2; book-3 additions at the end).
   Layout: one centered column like a workbook page; sky band on top, exercises stacked with dashed rules between them.
   Single deliberate light look that follows the printed book's colors. */
:root {
  color-scheme: light;
  --sky: #8fd6f5;
  --sky-deep: #12a3e3;
  --paper: #ffffff;
  --page: #f3f9fd;
  --ink: #1d2a44;
  --ink-soft: #5b6b85;
  --red: #e3262e;
  --sun: #ffd23f;
  --ok: #1e9e58;
  --ok-soft: #dff5e8;
  --bad: #d63a3a;
  --line: #d6e3ee;
  --font: "Calibri Book", Calibri, Arial, sans-serif;
  --round: "Calibri Book", Calibri, Arial, sans-serif;
  --step--1: 0.95rem;
  --step-0: 1.15rem;
  --step-1: 1.4rem;
  --step-2: 1.9rem;
  --step-4: clamp(3rem, 10vw, 4.6rem);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { background: var(--page); color: var(--ink); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.7;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sky-deep); outline-offset: 3px; }

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- Top band ---------- */
.band { background: linear-gradient(180deg, var(--sky) 0%, var(--page) 100%); }
.band .wrap { padding-block: 18px 28px; display: grid; gap: 18px; }
.topnav { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: var(--step--1); }
.topnav a { color: var(--ink); text-decoration: none; font-weight: 600; background: rgba(255,255,255,.7); padding: 6px 14px; border-radius: 999px; }
.stars { display: flex; flex-wrap: wrap; gap: 4px; font-size: 1.4rem; line-height: 1; letter-spacing: 2px; min-width: 0; max-width: 100%; }
@media (max-width: 480px) { .stars { font-size: 1.1rem; gap: 2px; letter-spacing: 0; } }
.stars span { color: #c9d6e2; transition: color .3s, transform .3s; }
.stars span.on { color: var(--sun); transform: scale(1.15); text-shadow: 0 1px 0 #c79a00; }

.hero { display: flex; align-items: center; gap: 22px; }
.hero .tile {
  flex: none; width: 104px; height: 104px; display: grid; place-items: center;
  background: var(--paper); border-radius: 6px; box-shadow: 10px 10px 0 #fde7d3, -8px -8px 0 #bfe6fa;
  font-size: 4.2rem; font-weight: 800; color: var(--red); line-height: 1;
}
.hero h1 { margin: 0; font-size: var(--step-4); font-weight: 800; color: var(--red); line-height: 1.1; }
.hero p { margin: 0; color: var(--ink-soft); font-size: var(--step--1); }

/* ---------- Exercises ---------- */
main.wrap { padding-block: 8px 40px; display: grid; gap: 0; grid-template-columns: minmax(0, 1fr); }
.ex > *, .ex-body > * { min-width: 0; }
.ex { grid-template-columns: minmax(0, 1fr); padding-block: 26px; border-bottom: 2px dashed var(--line); display: grid; gap: 16px; }
.ex:last-child { border-bottom: 0; }
.ex-head { display: flex; align-items: flex-start; gap: 12px; }
.num {
  flex: none; width: 1.7em; height: 1.7em; display: grid; place-items: center;
  background: var(--red); color: #fff; font-weight: 800; font-size: var(--step--1); border-radius: 4px; margin-top: .25em;
}
.ex-head h2 { margin: 0; font-size: var(--step-1); font-weight: 700; text-wrap: balance; flex: 1; min-width: 0; }
.ex-head .hint { display: block; font-size: var(--step--1); font-weight: 400; color: var(--ink-soft); margin-top: 2px; }
.ex-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn {
  border: 2px solid var(--line); background: var(--paper); border-radius: 999px; padding: 4px 16px;
  cursor: pointer; font-size: var(--step--1); font-weight: 600;
}
.btn:hover { border-color: var(--sky-deep); }
.btn.primary { background: var(--sky-deep); border-color: var(--sky-deep); color: #fff; }
.done-msg { display: none; color: var(--ok); font-weight: 700; }
.ex.done .done-msg { display: inline; }
.ex.done .num { background: var(--ok); }
.counter { font-size: var(--step--1); color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* shake for wrong answers */
@keyframes shake { 0%,100% { transform: translateX(0) } 25% { transform: translateX(-6px) } 75% { transform: translateX(6px) } }
.wrong { animation: shake .35s; }
@keyframes pop { 0% { transform: scale(1) } 50% { transform: scale(1.08) } 100% { transform: scale(1) } }
.pop { animation: pop .35s; }
@media (prefers-reduced-motion: reduce) { .wrong, .pop { animation: none; } }

/* ---------- Listening ---------- */
.player {
  display: flex; align-items: center; gap: 14px; background: var(--paper); border: 2px solid var(--line);
  border-radius: 999px; padding: 8px 18px 8px 8px; max-width: 520px;
}
.player .play {
  flex: none; width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--red); color: #fff; display: grid; place-items: center;
}
.player .play svg { width: 22px; height: 22px; fill: currentColor; }
.player .bar { flex: 1; min-width: 0; height: 10px; background: var(--line); border-radius: 999px; cursor: pointer; position: relative; direction: ltr; transform: scaleX(-1); }
.player .bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--sky-deep); border-radius: 999px; }
.player .time { font-size: var(--step--1); color: var(--ink-soft); font-variant-numeric: tabular-nums; direction: ltr; }

.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.card {
  background: var(--paper); border: 2px solid var(--ink); border-radius: 4px; padding: 10px 8px 6px;
  display: grid; gap: 4px; justify-items: center; cursor: pointer; transition: border-color .2s, background .2s;
}
.card img { height: 110px; width: 100%; object-fit: contain; }
.card b { font-size: var(--step-2); font-weight: 800; line-height: 1.3; }
.card.seen { border-color: var(--sky-deep); background: #eef8fe; }

/* ---------- Connect ---------- */
.connect { position: relative; display: grid; gap: 70px; justify-items: center; padding-top: 6px; user-select: none; -webkit-user-select: none; }
.connect svg.lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.connect .big {
  font-size: 5rem; font-weight: 900; color: var(--ink); line-height: 1; width: 110px; height: 110px;
  display: grid; place-items: center; border-radius: 50%; background: var(--paper); border: 3px dashed var(--sky-deep);
  cursor: grab; touch-action: none; position: relative; z-index: 1;
}
.connect .row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; width: 100%; }
.cn-item { display: grid; justify-items: center; gap: 4px; cursor: pointer; padding: 8px; border-radius: var(--radius); border: 2px solid transparent; background: var(--paper); position: relative; z-index: 1; }
.cn-item img { height: 90px; width: 100%; object-fit: contain; mix-blend-mode: multiply; }
.cn-item b { font-size: var(--step-1); }
.cn-item.ok { border-color: var(--ok); background: var(--ok-soft); }

/* ---------- Train ---------- */
.train { display: flex; align-items: flex-end; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
.wagon {
  flex: none; width: 66px; height: 70px; border: 3px solid #4d5868; border-radius: 6px 6px 2px 2px; background: var(--paper);
  display: grid; place-items: center; font-size: 2rem; font-weight: 800; cursor: pointer; position: relative; margin-bottom: 16px;
  transition: background .25s;
}
.wagon::before, .wagon::after { content: ""; position: absolute; bottom: -18px; width: 18px; height: 18px; border-radius: 50%; background: #23324a; border: 3px solid #9fb3c8; }
.wagon::before { right: 8px; } .wagon::after { left: 8px; }
.wagon.ok { background: var(--sun); }
.train img.loco { flex: none; width: 140px; height: auto; mix-blend-mode: multiply; }

/* ---------- Coloring ---------- */
.palette { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--paper); box-shadow: 0 0 0 2px var(--line); cursor: pointer; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--ink); }
.color-panel { background: var(--sky-deep); border-radius: 28px; padding: 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.cp-item { display: grid; gap: 6px; justify-items: center; cursor: pointer; background: none; border: 0; padding: 0; }
.cp-item .circle { width: 100%; aspect-ratio: 1; max-width: 160px; border-radius: 50%; overflow: hidden; background: #fff; transition: background .3s; border: 3px solid #0d4f74; }
.cp-item .circle img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }
.cp-item b { color: #fff; font-size: var(--step-1); font-weight: 800; }

/* ---------- Letter grid ---------- */
.grid-wrap { overflow-x: auto; }
table.letters { border-collapse: collapse; margin-inline: auto; }
table.letters td { border: 1.5px solid #7f8ea3; width: 50px; height: 44px; text-align: center; font-size: 1.5rem; font-weight: 700; cursor: pointer; position: relative; padding: 0; }
table.letters tr td:nth-child(even) { background: #eef7fd; }
table.letters td.ok::after { content: ""; position: absolute; inset: 3px 6px; border: 3px solid var(--red); border-radius: 50%; }

/* ---------- Tracing ---------- */
.trace-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.trace-row .model { height: 90px; width: auto; flex: none; }
.trace-row .label { width: 100%; font-size: var(--step--1); color: var(--ink-soft); }
.trace-box { position: relative; width: auto; height: 110px; aspect-ratio: 53 / 56; max-width: 100%; border: 2px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.trace-box img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .9; }
.trace-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }

/* ---------- Footer nav ---------- */
.footnav { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 10px 30px; }
.footnav a, .footnav span { font-weight: 700; text-decoration: none; color: var(--sky-deep); }
.footnav span { color: var(--ink-soft); font-weight: 400; }
.pagenum { display: inline-grid; place-items: center; min-width: 2em; height: 2em; background: var(--red); color: var(--sun); font-weight: 800; padding-inline: 6px; }

/* ---------- Table of contents ---------- */
.toc { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; padding-block: 24px 40px; }
.toc a, .toc div {
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); padding: 14px 10px; text-decoration: none; color: var(--ink);
  display: grid; justify-items: center; gap: 2px;
}
.toc a:hover { border-color: var(--sky-deep); }
.toc .l { font-size: 2.6rem; font-weight: 800; color: var(--red); line-height: 1.1; }
.toc .n { font-size: var(--step--1); font-weight: 600; }
.toc .s { font-size: .8rem; color: var(--ink-soft); }
.toc div { opacity: .55; }

@media (max-width: 640px) {
  .cards, .connect .row, .color-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .connect { gap: 50px; }
  .hero .tile { width: 80px; height: 80px; font-size: 3.2rem; }
  .card img { height: 90px; }
  table.letters td { width: 40px; height: 40px; font-size: 1.3rem; }
  .trace-box { height: 90px; }
}

/* ---------- Write (fill in) ---------- */
.bank { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border: 2px solid var(--sky-deep); border-radius: 6px; padding: 8px 12px; background: var(--paper); }
.bank b { color: var(--red); }
.chip { border: 2px solid var(--line); background: var(--paper); border-radius: 999px; padding: 2px 14px; cursor: pointer; font-size: var(--step-0); font-weight: 600; }
.chip.big { font-size: var(--step-1); padding: 6px 18px; }
.chip.ok, .card.ok { border-color: var(--ok); background: var(--ok-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.w-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.w-grid.pics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.w-item { display: grid; gap: 6px; justify-items: center; background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); padding: 10px; }
.w-item img { height: 100px; width: 100%; object-fit: contain; mix-blend-mode: multiply; }
.w-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px; font-size: var(--step-1); font-weight: 700; justify-content: center; }
.w-line input { font: inherit; text-align: center; border: 0; border-bottom: 3px solid var(--sky-deep); background: #eef8fe; border-radius: 6px 6px 0 0; padding: 0 4px; min-width: 1.6em; max-width: 100%; color: var(--ink); }
.w-line input.ok { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.w-line input.bad { border-color: var(--bad); background: #fde8e8; }

/* ---------- Letters in words ---------- */
.l-words { display: flex; flex-wrap: wrap; gap: 14px 28px; font-size: 2.2rem; font-weight: 800; line-height: 1.6; justify-content: center; }
.l-word { white-space: nowrap; }
.l-ch { cursor: pointer; border-radius: 10px; padding: 0 1px; display: inline-block; }
.l-ch:hover { background: #eef8fe; }
.l-ch.ok { color: var(--red); box-shadow: inset 0 0 0 3px var(--red); border-radius: 50%; }

/* ---------- Match ---------- */
.match { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 18% ; }
.match svg.lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.m-col { display: grid; gap: 10px; align-content: start; }
.m-item { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); padding: 8px; cursor: pointer; font-size: var(--step-1); min-height: 56px; position: relative; z-index: 1; }
.m-item img { height: 64px; width: auto; max-width: 70%; object-fit: contain; mix-blend-mode: multiply; }
.m-item.sel { border-color: var(--sky-deep); background: #eef8fe; }
.m-item.ok { border-color: var(--ok); background: var(--ok-soft); }

/* ---------- Read ---------- */
.read { display: grid; gap: 14px; }
.read img { max-height: 260px; width: auto; margin-inline: auto; }
.read-text { background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); padding: 14px 20px; font-size: var(--step-1); line-height: 2; }
.read-text p { margin: 0; }

/* ---------- Sheet (page area with pen) ---------- */
.palette.pen { align-items: center; }
.palette.pen .btn[aria-pressed="true"] { border-color: var(--ink); }
.sheet { position: relative; width: 100%; max-width: 100%; border: 2px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.sheet img { position: absolute; inset: 0; width: 100%; height: 100%; }
.sheet canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
@media (max-width: 640px) {
  .w-grid.pics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .l-words { font-size: 1.8rem; }
  .match { gap: 12%; }
}
.pick-groups { display: grid; gap: 14px; }
.pick-row { display: flex; align-items: center; gap: 14px; }
.pick-row .cards { flex: 1; min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pick-letter { flex: none; width: 72px; height: 72px; border-radius: 50%; border: 5px solid var(--sky-deep); display: grid; place-items: center; font-size: 2.4rem; font-weight: 800; color: var(--red); background: var(--paper); }
.tf { display: grid; gap: 10px; }
.tf-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); padding: 8px 12px; }
.tf-row.ok { border-color: var(--ok); }
.tf-text { flex: 1; min-width: 12em; font-size: var(--step-1); font-weight: 600; }
.chip.sel { border-color: var(--sky-deep); background: #eef8fe; }
.bins { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 12px; }
.bin { display: grid; align-content: start; gap: 8px; min-height: 140px; background: #fff8d6; border: 2px dashed #e8c94a; border-radius: var(--radius); padding: 10px; cursor: pointer; text-align: center; }
.bin > b { font-size: var(--step-1); }
.bin-list { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }

/* order: build a sentence */
.order { display: grid; gap: 14px; }
.o-row { display: grid; gap: 8px; background: #f6fbff; border: 2px solid #d7ecfa; border-radius: var(--radius); padding: 10px; }
.o-row.ok { border-color: var(--ok); background: #effaf3; }
.o-line { min-height: 52px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border-bottom: 2px dashed #b9dcf3; padding-bottom: 8px; }
.o-line .chip { cursor: default; }
.o-dot { font-size: var(--step-1); font-weight: 800; }

/* dict: Hebrew–Arabic list */
.dict { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 8px; }
.d-row { display: grid; grid-template-columns: 1fr 1fr; border: 1.5px solid #b9dcf3; border-radius: 12px; overflow: hidden; background: #fff; }
.d-he, .d-ar { display: grid; place-items: center; padding: 4px; min-height: 52px; }
.d-he { background: #e6f5fd; }
.d-ar { background: #fbf5ec; border: 0; border-inline-start: 1.5px solid #b9dcf3; cursor: pointer; font: inherit; }
.d-he img, .d-ar img { max-width: 100%; height: auto; max-height: 64px; }
.dict.quiz .d-ar img { filter: blur(9px); opacity: .35; transition: filter .2s, opacity .2s; }
.dict.quiz .d-ar.show img { filter: none; opacity: 1; }

/* drag & drop from the word bank */
.bank { position: sticky; top: 8px; z-index: 5; box-shadow: 0 6px 14px rgba(13,79,116,.12); }
.bank .chip { touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.bank .chip.used { opacity: .45; }
.chip.dragging { opacity: .35; }
.chip.ghost { position: fixed; z-index: 90; pointer-events: none; transform: translate(-50%, -60%) scale(1.08); box-shadow: 0 8px 18px rgba(0,0,0,.2); border-color: var(--sky-deep); background: #fff; cursor: grabbing; }
.w-line input.slot { cursor: pointer; caret-color: transparent; }
.drop-over, .w-line input.drop-over { outline: 3px dashed var(--sky-deep); outline-offset: 2px; background: #dff2fd; }
body.picking .w-line input.slot:not([disabled]), body.picking .bin { outline: 2px dashed #9fd3f2; outline-offset: 2px; }
.bins .chip { touch-action: auto; }

/* one question per line */
.w-grid:not(.pics) { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.w-grid:not(.pics) .w-item { justify-items: start; padding: 10px 14px; }
.w-grid:not(.pics) .w-line { justify-content: flex-start; row-gap: 8px; }

/* digital board */
.draw-page { position: absolute; top: 0; left: 0; z-index: 40; pointer-events: none; touch-action: none; }
body.drawing .draw-page { pointer-events: auto; cursor: crosshair; }
.draw-white { position: fixed; inset: 0; z-index: 50; background: #fff; background-image: linear-gradient(#e6f0f7 1px, transparent 1px); background-size: 100% 44px; }
.draw-white canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.draw-fab { position: fixed; z-index: 70; inset-block-end: 16px; inset-inline-start: 16px; width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--red); color: #fff; box-shadow: 0 6px 16px rgba(0,0,0,.25); cursor: pointer; display: grid; place-items: center; }
.draw-fab svg { width: 28px; height: 28px; fill: currentColor; }
.draw-fab[aria-pressed="true"] { background: var(--sky-deep); }
.draw-bar { position: fixed; z-index: 65; inset-block-end: 16px; inset-inline: 86px 16px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 8px 10px; box-shadow: 0 8px 22px rgba(0,0,0,.18); max-width: 720px; }
.draw-bar[hidden], .draw-white[hidden] { display: none; }
.draw-bar .swatch { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line); cursor: pointer; }
.draw-bar .swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--ink); }
.draw-bar .btn { padding: 4px 12px; }
.draw-bar .btn[aria-pressed="true"] { background: var(--sky-deep); color: #fff; border-color: var(--sky-deep); }
@media (max-width: 480px) { .draw-bar { inset-inline: 10px; inset-block-end: 84px; } .draw-fab { inset-inline-start: 12px; } }
@media print { .draw-fab, .draw-bar { display: none; } }
.footnav { margin-bottom: 84px; }

/* typing places over a page image */
.sheet.type .t-slot { position: absolute; box-sizing: border-box; margin: 0; padding: 0 .3em; border: 2px dashed #7cc4ee; border-radius: 6px; background: rgba(238, 248, 254, .72);
  font-family: inherit; font-weight: 700; color: #1572c4; text-align: right; line-height: 1; min-height: 0; }
.sheet.type .t-slot:focus { outline: 3px solid var(--sky-deep); outline-offset: 0; background: rgba(255, 255, 255, .92); }
.sheet.type .t-slot.ok { border-style: solid; border-color: var(--ok); background: rgba(225, 247, 234, .85); color: var(--ok); }
.sheet.type .t-slot.bad { border-color: var(--bad); background: rgba(253, 232, 232, .85); }
.sheet.type .t-slot.center { text-align: center; padding: 0; }
.sheet.type .t-slot.given { border: 2px solid #8a94a6; background: #fff; color: #1d2a44; -webkit-text-fill-color: #1d2a44; opacity: 1; }

/* ---------- section labels for videos and games ---------- */
.ex.video .num, .ex.game .num { background: var(--sun); color: var(--ink); }

/* ---------- video player ---------- */
.v-player { position: relative; border-radius: 18px; overflow: hidden; background: linear-gradient(160deg, #e9f7ff, #fff8dc); border: 3px solid #0d4f74; box-shadow: 0 8px 22px rgba(13,79,116,.15); }
.v-stage { aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden; }
.v-scene { display: grid; place-items: center; gap: 10px; text-align: center; animation: vIn .6s ease both; width: 100%; height: 100%; align-content: center; }
@keyframes vIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
.v-tile { font-size: clamp(5rem, 22vw, 11rem); font-weight: 900; color: var(--red); line-height: 1; text-shadow: 0 6px 0 rgba(13,79,116,.15); animation: vPop .9s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes vPop { from { transform: scale(.2) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
.v-cap { font-size: clamp(1.2rem, 4vw, 2rem); font-weight: 800; color: #0d4f74; animation: vIn .6s .5s ease both; }
.v-cap.big { font-size: clamp(1.4rem, 5vw, 2.6rem); padding: 0 6%; line-height: 1.5; }
.v-draw { width: min(52%, 280px); height: auto; overflow: visible; }
.v-stroke { font-family: "Calibri Book", Calibri, Arial, sans-serif; font-weight: 900; font-size: 170px; fill: transparent; stroke: var(--sky-deep); stroke-width: 3; stroke-dasharray: 900; stroke-dashoffset: 900;
  animation: vDraw 2.2s ease forwards, vFill .8s 2.1s ease forwards; }
@keyframes vDraw { to { stroke-dashoffset: 0; } }
@keyframes vFill { to { fill: var(--red); stroke: #9b1117; } }
.v-img { max-height: 52%; max-width: 60%; object-fit: contain; mix-blend-mode: multiply; animation: vPop .8s cubic-bezier(.2,1.5,.4,1) both; }
.v-word { font-size: clamp(2rem, 8vw, 4.2rem); font-weight: 900; color: #1d2a44; direction: rtl; }
.v-word span { display: inline-block; opacity: 0; animation: vLetter .4s ease forwards; }
.v-word span.hit { color: var(--red); }
.v-word span.hit { animation: vLetter .4s ease forwards, vHit .7s 2.2s ease 2; }
@keyframes vLetter { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: none; } }
@keyframes vHit { 50% { transform: scale(1.35); } }
.v-mx { display: flex; align-items: center; justify-content: center; gap: 4%; width: 100%; direction: rtl; }
.v-mx > div { display: grid; justify-items: center; gap: 6px; }
.v-mx img { height: clamp(70px, 20vw, 170px); width: auto; mix-blend-mode: multiply; }
.v-mx b { font-size: clamp(1.6rem, 6vw, 3.2rem); font-weight: 900; }
.m-from { animation: vIn .6s both; }
.m-plus { font-size: clamp(1.6rem, 6vw, 3rem); font-weight: 900; color: var(--red); animation: vPop .7s 1s both; }
.m-to { animation: vPop .8s 2s both; }
.m-to b { color: #8a4fd8; }
.v-big { position: absolute; inset: 0; margin: auto; width: 86px; height: 86px; border-radius: 50%; border: 0; background: var(--red); color: #fff; box-shadow: 0 8px 20px rgba(0,0,0,.25); cursor: pointer; display: grid; place-items: center; }
.v-big[hidden] { display: none; }
.v-big svg { width: 44px; height: 44px; fill: currentColor; }
.v-ctrl { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: rgba(255,255,255,.85); border-top: 2px solid #cfe6f5; }
.v-ctrl .bar { flex: 1; }
.v-dots { display: flex; gap: 4px; }
.v-dots button { width: 10px; height: 10px; border-radius: 50%; border: 0; background: #b9dcf3; padding: 0; cursor: pointer; }
.v-dots button.on { background: var(--sky-deep); }
@media (max-width: 480px) { .v-dots { display: none; } .v-big { width: 64px; height: 64px; } }

/* ---------- balloon game ---------- */
.bl-hud { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: var(--step-1); font-weight: 700; }
.bl-target { font-size: 2rem; color: var(--red); }
.bl-score { margin-inline-start: auto; background: var(--sun); border-radius: 999px; padding: 2px 14px; }
.bl-field { position: relative; height: 380px; border-radius: 18px; overflow: hidden; background: linear-gradient(#bfe7ff, #f2fbff 70%, #d8f3c8); border: 3px solid #0d4f74; display: grid; place-items: center; touch-action: manipulation; }
.balloon { position: absolute; bottom: -110px; width: 70px; height: 86px; border-radius: 50% 50% 46% 46%; border: 0; color: #fff; font: 900 2.1rem/1 "Noto Naskh Arabic", sans-serif; text-shadow: 0 2px 0 rgba(0,0,0,.25);
  box-shadow: inset -8px -10px 0 rgba(0,0,0,.12); cursor: pointer; animation: rise linear forwards; }
.balloon::after { content: ""; position: absolute; left: 50%; top: 100%; width: 2px; height: 34px; background: #6a7b8c; }
@keyframes rise { to { transform: translateY(-520px); } }
.balloon.pop { animation: popB .3s ease forwards !important; }
@keyframes popB { to { transform: scale(1.8); opacity: 0; } }
.bl-win { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.4rem; font-weight: 900; color: var(--ok); background: rgba(255,255,255,.75); }

/* ---------- memory game ---------- */
.mem { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .mem { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mem-card { aspect-ratio: 3 / 4; border: 0; padding: 0; background: none; perspective: 700px; cursor: pointer; }
.mem-in { position: relative; width: 100%; height: 100%; transition: transform .45s; transform-style: preserve-3d; }
.mem-card.flip .mem-in { transform: rotateY(180deg); }
.mem-back, .mem-front { position: absolute; inset: 0; border-radius: 14px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: grid; place-items: center; }
.mem-back { background: repeating-linear-gradient(45deg, #12a3e3 0 12px, #0f93cf 12px 24px); color: #fff; font-size: 2.4rem; font-weight: 900; border: 3px solid #0d4f74; }
.mem-front { transform: rotateY(180deg); background: #fff; border: 3px solid #0d4f74; padding: 6px; gap: 4px; align-content: center; }
.mem-front img { max-width: 100%; max-height: 74%; object-fit: contain; }
.mem-front.pic img { max-height: 92%; }
.mem-front b { font-size: clamp(1rem, 3.4vw, 1.5rem); font-weight: 800; text-align: center; line-height: 1.2; }
.mem-card.ok .mem-front { border-color: var(--ok); background: var(--ok-soft); }
.mem-info { font-weight: 700; color: var(--ok); }

/* ---------- spelling game ---------- */
.sp-count { font-weight: 800; color: #0d4f74; }
.sp { display: grid; justify-items: center; gap: 14px; background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); padding: 14px; }
.sp-img { height: 150px; width: auto; max-width: 100%; object-fit: contain; mix-blend-mode: multiply; }
.sp-slots { display: flex; gap: 6px; direction: rtl; }
.sp-slot { width: 52px; height: 58px; border-bottom: 4px solid var(--sky-deep); background: #eef8fe; border-radius: 8px 8px 0 0; display: grid; place-items: center; font-size: 2rem; font-weight: 900; }
.sp-slot.ok { color: var(--ok); }
.sp-slots.ok .sp-slot { border-color: var(--ok); background: var(--ok-soft); }
.sp-word { font-size: 1.8rem; font-weight: 900; color: var(--ok); }
.sp-tiles { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.sp-tile { min-width: 54px; font-size: 1.8rem; font-weight: 900; }
.sp-tile.used { opacity: .3; }
@media (max-width: 480px) { .sp-slot { width: 40px; height: 48px; font-size: 1.6rem; } }
.v-ctrl .play { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--red); color: #fff; display: grid; place-items: center; cursor: pointer; }
.v-ctrl .play svg { width: 22px; height: 22px; fill: currentColor; }
.v-ctrl .bar { flex: 1; min-width: 0; height: 10px; background: var(--line); border-radius: 999px; position: relative; direction: ltr; transform: scaleX(-1); }
.v-ctrl .bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--sky-deep); border-radius: 999px; }
.draw-fab { inset-inline-start: auto; inset-inline-end: 16px; }
.draw-bar { inset-inline: 16px 86px; }
@media (max-width: 480px) { .draw-fab { inset-inline-end: 12px; } .draw-bar { inset-inline: 10px; } }

/* ---------- always-visible bar: back to the table of contents ---------- */
.quickbar { position: sticky; top: 0; z-index: 60; background: rgba(255,255,255,.96); border-bottom: 2px solid #cfe6f5; box-shadow: 0 3px 10px rgba(13,79,116,.08); }
.qb-in { display: flex; align-items: center; gap: 10px; padding-block: 6px; }
.qb-home { background: var(--sky-deep); color: #fff; text-decoration: none; font-weight: 800; padding: 6px 14px; border-radius: 999px; white-space: nowrap; }
.qb-menu { position: relative; min-width: 0; }
.qb-menu summary { list-style: none; cursor: pointer; font-weight: 700; padding: 6px 12px; border: 2px solid var(--line); border-radius: 999px; background: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
.qb-menu summary::-webkit-details-marker { display: none; }
.qb-list { position: absolute; inset-inline-start: 0; top: calc(100% + 6px); width: min(320px, 86vw); max-height: 70vh; overflow: auto; background: #fff; border: 2px solid var(--line); border-radius: 14px; box-shadow: 0 10px 26px rgba(0,0,0,.18); padding: 6px; display: grid; gap: 2px; }
.qb-list a { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 600; }
.qb-list a:hover { background: #eef8fe; }
.qb-list a[aria-current] { background: var(--sun); }
.qb-list .l { min-width: 2.6em; text-align: center; font-weight: 900; color: var(--red); }
.qb-nav { margin-inline-start: auto; display: flex; gap: 6px; }
.qb-arrow { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; font-weight: 900; font-size: 1.2rem; }
.qb-arrow.off { opacity: .3; }
.bank { top: 60px; }
@media (max-width: 480px) { .qb-home { padding: 6px 10px; font-size: .9rem; } .qb-arrow { width: 34px; height: 34px; } }
.qb-list { position: fixed; top: 54px; inset-inline-start: max(10px, calc((100vw - 1100px) / 2)); width: min(340px, calc(100vw - 20px)); }
.read.img-only img { max-height: none; width: 100%; max-width: 760px; height: auto; border-radius: 12px; }
.ex-img { display: block; max-width: min(100%, 680px); height: auto; margin: 0 auto 14px; border-radius: 12px; }

.pick-row.long { flex-wrap: wrap; gap: 8px 14px; }
.pick-letter.long { flex-basis: 100%; width: auto; height: auto; border: 0; border-radius: 0; background: none; display: block; font-size: 1.3rem; font-weight: 600; color: inherit; text-align: start; }
.o-line.seq, .chips.seq { flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
.chips.seq .chip, .o-line.seq .chip { text-align: start; border-radius: 14px; white-space: normal; }

/* ---------- open answers: typed questions, forms and tables ---------- */
.open { display: grid; gap: 16px; }
.o-img { max-height: 220px; width: auto; margin-inline: auto; }
.o-heading { margin: 0; font-size: var(--step-1); font-weight: 800; color: var(--sky-deep); }
.o-list { display: grid; gap: 18px; }
.open.cols-2 .o-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
.o-item { display: grid; gap: 8px; min-width: 0; }
.o-q { margin: 0; font-size: var(--step-1); font-weight: 700; line-height: 1.8; }
.o-area {
  --lh: 2.4rem;
  display: block; width: 100%; min-height: calc(var(--rows, 1) * var(--lh) + 14px); resize: none; overflow: hidden;
  font: inherit; font-size: var(--step-1); line-height: var(--lh); color: var(--ink);
  padding: 6px 14px 8px; border: 2px solid var(--line); border-radius: var(--radius);
  background-color: var(--paper);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--lh) - 2px), #b9cfe0 calc(var(--lh) - 2px), #b9cfe0 var(--lh));
  background-position: 0 6px; background-origin: padding-box; background-attachment: local;
}
.o-area:focus, .o-in:focus { outline: 3px solid var(--sky-deep); outline-offset: 1px; border-color: var(--sky-deep); }
.o-item.lab { grid-template-columns: minmax(7.5em, max-content) minmax(0, 1fr); align-items: center; gap: 8px 14px;
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); padding: 8px 14px; }
.o-label { font-size: var(--step-1); font-weight: 700; }
.o-fields { display: flex; gap: 10px; min-width: 0; }
.o-in { flex: 1 1 0; min-width: 0; width: 100%; font: inherit; font-size: var(--step-1); color: var(--ink); padding: 2px 8px;
  border: 0; border-bottom: 3px solid var(--sky-deep); border-radius: 6px 6px 0 0; background: #eef8fe; }
.o-in.num { flex: 0 0 3.2em; text-align: center; }
.o-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden; table-layout: fixed; }
.o-table th { background: var(--sky-deep); color: #fff; font-size: var(--step-1); padding: 6px 10px; }
.o-table td { border-top: 2px solid var(--line); padding: 8px 10px; font-size: var(--step-1); text-align: center; }
.o-table td + td, .o-table th + th { border-inline-start: 2px solid var(--line); }
.o-table tr.eg td { background: #f3f9fd; color: var(--ink-soft); }
.o-table .o-in { text-align: center; }
.o-area.wrong, .o-in.wrong { animation: shake .35s; border-color: var(--bad); }
.o-list.form { grid-template-columns: fit-content(45%) minmax(0, 1fr); gap: 12px; }
.o-list.form .o-item.lab { grid-column: 1 / -1; grid-template-columns: subgrid; }
.o-list.form .o-item.nolab > * { grid-column: 1 / -1; }
.open.cols-2 .o-list.form { grid-template-columns: fit-content(28%) minmax(0, 1fr) fit-content(28%) minmax(0, 1fr); gap: 12px 18px; }
.open.cols-2 .o-list.form .o-item.lab { grid-column: span 2; }
@media (max-width: 560px) {
  .open.cols-2 .o-list { grid-template-columns: minmax(0, 1fr); }
  .open.cols-2 .o-list.form { grid-template-columns: fit-content(45%) minmax(0, 1fr); }
  .open.cols-2 .o-list.form .o-item.lab { grid-column: 1 / -1; }
  .o-item.lab { padding: 8px 10px; }
}
.o-item.lab.nolab { grid-template-columns: minmax(0, 1fr); }
.o-item.lab .o-area { --lh: 2.2rem; border-width: 0 0 0 0; padding: 0 6px; background-color: #eef8fe; border-radius: 6px; min-height: calc(var(--rows, 1) * var(--lh) + 4px); background-position: 0 0; }

/* ---------- paint: outlined letters filled by tapping ---------- */
.paint { display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: center; }
.paint.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.pt-item { display: grid; justify-items: center; gap: 4px; }
.paint.cards .pt-item { background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); padding: 10px 12px 14px; }
.pt-word { font-size: 2.2rem; font-weight: 900; line-height: 1.6; }
.pt-line { display: inline-flex; direction: rtl; font-size: clamp(3.4rem, 11vw, 5.2rem); font-weight: 900; line-height: 1.5; }
.pt-ch { color: #fff; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; cursor: pointer; transition: color .15s; padding: 0 .02em; }
.pt-ch:hover { color: #eef8fe; }
.pt-ch.on { -webkit-text-stroke-color: var(--ink); }
.pt-gap { width: .4em; }
.read-grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 6px 10px; direction: rtl; background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); padding: 14px 18px; font-size: 2.1rem; font-weight: 800; text-align: center; color: var(--ink); }
.read-text.big { font-size: 1.75rem; line-height: 2.1; }
.read-text.poem { text-align: center; }
.read-text p.gap { height: .8em; }
.rb-p { margin: 0; font-size: var(--step-1); font-weight: 600; line-height: 1.9; }
.rb-note { margin: 0; color: var(--ok); font-weight: 800; font-size: var(--step-0); }
.rb-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 12px; }
.rb-card { margin: 0; display: grid; justify-items: center; gap: 6px; background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); padding: 10px 8px 8px; }
.rb-card img { height: 110px; width: 100%; object-fit: contain; }
.rb-card figcaption { font-size: var(--step-1); font-weight: 800; color: var(--red); line-height: 1.5; }
.rb-img { max-height: 280px; width: auto; max-width: 100%; margin-inline: auto; border-radius: 10px; }
.rb-table td { font-weight: 700; } .rb-table td:first-child { color: var(--sky-deep); }

/* book pictures with the book's words typed back on top */
.ov { position: relative; container-type: inline-size; margin-inline: auto; }
.ov > img { position: absolute; inset: 0; width: 100% !important; height: 100% !important; max-height: none !important; border-radius: 0; }
.read.img-only .ov { width: min(100%, 760px) !important; border-radius: 12px; overflow: hidden; }
.sheet { container-type: inline-size; }
.ov-t { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; font-weight: 800; line-height: 1; pointer-events: none; color: #1d2a44; z-index: 1; }
.ov-t .h { -webkit-text-stroke: .1em #fff; paint-order: stroke fill; }
.sheet-lines { margin-bottom: 12px; }
.o-table td.o-pic { width: 26%; text-align: center; background: #fff; }
.o-table td.o-pic img { height: 74px; width: auto; max-width: 100%; vertical-align: middle; }
.rb-table.kv th { background: #1d2a44; color: #fff; font-weight: 800; white-space: pre-line; width: 38%; }
.rb-note.green { color: #3f9c35; font-size: var(--step-1); font-weight: 800; text-align: center; }
.o-table td.o-pic img { display: block; margin: 0 auto; mix-blend-mode: multiply; }
table.letters.search td.sel { outline: 3px solid var(--red); outline-offset: -3px; }
table.letters.search td.hit { color: #1d2a44; }

.d-he span, .d-ar span { font-size: 1.3rem; font-weight: 700; line-height: 1.6; text-align: center; }
.d-ar span { font-size: 1.35rem; color: #6b3d0b; }
.dict.quiz .d-ar span { filter: blur(7px); opacity: .35; transition: filter .2s, opacity .2s; }
.dict.quiz .d-ar.show span { filter: none; opacity: 1; }

/* =====================================================================
   Book 3 (مصباح المعرفة – علوم، الصف الأول): theme, Arabic type, new activities
   ===================================================================== */
:root {
  --sky: #ffd1e6; --sky-deep: #1f8fd6; --red: #e8337f; --page: #fff6fa; --line: #f1d3e2; --sun: #ffd23f;
  --pink: #f06ea9; --pink-deep: #d9468b; --blue: #1f8fd6; --leaf: #3fae49;
}
body { line-height: 1.9; }
.band { background: linear-gradient(180deg, #f8a8cc 0%, #ffe3ef 55%, var(--page) 100%); }
.hero h1, .ex-head h2, .qb-home, .btn, .toc .n, .bl-hud, .qz, .cut-sheet-h, .chapter-h { font-family: var(--round); }
.hero h1 { color: #fff; text-shadow: 0 3px 0 var(--pink-deep), 0 0 18px rgba(217,70,139,.35); font-weight: 800; font-size: clamp(2.1rem, 7vw, 3.4rem); line-height: 1.35; }
.hero p { color: #7a3159; font-weight: 600; }
.hero .tile { font-size: 3.2rem; box-shadow: 10px 10px 0 #fbd0e3, -8px -8px 0 #bfe3fa; border-radius: 22px; }
.ex-head h2 { font-weight: 700; line-height: 1.6; }
.num { background: var(--pink); border-radius: 50%; }
.ex.game { background: linear-gradient(180deg, #fff 0%, #fff7d6 100%); border: 3px solid #ffd23f; border-radius: 22px; padding: 22px 18px; margin-block: 14px; }
.ex.game .num { background: #f5a300; }
.btn { font-weight: 600; }
.btn.big { font-size: 1.3rem; padding: 8px 26px; }
.btn.primary { box-shadow: 0 3px 0 #136aa3; }
.chip, .chip.big { font-weight: 600; line-height: 1.8; }
.quickbar { border-bottom-color: #f6c6dc; }
.qb-home { background: var(--pink); }
.qb-list .l { color: var(--pink-deep); min-width: 1.8em; }
.tf-img { width: 84px; height: 64px; object-fit: contain; flex: none; mix-blend-mode: multiply; }
.read-text { line-height: 2.1; }
.toc .l { color: var(--pink-deep); font-size: 2rem; }

/* index: chapters with their lessons */
.chapters { display: grid; gap: 26px; padding-block: 24px 50px; }
.chapter { background: #fff; border: 3px solid var(--line); border-radius: 26px; overflow: hidden; }
.chapter-h { display: flex; gap: 14px; align-items: center; padding: 12px 18px; color: #fff; background: var(--blue); }
.chapter-h img { width: 86px; height: 86px; object-fit: cover; border-radius: 16px; border: 3px solid #fff; flex: none; }
.chapter-h small { display: block; font-size: 1rem; opacity: .95; font-weight: 600; }
.chapter-h b { font-size: 1.6rem; font-weight: 800; line-height: 1.3; }
.chapter .toc { padding: 16px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.chapter .toc a { gap: 4px; }
.chapter .toc .ic { width: 100%; height: 86px; object-fit: contain; }
.chapter:nth-child(2) .chapter-h { background: #1fa774; } .chapter:nth-child(3) .chapter-h { background: #e58a0c; }
.chapter:nth-child(4) .chapter-h { background: #8a4fd8; } .chapter:nth-child(5) .chapter-h { background: var(--pink-deep); }

/* sort with pictures, baskets */
.chips.pics { gap: 10px; }
.chip.pic { display: grid; justify-items: center; gap: 2px; border-radius: 16px; padding: 6px; width: 112px; background: #fff; }
.chip.pic img { width: 96px; height: 80px; object-fit: contain; pointer-events: none; }
.chip.pic b { font-size: 1rem; line-height: 1.4; }
.bins .chip.pic { width: 92px; } .bins .chip.pic img { width: 76px; height: 60px; }
.bin.basket { background: #fff; border: 3px dashed #e9a7c7; }
.bin-img { width: 110px; height: 80px; object-fit: contain; margin-inline: auto; }
@media (max-width: 480px) { .chip.pic { width: 92px; } .chip.pic img { width: 78px; height: 64px; } }

/* balloons with words or pictures */
.balloon { background: var(--b, #e3262e); width: 92px; height: 108px; font: 800 1.15rem/1.3 var(--round); padding: 6px; display: grid; place-items: center; }
.balloon.pic { background: radial-gradient(circle at 50% 42%, #fff 0 54%, var(--b, #e3262e) 56%); }
.balloon.pic img { width: 64px; height: 64px; object-fit: contain; pointer-events: none; }
.balloon span { pointer-events: none; }
.bl-field { height: 420px; }
.bl-target { font-size: 1.4rem; }

/* drawing boxes */
.db { display: grid; gap: 8px; }
.db-bar .swatch { width: 30px; height: 30px; }
.db-bar .btn[aria-pressed="true"] { background: var(--ink); color: #fff; }
.db-paper { border: 3px dashed #e9a7c7; border-radius: 16px; background: #fff; overflow: hidden; }
.db-cv { display: block; width: 100%; height: auto; cursor: crosshair; }
.o-item.lab .db { grid-column: 1 / -1; }
.o-qimg { max-height: 200px; width: auto; max-width: 100%; margin-inline: auto; border-radius: 10px; }

/* cut and paste */
.cut-targets { display: grid; gap: 14px; }
.cut-targets.baskets { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.cut-basket { display: grid; justify-items: center; align-content: start; gap: 6px; background: #fff; border: 3px dashed #e9a7c7; border-radius: 22px; padding: 12px; min-height: 190px; }
.cut-basket > b { font-size: 1.35rem; font-family: var(--round); color: var(--pink-deep); }
.cut-basket-img { width: 140px; height: 96px; object-fit: contain; }
.cut-in { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; min-height: 80px; width: 100%; }
.cut-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px; align-items: center; gap: 12px; background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 10px 14px; }
.cut-row .cut-row-img { grid-row: span 2; }
.cut-text { margin: 0; font-size: var(--step-1); font-weight: 600; line-height: 1.8; }
.cut-row .cut-in { width: 150px; height: 120px; min-height: 0; border: 3px dashed #9cc9ea; border-radius: 14px; align-items: center; background: #f4fbff; }
.cut-row.has .cut-in { border-style: solid; border-color: var(--ok); background: var(--ok-soft); }
.drop-over.cut-row, .drop-over.cut-basket, .drop-over.cut-spot { border-color: var(--blue); background: #eaf6ff; }
.cut-scene { position: relative; margin-inline: auto; width: 100%; }
.cut-scene > .ov, .cut-scene > img { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.cut-spot { position: absolute; border: 3px dashed #1f8fd6; border-radius: 12px; background: rgba(255,255,255,.55); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; }
.cut-spot.has { border-style: solid; border-color: var(--ok); background: rgba(255,255,255,.2); }
.cut-spot .cut-piece.glued { width: 100%; height: 100%; padding: 2px; }
.cut-spot.many .cut-piece.glued { width: 46%; height: 46%; }
.cut-sheet { background: #fffdf4; border: 2px solid #f0e2b6; border-radius: 18px; padding: 12px; }
.cut-sheet-h { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 1rem; color: #8a6d0f; font-weight: 600; }
.cut-sheet-h svg { width: 26px; height: 26px; fill: #e3262e; flex: none; }
.cut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 16px; }
.cut-cell { position: relative; aspect-ratio: 1; border-radius: 6px; }
.cut-cell.empty { outline: 2px dashed #e5d39b; outline-offset: -2px; background: repeating-linear-gradient(45deg, #fffaf0 0 8px, #fbf3dc 8px 16px); }
.cut-piece { position: relative; width: 100%; height: 100%; background: #fff; display: grid; place-items: center; padding: 10px; touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; transition: transform .35s, box-shadow .35s; }
.cut-piece img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.cut-piece.word b { font-size: 1.3rem; font-family: var(--round); }
.cut-piece img + b { position: absolute; bottom: 4px; font-size: .95rem; }
.cut-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.cut-line .dash { fill: none; stroke: #6b6b6b; stroke-width: 2; stroke-dasharray: 7 6; }
.cut-line .cutseg { stroke: transparent; stroke-width: 4; stroke-linecap: round; }
.cut-line .cutseg.on { stroke: #e3262e; }
.cut-sc { position: absolute; width: 38px; height: 38px; margin: -19px 0 0 -19px; border: 0; padding: 4px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.25); cursor: pointer; z-index: 2; transition: left .04s linear, top .04s linear; }
.cut-sc svg { width: 100%; height: 100%; fill: #e3262e; }
.cut-piece.cutting .cut-sc { transform: scale(1.15); }
.cut-piece.free { cursor: grab; box-shadow: 0 10px 18px rgba(0,0,0,.18); transform: rotate(-3deg) translateY(-4px); border-radius: 4px; outline: 1px solid #ddd; }
.cut-piece.free:nth-child(odd) { transform: rotate(2deg) translateY(-4px); }
.cut-piece.sel { outline: 3px solid var(--blue); }
.cut-piece.ghost { position: fixed; z-index: 90; width: 110px; height: 110px; pointer-events: none; transform: translate(-50%, -50%) rotate(-4deg) scale(1.05); box-shadow: 0 14px 26px rgba(0,0,0,.28); }
.cut-piece.dragging { opacity: .35; }
.cut-piece.glued { width: 96px; height: 96px; transform: rotate(-2deg); box-shadow: 0 2px 0 rgba(0,0,0,.08); cursor: default; outline: 1px solid #e8e8e8; padding: 6px; }
.cut-row .cut-piece.glued { width: 100%; height: 100%; }
@media (max-width: 560px) {
  .cut-row { grid-template-columns: minmax(0, 1fr) 110px; } .cut-row .cut-in { width: 110px; height: 96px; }
  .cut-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } .cut-piece.glued { width: 78px; height: 78px; }
}

/* colouring page */
.fill-pal .swatch.big { width: 40px; height: 40px; }
.fill-pal .swatch[style*="#ffffff"] { box-shadow: 0 0 0 2px #bbb; }
.fill-wrap { margin-inline: auto; width: 100%; border: 3px solid var(--line); border-radius: 18px; overflow: hidden; background: #fff; }
.fill-cv { display: block; width: 100%; height: auto; cursor: pointer; }

/* experiment video */
.mv-box { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.mv-frame { border-radius: 18px; overflow: hidden; background: #000; border: 4px solid #1f8fd6; box-shadow: 0 10px 24px rgba(31,143,214,.25); }
.mv { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #000; }
.mv-side { background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 12px 16px; }
.mv-side b { color: var(--pink-deep); font-family: var(--round); font-size: 1.2rem; }
.mv-steps { margin: 6px 0 0; padding-inline-start: 1.4em; display: grid; gap: 4px; font-size: 1.05rem; }
@media (max-width: 700px) { .mv-box { grid-template-columns: minmax(0, 1fr); } }

/* quiz game */
.qz-bar { height: 12px; border-radius: 99px; background: #fde2ee; overflow: hidden; }
.qz-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #f06ea9, #ffd23f); transition: width .4s; }
.qz { background: #fff; border: 3px solid #ffd23f; border-radius: 22px; padding: 16px; min-height: 260px; display: grid; gap: 14px; align-content: start; }
.qz-start, .qz-end { display: grid; justify-items: center; gap: 8px; padding: 20px; text-align: center; }
.qz-big { font-size: 4rem; line-height: 1; }
.qz-start p, .qz-end p { margin: 0; font-size: 1.3rem; font-weight: 700; }
.qz-stars { font-size: 3.2rem; color: #f5b700; letter-spacing: 6px; }
.qz-head { display: flex; justify-content: space-between; font-weight: 800; color: #7a3159; }
.qz-score { color: #c98a00; }
.qz-q { display: grid; justify-items: center; gap: 8px; text-align: center; }
.qz-q p { margin: 0; font-size: 1.45rem; font-weight: 700; line-height: 1.7; }
.qz-img { max-height: 200px; width: auto; max-width: 100%; border-radius: 12px; }
.qz-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.qz-opt { border: 3px solid var(--line); background: #fff; border-radius: 16px; padding: 10px; cursor: pointer; font-size: 1.25rem; display: grid; justify-items: center; gap: 4px; font-weight: 700; transition: transform .15s; }
.qz-opt:hover { transform: translateY(-2px); border-color: var(--blue); }
.qz-opt img { height: 90px; width: 100%; object-fit: contain; }
.qz-opt.ok { border-color: var(--ok); background: var(--ok-soft); }
.qz-opt.bad { border-color: var(--bad); background: #fde8e8; animation: shake .35s; }

/* label a picture */
.lb-pic { position: relative; margin-inline: auto; width: 100%; }
.lb-pic > .ov, .lb-pic > img { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.lb-spot { position: absolute; border: 3px dashed #1f8fd6; border-radius: 12px; background: rgba(255,255,255,.88); display: grid; place-items: center; font: 800 clamp(.8rem, 2.6vw, 1.3rem)/1.2 var(--round); color: var(--ok); }
.lb-spot.ok { border-style: solid; border-color: var(--ok); background: #fff; }
.lb-spot.drop-over { background: #eaf6ff; }
.s-words .chip { cursor: default; }
.s-words .chip.ok { text-decoration: line-through; text-decoration-thickness: 3px; }
.hero .tile.pic { padding: 6px; overflow: hidden; background: #fff; }
.hero .tile.pic img { width: 100%; height: 100%; object-fit: contain; }
.hero .kicker { margin: 0; font-family: var(--round); font-weight: 700; color: #fff; background: var(--blue); display: inline-block; padding: 0 12px; border-radius: 999px; font-size: .95rem; }
.ex-head h2 { font-size: clamp(1.15rem, 3.6vw, 1.4rem); }
.rb-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.rb-i { display: flex; gap: 10px; align-items: flex-start; border-radius: 18px; padding: 12px 14px; background: #eaf6ff; border: 2px solid #cfe7f8; }
.rb-i img { width: 86px; height: 86px; object-fit: contain; flex: none; mix-blend-mode: multiply; }
.rb-i b { display: block; font-family: var(--round); font-size: 1.25rem; color: #1f6fb0; line-height: 1.5; }
.rb-i p { margin: 0; font-size: 1.12rem; line-height: 1.9; }
.rb-i.c1 { background: #fff1f7; border-color: #f8cfe1; } .rb-i.c1 b { color: #c2306f; }
.rb-i.c2 { background: #eefaea; border-color: #cdebc4; } .rb-i.c2 b { color: #2f8a2c; }
.rb-i.c3 { background: #fff8e1; border-color: #f4e2a6; } .rb-i.c3 b { color: #a77300; }
.rb-i.c4 { background: #f3eefe; border-color: #ddd0fb; } .rb-i.c4 b { color: #6b3fc4; }
.rb-i.c5 { background: #e9fbfb; border-color: #bfeceb; } .rb-i.c5 b { color: #138283; }
.rb-box { background: #fff8e1; border: 2px dashed #f2c94c; border-radius: 18px; padding: 10px 16px; }
.rb-box p { margin: 0; font-size: var(--step-1); font-weight: 600; line-height: 1.9; }
.card { border: 3px solid var(--line) !important; border-radius: 18px !important; background: #fff; padding: 8px; cursor: pointer; display: grid; justify-items: center; gap: 4px; }
.card:hover { border-color: #9cc9ea !important; }
.card img { height: 120px; mix-blend-mode: multiply; }
.card b { font-size: 1.2rem; font-family: var(--round); }
.card.ok { border-color: var(--ok) !important; background: var(--ok-soft); }
.pick-row .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pick-groups .pick-row { background: #fff; border: 2px solid var(--line); border-radius: 20px; padding: 10px 12px; }
.pick-letter.long { color: #1f6fb0; }
@media (max-width: 480px) { .card img { height: 84px; } .pick-row .cards { gap: 8px; } }
.cut-basket[style*="--c"] { border: 4px solid var(--c); background: color-mix(in srgb, var(--c) 10%, #fff); }
.cut-basket[style*="--c"] > b { color: var(--c); }
.pick-row.withpic { flex-wrap: wrap; }
.pick-row.withpic .pick-q-img { width: 150px; height: auto; max-height: 150px; object-fit: contain; border-radius: 14px; flex: none; }
.pick-row.withpic .pick-letter.long { flex-basis: auto; flex: 1; min-width: 12em; }
.pick-row.withpic .chips { flex-basis: 100%; }

/* sound buttons */
.snd-btn { display: inline-flex; align-items: center; gap: .45em; margin: .3em 0 .5em; padding: .45em 1.1em; border: 0; border-radius: 999px;
  background: linear-gradient(180deg, #ffd34d, #ffb31a); color: #5a3300; font: 700 1.05rem var(--round); cursor: pointer; box-shadow: 0 3px 0 #d68a00; }
.snd-btn span { font-size: 1.35em; line-height: 1; }
.snd-btn.on { animation: sndpulse .7s ease-in-out infinite alternate; }
.snd-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #d68a00; }
@keyframes sndpulse { from { box-shadow: 0 3px 0 #d68a00, 0 0 0 0 rgba(255,179,26,.6); } to { box-shadow: 0 3px 0 #d68a00, 0 0 0 10px rgba(255,179,26,0); } }
.qz-q .snd-btn { font-size: 1.2rem; }
@media (prefers-reduced-motion: reduce) { .snd-btn.on { animation: none; outline: 3px solid #ffb31a; } }
.snd-btn { width: fit-content; justify-self: start; align-self: flex-start; }
.ov-t.wrap { white-space: normal; text-align: center; line-height: 1.5; font-weight: 700; }
.tf-img.ov { width: 120px !important; flex: none; }
.tf-img.ov { height: auto; }
/* a picture with typed-back text inside a pick row: show it large enough to read */
.pick-row.withpic .ov.pick-q-img { width: min(100%, 460px) !important; max-height: none; height: auto; }
.qz-img.ov { max-height: none; width: min(100%, 420px) !important; margin-inline: auto; }
/* four picture options fit on one row on wide screens */
@media (min-width: 700px) { .pick-row .cards:has(> :nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 699px) { .pick-row .cards:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ov.rb-img { max-height: none; }
/* the little detective (find in the picture) */
.fd-pic { cursor: crosshair; border-radius: 14px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.fd-spot { position: absolute; background: transparent; border: 0; padding: 0; border-radius: 50%; cursor: crosshair; }
.fd-spot.ok { border: 4px solid #1e9e58; box-shadow: 0 0 0 3px rgba(255,255,255,.9); background: rgba(30,158,88,.12); }
.fd-tag { position: absolute; left: 50%; top: 100%; transform: translate(-50%, 2px); white-space: nowrap; background: #1e9e58; color: #fff; font: 700 .85rem/1.5 var(--round, inherit); padding: 0 .5em; border-radius: 999px; z-index: 2; }
.fd-miss { position: absolute; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%; background: rgba(227,38,46,.85); color: #fff; display: grid; place-items: center; font-weight: 800; pointer-events: none; animation: fdMiss .7s ease-out forwards; }
@keyframes fdMiss { from { opacity: 1; transform: translate(-50%, -50%) scale(.6); } to { opacity: 0; transform: translate(-50%, -50%) scale(1.3); } }
.fd-ask { font-weight: 700; margin: 0 0 6px; }
.fd-list { margin-bottom: 10px; }
.fd-name.ok { background: #e6f7ec; border-color: #1e9e58; color: #1e9e58; text-decoration: line-through; }
/* cut pieces: tall pictures stay inside their square */
.cut-piece { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); }
.cut-piece img { min-width: 0; min-height: 0; max-height: 100%; }
.cut-piece:has(img + b) { padding-bottom: 26px; }
.cut-piece.glued:has(img + b) { padding-bottom: 18px; }
.cut-piece.glued img + b { font-size: .75rem; bottom: 2px; }
/* healthy plate game */
.pl-wrap { display: grid; gap: 16px; justify-items: center; }
.pl-dish { width: min(100%, 340px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, #fff 0 55%, #eef3f7 56% 62%, #fff 63% 68%, #dfe7ee 69%); box-shadow: 0 8px 20px rgba(0,0,0,.12); display: grid; place-items: center; }
.pl-in { width: 66%; aspect-ratio: 1; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 4px; }
.pl-in .pl-food { width: 30%; padding: 2px; border: 0; background: none; box-shadow: none; animation: plDrop .4s ease-out; }
.pl-in .pl-food b { display: none; }
@keyframes plDrop { from { transform: translateY(-40px) scale(1.3); opacity: 0; } to { transform: none; opacity: 1; } }
.pl-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; width: 100%; }
.pl-food { position: relative; display: grid; justify-items: center; gap: 2px; padding: 8px 6px; border: 2px solid #f0d9e4; border-radius: 14px; background: #fff; cursor: pointer; font: inherit; }
.pl-food img { width: 100%; aspect-ratio: 1; object-fit: contain; pointer-events: none; }
.pl-food b { font-size: .85rem; line-height: 1.3; }
.pl-food.no { opacity: .45; border-color: #e3262e; }
.pl-food.no::after { content: "✗"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 3rem; color: #e3262e; }
/* water cups */
.cp-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; max-width: 640px; margin-inline: auto; }
@media (max-width: 560px) { .cp-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cp-glass { position: relative; border: 0; background: none; padding: 0; cursor: pointer; }
.cp-glass svg { width: 100%; display: block; }
.cp-glass b { position: absolute; top: 42%; inset-inline: 0; text-align: center; font-size: .9rem; color: #6b7c8a; }
.cp-out { fill: none; stroke: #5b6d7a; stroke-width: 3; stroke-linejoin: round; }
.cp-shine { stroke: #fff; stroke-width: 3; opacity: .7; stroke-linecap: round; }
.cp-water { fill: #4fb6ef; transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(0); transition: transform .5s ease-out; }
.cp-glass.full .cp-water { transform: scaleY(1); }
.cp-glass.full b { color: #fff; }
.cp-note { text-align: center; font-weight: 700; min-height: 1.6em; margin: 12px 0 0; }
.cp-note.ok { color: #1e9e58; } .cp-note.more { color: #d97706; }

/* ================= grade-2 science games (book 7) ================= */
.th { font: inherit; }
.th .th-e { font-style: normal; font-size: 2.6rem; line-height: 1.1; display: block; }
.th img { pointer-events: none; }
button.th { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; border: 2px solid var(--line); background: #fff; border-radius: 16px;
  display: inline-grid; justify-items: center; align-content: center; gap: 2px; padding: 6px 8px; color: var(--ink); }
button.th.word { border-radius: 999px; padding: 6px 18px; font-size: var(--step-1); font-weight: 700; }
button.th.pic, button.th.emo { width: 118px; min-height: 104px; }
button.th.pic img { width: 100%; height: 82px; object-fit: contain; }
button.th b { font-size: 1rem; line-height: 1.35; font-weight: 700; }
button.th.sel { border-color: var(--sky-deep); background: #eef8fe; box-shadow: 0 0 0 3px rgba(18,163,227,.25); }
button.th.dragging { opacity: .35; }
.th.ghost { position: fixed; z-index: 90; pointer-events: none; transform: translate(-50%, -60%) scale(1.06); box-shadow: 0 10px 22px rgba(0,0,0,.22); }
button.th.wrong { animation: shake .4s; }

/* rush */
.ru { display: grid; gap: 10px; }
.ru-hud { display: flex; justify-content: space-between; gap: 10px; font-weight: 800; font-size: var(--step-1); min-height: 1.6em; font-family: var(--round); }
.ru-streak.hot { color: #e8590c; animation: pop .4s; }
.ru-time { height: 12px; border-radius: 99px; background: #e4edf4; overflow: hidden; }
.ru-time i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #1e9e58, #7ac943); border-radius: 99px; }
.ru-time.low i { background: linear-gradient(90deg, #e3262e, #ff8a3d); }
.ru-stage { min-height: 230px; display: grid; place-items: center; border-radius: 20px; background: radial-gradient(circle at 50% 40%, #fff, #e9f6fd); border: 3px dashed #b9dcef; padding: 12px; position: relative; }
.ru-card { display: grid; justify-items: center; gap: 6px; background: #fff; border-radius: 20px; padding: 12px 18px; box-shadow: 0 8px 22px rgba(13,79,116,.18); border: 3px solid #12a3e3;
  touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; position: relative; min-width: 150px; }
.ru-card img { max-width: 200px; max-height: 150px; object-fit: contain; }
.ru-card .th-e { font-size: 4.4rem; }
.ru-card b { font-size: var(--step-2); font-weight: 800; }
.ru-card.ru-in { animation: ruIn .35s ease; }
.ru-card.ru-go { transition: transform .45s ease, opacity .45s; transform: translateY(130px) scale(.35); opacity: 0; }
.ru-card.ru-miss { animation: shake .45s; border-color: var(--bad); }
.ru-late { position: absolute; top: -14px; inset-inline-end: -12px; font-size: 1.8rem; }
@keyframes ruIn { from { transform: scale(.4) translateY(-30px); opacity: 0; } to { transform: none; opacity: 1; } }
.ru-bins { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
.ru-bins.n3 { grid-template-columns: repeat(3, 1fr); }
.ru-bins.n4 { grid-template-columns: repeat(2, 1fr); }
.ru-bin { --c: #1e9e58; border: 4px solid var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); border-radius: 20px; padding: 10px 8px; cursor: pointer; font: inherit;
  display: grid; justify-items: center; gap: 2px; min-height: 96px; align-content: center; color: var(--ink); box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 60%, #000); }
.ru-bin:active { transform: translateY(3px); box-shadow: 0 1px 0 color-mix(in srgb, var(--c) 60%, #000); }
.ru-bin .ru-ic { font-size: 2.3rem; line-height: 1.1; }
.ru-bin img { max-height: 70px; max-width: 100%; object-fit: contain; }
.ru-bin b { font-size: var(--step-1); font-weight: 800; line-height: 1.3; }
.ru-bin.drop-over { background: color-mix(in srgb, var(--c) 30%, #fff); }
.ru-bin.ru-hint { animation: ruHint 1.2s; }
@keyframes ruHint { 0%, 100% { box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 60%, #000); } 30%, 70% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--c) 45%, transparent); } }
.ru-best { font-weight: 700; color: #e8590c; }

/* catch */
.ct-field { position: relative; height: min(420px, 62vh); border-radius: 18px; overflow: hidden; border: 3px solid #0d4f74; display: grid; place-items: center;
  background: linear-gradient(#bfe7ff, #f2fbff 62%, #cdeeb5 62%, #a9dc8c); user-select: none; -webkit-user-select: none; }
.ct-field.on { touch-action: none; cursor: none; }
.ct-basket { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); font-size: 4.2rem; line-height: 1; pointer-events: none; filter: drop-shadow(0 4px 3px rgba(0,0,0,.25)); }
.ct-basket img { width: 96px; }
.ct-basket.pop { animation: pop .3s; } .ct-basket.wrong { animation: shake .4s; }
.ct-drop { position: absolute; top: 0; display: grid; justify-items: center; background: #fff; border-radius: 16px; padding: 4px 6px; box-shadow: 0 4px 10px rgba(0,0,0,.18); border: 2px solid #fff; max-width: 104px; pointer-events: none; }
.ct-drop img { width: 72px; height: 56px; object-fit: contain; }
.ct-drop .th-e { font-size: 2.6rem; }
.ct-drop b { font-size: .95rem; line-height: 1.3; font-weight: 700; text-align: center; }
.ct-drop.ct-in { transition: opacity .25s, transform .25s; opacity: 0; }
.ct-drop.ct-no { border-color: var(--bad); background: #ffe3e3; }
.ct-lives { font-size: 1.2rem; letter-spacing: 2px; }
.bl-win.lose { display: grid; gap: 10px; place-content: center; justify-items: center; color: var(--bad); font-size: 1.6rem; }
.bl-win.lose p { margin: 0; }

/* chain */
.ch-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; padding: 12px; border-radius: 18px; background: #f2f9fd; border: 2px solid #cfe6f3; }
.ch-row.vert { flex-direction: column; }
.ch-row.vert .ch-arrow { transform: rotate(-90deg); }
.ch-arrow { font-size: 2rem; font-weight: 900; color: #12a3e3; line-height: 1; }
.ch-slot { width: 124px; min-height: 112px; border: 3px dashed #9cc9e2; border-radius: 16px; background: #fff; display: grid; place-items: center; padding: 4px; }
.ch-slot.drop-over { border-color: var(--sky-deep); background: #eaf7ff; }
.ch-slot.ok { border-style: solid; border-color: var(--ok); background: var(--ok-soft); }
.ch-slot.given { border-color: #f5b700; background: #fff8dc; }
.ch-slot.wrong { animation: shake .4s; border-color: var(--bad); }
.ch-slot.pop { animation: pop .35s; }
.ch-n { font-size: 2rem; font-weight: 900; color: #b5d3e4; font-family: var(--round); }
.ch-in { display: grid; justify-items: center; gap: 2px; }
.ch-in img { width: 106px; height: 76px; object-fit: contain; }
.ch-in .th-e { font-size: 2.5rem; }
.ch-in b { font-size: .98rem; line-height: 1.3; text-align: center; }
.ch-row.ch-done { animation: pop .5s; border-color: var(--ok); }
.ch-pool { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 12px; min-height: 40px; }
@media (max-width: 560px) { .ch-slot, button.th.pic, button.th.emo { width: 96px; } .ch-in img { width: 84px; height: 60px; } button.th.pic img { height: 64px; } .ch-arrow { font-size: 1.5rem; } }

/* scrub */
.sc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 800; font-size: var(--step-1); margin-bottom: 8px; font-family: var(--round); }
.sc-bar { flex: 1; min-width: 120px; height: 14px; background: #e4edf4; border-radius: 99px; overflow: hidden; }
.sc-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #12a3e3, #7fd4ff); transition: width .2s; }
.sc-pct { min-width: 3.2em; text-align: center; }
.sc-wrap { position: relative; margin-inline: auto; width: 100%; border-radius: 20px; overflow: hidden; background: #fde7ea; border: 3px solid #f4b6c0; }
.sc-img, .sc-img svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.sc-cv { position: absolute; inset: 0; width: 100%; height: 100%; cursor: none; }
.sc-tool { position: absolute; font-size: 3.2rem; pointer-events: none; transform: translate(-30%, -70%) rotate(-30deg); opacity: 0; transition: opacity .2s; }
.sc-tool.on { opacity: 1; }
.sc-wrap.clean { border-color: var(--ok); box-shadow: 0 0 0 6px var(--ok-soft); }
.sc-spark { position: absolute; font-size: 2rem; animation: spark 1.2s ease forwards; pointer-events: none; }
@keyframes spark { 0% { transform: scale(0); opacity: 0; } 40% { transform: scale(1.3); opacity: 1; } 100% { transform: scale(.9) translateY(-14px); opacity: 0; } }

/* whack */
.wh-field { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 18px; border-radius: 22px; background: linear-gradient(#ffd6dc, #f7a8b6); border: 3px solid #d9667c; min-height: 300px; }
.wh-hole { position: relative; aspect-ratio: 1.15; border-radius: 50% 50% 44% 44%; background: radial-gradient(ellipse at 50% 85%, #7b1d2c 0 42%, #5a1220 60%, transparent 62%), #fff;
  border: 4px solid #e8edf2; box-shadow: inset 0 -8px 0 #e4ebf1; overflow: hidden; }
.wh-mole { position: absolute; left: 50%; bottom: -100%; transform: translateX(-50%); border: 0; background: none; cursor: pointer; transition: bottom .18s ease-out; display: grid; justify-items: center; padding: 0; touch-action: manipulation; }
.wh-mole.up { bottom: 6%; }
.wh-mole .th-e { font-size: clamp(2.4rem, 9vw, 3.6rem); font-style: normal; }
.wh-mole img { width: 70px; height: 60px; object-fit: contain; }
.wh-mole b { font-size: .9rem; background: #fff; border-radius: 8px; padding: 0 6px; }
.wh-mole.splat .th-e, .wh-mole.splat img { animation: splat .35s forwards; }
.wh-mole.oops { animation: shake .4s; }
@keyframes splat { to { transform: scale(1.6) rotate(30deg); opacity: 0; } }
.wh-field > .qz-start, .wh-field > .bl-win { position: absolute; inset: 0; background: rgba(255,255,255,.85); border-radius: 20px; z-index: 3; }
.wh-field > .qz-start { display: grid; place-content: center; justify-items: center; }
@media (min-width: 700px) { .wh-field { grid-template-columns: repeat(3, 1fr); padding: 22px 40px; } }

.wh-field.sea { background: linear-gradient(#c9efff, #4fb3e6); border-color: #1572c4; }
.wh-field.sea .wh-hole { background: radial-gradient(ellipse at 50% 85%, #1d6fa8 0 42%, #135a8a 60%, transparent 62%), #e9f7ff; border-color: #d5eefc; box-shadow: inset 0 -8px 0 #cde9f8; }
.wh-field.garden { background: linear-gradient(#d8f5c8, #8fd06a); border-color: #3f8f2a; }
.wh-field.garden .wh-hole { background: radial-gradient(ellipse at 50% 85%, #6b4423 0 42%, #4e3018 60%, transparent 62%), #eaf7df; border-color: #d2ebc1; box-shadow: inset 0 -8px 0 #cfe6bf; }

/* lab */
.lab-tabs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 10px; }
.lab-tab[aria-pressed="true"] { border-color: var(--sky-deep); background: #e6f6fe; }
.lab-tab.ok::after { content: " ✓"; color: var(--ok); font-weight: 900; }
.lab-box { display: grid; gap: 10px; justify-items: center; }
.lab-stage { position: relative; width: min(100%, 460px); height: 250px; border-radius: 22px; background: linear-gradient(#f4fbff, #dff1fb); border: 3px solid #b9dcef; display: grid; place-items: center; overflow: hidden; }
.lab-obj { position: relative; display: grid; place-items: center; transition: transform .6s; }
.lab-e { font-size: 6.5rem; line-height: 1; position: relative; z-index: 2; transition: all .6s; }
.lab-obj img { max-width: 170px; max-height: 150px; position: relative; z-index: 2; }
.lab-obj.liquid .lab-e { font-size: 3.6rem; transform: translateY(26px); }
.lab-puddle { position: absolute; width: 200px; height: 46px; border-radius: 50%; background: var(--c); opacity: .75; bottom: -34px; z-index: 1; box-shadow: inset 0 -6px 0 rgba(0,0,0,.08); animation: spread .6s ease; }
@keyframes spread { from { transform: scaleX(.3); } to { transform: none; } }
.lab-obj.gas .lab-e { opacity: .45; filter: blur(1px); }
.lab-steam { position: absolute; top: -10px; width: 26px; height: 70px; border-radius: 50%; border-inline-start: 5px solid rgba(140,160,180,.7); animation: steam 1.6s infinite ease-out; opacity: 0; }
@keyframes steam { 0% { transform: translateY(20px) scaleY(.6); opacity: 0; } 30% { opacity: .9; } 100% { transform: translateY(-60px) scaleY(1.1); opacity: 0; } }
.lab-obj.chg { animation: pop .5s; }
.lab-name { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); background: #fff; border-radius: 999px; padding: 2px 16px; font-size: var(--step-1); font-weight: 800; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.1); }
.lab-thermo { position: absolute; inset-inline-start: 16px; top: 18px; bottom: 50px; width: 18px; border-radius: 99px; background: #fff; border: 3px solid #9bb3c4; overflow: hidden; display: flex; align-items: flex-end; }
.lab-thermo i { display: block; width: 100%; background: linear-gradient(#e3262e, #ff8a3d); transition: height .6s; border-radius: 99px; }
.lab-ctl { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.lab-b { font-size: var(--step-1); padding: 8px 22px; font-weight: 800; }
.lab-b.heat { background: #fff1e6; border-color: #ff8a3d; }
.lab-b.cool { background: #e8f6ff; border-color: #12a3e3; }
.lab-b:disabled { opacity: .4; cursor: default; }
.lab-cap { min-height: 2.6em; text-align: center; font-size: var(--step-1); font-weight: 700; margin: 0; max-width: 34em; }

/* care */
.cr-box { display: grid; grid-template-columns: minmax(170px, 1fr) 1.2fr; gap: 14px; align-items: center; }
@media (max-width: 560px) { .cr-box { grid-template-columns: 1fr; } }
.cr-who { position: relative; display: grid; justify-items: center; gap: 4px; padding: 14px; border-radius: 24px; background: radial-gradient(circle at 50% 40%, #fff, #eaf7e3); border: 4px dashed #8ccf6e; min-height: 200px; align-content: center; }
.cr-who.drop-over { background: #dff3d5; border-style: solid; }
.cr-who img { max-height: 170px; max-width: 100%; object-fit: contain; pointer-events: none; }
.cr-e { font-size: 6rem; line-height: 1.05; }
.cr-who b { font-size: var(--step-1); font-weight: 800; }
.cr-face { position: absolute; top: 8px; inset-inline-end: 12px; font-size: 2.4rem; }
.cr-who.pop { animation: pop .4s; } .cr-who.wrong { animation: shake .4s; }
.cr-meters { display: grid; gap: 10px; }
.cr-m { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "ic lab" "ic bar"; column-gap: 10px; align-items: center; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 6px 12px; }
.cr-ic { grid-area: ic; font-size: 2rem; }
.cr-m b { grid-area: lab; font-weight: 700; }
.cr-bar { grid-area: bar; height: 12px; background: #e4edf4; border-radius: 99px; overflow: hidden; display: block; }
.cr-bar i { display: block; height: 100%; width: 8%; background: #ff8a3d; transition: width .7s; border-radius: 99px; }
.cr-m.full { border-color: var(--ok); background: var(--ok-soft); }
.cr-m.full .cr-bar i { width: 100%; background: var(--ok); }
.cr-say { text-align: center; font-weight: 700; min-height: 1.8em; margin: 10px 0; font-size: var(--step-1); }
.cr-say.ok { color: var(--ok); } .cr-say.no { color: var(--bad); }
.cr-tray { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.cr-item.used { display: none; }

/* board */
.bd-box { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 700px) { .bd-box { grid-template-columns: 1fr; } }
.bd-path { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 10px; border-radius: 18px; background: #fff7df; border: 3px solid #f5c84c; }
.bd-cell { aspect-ratio: 1; border-radius: 12px; background: #fff; border: 2px solid #f2dc9a; display: grid; place-items: center; position: relative; font-weight: 800; color: #b08a1e; font-size: 1.1rem; }
.bd-cell.start { background: #e6f6fe; border-color: #12a3e3; } .bd-cell.end { background: #e8f8ee; border-color: var(--ok); font-size: 1.6rem; }
.bd-cell.star { background: #fffbe8; }
.bd-token { position: absolute; font-size: 2rem; z-index: 2; animation: pop .3s; filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
.bd-side { display: grid; gap: 10px; justify-items: center; }
.bd-die { font-size: 3.4rem; line-height: 1; border: 3px solid #12a3e3; border-radius: 18px; background: #fff; padding: 6px 16px; cursor: pointer; box-shadow: 0 4px 0 #0d6e9a; }
.bd-die:disabled { opacity: .45; cursor: default; box-shadow: none; }
.bd-die.pop { animation: pop .4s; }
.bd-panel { width: 100%; display: grid; gap: 8px; }
.bd-panel .qz-q p { font-size: var(--step-1); font-weight: 700; margin: 0; text-align: center; }
.bd-msg { text-align: center; font-weight: 800; margin: 0; color: var(--bad); }
.bd-msg.ok { color: var(--ok); }

/* ===== book 7 theme: the turquoise frame of the grade-2 science book ===== */
:root { --sky: #bdeee6; --page: #f2fbf9; --line: #cfe9e4; --pink: #17a398; --pink-deep: #0f7f76; --red: #e3262e; }
.band { background: linear-gradient(180deg, #7fd6c9 0%, #d6f4ee 55%, var(--page) 100%); }
.hero h1 { text-shadow: 0 3px 0 #0f7f76, 0 0 18px rgba(15,127,118,.35); }
.hero p { color: #0d5f58; }
.hero .tile { box-shadow: 10px 10px 0 #c3ece5, -8px -8px 0 #ffe7a8; }
.quickbar { border-bottom-color: #bfe7df; }
.qz-bar { background: #d9f3ee; }
.qz-bar i { background: linear-gradient(90deg, #17a398, #ffd23f); }
.chapter:nth-child(1) .chapter-h { background: #17a398; } .chapter:nth-child(2) .chapter-h { background: #1f8fd6; } .chapter:nth-child(3) .chapter-h { background: #e8578f; }
.rb-i.c1 { background: #ecfaf7; border-color: #bfe7df; } .rb-i.c1 b { color: #0f7f76; }

/* pick groups: a row of small pictures beside the question */
.pick-q-imgs { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; flex-basis: 100%; }
.pick-row.withpic .pick-q-imgs .pick-q-img { width: 110px; max-height: 110px; }

/* read: a link out of the book (a short video the book points to with a QR code) */
.rb-link { text-align: center; margin: 10px 0; }
.rb-link a { display: inline-block; background: #e53935; color: #fff; font-weight: 800; padding: 10px 22px; border-radius: 999px; text-decoration: none; box-shadow: 0 4px 0 #b71c1c; }

/* sort with big pictures */
.sort-big .chip.pic { width: 150px; } .sort-big .chip.pic img { width: 136px; height: 118px; }
.sort-big .bins .chip.pic { width: 118px; } .sort-big .bins .chip.pic img { width: 104px; height: 90px; }
@media (max-width: 480px) { .sort-big .chip.pic { width: 140px; } .sort-big .chip.pic img { width: 126px; height: 110px; } }

/* pick rows: an arrow between "before" and "after" pictures */
.pick-arrow { align-self: center; font-size: 2rem; color: var(--sky-deep); font-weight: 900; }
/* find: coloured rings (red = glass, yellow = wood, blue = rubber ...) */
.fd-spot.ok { border-color: var(--fd, #1e9e58); background: color-mix(in srgb, var(--fd, #1e9e58) 14%, transparent); }
.fd-tag { background: var(--fd, #1e9e58); }

/* tank: float or sink */
.tk { display: grid; gap: 12px; justify-items: center; }
.tk-top { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; min-height: 112px; }
.tk-card { min-width: 130px; display: grid; justify-items: center; }
.tk-card .th { display: inline-grid; justify-items: center; gap: 4px; padding: 8px 14px; border: 3px solid var(--line); border-radius: 20px; background: #fff; animation: ruIn .35s ease-out; }
.tk-card .th-e { font-size: 3.4rem; }
.tk-card .th img { width: 96px; height: 86px; object-fit: contain; }
.tk-card .th b { font-size: 1.15rem; }
.tk-ctl { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.tk-ctl[hidden] { display: none; }
.tk-b { font-size: 1.2rem; padding: .5em 1.1em; border-width: 3px; }
.tk-b.float { background: #e6f6fe; border-color: #1572c4; color: #0d4f8a; }
.tk-b.sink { background: #f4ede4; border-color: #8a6440; color: #5a3d22; }
.tk-say { margin: 0; min-height: 1.6em; font-size: 1.15rem; font-weight: 700; text-align: center; }
.tk-say.ok { color: var(--ok); }
.tk-say.no { color: #c0392b; }
.tk-tank { position: relative; width: min(100%, 540px); height: 280px; border: 5px solid #a7d3ec; border-top: 0; border-radius: 0 0 36px 36px; overflow: hidden;
  background: linear-gradient(#f7fcff, #eef8fe); box-shadow: 0 6px 0 #d4ebf7; }
.tk-water { position: absolute; left: 0; right: 0; bottom: 0; top: 30%; background: linear-gradient(rgba(120, 205, 245, .78), rgba(36, 132, 205, .9)); }
.tk-wave { position: absolute; left: 0; right: 0; top: -7px; height: 14px; background: radial-gradient(ellipse 12px 7px at 12px 7px, rgba(120, 205, 245, .78) 98%, transparent 100%) repeat-x; background-size: 24px 14px; animation: tkWave 2.6s linear infinite; }
@keyframes tkWave { to { background-position: 24px 0; } }
.tk-obj { position: absolute; top: -80px; width: 64px; display: grid; justify-items: center; z-index: 2; transition: top 1.05s cubic-bezier(.3, .2, .4, 1.25); }
.tk-obj b { display: none; }
.tk-obj .th-e { font-size: 2.8rem; }
.tk-obj img { width: 60px; height: 60px; object-fit: contain; }
.tk-obj.fl { top: calc(30% - 40px); animation: tkBob 2.4s ease-in-out 1.1s infinite; }
.tk-obj.sk { top: calc(100% - 66px); transition: top 1.2s cubic-bezier(.55, .1, .85, .7); }
@keyframes tkBob { 50% { transform: translateY(6px) rotate(5deg); } }
.tk-splash { position: absolute; top: calc(30% - 18px); width: 64px; height: 30px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .9); animation: tkSplash .7s ease-out forwards; z-index: 3; pointer-events: none; }
@keyframes tkSplash { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.8, 1.2); opacity: 0; } }
.tk-table { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: min(100%, 540px); }
.tk-table > div { border: 3px dashed #b9dcef; border-radius: 18px; padding: 8px; min-height: 84px; text-align: center; background: #fbfeff; }
.tk-table > .tk-ts { border-color: #d8c3a8; background: #fffaf3; }
.tk-table b { font-size: .95rem; }
.tk-col { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 6px; }
.tk-mini { display: inline-grid; justify-items: center; font-size: .82rem; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 3px 6px; animation: ruIn .3s ease-out; }
.tk-mini .th-e { font-size: 1.5rem; }
.tk-mini img { width: 40px; height: 40px; object-fit: contain; }
@media (prefers-reduced-motion: reduce) { .tk-obj, .tk-obj.fl, .tk-obj.sk { transition: none; animation: none; } .tk-wave { animation: none; } }
.pick-letter:empty { display: none; }
/* find: a wide picture can be swiped sideways on phones, so the small things are big enough to tap */
.fd-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; border-radius: 16px; }
.fd-swipe { display: none; margin: 4px 0 0; text-align: center; font-size: .9rem; color: var(--muted, #667); }
@media (max-width: 700px) { .fd-scroll .fd-pic { width: 680px; max-width: none !important; } .fd-swipe { display: block; } }
.bins { grid-template-columns: repeat(auto-fit, minmax(min(104px, 100%), 1fr)); }
/* soak: eggshells in drinks */
.sk { display: grid; gap: 12px; }
.sk-clock { justify-self: center; display: flex; align-items: center; gap: 8px; background: #fff7d6; border: 2px solid #f0c94a; border-radius: 999px; padding: 4px 16px; font-size: 1.1rem; }
.sk-clock .sk-sky { font-size: 1.5rem; display: inline-block; }
.sk-clock.run .sk-sky { animation: skSpin .75s linear infinite; }
@keyframes skSpin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.sk-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: start; }
.sk-box { display: grid; justify-items: center; gap: 6px; text-align: center; border-radius: 16px; padding: 8px 4px; border: 3px solid transparent; transition: border-color .2s, background .2s; }
.sk-box.on { border-color: #3b82f6; background: #eaf2ff; }
.sk-cup { background: none; border: 0; padding: 0; cursor: pointer; width: min(110px, 100%); }
.sk-glass { display: block; position: relative; height: 140px; border: 4px solid #9fb6c9; border-top: 0; border-radius: 0 0 22px 22px; background: rgba(230, 244, 255, .5); overflow: hidden; }
.sk-liq { position: absolute; inset: auto 0 0 0; height: 72%; opacity: .92; }
.sk-shell { position: absolute; left: 50%; width: 46px; height: 34px; margin-left: -23px; top: -120px; background: #fffdf6; border: 2px solid #e6dcc4;
  border-radius: 50% 50% 46% 46% / 30% 30% 70% 70%; box-shadow: inset 0 -6px 0 rgba(0,0,0,.06); transition: top .7s cubic-bezier(.3,1.4,.6,1), background 2.8s, filter 2.8s, transform 2.8s, border-color 2.8s; }
.sk-box.in .sk-shell { top: 52%; }
.sk-box.fx-stain .sk-shell { background: #8a5426; border-color: #5d3415; }
.sk-box.fx-soft .sk-shell { background: radial-gradient(circle at 30% 40%, #c98a2a 0 5px, transparent 6px), radial-gradient(circle at 70% 60%, #c98a2a 0 4px, transparent 5px), radial-gradient(circle at 55% 25%, #d99a3a 0 3px, transparent 4px), #f6e2a8;
  border-color: #d4a84e; transform: scale(.88) rotate(-6deg); }
.sk-box.out .sk-shell { top: -40px; }
.sk-box.out .sk-glass { overflow: visible; }
.sk-name { font-size: 1.02rem; }
.sk-res { margin: 0; min-height: 1.4em; font-size: .95rem; line-height: 1.5; border-radius: 10px; padding: 0 4px; }
.sk-res.ok { background: #e7f8ea; color: #1d6b2c; }
.sk-res.bad { background: #fdeceb; color: #a1281d; }
.sk-ctl { display: flex; justify-content: center; }
.sk-go { font-size: 1.1rem; padding: 10px 18px; }
@media (max-width: 420px) { .sk-glass { height: 110px; } .sk-shell { width: 38px; height: 28px; margin-left: -19px; } .sk-name { font-size: .92rem; } .sk-res { font-size: .85rem; } }
@media (prefers-reduced-motion: reduce) { .sk-shell { transition: none; } .sk-clock.run .sk-sky { animation: none; } }
/* info card with a scene picture on top (wide: True) */
.rb-i.wide { flex-direction: column; align-items: stretch; }
.rb-i.wide img { width: 100%; height: auto; max-height: 230px; object-fit: contain; mix-blend-mode: normal; border-radius: 12px; }
.pl-food .pl-e { display: block; font-size: 2.1rem; line-height: 1.2; }
.rb-i.wide .rb-pic { align-self: center; width: min(100%, 320px) !important; }
.rb-i.wide > div:last-child:has(> b:only-child) b { text-align: center; }

/* ===== book 8 theme: the green frame of the grade-3 science book ===== */
:root { --sky: #cdeeb4; --page: #f5fbef; --line: #d6ecc6; --pink: #4aa82a; --pink-deep: #2f7d16; --red: #e3262e; }
.band { background: linear-gradient(180deg, #a6dc7e 0%, #e2f5d2 55%, var(--page) 100%); }
.hero h1 { text-shadow: 0 3px 0 #2f7d16, 0 0 18px rgba(47,125,22,.35); }
.hero p { color: #2c5e14; }
.hero .tile { box-shadow: 10px 10px 0 #d3efbd, -8px -8px 0 #ffe7a8; }
.quickbar { border-bottom-color: #cbe8b4; }
.qz-bar { background: #e3f4d6; }
.qz-bar i { background: linear-gradient(90deg, #4aa82a, #ffd23f); }
.chapter:nth-child(1) .chapter-h { background: #4aa82a; } .chapter:nth-child(2) .chapter-h { background: #1f8fd6; }
.chapter:nth-child(3) .chapter-h { background: #e8578f; } .chapter:nth-child(4) .chapter-h { background: #6a4fc8; }
.rb-i.c1 { background: #f1faea; border-color: #cbe8b4; } .rb-i.c1 b { color: #2f7d16; }

/* ----- grow ----- */
.gr { display: grid; gap: 10px; justify-items: center; }
.gr-day { font-family: var(--round); font-size: 1.35rem; background: #fff7d6; border: 2px solid #f1d98a; border-radius: 999px; padding: 2px 18px; }
.gr-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; width: 100%; }
.gr-box { display: grid; justify-items: center; gap: 4px; width: 150px; padding: 8px 6px; border: 3px solid transparent; border-radius: 20px; }
.gr-box.on { border-color: var(--sky-deep); background: #eef8fe; }
.gr-box.best { border-color: var(--ok); background: var(--ok-soft); }
.gr-pot { position: relative; width: 120px; height: 250px; border: 0; background: linear-gradient(#fdfefe, #eef7ff); border-radius: 16px; cursor: pointer; padding: 0; overflow: hidden; }
.gr-pot.dark { background: linear-gradient(#3a3f55, #262a3a); }
.gr-base { position: absolute; bottom: 0; left: 50%; width: 84px; height: 54px; transform: translateX(-50%); background: linear-gradient(#d0773f, #a8562a);
  clip-path: polygon(0 0, 100% 0, 86% 100%, 14% 100%); }
.gr-base::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 10px; background: #6b4426; }
.gr-plant { position: absolute; bottom: 50px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.gr-stem { position: relative; display: block; width: 6px; height: 6px; background: #3fae49; border-radius: 3px; font-style: normal; }
.gr-leaf { position: absolute; width: 22px; height: 11px; background: #4cc357; border-radius: 0 100% 0 100%; opacity: 0; transition: opacity .4s, background .6s, transform .6s; font-style: normal; }
.gr-leaf.a { top: 6%; right: 4px; transform: rotate(-24deg); } .gr-leaf.b { top: 6%; left: 4px; transform: scaleX(-1) rotate(-24deg); }
.gr-leaf.c { top: 45%; right: 4px; transform: rotate(-18deg); } .gr-leaf.d { top: 55%; left: 4px; transform: scaleX(-1) rotate(-18deg); }
.gr-plant .gr-leaf.a, .gr-plant .gr-leaf.b { opacity: 1; }
.gr-plant.grown .gr-leaf { opacity: 1; }
.gr-plant.sad .gr-stem { background: #b49a4a; } .gr-plant.sad .gr-leaf { background: #cdb460; }
.gr-plant.sad .gr-leaf.a, .gr-plant.sad .gr-leaf.c { transform: rotate(40deg); } .gr-plant.sad .gr-leaf.b, .gr-plant.sad .gr-leaf.d { transform: scaleX(-1) rotate(40deg); }
.gr-fruits { font-size: 1rem; line-height: 1; max-width: 70px; text-align: center; min-height: 1em; }
.gr-name { font-size: 1rem; text-align: center; line-height: 1.35; }
.gr-tags { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; }
.gr-tags span { font-size: .8rem; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; }
.gr-res { margin: 0; font-size: .9rem; font-weight: 700; text-align: center; min-height: 0; }
@media (max-width: 560px) { .gr-box { width: 46%; } .gr-pot { width: 104px; } }

/* ----- circuit drawing ----- */
.cc { position: relative; width: min(100%, 460px); margin: 0 auto; }
.cc-svg { display: block; width: 100%; height: auto; }
.cc-wire { fill: none; stroke: #c0392b; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.cc-flow { fill: none; stroke: #ffe066; stroke-width: 3; stroke-dasharray: 2 12; stroke-linecap: round; opacity: 0; }
.cc.on .cc-flow { opacity: 1; animation: ccFlow .5s linear infinite; }
@keyframes ccFlow { to { stroke-dashoffset: -14; } }
.cc-glass { fill: #eef3f7; stroke: #8796a5; stroke-width: 2; transition: fill .3s; }
.cc-fil { stroke: #7a6a50; stroke-width: 1.6; }
.cc-halo { fill: rgba(255, 226, 80, 0); transition: fill .3s; }
.cc.on .cc-glass { fill: #fff27a; } .cc.on .cc-fil { stroke: #ff8a00; } .cc.on .cc-halo { fill: rgba(255, 226, 80, .45); }
.cc-clip { fill: #4a5563; }
.cc-lever { stroke: #4a5563; stroke-width: 5; stroke-linecap: round; transform-box: view-box; transform-origin: 250px 196px; transform: rotate(-32deg); transition: transform .25s; }
.cc.closed .cc-lever { transform: rotate(0deg); }
.cc.gap .cc-sw { display: none; }
.cc.build .cc-gap { display: none; }
.cc.build .cc-bat, .cc.build .cc-bulb, .cc.build .cc-sw { opacity: 0; transition: opacity .3s; }
.cc.build.has-bat .cc-bat, .cc.build.has-bulb .cc-bulb, .cc.build.has-sw .cc-sw { opacity: 1; }
.cc-slot { position: absolute; transform: translate(-50%, -50%); min-width: 74px; min-height: 52px; border: 3px dashed #8aa6bf; border-radius: 14px; background: rgba(255, 255, 255, .85);
  display: grid; place-items: center; font-weight: 800; color: #6a8aa6; font-size: 1.4rem; }
.cc-slot.drop-over { border-color: var(--sky-deep); background: #eaf7ff; }
.cc-slot.ok { background: transparent; border-color: transparent; min-height: 0; transform: translate(-50%, 70%); }
.cc-slot.ok b { font-size: .85rem; color: var(--ink); background: #fff; border-radius: 999px; padding: 0 8px; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.cc-slot[style*="top:18%"].ok { transform: translate(-50%, -150%); }
.ccw .cc-pool { justify-content: center; }
.cc-swb[hidden] { display: none; }

/* ----- probe (magnet / circuit / dissolve / heat) ----- */
.pb { position: relative; width: min(100%, 460px); min-height: 230px; }
.pb-hold { position: absolute; z-index: 3; display: grid; justify-items: center; transition: all .8s cubic-bezier(.3, .2, .4, 1.2); }
.pb-th { display: grid; justify-items: center; font-style: normal; }
.pb-th b { display: none; }
.pb-th .th-e { font-size: 2.6rem; font-style: normal; }
.pb-th img { width: 62px; height: 62px; object-fit: contain; }
/* circuit: the thing sits in the gap */
.pb-circuit .pb-hold { left: 71%; top: 83%; transform: translate(-50%, -110%) scale(.4); opacity: 0; }
.pb-circuit.go .pb-hold { transform: translate(-50%, -62%) scale(1); opacity: 1; }
/* magnet: the magnet comes down; a magnetic thing jumps up to it */
.pb-magnet { min-height: 250px; }
.pb-desk { position: absolute; bottom: 0; left: 8%; right: 8%; height: 26px; background: linear-gradient(#c99b6d, #a87a4d); border-radius: 8px; }
.pb-mag { position: absolute; top: 0; left: 50%; width: 90px; height: 64px; transform: translateX(-50%); transition: top .6s ease-in-out; z-index: 4;
  border: 18px solid #d63a3a; border-bottom: 0; border-radius: 45px 45px 0 0; box-sizing: border-box; }
.pb-mag i { position: absolute; bottom: -18px; width: 18px; height: 18px; font-style: normal; font-weight: 900; font-size: .8rem; color: #fff; display: grid; place-items: center; background: #9aa3ad; }
.pb-mag-n { left: -18px; } .pb-mag-s { right: -18px; }
.pb-magnet.down .pb-mag { top: 70px; }
.pb-magnet .pb-hold { bottom: 26px; left: 50%; transform: translateX(-50%); opacity: 0; }
.pb-magnet.go .pb-hold { opacity: 1; }
.pb-magnet.on .pb-hold { bottom: 132px; transition: bottom .35s cubic-bezier(.5, -0.2, .7, 1.4); }
/* dissolve: a glass of water and a stirring spoon */
.pb-dissolve { display: grid; place-items: center; }
.pb-glass { position: relative; width: 160px; height: 210px; border: 5px solid #a7d3ec; border-top: 0; border-radius: 0 0 26px 26px; background: rgba(255,255,255,.6); overflow: visible; }
.pb-water { position: absolute; left: 0; right: 0; bottom: 0; height: 74%; background: rgba(120, 205, 245, .55); border-radius: 0 0 22px 22px; transition: background 1.6s; }
.pb-dissolve .pb-hold { left: 50%; top: -70px; transform: translateX(-50%); }
.pb-dissolve.go .pb-hold { top: 34%; }
.pb-dissolve.melt .pb-hold { opacity: 0; transform: translateX(-50%) scale(.2); transition: all 1.8s ease-in; }
.pb-dissolve.sink .pb-hold { top: 72%; }
.pb-dissolve.float .pb-hold { top: 14%; }
.pb-stir { position: absolute; top: -40px; left: 62%; width: 8px; height: 200px; background: linear-gradient(#cfd6dd, #9aa3ad); border-radius: 4px; transform-origin: 50% 100%; transform: rotate(14deg); z-index: 4; }
.pb-dissolve.go .pb-stir { animation: stir .5s ease-in-out 3 alternate .9s; }
@keyframes stir { from { transform: rotate(14deg) translateX(0); } to { transform: rotate(-8deg) translateX(-40px); } }
/* heat: a spoon in a cup of hot water */
.pb-heat { min-height: 260px; }
.pb-cup { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 170px; height: 120px; border: 5px solid #e9edf2; border-top: 0; border-radius: 0 0 40px 40px; background: #fff; }
.pb-hot { position: absolute; left: 0; right: 0; bottom: 0; height: 80%; background: linear-gradient(#ff9f80, #e8553a); border-radius: 0 0 34px 34px; opacity: .8; }
.pb-steam { position: absolute; top: -40px; width: 10px; height: 34px; border-radius: 50%; border-left: 4px solid rgba(160, 170, 180, .6); animation: steam 2s ease-in-out infinite; }
.pb-steam.a { left: 30%; } .pb-steam.b { left: 50%; animation-delay: .6s; } .pb-steam.c { left: 70%; animation-delay: 1.2s; }
@keyframes steam { 0% { transform: translateY(10px); opacity: 0; } 50% { opacity: 1; } 100% { transform: translateY(-14px); opacity: 0; } }
.pb-heat .pb-hold { left: 50%; bottom: 40px; transform: translate(-50%, -60px) rotate(18deg); opacity: 0; transform-origin: 50% 100%; }
.pb-heat.go .pb-hold { opacity: 1; transform: translate(-50%, 0) rotate(18deg); }
.pb-spoon { position: relative; display: block; width: 16px; height: 190px; border-radius: 8px; background: var(--c); overflow: visible; }
.pb-spoon::after { content: ""; position: absolute; bottom: -18px; left: 50%; width: 38px; height: 46px; transform: translateX(-50%); border-radius: 50%; background: var(--c); }
.pb-spoon .pb-glow { position: absolute; left: 0; right: 0; bottom: -18px; height: 0; border-radius: 8px; background: linear-gradient(0deg, rgba(232, 60, 30, .95), rgba(255, 140, 40, .75)); transition: height 1.8s ease-in; z-index: 1; min-height: 0; }
.pb-heat.go .pb-spoon .pb-glow { height: 30%; }
.pb-heat.on .pb-spoon .pb-glow { height: calc(100% + 18px); }
.pb-sname { position: absolute; top: -26px; white-space: nowrap; font-size: .9rem; background: #fff; border-radius: 999px; padding: 0 8px; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.pb-hand { position: absolute; top: 6px; inset-inline-start: 4%; font-weight: 800; font-size: 1.05rem; background: #fff; border-radius: 14px; padding: 4px 10px; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.pb-hand:empty { display: none; }
.pb-yes { background: #fff7d6; border-color: #e0a800; color: #6b5200; }
.pb-no { background: #eef1f4; border-color: #8a96a3; color: #3b4652; }
@media (prefers-reduced-motion: reduce) { .pb-hold, .pb-mag, .pb-stir, .pb-spoon .pb-glow { transition: none !important; animation: none !important; } }

/* ----- moon ----- */
.mn { display: grid; gap: 10px; justify-items: center; }
.mn-task { margin: 0; font-weight: 800; font-size: 1.15rem; text-align: center; background: #fff7d6; border: 2px solid #f1d98a; border-radius: 14px; padding: 6px 14px; }
.mn-task:empty { display: none; }
.mn-stage { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; width: 100%; }
.mn-sky { display: grid; justify-items: center; gap: 4px; background: radial-gradient(circle at 30% 20%, #2a3a74, #0d1433); border-radius: 22px; padding: 14px 24px; color: #fff; min-width: 220px; }
.mn-moon { width: 150px; height: 150px; filter: drop-shadow(0 0 14px rgba(255, 244, 191, .35)); }
.mn-name { font-size: 1.35rem; color: #ffe27a; font-family: var(--round); }
.mn-day { font-size: .95rem; opacity: .9; }
.mn-orbit { width: 170px; background: #0d1433; border-radius: 22px; padding: 6px; }
.mn-orbit svg { display: block; width: 100%; }
.mn-range { direction: ltr; width: min(100%, 460px); accent-color: #e0a800; height: 30px; }
.mn-strip { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; direction: ltr; }
.mn-mini { border: 0; background: #0d1433; border-radius: 10px; padding: 3px 4px 1px; display: grid; justify-items: center; color: #fff; cursor: pointer; }
.mn-mini small { font-size: .7rem; }
.mn-mini svg { display: block; }
.mn-mini .mn-moon { width: 30px; height: 30px; filter: none; }

/* ----- spin (day and night / seasons) ----- */
.sp { display: grid; gap: 10px; justify-items: center; }
.sp-info { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; align-items: center; }
.sp-status { font-size: 1.4rem; font-family: var(--round); background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: 2px 18px; }
.sp-clock { font-weight: 700; }
.sp-stage { width: min(100%, 440px); background: radial-gradient(circle at 70% 30%, #1b2a5c, #0a0f26); border-radius: 22px; padding: 6px; }
.sp-stage svg { display: block; width: 100%; height: auto; }
.sp-stage.orbit { background: radial-gradient(circle, #24346e, #0a0f26); }

/* ----- fire triangle ----- */
.fr { display: grid; gap: 12px; justify-items: center; }
.fr-tri { position: relative; width: 300px; height: 250px; }
.fr-tri::before { content: ""; position: absolute; left: 30px; right: 30px; top: 20px; bottom: 40px; clip-path: polygon(50% 0, 100% 100%, 0 100%); background: #ffe2d1; }
.fr-s { position: absolute; font-weight: 800; font-size: .92rem; background: #fff; border: 3px solid #e8553a; border-radius: 999px; padding: 2px 10px; white-space: nowrap; transition: all .4s; }
.fr-s.fuel { bottom: 4px; left: 50%; transform: translateX(-50%); }
.fr-s.air { top: 70px; right: -6px; } .fr-s.heat { top: 70px; left: -6px; }
.fr-tri.fuel .fr-s.fuel, .fr-tri.air .fr-s.air, .fr-tri.heat .fr-s.heat { opacity: .35; text-decoration: line-through; border-color: #9aa3ad; filter: grayscale(1); }
.fr-flame { position: absolute; left: 50%; top: 92px; transform: translateX(-50%); font-size: 4.2rem; line-height: 1; animation: flick .5s ease-in-out infinite alternate; transition: opacity 1.2s, transform 1.2s; }
@keyframes flick { to { transform: translateX(-50%) scale(1.08, .94); } }
.fr-tri.out .fr-flame { opacity: 0; transform: translateX(-50%) scale(.2); animation: none; }
.fr-tri.out::after { content: "💨"; position: absolute; left: 50%; top: 96px; transform: translateX(-50%); font-size: 3rem; animation: ruIn .6s ease-out; }
.fr-q { display: flex; gap: 10px; align-items: center; justify-content: center; text-align: center; max-width: 34em; }
.fr-q p { margin: 0; font-size: 1.2rem; font-weight: 800; }
.fr-e { font-size: 2.6rem; }
.fr-opts { display: grid; gap: 8px; width: min(100%, 520px); }
.fr-o { font-size: 1.05rem; padding: .55em 1em; text-align: center; }
.fr-o.ok { border-color: var(--ok); background: var(--ok-soft); }
@media (max-width: 400px) { .fr-tri { transform: scale(.9); } }

/* ----- watch (time-lapse experiments) ----- */
.wt { display: grid; gap: 10px; justify-items: center; }
.wt-opts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.wt-o { font-size: 1.05rem; }
.wt-o.on { border-color: var(--accent, #4aa82a); background: #eaf7e4; }
.wt-o.ok { border-color: var(--ok); background: var(--ok-soft); }
.wt-main { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: center; width: 100%; }
.wt-stage { width: min(100%, 300px); background: linear-gradient(#eaf6ff, #fdfdf6); border: 3px solid var(--line); border-radius: 22px; padding: 6px; }
.wt-stage svg { display: block; width: 100%; height: auto; }
.wt-side { display: grid; gap: 8px; justify-items: center; max-width: 280px; }
.wt-note { margin: 0; min-height: 3.2em; font-size: 1.08rem; font-weight: 700; text-align: center; background: #fff; border: 2px dashed var(--line); border-radius: 16px; padding: 8px 12px; }
.wt-ctl { display: flex; gap: 10px; align-items: center; width: min(100%, 520px); }
.wt-range { flex: 1; accent-color: #4aa82a; height: 28px; direction: rtl; }
.wt-p { transition: fill .2s; stroke: rgba(0,0,0,.12); stroke-width: 1.5; }

/* calibri-fix: keep answer lines inside their card with the wider font */
.w-item { grid-template-columns: minmax(0, 1fr); }
.w-line { max-width: 100%; min-width: 0; }
.w-line input { min-width: 0; }
/* /calibri-fix */
