/* ==========================================================
   Class 7 Science · Section 9 · তাপ ও তাপমাত্রা
   Theme: "থার্মাল ক্যামেরা" — dark viewfinder, heat-map gradients (age ~12)
   ========================================================== */
:root {
  --bg: #0e1220;
  --panel: #161c2e;
  --panel-2: #1d2540;
  --text: #eef1ff;
  --muted: #9aa3c7;
  --line: rgba(154, 163, 199, .22);
  --c0: #2b3aa8; --c1: #6a2fb8; --c2: #d8317f; --c3: #ff7a1a; --c4: #ffd84a;
  --cyan: #5fd3ff;
  --heat: linear-gradient(90deg, var(--c0), var(--c1), var(--c2), var(--c3), var(--c4));
}
body { color: var(--text); background: radial-gradient(1200px 600px at 80% -10%, rgba(216, 49, 127, .18), transparent 60%), radial-gradient(900px 500px at -10% 30%, rgba(43, 58, 168, .25), transparent 60%), var(--bg); }
::selection { background: var(--c3); color: #000; }
strong { color: var(--c4); }
b { color: #fff; }
a { color: var(--cyan); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--c4); color: #000; padding: .5rem 1rem; z-index: 2000; }
.skip:focus { left: 8px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: .5rem 1rem; flex-wrap: wrap; padding: .45rem var(--gutter); background: rgba(14, 18, 32, .9); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.crumbs { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: #fff; text-decoration: underline; }
.crumbs [aria-current] { color: var(--c4); font-weight: 700; }
.heat-scale { display: flex; align-items: center; gap: .45rem; color: var(--muted); }
.hs-bar { width: 120px; height: 10px; border-radius: 5px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.hs-bar i { display: block; height: 100%; width: 0; background: var(--heat); background-size: 120px 100%; transition: width .6s; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem 1.1rem; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font-weight: 700; text-decoration: none; transition: border-color .2s, transform .15s; }
.btn:hover { border-color: var(--cyan); transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-hot { background: linear-gradient(90deg, var(--c2), var(--c3)); border-color: transparent; color: #fff; }
.btn-small { padding: .25rem .75rem; font-size: var(--fs-sm); }
.btn[aria-pressed="false"].btn-hot { background: var(--panel-2); border-color: var(--line); }
.row-btns { display: flex; gap: .6rem; flex-wrap: wrap; margin: .75rem 0; }
.seg { display: inline-flex; flex-wrap: wrap; gap: .35rem; margin: .4rem 0; }
.seg button { border: 1px solid var(--line); background: var(--panel-2); color: var(--text); padding: .3rem .85rem; border-radius: 8px; font-weight: 600; }
.seg button.on, .seg button[aria-pressed="true"] { background: linear-gradient(90deg, var(--c1), var(--c2)); border-color: transparent; }

/* ---------- panel ---------- */
.panel { position: relative; background: linear-gradient(180deg, var(--panel), #121729); border: 1px solid var(--line); border-radius: 14px; padding: clamp(1rem, 3vw, 1.5rem); }
.panel h3 { font-size: var(--fs-lg); display: flex; gap: .5rem; align-items: center; }
.panel.hot { border-top: 4px solid var(--c3); } .panel.cold { border-top: 4px solid var(--cyan); }
.panel.hot h4 { color: var(--c3); } .panel.cold h4 { color: var(--cyan); }

/* ---------- hero ---------- */
.hero { padding: clamp(1.5rem, 4vw, 3rem) 0 1.5rem; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center; }
.eyebrow { color: var(--muted); font-weight: 600; display: flex; gap: .5rem; align-items: center; }
.rec { width: .7rem; height: .7rem; border-radius: 50%; background: #ff3b4f; box-shadow: 0 0 10px #ff3b4f; animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }
.hero h1 { font-size: var(--fs-3xl); margin: .4rem 0 .8rem; }
.grad { background: var(--heat); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: var(--fs-lg); color: #d6dbf5; }
.viewfinder { position: relative; border-radius: 14px; overflow: hidden; background: #000; aspect-ratio: 420 / 320; cursor: crosshair; touch-action: none; }
.viewfinder svg:not(.ic) { width: 100%; height: 100%; }
.vf-c { position: absolute; width: 28px; height: 28px; border: 3px solid rgba(255, 255, 255, .8); }
.vf-c.tl { top: 10px; left: 10px; border-right: 0; border-bottom: 0; } .vf-c.tr { top: 10px; right: 10px; border-left: 0; border-bottom: 0; }
.vf-c.bl { bottom: 10px; left: 10px; border-right: 0; border-top: 0; } .vf-c.br { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }
.vf-read { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, .6); padding: .1rem .8rem; border-radius: 20px; font-weight: 700; font-size: var(--fs-sm); }
.vf-note { position: absolute; bottom: 6px; right: 46px; margin: 0; font-size: .72rem; color: rgba(255, 255, 255, .6); }

/* ---------- layout ---------- */
.block { padding: clamp(2rem, 5vw, 3.5rem) 0; }
.lesson-part.alt { background: rgba(29, 37, 64, .35); border-block: 1px solid var(--line); }
.part-tag { display: inline-block; margin: 0 0 .3rem; padding: .05rem .8rem; border-radius: 20px; background: var(--heat); color: #000; font-weight: 800; font-size: var(--fs-sm); }
h2 { font-size: var(--fs-2xl); }
.sec-title { font-size: var(--fs-xl); display: flex; gap: .6rem; align-items: center; }
.chip { font-size: .85rem; padding: .05rem .7rem; border-radius: 20px; border: 1px solid var(--c3); color: var(--c3); }
.sub-title { font-size: var(--fs-xl); margin-top: 2.5rem; display: flex; gap: .5rem; align-items: center; }
.goals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr)); gap: .5rem 1.5rem; list-style: none; padding: 0; }
.goals li { position: relative; padding-left: 1.6rem; }
.goals li::before { content: ''; position: absolute; left: 0; top: .55em; width: .9rem; height: .9rem; border-radius: 50%; background: var(--heat); background-size: 300% 100%; }
.goals li:nth-child(3n+2)::before { background-position: 50% 0; } .goals li:nth-child(3n)::before { background-position: 100% 0; }
.safety { display: flex; gap: .5rem; align-items: flex-start; font-size: var(--fs-sm); padding: .5rem .8rem; border-radius: 10px; background: rgba(255, 122, 26, .12); border: 1px solid rgba(255, 122, 26, .4); }
.compare, .defs, .daily { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); gap: 1rem; margin-top: 1rem; }
.compare p, .defs p, .daily p { margin: 0; }
.formula { display: inline-block; font-size: var(--fs-xl); font-weight: 800; padding: .3rem 1rem; border-radius: 10px; background: #000; border: 1px solid var(--c3); color: var(--c4); }
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .6s, transform .6s; }
[data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- glasses / warm ---------- */
#glass-svg, #warm-svg { width: 100%; height: auto; }
.warm { margin-top: 1rem; }
.warm-body { display: grid; grid-template-columns: minmax(0, 260px) 1fr; gap: 1.25rem; align-items: center; }
.warm input, .thermo-lab input, .rust input, .press input, .humid input { width: 100%; accent-color: var(--c3); }

/* ---------- thermometer ---------- */
.thermo-lab { display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem; align-items: center; }
.thermo-wrap { background: #fff; border-radius: 12px; padding: .5rem; }
#thermo-svg { width: 100%; height: auto; }
.readout { display: flex; gap: 1rem; flex-wrap: wrap; margin: .5rem 0; }
.readout b { font-size: var(--fs-xl); padding: .1rem .8rem; border-radius: 8px; background: #000; color: var(--c4); }
.presets { display: flex; flex-wrap: wrap; gap: .35rem; }
.presets button { border: 1px solid var(--line); background: var(--panel-2); color: var(--text); padding: .2rem .7rem; border-radius: 16px; font-size: var(--fs-sm); }
.conv { margin-top: 1rem; }
.conv-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin: 1rem 0 .5rem; }
.conv-row input, .ftable input { width: 6.5rem; padding: .3rem .5rem; border-radius: 8px; border: 1px solid var(--line); background: #0b0f1c; color: var(--text); }
.steps { margin: .5rem 0; padding-left: 1.4rem; font-family: var(--bn-font); }
.steps li { margin-bottom: .2rem; }
.steps li:last-child { color: var(--c4); font-weight: 800; }
.fever { margin-top: 1rem; overflow-x: auto; }
.ftable { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.ftable th, .ftable td { border-bottom: 1px solid var(--line); padding: .4rem .5rem; text-align: left; }
.ftable th { color: var(--muted); }
.ftable input[type="text"] { width: 8rem; }
.tag-ok { color: #7ee08a; font-weight: 700; } .tag-hot { color: var(--c3); font-weight: 700; }

/* ---------- expansion ---------- */
.exp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr)); gap: 1rem; }
#ring-svg, #balloon-svg { width: 100%; max-width: 300px; height: auto; display: block; margin: 0 auto; }
.rail { margin-top: 1rem; }
#rail-svg { width: 100%; height: auto; }
#ruti-svg { width: 100%; height: auto; margin-top: .4rem; }

/* ---------- pressure / humidity ---------- */
.press-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.press-grid figure { margin: 0; text-align: center; }
.press-grid canvas { width: 100%; height: auto; border-radius: 10px; background: #0b0f1c; border: 1px solid var(--line); }
.press-grid figcaption { margin-top: .3rem; font-size: var(--fs-sm); }
.humid { margin-top: 1rem; }
.humid-body { display: grid; grid-template-columns: minmax(0, 360px) 1fr; gap: 1.25rem; align-items: center; }
#humid-svg { width: 100%; height: auto; }
.humid label { font-size: var(--fs-sm); font-weight: 700; display: block; margin-top: .4rem; }

/* ---------- transfer ---------- */
.modes { display: flex; gap: .4rem; flex-wrap: wrap; margin: 1rem 0; }
.modes button { border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font-weight: 800; padding: .4rem 1.1rem; border-radius: 10px; }
.modes button[aria-selected="true"] { background: var(--heat); color: #000; border-color: transparent; }
#rod-c { width: 100%; height: auto; border-radius: 10px; background: #0b0f1c; }
.three-stage { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: radial-gradient(circle at 50% 40%, #1d2540, #0b0f1c); touch-action: none; }
.three-stage canvas { width: 100% !important; height: 100% !important; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; }
#rad-svg, #earth-svg { width: 100%; height: auto; }
.earth { margin-top: .5rem; }

/* ---------- player ---------- */
.player { border-radius: 16px; background: #000; padding: clamp(.5rem, 2vw, 1rem); border: 1px solid var(--line); }
.stage { position: relative; border-radius: 10px; overflow: hidden; }
#scene { width: 100%; height: auto; }
.big-play { position: absolute; inset: 0; margin: auto; width: 5.5rem; height: 5.5rem; border-radius: 50%; border: 0; background: var(--heat); color: #000; display: grid; place-items: center; box-shadow: 0 0 30px rgba(255, 122, 26, .5); }
.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; flex: none; border-radius: 50%; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); display: grid; place-items: center; }
.controls input { flex: 1; min-width: 0; accent-color: var(--c3); }
.time { 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 var(--line); background: transparent; color: var(--muted); border-radius: 16px; padding: .1rem .7rem; font-size: var(--fs-sm); }
.chapters button.on { background: var(--heat); color: #000; border-color: transparent; }

/* ---------- quiz ---------- */
.score-pill { position: sticky; top: 3.6rem; z-index: 5; display: inline-flex; gap: .3rem; align-items: center; padding: .3rem 1rem; border-radius: 20px; background: var(--heat); color: #000; font-weight: 800; }
.quiz-fig { max-width: 26rem; margin: 1rem 0 1.5rem; }
.quiz-fig svg:not(.ic) { width: 100%; height: auto; background: #fff; border-radius: 10px; }
.quiz-fig figcaption { color: var(--muted); font-size: var(--fs-sm); margin-top: .4rem; }
.mcq { display: grid; gap: 1rem; }
.lk-q { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.25rem; }
.lk-q-stem { font-weight: 700; margin-bottom: .6rem; }
.lk-q-num { color: var(--c3); }
.mcq-stem-list { margin: .3rem 0; font-weight: 500; }
.lk-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr)); gap: .5rem; }
.lk-opt { display: flex; gap: .6rem; align-items: center; text-align: left; padding: .45rem .8rem; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); }
.lk-opt:hover { border-color: var(--cyan); }
.lk-opt-key { flex: none; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--heat); background-size: 300% 100%; color: #000; display: grid; place-items: center; font-weight: 800; }
.lk-opt.is-right { border-color: #7ee08a; background: rgba(126, 224, 138, .15); }
.lk-opt.is-wrong { border-color: #ff5d6c; background: rgba(255, 93, 108, .15); }
.lk-opt[aria-disabled="true"] { cursor: default; }
.lk-explain { margin: .6rem 0 0; padding: .5rem .8rem; border-radius: 10px; }
.lk-explain.ok { background: rgba(126, 224, 138, .12); } .lk-explain.no { background: rgba(255, 93, 108, .12); }
.qa details, .cq-parts details { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: .6rem; }
.qa summary, .cq-parts summary { cursor: pointer; padding: .65rem 1rem; font-weight: 700; }
.qa details p, .cq-parts p { padding: 0 1rem .8rem; margin: 0; }
.cq { margin-top: 1rem; }
.cq-stem { font-size: var(--fs-lg); }
.cq-parts { padding-left: 0; list-style: none; display: grid; gap: .1rem; margin-top: .75rem; }
.summary li { margin-bottom: .4rem; }
.pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 2rem 0 1rem; }
.pager-btn { padding: .6rem 1.1rem; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); text-decoration: none; font-weight: 700; }
.pager-btn:hover { border-color: var(--c3); }
.pager-btn.disabled { opacity: .5; }
.credit { color: var(--muted); font-size: var(--fs-sm); padding-bottom: 2rem; }

@media (max-width: 860px) {
  .hero-grid, .thermo-lab, .warm-body, .humid-body { grid-template-columns: 1fr; }
  .thermo-wrap { max-width: 200px; margin-inline: auto; }
  #warm-svg, #humid-svg { max-width: 320px; margin-inline: auto; }
}
@media (max-width: 560px) {
  .heat-scale span { display: none; }
  .press-grid { grid-template-columns: 1fr; }
  .score-pill { top: 5.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; }
  .rec { animation: none; }
}
