/* 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 (built by interactive-book-4b-src/mkcss4.py).
   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;
  --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 Sans Hebrew", 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; }
[lang="ar"] { font-family: "Calibri Book", Calibri, Arial, sans-serif; }
.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; }

/* 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 #b8dc8c; }
.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 #b8dc8c; 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 #b8dc8c; 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; }


/* =====================================================================
   Book 4 (אופק לעתיד ד׳): green theme, read-along, vocabulary, grade-4 games
   ===================================================================== */
:root {
  --sky: #d8f0b8; --sky-deep: #1f8fd6; --red: #e8424e; --page: #f6fbef; --line: #d7e9c2; --sun: #ffd23f;
  --lime: #8cc63f; --leaf: #4c9a1f; --leaf-deep: #2f7412; --orange: #f39200; --blue: #1f8fd6; --pink: #e8424e; --pink-deep: #c92f3b;
  --round: "Calibri Book", Calibri, Arial, sans-serif;
}
body { line-height: 1.9; }
.band { background: linear-gradient(180deg, #a6d86a 0%, #e3f4cf 58%, var(--page) 100%); }
.hero h1, .ex-head h2, .qb-home, .btn, .toc .n, .bl-hud, .qz, .chapter-h, .fw-hud, .rc, .ld, .cw-h { font-family: var(--round); }
.hero h1 { color: #fff; text-shadow: 0 3px 0 var(--leaf-deep), 0 0 18px rgba(47,116,18,.35); font-weight: 800; font-size: clamp(2rem, 6.6vw, 3.3rem); line-height: 1.35; }
.hero p { color: #2f5a17; font-weight: 600; }
.hero .tile { font-size: 3rem; box-shadow: 10px 10px 0 #cfe9ad, -8px -8px 0 #ffd9a0; border-radius: 22px; }
.ex-head h2 { font-weight: 700; line-height: 1.6; }
.num { background: var(--leaf); border-radius: 50%; }
.ex.game { background: linear-gradient(180deg, #fff 0%, #fff6dc 100%); border: 3px solid #f6c445; border-radius: 22px; padding: 22px 18px; margin-block: 14px; }
.ex.game .num { background: var(--orange); }
.btn { font-weight: 600; }
.btn.big { font-size: 1.25rem; 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: #cfe6b4; }
.qb-home { background: var(--leaf); }
.qb-list .l { color: var(--leaf); min-width: 1.8em; }
.tf-img { width: 84px; height: 64px; object-fit: contain; flex: none; mix-blend-mode: multiply; }
.read-text { line-height: 2.15; }
.toc .l { color: var(--leaf); font-size: 1.6rem; }
.chapter:nth-child(1) .chapter-h { background: #e8424e; } .chapter:nth-child(2) .chapter-h { background: #f39200; }
.chapter:nth-child(3) .chapter-h { background: #1f8fd6; } .chapter:nth-child(4) .chapter-h { background: #8a4fd8; }
.chapter:nth-child(5) .chapter-h { background: #3f9b1c; } .chapter:nth-child(6) .chapter-h { background: #0f9aa8; }
.chapter:nth-child(7) .chapter-h { background: #6b7c93; }
.bin.basket { border-color: #b8dc8c; }

/* the book's sections: a coloured label before the exercise title */
.ex-head .tag { display: inline-block; font: 700 .85rem/1.6 var(--round); color: #fff; background: var(--red); padding: 0 .7em; border-radius: 999px; margin-inline-end: .5em; vertical-align: .15em; }
.ex.k-speak .ex-head .tag { background: var(--orange); }
.ex.k-lang .ex-head .tag { background: #e8424e; }
.ex.k-write .ex-head .tag { background: #1f8fd6; }
.ex.k-research .ex-head .tag { background: #8a4fd8; }
.ex.k-riddle .ex-head .tag { background: #e6177e; }
.ex.k-read .ex-head .tag { background: var(--leaf); }

/* reading texts */
.read-text .by { font-size: .9rem; color: var(--ink-soft); text-align: left; }
.read-h { margin: 6px 0 0; font: 800 1.5rem/1.4 var(--round); color: var(--red); text-align: center; }
.read.poem .read-text, .read-text.poem { text-align: center; }
.ra { background: linear-gradient(180deg, #f1fae6, #fff); border: 2px solid #cfe6b4; border-radius: 18px; padding: 10px 14px; display: grid; gap: 6px; }
.ra-head { display: flex; align-items: center; gap: 8px; font: 700 1.1rem var(--round); color: var(--leaf-deep); }
.ra-ic { font-size: 1.5rem; }
.ra.on .ra-ic { animation: sndpulse .8s ease-in-out infinite alternate; border-radius: 50%; }
.ra-player { margin: 0; }
.ra-speed { border: 2px solid var(--line); background: #fff; border-radius: 999px; font: 700 .95rem var(--round); padding: 2px 10px; cursor: pointer; color: var(--leaf-deep); flex: none; }
.ra-note { margin: 0; font-size: .92rem; color: var(--ink-soft); }
.ra-s { border-radius: 8px; transition: background-color .25s, box-shadow .25s; cursor: pointer; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.ra-s:hover { background: #f1f7e9; }
.ra-s.now { background: #fff1a8; box-shadow: 0 0 0 3px #fff1a8; }
@media (prefers-reduced-motion: reduce) { .ra.on .ra-ic { animation: none; } }

/* vocabulary box (בַּטֶּקְסְט הַזֶּה לָמַדְנוּ) */
.vocab { background: #f0f3f6; border-radius: 18px; padding: 10px 14px 14px; border-inline-start: 8px solid var(--lime); }
.vocab-t { display: block; font: 700 1.1rem var(--round); color: var(--leaf-deep); margin-bottom: 6px; }
.vocab-g { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.vocab-i { display: flex; flex-wrap: wrap; justify-content: space-between; column-gap: 10px; background: #fff; border-radius: 12px; padding: 4px 10px; align-items: baseline; }
.vocab-i .vh, .vocab-i .va { white-space: nowrap; }
.vocab-i .vh { font-weight: 700; }
.vocab-i .va { color: #355d8c; font-size: 1.05rem; }
.rb-box { background: #fff8e1; border: 2px dashed #f2c94c; border-radius: 18px; padding: 10px 16px; }
.rb-box-t { display: block; font: 700 1.15rem var(--round); color: #b35c00; }
.rb-box.rule { background: #fff; border: 3px solid #e8424e; border-style: solid; }
.rb-box.rule .rb-box-t { color: #e8424e; }
.rb-box.ex { background: #f1fae6; border-color: #9fd36a; }
.rb-box p { margin: 0; font-size: var(--step-0); font-weight: 500; line-height: 1.9; }

/* ---------- crossword ---------- */
.cw { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.4fr) minmax(220px, 1fr); align-items: start; }
@media (max-width: 760px) { .cw { grid-template-columns: 1fr; } }
.cw-board { overflow-x: auto; padding: 4px; container-type: inline-size; }
.cw-grid { display: grid; grid-template-columns: repeat(var(--cols), min(44px, calc((100cqw - 8px) / var(--cols) - 3px))); gap: 3px; width: max-content; margin-inline: auto; }
.cw-cell { position: relative; aspect-ratio: 1; border-radius: 6px; background: #fff; box-shadow: 0 0 0 2px #2f5a17; }
.cw-cell.blank { background: transparent; box-shadow: none; }
.cw-cell.on { background: #fff6c8; }
.cw-cell.ok { background: #dff5e8; box-shadow: 0 0 0 2px var(--ok); }
.cw-cell.bad { background: #fde3e3; box-shadow: 0 0 0 2px var(--bad); }
.cw-cell.given input { color: #8a4fd8; }
.cw-in { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; text-align: center; font: 800 clamp(.95rem, 4vw, 1.5rem)/1 "Noto Sans Hebrew", sans-serif; color: var(--ink); padding: 6px 0 0; border-radius: 6px; caret-color: var(--blue); }
.cw-in:focus { outline: 3px solid var(--blue); outline-offset: 1px; }
.cw-n { position: absolute; top: 1px; right: 3px; font: 700 .62rem/1 var(--round); color: #2f5a17; pointer-events: none; z-index: 1; }
.cw-grid.won { animation: pop .5s; }
.cw-clues { display: grid; gap: 12px; }
.cw-col { display: grid; gap: 6px; }
.cw-h { font-size: 1.05rem; color: var(--leaf-deep); }
.cw-clue { display: flex; align-items: center; gap: 8px; text-align: start; border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 4px 10px; font: inherit; cursor: pointer; color: var(--ink); }
.cw-clue.on { border-color: #f2c94c; background: #fffbe8; }
.cw-clue.ok { border-color: var(--ok); background: var(--ok-soft); }
.cw-clue.ok b { text-decoration: line-through; text-decoration-color: rgba(30,158,88,.6); }
.cw-clue img { width: 46px; height: 46px; object-fit: contain; flex: none; }
.cw-clue b { font: 700 1.15rem "Noto Naskh Arabic", "Noto Sans Hebrew", sans-serif; flex: 1; }
.cw-cn { min-width: 1.7em; height: 1.7em; display: grid; place-items: center; border-radius: 50%; background: var(--leaf); color: #fff; font: 700 .85rem var(--round); flex: none; }
.cw-len { color: var(--ink-soft); font-size: .85rem; }

/* ---------- falling words ---------- */
.fw { display: grid; gap: 8px; }
.fw-hud { display: flex; justify-content: space-between; align-items: center; font-size: 1.2rem; }
.fw-hearts { letter-spacing: 2px; }
.fw-field { position: relative; height: clamp(300px, 52vh, 440px); border-radius: 18px; overflow: hidden;
  background: linear-gradient(180deg, #bfe7ff 0%, #eaf8ff 70%, #d9f2c2 100%); border: 3px solid #a8d8f0; }
.fw-card { position: absolute; top: 0; transform: translateX(50%); background: #fff; border: 3px solid #1f8fd6; border-radius: 14px; padding: 4px 14px;
  font: 800 clamp(1.1rem, 4.2vw, 1.5rem)/1.6 var(--round); box-shadow: 0 6px 0 rgba(0,0,0,.08); white-space: nowrap; transition: transform .45s ease-in, opacity .45s; }
.fw-card.ok { border-color: var(--ok); }
.fw-card.bad { border-color: var(--bad); background: #fde8e8; animation: shake .35s; font-size: 1.05rem; }
.fw-bins { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 8px; }
.fw-bin { border: 0; border-radius: 16px; padding: 12px 6px; color: #fff; font: 800 clamp(1.05rem, 4vw, 1.4rem)/1.3 var(--round); cursor: pointer; box-shadow: 0 5px 0 rgba(0,0,0,.18); background: #1f8fd6; }
.fw-bin:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.fw-bin.c1 { background: #e8424e; } .fw-bin.c2 { background: #3f9b1c; } .fw-bin.c3 { background: #8a4fd8; }
.fw-start, .fw-end { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; padding: 16px; background: rgba(255,255,255,.75); }
.fw-start p, .fw-end p { margin: 0; font: 700 1.2rem var(--round); }

/* ---------- true / false race ---------- */
.rc-wrap { display: grid; gap: 10px; }
.rc-clock { height: 12px; border-radius: 999px; background: #e8eef4; overflow: hidden; }
.rc-clock i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #e8424e, #f5a623 45%, #3f9b1c); transition: width 1s linear; margin-inline-start: auto; }
.rc-stat { display: flex; justify-content: space-between; font-size: 1.2rem; }
.rc { min-height: 220px; display: grid; align-content: center; gap: 14px; }
.rc-q { margin: 0; font-size: clamp(1.2rem, 4.4vw, 1.6rem); font-weight: 700; text-align: center; background: #fff; border: 3px solid var(--line); border-radius: 18px; padding: 14px; line-height: 1.8; }
.rc-fix { color: var(--ok); }
.rc-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rc-b { border: 0; border-radius: 18px; padding: 14px 8px; font: 800 1.3rem var(--round); color: #fff; cursor: pointer; box-shadow: 0 5px 0 rgba(0,0,0,.18); }
.rc-b.yes { background: #3f9b1c; } .rc-b.no { background: #e8424e; }
.rc-b.ok { outline: 5px solid #ffd23f; } .rc-b.bad { animation: shake .35s; opacity: .7; }

/* ---------- find the mistake ---------- */
.fx-top { display: flex; justify-content: flex-end; font: 700 1.05rem var(--round); color: var(--ink-soft); }
.fx { display: grid; gap: 10px; }
.fx-card { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 3px solid var(--line); border-radius: 18px; padding: 12px 14px; }
.fx-ic { font-size: 1.8rem; }
.fx-line { margin: 0; font-size: clamp(1.2rem, 4.2vw, 1.5rem); line-height: 2.2; }
.fx-line.ok { color: var(--ok); }
.fx-w { border: 0; background: none; font: inherit; color: inherit; padding: 0 3px; border-radius: 8px; cursor: pointer; border-bottom: 2px dotted #c6d4e2; }
.fx-w:hover { background: #f4f8fc; }
.fx-w.found { background: #fde3e3; color: var(--bad); text-decoration: line-through; border-bottom-color: transparent; }
.fx-w.ok { background: var(--ok-soft); color: var(--ok); text-decoration: none; }
.fx-ask { margin: 0; font-weight: 700; }
.fx-yes { color: var(--ok); font-weight: 800; font-size: 1.2rem; }

/* ---------- champions' ladder ---------- */
.ld { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: start; }
.ld-steps { list-style: none; margin: 0; padding: 6px; display: flex; flex-direction: column-reverse; gap: 4px; background: linear-gradient(90deg, #b57b3e 0 8px, transparent 8px calc(100% - 8px), #b57b3e calc(100% - 8px)); border-radius: 8px; }
.ld-steps li { text-align: center; font: 700 .95rem/2 var(--round); background: #f2e2cc; border-radius: 6px; color: #7a4a1a; }
.ld-steps li.on { background: #3f9b1c; color: #fff; }
.ld-steps li.cur { background: #ffd23f; color: #5a3300; animation: pop .5s; }
.ld-main { display: grid; gap: 10px; }
.ld-tools { display: flex; gap: 10px; align-items: center; }
.ld-time { flex: 1; height: 12px; border-radius: 999px; background: #e8eef4; overflow: hidden; }
.ld-time i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #e8424e, #f5a623 40%, #1f8fd6); margin-inline-start: auto; }
.ld-50 { flex: none; }
.ld-q { display: grid; gap: 12px; min-height: 240px; align-content: start; }
.ld-text { margin: 0; font-size: clamp(1.15rem, 4vw, 1.45rem); font-weight: 700; line-height: 1.8; }
.ld-let { display: inline-grid; place-items: center; width: 1.7em; height: 1.7em; border-radius: 50%; background: #1f8fd6; color: #fff; font: 700 .9rem var(--round); margin-inline-end: 8px; flex: none; }
.ld .qz-opt { display: flex; align-items: center; justify-content: flex-start; text-align: start; }
.qz-opt.gone { opacity: .25; }
.ld-late { margin: 0; color: var(--bad); font-weight: 700; }
@media (max-width: 560px) {
  .ld { grid-template-columns: 1fr; }
  .ld-steps { flex-direction: row-reverse; background: none; padding: 0; }
  .ld-steps li { flex: 1; font-size: .8rem; }
}

/* ---------- find the root ---------- */
.rt { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.rt-card { display: grid; justify-items: center; gap: 6px; background: #fff; border: 3px solid var(--line); border-radius: 18px; padding: 12px 8px; }
.rt-card.ok { border-color: var(--ok); background: var(--ok-soft); }
.rt-word { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: center; direction: rtl; gap: 3px; max-width: 100%; }
.rt-ch { min-width: 1.35em; border: 2px solid #c9dbe9; background: #f8fbff; border-radius: 10px; font: 800 clamp(1.25rem, 4.4vw, 1.6rem)/1.6 "Noto Sans Hebrew", sans-serif; cursor: pointer; padding: 0 2px; color: var(--ink); }
.rt-ch.sel { background: #ffd23f; border-color: #e0a800; }
.rt-card.ok .rt-ch.sel { background: var(--ok); border-color: var(--ok); color: #fff; }
.rt-root { font: 800 1.2rem var(--round); color: var(--leaf-deep); letter-spacing: 2px; direction: rtl; unicode-bidi: plaintext; }
.rt-gap { width: .6em; }

/* ---------- spin the wheel ---------- */
.wh { display: grid; grid-template-columns: minmax(220px, 320px) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 700px) { .wh { grid-template-columns: 1fr; } }
.wh-wheel { position: relative; display: grid; justify-items: center; gap: 10px; }
.wh-svg { width: min(100%, 300px); aspect-ratio: 1; filter: drop-shadow(0 6px 10px rgba(0,0,0,.18)); }
.wh-svg g { transform-origin: 0 0; transition: transform 3s cubic-bezier(.17,.67,.21,1); }
.wh-t { font: 800 18px var(--round); fill: #fff; }
.wh-ptr { position: absolute; top: -10px; font-size: 2rem; color: #1d2a44; z-index: 1; line-height: 1; }
.wh-score { font: 700 1.2rem var(--round); }
.wh-q { display: grid; gap: 10px; }
.wh-text { margin: 0; font-size: 1.3rem; font-weight: 700; line-height: 1.8; }
.wh-end { font: 700 1.2rem var(--round); color: var(--leaf-deep); }
@media (prefers-reduced-motion: reduce) { .wh-svg g { transition-duration: .01s; } .fw-card { transition: none; } }

/* movie of a reading text */
.mv-box.text { grid-template-columns: minmax(0, 1fr); }
.mv-box.text .mv-frame { width: 100%; max-width: 900px; margin-inline: auto; }

/* ---------- mark the text ---------- */
.mk-tasks { display: grid; gap: 6px; margin-bottom: 10px; }
.mk-task { display: flex; align-items: center; gap: 10px; text-align: start; border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 6px 12px; font: inherit; cursor: pointer; color: var(--ink); }
.mk-task[aria-pressed="true"] { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); }
.mk-task.ok { background: var(--ok-soft); }
.mk-sw { width: 26px; height: 20px; flex: none; border-radius: 50%; border: 3px solid var(--c); }
.mk-task.underline .mk-sw { border: 0; border-bottom: 4px solid var(--c); border-radius: 0; }
.mk-task.color .mk-sw { background: var(--c); border-radius: 6px; }
.mk-l { flex: 1; font-weight: 600; }
.mk-cnt { font: 700 .95rem var(--round); color: var(--ink-soft); }
.mk-text { background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 12px 16px; }
.mk-w { cursor: pointer; border-radius: 10px; padding: 0 2px; }
.mk-w:hover { background: #f4f8fc; }
.mk-w.on.circle { box-shadow: 0 0 0 2.5px var(--c); border-radius: 999px; }
.mk-w.on.underline { text-decoration: underline; text-decoration-color: var(--c); text-decoration-thickness: 3px; text-underline-offset: 6px; }
.mk-w.on.color { background: color-mix(in srgb, var(--c) 30%, #fff); }
.mk-w.on.circle.g-first { border-radius: 999px 0 0 999px; } .mk-w.on.circle.g-last { border-radius: 0 999px 999px 0; } .mk-w.on.circle.g-mid { border-radius: 0; }
[dir="rtl"] .mk-w.on.circle.g-first { border-radius: 0 999px 999px 0; } [dir="rtl"] .mk-w.on.circle.g-last { border-radius: 999px 0 0 999px; }

/* match: pictures large enough to recognise */
.m-item img { height: clamp(64px, 18vw, 96px); }

.rb-box.has-img { display: flow-root; }
.rb-box-img { float: left; width: min(150px, 34%); height: auto; margin: 4px 0 6px 12px; }
.rb-box.sign { background: #f3fbff; border: 3px solid #1d7fd1; border-style: solid; text-align: center; }
.rb-box.sign .rb-box-t { color: #1d7fd1; }

/* 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 */
