/* =====================================================================
   BreakThrough Education — Storybook (book.js) styling
   A cinematic, magical, life-like book: paper leaves, page-turns,
   drop-caps, gilded chrome, drifting motes. Themed per skill via
   .accent-<skill> (maps to the existing skill colour vars).
   ===================================================================== */

.btbook-ov {
  --bk-accent: #6d28d9; --bk-accent-l: #ede9fe;
  --bk-gold: #e7b94e; --bk-gold-soft: #b8923a;
  --bk-paper: #fbf3da; --bk-paper-2: #e2c98f; --bk-ink: #42300f; --bk-ink-soft: #7a5a2a;
  position: fixed; inset: 0; z-index: 4000;
  display: grid; grid-template-rows: auto 1fr auto; align-items: center; justify-items: center;
  overflow: hidden;
  background:
    radial-gradient(1100px 720px at 50% 30%, #3c2b18 0%, #1a1109 52%, #070503 100%);
  animation: bkFadeIn .4s ease both;
}
.btbook-ov.reduced, .btbook-ov.reduced * { animation: none !important; transition: none !important; }
@keyframes bkFadeIn { from { opacity: 0; } to { opacity: 1; } }
body.book-open { overflow: hidden; }
/* In the book the passage is narrated by the Azure voice (data-say); hide the old
   browser-TTS "Lees voor" button so it never plays the robotic fallback voice. */
.btbook-ov .tts-bar { display: none; }

/* accent themes */
.accent-leesbegrip      { --bk-accent: var(--c-leesbegrip-d);      --bk-accent-l: var(--c-leesbegrip-l); }
.accent-spelling        { --bk-accent: var(--c-spelling-d);        --bk-accent-l: var(--c-spelling-l); }
.accent-leesvaardigheid { --bk-accent: var(--c-leesvaardigheid-d); --bk-accent-l: var(--c-leesvaardigheid-l); }
.accent-woordeskat      { --bk-accent: var(--c-woordeskat-d);      --bk-accent-l: var(--c-woordeskat-l); }
.accent-skryf           { --bk-accent: var(--c-skryf-d);           --bk-accent-l: var(--c-skryf-l); }
.accent-luisterpraat    { --bk-accent: var(--c-luisterpraat-d);    --bk-accent-l: var(--c-luisterpraat-l); }

/* drifting motes (magic dust) */
.btbook-bg { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.btbook-bg::after {
  content: ""; position: absolute; left: 50%; top: -8%; width: 920px; height: 560px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255,217,138,.16), transparent 70%);
}
.bk-mote {
  position: absolute; width: 6px; height: 6px; border-radius: 50%;
  background: radial-gradient(circle, #ffe9a8, rgba(255,200,90,.05));
  opacity: 0; filter: blur(.4px);
  animation: bkMote linear infinite;
}
.bk-mote.m0 { left: 12%; animation-duration: 13s; animation-delay: 0s; }
.bk-mote.m1 { left: 28%; width: 5px; animation-duration: 17s; animation-delay: 2s; }
.bk-mote.m2 { left: 46%; width: 9px; animation-duration: 15s; animation-delay: 5s; }
.bk-mote.m3 { left: 64%; width: 5px; animation-duration: 19s; animation-delay: 1s; }
.bk-mote.m4 { left: 79%; width: 8px; animation-duration: 14s; animation-delay: 6s; }
.bk-mote.m5 { left: 91%; width: 6px; animation-duration: 21s; animation-delay: 3s; }
@keyframes bkMote {
  0% { transform: translateY(105vh) scale(.6); opacity: 0; }
  10% { opacity: .8; } 90% { opacity: .7; }
  100% { transform: translateY(-10vh) scale(1.1); opacity: 0; }
}

/* chrome */
.bk-close {
  position: absolute; top: 16px; right: 18px; z-index: 6;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18);
  background: rgba(12,18,30,.6); color: #fff; font-size: 1.1rem; cursor: pointer;
  backdrop-filter: blur(6px); transition: transform .15s, background .15s;
}
.bk-close:hover { transform: scale(1.08); background: rgba(20,28,44,.85); }
.bk-titlebar {
  grid-row: 1; z-index: 5; margin-top: 16px; display: flex; align-items: center; gap: 10px;
  color: #f4ecdb; font-family: var(--font); font-weight: 800; letter-spacing: .3px;
  text-shadow: 0 2px 10px rgba(0,0,0,.6);
}
.bk-titlebar .bk-temoji { font-size: 1.3rem; }
.bk-titlebar .bk-ttext { font-size: 1.18rem; font-family: Georgia, "Times New Roman", serif; color: #ffe9a8; letter-spacing: .5px; }

/* stage + book */
.bk-stage {
  grid-row: 2; z-index: 4; position: relative;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: min(980px, 96vw); height: min(80vh, 760px);
  perspective: 2400px;
}
.bk-book {
  position: relative; width: min(720px, 92vw); height: 100%;
  border-radius: 10px 16px 16px 10px;
  background: linear-gradient(145deg, #5e3c1d, #311d0c 120%);
  padding: 13px 13px 13px 17px;
  box-shadow: 0 40px 90px rgba(0,0,0,.65), 0 0 0 2px var(--bk-gold) inset, 0 0 0 6px rgba(0,0,0,.28) inset;
  transform-style: preserve-3d;
}
/* faux stacked page edges peeking on the right */
.bk-book::after {
  content: ""; position: absolute; top: 14px; bottom: 14px; right: 5px; width: 8px;
  border-radius: 0 8px 8px 0;
  background: repeating-linear-gradient(to right, #efe4cb, #efe4cb 2px, #d9c9a6 2px, #d9c9a6 4px);
  box-shadow: 0 0 8px rgba(0,0,0,.4);
}
.bk-leaves-under {
  position: absolute; inset: 12px 12px 12px 16px; border-radius: 4px 10px 10px 4px;
  background: #e9dcc0; transform: translate(3px, 4px); box-shadow: 0 6px 14px rgba(0,0,0,.3);
}

.leaf {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d; backface-visibility: hidden; will-change: transform;
}
/* gilded inner frame on the page */
.leaf::after {
  content: ""; position: absolute; inset: 14px; border-radius: 3px; z-index: 3; pointer-events: none;
  border: 1.5px solid rgba(184,146,58,.7); box-shadow: 0 0 0 1px rgba(255,233,168,.22) inset;
}
.leaf-paper {
  position: relative; width: 100%; height: 100%; overflow-y: auto; overflow-x: hidden;
  border-radius: 4px 10px 10px 4px;
  padding: clamp(22px, 4vw, 48px) clamp(22px, 5vw, 56px);
  color: var(--bk-ink);
  background:
    radial-gradient(150% 95% at 30% 18%, #fbf3da 0%, #eedcb0 62%, var(--bk-paper-2) 100%);
  box-shadow: inset 14px 0 26px -16px rgba(70,45,20,.55), inset 0 0 90px rgba(120,80,30,.14);
}
/* binding shadow down the spine side */
.leaf-paper::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 26px;
  background: linear-gradient(to right, rgba(60,40,15,.28), transparent);
  pointer-events: none; border-radius: 4px 0 0 4px;
}
.leaf-paper::-webkit-scrollbar { width: 9px; }
.leaf-paper::-webkit-scrollbar-thumb { background: rgba(120,90,40,.4); border-radius: 8px; }

/* page-turn animation */
.leaf.turning-next  { transform-origin: left center;  animation: leafOutNext .2s ease-in forwards; }
.leaf.arriving-next { transform-origin: left center;  animation: leafInNext .24s ease-out forwards; }
.leaf.turning-prev  { transform-origin: right center; animation: leafOutPrev .2s ease-in forwards; }
.leaf.arriving-prev { transform-origin: right center; animation: leafInPrev .24s ease-out forwards; }
@keyframes leafOutNext { from { transform: rotateY(0); }       to { transform: rotateY(-108deg); filter: brightness(.7); } }
@keyframes leafInNext  { from { transform: rotateY(108deg); filter: brightness(.7); } to { transform: rotateY(0); } }
@keyframes leafOutPrev { from { transform: rotateY(0); }       to { transform: rotateY(108deg); filter: brightness(.7); } }
@keyframes leafInPrev  { from { transform: rotateY(-108deg); filter: brightness(.7); } to { transform: rotateY(0); } }

/* page foot */
.leaf-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 28px; padding-top: 12px; border-top: 1px solid rgba(120,90,40,.22);
  font-family: var(--font); font-size: .76rem; font-weight: 700; color: var(--bk-ink-soft);
  text-transform: uppercase; letter-spacing: .6px;
}

/* folded-corner affordances */
.bk-corner {
  position: absolute; width: 56px; height: 56px; border: 0; cursor: pointer; background: transparent; padding: 0;
}
.bk-corner.next { right: 0; bottom: 0; border-radius: 0 0 10px 0; }
.bk-corner.prevc { left: 0; bottom: 0; border-radius: 0 0 0 4px; }
.bk-corner.next::after {
  content: ""; position: absolute; right: 0; bottom: 0;
  border-style: solid; border-width: 0 0 30px 30px;
  border-color: transparent transparent rgba(120,90,40,.32) transparent;
  transition: border-width .15s ease;
}
.bk-corner.next:hover::after { border-width: 0 0 46px 46px; border-color: transparent transparent var(--bk-accent) transparent; }

/* side arrows */
.bk-arrow {
  z-index: 5; width: 46px; height: 46px; border-radius: 50%; cursor: pointer; flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.2); background: rgba(12,18,30,.55); color: #fff;
  font-size: 1.6rem; line-height: 1; display: grid; place-items: center;
  backdrop-filter: blur(6px); transition: transform .15s, background .15s;
}
.bk-arrow:hover { transform: scale(1.1); background: var(--bk-accent); }
.bk-arrow.hidden, .bk-corner.hidden { visibility: hidden; }

/* progress dots */
.bk-progress {
  grid-row: 3; z-index: 5; margin-bottom: 16px; display: flex; flex-wrap: wrap;
  justify-content: center; gap: 7px; max-width: 92vw;
}
.bk-dot {
  width: 9px; height: 9px; border-radius: 50%; border: 0; cursor: pointer; padding: 0;
  background: rgba(255,255,255,.26); transition: transform .15s, background .15s;
}
.bk-dot.chap { width: 11px; height: 11px; border-radius: 3px; transform: rotate(45deg); }
.bk-dot.seen { background: rgba(255,255,255,.5); }
.bk-dot.on { background: var(--bk-accent-l); transform: scale(1.5); box-shadow: 0 0 8px var(--bk-accent-l); }
.bk-dot.chap.on { transform: rotate(45deg) scale(1.4); }

/* =========================== page content =========================== */
.leaf-content h1 { font-family: var(--font); color: var(--bk-ink); line-height: 1.12; margin: 0; }

/* cover + chapter-open + finish: centered, cinematic */
.bk-cover, .bk-chap-open, .bk-finish {
  min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 14px; padding: 10px 4px;
}
.bk-cover-emoji, .bk-finish-emoji { font-size: clamp(3.4rem, 9vw, 5.4rem); filter: drop-shadow(0 8px 14px rgba(0,0,0,.2)); animation: bkPop .5s ease both; }
@keyframes bkPop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.bk-cover-title { font-size: clamp(2rem, 6vw, 3rem); color: var(--bk-accent); }
.bk-cover-sub { margin: 0; font-weight: 700; color: var(--bk-ink-soft); letter-spacing: 2px; text-transform: uppercase; font-size: .9rem; }
.bk-cover-intro { max-width: 46ch; font-family: Georgia, "Times New Roman", serif; font-size: 1.05rem; line-height: 1.6; color: var(--bk-ink); }
.bk-cover-meta { font-family: var(--font); font-weight: 800; color: var(--bk-accent); background: var(--bk-accent-l); padding: 6px 16px; border-radius: 99px; }

.bk-chap-kicker { font-family: var(--font); font-weight: 800; letter-spacing: 4px; text-transform: uppercase; color: var(--bk-ink-soft); font-size: .82rem; }
.bk-chap-badge { background: var(--bk-accent); color: #fff; font-weight: 800; font-size: .78rem; padding: 5px 14px; border-radius: 99px; }
.bk-chap-title { font-size: clamp(1.7rem, 5vw, 2.6rem); color: var(--bk-ink); max-width: 22ch; }
.bk-chap-meta { font-family: var(--font); color: var(--bk-ink-soft); font-weight: 700; font-size: .9rem; }
.bk-chap-done { color: #1f9d55; font-weight: 800; }
.bk-finish h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); color: var(--bk-accent); }
.bk-finish p { font-family: Georgia, serif; font-size: 1.05rem; color: var(--bk-ink); }
.bk-finish-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 8px; }

/* the big storybook call-to-action button */
.bk-begin {
  margin-top: 10px; cursor: pointer; border: 0; border-radius: 99px;
  font-family: var(--font); font-weight: 800; font-size: 1.02rem; padding: 13px 28px; color: #fff;
  background: linear-gradient(135deg, var(--bk-accent), #00000022);
  box-shadow: 0 10px 24px -8px var(--bk-accent), 0 0 0 1px rgba(255,255,255,.15) inset;
  transition: transform .15s, box-shadow .15s;
}
.bk-begin:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -8px var(--bk-accent); }
.bk-begin.ghost { background: transparent; color: var(--bk-accent); box-shadow: 0 0 0 2px var(--bk-accent) inset; }
.bk-begin.ok { background: #1f9d55; box-shadow: none; cursor: default; }
.bk-begin[disabled] { opacity: .9; cursor: default; transform: none; }

/* the reading passage — serif, drop-cap, generous leading */
.bk-passage { font-family: Georgia, "Times New Roman", serif; color: var(--bk-ink); }
.bk-passage p { font-size: clamp(1.02rem, 2.4vw, 1.16rem); line-height: 1.75; margin: 0 0 1.05em; text-align: justify; hyphens: auto; }
.bk-passage p:first-of-type::first-letter {
  float: left; font-size: 3.8em; line-height: .72; padding: 6px 12px 0 0;
  color: var(--bk-gold-soft); font-family: Georgia, serif; font-weight: 700;
  text-shadow: 0 1px 0 rgba(255,233,168,.6);
}
.bk-gloss { margin-top: 22px; padding: 16px 18px; border-radius: 12px; background: var(--bk-accent-l);
  border: 1px dashed color-mix(in srgb, var(--bk-accent) 40%, transparent); }
.bk-gloss-h { font-family: var(--font); font-weight: 800; color: var(--bk-accent); margin-bottom: 8px; }
.bk-gloss-i { display: flex; gap: 10px; padding: 4px 0; font-size: .95rem; border-top: 1px solid rgba(120,90,40,.12); }
.bk-gloss-i:first-of-type { border-top: 0; }
.bk-gloss-i b { color: var(--bk-ink); min-width: 32%; }
.bk-readon { text-align: center; margin-top: 20px; }

/* 40-week course lesson pages (language drill, vocab, writing, oral) */
.bk-words { display: grid; gap: 10px; margin-top: 6px; }
.bk-word { padding: 10px 12px; border-radius: 10px; background: var(--bk-accent-l);
  border: 1px solid color-mix(in srgb, var(--bk-accent) 28%, transparent); }
.bk-word-pair { display: flex; align-items: baseline; gap: 10px; justify-content: space-between; }
.bk-word-pair b { color: var(--bk-ink); font-size: 1.06rem; }
.bk-word-pair span { color: var(--bk-accent); font-weight: 700; }
.bk-word em { display: block; margin-top: 4px; font-size: .92rem; opacity: .82; }
.bk-guides { margin: 10px 0 4px; padding-left: 20px; }
.bk-guides li { margin: 5px 0; line-height: 1.5; }
.bk-drill-item { margin-top: 14px; padding-top: 12px; border-top: 1px dashed color-mix(in srgb, var(--bk-accent) 30%, transparent); }
.bk-drill-item:first-of-type { border-top: 0; }
.bk-drill-item .btn { margin-top: 8px; }

/* question pages */
.bk-q { display: flex; flex-direction: column; min-height: 100%; }
.bk-q-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.bk-q-num { font-family: var(--font); font-weight: 800; color: var(--bk-accent); letter-spacing: .3px; }
.bk-q-pts { font-family: var(--font); font-weight: 800; color: var(--bk-ink-soft); }
.bk-q-text { font-family: Georgia, serif; font-size: clamp(1.1rem, 2.6vw, 1.3rem); line-height: 1.5; color: var(--bk-ink); margin-bottom: 16px; }
.bk-q-ans {
  width: 100%; min-height: 150px; resize: vertical; flex: 1;
  font-family: var(--font); font-size: 1rem; line-height: 1.6; color: var(--bk-ink);
  padding: 14px 16px; border-radius: 12px; border: 1px solid rgba(120,90,40,.3);
  background: rgba(255,255,255,.55);
  background-image: repeating-linear-gradient(transparent, transparent 31px, rgba(120,90,40,.14) 32px);
}
.bk-q-ans:focus { outline: none; border-color: var(--bk-accent); box-shadow: 0 0 0 3px var(--bk-accent-l); }
.bk-q-actions { margin-top: 12px; }
/* answer feedback line (submit → mark) */
.bk-q-fb { margin-top: 10px; padding: 9px 12px; border-radius: 10px; font-family: var(--font); line-height: 1.45; }
.bk-q-fb.ok { background: #d7ffb8; color: #2e7d0f; }
.bk-q-fb.warn { background: #fff2cf; color: #7a5a10; }
.bk-q-fb.bad { background: #ffdfe0; color: #b3261e; }
.bk-q-ans.ok { border-color: #58cc02; }
.bk-q-ans.bad { border-color: #e57373; }
.bk-q-fb .bk-why { margin-top: 8px; }
.bk-memo { margin-top: 12px; font-family: Georgia, serif; }

/* games inside a page */
.leaf-content .game-host, .leaf-content .bk-game { width: 100%; }

/* narration — the spoken (Afrikaans) line highlights as it's read */
.leaf-content [data-say] { border-radius: 8px; transition: background .25s var(--ease), box-shadow .25s var(--ease); }
.leaf-content [data-say].sayable { cursor: pointer; }
.leaf-content [data-say].saying {
  background: rgba(255,210,120,.34);
  box-shadow: 0 0 0 7px rgba(255,210,120,.16);
}
.bk-narr {
  position: absolute; top: 16px; right: 70px; z-index: 6;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18);
  background: rgba(12,18,30,.6); color: #fff; font-size: 1.1rem; cursor: pointer;
  backdrop-filter: blur(6px); transition: transform .15s, background .15s;
}
.bk-narr:hover { transform: scale(1.08); background: rgba(20,28,44,.85); }

@media (max-width: 640px) {
  .bk-stage { gap: 4px; height: 82vh; height: 82dvh; }
  .bk-arrow { width: 38px; height: 38px; font-size: 1.3rem; }
  .leaf-paper { padding: 20px 18px 18px; }
  .bk-passage p { text-align: left; }   /* justify makes ugly word-gaps in a narrow column */
}

/* ---- Tap-to-define popup: meaning of a tapped Afrikaans word in the chosen language ---- */
#bkContent .bk-passage p, #bkContent .bk-q-text { cursor: help; }   /* hint that words are tappable (desktop) */
#wordpop {
  position: fixed; z-index: 9000; width: 240px; max-width: 92vw;
  background: #0d1422; color: #eaf0fb; border: 1px solid #2b3a55; border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,.6); padding: 12px 30px 12px 14px;
  font-family: inherit; opacity: 0; transform: translateY(6px); pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
}
#wordpop.show { opacity: 1; transform: none; pointer-events: auto; }
#wordpop .wp-w { font-weight: 800; font-size: 1.06rem; color: #ffe08a; display: flex; align-items: center; gap: 8px; }
#wordpop .wp-m { margin-top: 6px; font-size: 1rem; line-height: 1.4; }
#wordpop .wp-af { margin-top: 5px; font-size: .82rem; color: #9fb0cc; }
#wordpop .wp-none { margin-top: 6px; font-size: .9rem; color: #9fb0cc; }
#wordpop .wp-x { position: absolute; top: 4px; right: 8px; background: none; border: 0; color: #9fb0cc; font-size: 1.25rem; line-height: 1; cursor: pointer; }
#wordpop .wp-x:hover { color: #fff; }
#wordpop .wp-say { background: rgba(255,255,255,.1); border: 1px solid #2b3a55; color: #fff; border-radius: 8px; padding: 1px 7px; cursor: pointer; font-size: .8rem; }
#wordpop .wp-say:hover { background: rgba(255,255,255,.2); }
#wordpop .wp-note { margin-top: 6px; font-size: .98rem; line-height: 1.45; }

/* ---- teacher rich-content marks (js/richtext.js) ---- */
.bk-page mark { background: #ffd76a; color: #3a2c00; padding: 0 3px; border-radius: 4px; }
.rt-tr { border-bottom: 2px dashed #49b26e; cursor: pointer; }
.rt-tr:hover { background: rgba(73,178,110,.14); border-radius: 3px; }
.rt-pop { background: rgba(224,169,61,.14); border-bottom: 2px dotted #e0a93d; border-radius: 3px; padding: 0 2px; cursor: pointer; }
.rt-pop::after { content: "ⓘ"; font-size: .68em; vertical-align: super; opacity: .75; margin-left: 1px; }
.rt-pop:hover { background: rgba(224,169,61,.26); }
/* "Chosen Language" span — renders in the learner's language; clean in the app */
.rt-cl { }

/* "explain the answer" box, revealed with the model answer */
.bk-why { margin-top: 10px; padding: 9px 12px; border-left: 3px solid #e0a93d; background: rgba(224,169,61,.09); border-radius: 0 8px 8px 0; line-height: 1.5; }

/* section-objectives page (wk.doelwitte) — the first leaf after the cover */
.bk-goals { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding: 8px 0; }
.bk-goals-emoji { font-size: clamp(2.6rem, 7vw, 4rem); filter: drop-shadow(0 8px 14px rgba(0,0,0,.2)); }
.bk-goals-title { font-size: clamp(1.35rem, 4vw, 1.9rem); color: var(--bk-accent); font-family: var(--font); margin: 0; line-height: 1.25; max-width: 24ch; }
.bk-goals-list { list-style: none; margin: 4px 0; padding: 16px 20px; text-align: left; max-width: 52ch; background: var(--bk-accent-l); border-radius: 14px; display: flex; flex-direction: column; gap: 11px; }
.bk-goals-list li { position: relative; padding-left: 30px; font-family: Georgia, "Times New Roman", serif; font-size: 1.04rem; line-height: 1.5; color: var(--bk-ink); }
.bk-goals-list li::before { content: "✅"; position: absolute; left: 0; top: 1px; font-size: .95rem; }

/* =====================================================================
   Interactive exercises (js/oefening.js) — Duolingo-style, on book paper
   ===================================================================== */
.oef { display: flex; flex-direction: column; gap: 14px; font-family: var(--font); }
.oef .hide { display: none !important; }
.oef-title { font-weight: 900; font-size: clamp(1.15rem, 3vw, 1.45rem); color: var(--bk-ink); }
.oef-newword { display: inline-block; align-self: flex-start; font-size: .68rem; font-weight: 900; letter-spacing: .8px; color: #7c3aed; background: #ede9fe; border-radius: 99px; padding: 3px 10px; }
.oef-scene { display: flex; align-items: center; gap: 14px; min-height: 40px; flex-wrap: wrap; }
.oef-prent.emoji { font-size: 3.4rem; line-height: 1; filter: drop-shadow(0 6px 10px rgba(0,0,0,.18)); }
.oef-prent.emoji.big { font-size: 4.4rem; }
img.oef-prent { width: 96px; height: 96px; object-fit: cover; border-radius: 14px; box-shadow: 0 8px 18px rgba(0,0,0,.2); }
img.oef-prent.big { width: 132px; height: 132px; }
.oef-bubble-wrap { flex: 1; min-width: 200px; }
.oef-bubble { display: inline-flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 16px; border: 2px solid rgba(120,90,40,.35); background: rgba(255,255,255,.45); position: relative; }
.oef-bubble::before { content: ""; position: absolute; left: -10px; top: 18px; border: 6px solid transparent; border-right-color: rgba(120,90,40,.35); }
.oef-bubble-t { font-family: Georgia, serif; font-size: 1.12rem; color: var(--bk-ink); }
.oef-say { width: 42px; height: 42px; border-radius: 12px; border: 0; background: #1cb0f6; color: #fff; font-size: 1.15rem; cursor: pointer; box-shadow: 0 3px 0 #1899d6; flex: none; }
.oef-say:active { transform: translateY(2px); box-shadow: none; }
.oef-say.slow { background: #49c0f8; }
.oef-word-row { display: flex; align-items: center; gap: 10px; }
.oef-word { font-family: Georgia, serif; font-size: 1.3rem; font-weight: 700; color: #7c3aed; border-bottom: 2px dashed #7c3aed; }
/* the answer line + word bank (tile exercises) */
.oef-line { min-height: 56px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 2px; border-top: 2px solid rgba(120,90,40,.3); border-bottom: 2px solid rgba(120,90,40,.3); }
.oef-bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 6px 0; }
.oef-tile { font: inherit; font-weight: 700; color: var(--bk-ink); background: #fffdf6; border: 2px solid rgba(120,90,40,.35); border-bottom-width: 4px; border-radius: 12px; padding: 9px 14px; cursor: pointer; transition: transform .08s; }
.oef-tile:active { transform: translateY(2px); border-bottom-width: 2px; }
/* the sentence with a blank */
.oef-sin { font-family: Georgia, serif; font-size: 1.25rem; line-height: 1.7; color: var(--bk-ink); }
.oef-slot { display: inline-block; min-width: 110px; border-bottom: 2.5px solid #1cb0f6; margin: 0 6px; font-weight: 800; text-align: center; color: #0369a1; }
/* option buttons */
.oef-opts { display: flex; flex-direction: column; gap: 10px; }
.oef-opts.pills { flex-direction: row; flex-wrap: wrap; justify-content: center; }
.oef-opt { font: inherit; font-weight: 700; color: var(--bk-ink); background: #fffdf6; border: 2px solid rgba(120,90,40,.35); border-bottom-width: 4px; border-radius: 14px; padding: 13px 16px; cursor: pointer; text-align: center; }
.oef-opts.pills .oef-opt { padding: 9px 16px; border-radius: 12px; }
.oef-opt.sel { border-color: #1cb0f6; background: #ddf4ff; color: #0369a1; }
/* picture cards (2×2) */
.oef-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 420px; }
.oef-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 10px 12px; background: #fffdf6; border: 2px solid rgba(120,90,40,.35); border-bottom-width: 4px; border-radius: 16px; cursor: pointer; font: inherit; }
.oef-card.sel { border-color: #1cb0f6; background: #ddf4ff; }
.oef-card-img.emoji { font-size: 3.2rem; line-height: 1.2; }
img.oef-card-img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; }
.oef-card-cap { font-weight: 700; color: var(--bk-ink-soft); font-size: .95rem; }
/* footer: CHECK + result banner */
.oef-foot { margin-top: 4px; }
.oef-check { width: 100%; border: 0; border-radius: 14px; padding: 14px; font: inherit; font-weight: 900; letter-spacing: 1px; cursor: pointer; color: #fff; background: #58cc02; box-shadow: 0 4px 0 #46a302; }
.oef-check:disabled { background: rgba(120,90,40,.25); color: rgba(70,50,20,.5); box-shadow: none; cursor: default; }
.oef-check:not(:disabled):active { transform: translateY(2px); box-shadow: none; }
.oef-result { border-radius: 14px; padding: 14px 16px; }
.oef-result.ok { background: #d7ffb8; }
.oef-result.bad { background: #ffdfe0; }
.oef-verdict { font-weight: 900; font-size: 1.1rem; color: var(--bk-ink); }
.oef-result.ok .oef-verdict { color: #2e7d0f; }
.oef-result.bad .oef-verdict { color: #b3261e; }
.oef-correct { margin-top: 6px; color: #7a1f1a; }
.oef-why { margin-top: 8px; padding: 8px 11px; border-left: 3px solid #e0a93d; background: rgba(224,169,61,.14); border-radius: 0 8px 8px 0; color: var(--bk-ink); }
.oef-next, .oef-retry { margin-top: 10px; border: 0; border-radius: 12px; padding: 10px 22px; font: inherit; font-weight: 800; cursor: pointer; color: #fff; }
.oef-next { background: #58cc02; box-shadow: 0 3px 0 #46a302; }
.oef-retry { background: #1cb0f6; box-shadow: 0 3px 0 #1899d6; }
/* open-text (oop) + match-columns (pas) question types */
.oef-q { font-family: Georgia, "Times New Roman", serif; font-size: 1.05rem; line-height: 1.5; color: var(--bk-ink); margin: 4px 0 10px; }
.oef-oop-input { width: 100%; box-sizing: border-box; border: 2px solid var(--bk-paper-2); border-radius: 12px; padding: 11px 13px; font: inherit; font-size: 1rem; background: rgba(255,255,255,.7); color: var(--bk-ink); resize: vertical; min-height: 70px; }
.oef-oop-input:focus { outline: none; border-color: var(--bk-accent); }
.oef-pas { display: flex; gap: 14px; margin: 6px 0 4px; }
.oef-pas-col { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.oef-pas-item { display: flex; align-items: center; gap: 8px; text-align: left; border: 2px solid var(--bk-paper-2); background: rgba(255,255,255,.72); color: var(--bk-ink); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: .98rem; cursor: pointer; transition: border-color .12s, background .12s; }
.oef-pas-item:hover { border-color: var(--bk-accent); }
.oef-pas-item.sel { border-color: var(--bk-accent); background: var(--bk-accent-l); }
.oef-pas-item.paired { border-color: #58cc02; background: rgba(88,204,2,.12); }
.oef-pas-t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.oef-pas-badge { flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 800; color: #fff; }
.oef-pas-item.paired .oef-pas-badge { background: #58cc02; }
@media (max-width: 560px) { .oef-cards { grid-template-columns: 1fr 1fr; gap: 9px; } img.oef-prent { width: 72px; height: 72px; } .oef-pas { gap: 8px; } .oef-pas-item { padding: 8px 9px; font-size: .9rem; } }
