/* Aptiz lesson player — one lesson, three students, three worlds.
   court · Mia  · a basketball whiteboard lesson
   comic · Jack · the comic from the school pitch
   lab   · Ruby · a footy oval with a balance to play with
   Pick a student (or take the check yourself), see their route through the
   same teaching steps, play the lesson, reach the same finish line. */

:root {
  --paper: #FCFCFA; --cream: #F8F6F1; --ink: #111; --ink-2: #5E5E5E; --line: #E4E2DC;
  --navy: #1B2236; --gold: #D4A72C; --gold-wash: #FDF8E9;
  --good: #1F8A4C; --good-wash: #E5F5EC; --bad: #C2502F; --bad-wash: #FCECE6;
  --secure: #2B59C3; --secure-wash: #EDF2FD; --fuzzy: #C08A1E; --fuzzy-wash: #FFF5DE; --gap: #C2502F; --gap-wash: #FCECE6;
  --orange: #E0763A; --peach: #FBEDE3; --sky: #E8F0FA; --capt: #FBE29A;
  --sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --serif: 'Source Serif 4', Georgia, serif;
  --math: 'Source Serif 4', 'STIX Two Math', Georgia, serif;
  --hand: 'Patrick Hand', 'Segoe Print', 'Bradley Hand', 'Comic Sans MS', cursive;
  --bang: 'Bangers', Impact, 'Arial Black', sans-serif;
  --sticker: 0 3px 0 var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--sans); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.m { font-family: var(--math); font-variant-numeric: lining-nums; white-space: nowrap; }
.m i { font-style: italic; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ── shell ─────────────────────────────────────────────────────────── */
.pl { min-height: 100vh; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: rgba(252,252,250,.95); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; color: var(--ink); }
.brand svg { width: 26px; height: 26px; }
.brand b { font-family: var(--serif); font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.chip { font-size: 12.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.sp { flex: 1; }
.who { display: inline-flex; align-items: center; gap: 8px; padding: 3px 12px 3px 3px; border-radius: 999px; background: var(--cream); border: 1px solid var(--line); font-size: 13px; font-weight: 800; white-space: nowrap; }
.who img { width: 28px; height: 28px; }
.link-btn { display: inline-flex; align-items: center; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; height: 34px; padding: 0 14px; font-size: 13px; font-weight: 800; text-decoration: none; color: inherit; white-space: nowrap; }
.link-btn:hover { background: var(--cream); }
.stage { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 22px 18px 100px; }
.foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; pointer-events: none; }
.foot > * { pointer-events: auto; }
.foot .step { font-size: 12.5px; font-weight: 800; padding: 5px 12px; border-radius: 99px; background: rgba(252,252,250,.92); border: 1px solid var(--line); }
@media (max-width: 640px) { .top .chip, .top .site, .who .int { display: none; } .top { gap: 8px; padding: 8px 10px; } .stage { padding: 14px 12px 96px; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 11px 22px; border-radius: 999px; border: 2px solid var(--ink); background: var(--paper); font-weight: 800; font-size: 15px; box-shadow: var(--sticker); text-decoration: none; color: var(--ink); transition: transform .12s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.gold { background: var(--gold); }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: 13.5px; }
.btn.pulse { animation: pulse 1.4s ease-in-out infinite; }
.btn[disabled] { opacity: .45; cursor: default; transform: none; }
@keyframes pulse { 0%, 100% { box-shadow: var(--sticker), 0 0 0 0 rgba(212,167,44,.65); } 50% { box-shadow: var(--sticker), 0 0 0 10px rgba(212,167,44,0); } }

.sh { margin: 2px 0 16px; }
.sh small { display: inline-block; font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 3px 10px; border-radius: 99px; background: var(--ink); color: var(--paper); }
.sh h2 { font-family: var(--serif); font-size: clamp(26px, 4vw, 40px); letter-spacing: -.025em; line-height: 1.05; margin: 10px 0 6px; }
.sh p { margin: 0; font-size: 16px; color: #333; line-height: 1.5; max-width: 62ch; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 760px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.opts { display: flex; flex-wrap: wrap; gap: 10px; }
.opt { min-height: 46px; padding: 9px 16px; border-radius: 14px; border: 2px solid var(--ink); background: var(--paper); font-weight: 700; font-size: 15.5px; box-shadow: var(--sticker); text-align: left; }
.opt .m { font-size: 19px; }
.opt.right { background: var(--good-wash); border-color: var(--good); box-shadow: 0 3px 0 var(--good); }
.opt.wrong { background: var(--bad-wash); border-color: var(--bad); box-shadow: 0 3px 0 var(--bad); animation: shake .4s ease; }
.opt.ns { border-style: dashed; box-shadow: none; color: var(--ink-2); font-size: 13.5px; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.fb { margin-top: 10px; font-size: 14.5px; line-height: 1.45; padding: 10px 14px; border-radius: 12px; animation: pop .3s ease both; }
.fb.good { background: var(--good-wash); border: 1.5px solid var(--good); }
.fb.bad { background: var(--bad-wash); border: 1.5px solid var(--bad); }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: none; } }

.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; padding: 3px 10px 3px 8px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--paper); white-space: nowrap; }
.st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #B4B4B4; }
.st.secure { background: var(--secure-wash); border-color: #C9D7F4; } .st.secure::before { background: var(--secure); }
.st.fuzzy { background: var(--fuzzy-wash); border-color: #EFD6A0; } .st.fuzzy::before { background: var(--fuzzy); }
.st.gap { background: var(--gap-wash); border-color: #F0C6B7; } .st.gap::before { background: var(--gap); }
.qchips { display: flex; gap: 5px; flex-wrap: wrap; }
.qchips span { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 99px; border: 1.5px solid var(--line); }
.qchips .r { background: var(--secure-wash); border-color: #C9D7F4; }
.qchips .w { background: var(--gap-wash); border-color: #F0C6B7; }
.qchips .u { background: #F1F1F1; color: var(--ink-2); }

.stamp { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border: 3px solid var(--good); color: var(--good); border-radius: 10px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; font-size: 14px; transform: rotate(-4deg); background: rgba(255,255,255,.92); animation: stampin .45s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes stampin { from { opacity: 0; transform: rotate(-4deg) scale(2.2); } to { opacity: 1; transform: rotate(-4deg) scale(1); } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i { position: absolute; top: -14px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translate3d(var(--dx), 110vh, 0) rotate(var(--r)); } }
.sfx { font: 46px/1 var(--bang); letter-spacing: .04em; color: #FFD23F; -webkit-text-stroke: 2px var(--navy); text-shadow: 3px 3px 0 var(--navy); transform: rotate(-8deg); display: inline-block; animation: sfx .5s cubic-bezier(.2,1.8,.4,1) both; }
@keyframes sfx { from { transform: rotate(-8deg) scale(0); } to { transform: rotate(-8deg) scale(1); } }

/* tutor bubble */
.say { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; animation: pop .35s ease both; }
.say .av { width: 36px; height: 36px; border-radius: 50%; background: var(--ink); display: grid; place-items: center; flex: none; }
.say .av svg { width: 22px; height: 22px; color: var(--paper); }
.say p { margin: 0; padding: 9px 13px; border-radius: 4px 16px 16px 16px; background: var(--paper); border: 1.5px solid var(--line); font-size: 15px; line-height: 1.45; }
.say p b { display: block; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.say.me { flex-direction: row-reverse; }
.say.me p { background: #F2C14E; border-color: #E0AE3A; border-radius: 16px 4px 16px 16px; font-weight: 700; }

/* ── pick ──────────────────────────────────────────────────────────── */
body[data-theme="home"] { background: radial-gradient(900px 500px at 10% -10%, #FFF1D6, transparent 60%), radial-gradient(900px 600px at 110% 10%, #E4ECFF, transparent 60%), var(--paper); }
.pick-h { text-align: center; margin: 6px auto 20px; max-width: 720px; }
.pick-h h1 { font-family: var(--serif); font-size: clamp(30px, 5vw, 50px); letter-spacing: -.035em; line-height: 1.02; margin: 4px 0 8px; }
.pick-h p { font-size: 16.5px; color: #333; margin: 0; }
.kids { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.kid { text-decoration: none; display: flex; flex-direction: column; text-align: left; padding: 0; overflow: hidden; border-radius: 20px; border: 2px solid var(--ink); background: var(--paper); box-shadow: 5px 5px 0 var(--ink); transition: transform .15s ease, box-shadow .15s ease; color: var(--ink); }
.kid:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.kid .thumb { height: 150px; position: relative; overflow: hidden; border-bottom: 2px solid var(--ink); }
.kid .body { padding: 14px 16px 16px; display: grid; gap: 8px; }
.kid .nm { display: flex; align-items: center; gap: 10px; }
.kid .nm img { width: 44px; height: 44px; }
.kid .nm b { font-size: 20px; display: block; line-height: 1.1; }
.kid .nm small { font-size: 13px; color: var(--ink-2); }
.kid .line { font-size: 14px; line-height: 1.45; color: #333; margin: 0; }
.kid .go { font-weight: 900; font-size: 14.5px; }
.self { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 20px; padding: 16px; border-radius: 18px; border: 2px dashed var(--ink); background: rgba(255,255,255,.7); font-size: 15px; }
@media (max-width: 860px) { .kids { grid-template-columns: minmax(0, 1fr); } }

/* animated thumbnails — also used on the website's hero */
.th-court { background: repeating-linear-gradient(90deg, #E9BE84 0 34px, #E2B477 34px 68px); }
.th-court::before { content: ""; position: absolute; left: -30px; bottom: -90px; width: 220px; height: 180px; border: 3px solid rgba(255,255,255,.8); border-radius: 50%; }
.th-court .hoop { position: absolute; right: 22px; top: 18px; width: 66px; }
.th-court .bb { position: absolute; left: 34px; bottom: 16px; width: 30px; height: 30px; animation: thshot 2.4s cubic-bezier(.3,.1,.3,1) infinite; }
.th-court .sb { position: absolute; left: 12px; top: 12px; padding: 4px 9px; border-radius: 6px; background: #151515; color: #FF5A36; font: 800 15px/1 'Courier New', monospace; letter-spacing: .1em; }
@keyframes thshot { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 55% { transform: translate(150px, -100px) rotate(260deg); } 72% { transform: translate(193px, -76px) rotate(320deg); opacity: 1; } 82% { opacity: 0; } 100% { transform: translate(193px, -40px); opacity: 0; } }
.th-comic { background-color: #FFD84D; background-image: radial-gradient(rgba(27,34,54,.22) 1.2px, transparent 1.6px); background-size: 9px 9px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 14px; }
.th-comic span { border: 2.5px solid var(--navy); border-radius: 4px; background: var(--peach) center 70%/88% auto no-repeat; animation: thpanel 3s ease-in-out infinite; }
.th-comic span:nth-child(2) { background-color: var(--sky); animation-delay: .5s; }
@keyframes thpanel { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-4px) rotate(-1.5deg); } }
.th-lab { background: repeating-linear-gradient(90deg, #47A56A 0 40px, #3F9A60 40px 80px); display: grid; place-items: center; }
.th-lab::before { content: ""; position: absolute; left: 50%; top: 50%; width: 320px; height: 220px; transform: translate(-50%, -50%); border: 3px solid rgba(255,255,255,.75); border-radius: 50%; }
.th-lab svg { position: relative; width: 210px; height: 120px; }
.th-lab .tb { transform-origin: 105px 34px; animation: thtilt 3.2s ease-in-out infinite; }
@keyframes thtilt { 0% { transform: rotate(-9deg); } 30% { transform: rotate(7deg); } 55% { transform: rotate(-3deg); } 75%, 100% { transform: rotate(0); } }

/* ── take the check yourself ───────────────────────────────────────── */
.qgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.qc { background: var(--paper); border: 2px solid var(--ink); border-radius: 16px; padding: 14px; box-shadow: 4px 4px 0 var(--ink); display: flex; flex-direction: column; gap: 8px; }
.qc.wait { opacity: .45; pointer-events: none; }
.qc header { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 800; color: var(--ink-2); }
.qc header b { background: var(--gold); color: var(--ink); padding: 1px 8px; border-radius: 99px; font-size: 11.5px; }
.qc p { margin: 0; font-size: 14.5px; line-height: 1.45; }
.qc .qeq { font-family: var(--math); font-size: 22px; }
.qc .opts { gap: 6px; }
.qc .opt { min-height: 40px; padding: 6px 12px; font-size: 15px; border-radius: 12px; }
.qc .fol { border-top: 2px dashed var(--line); padding-top: 8px; display: grid; gap: 8px; animation: pop .3s ease both; }
.qc .res { font-size: 13.5px; font-weight: 800; }
.timer { font: 800 15px/1 'Courier New', monospace; padding: 8px 12px; border-radius: 10px; background: var(--ink); color: var(--paper); }
@media (max-width: 860px) { .qgrid { grid-template-columns: minmax(0, 1fr); } }

/* ── plan (the student's check + today's path) ─────────────────────── */
.plan { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; align-items: start; }
.plan .me { padding: 18px; border-radius: 20px; border: 2px solid var(--ink); background: var(--paper); box-shadow: 5px 5px 0 var(--ink); display: grid; gap: 10px; }
.plan .me .nm { display: flex; gap: 12px; align-items: center; }
.plan .me .nm img { width: 60px; height: 60px; }
.plan .me .nm b { font-size: 22px; display: block; }
.plan .me .nm small { color: var(--ink-2); font-weight: 700; }
.plan .me p { margin: 0; font-size: 14.5px; line-height: 1.5; }
.route { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: r; }
.route li { counter-increment: r; display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; border: 2px solid var(--ink); background: var(--paper); animation: pop .35s ease both; }
.route li::before { content: counter(r); width: 30px; height: 30px; border-radius: 50%; background: var(--accent, var(--ink)); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 14px; }
.route li b { display: block; font-size: 15.5px; }
.route li small { font-size: 12.5px; color: var(--ink-2); font-weight: 700; }
.route li.fin { background: var(--gold); }
.route li.fin::before { background: var(--ink); content: "★"; }
.route li.skip { border-style: dashed; border-color: #BDBDBD; background: transparent; color: var(--ink-2); }
.route li.skip b { text-decoration: line-through; text-decoration-color: #BDBDBD; }
.route li.skip::before { background: #CFCFCF; content: "–"; }
.route li.later { border-style: dashed; border-color: var(--gold); background: var(--gold-wash); }
.route li.later::before { background: var(--gold); color: var(--ink); content: "→"; }
.plan .pr { display: grid; gap: 10px; min-width: 0; }
/* the same teaching steps for everyone, and this student's route through them */
.spine { padding: 14px; border-radius: 16px; border: 2px solid var(--ink); background: var(--paper); display: grid; gap: 8px; animation: pop .35s ease both; }
.spine p { margin: 0; font-size: 14.5px; line-height: 1.45; }
.spine > small { font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.spine .chips, .spine .key { display: flex; flex-wrap: wrap; gap: 6px; }
.spine .chips span { font-size: 12.5px; font-weight: 800; padding: 4px 10px; border-radius: 99px; border: 1.5px solid var(--ink); white-space: nowrap; }
.spine .key span { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; border: 1.5px solid var(--ink); }
.spine .full { background: var(--ink); color: var(--paper); }
.spine .quick { background: repeating-linear-gradient(135deg, var(--paper) 0 5px, #E2DFD7 5px 10px); }
.spine .skip { border-style: dashed !important; border-color: #BDBDBD !important; color: #9A9A9A; text-decoration: line-through; }
.spine .key .skip { text-decoration: none; }
.spine .later { border-style: dashed !important; border-color: var(--gold) !important; background: var(--gold-wash); color: #8A5F0E; }
.spine .pre { background: var(--gold); }
@media (max-width: 860px) { .plan { grid-template-columns: minmax(0, 1fr); } }

/* ══════════════════════════════════════════════ COURT · Mia */
body[data-theme="court"] { --accent: var(--orange); background-color: #E7BC85; background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.07) 0 2px, transparent 2px 72px), repeating-linear-gradient(90deg, #E9BE86 0 72px, #E3B47A 72px 144px); }
body[data-theme="court"] .top { background: rgba(21,21,21,.94); border-bottom-color: #000; }
body[data-theme="court"] .brand, body[data-theme="court"] .chip { color: #F2F2F0; }
body[data-theme="court"] .who, body[data-theme="court"] .link-btn { background: #262626; border-color: #3A3A3A; color: #F2F2F0; }
body[data-theme="court"] .sh small { background: var(--orange); }
.scoreboard { display: inline-flex; align-items: center; gap: 12px; padding: 7px 14px; border-radius: 10px; background: #0F0F0F; border: 2px solid #333; color: #CFCFCF; font-weight: 800; font-size: 10.5px; letter-spacing: .12em; }
.scoreboard .dig { font: 900 26px/1 'Courier New', monospace; color: #FF5A36; text-shadow: 0 0 10px rgba(255,90,54,.8); min-width: 2.2ch; text-align: right; }
.scoreboard .dig.blue { color: #59C3FF; text-shadow: 0 0 10px rgba(89,195,255,.7); }
.courtbox { position: relative; height: 290px; border-radius: 18px; border: 3px solid #3A2A1A; overflow: hidden; background: repeating-linear-gradient(90deg, #EAC08A 0 54px, #E3B679 54px 108px); box-shadow: 5px 5px 0 #3A2A1A; }
.courtbox::before { content: ""; position: absolute; right: -80px; bottom: -110px; width: 330px; height: 330px; border: 4px solid rgba(255,255,255,.85); border-radius: 50%; }
.courtbox::after { content: ""; position: absolute; right: 0; bottom: 0; width: 150px; height: 168px; border: 4px solid rgba(255,255,255,.85); border-right: 0; border-bottom: 0; background: rgba(224,118,58,.18); }
.courtbox .hoop { position: absolute; right: 22px; top: 24px; width: 112px; z-index: 2; }
.courtbox .net { transform-origin: 50% 0; transform-box: fill-box; }
.courtbox .net.swish { animation: swish .45s ease; }
@keyframes swish { 40% { transform: scaleY(1.3) scaleX(.85); } }
.courtbox .player { position: absolute; left: 18px; bottom: 10px; width: 72px; z-index: 2; }
.courtbox .ball { position: absolute; left: 74px; bottom: 74px; width: 34px; height: 34px; z-index: 3; }
.courtbox .ball.go { animation: bx .85s linear forwards; }
.courtbox .ball.go svg { animation: by .85s cubic-bezier(.2,.6,.5,1) forwards; }
@keyframes bx { to { transform: translateX(var(--dx, 360px)); } }
@keyframes by { 0% { transform: translateY(0) rotate(0); } 55% { transform: translateY(-185px) rotate(240deg); } 100% { transform: translateY(-140px) rotate(380deg); } }
.courtbox .sbwrap { position: absolute; left: 14px; top: 12px; z-index: 4; }
.courtbox .pts { position: absolute; right: 70px; top: 116px; z-index: 4; font: 900 32px/1 var(--sans); color: #fff; -webkit-text-stroke: 1.5px #111; animation: up 1s ease-out forwards; }
@keyframes up { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-50px) scale(1.3); } }
/* the whiteboard, as in the pitch */
.wb { background: #FFFFFE; border: 2px solid var(--ink); border-radius: 18px; padding: 14px 16px 18px; box-shadow: 5px 5px 0 var(--ink); background-image: radial-gradient(#DCDCD6 1px, transparent 1.3px); background-size: 18px 18px; }
.wb .tools { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.wb .tools span { font-size: 11.5px; font-weight: 800; padding: 3px 10px; border-radius: 99px; }
.wb .tools span:nth-child(1) { background: var(--navy); color: #fff; }
.wb .tools span:nth-child(2) { background: #FBE29A; }
.wb .tools span:nth-child(3) { background: #FBDCCB; color: #B5532A; }
.wb .tools span:nth-child(4) { background: #DCE7FB; color: #2B59C3; }
.wb .ln { font-family: var(--hand); font-size: 23px; line-height: 1.35; margin: 3px 0; animation: write .5s ease both; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.wb .lab { font-family: var(--sans); font-size: 11.5px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); min-width: 104px; }
.wb .m { font-size: 26px; }
.wb .hi { background: #FBE29A; padding: 0 8px; border-radius: 4px; }
.wb .ring { border: 2px solid var(--orange); border-radius: 99px; padding: 2px 12px; }
.wb .tagx { font-family: var(--sans); font-size: 12px; font-weight: 800; color: #B5532A; border: 1.5px solid var(--orange); border-radius: 99px; padding: 2px 10px; }
.wb .hr { height: 0; border-top: 1.5px solid var(--line); margin: 10px 0; }
.wb .small { font-family: var(--sans); font-size: 12px; font-weight: 800; color: #B5532A; display: block; }
@keyframes write { from { opacity: 0; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
.fund { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fund button { text-align: left; padding: 14px; border-radius: 16px; border: 2px solid var(--ink); background: var(--paper); box-shadow: var(--sticker); font-weight: 800; font-size: 16px; }
.fund button small { display: block; font-size: 13px; color: #B5532A; font-weight: 800; }
.fund button .m { display: block; font-size: 26px; margin-top: 8px; }
.fund button .tap { font-size: 12px; color: var(--ink-2); font-weight: 700; }
.fund button.on { background: #FFF6E8; }
.balls { display: flex; gap: 16px; flex-wrap: wrap; }
.bball { position: relative; width: 88px; height: 88px; border-radius: 50%; border: 3px solid #3A2A1A; background: radial-gradient(circle at 35% 30%, #F5944F, #E8702A 55%, #C55416); color: #fff; font: 900 28px/1 var(--sans); -webkit-text-stroke: 1px #3A2A1A; display: grid; place-items: center; box-shadow: 0 5px 0 #3A2A1A; overflow: hidden; transition: transform .15s ease; }
.bball::before, .bball::after { content: ""; position: absolute; inset: 0; border: 2px solid rgba(58,42,26,.55); border-radius: 50%; }
.bball::before { transform: scaleX(.45); } .bball::after { border-left: 0; border-right: 0; transform: scaleY(.45); }
.bball span { position: relative; z-index: 2; }
.bball:hover { transform: translateY(-3px) rotate(-8deg); }
.bball.made { animation: made .8s ease forwards; }
.bball.clank { animation: shake .4s ease; }
@keyframes made { 40% { transform: translateY(-60px) rotate(180deg) scale(.8); } 100% { transform: translateY(-120px) rotate(360deg) scale(.2); opacity: 0; } }
.gp { text-align: center; padding: 18px; border-radius: 20px; border: 3px solid var(--ink); background: #151515; color: #F2F2F0; box-shadow: 5px 5px 0 var(--ink); }
.gp .banner { font: 900 13px/1 var(--sans); letter-spacing: .14em; color: #FF5A36; }
.gp > .m { font-size: clamp(40px, 7vw, 64px); display: block; margin: 10px 0 4px; color: #fff; }
.gp p .m { font-size: 17px; }
.gp p { margin: 0; color: #CFCFCF; font-size: 15px; }
@media (max-width: 620px) { .fund { grid-template-columns: 1fr; } .courtbox { height: 250px; } }

/* ══════════════════════════════════════════════ COMIC · Jack (as in the pitch) */
body[data-theme="comic"] { --accent: var(--orange); background-color: #FFD84D; background-image: radial-gradient(rgba(27,34,54,.16) 1.3px, transparent 1.7px); background-size: 10px 10px; }
body[data-theme="comic"] .sh small { background: var(--navy); }
body[data-theme="comic"] .sh h2 { font-family: var(--bang); font-weight: 400; letter-spacing: .03em; font-size: clamp(36px, 5.6vw, 56px); color: #fff; -webkit-text-stroke: 2px var(--navy); text-shadow: 4px 4px 0 var(--navy); }
.book { background: var(--cream); border: 3px solid var(--navy); border-radius: 10px; padding: 16px; box-shadow: 9px 9px 0 var(--navy); animation: turn .7s cubic-bezier(.3,.7,.3,1) both; transform-origin: left center; }
@keyframes turn { from { transform: perspective(1600px) rotateY(-70deg); opacity: 0; } to { transform: perspective(1600px) rotateY(0); opacity: 1; } }
.book .masthead { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; font: 20px/1 var(--bang); letter-spacing: .06em; color: var(--navy); }
.book .masthead span:last-child { font-size: 15px; color: var(--orange); }
.strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cpw { display: flex; flex-direction: column; gap: 10px; }
.cpn { position: relative; aspect-ratio: 760 / 1000; border: 3px solid var(--navy); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; padding: 10px; gap: 8px; animation: pop .45s ease both; }
.cpn.peach { background: var(--peach); } .cpn.blue { background: var(--sky); }
.cpn img { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: auto; }
.cpn .capt { position: relative; z-index: 2; background: var(--capt); border: 2px solid var(--navy); border-radius: 3px; padding: 7px 9px; font-size: 13px; line-height: 1.32; font-weight: 600; color: var(--navy); }
.cpn .bub { position: absolute; z-index: 2; left: 50%; bottom: 14%; transform: translateX(-38%); background: #fff; border: 2px solid var(--navy); border-radius: 14px; padding: 7px 11px; font-size: 13px; font-weight: 600; color: var(--navy); line-height: 1.3; max-width: 70%; }
.cpn.n3 .bub { bottom: auto; top: 30%; left: 50%; transform: translateX(-50%); text-align: center; }
.cpn.n4 .bub { bottom: auto; top: 38%; left: auto; right: 6%; transform: none; text-align: center; }
.cpn .sfx { position: absolute; z-index: 3; top: 30%; left: 8%; font-size: 34px; }
.cpw .alg { text-align: center; font-weight: 900; font-size: clamp(18px, 2.2vw, 24px); color: var(--navy); }
.cpw .alg.last { color: #B5532A; }
.cpn.locked { background: rgba(255,255,255,.55); border-style: dashed; display: grid; place-items: center; }
.cbtn { font: 20px/1 var(--bang); letter-spacing: .05em; padding: 10px 16px; border: 3px solid var(--navy); border-radius: 10px; background: #FFD23F; color: var(--navy); box-shadow: 3px 3px 0 var(--navy); }
.cbtn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--navy); }
.cbtn.blue { background: #8FD3FF; } .cbtn.white { background: #fff; } .cbtn.green { background: #7EDB9C; }
.cbtn.wrong { background: #FFB4B4; animation: shake .4s ease; }
.cpanel { position: relative; border: 3px solid var(--navy); border-radius: 8px; background: var(--peach); padding: 14px; display: grid; gap: 10px; }
.cpanel.blue { background: var(--sky); }
.cpanel .capt { justify-self: start; background: var(--capt); border: 2px solid var(--navy); border-radius: 3px; padding: 7px 10px; font-size: 14px; font-weight: 600; color: var(--navy); }
.cpanel .bub { justify-self: start; background: #fff; border: 2px solid var(--navy); border-radius: 14px; padding: 8px 12px; font-size: 15px; font-weight: 600; color: var(--navy); }
.scale-wrap svg { width: 100%; max-width: 500px; height: auto; display: block; margin: 0 auto; }
.scale-wrap .beam, .scale-wrap .pan { transition: transform .7s cubic-bezier(.3,1.5,.5,1); }
.scale-wrap .beam { transform-box: view-box; }
.counter { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; font-family: var(--math); font-size: 30px; color: var(--navy); }
.counter .box { min-width: 56px; text-align: center; padding: 2px 10px; border: 2.5px dashed var(--navy); border-radius: 10px; background: #fff; }
.blocks-pick { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.blocks-pick .cbtn { min-width: 76px; font-size: 26px; }
@media (max-width: 860px) { .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .strip { grid-template-columns: minmax(0, 1fr); } }

/* ══════════════════════════════════════════════ LAB · Ruby (footy) */
body[data-theme="lab"] { --accent: var(--secure); background-color: #43A066; background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 60px, transparent 60px 120px); }
body[data-theme="lab"] .top { background: rgba(23,64,40,.95); border-bottom-color: #0E2A19; }
body[data-theme="lab"] .brand, body[data-theme="lab"] .chip { color: #F2F2F0; }
body[data-theme="lab"] .who, body[data-theme="lab"] .link-btn { background: #1F5435; border-color: #2D6B46; color: #F2F2F0; }
body[data-theme="lab"] .sh h2, body[data-theme="lab"] .sh p { color: #fff; }
body[data-theme="lab"] .sh small { background: #fff; color: #1F5435; }
.ladder { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.ladder span { font-size: 12.5px; font-weight: 800; padding: 6px 12px; border-radius: 99px; background: rgba(255,255,255,.18); color: #fff; border: 1.5px solid rgba(255,255,255,.35); }
.ladder span.on { background: var(--gold); color: var(--ink); border-color: var(--ink); }
.ladder span.done { background: #fff; color: #1F5435; }
.rule { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 12px; background: #FFF6CF; border: 2px solid var(--ink); font-weight: 800; font-size: 15px; transform: rotate(-1deg); box-shadow: 3px 3px 0 var(--ink); margin-bottom: 12px; }
.rule small { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #8A5F0E; }
.bal { position: relative; background: var(--paper); border: 2px solid var(--ink); border-radius: 22px; box-shadow: 6px 6px 0 #1F5435; padding: 12px 12px 16px; }
.bal .story { margin: 2px 4px 6px; font-size: 15.5px; line-height: 1.5; }
.bal svg.scale { width: 100%; max-width: 600px; margin: 0 auto; height: auto; display: block; touch-action: manipulation; }
.bal .beam, .bal .pan { transition: transform .7s cubic-bezier(.3,1.5,.5,1); }
.bal .beam { transform-box: view-box; }
.bal .item { cursor: pointer; }
.bal .item:hover { filter: brightness(1.12); }
.bal .item:focus-visible { outline: none; }
.bal .item:focus-visible > :first-child { stroke: var(--gold); stroke-width: 3; }
.bal-eq { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; font-family: var(--math); font-size: clamp(26px, 4vw, 36px); margin: 4px 0 6px; }
.bal-eq .neq { color: var(--bad); }
.bal-eq .lvl { font-family: var(--sans); font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 99px; background: var(--good-wash); color: var(--good); border: 1.5px solid var(--good); }
.bal-eq .lvl.off { background: var(--bad-wash); color: var(--bad); border-color: var(--bad); }
.bal-tip { text-align: center; font-size: 14.5px; color: #333; margin: 4px 0 10px; min-height: 22px; font-weight: 600; }
.bal-tools { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.bal-log { margin: 10px auto 0; display: grid; gap: 4px; max-width: 460px; }
.bal-log div { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; padding: 5px 12px; border-radius: 10px; background: #F1F4F0; }
.bal-log .m { font-size: 17px; }
.goal { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 6; }
.goal b { font: 66px/1 var(--bang); color: #fff; -webkit-text-stroke: 3px var(--ink); text-shadow: 5px 5px 0 #1F5435; animation: sfx .5s cubic-bezier(.2,1.8,.4,1) both; }
.dials { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; font-family: var(--math); font-size: 36px; margin: 14px 0; }
.dial { display: grid; gap: 4px; justify-items: center; }
.dial button { width: 44px; height: 32px; border-radius: 10px; border: 2px solid var(--ink); background: var(--paper); font-weight: 900; font-size: 16px; font-family: var(--sans); }
.dial b { min-width: 2ch; text-align: center; font-weight: 600; }
.puzzle { margin: 12px auto 0; max-width: 420px; padding: 16px; border-radius: 16px; border: 2px solid var(--ink); background: var(--gold); box-shadow: 5px 5px 0 var(--ink); text-align: center; animation: stampin .5s ease both; }
.puzzle .m { font-size: 30px; }

/* ── finish ────────────────────────────────────────────────────────── */
.finish { text-align: center; max-width: 760px; margin: 0 auto; }
.finish .big { font: clamp(46px, 8.5vw, 88px)/1 var(--bang); letter-spacing: .03em; color: var(--gold); -webkit-text-stroke: 3px var(--ink); text-shadow: 6px 6px 0 var(--ink); transform: rotate(-3deg); animation: sfx .6s cubic-bezier(.2,1.8,.4,1) both; margin: 8px 0 14px; }
.finish .card { text-align: left; background: var(--paper); border: 2px solid var(--ink); border-radius: 20px; padding: 18px; box-shadow: 5px 5px 0 var(--ink); display: grid; gap: 12px; }
.finish .line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 15px; }
.finish .line .m { font-size: 22px; }
.finish .teacher { padding: 12px 14px; border-radius: 12px; border: 2px solid var(--ink); font-size: 14.5px; line-height: 1.45; background: var(--cream); }
.finish .teacher small { display: block; font-size: 10.5px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.finish .next { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 18px; }
.finish .next .btn img { width: 26px; height: 26px; }

/* ── lesson pieces added for the full lessons ──────────────────────── */
.stepq { font-weight: 800; font-size: 15px; margin: 0 0 10px; }
.solvebox { position: relative; margin-top: 14px; }
.solvebox:empty { display: none; }
.solvebox .opts { margin-bottom: 4px; }
.plus2 { position: absolute; right: 8px; top: -8px; font: 900 22px/1 var(--sans); color: var(--orange); -webkit-text-stroke: 1px #3A2A1A; animation: up 1s ease-out forwards; pointer-events: none; }
.ln-out { font-size: 22px; padding: 4px 0; animation: pop .35s ease both; }
.step-out { font-size: 22px; padding: 2px 10px; border-radius: 8px; background: #fff; border: 2px solid var(--navy); animation: pop .35s ease both; }
.opts.col { flex-direction: column; align-items: stretch; }
.opts.col .opt { text-align: left; }
.cbtn.right { background: #7EDB9C; }
.cbtn.small { font-size: 16px; padding: 6px 12px; }
.cbtn[disabled] { opacity: .55; }
.cbtn.right[disabled] { opacity: 1; }
.scoreboard.boom .dig { animation: boom .9s ease both; }
@keyframes boom { 0% { transform: scale(1); } 40% { transform: scale(1.7) rotate(-8deg); color: #FFE14D; } 100% { transform: scale(1); } }

/* Mia */
.jerseys { display: flex; flex-wrap: wrap; gap: 10px; min-height: 104px; align-items: flex-end; padding: 12px; border-radius: 16px; background: rgba(255,255,255,.6); border: 2px dashed rgba(58,42,26,.45); }
.jerseys .jersey { width: 62px; animation: pop .35s cubic-bezier(.2,1.6,.4,1) both; }
.join { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 16px; border-radius: 18px; background: rgba(255,255,255,.7); border: 2px dashed rgba(58,42,26,.45); }
.excard { flex: 1; min-width: 130px; padding: 14px; border-radius: 16px; border: 2px solid var(--ink); background: var(--paper); box-shadow: var(--sticker); }
.excard small { display: block; font-size: 12.5px; font-weight: 800; color: #B5532A; margin-bottom: 6px; }
.excard .m { font-size: 30px; }
.eqbtn { width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--ink); background: var(--gold); font: 900 34px/1 var(--math); box-shadow: var(--sticker); animation: pulse 1.4s ease-in-out infinite; }
.join.joined { border-style: solid; border-color: var(--gold); background: var(--gold-wash); }
.join.joined .eqbtn { animation: none; background: var(--ink); color: var(--gold); }
.bars { display: flex; height: 54px; border-radius: 12px; overflow: hidden; border: 2px solid var(--ink); margin: 10px 0; }
.bars span { display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 12.5px; text-align: center; line-height: 1.15; animation: grow .6s ease both; transform-origin: left; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.drill { display: grid; gap: 14px; }
.drill .item { display: grid; grid-template-columns: minmax(170px, 260px) 1fr; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--ink); background: rgba(255,255,255,.92); box-shadow: 4px 4px 0 var(--ink); }
.drill .item > div:first-child .m { font-size: 28px; }
.drill .item.won { background: var(--good-wash); }
.drill .item .chk { grid-column: 1 / -1; font-size: 14.5px; min-height: 20px; }
.drill .item .chk .m { font-size: 18px; }
@media (max-width: 620px) { .drill .item { grid-template-columns: minmax(0, 1fr); } .bball { width: 72px; height: 72px; font-size: 24px; } }

/* Jack */
.panels2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cpanel.wide { grid-column: 1 / -1; }
.pair { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 0; }
.pair svg { width: 64px; height: auto; }
.pair .n { width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 900; display: grid; place-items: center; font-size: 13px; }
.pair .arr { font: 28px/1 var(--bang); color: var(--navy); }
.chain { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; font-size: 30px; color: var(--navy); min-height: 46px; }
.chain .arrow { font: 20px/1 var(--bang); letter-spacing: .04em; color: #E63946; }
.ido3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.idoh { margin: 0; font: 26px/1 var(--bang); letter-spacing: .05em; color: #E0763A; -webkit-text-stroke: .6px var(--navy); }
.idoh small { display: block; font-family: var(--sans); -webkit-text-stroke: 0; font-size: 12.5px; font-weight: 800; letter-spacing: 0; color: var(--navy); margin-top: 4px; }
.idol { display: grid; gap: 4px; }
.idol .ln, .cpanel .ln { font-family: var(--math); font-size: 22px; color: var(--navy); animation: pop .4s ease both; }
.idol .an { font-size: 12.5px; font-weight: 800; color: #E63946; animation: pop .4s ease both; }
.blank { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.blank .m { font-size: 21px; }
.blank .opts { gap: 6px; }
.mine { background: #FBE29A; border: 2px solid var(--navy); padding: 0 8px; border-radius: 6px; }
.lock { padding: 18px; border: 2px dashed var(--navy); border-radius: 8px; text-align: center; font-weight: 700; color: var(--navy); opacity: .6; }
.train { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.tstory { margin: 0; font-size: 14px; font-weight: 600; color: var(--navy); }
.tfb, .fresh { display: grid; gap: 8px; }
.fresh { margin-top: 10px; padding-top: 10px; border-top: 2px dashed var(--navy); }
.cpanel .opts { gap: 8px; }
@media (max-width: 860px) { .panels2, .ido3, .train { grid-template-columns: minmax(0, 1fr); } }

/* Ruby */
.recap { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: center; padding: 20px; }
.tring { width: 120px; height: 120px; }
.tring .fg { transition: stroke-dashoffset 2.6s linear; }
.rulebig { font-family: var(--serif); font-size: clamp(24px, 3.4vw, 34px); font-weight: 600; letter-spacing: -.02em; margin: 0 0 12px; }
.recap .lines { display: grid; gap: 8px; }
.recap .lines div { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; font-size: 15px; animation: pop .4s ease both; }
.recap .lines .m { font-size: 28px; min-width: 6.5ch; }
.recap .lines span:not(.m) { color: var(--ink-2); font-weight: 700; }
.age { text-align: center; font-family: var(--serif); font-size: 46px; font-weight: 600; line-height: 1; margin-top: 6px; }
.age small { display: block; font-family: var(--sans); font-size: 13px; font-weight: 700; color: var(--ink-2); margin-top: 4px; }
.slider { width: 100%; height: 34px; accent-color: var(--secure); margin: 8px 0; }
.life { position: relative; height: 70px; margin: 8px 0 4px; }
.lbar { position: absolute; left: 0; top: 0; height: 30px; border: 2.5px solid var(--ink); border-radius: 8px; background: #fff; transition: width .2s ease; }
.lbar::after { content: "his life"; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 11px; font-weight: 800; color: var(--ink-2); }
.segs { position: absolute; left: 0; right: 0; top: 38px; height: 28px; display: flex; }
.segs span { flex: none; }
.segs span { height: 100%; border-right: 2px solid #fff; transition: width .2s ease; }
.segs span:first-child { border-radius: 6px 0 0 6px; } .segs span:last-child { border-radius: 0 6px 6px 0; border-right: 0; }
.legend2 { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: #333; margin-top: 2px; }
.legend2 span { display: inline-flex; align-items: center; gap: 6px; }
.legend2 i { width: 12px; height: 12px; border-radius: 3px; }
@media (max-width: 620px) { .recap { grid-template-columns: minmax(0, 1fr); justify-items: start; } .tring { width: 90px; height: 90px; } }
.bal-eq.long .m { white-space: normal; font-size: clamp(18px, 4.6vw, 30px); text-align: center; }
.bal-tip .stamp { display: inline-block; max-width: 100%; white-space: normal; text-align: center; }
.bal-tip { overflow-wrap: anywhere; }
/* stamps and bursts animate from a large scale; keep that from ever widening the page */
.pl, .stage { overflow-x: clip; }

/* ── the shared teaching steps, in beats: a scale, board lines, a quick check ── */
.beats { display: grid; gap: 14px; }
.beat { position: relative; display: grid; gap: 10px; align-content: start; padding: 14px 16px; border-radius: 18px; border: 2px solid var(--ink); background: var(--paper); box-shadow: 5px 5px 0 var(--ink); animation: pop .4s ease both; min-width: 0; }
.beat.has-scale { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; column-gap: 18px; }
.beat.has-scale > .bcap { grid-column: 1 / -1; }
.bcap { justify-self: start; font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 99px; background: var(--ink); color: var(--paper); line-height: 1.35; }
.bscale svg { width: 100%; max-width: 420px; height: auto; display: block; margin: 0 auto; }
.bscale .beam, .bscale .pan { transition: transform .7s cubic-bezier(.3,1.5,.5,1); }
.bscale .beam { transform-box: view-box; }
.bmain { display: grid; gap: 8px; min-width: 0; }
.bboard { display: grid; gap: 2px; }
.bl { font-size: 24px; line-height: 1.3; overflow-wrap: anywhere; }
.bl .m { font-size: 26px; }
.bl.new { animation: write .5s ease both; }
.bqp { margin: 0; font-weight: 800; font-size: 15px; line-height: 1.45; }
.bq { display: grid; gap: 8px; }
.bq:empty { display: none; }
.bq .opts, .beat .opts { gap: 8px; }
.bq .say { margin: 2px 0; }
.brule { padding: 10px 12px; border-radius: 12px; background: #FFF6CF; border: 2px solid var(--ink); font-size: 14.5px; line-height: 1.45; font-weight: 600; animation: pop .35s ease both; }
.bend { display: flex; justify-content: center; margin: 16px 0 0; }
.beat .bub, .cpanel .bub.bad { justify-self: start; background: #fff; border: 2px solid var(--navy); border-radius: 14px; padding: 8px 12px; font-size: 15px; font-weight: 600; color: var(--navy); line-height: 1.4; }
.bub.bad { background: #FFE3E3 !important; }
.hint-line { margin: 10px 2px 0; font-size: 14px; font-weight: 700; color: #3A2A1A; }
.qkwb { margin-top: 14px; box-shadow: 3px 3px 0 #111; }
.qkwb .bqp { margin-bottom: 10px; }
.bball.good { box-shadow: 0 0 0 4px var(--good), 0 5px 0 #3A2A1A; }
.bball[disabled] { cursor: default; }
.drill .lvl { display: block; font-size: 11.5px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: #B5532A; margin-bottom: 4px; }
.layout { display: grid; gap: 2px; margin-top: 6px; }
.layout .m { font-size: 19px; }
.wrapm .m { white-space: normal; }
.bq2 { margin-top: 12px; padding-top: 12px; border-top: 2px dashed var(--line); display: grid; gap: 8px; }
.rule { max-width: 100%; }
.rules2 { margin: 0 0 12px; padding: 0; list-style: none; display: grid; gap: 4px; }
.rules2 li { font-family: var(--serif); font-size: clamp(19px, 2.6vw, 26px); font-weight: 600; letter-spacing: -.015em; line-height: 1.25; }
@media (max-width: 760px) { .beat.has-scale { grid-template-columns: minmax(0, 1fr); } }
/* Mia: every beat is a page of her whiteboard */
body[data-theme="court"] .beat { background-color: #FFFFFE; background-image: radial-gradient(#DCDCD6 1px, transparent 1.3px); background-size: 18px 18px; }
body[data-theme="court"] .bl { font-family: var(--hand); }
body[data-theme="court"] .bcap { background: var(--orange); }
body[data-theme="court"] .bal { box-shadow: 5px 5px 0 #3A2A1A; }
/* Jack: every beat is a comic panel */
body[data-theme="comic"] .beat { border: 3px solid var(--navy); border-radius: 8px; background: var(--peach); box-shadow: none; }
body[data-theme="comic"] .beat.alt { background: var(--sky); }
body[data-theme="comic"] .bcap { background: var(--capt); color: var(--navy); border: 2px solid var(--navy); border-radius: 3px; padding: 7px 10px; font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none; }
body[data-theme="comic"] .bl { color: var(--navy); }
body[data-theme="comic"] .bqp { color: var(--navy); }
body[data-theme="comic"] .brule { background: #fff; border-color: var(--navy); color: var(--navy); font-weight: 700; }
/* Ruby: lab cards on the oval */
body[data-theme="lab"] .beat { box-shadow: 6px 6px 0 #1F5435; border-radius: 22px; }
body[data-theme="lab"] .bcap { background: #1F5435; }

/* ── the error clinic: tap the line with the illegal move ──────────── */
.flines { display: grid; gap: 8px; }
.fline { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--ink); background: var(--paper); box-shadow: var(--sticker); }
.fline .m { font-size: 24px; }
.fline.wrong { animation: shake .4s ease; background: #F1F1EE; }
.fline.foul { border-color: var(--bad); background: var(--bad-wash); box-shadow: 0 3px 0 var(--bad); }
.fline[disabled] { cursor: default; }
.whistle { flex: none; font: 900 12px/1 var(--sans); letter-spacing: .12em; padding: 6px 10px; border-radius: 8px; background: var(--ink); color: #FFD23F; transform: rotate(-4deg); animation: sfx .45s cubic-bezier(.2,1.8,.4,1) both; }
body[data-theme="comic"] .fline { border: 3px solid var(--navy); box-shadow: 3px 3px 0 var(--navy); }
.contrast { margin-top: 14px; padding-top: 12px; border-top: 2px dashed var(--line); display: grid; gap: 10px; }

/* ── the sum-up ────────────────────────────────────────────────────── */
.takes { margin: 0; padding-left: 24px; display: grid; gap: 8px; font-size: 17px; line-height: 1.4; font-weight: 600; }
.takes li { animation: pop .4s ease both; }
body[data-theme="court"] .takes { font-family: var(--hand); font-size: 23px; font-weight: 400; }
body[data-theme="comic"] .takes { color: var(--navy); }
.picked { outline: 3px solid var(--gold); outline-offset: 2px; }
.bqp.nxt { font-weight: 600; }
/* inline maths inside sentences on the whiteboard stays at text size */
.wb .say .m, .wb .bqp .m, .wb .fb .m { font-size: 1.12em; }
.excard small .m { font-size: 1.15em; }
/* a move that is allowed but not the best: an amber nudge, not a red cross */
.opt.meh, .cbtn.meh { background: #FFF1CC; border-color: #B7801A; box-shadow: 0 3px 0 #B7801A; animation: shake .4s ease; }
.cbtn.meh { box-shadow: 3px 3px 0 #B7801A; }
.fb.meh { background: #FFF6DC; border: 1.5px solid #B7801A; }
.bub.meh { background: #FFF6DC !important; border-color: #B7801A !important; }
