/* ==========================================================
   Class 6 Science · Section 8 · মিশ্রণ
   Theme: "শরবতওয়ালার ঠেলাগাড়ি" — a Bangladeshi street
   sherbet-and-jhalmuri cart. Cream signboard page, red/green
   scalloped awning on top bar and hero, cards painted like
   hand-lettered signboards (double painted border + corner
   dots). Palette: cart red, lime sherbet, mango, tamarind,
   water teal, cream, dark ink. Band কৌতূহলী (11–12).
   ========================================================== */
:root {
  --bg: #fff4dd;
  --card: #fffdf6;
  --ink: #2a1c14;
  --ink-2: #6a5444;
  --red: #c8372d;
  --red-d: #8e221b;
  --red-s: #fbe3df;
  --lime: #4f8f25;
  --lime-s: #e6f2d8;
  --mango: #e89a12;
  --mango-s: #fdf0d2;
  --tam: #6b3a1f;
  --teal: #1f7f86;
  --teal-s: #dcf0f1;
  --line: #ead9b8;
  --paint: #c8372d;
  --ok: #2f7a2a;
  --no: #b0302a;
}
* { box-sizing: border-box; }
body {
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 30%, rgba(232, 154, 18, .07) 0 3px, transparent 4px) 0 0 / 44px 44px,
    radial-gradient(circle at 70% 80%, rgba(200, 55, 45, .05) 0 2px, transparent 3px) 0 0 / 60px 60px,
    var(--bg);
}
::selection { background: rgba(232, 154, 18, .3); }
a { color: var(--teal); }
strong { color: var(--red); }
.muted { color: var(--ink-2); }
.small { font-size: var(--fs-sm); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 2000; }
.skip:focus { left: 8px; }
.wrap { max-width: var(--content-w); margin-inline: auto; padding-inline: var(--gutter); }
main, .wrap, .lesson-part > *, .grid2 > *, .row-ctrl > *, .exp-grid > *, .two-sliders > * { min-width: 0; }

/* awning stripe (reused) */
.awning, .topbar::after {
  background:
    repeating-linear-gradient(90deg, var(--red) 0 36px, #fff6e6 36px 72px, var(--lime) 72px 108px, #fff6e6 108px 144px);
}
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: .4rem 1rem; flex-wrap: wrap; padding: .45rem var(--gutter) .7rem; background: rgba(255, 248, 232, .96); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); font-size: var(--fs-sm); border-bottom: 2px solid var(--tam); }
.topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -8px; height: 6px; -webkit-mask: radial-gradient(circle at 9px 0, #000 6px, transparent 6.5px) 0 0 / 18px 6px repeat-x; mask: radial-gradient(circle at 9px 0, #000 6px, transparent 6.5px) 0 0 / 18px 6px repeat-x; }
.crumbs { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs [aria-current] { color: var(--red); font-weight: 700; }
.level { display: flex; align-items: center; gap: .45rem; font-weight: 800; }
.glass-badge { width: 1.5rem; height: 1.95rem; }
#gb-fill { transition: y .6s ease; }
.level.pop { animation: bob .6s; }
@keyframes bob { 40% { transform: translateY(-5px); } }

/* hero */
.hero { position: relative; padding: 0 0 2rem; }
.awning { height: 34px; -webkit-mask: radial-gradient(circle at 18px 22px, #000 12px, transparent 12.5px) 0 0 / 36px 34px repeat-x, linear-gradient(#000, #000) 0 0 / 100% 22px no-repeat; mask: radial-gradient(circle at 18px 22px, #000 12px, transparent 12.5px) 0 0 / 36px 34px repeat-x, linear-gradient(#000, #000) 0 0 / 100% 22px no-repeat; margin-bottom: clamp(1.2rem, 4vw, 2.6rem); }
.hero-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1fr 1.05fr; } }
.eyebrow { display: inline-block; color: #fff; background: var(--red); font-weight: 800; padding: .1rem .9rem; border-radius: 6px; font-size: var(--fs-sm); box-shadow: 0 3px 0 var(--red-d); }
h1 { font-size: var(--fs-3xl); line-height: 1.25; margin: .7rem 0 1rem; color: var(--tam); text-shadow: 3px 3px 0 #f6d38d; }
.lede { font-size: var(--fs-lg); line-height: 1.75; }
.hint { color: var(--ink-2); border-left: 5px solid var(--mango); padding-left: .8rem; }
.sign-frame { margin: 0; border-radius: 14px; overflow: hidden; background: #fbe6bd; border: 4px solid var(--tam); box-shadow: 0 0 0 4px var(--mango), 0 14px 30px rgba(107, 58, 31, .25); }
.sign-frame > svg { display: block; width: 100%; height: auto; }
.hero-read { margin: 0; padding: .4rem 1rem; background: var(--tam); color: #fff3d6; font-weight: 800; }

/* blocks */
.block { padding-block: clamp(1.6rem, 4vw, 3rem); }
.sec-title, .lesson-part h2, #video h2, #compare h2, #activity h2, #quiz h2, .story h2 { font-size: var(--fs-2xl); line-height: 1.35; margin: .2rem 0 1rem; color: var(--tam); }
.story h2 { font-size: var(--fs-xl); }
.sub-title { font-size: var(--fs-xl); margin: 2rem 0 .8rem; color: var(--teal); }
.part-tag { display: inline-block; margin: 0; font-weight: 800; color: #fff; background: var(--lime); padding: .05rem 1rem; border-radius: 4px 14px 4px 14px; font-size: var(--fs-sm); box-shadow: 0 3px 0 #33621a; }
.goals { display: grid; gap: .6rem; padding: 0; list-style: none; grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr)); }
.goals li { background: var(--card); border-radius: 10px; padding: .7rem 1rem .7rem 2.6rem; border: 2px solid var(--line); position: relative; }
.goals li::before { content: ''; position: absolute; left: .8rem; top: 1.05rem; width: 1rem; height: 1.2rem; border: 2.5px solid var(--tam); border-top: 0; border-radius: 0 0 4px 4px; background: linear-gradient(transparent 40%, var(--mango) 40%); }

/* signboard card */
.card { position: relative; background: var(--card); border-radius: 12px; padding: clamp(1rem, 3vw, 1.6rem); border: 3px solid var(--paint); box-shadow: inset 0 0 0 4px var(--card), inset 0 0 0 6px var(--mango), 0 6px 0 rgba(107, 58, 31, .18); }
.card::before, .card::after { content: ''; position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--lime); top: 12px; }
.card::before { left: 12px; } .card::after { right: 12px; }
.card h3 { margin: 0 0 .5rem; font-size: var(--fs-lg); display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; color: var(--red-d); }
.widget { margin: 1.6rem 0; }
.def { margin: 1rem 0; background: var(--teal-s); border-left: 6px solid var(--teal); border-radius: 6px; padding: .8rem 1rem; }
.def b:first-child { color: var(--teal); }
.remember { margin: 1.4rem 0 .4rem; background: var(--mango-s); border-radius: 10px; padding: .9rem 1rem; border: 2px dashed var(--mango); }
.remember > b:first-child { display: inline-block; background: var(--red); color: #fff; padding: 0 .6rem; border-radius: 4px; margin-right: .4rem; }
.formula { text-align: center; font-size: var(--fs-xl); font-weight: 800; margin: 1rem auto; padding: .4rem 1.4rem; border: 3px solid var(--tam); border-radius: 8px; background: var(--card); width: fit-content; max-width: 100%; }
.warn-note { display: flex; gap: .5rem; align-items: flex-start; background: var(--red-s); border-radius: 8px; padding: .5rem .8rem; font-size: var(--fs-sm); margin: .6rem 0 0; }
.warn-note .ic { flex: none; margin-top: .2rem; }

.grid2 { display: grid; gap: 1.2rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid2 { grid-template-columns: minmax(0, .8fr) 1fr; } }
.fig { display: block; width: 100%; height: auto; }
.exp-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: start; margin: .6rem 0; }
@media (min-width: 760px) { .exp-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; } }
#sher-svg, #sat-svg, #heat-svg, #univ-svg, #cryst-svg, #filt-svg, #size-svg { max-width: 420px; margin-inline: auto; }
#fizz-svg { max-width: 220px; margin-inline: auto; }
#muri-svg, #conc-svg, #tube-svg, #evap-svg, #settle-svg { max-width: 600px; margin-inline: auto; }
#dist-svg { max-width: 680px; margin-inline: auto; }
#dist-svg .num { cursor: pointer; }
#dist-svg .num:focus-visible circle { stroke: #1d7bff; stroke-width: 4; }
.two-sliders { display: flex; flex-wrap: wrap; gap: 0 1.5rem; }

.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: .5rem 0; }
.chips button, .seg button { border: 2px solid var(--tam); background: #fff; color: var(--ink); border-radius: 999px; padding: .05rem .8rem; font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.chips button.seen { border-color: var(--lime); background: var(--lime-s); }
.chips button.no-dis { border-color: var(--red); background: var(--red-s); }
.chips button[aria-pressed="true"], .seg button[aria-pressed="true"] { background: var(--tam); color: #fff; border-color: var(--tam); }
.seg { display: inline-flex; flex-wrap: wrap; gap: .3rem; margin: .3rem 0; }
.slider { display: flex; align-items: center; gap: .5rem; font-weight: 700; flex-wrap: wrap; margin: .5rem 0; }
.slider b { color: var(--red-d); }
.slider input { accent-color: var(--red); width: 11rem; max-width: 100%; }
.btn { font: inherit; font-weight: 800; border: 0; background: var(--red); color: #fff; padding: .3rem 1.1rem; border-radius: 999px; cursor: pointer; box-shadow: 0 3px 0 var(--red-d); margin: .2rem 0; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--red-d); }
.btn.ghost { background: #fff; color: var(--ink); border: 2px solid var(--tam); box-shadow: 0 3px 0 var(--line); }
.btn[disabled] { opacity: .45; cursor: default; }
.count-pill { font-weight: 800; background: var(--tam); color: #fff; padding: .05rem .8rem; border-radius: 999px; font-variant-numeric: tabular-nums; }
.msg { min-height: 1.8em; font-weight: 700; margin: .5rem 0; }
.msg.ok { color: var(--ok); } .msg.no { color: var(--no); }
.readout { display: grid; gap: .3rem; background: var(--mango-s); border: 2px solid var(--line); border-radius: 10px; padding: .6rem .8rem; }
.readout div { display: flex; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.readout b { font-variant-numeric: tabular-nums; }
.state { display: inline-block; padding: 0 .7rem; border-radius: 999px; font-weight: 800; color: #fff; }
.state.un { background: var(--teal); } .state.sat { background: var(--red); }
.calc-out { font-size: var(--fs-lg); font-weight: 700; background: var(--card); border: 2px dashed var(--teal); border-radius: 10px; padding: .5rem .9rem; }
.meter { display: flex; align-items: center; gap: .6rem; font-weight: 700; flex-wrap: wrap; }
.meter i { flex: 1 1 8rem; height: 14px; border-radius: 999px; background: var(--line); overflow: hidden; display: block; }
.meter i b { display: block; height: 100%; width: 100%; background: var(--mango); transition: width .5s; }

/* sorter */
.sorter { list-style: none; padding: 0; margin: .6rem 0; display: grid; gap: .5rem; }
.sorter li { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; justify-content: space-between; padding: .45rem .7rem; border-radius: 10px; background: #fff; border: 2px solid var(--line); }
.sorter li .t { flex: 1 1 11rem; display: flex; align-items: center; gap: .5rem; }
.sorter li .t .ic { width: 1.7rem; height: 1.7rem; flex: none; }
.sorter li.ok { background: var(--lime-s); border-color: var(--lime); }
.sorter li.bad { animation: shake .4s; border-color: var(--no); }
.sorter .seg { margin: 0; }
.sorter .seg button { font-size: .95rem; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* tag row */
.tag-row { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); margin: .6rem 0; }
.tag-row > div { background: #fff; border: 2px solid var(--line); border-radius: 10px; padding: .5rem .8rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem; }
.tag-row > div.ok { border-color: var(--lime); background: var(--lime-s); }
.tag-row > div.bad { animation: shake .4s; border-color: var(--no); }
.tag-row b { font-size: var(--fs-lg); }

/* steps */
.steps { padding-left: 1.4rem; margin: .3rem 0 .6rem; }
.steps li { margin: .25rem 0; color: var(--ink-2); }
.steps li.now { color: var(--ink); font-weight: 800; }
.steps li.done { color: var(--ok); }

.exp-info { background: #fff; border: 2px solid var(--line); border-radius: 10px; padding: .7rem .9rem; min-height: 5.5rem; margin: .5rem 0; }
.exp-info h4 { margin: 0 0 .3rem; font-size: var(--fs-lg); color: var(--teal); }
.exp-info p { margin: .3rem 0; }

.size-scale { display: flex; border-radius: 8px; overflow: hidden; font-size: .9rem; font-weight: 700; margin: .4rem 0; }
.size-scale span { flex: 1; padding: .25rem .5rem; color: #fff; }
.size-scale .col { background: var(--teal); } .size-scale .sus { background: var(--tam); }

.chart-box { position: relative; height: 250px; margin: .8rem 0; }

/* role match (detective) */
.role-match { list-style: none; padding: 0; display: grid; gap: .5rem; }
.role-match li { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; justify-content: space-between; padding: .5rem .7rem; border-radius: 10px; background: #fff; border: 2px solid var(--line); }
.role-match li > span { flex: 1 1 13rem; font-weight: 700; }
.role-match li .sels { display: flex; flex-wrap: wrap; gap: .4rem; }
.role-match select { font: inherit; font-size: var(--fs-sm); max-width: 100%; padding: .1rem .4rem; border: 2px solid var(--tam); border-radius: 6px; background: #fff; color: var(--ink); }
.role-match li.ok { background: var(--lime-s); border-color: var(--lime); }
.role-match li.bad { border-color: var(--no); }

/* story */
.story .part-tag { margin-bottom: .6rem; }

/* player */
.player { border-radius: 16px; background: var(--tam); padding: clamp(.5rem, 2vw, 1rem); color: #fff; box-shadow: 0 0 0 4px var(--mango), 0 14px 30px rgba(107, 58, 31, .3); }
.stage { position: relative; border-radius: 10px; 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: #fff; color: var(--ink); display: grid; place-items: center; cursor: pointer; flex: none; }
.controls input { flex: 1; min-width: 0; accent-color: var(--mango); }
.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, .55); background: transparent; color: #fff3d6; border-radius: 999px; padding: .1rem .7rem; font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.chapters button.on { background: var(--mango); border-color: var(--mango); color: var(--ink); }

/* table */
.table-wrap { overflow-x: auto; }
.cmp { width: 100%; border-collapse: collapse; background: var(--card); min-width: 34rem; border: 2px solid var(--tam); }
.cmp.mini { min-width: 0; margin: .6rem 0; }
.cmp th, .cmp td { border: 1px solid var(--line); padding: .5rem .7rem; text-align: left; vertical-align: top; }
.cmp thead th { background: var(--tam); color: #fff; }
.cmp thead th.c1 { background: var(--teal); }
.cmp thead th.c2 { background: var(--lime); }
.cmp thead th.c3 { background: var(--mango); color: var(--ink); }
.cmp thead th.c4 { background: var(--red); }
.cmp td:first-child { font-weight: 800; background: #fff7e8; }

/* quiz */
.score-pill { display: inline-block; background: var(--tam); color: #fff; padding: .1rem .9rem; border-radius: 999px; font-weight: 700; }
.lk-q { background: var(--card); border-radius: 10px; padding: 1rem; margin: .8rem 0; border: 2px solid var(--line); border-left: 8px solid var(--mango); }
.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: 10px; background: #fff; color: var(--ink); cursor: pointer; }
.lk-opt-key { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--red); color: #fff; flex: none; font-size: .95rem; }
.lk-opt.is-right { border-color: var(--ok); background: #e7f4e1; }
.lk-opt.is-wrong { border-color: var(--no); background: #fbe7e4; }
.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(--card); border-radius: 8px; padding: .6rem .9rem; margin: .5rem 0; border: 2px solid var(--line); border-left: 6px solid var(--teal); }
.cq .cq-parts details { background: #fff; }
.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: 800; font-size: var(--fs-lg); }
.cq-parts { list-style: none; padding: 0; }
.summary ul { padding-left: 1.3rem; }
.summary li { margin: .4rem 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: 999px; background: var(--tam); color: #fff; text-decoration: none; font-weight: 700; border: 2px solid var(--tam); }
.pager-btn.disabled { background: var(--line); color: #5f4c3e; border-color: var(--line); }
.credit { color: var(--ink-2); font-size: var(--fs-sm); padding-bottom: 2rem; }

/* pour-in reveal */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .7s, transform .7s; }
[data-reveal].is-in { opacity: 1; transform: none; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
