/* ==========================================================
   Theme: "জ্ঞানের ডিজিটাল পাঠাগার" — a library card catalogue.
   Walnut wood (top bar, hero shelf, player), cool blue-grey reading-room
   page, index-card widgets (red top rule, blue ruled lines, punched rod
   hole, call-number tag). Top bar: a tiny shelf that fills with spines.
   ========================================================== */
:root {
  --bg: #eef1f5;
  --paper: #ffffff;
  --ink: #2b2118;
  --ink-2: #5f564e;
  --line: #d5dce6;
  --rule: #e3ebf5;
  --wood: #4a2c1d;
  --wood-2: #6b4430;
  --wood-3: #8a5a3c;
  --red: #c2412d;
  --red-d: #8e2c1e;
  --blue: #2a5d9f;
  --blue-d: #1c4073;
  --brass: #c8962d;
  --brass-d: #8f6914;
  --sage: #4f8a5b;
  --sage-d: #356340;
  --grey: #5d6670;
  --tab: var(--red);
  --ok: #2c7d45;
  --no: #b8342a;
  color-scheme: light;
}
* { box-sizing: border-box; }
body {
  color: var(--ink);
  background-color: var(--bg);
  background-image: linear-gradient(90deg, rgba(42, 93, 159, .035) 1px, transparent 1px), linear-gradient(rgba(42, 93, 159, .035) 1px, transparent 1px);
  background-size: 28px 28px;
}
::selection { background: rgba(200, 150, 45, .3); }
a { color: var(--blue-d); }
strong { color: var(--wood); }
.muted { color: var(--ink-2); }
.small { font-size: var(--fs-sm); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brass); color: #111; padding: .5rem 1rem; z-index: 2000; }
.skip:focus { left: 8px; }
main, .wrap, .lesson-part > *, .row-ctrl > *, .ev-grid > *, .fo-grid > *, .wm-grid > *, .far-body > *, .ct-drawer > *, .hero-grid > * { min-width: 0; }
.url { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; background: #f3eee6; border: 1px solid #e3d6c3; border-radius: 5px; padding: 0 .3rem; overflow-wrap: anywhere; color: var(--wood); }

/* top bar: walnut shelf */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: .4rem 1rem; flex-wrap: wrap; padding: .35rem var(--gutter); background: var(--wood); color: #f6e9d8; border-bottom: 4px solid var(--wood-3); font-size: var(--fs-sm); }
.crumbs { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
.crumbs a { color: #e9d5bd; text-decoration: none; }
.crumbs a:hover { color: #fff; text-decoration: underline; }
.crumbs [aria-current] { color: #ffd98a; font-weight: 700; }
.level { display: flex; align-items: center; gap: .45rem; font-weight: 800; color: #fff3df; }
.level.pop { animation: bob .6s; }
@keyframes bob { 40% { transform: translateY(-4px) scale(1.06); } }
.spines { display: inline-flex; align-items: flex-end; gap: 1px; height: 22px; padding: 0 3px; border-bottom: 3px solid var(--wood-3); }
.spines i { width: 5px; height: 9px; border-radius: 1px 1px 0 0; background: rgba(255, 255, 255, .14); transition: height .4s, background .4s; }
.spines i.on { height: 18px; }
.spines i.on:nth-child(4n+1) { background: #e0644e; }
.spines i.on:nth-child(4n+2) { background: #5f8fd0; }
.spines i.on:nth-child(4n+3) { background: #e3b552; }
.spines i.on:nth-child(4n) { background: #6fb07b; }
.spines i.on:nth-child(3n) { height: 15px; }
@media (max-width: 560px) { .spines { display: none; } }

/* hero */
.hero { padding: clamp(2rem, 5vw, 4rem) 0 2rem; background: linear-gradient(180deg, #e2e8f0, transparent); }
.hero-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.05fr 1fr; } }
.eyebrow { display: inline-block; color: #fff; background: var(--wood); font-weight: 700; padding: .1rem .9rem; border-radius: 4px; font-size: var(--fs-sm); box-shadow: 3px 3px 0 var(--brass); }
h1 { font-size: var(--fs-3xl); line-height: 1.3; margin: .6rem 0 1rem; color: var(--wood); }
.lede { font-size: var(--fs-lg); line-height: 1.75; }
.hint { color: var(--ink-2); border-left: 4px solid var(--brass); padding-left: .8rem; }
.hero-fig { margin: 0; border-radius: 12px; overflow: hidden; border: 10px solid var(--wood-2); box-shadow: inset 0 0 0 2px var(--wood), 0 18px 40px rgba(74, 44, 29, .28); }
.hero-fig > svg { display: block; width: 100%; height: auto; }

/* sections */
.block { padding-block: clamp(1.6rem, 4vw, 3rem); }
.sec-title, .lesson-part h2, #compare h2, #activity h2, #quiz h2 { font-size: var(--fs-2xl); line-height: 1.4; margin: .4rem 0 1rem; color: var(--wood); }
.sub-title { font-size: var(--fs-xl); margin: 2rem 0 .7rem; color: var(--tab); }
.t-red { --tab: var(--red); }
.t-blue { --tab: var(--blue); }
.t-brass { --tab: var(--brass-d); }
.t-sage { --tab: var(--sage-d); }
#video, #compare, #activity, #quiz { --tab: var(--wood-2); }
.part-tag { display: inline-flex; align-items: center; gap: .55rem; margin: 0; font-weight: 800; color: var(--ink); background: #fff; padding: .1rem .9rem .1rem .2rem; border-radius: 4px; font-size: var(--fs-sm); border: 2px solid var(--tab); }
.part-tag .call { background: var(--tab); color: #fff; padding: 0 .6rem; border-radius: 2px; font-family: ui-monospace, Menlo, monospace, var(--bn-font); font-size: .9em; }
.goals { display: grid; gap: .6rem; padding: 0; list-style: none; grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr)); counter-reset: g; }
.goals li { position: relative; background: var(--paper); border-radius: 4px; padding: .7rem 1rem .7rem 2.9rem; border: 1px solid var(--line); border-top: 4px solid var(--red); box-shadow: 0 3px 0 #d6dde8; }
.goals li::before { counter-increment: g; content: counter(g, bengali); position: absolute; left: .8rem; top: .8rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: .9rem; }

/* index card */
.card { position: relative; background-color: var(--paper); background-image: linear-gradient(180deg, transparent 0 2.6rem, transparent 2.6rem), repeating-linear-gradient(180deg, transparent 0 2.05rem, var(--rule) 2.05rem 2.12rem); border-radius: 4px; padding: clamp(1rem, 3vw, 1.6rem); padding-bottom: clamp(1.6rem, 3vw, 2.2rem); border: 1px solid var(--line); border-top: 5px solid var(--tab); box-shadow: 0 2px 0 #d3dae5, 0 10px 22px rgba(43, 33, 24, .07); }
.card::after { content: ""; position: absolute; left: 50%; bottom: .45rem; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25); }
.card h3 { margin: 0 0 .5rem; font-size: var(--fs-lg); display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; color: var(--wood); }
.widget { margin: 1.6rem 0; }
.def { margin: 1rem 0; background: #fff; border-left: 6px solid var(--tab); border-radius: 4px; padding: .8rem 1rem; box-shadow: 0 2px 0 #d6dde8; }
.def b:first-child { color: var(--tab); }
.remember { margin: 1.4rem 0 .4rem; background: #fdf6e3; border-radius: 4px; padding: .9rem 1rem; border: 1px dashed var(--brass); }
.remember > b:first-child { display: inline-block; background: var(--wood); color: #fff; padding: 0 .6rem; border-radius: 3px; margin-right: .4rem; }
.fig { display: block; width: 100%; height: auto; }

/* controls */
.row-ctrl { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; margin: .7rem 0; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0; }
.chips button, .seg button { border: 2px solid var(--tab); background: #fff; color: var(--ink); border-radius: 4px; padding: .05rem .75rem; font: inherit; font-size: var(--fs-sm); cursor: pointer; max-width: 100%; text-align: left; }
.chips button[aria-pressed="true"], .seg button[aria-pressed="true"] { background: var(--tab); color: #fff; }
.seg { display: flex; flex-wrap: wrap; gap: .35rem; margin: .4rem 0 .6rem; }
.inp { display: flex; align-items: center; gap: .4rem; font-weight: 700; flex-wrap: wrap; margin: .35rem 0; }
.inp input { font: inherit; flex: 1 1 10rem; min-width: 0; max-width: 100%; padding: .15rem .55rem; border: 2px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink); }
.inp input.bad { border-color: var(--no); background: #fdf0ee; }
.slider { display: flex; align-items: center; gap: .6rem; font-weight: 700; flex-wrap: wrap; }
.slider b { min-width: 2em; display: inline-block; color: var(--tab); }
.slider input { accent-color: var(--tab); width: 14rem; max-width: 100%; }
.btn { font: inherit; font-weight: 800; border: 0; background: var(--red); color: #fff; padding: .3rem 1.05rem; border-radius: 4px; cursor: pointer; box-shadow: 0 4px 0 var(--red-d); }
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn.ghost { background: #fff; color: var(--ink); border: 2px solid var(--line); box-shadow: none; }
.btn[disabled] { opacity: .45; cursor: default; }
.msg { min-height: 1.8em; font-weight: 700; margin: .5rem 0; }
.msg.ok { color: var(--ok); } .msg.no { color: var(--no); }
.id-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.id-form input { flex: 1 1 12rem; min-width: 0; font: inherit; padding: .2rem .7rem; border: 2px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* events matcher */
.ev-grid { display: grid; gap: .8rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .ev-grid { grid-template-columns: 1fr 1fr; } }
.ev-col { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.ev-col button { width: 100%; text-align: left; font: inherit; font-size: var(--fs-sm); padding: .45rem .7rem; border-radius: 4px; border: 2px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; display: flex; gap: .55rem; align-items: center; }
.ev-col button .nm { font-weight: 800; color: var(--blue-d); flex: none; }
.ev-col button[aria-pressed="true"] { border-color: var(--blue); background: #eaf1fb; }
.ev-col button.done { border-color: var(--ok); background: #eef8f0; cursor: default; }
.ev-col button.wrong { animation: shake .4s; border-color: var(--no); }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.ev-story { margin-top: .4rem; }
.ev-story p { background: #f6f9fd; border-left: 4px solid var(--blue); padding: .5rem .8rem; margin: .4rem 0; animation: rise .35s both; font-size: var(--fs-sm); }

.pluto { display: flex; gap: 1rem; align-items: center; margin: 1.2rem 0; }
.pluto-ic { width: 88px; height: 88px; flex: none; }
.pluto b { font-size: var(--fs-lg); color: var(--blue-d); }
.pluto p { margin: .3rem 0 0; }
@media (max-width: 520px) { .pluto { flex-direction: column; align-items: flex-start; } }

/* forum */
.fo-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 680px) { .fo-grid { grid-template-columns: 170px 1fr; } }
.fo-clock { width: 100%; max-width: 170px; margin: 0 auto; display: block; }
.fo-board { background: #f6f9fd; border: 1px solid var(--line); border-radius: 4px; padding: .6rem .8rem; }
.fo-q { font-size: var(--fs-sm); border-bottom: 1px dashed var(--line); padding-bottom: .4rem; }
.fo-ans { list-style: none; padding: 0; margin: .4rem 0 0; display: grid; gap: .35rem; min-height: 2rem; }
.fo-ans li { font-size: .95rem; background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: .3rem .6rem; animation: rise .35s both; }
.fo-ans li button { font: inherit; font-size: .85rem; margin-left: .4rem; border: 1px solid var(--sage); color: var(--sage-d); background: #fff; border-radius: 4px; cursor: pointer; padding: 0 .4rem; }
.fo-ans li.best { border-color: var(--ok); background: #eef8f0; }
.fo-ans li small { color: var(--ink-2); font-weight: 700; }

/* online exam */
.ex-list { padding-left: 1.6rem; margin: .4rem 0; }
.ex-list li { margin: .5rem 0; }
.ex-list .ex-s { font-weight: 700; }
.ex-opts { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .25rem; }
.ex-opts button { font: inherit; font-size: var(--fs-sm); border: 2px solid var(--line); background: #fff; border-radius: 4px; padding: 0 .7rem; cursor: pointer; color: var(--ink); }
.ex-opts button[aria-pressed="true"] { border-color: var(--blue); background: #eaf1fb; }
.ex-opts button.right { border-color: var(--ok); background: #e7f6ea; }
.ex-opts button.wrong { border-color: var(--no); background: #fdecea; text-decoration: line-through; }
.ex-fix { display: block; font-size: .92rem; color: var(--ok); font-weight: 700; margin-top: .2rem; }

/* essay */
.lp-out { margin-top: .6rem; }
.lp-out ol { padding-left: 1.5rem; }
.lp-out li { margin: .3rem 0; animation: rise .35s both; }
.lp-out .lp-t { font-weight: 800; color: var(--wood); font-size: var(--fs-lg); margin: 0; }

/* glossary */
.words { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr)); }
.word { font: inherit; text-align: left; background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--tab); border-radius: 4px; padding: .6rem .8rem; cursor: pointer; color: var(--ink); min-height: 4.4rem; }
.word b { display: block; color: var(--tab); font-size: var(--fs-lg); }
.word span { display: none; font-size: var(--fs-sm); }
.word[aria-expanded="true"] span { display: block; animation: rise .3s both; }
.word[aria-expanded="true"] small { display: none; }
.word small { color: var(--ink-2); }

/* result race */
.rs-svg { border-radius: 6px; background: #f3f7ee; max-height: 260px; }

/* admission form */
.af-form { background: #fbfcfe; border: 1px solid var(--line); border-radius: 4px; padding: .6rem .9rem; max-width: 36rem; }
.af-head { font-weight: 800; color: var(--blue-d); border-bottom: 2px solid var(--blue); padding-bottom: .3rem; margin-bottom: .4rem; }
.af-badge { display: inline-block; background: var(--brass); color: #2b2118; border-radius: 3px; padding: 0 .45rem; font-size: .85rem; margin-right: .3rem; }
.af-form .inp { display: grid; grid-template-columns: 1fr; gap: .1rem; font-size: var(--fs-sm); }
@media (min-width: 560px) { .af-form .inp { grid-template-columns: 11rem 1fr; } }
.af-own { display: flex; gap: .5rem; align-items: center; font-size: var(--fs-sm); font-weight: 700; margin: .4rem 0; }
.af-own input { width: 1.2rem; height: 1.2rem; accent-color: var(--blue); }
.af-errs { list-style: none; padding: 0; margin: .5rem 0 0; }
.af-errs li { font-weight: 700; color: var(--no); font-size: var(--fs-sm); }
.af-errs li.ok { color: var(--ok); font-size: var(--fs-base); }

/* virtual classroom */
.vc-svg { max-height: 320px; background: #f4f1ea; border-radius: 6px; margin: .4rem 0; }
.far-body { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 720px) { .far-body { grid-template-columns: 1fr 1fr; } }
.far-svg { max-height: 240px; background: #1f2a3a; border-radius: 6px; }

/* wall magazine */
.wm-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 820px) { .wm-grid { grid-template-columns: 1fr 1fr; } }
.wm-lab { font-weight: 800; margin: .5rem 0 0; font-size: var(--fs-sm); color: var(--wood); }
.wm-paper { --wm: var(--red); border: 3px solid var(--wm); background: #fffdf6; border-radius: 4px; padding: .8rem; box-shadow: 6px 6px 0 rgba(74, 44, 29, .15); transform: rotate(-.6deg); align-self: start; }
.wm-paper h4 { margin: 0 0 .5rem; color: #fff; background: var(--wm); padding: .2rem .6rem; font-size: var(--fs-lg); text-align: center; border-radius: 2px; }
.wm-paper .yr { text-align: center; font-weight: 800; color: var(--wm); margin: 0 0 .4rem; font-size: var(--fs-sm); }
.wm-paper ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.wm-paper li { border: 1px dashed var(--wm); padding: .35rem .6rem; font-size: var(--fs-sm); background: #fff; animation: rise .35s both; }
.wm-paper .empty { color: var(--ink-2); font-size: var(--fs-sm); text-align: center; }

/* info-form sorter */
.forms-list { padding-left: 1.3rem; }
.forms-list li { margin: .3rem 0; }
.fm-card { min-height: 3.6rem; display: flex; align-items: center; justify-content: center; text-align: center; font-size: var(--fs-lg); font-weight: 800; padding: .7rem 1rem; border-radius: 4px; background: #fff; border: 2px dashed var(--sage); margin: .6rem 0; }
.fm-card.pop { animation: pop .35s; }
@keyframes pop { 50% { transform: scale(1.04); } }
#fm-btns .btn.ghost.right, .ws-btns .btn.ghost.right { background: var(--ok); border-color: var(--ok); color: #fff; }
#fm-btns .btn.ghost.wrong, .ws-btns .btn.ghost.wrong { border-color: var(--no); color: var(--no); }

/* course journey */
.oc-steps { list-style: none; padding: 0; margin: .6rem 0; display: grid; gap: .4rem; }
.oc-steps li { display: flex; gap: .7rem; align-items: center; padding: .45rem .8rem; border-radius: 4px; background: #fff; border: 2px solid var(--line); opacity: .4; transition: opacity .4s, border-color .4s, transform .4s; }
.oc-steps li.on { opacity: 1; border-color: var(--sage); }
.oc-steps li.cur { transform: translateX(6px); box-shadow: 0 3px 0 #cfe3d3; }
.oc-steps .n { width: 1.8rem; height: 1.8rem; flex: none; border-radius: 50%; background: var(--sage); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .9rem; }
.oc-steps .ic { width: 1.8rem; height: 1.8rem; flex: none; }
.fix { margin: 1.2rem 0; --tab: var(--brass); background-color: #fffaf0; }
.fix > b { display: flex; gap: .4rem; align-items: center; color: var(--brass-d); font-size: var(--fs-lg); }
.fix p { margin: .4rem 0 0; }

/* keyword picker */
.kw-need { font-weight: 800; font-size: var(--fs-lg); margin: .4rem 0; color: var(--sage-d); }
.kw-box { display: flex; align-items: center; gap: .5rem; border: 2px solid var(--sage); border-radius: 999px; padding: .3rem 1rem; background: #fff; min-height: 2.6rem; overflow-wrap: anywhere; }
.kw-box .ic { flex: none; }
.nm-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: var(--fs-lg); font-weight: 800; }
.nm-row span { background: #fff; border: 2px solid var(--line); border-radius: 4px; padding: .1rem .6rem; animation: rise .35s both; }
.nm-row span.hl { border-color: var(--sage); color: var(--sage-d); }
.gs-list { padding-left: 1.6rem; margin: .4rem 0; }
.gs-list li { margin: .6rem 0; }
.gs-list .gs-t { font-weight: 800; }
.gs-list .gs-why { display: block; font-size: .92rem; font-weight: 700; margin-top: .2rem; }
.gs-list .gs-why.ok { color: var(--ok); } .gs-list .gs-why.no { color: var(--no); }

/* card catalogue */
.cat-widget { --tab: var(--wood-2); }
.ct-drawer { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(12.5rem, 100%), 1fr)); margin: .6rem 0; }
.ct-card { font: inherit; text-align: left; cursor: pointer; background: #fffdf8; border: 1px solid #e1d6c4; border-top: 4px solid var(--red); border-radius: 3px; padding: .5rem .7rem 1.1rem; color: var(--ink); position: relative; box-shadow: 0 3px 0 #e6dccb; transition: transform .2s; }
.ct-card::after { content: ""; position: absolute; left: 50%; bottom: .3rem; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%; background: #e6dccb; }
.ct-card:hover { transform: translateY(-3px); }
.ct-card[aria-pressed="true"] { border-top-color: var(--blue); background: #f2f6fc; }
.ct-card .no { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; color: var(--red-d); display: block; }
.ct-card b { display: block; overflow-wrap: anywhere; }
.ct-card small { color: var(--ink-2); }
.ct-detail { background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--blue); border-radius: 4px; padding: .7rem .9rem; min-height: 4rem; }
.ct-detail h4 { margin: 0 0 .3rem; color: var(--blue-d); overflow-wrap: anywhere; }
.ct-detail p { margin: .3rem 0; }
.ct-detail .note { background: #fffaf0; border: 1px dashed var(--brass); padding: .4rem .6rem; font-size: var(--fs-sm); }
.ct-detail .tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.ct-detail .tags span { background: #eef1f5; border-radius: 3px; padding: 0 .5rem; font-size: .88rem; font-weight: 700; }
.chart-box { position: relative; height: 260px; margin: .6rem 0; }

/* classics shelf */
.cl-shelf { display: flex; align-items: flex-end; gap: .5rem; padding: .6rem 1rem 0; border-bottom: 12px solid var(--wood-2); min-height: 11rem; flex-wrap: wrap; }
.cl-book { font: inherit; cursor: pointer; border: 2px solid rgba(0, 0, 0, .25); border-radius: 4px 4px 0 0; color: #fff; font-weight: 800; padding: .7rem .6rem; min-height: 9rem; width: 9.5rem; max-width: calc(50% - .5rem); transition: transform .3s; font-size: .95rem; line-height: 1.5; display: flex; align-items: center; justify-content: center; text-align: center; box-shadow: inset 8px 0 0 rgba(0, 0, 0, .18); }
.cl-book.deco { width: 1.6rem; min-height: 7.5rem; padding: 0; cursor: default; opacity: .55; }
.cl-book:hover, .cl-book[aria-pressed="true"] { transform: translateY(-12px); }
.cl-book.deco:hover { transform: none; }
.cl-info { margin-top: .8rem; min-height: 3rem; }
.cl-info p { margin: .3rem 0; }

/* which site game */
.ws-q { font-size: var(--fs-lg); font-weight: 800; min-height: 3.2em; }
.ws-btns { display: grid; gap: .45rem; grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr)); }
.ws-btns .btn { overflow-wrap: anywhere; text-align: left; }

/* player */
.player { border-radius: 10px; background: var(--wood); padding: clamp(.5rem, 2vw, 1rem); color: #fff; box-shadow: 0 14px 30px rgba(74, 44, 29, .3); border: 4px solid var(--wood-3); }
.stage { position: relative; border-radius: 6px; overflow: hidden; }
.stage svg:not(.ic) { width: 100%; height: auto; display: block; }
.big-play { position: absolute; inset: 0; margin: auto; width: 5.5rem; height: 5.5rem; border-radius: 50%; border: 4px solid #fff; background: var(--red); color: #fff; display: grid; place-items: center; cursor: pointer; }
.big-play .ic { width: 2.4rem; height: 2.4rem; }
.big-play.hide { display: none; }
.caption { min-height: 3.6em; margin: .75rem .25rem; font-size: var(--fs-lg); line-height: 1.6; }
.controls { display: flex; align-items: center; gap: .6rem; }
.ctrl { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 0; background: var(--brass); color: #2b2118; display: grid; place-items: center; cursor: pointer; flex: none; }
.controls input { flex: 1; min-width: 0; accent-color: var(--brass); }
.time { font-variant-numeric: tabular-nums; font-size: var(--fs-sm); white-space: nowrap; }
.chapters { display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; margin: .75rem 0 0; list-style: none; }
.chapters button { border: 1px solid rgba(255, 255, 255, .4); background: transparent; color: #f6e9d8; border-radius: 4px; padding: .1rem .7rem; font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.chapters button.on { background: var(--brass); border-color: var(--brass); color: #2b2118; }

/* table */
.table-wrap { overflow-x: auto; }
.cmp { width: 100%; border-collapse: collapse; background: var(--paper); min-width: 42rem; }
.cmp th, .cmp td { border: 1px solid var(--line); padding: .5rem .7rem; text-align: left; vertical-align: top; }
.cmp thead th { background: var(--wood); color: #fff; }
.cmp td:first-child { font-weight: 800; color: var(--blue-d); font-family: ui-monospace, Menlo, monospace, var(--bn-font); font-size: .9em; }
.cmp tbody tr:nth-child(even) { background: #f6f8fb; }

/* quiz */
.score-pill { display: inline-block; background: var(--wood); color: #fff; padding: .1rem .9rem; border-radius: 4px; font-weight: 700; }
.lk-q { background: var(--paper); border-radius: 4px; padding: 1rem; margin: .8rem 0; border: 1px solid var(--line); border-top: 4px solid var(--red); }
.lk-q-stem { font-weight: 700; margin-bottom: .6rem; }
.lk-opts { display: grid; gap: .45rem; grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr)); }
.lk-opt { display: flex; gap: .6rem; align-items: center; text-align: left; font: inherit; padding: .45rem .7rem; border: 2px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink); cursor: pointer; overflow-wrap: anywhere; }
.lk-opt:hover { border-color: var(--blue); }
.lk-opt-key { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--blue); color: #fff; flex: none; font-size: .95rem; font-weight: 800; }
.lk-opt.is-right { border-color: var(--ok); background: #e8f7ec; }
.lk-opt.is-wrong { border-color: var(--no); background: #fdecea; }
.lk-explain { margin: .6rem 0 0; }
.lk-explain.ok { color: var(--ok); } .lk-explain.no { color: var(--no); }
.qa details, .cq-parts details { background: var(--paper); border-radius: 4px; padding: .6rem .9rem; margin: .5rem 0; border: 1px solid var(--line); border-left: 5px solid var(--blue); }
.qa summary, .cq-parts summary { cursor: pointer; font-weight: 700; }
.qa details p, .cq-parts details p { margin: .6rem 0 .2rem; }
.cq { margin: 1rem 0; }
.cq-stem { font-weight: 700; }
.cq-parts { list-style: none; padding: 0; }
.summary ul { padding-left: 1.3rem; }
.summary li { margin: .4rem 0; }
.summary h2 { margin-top: 0; }

.pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-block: 2rem 1rem; }
.pager-btn { display: inline-block; padding: .5rem 1.1rem; border-radius: 4px; background: var(--wood); color: #fff; text-decoration: none; font-weight: 700; }
.pager-btn.disabled { background: #dfe3ea; color: #6b6660; }
.credit { color: var(--ink-2); font-size: var(--fs-sm); padding-bottom: 2rem; }

[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .6s, transform .6s; }
[data-reveal].is-in { opacity: 1; transform: none; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  [data-reveal] { opacity: 1; transform: none; }
  .wm-paper { transform: none; }
}
