/* =========================================================================
   THE LION KING: MUFASA — THE PURSUIT OF EXCELLENCE
   Styles. The stage is a fixed 1920x1080 canvas scaled to fit (16:9).
   ========================================================================= */
:root {
  --gold: #ffc928; --gold-d: #e09a00; --orange: #f57c1f; --orange-d: #c85a0c;
  --green: #4f9d26; --green-d: #2f6e14; --sky: #2f9be0; --sky-l: #bfe8fb;
  --brown: #5b3416; --cream: #fff8e6; --ink: #2b1a0c; --red: #e0453a;
  --radius: 28px;
  --font: "Segoe UI", "Trebuchet MS", Verdana, Arial, sans-serif;
  --font-title: "Arial Black", "Segoe UI Black", "Segoe UI", Impact, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1d0f05; font-family: var(--font); color: var(--ink); user-select: none; -webkit-user-select: none; touch-action: manipulation; }
button { font-family: inherit; cursor: pointer; touch-action: manipulation; }
textarea, input, select { font-family: inherit; user-select: text; -webkit-user-select: text; }
.hidden { display: none !important; }
.center { text-align: center; justify-content: center; }

/* ---------- World background ---------- */
#world { position: fixed; inset: 0; overflow: hidden; z-index: 0; }
#world-art, #world-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sun-rays { animation: spin 90s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.grass .blade { transform-box: fill-box; transform-origin: bottom center; animation: sway 3.2s ease-in-out infinite alternate; }
@keyframes sway { from { transform: rotate(-4deg); } to { transform: rotate(5deg); } }
.cloud { position: absolute; background: #fff; border-radius: 100px; opacity: .92; filter: drop-shadow(0 8px 10px rgba(0,0,0,.08)); animation: drift linear infinite; }
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 55%; height: 170%; left: 12%; top: -85%; }
.cloud::after { width: 40%; height: 130%; right: 12%; top: -55%; }
.c1 { width: 240px; height: 60px; top: 9%; animation-duration: 75s; animation-delay: -10s; }
.c2 { width: 170px; height: 44px; top: 20%; animation-duration: 95s; animation-delay: -50s; opacity: .8; }
.c3 { width: 300px; height: 70px; top: 4%; animation-duration: 120s; animation-delay: -80s; opacity: .7; }
.c4 { width: 140px; height: 38px; top: 30%; animation-duration: 85s; animation-delay: -30s; opacity: .75; }
@keyframes drift { from { transform: translateX(-30vw); } to { transform: translateX(130vw); } }
#fireflies .ff { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #fff7a0; box-shadow: 0 0 14px 6px rgba(255,236,120,.75); animation: float 7s ease-in-out infinite alternate, twinkle 2.4s ease-in-out infinite alternate; }
@keyframes float { 0% { transform: translate(0,0); } 50% { transform: translate(40px,-50px); } 100% { transform: translate(-30px,-100px); } }
@keyframes twinkle { from { opacity: .2; } to { opacity: 1; } }
#footprints .paw { position: absolute; width: 46px; height: 46px; opacity: 0; animation: pawfade 12s linear infinite; }
@keyframes pawfade { 0% { opacity: 0; } 5% { opacity: .9; } 40% { opacity: .5; } 60%, 100% { opacity: 0; } }

/* ---------- Stage ---------- */
#stage { position: absolute; left: 50%; top: 50%; width: 1920px; height: 1080px; transform-origin: 0 0; z-index: 1; }
#hud { position: absolute; left: 0; right: 0; top: 0; height: 112px; display: flex; align-items: center; justify-content: space-between; padding: 0 26px; gap: 20px;
  background: linear-gradient(180deg, rgba(60,30,8,.88), rgba(60,30,8,.6)); border-bottom: 4px solid rgba(255,201,40,.7); color: #fff; z-index: 5; }
.on-start #hud, .on-start #footer { display: none; }
.hud-left { display: flex; align-items: center; gap: 14px; min-width: 430px; }
.hud-logo { font-size: 58px; filter: drop-shadow(0 3px 0 rgba(0,0,0,.3)); animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.hud-title { font-family: var(--font-title); font-size: 30px; color: var(--gold); text-shadow: 0 3px 0 #7a3e00; line-height: 1.1; }
.hud-sub { font-size: 20px; opacity: .9; }
.hud-center { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
#mission-map { display: flex; gap: 8px; }
.mm-step { width: 52px; height: 52px; border-radius: 50%; border: 3px solid rgba(255,255,255,.5); background: rgba(255,255,255,.12); font-size: 26px; display: grid; place-items: center; color: #fff; padding: 0; transition: .3s; }
.mm-step.done { background: var(--green); border-color: #b9f08a; }
.mm-step.current { background: var(--gold); border-color: #fff; transform: scale(1.18); box-shadow: 0 0 18px var(--gold); }
.lesson-bar { position: relative; width: 640px; height: 22px; border-radius: 12px; background: rgba(255,255,255,.2); overflow: hidden; border: 2px solid rgba(255,255,255,.4); }
#lesson-bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--gold), var(--orange)); transition: width 1s linear; }
#lesson-bar-text { position: absolute; inset: 0; text-align: center; font-size: 15px; font-weight: 700; line-height: 18px; text-shadow: 0 1px 2px #000; }
.hud-right { display: flex; align-items: center; gap: 12px; }
.hud-btn { min-width: 72px; height: 72px; border-radius: 20px; border: 3px solid rgba(255,255,255,.55); background: rgba(255,255,255,.14); color: #fff; font-size: 34px; display: grid; place-items: center; transition: transform .15s, background .2s; }
.hud-btn:active { transform: scale(.92); }
.hud-btn.off { opacity: .5; text-decoration: line-through; background: rgba(0,0,0,.25); }
.teacher-btn { background: rgba(255,201,40,.25); }
.activity-timer { font-size: 30px; font-weight: 800; background: rgba(0,0,0,.25); padding: 10px 18px; border-radius: 18px; min-width: 150px; text-align: center; }
.activity-timer.over { color: #ffd0c8; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.mini-puzzle-btn { display: flex; gap: 8px; padding: 0 12px; width: auto; }
.mini-puzzle-btn b { font-size: 22px; }
#mini-puzzle { display: grid; grid-template-columns: repeat(2, 18px); gap: 3px; }
#mini-puzzle i { width: 18px; height: 14px; border-radius: 4px; background: rgba(255,255,255,.25); display: block; }
#mini-puzzle i.on { background: var(--gold); box-shadow: 0 0 8px var(--gold); }

#screens { position: absolute; left: 0; right: 0; top: 104px; bottom: 72px; }
.on-start #screens { top: 0; bottom: 0; }
.screen { position: absolute; inset: 0; padding: 18px 54px 20px; display: none; overflow-y: auto; }
.screen.active { display: block; animation: screenIn .6s cubic-bezier(.2,.8,.2,1); }
@keyframes screenIn { from { opacity: 0; transform: translateY(30px) scale(.98); } to { opacity: 1; transform: none; } }

#footer { position: absolute; left: 0; right: 0; bottom: 0; height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 26px; gap: 14px;
  background: linear-gradient(0deg, rgba(40,70,10,.88), rgba(40,70,10,.45)); border-top: 3px solid rgba(255,201,40,.55); z-index: 5; pointer-events: none; }
.nav-btn { pointer-events: auto; width: 108px; height: 54px; border-radius: 28px; border: 3px solid #fff; background: linear-gradient(180deg, #ffd85a, var(--orange)); color: #fff; font-size: 30px; font-weight: 900; text-shadow: 0 2px 0 var(--orange-d); box-shadow: 0 4px 0 var(--orange-d); display: grid; place-items: center; padding: 0; }
.nav-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--orange-d); }
.nav-btn:disabled { opacity: .35; }
.nav-btn.next.ready { animation: glow 1.6s ease-in-out infinite; }
.scoreboard { flex: 1; display: flex; justify-content: center; align-items: center; gap: 10px; pointer-events: none; }
.team-chip { pointer-events: auto; display: flex; align-items: center; gap: 8px; min-width: 162px; height: 50px; padding: 0 12px; border-radius: 15px; border: 3px solid rgba(255,255,255,.65); background: rgba(255,255,255,.94); font-size: 17px; font-weight: 900; color: var(--ink); position: relative; transition: transform .2s; box-shadow: 0 3px 8px rgba(0,0,0,.22); }
.team-chip .te { font-size: 26px; line-height: 1; }
.team-chip .tn { font-size: 15px; letter-spacing: .5px; }
.team-chip .tp { margin-left: auto; font-size: 24px; color: var(--orange-d); min-width: 32px; text-align: right; }
.team-chip .tstars { position: absolute; left: 44px; bottom: 2px; font-size: 10px; color: var(--gold-d); letter-spacing: -1px; white-space: nowrap; max-width: 85px; overflow: hidden; }
.team-chip.active { border-color: var(--gold); box-shadow: 0 0 0 3px var(--orange), 0 0 16px var(--gold); transform: translateY(-3px); }
.team-chip.bump { animation: bump .6s ease; }
@keyframes bump { 30% { transform: scale(1.12) rotate(-2deg); } 60% { transform: scale(.97); } }
.float-pts { position: absolute; top: -8px; right: 12px; font-size: 28px; font-weight: 900; color: var(--green-d); animation: floatUp 1.2s ease-out forwards; pointer-events: none; text-shadow: 0 2px 0 #fff; }
.float-pts.neg { color: var(--red); }
@keyframes floatUp { to { transform: translateY(-60px); opacity: 0; } }

/* ---------- Generic buttons & cards ---------- */
.big-btn { font-family: var(--font-title); font-size: 46px; padding: 26px 60px; border-radius: 60px; border: 6px solid #fff; color: #fff; background: linear-gradient(180deg, #ffd85a, var(--orange) 60%, var(--orange-d)); text-shadow: 0 4px 0 #9a4300; box-shadow: 0 10px 0 #8a3c00, 0 18px 30px rgba(0,0,0,.3); transition: transform .12s; }
.big-btn:active { transform: translateY(6px); box-shadow: 0 4px 0 #8a3c00; }
.big-btn:disabled { filter: grayscale(.7); opacity: .6; }
.glow { animation: glow 2s ease-in-out infinite; }
@keyframes glow { 0%,100% { filter: drop-shadow(0 0 0 rgba(255,220,80,0)); } 50% { filter: drop-shadow(0 0 22px rgba(255,220,80,.95)); } }
.mid-btn { font-size: 28px; font-weight: 800; padding: 18px 32px; min-height: 76px; border-radius: 40px; border: 4px solid #fff; color: var(--ink); background: linear-gradient(180deg, #ffffff, #e8f6ff); box-shadow: 0 6px 0 #8fb7cf; transition: transform .12s; }
.mid-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #8fb7cf; }
.mid-btn.gold { background: linear-gradient(180deg, #ffe680, var(--gold)); box-shadow: 0 6px 0 var(--gold-d); }
.mid-btn:disabled { opacity: .45; }
.row-btns { display: flex; gap: 20px; margin-top: 20px; flex-wrap: wrap; }
.row-btns.center { justify-content: center; }
.screen-heading { font-family: var(--font-title); font-size: 56px; margin: 0 0 8px; color: #fff; text-shadow: 0 5px 0 var(--orange-d), 0 8px 16px rgba(0,0,0,.35); }
.instruction { font-size: 32px; font-weight: 700; margin: 0 0 20px; color: #fff; background: rgba(60,30,8,.55); display: inline-block; padding: 10px 24px; border-radius: 20px; }
.score-chip { font-size: 30px; font-weight: 800; background: rgba(255,255,255,.95); padding: 14px 26px; border-radius: 30px; border: 4px solid var(--gold); }
.frame { background: var(--cream); border: 8px solid #fff; border-radius: var(--radius); box-shadow: 0 16px 40px rgba(0,0,0,.3); }
.tool-btn { font-size: 24px; font-weight: 800; padding: 14px 20px; min-height: 68px; border-radius: 18px; border: 3px solid #fff; background: rgba(255,255,255,.88); color: var(--ink); box-shadow: 0 4px 0 rgba(0,0,0,.2); }
.tool-btn.on { background: var(--gold); }
.tool-btn.sm { font-size: 20px; padding: 10px 14px; min-height: 56px; }
.tool-btn:active { transform: translateY(3px); }
.pill-toggle { font-size: 26px; font-weight: 800; padding: 14px 26px; border-radius: 40px; border: 4px solid #fff; background: rgba(0,0,0,.35); color: #fff; }
.pill-toggle.on { background: var(--green); }
.small-link { background: none; border: none; color: #fff; font-size: 26px; text-decoration: underline; margin-top: 10px; }

/* ---------- Start screen ---------- */
.start-wrap { position: absolute; inset: 0; display: flex; align-items: center; }
.start-art { position: relative; width: 52%; height: 100%; }
.pride-rock-holder { position: absolute; left: -40px; bottom: 60px; width: 980px; animation: rise 1.4s cubic-bezier(.2,.8,.2,1) both; }
.pride-rock-holder svg { width: 100%; display: block; filter: drop-shadow(0 20px 30px rgba(0,0,0,.35)); }
@keyframes rise { from { transform: translateY(300px); opacity: 0; } to { transform: none; opacity: 1; } }
.start-lion { position: absolute; left: 420px; top: 170px; width: 430px; animation: lionIn 1.6s .6s cubic-bezier(.2,.9,.3,1.2) both, bob 4s 2.4s ease-in-out infinite; filter: drop-shadow(0 18px 20px rgba(0,0,0,.35)); }
.start-cub { position: absolute; left: 270px; top: 430px; width: 170px; animation: lionIn 1.2s 1.4s cubic-bezier(.2,.9,.3,1.3) both, bob 2.6s 2.8s ease-in-out infinite; filter: drop-shadow(0 10px 12px rgba(0,0,0,.35)); }
@keyframes lionIn { from { transform: translateY(120px) scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }
.lion-svg { width: 100%; height: auto; display: block; }
.lion-eyes { animation: blink 5s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
.start-panel { width: 48%; padding: 0 80px 0 10px; text-align: center; color: #fff; animation: screenIn 1s .3s both; }
.start-kicker { display: inline-block; font-size: 28px; font-weight: 800; background: var(--green); padding: 8px 26px; border-radius: 30px; border: 3px solid #fff; }
.title-main { font-family: var(--font-title); font-size: 92px; line-height: 1; margin: 18px 0 6px; color: var(--gold); text-shadow: 0 6px 0 #a24f00, 0 10px 0 #5b2b00, 0 18px 30px rgba(0,0,0,.5); letter-spacing: 1px; }
.title-main span { font-size: 130px; color: #fff3b0; }
.title-sub { font-family: var(--font-title); font-size: 38px; margin: 0 0 18px; color: #fff; text-shadow: 0 4px 0 var(--orange-d), 0 6px 12px rgba(0,0,0,.4); }
.start-mission { font-size: 32px; font-weight: 700; line-height: 1.35; background: rgba(60,30,8,.6); padding: 18px 28px; border-radius: 24px; margin: 0 0 18px; }
.start-pieces { display: flex; justify-content: center; gap: 12px; margin-bottom: 16px; }
.start-pieces span { font-size: 46px; animation: bob 2s ease-in-out infinite; }
.start-plan { margin: 0 auto 26px; width: 92%; }
.plan-bar { display: flex; height: 46px; border-radius: 24px; overflow: hidden; border: 4px solid #fff; box-shadow: 0 6px 14px rgba(0,0,0,.3); }
.plan-bar div { display: grid; place-items: center; font-size: 22px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.5); border-right: 2px solid rgba(255,255,255,.6); }
.plan-label { font-size: 22px; font-weight: 700; margin-top: 6px; }
.start-settings { display: flex; justify-content: center; gap: 16px; margin-top: 26px; }

/* ---------- Layout helpers ---------- */
.two-col { display: flex; gap: 50px; height: 100%; align-items: center; }
.col-left { width: 44%; display: flex; flex-direction: column; align-items: center; }
.col-right { flex: 1; }

/* ---------- Lesson 1: Mystery ---------- */
.mystery-frame { position: relative; width: 640px; height: 640px; overflow: hidden; background: radial-gradient(circle at 50% 40%, #fff4c0, #ffcf6b); }
.mystery-portrait { position: absolute; inset: 20px; }
.mystery-tiles { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); }
.tile { border: 3px solid rgba(255,255,255,.7); background: linear-gradient(135deg, #2f9be0, #1b6fb0); color: #fff; font-size: 54px; font-weight: 900; display: grid; place-items: center; transition: transform .5s, opacity .5s; text-shadow: 0 3px 0 rgba(0,0,0,.25); padding: 0; }
.tile:nth-child(odd) { background: linear-gradient(135deg, #43b02a, #2a7a16); }
.tile:nth-child(4n+1):nth-child(even), .tile:nth-child(3n) { background: linear-gradient(135deg, #f39c12, #c9670a); }
.tile.gone { transform: rotateY(90deg) scale(.4); opacity: 0; pointer-events: none; }
.mystery-name { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); font-family: var(--font-title); font-size: 54px; color: #fff; background: linear-gradient(180deg, var(--gold), var(--orange)); padding: 10px 40px; border-radius: 30px; border: 5px solid #fff; text-align: center; white-space: nowrap; text-shadow: 0 3px 0 var(--orange-d); animation: popIn .8s cubic-bezier(.2,.9,.3,1.4); }
.mystery-name small { display: block; font-family: var(--font); font-size: 24px; font-weight: 800; }
@keyframes popIn { from { transform: translateX(-50%) scale(0); } to { transform: translateX(-50%) scale(1); } }
.q-stack { display: flex; flex-direction: column; gap: 18px; }
.q-card { background: #fff; border-radius: 24px; padding: 20px 26px; border-left: 14px solid var(--orange); box-shadow: 0 8px 20px rgba(0,0,0,.2); animation: slideIn .6s both; }
.q-card:nth-child(2) { animation-delay: .15s; border-left-color: var(--sky); }
.q-card:nth-child(3) { animation-delay: .3s; border-left-color: var(--green); }
@keyframes slideIn { from { transform: translateX(80px); opacity: 0; } to { transform: none; opacity: 1; } }
.q-card .q { font-size: 38px; font-weight: 900; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.q-card .a { font-size: 30px; margin-top: 12px; padding: 14px 18px; background: #fff6d6; border-radius: 16px; animation: screenIn .5s; }
.reveal-btn { font-size: 22px; font-weight: 800; padding: 12px 20px; border-radius: 20px; border: 3px solid var(--gold-d); background: #fff3c4; white-space: nowrap; min-height: 60px; }
.mission-intro { margin-top: 20px; }
.simba-says { display: flex; gap: 20px; align-items: center; background: #fff; border-radius: 26px; padding: 18px 24px; border: 5px solid var(--gold); font-size: 30px; animation: popUp .7s cubic-bezier(.2,.9,.3,1.3); }
.simba-says p { margin: 0; }
.simba-face { width: 120px; flex: none; }
@keyframes popUp { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Lesson 2: Vocabulary ---------- */
.tabbar { display: flex; gap: 16px; justify-content: center; margin-bottom: 22px; }
.tab { font-size: 32px; font-weight: 900; padding: 14px 40px; border-radius: 40px; border: 4px solid #fff; background: rgba(255,255,255,.6); color: var(--ink); min-height: 76px; }
.tab.active { background: var(--gold); box-shadow: 0 0 20px rgba(255,201,40,.8); }
.vocab-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px 34px; height: calc(100% - 100px); }
.vcard { perspective: 1400px; animation: cardIn .7s both; }
@keyframes cardIn { from { transform: translateY(80px) scale(.6); opacity: 0; } 70% { transform: translateY(-10px) scale(1.04); } to { transform: none; opacity: 1; } }
.vcard-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.2,.8,.2,1); }
.vcard.flipped .vcard-inner { transform: rotateY(180deg); }
.vface { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 28px; border: 6px solid #fff; box-shadow: 0 12px 26px rgba(0,0,0,.28); overflow: hidden; }
.vfront { display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; cursor: pointer; }
.vfront .vart { font-size: 92px; line-height: 1; animation: bounce 2.4s ease-in-out infinite; }
.vfront .vword { font-family: var(--font-title); font-size: 52px; letter-spacing: 2px; text-shadow: 0 4px 0 rgba(0,0,0,.25); margin-top: 6px; }
.vfront .vtap { font-size: 20px; font-weight: 800; opacity: .9; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px) rotate(-3deg); } }
.vback { transform: rotateY(180deg); background: #fff; padding: 16px 22px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.vback .vbword { font-family: var(--font-title); font-size: 34px; }
.vback .vmean { font-size: 25px; font-weight: 800; line-height: 1.25; }
.vback .vex { font-size: 22px; font-style: italic; background: #f3f9ff; padding: 6px 12px; border-radius: 12px; }
.vback .vact { font-size: 21px; font-weight: 700; background: #fff3c4; padding: 6px 12px; border-radius: 12px; }
.speak-btn { position: absolute; top: 12px; right: 12px; width: 64px; height: 64px; border-radius: 50%; border: 3px solid #fff; background: rgba(255,255,255,.3); font-size: 30px; z-index: 2; }
.vback .speak-btn { background: #e8f6ff; border-color: var(--sky); }
.vocab-game { height: calc(100% - 100px); }
.game-top { display: flex; gap: 20px; justify-content: center; align-items: center; margin-bottom: 20px; }
.vg-body { display: flex; gap: 40px; align-items: stretch; justify-content: center; }
.vg-pic { width: 560px; background: #fff; border-radius: 30px; border: 6px solid var(--gold); padding: 24px; text-align: center; box-shadow: 0 12px 26px rgba(0,0,0,.25); animation: popUp .5s; }
.vg-pic .pic { font-size: 120px; line-height: 1.2; }
.vg-pic .txt { font-size: 34px; font-weight: 800; line-height: 1.3; }
.vg-opts { display: flex; flex-direction: column; gap: 22px; width: 560px; }
.vg-feedback { font-size: 30px; font-weight: 800; color: #fff; background: rgba(60,30,8,.6); border-radius: 20px; padding: 12px 20px; min-height: 64px; }
.vg-done { text-align: center; background: #fff; border-radius: 30px; padding: 40px 60px; border: 6px solid var(--gold); animation: popUp .6s; }
.vg-done h3 { font-family: var(--font-title); font-size: 56px; margin: 0 0 10px; color: var(--orange-d); }
.vg-done p { font-size: 34px; font-weight: 700; }

/* answer buttons (shared by vocab game and quiz) */
.ans-btn { position: relative; font-size: 40px; font-weight: 900; min-height: 120px; padding: 18px 30px 18px 110px; text-align: left; border-radius: 30px; border: 6px solid #fff; color: var(--ink); background: linear-gradient(180deg, #ffffff, #fff3d0); box-shadow: 0 8px 0 #d39a2c, 0 14px 24px rgba(0,0,0,.2); transition: transform .12s, background .3s; }
.ans-btn .letter { position: absolute; left: 22px; top: 50%; transform: translateY(-50%); width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center; font-size: 36px; color: #fff; background: var(--sky); }
.ans-btn:nth-child(2) .letter { background: var(--green); }
.ans-btn:nth-child(3) .letter { background: var(--orange); }
.ans-btn:active { transform: translateY(5px); box-shadow: 0 3px 0 #d39a2c; }
.ans-btn.correct { background: linear-gradient(180deg, #b8f59a, #5cc33a); border-color: #fff; animation: correctPop .6s; }
.ans-btn.correct::after { content: "✔"; position: absolute; right: 26px; top: 50%; transform: translateY(-50%); font-size: 54px; color: #fff; text-shadow: 0 3px 0 var(--green-d); }
.ans-btn.wrong { background: linear-gradient(180deg, #ffd6cf, #ff9c8c); animation: shake .5s; opacity: .8; }
.ans-btn.wrong::after { content: "✖"; position: absolute; right: 26px; top: 50%; transform: translateY(-50%); font-size: 46px; color: #fff; }
.ans-btn:disabled { cursor: default; }
@keyframes correctPop { 40% { transform: scale(1.06); } }
@keyframes shake { 20%, 60% { transform: translateX(-12px); } 40%, 80% { transform: translateX(12px); } }

/* ---------- Lesson 3: Reading ---------- */
.read-layout { display: flex; gap: 34px; height: 100%; }
.read-main { flex: 1; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.read-toolbar { display: flex; gap: 12px; flex-wrap: wrap; }
.passage-card { flex: 1; background: var(--cream); border-radius: 30px; border: 8px solid #fff; box-shadow: 0 14px 30px rgba(0,0,0,.28); padding: 22px 40px; display: flex; flex-direction: column; overflow: hidden; background-image: linear-gradient(transparent 0, transparent); }
.passage-head { display: flex; justify-content: space-between; align-items: center; font-size: 26px; font-weight: 900; color: var(--orange-d); }
.part-dots { display: flex; gap: 10px; }
.part-dots i { width: 22px; height: 22px; border-radius: 50%; background: #e5d3a8; display: block; }
.part-dots i.on { background: var(--orange); }
.passage { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 20px; font-family: Verdana, "Segoe UI", sans-serif; font-size: 52px; line-height: 1.5; color: #24160a; }
.passage.full { font-size: 34px; gap: 10px; justify-content: flex-start; line-height: 1.55; }
.passage.full .part-block { margin: 0; }
.sentence { padding: 2px 6px; border-radius: 12px; transition: background .3s, opacity .4s; }
.sentence.hidden-s { opacity: 0; }
.sentence.reveal { animation: fadeUp .6s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; } }
.sentence.speaking { background: #fff1a8; box-shadow: 0 0 0 4px #ffe066; }
.word.now { background: #ffb547; border-radius: 8px; }
.passage.hl .kw { color: #b8360b; font-weight: 900; text-decoration: underline wavy #f5a623 3px; text-underline-offset: 8px; }
.read-nav { display: flex; justify-content: space-between; }
.read-side { width: 560px; display: flex; flex-direction: column; gap: 20px; }
.prompt-card { background: #fff; border-radius: 26px; padding: 20px 24px; border: 5px solid var(--sky); font-size: 28px; font-weight: 700; line-height: 1.35; animation: popUp .5s; }
.prompt-card h4 { margin: 0 0 8px; font-size: 32px; color: var(--sky); }
.prompt-card ol { margin: 6px 0 0 0; padding-left: 34px; }
.question-card { background: #fff; border-radius: 26px; padding: 22px 26px; border: 5px solid var(--gold); box-shadow: 0 10px 22px rgba(0,0,0,.22); }
.question-card .qlabel { font-size: 24px; font-weight: 900; color: var(--orange-d); }
.question-card .qtext { font-size: 36px; font-weight: 900; margin: 6px 0 14px; line-height: 1.25; }
.question-card .qans { font-size: 30px; background: #eaffdf; border-radius: 16px; padding: 14px 18px; margin-top: 12px; animation: screenIn .5s; }

/* ---------- Lesson 4: Quiz ---------- */
.quiz-top { display: flex; align-items: center; gap: 22px; justify-content: center; margin-bottom: 18px; }
.quiz-progress { display: flex; gap: 10px; }
.quiz-progress button { width: 54px; height: 54px; border-radius: 50%; border: 4px solid #fff; background: rgba(255,255,255,.45); font-size: 24px; font-weight: 900; color: var(--ink); padding: 0; }
.quiz-progress button.current { background: var(--gold); transform: scale(1.15); }
.quiz-progress button.right { background: #6fd14a; color: #fff; }
.quiz-progress button.missed { background: #ff9c8c; color: #fff; }
.turn-chip { border-color: var(--orange); }
.quiz-card { margin: 0 auto; width: 1500px; background: rgba(255,255,255,.95); border-radius: 36px; border: 8px solid #fff; box-shadow: 0 16px 34px rgba(0,0,0,.3); padding: 24px 50px 22px; }
.quiz-qnum { font-size: 26px; font-weight: 900; color: var(--orange-d); }
.quiz-question { font-size: 56px; font-weight: 900; margin: 4px 0 20px; line-height: 1.2; }
.quiz-answers { display: grid; grid-template-columns: 1fr; gap: 18px; }
.quiz-feedback { min-height: 70px; margin-top: 16px; font-size: 32px; font-weight: 800; border-radius: 20px; padding: 12px 20px; }
.quiz-feedback.good { background: #e3ffd6; color: #1d6b0a; }
.quiz-feedback.try { background: #fff1e6; color: #a2460e; }
.quiz-feedback.show { background: #e8f4ff; color: #174d7a; }
.quiz-nav { display: flex; justify-content: center; gap: 30px; margin-top: 18px; }
.quiz-unlock-hint { position: absolute; right: 60px; bottom: 30px; font-size: 22px; font-weight: 800; color: #fff; background: rgba(60,30,8,.6); padding: 10px 18px; border-radius: 16px; }

/* ---------- Lesson 5: Circle of Wisdom ---------- */
.scenario-cards { display: flex; gap: 40px; justify-content: center; margin: 20px 0 30px; }
.scard { width: 500px; min-height: 420px; border-radius: 34px; border: 8px solid #fff; color: #fff; padding: 26px; text-align: center; box-shadow: 0 16px 30px rgba(0,0,0,.3); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; animation: cardIn .7s both; position: relative; }
.scard:active { transform: scale(.97); }
.scard .sl { font-family: var(--font-title); font-size: 80px; line-height: 1; text-shadow: 0 5px 0 rgba(0,0,0,.25); }
.scard .si { font-size: 70px; }
.scard .st { font-size: 32px; font-weight: 800; line-height: 1.3; }
.scard .sdone { position: absolute; top: 14px; right: 18px; font-size: 26px; background: #fff; color: var(--green-d); border-radius: 20px; padding: 4px 14px; font-weight: 900; }
.discuss-banner { text-align: center; font-family: var(--font-title); font-size: 50px; color: #fff; background: linear-gradient(90deg, var(--green), var(--sky)); border-radius: 30px; padding: 10px; border: 5px solid #fff; margin-bottom: 20px; letter-spacing: 3px; animation: popUp .6s; }
.discuss-layout { display: flex; gap: 34px; }
.discuss-main { flex: 1; background: #fff; border-radius: 34px; border: 8px solid #fff; padding: 30px 40px; box-shadow: 0 16px 30px rgba(0,0,0,.28); position: relative; min-height: 560px; }
.discuss-letter { position: absolute; top: -26px; left: -20px; width: 100px; height: 100px; border-radius: 50%; background: var(--orange); color: #fff; font-family: var(--font-title); font-size: 58px; display: grid; place-items: center; border: 6px solid #fff; }
.discuss-text { font-size: 50px; font-weight: 900; line-height: 1.3; margin: 10px 0 20px 60px; }
.discuss-steps { font-size: 28px; font-weight: 700; color: #555; background: #f4f8ec; border-radius: 16px; padding: 12px 18px; }
.discuss-answer { margin-top: 20px; background: #fff8d8; border: 4px dashed var(--gold-d); border-radius: 22px; padding: 14px 24px; animation: screenIn .6s; }
.discuss-answer h4 { margin: 0 0 6px; font-size: 30px; color: var(--orange-d); }
.discuss-answer ul { margin: 0; padding-left: 36px; font-size: 32px; font-weight: 700; line-height: 1.45; }
.discuss-side { width: 470px; display: flex; flex-direction: column; gap: 16px; }
.timer-box { background: rgba(255,255,255,.95); border-radius: 30px; padding: 16px; text-align: center; border: 5px solid var(--sky); }
.timer-ring { position: relative; width: 190px; height: 190px; margin: 0 auto; }
.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #e2eef6; stroke-width: 12; }
.ring-fg { fill: none; stroke: var(--green); stroke-width: 12; stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear, stroke .3s; }
.timer-text { position: absolute; inset: 0; display: grid; place-items: center; font-size: 54px; font-weight: 900; }
.timer-box.low .ring-fg { stroke: var(--red); }
.timer-box.done .timer-text { color: var(--red); animation: pulse 1s infinite; }
.timer-btns { display: flex; gap: 10px; justify-content: center; margin-top: 8px; }
.award-box { background: rgba(255,255,255,.95); border-radius: 24px; padding: 12px 14px; border: 5px solid var(--gold); }
.award-title { font-size: 24px; font-weight: 900; text-align: center; margin-bottom: 8px; }
.award-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.award-grid button { font-size: 22px; font-weight: 900; min-height: 64px; border-radius: 18px; border: 3px solid #fff; background: #fff3c4; box-shadow: 0 4px 0 var(--gold-d); }
.award-grid button:active { transform: translateY(3px); }

/* ---------- Lesson 6: Den ---------- */
.den-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.den-item { background: #fff; border-radius: 22px; padding: 12px 22px; border-left: 14px solid var(--orange); box-shadow: 0 8px 18px rgba(0,0,0,.2); animation: slideIn .6s both; }
.den-item:nth-child(2) { border-left-color: var(--sky); animation-delay: .1s; }
.den-item:nth-child(3) { border-left-color: var(--green); animation-delay: .2s; }
.den-q { font-size: 31px; font-weight: 900; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.den-row { display: flex; gap: 16px; margin-top: 8px; align-items: stretch; }
.big-input { flex: 1; width: 100%; font-size: 27px; padding: 8px 16px; border-radius: 16px; border: 3px solid #d8c7a0; background: #fffdf5; resize: none; outline: none; }
.big-input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(255,201,40,.4); }
.den-ans { flex: 1; font-size: 26px; background: #eaffdf; border-radius: 16px; padding: 8px 16px; animation: screenIn .5s; }

/* ---------- Build the lion ---------- */
.build-layout { display: flex; gap: 40px; height: 100%; align-items: center; }
.build-puzzle { width: 860px; height: 860px; margin-top: -30px; flex: none; }
.build-side { flex: 1; color: #fff; }
.build-progress { position: relative; height: 54px; border-radius: 30px; background: rgba(0,0,0,.35); border: 4px solid #fff; overflow: hidden; margin: 16px 0; }
.build-progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--orange)); transition: width 1s cubic-bezier(.2,.8,.2,1); }
.build-progress span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 28px; font-weight: 900; text-shadow: 0 2px 2px #000; }
.piece-list { list-style: none; padding: 0; margin: 0 0 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.piece-list li { font-size: 22px; font-weight: 800; background: rgba(60,30,8,.6); border-radius: 16px; padding: 10px 14px; border: 3px solid transparent; }
.piece-list li.on { background: rgba(79,157,38,.9); border-color: #b9f08a; }
.piece-list li small { display: block; font-weight: 600; opacity: .85; font-size: 18px; }
.champion { margin-top: 22px; font-family: var(--font-title); font-size: 50px; line-height: 1.15; text-align: center; color: #fff3b0; background: linear-gradient(180deg, var(--orange), var(--orange-d)); border: 6px solid #fff; border-radius: 30px; padding: 20px; text-shadow: 0 4px 0 #7a3000; animation: champ 1.2s cubic-bezier(.2,.9,.3,1.4), glow 2s 1.2s infinite; }
@keyframes champ { from { transform: scale(0) rotate(-10deg); } to { transform: none; } }

/* puzzle SVG */
.puzzle-svg { width: 100%; height: 100%; overflow: visible; }
.pz-board { fill: rgba(255,248,230,.95); stroke: #fff; stroke-width: 8; filter: drop-shadow(0 14px 20px rgba(0,0,0,.35)); }
.pz-silhouette { opacity: .14; filter: grayscale(1) brightness(.6); }
.pz-slot-shape { fill: rgba(120,80,40,.08); stroke: #b88a4a; stroke-width: 3; stroke-dasharray: 12 8; }
.pz-num { font-family: var(--font-title); font-size: 64px; fill: rgba(140,90,40,.45); text-anchor: middle; }
.pz-slot.filled .pz-num { display: none; }
.pz-piece { opacity: 0; transform-box: fill-box; transform-origin: center; }
.pz-piece.on { opacity: 1; }
.pz-edge { fill: none; stroke: rgba(255,255,255,.85); stroke-width: 3; }
.puzzle-svg.complete .pz-edge { stroke: rgba(255,255,255,.25); transition: stroke 1.5s; }
.puzzle-svg.complete .pz-board { stroke: var(--gold); animation: boardGlow 1.6s ease-in-out infinite; }
@keyframes boardGlow { 50% { stroke: #fff; } }

/* ---------- Exit ticket ---------- */
.exit-options { display: flex; flex-direction: column; gap: 22px; }
.exit-opt { font-size: 44px; font-weight: 900; text-align: left; padding: 26px 40px; border-radius: 30px; border: 6px solid #fff; background: linear-gradient(180deg, #fff, #fff3d0); box-shadow: 0 8px 0 #d39a2c; color: var(--ink); animation: slideIn .6s both; }
.exit-opt:nth-child(2) { animation-delay: .1s; } .exit-opt:nth-child(3) { animation-delay: .2s; }
.exit-answer { background: #fff; border-radius: 34px; padding: 30px 40px; border: 8px solid var(--gold); animation: popUp .5s; }
.exit-stem { font-size: 56px; font-weight: 900; margin-bottom: 18px; line-height: 1.25; }
.exit-stem .blank { color: var(--orange-d); border-bottom: 5px dashed var(--orange); padding: 0 30px; }
.exit-summary { animation: popUp .6s; }
.summary-grid { display: flex; gap: 30px; }
.summary-box { flex: 1; background: #fff; border-radius: 30px; padding: 22px 30px; border: 6px solid var(--gold); }
.summary-box h3 { font-size: 40px; margin: 0 0 10px; color: var(--orange-d); }
.objectives { font-size: 30px; font-weight: 700; line-height: 1.5; padding-left: 10px; list-style: none; margin: 0; }
.objectives li::before { content: "✅ "; }
.sum-row { display: flex; justify-content: space-between; font-size: 30px; font-weight: 800; padding: 8px 0; border-bottom: 2px dashed #eedfb8; }
.sum-row.top { color: var(--orange-d); font-size: 34px; }

/* ---------- Overlays ---------- */
.overlay { position: absolute; inset: 0; background: rgba(20,10,2,.72); z-index: 20; display: flex; align-items: center; justify-content: center; animation: fadeIn .3s; }
@keyframes fadeIn { from { opacity: 0; } }
.unlock-box { text-align: center; color: #fff; }
.unlock-title { font-family: var(--font-title); font-size: 64px; color: var(--gold); text-shadow: 0 5px 0 #7a3e00; animation: champ .8s cubic-bezier(.2,.9,.3,1.4); }
.unlock-puzzle { width: 640px; height: 640px; margin: 0 auto; }
.unlock-msg { font-size: 34px; font-weight: 800; margin: 0 0 20px; }
.pause-box { text-align: center; color: #fff; font-family: var(--font-title); font-size: 90px; }
.pause-icon { font-size: 160px; }
.scores-box { background: #fff; border-radius: 40px; padding: 30px 50px; border: 8px solid var(--gold); width: 1500px; }
.scores-box h2 { font-family: var(--font-title); font-size: 60px; margin: 0 0 20px; text-align: center; color: var(--orange-d); }
.scores-big { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.sb-card { text-align: center; background: #fff8e6; border-radius: 30px; padding: 20px; border: 5px solid #eedfb8; }
.sb-card.lead { border-color: var(--gold); box-shadow: 0 0 26px rgba(255,201,40,.8); }
.sb-card .e { font-size: 90px; }
.sb-card .n { font-size: 32px; font-weight: 900; }
.sb-card .p { font-size: 80px; font-weight: 900; color: var(--orange-d); }
.sb-card .s { font-size: 30px; color: var(--gold-d); min-height: 40px; }
.sb-card .b { display: flex; gap: 10px; justify-content: center; margin-top: 10px; }
.sb-card .b button { font-size: 28px; font-weight: 900; min-width: 76px; min-height: 66px; border-radius: 18px; border: 3px solid #fff; background: #e8f6ff; box-shadow: 0 4px 0 #8fb7cf; }
#toast { position: absolute; left: 50%; top: 130px; transform: translateX(-50%) translateY(-30px); background: rgba(40,20,5,.92); color: #fff; font-size: 30px; font-weight: 800; padding: 16px 34px; border-radius: 30px; border: 3px solid var(--gold); opacity: 0; transition: .35s; z-index: 30; pointer-events: none; white-space: nowrap; }
#toast.show { opacity: 1; transform: translateX(-50%); }

/* ---------- Teacher panel ---------- */
#teacher-panel { position: fixed; top: 0; right: 0; width: 400px; max-width: 92vw; height: 100%; background: #fffaf0; z-index: 50; box-shadow: -10px 0 30px rgba(0,0,0,.4); transform: translateX(105%); transition: transform .35s cubic-bezier(.2,.8,.2,1); overflow-y: auto; font-size: 16px; }
#teacher-panel.open { transform: none; }
.tp-head { position: sticky; top: 0; background: var(--brown); color: #fff; font-size: 22px; font-weight: 900; padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; z-index: 1; }
.tp-head button { background: none; border: 2px solid #fff; color: #fff; border-radius: 10px; font-size: 20px; width: 44px; height: 44px; }
.tp-section { padding: 12px 16px; border-bottom: 2px solid #eedfb8; }
.tp-label { font-weight: 900; color: var(--orange-d); margin-bottom: 8px; text-transform: uppercase; font-size: 14px; letter-spacing: 1px; display: flex; justify-content: space-between; }
.tp-row { display: flex; gap: 8px; margin-bottom: 8px; }
.tp-row button, #teacher-panel select { flex: 1; min-height: 48px; font-size: 16px; font-weight: 800; border-radius: 12px; border: 2px solid #d8c7a0; background: #fff; color: var(--ink); padding: 6px 8px; }
#teacher-panel select { width: 100%; margin-bottom: 8px; }
.tp-row button:active { background: #ffe9a8; }
.tp-gold { background: #ffe680 !important; border-color: var(--gold-d) !important; }
.tp-red { background: #ffe1dc !important; border-color: #e7a093 !important; }
.tp-team { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.tp-team .nm { flex: 1; font-weight: 800; font-size: 16px; padding: 8px; border-radius: 10px; border: 2px solid transparent; background: #fff; text-align: left; min-height: 44px; }
.tp-team .nm.active { border-color: var(--orange); background: #fff3c4; }
.tp-team button.pm { width: 46px; min-height: 44px; font-size: 18px; font-weight: 900; border-radius: 10px; border: 2px solid #d8c7a0; background: #fff; }
.tp-team .pt { width: 44px; text-align: center; font-weight: 900; font-size: 18px; }
.tp-check { display: block; margin: 6px 0; font-weight: 700; }
.tp-check input { width: 20px; height: 20px; vertical-align: middle; margin-right: 6px; }
.tp-pieces { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.tp-pieces button { min-height: 48px; border-radius: 10px; border: 2px solid #d8c7a0; background: #fff; font-weight: 800; font-size: 15px; }
.tp-pieces button.on { background: #c9f2a8; border-color: var(--green); }
.tp-keys { padding: 12px 16px; font-size: 13px; color: #6b5a40; }

#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }

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