:root {
  --ink: #1d2340; --muted: #5b6385; --card: #ffffff; --line: #dbe3ff;
  --good: #16a34a; --good-bg: #dcfce7; --good-sh: #86efac;
  --bad: #e11d48; --bad-bg: #ffe4e6; --bad-sh: #fda4af;
  --brand: #ff3b3b; --brand-sh: #b91c1c; --blue: #2563eb; --gold: #f5b301;
  --road: 92px; --speed: 1.4s;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body { font-family: Nunito, system-ui, sans-serif; color: var(--ink); background: #bfeaff; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
img.e { width: 1em; height: 1em; object-fit: contain; vertical-align: -0.15em; }
b { color: #c2185b; }
button { font: inherit; color: inherit; cursor: pointer; }

/* ---------- scenery ---------- */
#sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: linear-gradient(#4cb8f5 0%, #9fdcff 45%, #e6f8ff 75%); }
.sun { position: absolute; top: 40px; right: 8%; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(#fff6b0, #ffd23f 60%, #ffb703); box-shadow: 0 0 60px 20px rgba(255, 214, 80, .55); animation: sun 6s ease-in-out infinite; }
@keyframes sun { 50% { transform: scale(1.06); } }
.cloud { position: absolute; width: 180px; height: 56px; background: #fff; border-radius: 60px; opacity: .9; animation: cloud linear infinite; }
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 80px; height: 80px; top: -38px; left: 26px; }
.cloud::after { width: 60px; height: 60px; top: -26px; left: 92px; }
.c1 { top: 12%; animation-duration: 70s; } .c2 { top: 26%; animation-duration: 95s; animation-delay: -40s; transform: scale(.7); } .c3 { top: 6%; animation-duration: 120s; animation-delay: -80s; transform: scale(.5); }
@keyframes cloud { from { left: -220px; } to { left: 110%; } }
.hills { position: absolute; left: 0; right: 0; bottom: calc(var(--road) - 6px); width: 100%; height: 230px; }
.road { position: absolute; left: 0; right: 0; bottom: 0; height: var(--road); background: linear-gradient(#5b6070, #3d414d); border-top: 8px solid; border-image: repeating-linear-gradient(90deg, #ff3b3b 0 28px, #fff 28px 56px) 8; }
.road .dash { position: absolute; top: 44%; left: 0; width: 200%; height: 7px; background: repeating-linear-gradient(90deg, #fff 0 46px, transparent 46px 100px); animation: dash var(--speed) linear infinite; }
@keyframes dash { to { transform: translateX(-100px); } }
body.boost { --speed: .25s; }
#snow { position: absolute; inset: 0; pointer-events: none; }
#snow i { position: absolute; top: -20px; color: #fff; font-style: normal; text-shadow: 0 0 4px rgba(80, 140, 200, .5); animation: fall linear infinite; }
@keyframes fall { to { transform: translate(var(--dx), 110vh) rotate(360deg); } }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

/* ---------- layout ---------- */
#app { max-width: 940px; margin: 0 auto; padding: 14px 14px calc(var(--road) + 40px); }
.fade { animation: fadein .35s ease both; }
@keyframes fadein { from { opacity: 0; transform: translateY(14px); } }
.pop { animation: pop .45s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes pop { from { opacity: 0; transform: scale(.85); } }
.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }
.bob { animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-3deg); } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-family: Fredoka, sans-serif; font-weight: 600; font-size: 24px; padding: 14px 30px; border-radius: 999px; border: 0; background: var(--brand); color: #fff; box-shadow: 0 6px 0 var(--brand-sh); transition: transform .08s, box-shadow .08s; text-decoration: none; }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--brand-sh); }
.btn.green { background: #22c55e; box-shadow: 0 6px 0 #15803d; } .btn.green:active { box-shadow: 0 2px 0 #15803d; }
.btn.blue { background: #3b82f6; box-shadow: 0 6px 0 #1d4ed8; } .btn.blue:active { box-shadow: 0 2px 0 #1d4ed8; }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: 0 6px 0 #c7d2fe; } .btn.ghost:active { box-shadow: 0 2px 0 #c7d2fe; }
.btn.small { font-size: 18px; padding: 9px 18px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn img { width: 1.25em; height: 1.25em; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.center { text-align: center; justify-content: center; }

.spk { width: 52px; height: 52px; flex: none; border-radius: 50%; border: 0; background: #eef2ff; box-shadow: 0 4px 0 #c7d2fe; display: inline-grid; place-items: center; }
.spk img { width: 30px; height: 30px; }
.spk.on { background: #fde68a; box-shadow: 0 4px 0 #f59e0b; animation: pulse .7s ease-in-out infinite; }
.spk.mini { width: 40px; height: 40px; } .spk.mini img { width: 22px; height: 22px; }
@keyframes pulse { 50% { transform: scale(1.12); } }

/* ---------- top bar ---------- */
.top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: Fredoka, sans-serif; font-weight: 700; font-size: 30px; color: #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, .18); line-height: 1; }
.brand img { width: 54px; height: 54px; }
.brand small { display: block; font-size: 15px; font-weight: 600; opacity: .95; margin-top: 4px; }
.grow { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: #fff; border-radius: 999px; padding: 6px 14px 6px 8px; font-family: Fredoka, sans-serif; font-weight: 700; font-size: 22px; box-shadow: 0 4px 0 rgba(0, 0, 0, .12); }
.pill img { width: 32px; height: 32px; }
.pill.bump { animation: pop .5s; }
.iconbtn { width: 50px; height: 50px; border-radius: 50%; border: 0; background: #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, .12); display: grid; place-items: center; flex: none; }
.iconbtn img { width: 30px; height: 30px; }

/* ---------- splash ---------- */
.splash { text-align: center; padding-top: 6vh; }
.splash .logo { font-family: Fredoka, sans-serif; font-weight: 700; font-size: clamp(44px, 9vw, 86px); color: #fff; line-height: .95; text-shadow: 0 5px 0 #ff3b3b, 0 10px 0 rgba(0, 0, 0, .15); margin: 10px 0 8px; }
.splash .tag { font-size: 22px; font-weight: 800; color: #1d4ed8; background: #fff; display: inline-block; padding: 6px 18px; border-radius: 999px; }
.splash .car { width: min(260px, 50vw); margin: 18px auto 6px; display: block; filter: drop-shadow(0 12px 6px rgba(0, 0, 0, .2)); }
.splash .btn { font-size: 30px; padding: 18px 42px; margin-top: 18px; }

/* ---------- coach ---------- */
.coach { display: flex; align-items: flex-end; gap: 10px; margin: 6px 0 16px; }
.coach .ava { width: 86px; height: 86px; flex: none; background: #fff; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 5px 0 rgba(0, 0, 0, .12); position: relative; }
.coach .ava img { width: 66px; height: 66px; }
.coach .ava::after { content: "COACH ZOOM"; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); background: #ff3b3b; color: #fff; font: 700 10px Fredoka, sans-serif; padding: 2px 7px; border-radius: 99px; white-space: nowrap; }
body.talking .coach .ava img, body.talking .pit .ava img { animation: talk .28s ease-in-out infinite alternate; }
@keyframes talk { to { transform: scale(1.08) rotate(-4deg); } }
.bubble { position: relative; background: #fff; border-radius: 22px; padding: 14px 18px; font-size: 21px; font-weight: 800; box-shadow: 0 5px 0 rgba(0, 0, 0, .1); flex: 1; display: flex; align-items: center; gap: 10px; }
.bubble::before { content: ""; position: absolute; left: -12px; bottom: 18px; border: 12px solid transparent; border-right-color: #fff; border-left: 0; }

/* ---------- home ---------- */
.missions { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.mcard { position: relative; text-align: left; border: 0; border-radius: 26px; padding: 18px 18px 16px; background: #fff; box-shadow: 0 7px 0 var(--c, #c7d2fe); border-top: 10px solid var(--c, #c7d2fe); display: flex; gap: 14px; align-items: center; transition: transform .12s; }
.mcard:hover { transform: translateY(-3px) rotate(-.5deg); }
.mcard:active { transform: translateY(3px); }
.mcard .mi { width: 74px; height: 74px; flex: none; }
.mcard h3 { margin: 0; font-family: Fredoka, sans-serif; font-size: 25px; }
.mcard p { margin: 4px 0 0; color: var(--muted); font-size: 15px; font-weight: 700; }
.mcard .stars { margin-top: 6px; font-size: 18px; letter-spacing: 2px; }
.mcard .badge { position: absolute; top: -14px; right: 14px; background: var(--bad); color: #fff; font: 700 15px Fredoka, sans-serif; border-radius: 99px; padding: 3px 10px; box-shadow: 0 3px 0 rgba(0, 0, 0, .15); }
.mcard.wide { grid-column: 1 / -1; }
.mcard.dim { opacity: .7; }
.shelf { margin-top: 20px; background: rgba(255, 255, 255, .85); border-radius: 26px; padding: 14px 18px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.shelf h4 { margin: 0; font-family: Fredoka, sans-serif; font-size: 22px; }
.shelf .medal { width: 64px; height: 64px; filter: grayscale(1) opacity(.35); transition: .3s; }
.shelf .medal.got { filter: none; animation: pop .6s; }
.credits { margin-top: 18px; font-size: 13px; color: #33406a; text-align: center; opacity: .85; }
.credits a { color: inherit; }

/* ---------- race ---------- */
.track { flex: 1; position: relative; height: 54px; background: #3d414d; border-radius: 999px; box-shadow: inset 0 3px 0 rgba(0, 0, 0, .25), 0 4px 0 rgba(0, 0, 0, .12); overflow: visible; }
.track::before { content: ""; position: absolute; left: 22px; right: 46px; top: 50%; height: 4px; transform: translateY(-50%); background: repeating-linear-gradient(90deg, #fff 0 14px, transparent 14px 26px); opacity: .6; }
.track .flag { position: absolute; right: 6px; top: 50%; width: 40px; height: 40px; transform: translateY(-50%); }
.track .car { position: absolute; top: 50%; width: 58px; height: 58px; transform: translateY(-58%) scaleX(-1); transition: left .9s cubic-bezier(.3, 1.3, .5, 1); filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .4)); }
.track .dots { position: absolute; left: 30px; right: 54px; top: 50%; display: flex; justify-content: space-between; transform: translateY(-50%); }
.track .dots i { width: 10px; height: 10px; border-radius: 50%; background: #9ca3af; display: block; }
.track .dots i.ok { background: #4ade80; } .track .dots i.no { background: #fb7185; } .track .dots i.re { background: #fbbf24; }
.track .count { position: absolute; left: 50%; bottom: -24px; transform: translateX(-50%); font: 700 14px Fredoka, sans-serif; color: #fff; background: rgba(29, 35, 64, .6); padding: 1px 10px; border-radius: 99px; white-space: nowrap; }
.streak { font-family: Fredoka, sans-serif; font-weight: 700; font-size: 22px; display: inline-flex; align-items: center; gap: 2px; background: #fff; border-radius: 999px; padding: 6px 12px 6px 6px; box-shadow: 0 4px 0 rgba(0, 0, 0, .12); }
.streak img { width: 32px; height: 32px; }
.streak.hot img { animation: pulse .5s infinite; }

.qcard { background: #fff; border-radius: 30px; padding: 20px 22px 24px; box-shadow: 0 9px 0 rgba(29, 35, 64, .16); position: relative; margin-top: 30px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font: 600 15px Fredoka, sans-serif; background: #eef2ff; color: #3730a3; padding: 4px 12px 4px 6px; border-radius: 99px; }
.chip img { width: 22px; height: 22px; }
.chip.re { background: #fef3c7; color: #92400e; } .chip.why { background: #fce7f3; color: #9d174d; } .chip.fix { background: #dcfce7; color: #166534; }
.qtitle { font-family: Fredoka, sans-serif; font-size: clamp(24px, 4vw, 32px); margin: 4px 0 12px; display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.prompt { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 18px; }
.pics { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.pic { position: relative; width: 150px; height: 150px; border-radius: 30px; background: linear-gradient(#f0f9ff, #e0f2fe); display: grid; place-items: center; box-shadow: inset 0 -6px 0 rgba(14, 116, 144, .12); }
.pic > img { width: 112px; height: 112px; }
.pic .mark { position: absolute; right: -10px; bottom: -10px; width: 58px; height: 58px; background: #fff; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 4px 0 rgba(0, 0, 0, .15); animation: pop .6s .3s both; }
.pic .mark img { width: 44px; height: 44px; }
.pic .name { position: absolute; bottom: -12px; left: 50%; transform: translateX(-50%); background: var(--nc, #3b82f6); color: #fff; font: 700 18px Fredoka, sans-serif; padding: 2px 14px; border-radius: 99px; }
.ptext { font-family: Fredoka, sans-serif; font-weight: 600; font-size: clamp(26px, 4.6vw, 40px); text-align: center; line-height: 1.25; }
.ptext .blank { display: inline-block; min-width: 110px; border-bottom: 5px dashed #93c5fd; margin: 0 4px; }
.big { font-family: Fredoka, sans-serif; font-weight: 700; font-size: clamp(30px, 6vw, 52px); background: #fff7d6; border: 3px dashed #f5c542; padding: 6px 24px; border-radius: 22px; }
.hint { font-weight: 800; font-size: 19px; color: #6d28d9; background: #f3e8ff; padding: 6px 14px; border-radius: 99px; }
.listenbtn { font-size: 26px; padding: 22px 40px; }
.btn.listenbtn img { width: 54px; height: 54px; }

.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.opts.one { grid-template-columns: 1fr; }
.opt { display: flex; align-items: center; gap: 12px; text-align: left; background: #fff; border: 3px solid var(--line); border-radius: 22px; padding: 12px 14px 12px 18px; font-size: clamp(19px, 2.8vw, 24px); font-weight: 800; min-height: 72px; box-shadow: 0 6px 0 #c7d2fe; transition: transform .08s; }
.opt:active { transform: translateY(3px); box-shadow: 0 3px 0 #c7d2fe; }
.opt .t { flex: 1; }
.opt.right { border-color: var(--good); background: var(--good-bg); box-shadow: 0 6px 0 var(--good-sh); }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); box-shadow: 0 6px 0 var(--bad-sh); }
.opt.faded { opacity: .45; }
.opt.imgopt { flex-direction: column; justify-content: center; min-height: 170px; text-align: center; }
.opt.imgopt > img { width: 108px; height: 108px; }
.opt.imgopt .t { font-size: 18px; flex: none; }
.opt.sym { justify-content: center; font-size: 64px; font-family: Fredoka, sans-serif; min-height: 110px; }

.answerline { min-height: 84px; border: 3px dashed #93c5fd; border-radius: 22px; padding: 12px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: #f8fbff; margin-bottom: 16px; }
.answerline:empty::before { content: "Tap the words in order…"; color: #94a3b8; font-weight: 700; font-size: 19px; padding-left: 6px; }
.pool { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: 18px; }
.tile { font-family: Fredoka, sans-serif; font-weight: 600; font-size: clamp(22px, 3.4vw, 30px); padding: 8px 18px; background: #fff7d6; border: 3px solid #f5c542; border-radius: 16px; box-shadow: 0 5px 0 #e0a800; min-width: 54px; }
.tile:active { transform: translateY(3px); box-shadow: 0 2px 0 #e0a800; }
.tile.used { visibility: hidden; }
.answerline .tile { background: #e0f2fe; border-color: #38bdf8; box-shadow: 0 5px 0 #0284c7; animation: pop .3s; }
.answerline.right .tile { background: var(--good-bg); border-color: var(--good); box-shadow: 0 5px 0 var(--good-sh); }
.answerline.wrong { border-color: var(--bad); background: var(--bad-bg); }

.typebox { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; }
.typebox input { font-family: Fredoka, sans-serif; font-weight: 600; font-size: clamp(26px, 4.4vw, 38px); padding: 12px 18px; border-radius: 20px; border: 4px solid #93c5fd; outline: none; width: min(560px, 100%); text-align: center; color: var(--ink); background: #f8fbff; }
.typebox input:focus { border-color: #3b82f6; box-shadow: 0 0 0 6px rgba(59, 130, 246, .18); }
.typebox input.right { border-color: var(--good); background: var(--good-bg); }
.typebox input.wrong { border-color: var(--bad); background: var(--bad-bg); }
.typetip { text-align: center; color: var(--muted); font-weight: 700; margin-top: 10px; }

.sentence { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 10px 0 6px; }
.word { font-family: Fredoka, sans-serif; font-weight: 600; font-size: clamp(26px, 4.4vw, 40px); background: #fff; border: 3px solid var(--line); border-radius: 16px; padding: 6px 16px; box-shadow: 0 5px 0 #c7d2fe; }
.word.wrong { background: var(--bad-bg); border-color: var(--bad); text-decoration: line-through; text-decoration-thickness: 4px; }
.word.right { background: var(--good-bg); border-color: var(--good); }
.word.fixw { background: var(--good-bg); border-color: var(--good); animation: pop .5s; }

/* dialogue */
.dlg { width: 100%; max-width: 640px; display: flex; flex-direction: column; gap: 12px; }
.line { display: flex; align-items: flex-end; gap: 10px; }
.line.me { flex-direction: row-reverse; }
.line .who { width: 64px; flex: none; text-align: center; font: 700 13px Fredoka, sans-serif; color: var(--muted); }
.line .who img { width: 56px; height: 56px; display: block; margin: 0 auto 2px; background: #fff; border-radius: 50%; padding: 4px; box-shadow: 0 3px 0 rgba(0, 0, 0, .1); }
.line .say { background: #eef2ff; border-radius: 22px 22px 22px 6px; padding: 12px 16px; font-size: clamp(21px, 3.4vw, 28px); font-weight: 800; display: flex; align-items: center; gap: 10px; }
.line.me .say { background: #dcfce7; border-radius: 22px 22px 6px 22px; }
.line .say.q { min-width: 120px; justify-content: center; color: #16a34a; font-size: 34px; }
.markbox { width: 52px; height: 52px; border-radius: 12px; border: 4px solid #0ea5e9; display: grid; place-items: center; background: #fff; flex: none; }
.markbox img { width: 38px; height: 38px; }

/* chart */
.chart { border-collapse: separate; border-spacing: 6px; }
.chart th img { width: 54px; height: 54px; }
.chart td { text-align: center; }
.chart td img { width: 44px; height: 44px; }
.chart .nm { font: 700 20px Fredoka, sans-serif; color: #fff; padding: 4px 12px; border-radius: 99px; }

/* feedback */
.fb { margin-top: 18px; border-radius: 22px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; animation: pop .45s both; }
.fb.ok { background: var(--good-bg); border: 3px solid var(--good); }
.fb h3 { margin: 0; font-family: Fredoka, sans-serif; font-size: 28px; display: flex; align-items: center; gap: 10px; color: #166534; }
.fb h3 img { width: 42px; height: 42px; }
.fb .why { font-size: 20px; font-weight: 700; line-height: 1.4; }
.fb .acts { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }

/* pit stop */
.veil { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 40; animation: fadein .25s both; }
.pit { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: min(820px, 100%); max-height: 88vh; overflow: auto; background: #fff; border-radius: 30px 30px 0 0; z-index: 41; padding: 0 22px 26px; animation: slideup .45s cubic-bezier(.2, 1.2, .4, 1) both; box-shadow: 0 -10px 40px rgba(0, 0, 0, .25); }
@keyframes slideup { from { transform: translate(-50%, 100%); } }
.pit .flagbar { height: 22px; margin: 0 -22px 14px; background: repeating-conic-gradient(#1d2340 0 25%, #fff 0 50%) 0 0 / 22px 22px; border-radius: 30px 30px 0 0; }
.pit .head { display: flex; align-items: center; gap: 14px; }
.pit .ava { width: 84px; height: 84px; border-radius: 50%; background: #fef3c7; display: grid; place-items: center; flex: none; }
.pit .ava img { width: 64px; height: 64px; }
.pit h2 { margin: 0; font-family: Fredoka, sans-serif; font-size: 34px; display: flex; align-items: center; gap: 8px; }
.pit h2 img { width: 40px; height: 40px; }
.pit .you { margin-top: 12px; background: var(--bad-bg); border-radius: 18px; padding: 12px 16px; font-size: 19px; font-weight: 700; line-height: 1.4; }
.pit .you .given { font-family: Fredoka, sans-serif; font-size: 22px; text-decoration: line-through; color: var(--bad); }
.pit .right { margin-top: 12px; background: var(--good-bg); border-radius: 18px; padding: 12px 16px; font-size: 19px; font-weight: 700; }
.pit .right .ans { display: block; font-family: Fredoka, sans-serif; font-size: clamp(24px, 4vw, 32px); color: #166534; margin-top: 4px; }
.pit .expl { margin-top: 12px; background: #eff6ff; border-radius: 18px; padding: 12px 16px; font-size: 20px; font-weight: 700; line-height: 1.45; }
.pit .expl p { margin: 4px 0; }
.pit .later { margin-top: 12px; color: #92400e; background: #fef3c7; border-radius: 99px; padding: 8px 16px; font-weight: 800; display: inline-flex; gap: 8px; align-items: center; }
.pit .later img { width: 26px; height: 26px; }
.pit .acts { display: flex; justify-content: flex-end; gap: 12px; margin-top: 16px; flex-wrap: wrap; }

/* recap */
.recap { text-align: center; }
.recap .rule { font-size: clamp(24px, 4vw, 32px); font-weight: 800; line-height: 1.35; background: #fef9c3; border-radius: 22px; padding: 18px; margin: 16px 0; border: 3px dashed #facc15; }
.recap .bigimg { width: 110px; height: 110px; }

/* lights */
.lights { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(15, 23, 42, .55); animation: fadein .2s both; }
.lights .box { background: #1f2937; padding: 22px 28px; border-radius: 26px; display: flex; gap: 16px; box-shadow: 0 12px 0 #0b1220; }
.lights i { width: 62px; height: 62px; border-radius: 50%; background: #374151; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .3); display: block; transition: background .15s; }
.lights i.on { background: #ef4444; box-shadow: 0 0 26px #ef4444, inset 0 -6px 0 rgba(0, 0, 0, .3); }
.lights i.go { background: #22c55e; box-shadow: 0 0 26px #22c55e, inset 0 -6px 0 rgba(0, 0, 0, .3); }
.lights .go-text { position: absolute; font-family: Fredoka, sans-serif; font-weight: 700; font-size: 120px; color: #22c55e; text-shadow: 0 8px 0 #14532d; animation: pop .4s both; margin-top: 240px; }

/* briefing + results + lessons */
.panel { background: #fff; border-radius: 30px; padding: 24px; box-shadow: 0 9px 0 rgba(29, 35, 64, .16); margin-top: 8px; }
.panel h1 { font-family: Fredoka, sans-serif; margin: 0 0 6px; font-size: clamp(30px, 5vw, 44px); display: flex; align-items: center; gap: 12px; }
.panel h1 img { width: 64px; height: 64px; }
.brief { list-style: none; padding: 0; margin: 14px 0; display: flex; flex-direction: column; gap: 10px; }
.brief li { font-size: 24px; font-weight: 800; background: #f1f5ff; border-radius: 18px; padding: 12px 18px; }
.results { text-align: center; }
.results .stars { display: flex; justify-content: center; gap: 12px; margin: 10px 0; min-height: 110px; }
.results .stars img { width: 100px; height: 100px; animation: starpop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
.results .stars img.off { filter: grayscale(1) opacity(.25); }
@keyframes starpop { from { transform: scale(0) rotate(-90deg); } }
.results .score { font-family: Fredoka, sans-serif; font-size: 56px; font-weight: 700; }
.results .medalbig { width: 150px; height: 150px; animation: starpop .8s cubic-bezier(.2, 1.6, .4, 1) both; }
.statrow { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 12px 0; }
.stat { background: #f1f5ff; border-radius: 18px; padding: 10px 16px; font-weight: 800; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.stat img { width: 32px; height: 32px; }
.tricklist { text-align: left; background: #fff7ed; border-radius: 18px; padding: 12px 16px; margin: 12px 0; font-weight: 700; }
.tricklist li { margin: 4px 0; }
.finishcar { width: 100px; height: 100px; position: relative; animation: crossline 1.4s ease-in both; }
@keyframes crossline { from { transform: translateX(-60vw) scaleX(-1); } to { transform: translateX(0) scaleX(-1); } }

.lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.slide { text-align: center; }
.slide h2 { font-family: Fredoka, sans-serif; font-size: clamp(28px, 4.6vw, 40px); margin: 6px 0 14px; }
.slide .txt { font-size: clamp(21px, 3vw, 26px); font-weight: 800; line-height: 1.45; background: #f8fafc; border-radius: 20px; padding: 14px 18px; margin: 16px 0; display: flex; gap: 12px; align-items: center; text-align: left; }
.slide .txt span { flex: 1; }
.dots { display: flex; gap: 8px; justify-content: center; margin: 8px 0 14px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: #cbd5e1; display: block; }
.dots i.on { background: #3b82f6; transform: scale(1.3); }
.morph { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.morph button { display: flex; align-items: center; gap: 14px; background: #fff; border: 3px solid var(--line); border-radius: 20px; padding: 8px 18px; font-family: Fredoka, sans-serif; font-weight: 600; font-size: clamp(24px, 4vw, 34px); box-shadow: 0 5px 0 #c7d2fe; animation: pop .5s both; }
.morph img { width: 52px; height: 52px; }
.morph .arrow { color: #94a3b8; }
.morph .add { color: #16a34a; background: #dcfce7; border-radius: 8px; padding: 0 4px; }
.morph .gone { color: #e11d48; text-decoration: line-through; }
.exrows { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.exrows button { display: flex; align-items: center; gap: 14px; background: #fff; border: 3px solid var(--line); border-radius: 20px; padding: 8px 18px; font-size: clamp(21px, 3.4vw, 28px); font-weight: 800; box-shadow: 0 5px 0 #c7d2fe; min-width: min(520px, 100%); animation: pop .5s both; }
.exrows .pic { width: 70px; height: 70px; border-radius: 18px; }
.exrows .pic > img { width: 52px; height: 52px; }
.exrows .pic .mark { width: 34px; height: 34px; right: -8px; bottom: -8px; }
.exrows .pic .mark img { width: 26px; height: 26px; }
.letters { display: flex; justify-content: center; gap: 8px; }
.letters span { font-family: Fredoka, sans-serif; font-weight: 700; font-size: clamp(54px, 10vw, 96px); background: #fff; border: 4px solid var(--line); border-radius: 18px; min-width: .9em; padding: 0 10px; animation: pop .5s both; }
.letters span.hl { background: #fde68a; border-color: #f59e0b; color: #b45309; }
.racebar { display: flex; align-items: center; gap: 6px; justify-content: center; flex-wrap: wrap; font-family: Fredoka, sans-serif; font-weight: 600; font-size: clamp(30px, 5vw, 46px); }
.racebar .st, .racebar .fin { background: #fde68a; border-radius: 14px; padding: 0 10px; position: relative; }
.racebar .fin { background: #bbf7d0; }
.racebar small { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: 13px; white-space: nowrap; color: var(--muted); }
.redpen { font-family: Caveat, cursive; font-size: clamp(40px, 7vw, 60px); color: #dc2626; background: repeating-linear-gradient(#fff 0 46px, #bfdbfe 46px 48px); border-radius: 18px; padding: 10px 26px; transform: rotate(-2deg); box-shadow: 0 6px 0 rgba(0, 0, 0, .1); display: inline-block; text-align: left; }
.chant { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.chant div { font-size: clamp(22px, 3.6vw, 30px); font-weight: 800; padding: 6px 16px; border-radius: 14px; transition: .2s; }
.chant div.now { background: #fde68a; transform: scale(1.06); }
.chant .ing { color: #16a34a; }
.toast { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); background: #1d2340; color: #fff; font: 600 20px Fredoka, sans-serif; padding: 10px 20px; border-radius: 99px; z-index: 70; animation: pop .4s both; display: flex; gap: 8px; align-items: center; }
.toast img { width: 30px; height: 30px; }
.flycoin { position: fixed; width: 40px; height: 40px; z-index: 65; pointer-events: none; transition: transform .8s cubic-bezier(.5, -0.4, .6, 1), opacity .8s; }
.streakpop { position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%); z-index: 66; font: 700 clamp(40px, 8vw, 72px) Fredoka, sans-serif; color: #fff; text-shadow: 0 5px 0 #ea580c, 0 10px 20px rgba(0, 0, 0, .3); animation: streakpop 1.6s ease both; pointer-events: none; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.streakpop img { width: 1.2em; height: 1.2em; }
@keyframes streakpop { 0% { transform: translate(-50%, -50%) scale(0); } 20% { transform: translate(-50%, -50%) scale(1.15); } 30%, 80% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 100% { transform: translate(-50%, -80%) scale(.9); opacity: 0; } }
.expired { text-align: center; padding-top: 12vh; }

@media (max-width: 640px) {
  .opts { grid-template-columns: 1fr; }
  .opts.imgs { grid-template-columns: 1fr 1fr; }
  .pic { width: 120px; height: 120px; } .pic > img { width: 88px; height: 88px; }
  .brand { font-size: 22px; } .brand img { width: 42px; height: 42px; } .brand small { font-size: 12px; }
  .qcard { padding: 16px 14px 20px; }
  .lights i { width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
.line .say.q > img { width: 50px; height: 50px; }
.line .say.q { gap: 12px; }
.morph .dbl { color: #c2410c; background: #ffedd5; border-radius: 6px; padding: 0 2px; }
.morph .add { padding: 0 2px; }
.racewrap { margin-top: 30px; display: inline-block; }
.racebar.big-race { font-size: clamp(36px, 7vw, 60px); gap: 10px; }
.racebar.big-race small { top: -26px; font-size: 15px; font-family: Nunito, sans-serif; font-weight: 800; }
.raceroad { position: relative; height: 54px; margin-top: 8px; background: #3d414d; border-radius: 12px; overflow: hidden; }
.raceroad::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 4px; background: repeating-linear-gradient(90deg, #fff 0 18px, transparent 18px 34px); opacity: .7; }
.raceroad img { position: absolute; top: 4px; width: 46px; height: 46px; transform: scaleX(-1); animation: sentencedrive 3.2s ease-in-out infinite; }
@keyframes sentencedrive { 0% { left: 0; } 80%, 100% { left: calc(100% - 46px); } }
