/* DL Lab: white + lavender + orange, sticker-style UI */
:root {
  --bg: #fffdfb;
  --panel: #ffffff;
  --panel-2: #f6f2ff;
  --ink: #1e1533;
  --text: #1e1533;
  --muted: #6e6688;
  --line: #e6def9;
  --lav: #b9a6ff;
  --lav-deep: #7c5cf5;
  --lav-soft: #f1ecff;
  --orange: #ff7a1a;
  --orange-deep: #f05f00;
  --orange-soft: #fff1e5;
  --ok: #12b76a;
  --ok-bg: #e5f8ee;
  --bad: #f0445f;
  --bad-bg: #ffecef;
  --warn: #ff7a1a;
  --radius: 18px;
  --shadow: 3px 3px 0 var(--ink);
  --shadow-lg: 5px 5px 0 var(--ink);
  --display: "Bricolage Grotesque", "Space Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.55 "Space Grotesk", system-ui, -apple-system, Segoe UI, sans-serif;
  background-image:
    radial-gradient(600px 300px at 0% 0%, rgba(185, 166, 255, .22), transparent 70%),
    radial-gradient(500px 280px at 100% 100%, rgba(255, 122, 26, .12), transparent 70%);
  background-attachment: fixed;
}
a { color: var(--lav-deep); font-weight: 600; }
h1, h2, h3, .brand { font-family: var(--display); }
code { font-family: var(--mono); font-size: .88em; background: var(--lav-soft); color: #5a3fd6; padding: 1px 6px; border-radius: 6px; }
::selection { background: var(--lav); }

button {
  font: 600 14px "Space Grotesk", system-ui, sans-serif; cursor: pointer; color: var(--ink);
  border: 2px solid var(--ink); background: #fff; padding: 7px 14px; border-radius: 999px;
  box-shadow: 2px 2px 0 var(--ink); transition: transform .08s, box-shadow .08s, background .15s;
}
button:hover { background: var(--lav-soft); transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
button:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
button.primary { background: var(--orange); color: #fff; }
button.primary:hover { background: var(--orange-deep); }
button.danger { color: var(--bad); }
button.small { padding: 4px 11px; font-size: 13px; }
input {
  font: inherit; width: 100%; padding: 11px 14px; border-radius: 14px; border: 2px solid var(--ink);
  background: #fff; color: var(--text); box-shadow: 2px 2px 0 var(--ink);
}
input:focus { outline: none; border-color: var(--lav-deep); box-shadow: 3px 3px 0 var(--lav-deep); }
.muted { color: var(--muted); }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px;
  background: #fff; border: 2px solid var(--ink); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.pill.ok { background: var(--ok-bg); color: #0a7a46; }
.pill.live { background: var(--orange-soft); color: var(--orange-deep); border-color: var(--orange); }
.pill.score { background: var(--lav); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #cfc8e2; display: inline-block; flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(18, 183, 106, .2); }
.live .dot, .dot.live { background: var(--orange); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- top bar */
.topbar {
  height: 62px; display: flex; align-items: center; gap: 12px; padding: 0 18px;
  border-bottom: 2px solid var(--ink); background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 800; letter-spacing: -.03em; font-size: 20px; display: flex; align-items: center; gap: 9px; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 11px; background: var(--lav); border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink); display: grid; place-items: center; font-size: 17px; transform: rotate(-6deg);
}
.brand .tag { background: var(--orange); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 99px; border: 2px solid var(--ink); transform: rotate(3deg); }
.topbar .spacer { flex: 1; }

/* ---------- auth page */
.auth-wrap { min-height: 100%; display: grid; place-items: center; padding: 28px 16px; position: relative; overflow: hidden; }
.auth-card {
  width: 100%; max-width: 440px; background: #fff; border: 2px solid var(--ink); border-radius: 26px;
  padding: 30px; box-shadow: 8px 8px 0 var(--ink); position: relative; z-index: 1;
}
.auth-card h1 { margin: 14px 0 6px; font-size: 34px; line-height: 1.05; letter-spacing: -.04em; }
.auth-card h1 .hl { background: var(--orange); color: #fff; padding: 0 8px; border-radius: 10px; display: inline-block; transform: rotate(-2deg); }
.sticker {
  position: absolute; font-family: var(--display); font-weight: 800; border: 2px solid var(--ink); border-radius: 999px;
  padding: 8px 16px; box-shadow: var(--shadow); font-size: 15px; white-space: nowrap;
}
.tabs { display: flex; gap: 6px; background: var(--lav-soft); padding: 5px; border-radius: 999px; margin: 22px 0 16px; border: 2px solid var(--ink); }
.tabs button { flex: 1; border: 0; background: transparent; box-shadow: none; }
.tabs button:hover { transform: none; box-shadow: none; }
.tabs button.active { background: #fff; border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.error-text { color: var(--bad); min-height: 20px; font-size: 13.5px; font-weight: 600; }

/* ---------- learn layout */
.learn { display: grid; grid-template-columns: 280px minmax(0, 1fr) 290px; height: calc(100% - 62px); }
.sidebar, .rightbar { overflow-y: auto; padding: 16px 14px; }
.sidebar { border-right: 2px solid var(--ink); background: rgba(246, 242, 255, .7); }
.rightbar { border-left: 2px solid var(--ink); background: rgba(255, 241, 229, .55); }
.main { overflow-y: auto; padding: 22px 26px 48px; }
.module-title { font-family: var(--display); font-size: 13px; font-weight: 800; color: var(--lav-deep); margin: 18px 6px 6px; letter-spacing: -.01em; }
.module-title:first-child { margin-top: 2px; }
.step-link {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 2px solid transparent;
  background: transparent; box-shadow: none; padding: 7px 10px; border-radius: 14px; font-weight: 500;
}
.step-link:hover { background: #fff; border-color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.step-link.active { background: #fff; border-color: var(--ink); box-shadow: 3px 3px 0 var(--lav-deep); font-weight: 700; }
.step-link.locked { color: #a8a0bd; }
.step-link .status { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; flex: none; border: 2px solid var(--ink); background: #fff; }
.step-link.locked .status { border-color: #cfc8e2; background: transparent; }
.step-link.passed .status { background: var(--ok); color: #fff; }
.step-link .here { margin-left: auto; font-size: 10.5px; font-weight: 800; color: #fff; background: var(--orange); padding: 1px 7px; border-radius: 99px; }
.card { background: #fff; border: 2px solid var(--ink); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.explain h2 { margin: 2px 0 10px; font-size: 26px; letter-spacing: -.03em; line-height: 1.15; }
.explain p, .explain li { color: #3b3252; }
.explain .eq {
  font-family: var(--mono); font-size: 13.5px; background: var(--lav-soft); border: 2px dashed var(--lav);
  border-radius: 14px; padding: 12px 16px; color: var(--ink); line-height: 1.85;
}
.kicker { display: inline-block; font-size: 12px; font-weight: 700; background: var(--lav-soft); color: var(--lav-deep); border: 2px solid var(--lav); padding: 1px 10px; border-radius: 99px; }
.banner {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 16px; margin-bottom: 16px;
  background: var(--orange-soft); border: 2px solid var(--orange); font-weight: 600;
}
.editor-tabs { display: flex; align-items: center; gap: 8px; margin: 20px 0 10px; flex-wrap: wrap; }
.editor-tabs .tab { background: #fff; box-shadow: none; }
.editor-tabs .tab.active { background: var(--lav); box-shadow: 2px 2px 0 var(--ink); }
.editor-box { border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); background: #fff; }

/* CodeMirror: light lavender theme */
.CodeMirror { height: auto; min-height: 260px; font-family: var(--mono); font-size: 13.5px; line-height: 1.6; background: #fff; color: var(--ink); }
.CodeMirror-scroll { min-height: 260px; max-height: 62vh; }
.CodeMirror-gutters { background: var(--lav-soft); border-right: 2px solid var(--line); }
.CodeMirror-linenumber { color: #a99ccc; }
.CodeMirror-cursor { border-left: 2px solid var(--orange); }
.CodeMirror-selected, .CodeMirror-focused .CodeMirror-selected { background: #e4dcff !important; }
.CodeMirror-matchingbracket { color: var(--orange-deep) !important; font-weight: 700; }
.cm-s-default .cm-keyword { color: #7c3aed; font-weight: 600; }
.cm-s-default .cm-def { color: #ea580c; font-weight: 600; }
.cm-s-default .cm-builtin { color: #0e7490; }
.cm-s-default .cm-string { color: #15803d; }
.cm-s-default .cm-number { color: #db2777; }
.cm-s-default .cm-comment { color: #9a8fb8; font-style: italic; }
.cm-s-default .cm-variable-2, .cm-s-default .cm-property { color: #4338ca; }
.cm-s-default .cm-operator { color: #6d28d9; }
.todo-line { background: #fff3e6; }

.toolbar { display: flex; gap: 10px; align-items: center; margin: 14px 0; flex-wrap: wrap; }
.toolbar .primary { font-size: 15px; padding: 9px 20px; }
.kbd { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.output { margin-top: 12px; display: grid; gap: 12px; }
.console {
  font-family: var(--mono); font-size: 12.8px; white-space: pre-wrap; background: #faf8ff; border: 2px solid var(--ink);
  border-radius: 14px; padding: 12px 16px; max-height: 320px; overflow: auto; margin: 0;
}
.console.err { background: var(--bad-bg); border-color: var(--bad); color: #a3162f; }
.checks { display: grid; gap: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 9px 14px; border-radius: 14px; border: 2px solid var(--ink); background: #fff; }
.check.ok { background: var(--ok-bg); }
.check.bad { background: var(--bad-bg); }
.check pre { margin: 4px 0 0; font-family: var(--mono); font-size: 12px; white-space: pre-wrap; color: #a3162f; }
.result-banner { padding: 13px 18px; border-radius: 16px; font-family: var(--display); font-weight: 800; font-size: 18px; border: 2px solid var(--ink); box-shadow: var(--shadow); }
.result-banner.ok { background: var(--ok); color: #fff; }
.result-banner.bad { background: var(--orange-soft); color: var(--orange-deep); }
.locked-msg { text-align: center; padding: 70px 20px; color: var(--muted); }
.locked-msg .big { font-size: 56px; display: inline-block; animation: wiggle 2.5s ease-in-out infinite; }
.locked-msg h2 { color: var(--ink); font-size: 28px; letter-spacing: -.03em; }
@keyframes wiggle { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }

/* ---------- leaderboard */
.lb-title { display: flex; align-items: center; justify-content: space-between; margin: 2px 4px 12px; font-family: var(--display); font-weight: 800; font-size: 17px; }
.lb-title .muted { font-family: "Space Grotesk", sans-serif; font-size: 12.5px; font-weight: 600; }
.lb-row { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 14px; border: 2px solid transparent; }
.lb-row.me { background: #fff; border-color: var(--ink); box-shadow: 2px 2px 0 var(--lav-deep); }
.lb-rank { font-family: var(--display); font-weight: 800; color: var(--muted); text-align: center; }
.lb-row:nth-child(1) .lb-rank, .lb-row:nth-child(2) .lb-rank, .lb-row:nth-child(3) .lb-rank { font-size: 18px; }
.lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 7px; font-weight: 600; }
.lb-pts { font-family: var(--mono); font-weight: 700; color: var(--orange-deep); }

/* ---------- instructor */
.instr { display: grid; grid-template-columns: 310px minmax(0, 1fr); height: calc(100% - 62px); }
.step-row { display: grid; grid-template-columns: auto 1fr auto; gap: 9px; align-items: center; padding: 7px 9px; border-radius: 14px; border: 2px solid transparent; cursor: pointer; }
.step-row:hover { background: #fff; border-color: var(--line); }
.step-row.active { background: #fff; border-color: var(--ink); box-shadow: 3px 3px 0 var(--lav-deep); }
.step-row .count { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--muted); }
.switch { position: relative; width: 40px; height: 24px; border-radius: 99px; background: #e7e1f6; border: 2px solid var(--ink); padding: 0; flex: none; box-shadow: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); transition: left .15s; box-sizing: border-box; }
.switch.on { background: var(--orange); }
.switch.on::after { left: 18px; }
.switch:hover { transform: none; box-shadow: none; background: #ddd4f4; }
.switch.on:hover { background: var(--orange-deep); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.matrix-wrap { overflow: auto; max-height: 70vh; border: 2px solid var(--ink); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
table.matrix { border-collapse: collapse; width: 100%; font-size: 13px; }
.matrix th, .matrix td { padding: 7px 8px; border-bottom: 1.5px solid var(--line); text-align: center; white-space: nowrap; }
.matrix th { position: sticky; top: 0; background: var(--lav-soft); z-index: 1; font-weight: 700; }
.matrix td.name { text-align: left; position: sticky; left: 0; background: #fff; font-weight: 600; }
.matrix th.name { left: 0; z-index: 2; text-align: left; }
.cell { display: inline-grid; place-items: center; min-width: 28px; height: 24px; border-radius: 8px; font-family: var(--mono); font-size: 12px; font-weight: 700; }
.cell.ok { background: var(--ok); color: #fff; border: 2px solid var(--ink); }
.cell.try { background: var(--orange-soft); color: var(--orange-deep); border: 2px solid var(--orange); }
.cell.none { color: #d3cce6; }
.stat { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.stat .card { padding: 10px 18px; min-width: 130px; }
.stat .card:nth-child(odd) { background: var(--lav-soft); }
.stat .card:nth-child(even) { background: var(--orange-soft); }
.stat .num { font-family: var(--display); font-size: 28px; font-weight: 800; line-height: 1.1; }
.code-big { font-family: var(--mono); font-weight: 800; letter-spacing: .08em; color: var(--orange-deep); }

/* ---------- projector board */
.board { padding: 30px 38px; max-width: 1400px; margin: 0 auto; }
.board h1 { font-size: 52px; margin: 6px 0 0; letter-spacing: -.045em; line-height: 1; }
.board h1 .hl { background: var(--lav); padding: 0 12px; border-radius: 16px; border: 2px solid var(--ink); display: inline-block; transform: rotate(-1.5deg); box-shadow: var(--shadow); }
.board-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 30px; margin-top: 30px; }
.big-row {
  display: grid; grid-template-columns: 60px 1fr 120px; align-items: center; gap: 14px; padding: 12px 18px;
  border-radius: 20px; font-size: 21px; border: 2px solid var(--ink); background: #fff; margin-bottom: 10px; box-shadow: var(--shadow);
}
.big-row:nth-child(1) { background: var(--orange); color: #fff; box-shadow: var(--shadow-lg); }
.big-row:nth-child(1) .muted { color: #fff; opacity: .85; }
.big-row:nth-child(2) { background: var(--lav); }
.big-row:nth-child(3) { background: var(--lav-soft); }
.big-row .bar { height: 9px; border-radius: 99px; background: var(--ink); opacity: .85; margin-top: 7px; transition: width .6s; }
.big-row .rank { font-family: var(--display); font-size: 30px; font-weight: 800; text-align: center; }
.big-row .pts { text-align: right; font-family: var(--mono); font-weight: 800; }
.step-progress { display: grid; grid-template-columns: 1fr 70px; gap: 5px 10px; align-items: center; margin-bottom: 12px; font-weight: 600; }
.step-progress .track { grid-column: 1 / -1; height: 14px; background: #fff; border: 2px solid var(--ink); border-radius: 99px; overflow: hidden; }
.step-progress .fill { height: 100%; background: linear-gradient(90deg, var(--lav), var(--orange)); transition: width .6s; }
.step-progress.locked { opacity: .4; }

/* ---------- toast + confetti */
#toasts { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 10px; z-index: 100; }
.toast { background: #fff; border: 2px solid var(--ink); padding: 11px 16px; border-radius: 16px; box-shadow: var(--shadow); animation: pop .3s cubic-bezier(.2, 1.6, .5, 1); max-width: 340px; font-weight: 600; }
.toast.ok { background: var(--ok-bg); }
.toast.bad { background: var(--bad-bg); }
@keyframes pop { from { transform: scale(.85) translateY(10px); opacity: 0; } }
.confetti { position: fixed; top: -12px; width: 10px; height: 15px; z-index: 99; pointer-events: none; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); } }

@media (max-width: 1100px) {
  .learn { grid-template-columns: 240px minmax(0, 1fr); }
  .rightbar { display: none; }
  .grid2, .board-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .learn, .instr { grid-template-columns: 1fr; height: auto; }
  .sidebar { border-right: 0; border-bottom: 2px solid var(--ink); max-height: 260px; }
  .main { padding: 16px 16px 40px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .hide-sm, .sticker { display: none; }
  .auth-card { box-shadow: 5px 5px 0 var(--ink); padding: 24px 20px; }
  .auth-card h1 { font-size: 28px; }
  .board { padding: 18px 16px; }
  .board h1 { font-size: 36px; }
}

/* ---------- lesson layout: text + video side by side */
.lesson { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 18px; align-items: start; }
.video-card { padding: 14px; }
.video-head { display: flex; align-items: center; gap: 8px; margin: 0 2px 10px; font-family: var(--display); font-weight: 800; font-size: 17px; }
.video-head .muted { font-family: "Space Grotesk", sans-serif; font-size: 12.5px; font-weight: 600; margin-left: auto; }
@media (max-width: 1350px) { .lesson { grid-template-columns: 1fr; } }

/* ---------- video player */
.vp { outline: none; }
.vp-screen {
  position: relative; aspect-ratio: 4 / 3; border: 2px solid var(--ink); border-radius: 16px; overflow: hidden;
  background: linear-gradient(160deg, #f6f2ff 0%, #ffffff 55%, #fff4ea 100%);
  display: grid; grid-template-rows: minmax(140px, 1fr) auto;
}
.vp:fullscreen { background: #fff; padding: 24px; display: grid; grid-template-rows: 1fr auto auto auto; gap: 10px; }
.vp:fullscreen .vp-screen { aspect-ratio: auto; height: 100%; font-size: 1.25em; }
.vp-stage { display: grid; place-items: center; padding: 10px 14px 4px; overflow: auto; min-height: 0; }
.vp-stage.full { grid-row: 1 / 3; }
.vp-code { margin: 0 10px 10px; border: 2px solid var(--ink); border-radius: 12px; background: #fff; overflow: hidden; box-shadow: 2px 2px 0 var(--ink); }
.vp-code pre { margin: 0; padding: 4px 0; font: 11.5px/1.55 var(--mono); max-height: 100px; overflow: auto; }
.vp-line { display: flex; white-space: pre; padding-right: 10px; opacity: .45; transition: opacity .3s; }
.vp-line.hl { opacity: 1; background: var(--orange-soft); box-shadow: inset 3px 0 0 var(--orange); font-weight: 600; }
.vp-ln { width: 34px; text-align: right; padding-right: 10px; color: #a99ccc; flex: none; user-select: none; }
.vp-line.hl .vp-src::after { content: ""; }
.vp-caption { padding: 8px 0 0; min-height: 52px; display: flex; align-items: center; justify-content: center; text-align: center; }
.vp-caption span {
  background: var(--ink); color: #fff; padding: 7px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.45; width: 100%;
  animation: vin .4s ease-out both; max-width: 100%;
}
.vp-big {
  position: absolute; inset: 0; margin: auto; width: 78px; height: 78px; border-radius: 50%; font-size: 30px; padding: 0 0 0 4px;
  background: var(--orange); color: #fff; box-shadow: 4px 4px 0 var(--ink); z-index: 2;
}
.vp-big[hidden] { display: none; }
.vp-progress { display: flex; gap: 4px; margin: 10px 2px 6px; }
.vp-seg { flex: 1; height: 9px; padding: 0; border-radius: 99px; background: #ece6fb; border: 1.5px solid var(--ink); box-shadow: none; overflow: hidden; position: relative; }
.vp-seg:hover { transform: none; box-shadow: none; background: #e0d7fa; }
.vp-seg.locked { background: repeating-linear-gradient(45deg, #ece6fb 0 4px, #ddd3f7 4px 8px); }
.vp-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--orange); }
.vp-seg.done .vp-fill { width: 100%; }
.vp-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vp-btn { padding: 3px 10px; font-size: 13px; box-shadow: 1.5px 1.5px 0 var(--ink); }
.vp-play { background: var(--lav); min-width: 40px; }
.vp-voice.on { background: var(--orange-soft); border-color: var(--orange); }
.vp-count { font: 600 12px var(--mono); color: var(--muted); margin-left: 4px; }

/* stage visuals; every element animates in using its --d delay */
@keyframes vin { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes vpop { 0% { opacity: 0; transform: scale(.6); } 70% { transform: scale(1.08); } }
@keyframes vhl { to { background: var(--orange); color: #fff; border-color: var(--ink); box-shadow: 2px 2px 0 var(--ink); } }
@keyframes vgrow { from { width: 0; } }
@keyframes vbob { 50% { transform: translateY(-8px) rotate(-4deg); } }
.vs-title { text-align: center; animation: vin .5s ease-out both; }
.vs-emoji { font-size: 58px; display: inline-block; animation: vbob 2.2s ease-in-out infinite; }
.vs-big { font-family: var(--display); font-weight: 800; font-size: 30px; letter-spacing: -.03em; line-height: 1.1; margin-top: 6px; }
.vs-sub { display: inline-block; margin-top: 10px; background: var(--lav); border: 2px solid var(--ink); border-radius: 99px; padding: 3px 14px; font-weight: 600; font-size: 14px; transform: rotate(-1.5deg); }
.vs-flow { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.vs-node, .vs-arrow { animation: vpop .45s ease-out both; animation-delay: var(--d); }
.vs-node { background: #fff; border: 2px solid var(--ink); border-radius: 12px; padding: 8px 12px; font: 700 14px var(--mono); box-shadow: 2px 2px 0 var(--ink); }
.vs-node:nth-of-type(4n+2) { background: var(--lav); }
.vs-arrow { font-size: 22px; font-weight: 800; color: var(--orange-deep); }
.vs-eq { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px; font: 600 17px/1.9 var(--mono); }
.vs-part { animation: vin .35s ease-out both; animation-delay: var(--d); white-space: pre; padding: 0 3px; border-radius: 8px; border: 2px solid transparent; }
.vs-part.hl { animation: vin .35s ease-out var(--d) both, vhl .4s ease-out var(--h) forwards; }
.vs-shapes, .vs-bullets, .vs-cells, .vs-bars { display: grid; gap: 9px; width: 100%; max-width: 520px; }
.vs-shape, .vs-bullet, .vs-cellrow, .vs-barrow, .vs-heat tr { animation: vin .4s ease-out both; animation-delay: var(--d); }
.vs-shape { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vs-shape code { font-size: 13.5px; background: #fff; border: 2px solid var(--ink); padding: 3px 9px; border-radius: 9px; color: var(--ink); }
.vs-to { font-weight: 800; color: var(--orange-deep); }
.vs-chip { background: var(--lav-soft); border: 2px dashed var(--lav-deep); border-radius: 9px; padding: 2px 9px; font: 600 13px var(--mono); }
.vs-bullet { background: #fff; border: 2px solid var(--ink); border-radius: 12px; padding: 8px 12px; font-weight: 600; box-shadow: 2px 2px 0 var(--ink); }
.vs-cellrow { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.vs-rl { width: 64px; font: 700 12.5px var(--mono); }
.vs-cell { min-width: 44px; text-align: center; border: 1.5px solid var(--ink); border-radius: 7px; padding: 3px 4px; font: 600 11.5px var(--mono); }
.vs-note { font: 600 11.5px var(--mono); color: var(--muted); text-align: right; }
.vs-barrow { display: grid; grid-template-columns: minmax(80px, 30%) 1fr auto; gap: 8px; align-items: center; }
.vs-bl { font: 600 12.5px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-track { height: 16px; background: #fff; border: 1.5px solid var(--ink); border-radius: 99px; overflow: hidden; }
.vs-bar { display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, var(--lav), var(--orange)); animation: vgrow .9s ease-out both; animation-delay: calc(var(--d) + .2s); }
.vs-bar.neg { background: var(--lav-deep); }
.vs-bv { font: 700 12.5px var(--mono); min-width: 60px; text-align: right; }
.vs-heat { border-collapse: separate; border-spacing: 3px; font: 600 11.5px var(--mono); }
.vs-heat th { font-weight: 700; color: var(--muted); padding: 0 4px; }
.vs-heat td { min-width: 34px; height: 26px; text-align: center; border: 1.5px solid var(--ink); border-radius: 6px; }
.vp-stage.locked { filter: saturate(.6); }
@media (max-width: 760px) {
  .vp-screen { aspect-ratio: 4 / 5; }
  .vs-big { font-size: 24px; }
  .vs-eq { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .vp *, .vs-emoji { animation-duration: .01s !important; animation-delay: 0s !important; }
}

/* ---------- Colab challenges */
.ch-hero { display: flex; gap: 18px; align-items: center; background: linear-gradient(120deg, var(--lav-soft), #fff 60%, var(--orange-soft)); }
.ch-hero h2 { margin: 6px 0 4px; font-size: 28px; letter-spacing: -.03em; }
.ch-hero p { margin: 0 0 8px; color: #3b3252; }
.ch-emoji { font-size: 64px; transform: rotate(-6deg); flex: none; }
.ch-step { display: grid; grid-template-columns: 44px 1fr; gap: 12px; margin-top: 18px; }
.ch-num { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font: 800 18px var(--display);
  background: var(--orange); color: #fff; border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.ch-body h3 { margin: 6px 0 10px; font-family: var(--display); font-size: 18px; }
.ch-body p { margin: 6px 0; }
.ds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.ds-card { display: grid; gap: 4px; text-align: left; border-radius: 16px; padding: 12px 14px; background: #fff; font-weight: 500; }
.ds-card .ds-emoji { font-size: 26px; }
.ds-card .muted { font-size: 12.5px; line-height: 1.4; }
.ds-card.active { background: var(--lav); box-shadow: 3px 3px 0 var(--ink); }
.ch-snippet { user-select: all; }
.ch-h { font-family: var(--display); margin: 28px 0 10px; font-size: 20px; }
.sub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.sub-card { background: #fff; border: 2px solid var(--ink); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.sub-card.starred { box-shadow: 4px 4px 0 var(--orange); border-color: var(--orange-deep); }
.sub-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #faf8ff; display: block; border-bottom: 2px solid var(--line); }
.sub-noimg { aspect-ratio: 4 / 3; display: grid; place-items: center; color: var(--muted); background: #faf8ff; }
.sub-meta { padding: 9px 12px; display: grid; gap: 4px; font-size: 13px; }
.sub-name { font-weight: 700; }
.sub-notes { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-actions { display: flex; gap: 6px; margin-top: 4px; }
.ch-admin { display: grid; gap: 10px; margin-bottom: 16px; }
.ch-admin-row { display: grid; grid-template-columns: auto auto 1fr auto auto; gap: 12px; align-items: center; padding: 10px 14px; }
.ch-emoji-sm { font-size: 28px; }
.fame { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
@media (max-width: 760px) { .ch-admin-row { grid-template-columns: auto 1fr; } .ch-emoji { font-size: 44px; } }
