/* =====================================================================
   LRL Player · Altlearn · engine styles
   Design canvas is a fixed 1600 × 900 "stage" that is scaled to fit any
   laptop or projector, so every chapter looks the same on every screen.
   ===================================================================== */
@font-face { font-family: "Tiro Bangla Local"; src: url("../assets/fonts/TiroBangla-Regular.ttf") format("truetype"); font-display: swap; }

:root {
  --navy: #1B2B4B; --navy-2: #2A3D63; --amber: #E07B3A; --amber-2: #F3A46B; --amber-soft: #FCE9DA;
  --green: #2D6A4F; --green-soft: #DCEFE4; --cream: #F8F4EE; --white: #FFFFFF;
  --ink: #1A1A1A; --muted: #6B6B6B; --line: #E2DDD6; --sky: #3D7EA6; --sky-soft: #E1EEF6;
  --red: #C0473A; --red-soft: #F8E1DD;
  /* sentence-part colours (used everywhere for S / V / O …) */
  --S: #3D7EA6; --S-bg: #E1EEF6;
  --V: #E07B3A; --V-bg: #FCE9DA;
  --O: #2D6A4F; --O-bg: #DCEFE4;
  --X: #6B6B6B; --X-bg: #EEEBE6;
  --T: #8A5A2B; --T-bg: #F3E6D6;
  --P: #7A6A1E; --P-bg: #F4EFCF;
  --display: "Playfair Display", Georgia, serif;
  --body: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "DM Mono", Consolas, monospace;
  --bangla: "Tiro Bangla", "Tiro Bangla Local", "Kalpurush", serif;
  --r: 22px;
  --shadow: 0 10px 30px rgba(27,43,75,.12), 0 2px 6px rgba(27,43,75,.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0F1A2E; color: var(--ink); font-family: var(--body); overflow: hidden; }
.bn, :lang(bn) { font-family: var(--bangla); font-weight: 400 !important; line-height: 1.8; }
button { font-family: inherit; cursor: pointer; }

/* ---------- stage ---------- */
#viewport { position: fixed; inset: 0; overflow: hidden; }
#stage { user-select: none; -webkit-user-select: none; width: 1600px; height: 900px; position: absolute; left: 50%; top: 50%; background: var(--cream); border-radius: 18px; overflow: hidden;
  transform-origin: center center; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
#topbar { position: absolute; left: 0; right: 0; top: 0; height: 70px; display: flex; align-items: center; gap: 18px; padding: 0 28px;
  background: var(--white); border-bottom: 1px solid var(--line); z-index: 20; }
#topbar .logo { height: 34px; }
#topbar .chap { font-family: var(--mono); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }
#topbar .chap b { color: var(--navy); font-family: var(--body); letter-spacing: 0; text-transform: none; font-size: 17px; margin-left: 6px; }
#secbar { display: flex; gap: 6px; margin-left: auto; }
.secdot { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--cream); color: var(--muted);
  font-size: 13px; font-weight: 600; border: 1px solid var(--line); transition: all .3s; cursor: pointer; }
.secdot.on { background: var(--navy); color: #fff; border-color: var(--navy); transform: translateY(-1px); }
.secdot.done { background: var(--green-soft); color: var(--green); border-color: #BFDCCB; }
#stars { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--navy); font-size: 20px; padding: 6px 14px; border-radius: 999px;
  background: var(--amber-soft); cursor: pointer; user-select: none; }
#stars .star { font-size: 24px; display: inline-block; }
#stars.bump .star { animation: starpop .6s ease; }
@keyframes starpop { 0%{transform:scale(1)} 40%{transform:scale(1.7) rotate(-15deg)} 100%{transform:scale(1)} }
#progress { position: absolute; left: 0; top: 70px; height: 5px; background: var(--amber); z-index: 21; transition: width .5s cubic-bezier(.2,.8,.2,1); }

#screen { position: absolute; left: 0; right: 0; top: 75px; bottom: 86px; }
.scr { position: absolute; inset: 0; padding: 28px 48px; }
.scr.enter { animation: scrIn .55s cubic-bezier(.2,.8,.2,1) both; }
.scr.enter-back { animation: scrInBack .55s cubic-bezier(.2,.8,.2,1) both; }
.scr.leave { animation: scrOut .35s ease both; pointer-events: none; }
@keyframes scrIn { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: none; } }
@keyframes scrInBack { from { opacity: 0; transform: translateX(-60px); } to { opacity: 1; transform: none; } }
@keyframes scrOut { to { opacity: 0; transform: scale(.97); } }

/* ---------- bottom controls ---------- */
#controls { position: absolute; left: 0; right: 0; bottom: 0; height: 86px; display: flex; align-items: center; padding: 0 24px; gap: 10px;
  background: var(--navy); z-index: 20; }
.cbtn { height: 52px; min-width: 52px; padding: 0 16px; border-radius: 14px; border: 0; background: var(--navy-2); color: #fff; font-size: 17px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .15s, background .2s; }
.cbtn:hover { background: #3A5080; transform: translateY(-2px); }
.cbtn:active { transform: translateY(1px) scale(.97); }
.cbtn.on { background: var(--amber); }
.cbtn svg { width: 24px; height: 24px; }
#navmid { margin: 0 auto; display: flex; align-items: center; gap: 14px; }
#btnNext { background: var(--amber); min-width: 150px; font-size: 20px; height: 58px; border-radius: 16px; box-shadow: 0 6px 0 #B85F25; }
#btnNext:hover { background: #EA8A4B; }
#btnNext:active { box-shadow: 0 2px 0 #B85F25; transform: translateY(4px); }
#btnNext.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100%{ box-shadow: 0 6px 0 #B85F25, 0 0 0 0 rgba(224,123,58,.6);} 50%{ box-shadow: 0 6px 0 #B85F25, 0 0 0 14px rgba(224,123,58,0);} }
#counter { color: #C9D3E6; font-family: var(--mono); font-size: 16px; min-width: 80px; text-align: center; }
.kbd-hint { color: #8796B3; font-size: 12px; font-family: var(--mono); }

/* ---------- side panels: menu & teacher notes & timer ---------- */
.panel { position: absolute; z-index: 40; background: #fff; border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.25); padding: 22px 24px; display: none; }
.panel.open { display: block; animation: panelIn .3s cubic-bezier(.2,.8,.2,1); }
@keyframes panelIn { from { opacity: 0; transform: translateY(16px);} to { opacity: 1; transform: none; } }
#menu { left: 24px; bottom: 100px; width: 430px; max-height: 700px; overflow: auto; }
#menu h3, #notes h3, #timerPanel h3 { margin: 0 0 12px; font-family: var(--mono); font-size: 13px; letter-spacing: .14em; color: var(--amber); text-transform: uppercase; }
.menu-sec { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; cursor: pointer; font-size: 18px; color: var(--navy); font-weight: 600; }
.menu-sec:hover { background: var(--cream); }
.menu-sec .ic { font-size: 24px; width: 34px; text-align: center; }
.menu-sec .bn { font-size: 16px; color: var(--muted); margin-left: auto; }
/* chapter switcher */
#topbar .chap { cursor: pointer; border-radius: 10px; padding: 4px 8px; margin-left: -8px; }
#topbar .chap:hover { background: var(--cream); }
#topbar .chap .chap-caret { color: var(--muted); font-size: 16px; margin-left: 6px; letter-spacing: 0; }
a.menu-sec { text-decoration: none; }
.menu-chap .chap-txt { display: flex; flex-direction: column; line-height: 1.2; }
.menu-chap .chap-txt small { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--amber); font-weight: 500; }
.menu-chap .bn { white-space: nowrap; }
.menu-chap.here { background: var(--cream); box-shadow: inset 3px 0 0 var(--amber); cursor: default; }
#notes { left: 24px; bottom: 100px; width: 520px; border-top: 6px solid var(--amber); }
#notes .bn { font-size: 19px; color: var(--navy); }
#notes .keys { margin-top: 14px; font-size: 13px; color: var(--muted); font-family: var(--mono); line-height: 1.8; }
#timerPanel { right: 24px; bottom: 100px; width: 330px; text-align: center; }
#timerPanel .t { font-family: var(--mono); font-size: 64px; color: var(--navy); font-weight: 500; }
#timerPanel .row { display: flex; gap: 8px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.pill { border: 1px solid var(--line); background: var(--cream); border-radius: 999px; padding: 8px 14px; font-weight: 600; color: var(--navy); font-size: 15px; }
.pill:hover { background: var(--amber-soft); }
.pill.primary { background: var(--amber); color: #fff; border-color: var(--amber); }
#timerFloat { position: absolute; right: 24px; top: 88px; z-index: 30; background: var(--navy); color: #fff; font-family: var(--mono); font-size: 30px;
  padding: 8px 18px; border-radius: 14px; display: none; box-shadow: var(--shadow); }
#timerFloat.show { display: block; }
#timerFloat.low { background: var(--red); animation: pulseT 1s infinite; }
@keyframes pulseT { 50% { transform: scale(1.06);} }

/* ---------- common typography ---------- */
.eyebrow { font-family: var(--mono); font-size: 15px; letter-spacing: .16em; text-transform: uppercase; color: var(--amber); margin-bottom: 6px; }
.h1 { font-family: var(--display); font-weight: 700; font-size: 46px; color: var(--navy); margin: 0; line-height: 1.15; }
.h2 { font-family: var(--display); font-weight: 700; font-size: 36px; color: var(--navy); margin: 0; line-height: 1.2; }
.sub-bn { font-family: var(--bangla); font-size: 24px; color: var(--muted); margin-top: 4px; }
.card { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); }
.define { display: flex; gap: 16px; align-items: flex-start; background: #fff; border-left: 6px solid var(--amber); border-radius: 16px; padding: 16px 22px; box-shadow: var(--shadow); }
.define .en { font-size: 21px; color: var(--navy); font-weight: 600; }
.define .bn { font-size: 21px; color: var(--ink); margin-top: 2px; }
.define .ic { font-size: 30px; }
.bigbtn { border: 0; background: var(--amber); color: #fff; font-weight: 700; font-size: 22px; padding: 16px 30px; border-radius: 18px; box-shadow: 0 6px 0 #B85F25; transition: transform .12s; }
.bigbtn:active { transform: translateY(4px); box-shadow: 0 2px 0 #B85F25; }
.bigbtn.ghost { background: #fff; color: var(--navy); box-shadow: 0 6px 0 var(--line); border: 2px solid var(--line); }
.bigbtn.green { background: var(--green); box-shadow: 0 6px 0 #1E4A37; }
.btnrow { display: flex; gap: 14px; align-items: center; }

/* ---------- host character + speech bubble ---------- */
.host { position: absolute; bottom: -6px; z-index: 6; pointer-events: none; }
.host.left { left: 18px; } .host.right { right: 18px; }
.host img.body { height: 380px; display: block; animation: breathe 3.2s ease-in-out infinite; transform-origin: 50% 100%; filter: drop-shadow(0 12px 14px rgba(0,0,0,.18)); }
.host.enter img.body { animation: hostIn .8s cubic-bezier(.3,1.5,.5,1) both, breathe 3.2s ease-in-out .8s infinite; }
.host.jump img.body { animation: jump .7s cubic-bezier(.3,1.6,.5,1); }
.host.shake img.body { animation: shake .5s ease; }
@keyframes breathe { 0%,100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(-4px) scaleY(1.012); } }
@keyframes hostIn { from { transform: translateY(120%) rotate(-6deg); } to { transform: none; } }
@keyframes jump { 0%{transform:none} 35%{transform:translateY(-70px) rotate(-4deg)} 65%{transform:translateY(0) scaleY(.94)} 100%{transform:none} }
@keyframes shake { 20%{transform:rotate(-4deg)} 40%{transform:rotate(4deg)} 60%{transform:rotate(-3deg)} 80%{transform:rotate(2deg)} }
.bubble { position: absolute; bottom: 392px; width: 310px; background: #fff; border-radius: 22px; padding: 14px 18px 14px 82px; box-shadow: var(--shadow); pointer-events: auto;
  border: 2px solid var(--line); animation: bubbleIn .5s cubic-bezier(.3,1.5,.5,1) .35s both; }
.host.left .bubble { left: 0; } .host.right .bubble { right: 0; }
.bubble::after { content: ""; position: absolute; bottom: -14px; width: 26px; height: 26px; background: #fff; border-right: 2px solid var(--line); border-bottom: 2px solid var(--line); transform: rotate(45deg); }
.host.left .bubble::after { left: 90px; } .host.right .bubble::after { right: 90px; }
.bubble .face { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 62px; height: 62px; border-radius: 50%; background: var(--cream); border: 3px solid var(--amber-2); }
.bubble .en { font-size: 19px; font-weight: 600; color: var(--navy); line-height: 1.35; }
.bubble .bn { font-size: 18px; color: var(--ink); line-height: 1.6; }
@keyframes bubbleIn { from { opacity: 0; transform: scale(.6) translateY(20px);} to { opacity: 1; transform: none; } }

/* ---------- cover ---------- */
.cover { display: grid; grid-template-columns: 1fr 560px; gap: 30px; height: 100%; align-items: center; }
.cover .tag { display: inline-block; background: var(--amber); color: #fff; font-family: var(--mono); font-size: 14px; letter-spacing: .14em; padding: 8px 14px; border-radius: 10px; }
.cover .series { font-family: var(--mono); color: var(--muted); font-size: 15px; letter-spacing: .1em; margin: 14px 0 6px; text-transform: uppercase; }
.cover .title { font-family: var(--display); font-size: 70px; color: var(--navy); line-height: 1.05; margin: 6px 0 14px; }
.cover .title .num { display: block; font-size: 30px; color: var(--amber); font-family: var(--body); font-weight: 700; }
.cover .theme { font-size: 22px; color: var(--navy); }
.cover .theme .bn { color: var(--muted); font-size: 21px; }
.cover .secs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.cover .secs span { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-weight: 600; color: var(--navy); font-size: 16px;
  animation: popIn .5s cubic-bezier(.3,1.6,.5,1) both; }
.cover .art { position: relative; height: 680px; }
.cover .art .frame { position: absolute; inset: 30px 0 30px 40px; border-radius: 36px; overflow: hidden; box-shadow: var(--shadow); border: 8px solid #fff; }
.cover .art .frame img { width: 100%; height: 100%; object-fit: cover; animation: kenburns 22s ease-in-out infinite alternate; }
.cover .art .asha { position: absolute; left: -110px; bottom: 6px; height: 560px; animation: hostIn 1s cubic-bezier(.3,1.4,.5,1) .3s both; filter: drop-shadow(0 18px 20px rgba(0,0,0,.25)); z-index: 2; }
.cover .art .asha.idle { animation: breathe 3.2s ease-in-out infinite; }
.cover .art .q { position: absolute; font-family: var(--display); color: var(--amber); font-size: 60px; animation: floaty 4s ease-in-out infinite; z-index: 3; }
@keyframes floaty { 0%,100%{ transform: translateY(0) rotate(-8deg);} 50%{ transform: translateY(-18px) rotate(8deg);} }
@keyframes kenburns { from { transform: scale(1.02) translate(0,0);} to { transform: scale(1.14) translate(-2%, -2%);} }
@keyframes popIn { from { opacity: 0; transform: scale(.4);} to { opacity: 1; transform: none; } }

/* ---------- characters ---------- */
.chars { display: flex; gap: 34px; justify-content: center; align-items: flex-end; height: 600px; margin-top: 16px; }
.charcard { width: 400px; height: 590px; position: relative; border-radius: 30px; background: #fff; box-shadow: var(--shadow); cursor: pointer; transition: transform .25s;
  display: flex; flex-direction: column; align-items: center; padding: 18px; animation: popIn .6s cubic-bezier(.3,1.5,.5,1) both; overflow: hidden; }
.charcard:hover { transform: translateY(-10px) rotate(-1deg); }
.charcard .bg { position: absolute; left: 0; right: 0; bottom: 0; height: 58%; background: var(--amber-soft); border-radius: 50% 50% 0 0 / 22% 22% 0 0; }
.charcard img { height: 380px; position: relative; z-index: 1; transition: transform .3s; }
.charcard.talk img { animation: jump .7s cubic-bezier(.3,1.6,.5,1); }
.charcard .nm { position: relative; z-index: 1; font-family: var(--display); font-weight: 700; font-size: 32px; color: var(--navy); margin-top: 4px; }
.charcard .bio { position: relative; z-index: 1; text-align: center; font-size: 17px; color: var(--navy); }
.charcard .bio .bn { font-size: 17px; color: var(--muted); }
.charcard .tapme { position: absolute; top: 16px; right: 16px; background: var(--amber); color: #fff; border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 700; z-index: 2; animation: pulse 2s infinite; }
.mentor { width: 300px; height: 300px; align-self: center; border-radius: 30px; background: var(--navy); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px;
  animation: popIn .6s cubic-bezier(.3,1.5,.5,1) .3s both; }
.mentor .av { width: 110px; height: 110px; border-radius: 50%; background: var(--amber); display: grid; place-items: center; font-family: var(--display); font-size: 56px; margin-bottom: 12px; }
.mentor .nm { font-family: var(--display); font-size: 28px; }
.mentor .bn { color: #C9D3E6; font-size: 17px; }

/* ---------- concept (definition) ---------- */
.concept { display: grid; grid-template-columns: 1fr; gap: 22px; max-width: 1060px; margin-left: 400px; padding-top: 10px; }
.concept .big { font-family: var(--display); font-size: 84px; color: var(--navy); line-height: 1; }
.concept .steps4 { display: flex; gap: 10px; margin-bottom: 4px; }
.concept .steps4 span { padding: 6px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 14px; font-weight: 700; color: var(--muted); }
.concept .steps4 span.on { background: var(--amber); color: #fff; border-color: var(--amber); }
.concept ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.concept li { display: flex; gap: 16px; align-items: center; background: #fff; border-radius: 16px; padding: 14px 20px; box-shadow: var(--shadow); animation: slideUp .5s cubic-bezier(.2,.8,.2,1) both; }
.concept li .n { width: 44px; height: 44px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 20px; flex: none; }
.concept li .en { font-size: 22px; color: var(--navy); font-weight: 600; }
.concept li .bn { font-size: 19px; color: var(--muted); line-height: 1.5; }
@keyframes slideUp { from { opacity: 0; transform: translateY(24px);} to { opacity: 1; transform: none; } }

/* ---------- story ---------- */
.story { display: grid; grid-template-columns: 600px 1fr; gap: 30px; height: 100%; }
.story .scene { position: relative; border-radius: 30px; overflow: hidden; box-shadow: var(--shadow); border: 8px solid #fff; height: 100%; }
.story .scene img { width: 100%; height: 100%; object-fit: cover; animation: kenburns 26s ease-in-out infinite alternate; }
.story .scene .partlabel { position: absolute; top: 16px; left: 16px; background: rgba(27,43,75,.85); color: #fff; padding: 8px 14px; border-radius: 12px; font-family: var(--mono); font-size: 14px; letter-spacing: .1em; z-index: 3; }
.fx { position: absolute; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.fx i { position: absolute; top: -10%; display: block; }
.fx.rain i { width: 2px; height: 26px; background: linear-gradient(transparent, rgba(255,255,255,.85)); animation: rain linear infinite; }
@keyframes rain { to { transform: translate(-40px, 820px); } }
.fx.leaves i { width: 18px; height: 12px; background: #6FA35A; border-radius: 0 100% 0 100%; animation: leaf linear infinite; opacity: .85; }
@keyframes leaf { 0% { transform: translate(0,0) rotate(0);} 100% { transform: translate(-160px, 820px) rotate(720deg);} }
.fx.sun::before { content: ""; position: absolute; right: -120px; top: -120px; width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,226,150,.75), rgba(255,226,150,0) 70%); animation: sunpulse 5s ease-in-out infinite; }
@keyframes sunpulse { 50% { transform: scale(1.18); opacity: .7; } }
.story .reader { display: flex; flex-direction: column; min-height: 0; }
.story .head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.story .head .h2 { font-size: 32px; margin-right: auto; }
.tog { display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--line); background: #fff; color: var(--navy); font-weight: 700; font-size: 16px; padding: 10px 16px; border-radius: 14px; }
.tog.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.tog.play { background: var(--amber); color: #fff; border-color: var(--amber); font-size: 18px; padding: 12px 20px; }
.tog.play.playing { background: var(--red); border-color: var(--red); }
.textbox { flex: 1; overflow: auto; background: #fff; border-radius: 24px; padding: 22px 30px; box-shadow: var(--shadow); scroll-behavior: smooth; }
.para { position: relative; font-size: 25px; line-height: 1.75; color: var(--ink); margin: 0 0 14px; padding: 6px 10px 6px 52px; border-radius: 14px; transition: background .3s; }
.para.active { background: var(--amber-soft); }
.para .pp { position: absolute; left: 6px; top: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--cream); color: var(--navy); font-size: 14px; display: grid; place-items: center; }
.para .pp:hover { background: var(--amber); color: #fff; }
.para.active .pp { background: var(--amber); color: #fff; }
.w { border-radius: 6px; padding: 0 2px; transition: background .15s, color .15s; }
.textbox.tracking .txt { color: #A4ACB9; }
.textbox.tracking .w.said { color: var(--ink); }
.textbox.tracking .w.said { color: var(--ink); }
.w.now { background: var(--amber); color: #fff !important; box-shadow: 0 2px 0 #B85F25; }
.vw { color: var(--amber); font-weight: 700; border-bottom: 3px dotted var(--amber); cursor: pointer; }
.textbox.tracking .vw.said { color: var(--amber); }
.textbox.hidden .para .txt { filter: blur(9px); user-select: none; }
.textbox.hidden::after { content: "🎧 Listen only — text hidden"; position: sticky; bottom: 0; display: block; text-align: center; font-weight: 700; color: var(--navy); background: var(--amber-soft); border-radius: 12px; padding: 10px; }
.quote { margin-top: 12px; text-align: center; font-family: var(--display); font-size: 26px; color: var(--green); border: 3px dashed #9CC7AF; border-radius: 16px; padding: 10px; background: var(--green-soft); }
.speedbadge { font-family: var(--mono); font-size: 13px; color: var(--muted); }

/* word pop-up (vocab) */
.pop { position: absolute; z-index: 50; width: 420px; background: #fff; border-radius: 22px; box-shadow: 0 24px 60px rgba(0,0,0,.25); padding: 20px 22px; border-top: 8px solid var(--amber);
  animation: bubbleIn .35s cubic-bezier(.3,1.5,.5,1) both; }
.pop .w1 { font-family: var(--display); font-size: 40px; color: var(--navy); }
.pop .close { position: absolute; right: 12px; top: 10px; border: 0; background: none; font-size: 28px; color: var(--muted); }
.syls { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.syl { border: 0; padding: 8px 14px; border-radius: 12px; background: var(--sky-soft); color: var(--sky); font-weight: 700; font-size: 22px; font-family: var(--body); transition: transform .12s; }
.syl.stress { background: var(--amber); color: #fff; font-size: 24px; }
.syl.hit { animation: clap .35s ease; }
@keyframes clap { 50% { transform: scale(1.25) rotate(-4deg);} }
.pop .say { font-family: var(--bangla); font-size: 22px; color: var(--muted); }
.pop .mean { font-family: var(--bangla); font-size: 24px; color: var(--navy); margin-top: 6px; }

/* ---------- MCQ ---------- */
.mcq { display: grid; grid-template-columns: 1fr; max-width: 1040px; margin: 0 auto 0 400px; gap: 18px; padding-top: 6px; }
.mcq .q { font-family: var(--display); font-size: 40px; color: var(--navy); line-height: 1.2; }
.mcq .qbn { font-family: var(--bangla); font-size: 26px; color: var(--muted); }
.opts { display: grid; gap: 14px; margin-top: 8px; }
.opt { display: flex; align-items: center; gap: 18px; text-align: left; border: 3px solid var(--line); background: #fff; border-radius: 20px; padding: 16px 22px; font-size: 25px; font-weight: 600; color: var(--navy);
  box-shadow: 0 5px 0 var(--line); transition: transform .12s, border-color .2s; animation: slideUp .45s cubic-bezier(.2,.8,.2,1) both; }
.opt:hover { transform: translateY(-3px); border-color: var(--amber-2); }
.opt .k { width: 46px; height: 46px; border-radius: 12px; background: var(--cream); display: grid; place-items: center; font-family: var(--mono); font-size: 20px; flex: none; }
.opt.right { border-color: var(--green); background: var(--green-soft); box-shadow: 0 5px 0 #9CC7AF; }
.opt.right .k { background: var(--green); color: #fff; }
.opt.wrong { border-color: var(--red); background: var(--red-soft); animation: shake .5s ease; }
.opt.wrong .k { background: var(--red); color: #fff; }
.feedback { font-size: 22px; font-weight: 700; min-height: 34px; }
.feedback.good { color: var(--green); } .feedback.bad { color: var(--red); }

/* ---------- checking word wall ---------- */
.checking { display: grid; grid-template-columns: 1fr 400px; gap: 26px; height: 100%; }
.wall { display: flex; flex-wrap: wrap; gap: 12px; align-content: flex-start; margin-top: 16px; }
.wchip { border: 3px solid var(--line); background: #fff; color: var(--navy); font-size: 24px; font-weight: 600; padding: 10px 20px; border-radius: 16px; box-shadow: 0 4px 0 var(--line);
  animation: popIn .4s cubic-bezier(.3,1.6,.5,1) both; transition: transform .12s; }
.wchip:hover { transform: translateY(-3px); }
.wchip.flag { border-color: var(--amber); background: var(--amber-soft); }
.wchip.flag::after { content: " ?"; color: var(--amber); font-weight: 800; }
.qlist { background: var(--navy); color: #fff; border-radius: 26px; padding: 22px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.qlist h4 { margin: 0 0 10px; font-family: var(--mono); letter-spacing: .14em; font-size: 14px; color: var(--amber-2); }
/* two columns so all 18 words fit; scrolls only if a chapter has even more */
.qlist .qitems { flex: 1; min-height: 0; overflow-y: auto; margin-top: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-content: start; }
.qlist .qitems .empty { grid-column: 1 / -1; }
.qlist .item { background: rgba(255,255,255,.08); border-radius: 14px; padding: 8px 12px; cursor: pointer; animation: slideUp .3s both; min-width: 0; }
.qlist .item b { font-size: 20px; overflow-wrap: anywhere; } .qlist .item .bn { color: #FCE9DA; font-size: 18px; display: none; }
.qlist .item.open { grid-column: 1 / -1; background: rgba(255,255,255,.16); }   /* an opened word uses the full width for its meaning */
.qlist .item.open .bn { display: block; }
.qlist .empty { color: #8796B3; font-size: 17px; }

/* ---------- vocab grid ---------- */
.vgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-top: 16px; }
.vcard { position: relative; height: 170px; background: #fff; border-radius: 22px; box-shadow: var(--shadow); border: 0; padding: 14px; text-align: left; display: flex; flex-direction: column; justify-content: space-between;
  animation: popIn .5s cubic-bezier(.3,1.5,.5,1) both; transition: transform .18s; }
.vcard:hover { transform: translateY(-6px) rotate(-1deg); }
.vcard .n { font-family: var(--mono); color: var(--amber); font-size: 14px; }
.vcard .wd { font-family: var(--display); font-size: 30px; color: var(--navy); font-weight: 700; }
.vcard .sy { font-size: 18px; color: var(--sky); font-weight: 600; }
.vcard .sy b { color: var(--amber); }
.vcard.seen::after { content: "✓"; position: absolute; top: 12px; right: 14px; width: 30px; height: 30px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 800; }
.modal { position: absolute; inset: 0; background: rgba(15,26,46,.55); z-index: 45; display: grid; place-items: center; animation: fadeIn .25s both; }
@keyframes fadeIn { from { opacity: 0; } }
.wordbig { width: 1100px; background: #fff; border-radius: 34px; padding: 34px 40px; position: relative; animation: bubbleIn .45s cubic-bezier(.3,1.5,.5,1) both; display: grid; grid-template-columns: 1fr 360px; gap: 30px; }
.wordbig .w1 { font-family: var(--display); font-size: 76px; color: var(--navy); line-height: 1; }
.wordbig .syls .syl { font-size: 34px; padding: 12px 22px; border-radius: 16px; }
.wordbig .count { font-family: var(--mono); color: var(--muted); font-size: 16px; }
.wordbig .say { font-family: var(--bangla); font-size: 30px; color: var(--muted); }
.wordbig .mean { font-family: var(--bangla); font-size: 34px; color: var(--navy); background: var(--amber-soft); border-radius: 16px; padding: 10px 18px; margin: 10px 0; }
.wordbig .ex { font-size: 22px; color: var(--ink); line-height: 1.6; background: var(--cream); border-radius: 16px; padding: 14px 18px; }
.wordbig .ex mark { background: var(--amber); color: #fff; border-radius: 6px; padding: 0 4px; }
.wordbig .close { position: absolute; right: 18px; top: 14px; border: 0; background: var(--cream); width: 50px; height: 50px; border-radius: 50%; font-size: 26px; color: var(--navy); }
.wordbig .side { display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.wordbig .nav { display: flex; gap: 10px; justify-content: space-between; }

/* ---------- drag & drop (shared) ---------- */
.chip { display: inline-flex; align-items: center; justify-content: center; padding: 14px 22px; border-radius: 16px; background: #fff; border: 3px solid var(--navy); color: var(--navy);
  font-size: 24px; font-weight: 700; cursor: grab; user-select: none; touch-action: none; box-shadow: 0 5px 0 rgba(27,43,75,.25); transition: transform .15s, box-shadow .15s; }
.chip:hover { transform: translateY(-3px) rotate(-1deg); }
.chip.dragging { cursor: grabbing; position: fixed; z-index: 100; box-shadow: 0 22px 40px rgba(0,0,0,.25); transform: rotate(-3deg) scale(1.08); transition: none; pointer-events: none; }
.chip.placed { cursor: grab; }
.chip.ok { border-color: var(--green); background: var(--green-soft); color: var(--green); box-shadow: 0 5px 0 #9CC7AF; }
.chip.no { border-color: var(--red); background: var(--red-soft); animation: shake .45s; }
.tray { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; min-height: 90px; padding: 16px; border-radius: 22px; background: rgba(27,43,75,.05); border: 2px dashed #C9C2B6; }
.zone { border: 3px dashed #C9C2B6; border-radius: 20px; min-height: 110px; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; background: rgba(255,255,255,.7); transition: background .2s, border-color .2s, transform .2s; }
.zone.hover { border-color: var(--amber); background: var(--amber-soft); transform: scale(1.03); }
.zone .lbl { font-family: var(--mono); font-size: 15px; letter-spacing: .1em; font-weight: 500; text-transform: uppercase; }
.zone .lbl .bn { font-size: 17px; letter-spacing: 0; text-transform: none; color: var(--muted); margin-left: 6px; }
.zone .holder { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; min-height: 64px; align-items: center; }

.role-S { --c: var(--S); --cb: var(--S-bg); } .role-V { --c: var(--V); --cb: var(--V-bg); } .role-O { --c: var(--O); --cb: var(--O-bg); }
.role-X { --c: var(--X); --cb: var(--X-bg); } .role-T { --c: var(--T); --cb: var(--T-bg); } .role-P { --c: var(--P); --cb: var(--P-bg); }
.zone[class*="role-"] { border-color: var(--c); background: color-mix(in srgb, var(--cb) 70%, #fff); }
.zone[class*="role-"] .lbl { color: var(--c); }

/* slots layout */
.slotsWrap { display: flex; flex-direction: column; gap: 22px; max-width: 1180px; margin: 0 0 0 auto; padding-right: 10px; }
.slotsWrap .sentence { font-size: 30px; color: var(--navy); background: #fff; border-radius: 18px; padding: 14px 22px; box-shadow: var(--shadow); font-weight: 600; }
.slotsWrap .zones { display: grid; gap: 14px; }
/* match: words in two columns so five rows + tray fit above the controls */
.matchWrap { gap: 18px; }
.matchZones { grid-template-columns: 1fr 1fr; }
.matchZones .zone { flex-direction: row; justify-content: flex-start; align-items: center; min-height: 86px; padding: 10px 14px; gap: 14px; }
.matchZones .zone .mword { font-size: 24px; font-weight: 800; min-width: 190px; flex: none; }
.matchZones .zone .holder { flex: 1; justify-content: flex-start; min-height: 56px; }
.after { font-size: 28px; font-weight: 700; color: var(--green); background: var(--green-soft); border-radius: 16px; padding: 12px 18px; animation: popIn .5s both; }
.tipbox { font-family: var(--bangla); font-size: 21px; background: var(--amber-soft); color: var(--navy); border-radius: 16px; padding: 12px 18px; animation: slideUp .4s both; }

/* notice */
.notice { display: grid; grid-template-columns: 1fr 420px; gap: 26px; height: 100%; }
.sent { background: #fff; border-radius: 20px; padding: 18px 24px; box-shadow: var(--shadow); font-size: 30px; line-height: 1.9; margin-bottom: 14px; cursor: pointer; animation: slideUp .45s both; position: relative; }
.sent .ex { font-family: var(--mono); color: var(--amber); font-size: 13px; letter-spacing: .12em; position: absolute; top: 8px; right: 16px; }
.part { border-radius: 10px; padding: 2px 6px; transition: all .4s; position: relative; }
.part[data-r=""] { padding: 0; }
.sent.show .part[data-r]:not([data-r=""]) { background: var(--cb); color: var(--c); font-weight: 700; }
.sent.show .part[data-r]:not([data-r=""])::after { content: attr(data-l); position: absolute; left: 50%; bottom: -20px; transform: translateX(-50%); font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: var(--c); white-space: nowrap; }
.asklist { background: var(--navy); color: #fff; border-radius: 24px; padding: 22px 24px; }
.asklist h4 { font-family: var(--mono); color: var(--amber-2); letter-spacing: .14em; font-size: 14px; margin: 0 0 10px; }
.asklist .bn { font-size: 22px; display: block; margin-bottom: 6px; }
.legend { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.legend span { padding: 4px 12px; border-radius: 999px; font-weight: 700; font-size: 14px; background: var(--cb); color: var(--c); }

/* explain blocks */
.blocks { display: flex; align-items: center; gap: 18px; justify-content: center; margin: 26px 0; }
.blk { width: 300px; border-radius: 26px; padding: 20px; text-align: center; background: var(--cb); border: 4px solid var(--c); box-shadow: 0 8px 0 color-mix(in srgb, var(--c) 40%, transparent);
  animation: dropIn .7s cubic-bezier(.3,1.5,.5,1) both; }
.blk .l { font-family: var(--mono); font-size: 15px; letter-spacing: .12em; color: var(--c); }
.blk .q { font-family: var(--bangla); font-size: 19px; color: var(--muted); }
.blk .t { font-size: 40px; font-weight: 800; color: var(--c); }
.plus { font-size: 46px; color: var(--muted); font-weight: 800; animation: popIn .4s both; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-120px) rotate(-8deg);} to { opacity: 1; transform: none; } }
.explainbn { font-family: var(--bangla); font-size: 24px; line-height: 1.8; background: #fff; border-radius: 20px; padding: 18px 24px; box-shadow: var(--shadow); max-width: 1180px; margin-left: auto; }

/* compare */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 18px; max-width: 1180px; margin-left: auto; }
.cmp { background: #fff; border-radius: 26px; padding: 22px; box-shadow: var(--shadow); text-align: center; animation: slideUp .5s both; }
.cmp .tag { display: inline-block; font-family: var(--mono); font-size: 16px; padding: 6px 14px; border-radius: 10px; background: var(--navy); color: #fff; }
.cmp .row { display: flex; gap: 10px; justify-content: center; margin: 18px 0; flex-wrap: wrap; }
.cmp .row span { background: var(--cb); color: var(--c); border: 3px solid var(--c); border-radius: 14px; padding: 10px 16px; font-size: 30px; font-weight: 800; }
.cmp .row span.ghost { background: transparent; border-style: dashed; color: #C9C2B6; border-color: #C9C2B6; }
.cmp .bn { font-size: 22px; color: var(--navy); }

/* sort */
.sortWrap { display: grid; grid-template-rows: auto 1fr; gap: 18px; height: 100%; max-width: 1180px; margin-left: auto; }
.bins { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.bins .zone { min-height: 300px; justify-content: flex-start; }
.bins .zone .holder { flex-direction: column; }
.chip.sm { font-size: 20px; padding: 10px 16px; font-weight: 600; }

/* phonics */
.phon { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 22px; margin-top: 14px; }
.pcard { background: #fff; border-radius: 26px; padding: 20px; box-shadow: var(--shadow); text-align: center; animation: popIn .5s both; }
.letters { display: flex; justify-content: center; gap: 10px; margin: 6px 0 10px; }
.letter { width: 90px; height: 100px; border-radius: 18px; border: 0; font-size: 60px; font-weight: 800; color: var(--navy); background: var(--sky-soft); font-family: var(--body); transition: transform .3s; }
.letter.v { background: var(--amber); color: #fff; }
.letter.hit { animation: clap .35s; }
.letters.blend .letter { transform: translateX(var(--bx)); }
.ipa { display: flex; justify-content: center; gap: 10px; font-family: var(--mono); font-size: 22px; color: var(--muted); min-height: 30px; }
.ipa span { width: 90px; opacity: 0; transition: opacity .3s; } .ipa span.on { opacity: 1; }
.pcard .bnw { font-family: var(--bangla); font-size: 24px; color: var(--muted); }
.pcard .from { font-size: 18px; color: var(--navy); background: var(--cream); border-radius: 12px; padding: 8px; margin-top: 8px; }
.cvcbar { display: flex; gap: 14px; align-items: center; margin-top: 20px; }
.cvcbar .bn { font-size: 21px; background: var(--amber-soft); border-radius: 14px; padding: 10px 16px; flex: 1; }

.cvcRows { display: grid; gap: 12px; max-width: 1180px; margin-left: auto; }
.cvcRow { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; background: #fff; border-radius: 22px; padding: 8px 22px; box-shadow: var(--shadow); }
.cvcRow .clue { font-size: 28px; color: var(--navy); font-weight: 600; }
.cvcRow .cells { display: flex; gap: 10px; }
.cvcRow .zone { width: 90px; min-height: 90px; padding: 4px; gap: 4px; justify-content: center; }
.cvcRow .zone .lbl { font-size: 12px; }
.cvcRow .zone .holder { min-height: 68px; }
/* 68px tiles: up to 15 letters fit in one tray row, so the tray never wraps under the controls */
.lchip { width: 68px; height: 68px; padding: 0; font-size: 38px; }
.slotsWrap .tray:has(.lchip) { gap: 10px; }
.lchip.vow { background: var(--amber-soft); }

.findSent { font-size: 40px; line-height: 2.1; background: #fff; border-radius: 26px; padding: 26px 34px; box-shadow: var(--shadow); max-width: 1180px; margin: 20px 0 0 auto; }
.fw { border: 0; background: none; font-size: 40px; font-family: var(--body); color: var(--navy); font-weight: 600; padding: 2px 8px; border-radius: 12px; transition: background .2s; }
.fw:hover { background: var(--cream); }
.fw.ok { background: var(--green); color: #fff; animation: clap .4s; }
.fw.no { background: var(--red-soft); color: var(--red); animation: shake .45s; }

/* sequence */
.seqWrap { display: grid; gap: 18px; }
.seqSlots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.seqSlots .zone { height: 272px; justify-content: flex-start; }
.seqSlots .zone .num { width: 42px; height: 42px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 20px; }
.pcardDrag { width: 300px; padding: 8px; border-radius: 18px; flex-direction: column; gap: 6px; font-size: 16px; font-weight: 600; line-height: 1.3; text-align: center; }
/* crop from the bottom, never the top, so the characters' heads stay in view */
.pcardDrag img { width: 100%; height: 124px; object-fit: cover; object-position: center top; border-radius: 12px; pointer-events: none; }
.seqTray { min-height: 228px; }

/* retell */
.retell { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; max-width: 1180px; margin-left: auto; margin-top: 10px; }
.starter { background: #fff; border-radius: 18px; padding: 16px 22px; font-size: 28px; color: var(--navy); font-weight: 600; box-shadow: var(--shadow); margin-bottom: 14px; animation: slideUp .5s both; display: flex; gap: 14px; align-items: center; }
.starter .n { width: 44px; height: 44px; border-radius: 50%; background: var(--amber); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.wordbank { display: flex; flex-wrap: wrap; gap: 10px; }
.wordbank span { background: var(--amber-soft); color: var(--navy); border-radius: 999px; padding: 8px 16px; font-weight: 700; font-size: 20px; }
.bigtimer { font-family: var(--mono); font-size: 96px; color: var(--navy); text-align: center; }

/* finish */
.finish { text-align: center; padding-top: 30px; }
.finish .big { font-family: var(--display); font-size: 74px; color: var(--navy); }
.finish .quote { max-width: 900px; margin: 18px auto; font-size: 34px; }
.finish .kids { display: flex; justify-content: center; gap: 30px; margin-top: 90px; }
.finish .kids img { height: 320px; animation: jump 1.2s cubic-bezier(.3,1.6,.5,1) infinite; }
.finish .kids img:nth-child(2) { animation-delay: .3s; }

#confetti { position: absolute; inset: 0; pointer-events: none; z-index: 90; }
.toast { position: absolute; left: 50%; top: 110px; transform: translateX(-50%); background: var(--green); color: #fff; font-size: 26px; font-weight: 800; padding: 12px 26px; border-radius: 999px; z-index: 60;
  animation: toast 1.6s ease both; box-shadow: var(--shadow); }
.toast.bad { background: var(--red); }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -20px) scale(.8);} 15% { opacity: 1; transform: translate(-50%,0) scale(1.05);} 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -10px);} }
.checkrow { display: flex; gap: 14px; justify-content: flex-end; align-items: center; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; } }
