/* Game Quest — CIY.Club "space academy" theme with a retro arcade touch (Bit purple) */
:root {
  --bg: #060A18;
  --bg-2: #0A1024;
  --panel: rgba(16, 24, 50, 0.78);
  --panel-solid: #101832;
  --panel-2: rgba(36, 50, 92, 0.55);
  --line: rgba(120, 160, 255, 0.16);
  --line-strong: rgba(120, 160, 255, 0.3);
  --text: #EAF0FF;
  --muted: #9AA8CF;
  --green: #2FD27A;
  --green-d: #1FB466;
  --cyan: #38D9F5;
  --violet: #8B7BFF;
  --yellow: #FFD84D;
  --blue: #4DABF7;
  --red: #FF6B81;
  --amber: #FFA94D;
  --radius: 18px;
  --display: "Chakra Petch", "Nunito", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Fira Code", Consolas, monospace;
  --glow-green: 0 0 0 1px rgba(47, 210, 122, .5), 0 8px 28px rgba(47, 210, 122, .28);
  --glow-cyan: 0 0 0 1px rgba(56, 217, 245, .55), 0 6px 22px rgba(56, 217, 245, .25);
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; color: var(--text); font: 16px/1.55 "Nunito", "Segoe UI", system-ui, sans-serif; min-height: 100vh;
  background:
    radial-gradient(1000px 600px at 12% -10%, rgba(91, 75, 219, 0.28), transparent 60%),
    radial-gradient(900px 600px at 105% 110%, rgba(155, 107, 255, 0.18), transparent 60%),
    linear-gradient(rgba(120, 150, 255, 0.045) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(120, 150, 255, 0.045) 1px, transparent 1px) 0 0 / 44px 44px,
    var(--bg);
  background-attachment: fixed;
}
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: .01em; }
a { color: var(--cyan); }
.ic { display: inline-block; vertical-align: -0.18em; flex: none; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 12px; padding: 10px 16px; background: var(--panel-2); color: var(--text);
  display: inline-flex; align-items: center; gap: 7px; transition: transform .12s, box-shadow .2s, filter .2s; }
button:hover { filter: brightness(1.15); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; filter: none; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
button.primary { background: linear-gradient(135deg, #3BE38A, #1FC2A7); color: #03261A; font-weight: 800; box-shadow: var(--glow-green); }
button.yellow { background: linear-gradient(135deg, #FFE27A, #FFC21F); color: #3A2C00; font-weight: 800; }
button.ghost { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line-strong); }
button.small { padding: 6px 11px; font-size: 14px; }
input, select, textarea { font: inherit; color: var(--text); background: rgba(4, 8, 20, 0.7); border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 12px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--cyan); border-color: transparent; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 22px 18px 40px; }

/* top bar */
.topbar { display: flex; align-items: center; gap: 14px; padding: 12px 22px; position: sticky; top: 0; z-index: 5;
  background: rgba(6, 10, 24, 0.82); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(56, 217, 245, 0.08), 0 10px 30px rgba(0, 0, 0, 0.25); }
.brand { display: flex; align-items: center; gap: 10px; font: 700 21px var(--display); letter-spacing: .02em; }
.brand small { display: block; font: 700 10px var(--mono); letter-spacing: .28em; color: var(--cyan); }
#logo .monty { width: 46px; height: 46px; }
.topbar .spacer { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 13px; font-size: 14px; font-weight: 700; white-space: nowrap; }
.chip-star .ic { color: var(--yellow); filter: drop-shadow(0 0 6px rgba(255, 216, 77, .5)); }
a.chip { color: var(--text); text-decoration: none; }
a.chip:hover { border-color: var(--cyan); box-shadow: var(--glow-cyan); }
#brand { cursor: pointer; }

/* cards and shared bits */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; backdrop-filter: blur(6px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05); }
.form { display: grid; gap: 12px; }
.form label { font-weight: 700; font-size: 14px; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.err { color: var(--red); min-height: 1.4em; font-weight: 700; }
.kicker { font: 700 12px var(--mono); letter-spacing: .22em; text-transform: uppercase; color: var(--cyan); }
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; }
.features div { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 14px; color: var(--muted); }
.features b { display: block; color: var(--text); font-family: var(--display); font-size: 16px; }
.okc { color: var(--green); } .noc { color: var(--red); }
.st-y .ic { color: var(--yellow); } .st-g .ic { color: var(--green); } .st-c .ic { color: var(--cyan); }

/* stars */
.stars { display: inline-flex; gap: 2px; align-items: center; vertical-align: middle; }
.stars .st.on { color: var(--yellow); filter: drop-shadow(0 0 4px rgba(255, 216, 77, .45)); }
.stars .st.off { color: #263255; }

/* quest map */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tab { padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.03); color: var(--muted); font: 700 14px var(--display); letter-spacing: .04em; }
.tab.on { background: rgba(56, 217, 245, 0.16); color: #DFFAFF; border-color: var(--cyan); box-shadow: var(--glow-cyan); }
.tab.locked { opacity: .45; }
.levels .tab.on { background: rgba(255, 216, 77, 0.14); color: #FFF3C2; border-color: var(--yellow); box-shadow: 0 0 0 1px rgba(255, 216, 77, .5), 0 6px 22px rgba(255, 216, 77, .18); }
.mapgrid { display: grid; grid-template-columns: 1fr 310px; gap: 18px; }
.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr 170px; gap: 10px; align-items: center;
  background: linear-gradient(135deg, rgba(43, 35, 112, 0.65), rgba(16, 24, 50, 0.85) 60%); border: 1px solid var(--line-strong); border-radius: 22px; padding: 26px; }
.hero::after { content: ""; position: absolute; inset: auto -60px -80px auto; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(47, 210, 122, .22), transparent 70%); pointer-events: none; }
.hero h2 { margin: 6px 0; font-size: 34px; line-height: 1.1; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 16px; }
.tag { font: 600 12px var(--mono); border: 1px solid var(--line-strong); background: rgba(139, 123, 255, 0.12); border-radius: 8px; padding: 3px 9px; color: #CFC8FF; }
.lessons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 16px; }
.lesson-card { display: flex; gap: 14px; align-items: center; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; width: 100%; }
.lesson-card:hover:not(:disabled) { border-color: var(--line-strong); filter: none; background: rgba(24, 36, 72, 0.85); }
.lesson-card .ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex: none; color: #fff;
  background: linear-gradient(135deg, #4DABF7, #3B5BDB); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 6px 16px rgba(0, 0, 0, .3); }
.ico.t-bigidea { background: linear-gradient(135deg, #FFC24D, #F08C00); }
.ico.t-tutorial { background: linear-gradient(135deg, #4DD4F7, #1C7ED6); }
.ico.t-drill { background: linear-gradient(135deg, #A78BFA, #6741D9); }
.ico.t-debug { background: linear-gradient(135deg, #FF8FA3, #E03159); }
.ico.t-sprint { background: linear-gradient(135deg, #FFA94D, #E8590C); }
.ico.t-project { background: linear-gradient(135deg, #38E0B8, #0CA678); }
.ico.t-check { background: linear-gradient(135deg, #FFE066, #E0A800); color: #3A2C00; }
.ico.t-locked { background: rgba(255, 255, 255, 0.06); color: var(--muted); box-shadow: none; border: 1px solid var(--line); }
.lesson-card .meta { font: 700 10.5px var(--mono); letter-spacing: .18em; color: var(--muted); text-transform: uppercase; }
.lesson-card .t { font: 700 17px var(--display); }
.lesson-card.locked { opacity: .5; }
.lesson-card.next { border-color: var(--green); box-shadow: var(--glow-green); }
.side { display: grid; gap: 12px; align-content: start; }
.side .card { padding: 16px; }
.side h4 { margin: 0 0 8px; font: 700 11px var(--mono); letter-spacing: .22em; color: var(--cyan); text-transform: uppercase; }
.statline { display: flex; gap: 14px; flex-wrap: wrap; font-weight: 700; }
.badges { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.badge { aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; color: #56628A; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); }
.badge.on { color: #fff; border: 0; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 0 14px rgba(255, 255, 255, .12); }
.badge.b0 { background: linear-gradient(135deg, #FFC24D, #F08C00); } .badge.b1 { background: linear-gradient(135deg, #FF8FA3, #D6336C); }
.badge.b2 { background: linear-gradient(135deg, #4DD4F7, #1C7ED6); } .badge.b3 { background: linear-gradient(135deg, #A78BFA, #6741D9); }
.badge.b4 { background: linear-gradient(135deg, #38E0B8, #0CA678); } .badge.b5 { background: linear-gradient(135deg, #FFA94D, #E8590C); }
.monty-says { display: flex; gap: 12px; align-items: flex-start; }
.monty-says p { margin: 0; }
.legend { list-style: none; padding: 0 !important; display: grid; gap: 6px; }
.legend li { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }

/* lesson */
.lesson-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.lesson-top h2 { margin: 0; font-size: 24px; }
.split { display: grid; grid-template-columns: 420px 1fr; gap: 16px; min-height: calc(100vh - 160px); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; overflow: auto; backdrop-filter: blur(6px); }
.task-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.task-tabs button { padding: 6px 11px; font: 700 13px var(--display); letter-spacing: .03em; border: 1px solid var(--line); }
.task-tabs button.on { background: rgba(56, 217, 245, 0.18); color: #DFFAFF; border-color: var(--cyan); }
.task-tabs button.done::after { content: " ✓"; color: var(--green); }
.prompt code, .step code, .quiz code { background: rgba(4, 8, 20, 0.8); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-family: var(--mono); font-size: 14px; color: #BFF5D6; }
pre.code { background: rgba(4, 8, 20, 0.85); border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-family: var(--mono); font-size: 14px; overflow: auto; white-space: pre; color: #D6E4FF; }
.editor-wrap { display: grid; grid-template-rows: auto 1fr auto auto; gap: 10px; }
.editor { display: grid; grid-template-columns: 46px 1fr; background: #050916; border: 1px solid var(--line-strong); border-radius: 14px; overflow: hidden; min-height: 300px;
  box-shadow: inset 0 0 0 1px rgba(56, 217, 245, 0.05), 0 10px 30px rgba(0, 0, 0, 0.3); }
.gutter { padding: 12px 8px; text-align: right; color: #3D4C78; font: 15px/1.6 var(--mono); user-select: none; background: #040713; white-space: pre; border-right: 1px solid var(--line); }
.editor textarea { border: 0; border-radius: 0; resize: none; font: 15px/1.6 var(--mono); padding: 12px; background: transparent; white-space: pre; overflow: auto; tab-size: 4; color: #E3ECFF; caret-color: var(--green); }
.editor textarea:focus { outline: none; }
.console { background: #03060F; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font: 14px/1.5 var(--mono); min-height: 110px; max-height: 240px; overflow: auto; white-space: pre-wrap; color: #C9F7DA; }
.console .e { color: var(--red); }
.console .s { color: var(--muted); }
.results { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 6px; }
.results li { padding: 9px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); font-size: 14px; }
.results li.ok .ic { color: var(--green); }
.results li.no .ic { color: var(--red); }
.results li.ok { border-color: rgba(47, 210, 122, 0.35); }
.results li.no { border-color: rgba(255, 107, 129, 0.35); }
.hintbox { background: rgba(255, 216, 77, 0.08); border: 1px solid rgba(255, 216, 77, 0.35); border-radius: 12px; padding: 10px 12px; margin-top: 8px; font-size: 14px; }
.hintbox .ic { color: var(--yellow); }
.reteach { background: rgba(56, 217, 245, 0.08); border: 1px solid rgba(56, 217, 245, 0.3); border-radius: 12px; padding: 10px 12px; margin: 10px 0; font-size: 14px; }
.inputs-box textarea { width: 100%; min-height: 54px; font-family: var(--mono); font-size: 14px; }
.timer { display: inline-flex; align-items: center; gap: 6px; font: 800 22px var(--mono); color: var(--yellow); }

/* steps / quiz */
.steps-nav { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.steps-nav span { font: 700 12px var(--mono); letter-spacing: .06em; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); }
.steps-nav span.on { background: rgba(56, 217, 245, 0.18); color: #DFFAFF; border-color: var(--cyan); }
.step { max-width: 780px; }
.step h3 { font-size: 28px; margin: 4px 0 12px; }
.quiz .q { margin: 14px 0; padding: 16px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); border-radius: 14px; }
.quiz .opts { display: grid; gap: 8px; margin-top: 10px; }
.quiz .opts button { text-align: left; justify-content: flex-start; background: rgba(4, 8, 20, 0.6); border: 1px solid var(--line-strong); }
.quiz .opts button.sel { border-color: var(--cyan); box-shadow: var(--glow-cyan); }
.quiz .opts button.right { border-color: var(--green); background: rgba(47, 210, 122, 0.14); }
.quiz .opts button.wrong { border-color: var(--red); background: rgba(255, 107, 129, 0.12); }
.quiz .explain { font-size: 14px; color: var(--muted); margin-top: 8px; }

/* result */
.result { text-align: center; padding: 34px; }
.result .big-stars { margin: 6px 0 4px; }
.result .big-stars .stars { gap: 8px; }
.result .big-stars .st.on { filter: drop-shadow(0 0 12px rgba(255, 216, 77, .7)); }
.result h2 { font-size: 30px; margin: 8px 0; }
.result .row { justify-content: center; }

/* monty */
.monty { width: 58px; height: 54px; flex: none; }
.monty.big { width: 170px; height: 158px; filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .35)); }

/* coach */
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th, table.grid td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.grid th { color: var(--cyan); font: 700 11px var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.flag { font-size: 12px; padding: 2px 9px; border-radius: 999px; font-weight: 800; }
.flag.live { background: rgba(47, 210, 122, 0.16); color: var(--green); }
.flag.stuck { background: rgba(255, 169, 77, 0.16); color: var(--amber); }
.cell-stars { color: var(--yellow); font-weight: 800; text-align: center !important; }
.cell-stars small { color: var(--muted); font-weight: 600; }
.cell-stars.low { color: var(--red); }
.classes { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.class-card { flex-direction: column; align-items: flex-start; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.class-card:hover { border-color: var(--cyan); box-shadow: var(--glow-cyan); filter: none; }
.class-card .code { font: 800 18px var(--mono); color: var(--yellow); }

/* charts and the Py Quest web browser (Level 4) */
.plots { display: grid; gap: 8px; justify-items: start; }
.plots:empty { display: none; }
.plots img { max-width: 100%; background: #fff; border-radius: 12px; border: 1px solid var(--line); }
.webpanel { display: grid; gap: 6px; border: 1px solid var(--line); border-radius: 14px; padding: 8px; background: var(--panel); }
.webbar { display: flex; gap: 6px; align-items: center; color: var(--cyan); }
.webbar input { flex: 1; font-family: var(--mono); padding: 6px 10px; border-radius: 8px; }
.webpanel iframe { width: 100%; height: 320px; border: 0; border-radius: 8px; background: #fff; }

/* course overview (home) */
.ov-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr 280px; gap: 24px; align-items: center;
  background: linear-gradient(135deg, rgba(43, 35, 112, 0.7), rgba(12, 20, 44, 0.9) 55%, rgba(10, 60, 52, 0.55));
  border: 1px solid var(--line-strong); border-radius: 26px; padding: 36px; margin-top: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.ov-hero::before { content: ""; position: absolute; right: 40px; top: 50%; width: 300px; height: 300px; transform: translateY(-50%); border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 210, 122, .25), transparent 68%); pointer-events: none; }
.ov-hero > * { position: relative; }
.ov-hero h1 { font-size: 52px; line-height: 1.04; margin: 8px 0 14px; }
.ov-hero h1 span { color: var(--ada); text-shadow: 0 0 24px rgba(155, 107, 255, .5); }
.ov-monty { display: grid; place-items: center; }
.ov-monty .monty { width: 250px; height: 232px; }
.ov-stats { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 14px; }
.ov-stats span { display: inline-flex; align-items: center; gap: 7px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 15px; font-weight: 800; }
.ov-next { margin: 6px 0 4px; }
button.letsgo { font: 700 26px var(--display); letter-spacing: .03em; padding: 16px 40px; border-radius: 18px; margin: 18px 0 10px; }
button.letsgo:hover { filter: brightness(1.08); transform: translateY(-1px); }
.lvls { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.lvl { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 4px; }
.lvl b { font: 700 18px var(--display); }
.lvl .bar { height: 8px; background: rgba(255, 255, 255, 0.06); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.lvl .bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--cyan)); box-shadow: 0 0 10px rgba(47, 210, 122, .6); }

@media (max-width: 900px) {
  .mapgrid, .split, .hero { grid-template-columns: 1fr; }
  .lessons { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .ov-hero { grid-template-columns: 1fr; padding: 24px; }
  .ov-hero h1 { font-size: 36px; }
  .ov-monty { display: none; }
  .lvls { grid-template-columns: 1fr 1fr; }
  button.letsgo { width: 100%; justify-content: center; }
  .topbar { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- Game Quest: Bit's purple accent and the task layout ---- */
:root { --ada: #B794FF; --ada-d: #7B4FE0; --bit: #9B6BFF; }
.ico.t-ethics { background: linear-gradient(135deg, #7FE7D3, #0E9E83); }
button.primary { background: linear-gradient(135deg, #B794FF, #7B4FE0); color: #fff; box-shadow: 0 0 0 1px rgba(155, 107, 255, .55), 0 8px 28px rgba(155, 107, 255, .3); }
.wrap { max-width: 1480px; }
.hidden { display: none !important; }
.small { font-size: 13px; }
button.xs { padding: 2px 6px; min-height: 0; font-size: 12px; }
.tasksplit { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 14px; align-items: start; }
.tasksplit > .panel { position: sticky; top: 10px; max-height: calc(100vh - 40px); overflow: auto; }
.prompt b { color: var(--yellow); }
.prompt ol, .prompt ul { padding-left: 20px; }
.prompt li { margin: 4px 0; }
@media (max-width: 960px) { .tasksplit { grid-template-columns: 1fr; } .tasksplit > .panel { position: static; max-height: none; } }

/* Teach-a-Machine */
.teach { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 14px; align-items: start; }
.teach h3 { margin: 0 0 8px; font-size: 17px; display: flex; gap: 8px; align-items: center; }
.teach .t-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.trays { display: grid; gap: 10px; margin-bottom: 10px; }
.tray { border: 1px solid var(--line); border-radius: 14px; padding: 10px; background: rgba(0, 0, 0, .18); cursor: pointer; }
.tray.sel { border-color: var(--c); box-shadow: 0 0 0 1px var(--c), 0 0 22px color-mix(in srgb, var(--c) 30%, transparent); }
.tray-head { display: flex; align-items: center; gap: 8px; }
.tray-head .sw { width: 14px; height: 14px; border-radius: 4px; background: var(--c); box-shadow: 0 0 10px var(--c); flex: none; }
.tray-head .tname { flex: 1; min-width: 0; font: 700 16px var(--display); color: var(--text); background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 5px 8px; }
.tray-head input.tname:hover, .tray-head input.tname:focus { border-color: var(--line-strong); }
.tray-head .cnt { font: 700 13px var(--mono); color: var(--muted); white-space: nowrap; }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; min-height: 48px; align-items: center; }
.thumbs .th { padding: 0; border-radius: 8px; background: #0B1430; border: 1px solid var(--line); line-height: 0; overflow: hidden; }
.thumbs .th:hover { border-color: var(--red); }
.thumbs .th img { width: 44px; height: 44px; object-fit: cover; image-rendering: pixelated; }
.deck-wrap h4 { margin: 12px 0 6px; }
.deck, .tdeck { display: flex; flex-wrap: wrap; gap: 8px; }
.dcard { padding: 0; line-height: 0; border-radius: 12px; border: 2px solid transparent; background: none; }
.dcard:hover { border-color: var(--cyan); transform: translateY(-2px); }
.dcard.on { border-color: var(--ada); box-shadow: var(--glow-cyan); }
.teach-side { display: grid; gap: 14px; }
.pad { position: relative; aspect-ratio: 1; width: 100%; max-width: 300px; margin: 0 auto; border-radius: 14px; overflow: hidden; border: 1px solid var(--line-strong); background: #0B1430; touch-action: none; }
.pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.padhint { position: absolute; inset: auto 0 10px; text-align: center; color: var(--muted); font-size: 13px; pointer-events: none; }
.cam { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line-strong); background: #0B1430; aspect-ratio: 4 / 3; }
.cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.cam .skel { position: absolute; inset: 0; width: 100%; height: 100%; transform: scaleX(-1); }
.camnote { position: absolute; left: 8px; bottom: 8px; font-size: 12px; background: rgba(6, 10, 24, .7); padding: 2px 8px; border-radius: 99px; color: var(--muted); }
button.rec { background: linear-gradient(135deg, #FF8FA3, #E03159) !important; color: #fff !important; }
.meter { height: 12px; border-radius: 99px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ada), var(--yellow)); transition: width .08s; }
.trainbar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .06); overflow: hidden; margin-top: 8px; }
.trainbar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ada), var(--cyan)); box-shadow: 0 0 12px var(--ada); }
.bars { display: grid; gap: 7px; margin-top: 8px; }
.pbar { display: grid; grid-template-columns: 96px 1fr 44px; gap: 8px; align-items: center; font-size: 14px; }
.pbar .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbar .tr { height: 14px; border-radius: 7px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.pbar .tr span { display: block; height: 100%; border-radius: 7px; background: var(--c); box-shadow: 0 0 12px var(--c); transition: width .25s; }
.pbar .pc { font: 700 13px var(--mono); text-align: right; }
.verdict { font: 700 19px var(--display); text-align: center; margin-top: 8px; min-height: 24px; }
.report .acc { font: 700 26px var(--display); color: var(--ada); }
.cgrid { display: grid; gap: 3px; margin-top: 8px; font: 700 12px var(--mono); }
.cgrid > div { padding: 6px 2px; text-align: center; border-radius: 6px; }
.cgrid .hd { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
@media (max-width: 1100px) { .teach { grid-template-columns: 1fr; } }

/* Sort */
.sorter .cards { display: flex; flex-wrap: wrap; gap: 8px; min-height: 60px; }
.scard { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); max-width: 190px; text-align: center; }
.scard.on { border-color: var(--ada); box-shadow: var(--glow-cyan); }
.scard .sc-text { padding: 6px 8px; font-weight: 700; }
.scard.small { max-width: 150px; font-size: 13px; padding: 4px; }
.scard .sc-pic { line-height: 0; }
.bins { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 14px 0 10px; }
.bin { border: 2px dashed color-mix(in srgb, var(--c) 60%, transparent); border-radius: 14px; padding: 10px; min-height: 150px; cursor: pointer; background: color-mix(in srgb, var(--c) 6%, transparent); }
.bin-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--c); }
.bin-head b, .bin-head input { flex: 1; font: 700 16px var(--display); color: var(--c); background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 3px 6px; min-width: 0; }
.bin-head input:focus { border-color: var(--line-strong); }
.bin-head .cnt { font: 700 13px var(--mono); }
.bin-cards { display: flex; flex-wrap: wrap; gap: 6px; }

/* Decision tree */
.treestudio { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); gap: 14px; align-items: start; }
.tcanvas { overflow: auto; }
.tree { display: flex; justify-content: center; padding: 8px; min-width: max-content; }
.tsub { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.tkids { display: flex; gap: 18px; align-items: flex-start; }
.tkids > div { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 8px; border-top: 2px solid var(--line-strong); }
.tnode { display: flex; align-items: center; gap: 6px; border-radius: 12px; padding: 8px 10px; border: 1px solid var(--line-strong); background: rgba(56, 217, 245, .08); }
.tnode.q { background: rgba(139, 123, 255, .16); border-color: rgba(139, 123, 255, .5); max-width: 220px; }
.tnode.leaf { background: rgba(255, 216, 77, .1); border-color: rgba(255, 216, 77, .5); }
.tnode.empty { border-style: dashed; background: none; }
.yn { font: 700 11px var(--mono); letter-spacing: .08em; padding: 1px 8px; border-radius: 99px; }
.yn.yes { background: rgba(47, 210, 122, .2); color: #6CF0A6; }
.yn.no { background: rgba(255, 107, 129, .2); color: #FF9AAE; }
.tpicker { grid-column: 1 / -1; }
.tpicker .opts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.irow { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.irow .lab { font-weight: 800; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.irow.ok .lab { color: var(--green); }
.irow.no .lab { color: var(--red); }
@media (max-width: 960px) { .treestudio { grid-template-columns: 1fr; } }

/* Write and quiz tasks */
.write textarea { width: 100%; font: 16px "Nunito", sans-serif; color: var(--text); background: rgba(0, 0, 0, .25); border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px; resize: vertical; }
.write .scenario { background: rgba(155, 107, 255, .08); border: 1px solid rgba(155, 107, 255, .35); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.write .q { display: block; margin-bottom: 8px; }
.quiz .q { margin-bottom: 14px; }
.quiz .dood { background: #0B1430; display: inline-block; border-radius: 12px; padding: 4px; }
.answer { border-top: 1px solid var(--line); padding: 8px 0; }
.answer p { margin: 4px 0 0; white-space: pre-wrap; }
.cardsvg { display: block; }
.tchip { display: inline-block; max-width: 220px; padding: 5px 9px; border-radius: 10px; background: rgba(56, 217, 245, .08); font-size: 13px; line-height: 1.3; text-align: left; white-space: normal; }
.thumbs .th:has(.tchip) { line-height: 1.2; background: none; }
.tform { display: flex; gap: 6px; }
.tform input { flex: 1; min-width: 0; font: 16px "Nunito", sans-serif; color: var(--text); background: rgba(0, 0, 0, .25); border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 10px; }
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.pcard { display: grid; gap: 4px; text-align: left; justify-content: stretch; padding: 10px; border-radius: 12px; background: rgba(155, 107, 255, .08); border: 1px solid rgba(155, 107, 255, .35); font-weight: 600; }
.pcard span { font-size: 13px; color: var(--muted); }
.pstudio textarea { width: 100%; font: 16px "Nunito", sans-serif; color: var(--text); background: rgba(0, 0, 0, .25); border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px; resize: vertical; }
.pchat { display: grid; gap: 8px; margin-top: 10px; }
.pmsg { padding: 8px 12px; border-radius: 12px; max-width: 90%; white-space: pre-wrap; }
.pmsg.me { justify-self: end; background: rgba(56, 217, 245, .14); }
.pmsg.ai { justify-self: start; background: rgba(155, 107, 255, .12); border: 1px solid rgba(155, 107, 255, .3); }
.pmsg.ai b { color: var(--ada); display: block; font-size: 13px; }
.pmsg.ai small { display: block; margin-top: 6px; color: var(--muted); }
.prompt .spec { display: inline-block; font: 700 14px var(--mono); background: rgba(155, 107, 255, .12); border: 1px solid rgba(155, 107, 255, .45); color: #9FF3E2; border-radius: 8px; padding: 1px 7px; }

/* ---------- Level 3: Data Lab notebook ---------- */
.datalab { padding: 12px; }
.labbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.labbar b { display: inline-flex; align-items: center; gap: 6px; color: var(--ada); font-family: var(--display); }
.labstatus { min-height: 18px; color: var(--yellow); }
.cell { border: 1px solid var(--line); border-radius: 12px; background: rgba(4, 8, 20, .55); margin: 0 0 10px; overflow: hidden; }
.cnote { padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 14.5px; background: rgba(155, 107, 255, .07); }
.cnote code { font-family: var(--mono); font-size: 13px; color: #9FF3E2; }
.cin { display: grid; grid-template-columns: auto auto 1fr auto; align-items: start; gap: 6px; padding: 6px; }
.cin .cn { font: 12px var(--mono); color: var(--muted); padding-top: 7px; }
.cin textarea { width: 100%; resize: none; min-height: 44px; border: 0; outline: 0; background: transparent; color: #E6FFF6; font: 14px/1.5 var(--mono); padding: 5px 4px; tab-size: 4; white-space: pre; overflow-x: auto; }
.cin textarea:focus { background: rgba(155, 107, 255, .05); border-radius: 6px; }
.cout:empty { display: none; }
.cout { border-top: 1px dashed var(--line); padding: 8px 12px; overflow-x: auto; }
.pout { margin: 0 0 6px; font: 13px/1.45 var(--mono); white-space: pre-wrap; color: #DCE6FF; }
.pout.val { color: #BFF5D6; }
.perr { background: rgba(255, 107, 129, .12); border: 1px solid rgba(255, 107, 129, .45); border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.perr b { color: var(--red); }
.perr span { color: var(--muted); }
.dwrap { overflow-x: auto; max-width: 100%; }
table.dtable { border-collapse: collapse; font: 12.5px var(--mono); margin: 2px 0 4px; }
table.dtable th, table.dtable td { padding: 3px 9px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
table.dtable thead th { color: var(--ada); border-bottom: 1px solid var(--line-strong); }
table.dtable tbody th { color: var(--muted); }
img.chart { display: block; max-width: 100%; background: #fff; border-radius: 8px; margin: 6px 0; }

/* ---------- Level 3: explorers ---------- */
.explorer { padding: 12px; }
.plot { width: 100%; height: auto; display: block; touch-action: none; user-select: none; }
.plot .plotbg { fill: rgba(4, 8, 20, .55); stroke: var(--line); }
.plot .grid { stroke: rgba(120, 160, 255, .09); }
.plot .tick { fill: var(--muted); font: 11px var(--mono); }
.plot .axl { fill: var(--text); font: 600 13px "Nunito", sans-serif; }
.plot .pt { stroke: rgba(0, 0, 0, .55); stroke-width: 1; }
.plot circle.pt:not([fill]) { fill: var(--cyan); }
.plot .fit { stroke: var(--yellow); stroke-width: 3; }
.plot .handle { fill: var(--yellow); stroke: #fff; stroke-width: 2; cursor: grab; }
.plot .resid { stroke: var(--red); stroke-width: 1.5; stroke-dasharray: 3 3; }
.plot .nbr { stroke-width: 1.5; opacity: .7; }
.plot .probe { stroke-linejoin: round; }
.plot rect.probe { stroke: #fff; stroke-width: 2; }
.plot .qlab { fill: #fff; font: 700 12px "Nunito", sans-serif; paint-order: stroke; stroke: rgba(0, 0, 0, .7); stroke-width: 3; }
.exbar { margin-top: 8px; align-items: center; gap: 10px; }
.exbar input[type=range] { width: 200px; accent-color: var(--ada); }
.errmeter { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin-top: 8px; }
.errmeter .mbar { height: 10px; border-radius: 6px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.errmeter .mbar i { display: block; height: 100%; width: 0; border-radius: 6px; transition: width .08s; }
.guess { margin-top: 8px; align-items: center; gap: 8px; }
.guess input { width: 110px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13.5px; margin-bottom: 4px; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.loo { margin-top: 6px; }

/* ---------- Level 4: Neural Playground ---------- */
.nnstudio { padding: 12px; }
.nngrid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(240px, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1100px) { .nngrid { grid-template-columns: 1fr; } }
.plot.sq { aspect-ratio: 1; }
.heatwrap { position: relative; }
.heatwrap canvas { width: 100%; height: auto; display: block; border-radius: 10px; background: rgba(4, 8, 20, .55); }
.heatwrap .over { position: absolute; inset: 0; }
.nnside { display: flex; flex-direction: column; gap: 9px; }
.neuron-eq { background: rgba(155, 107, 255, .08); border: 1px solid rgba(155, 107, 255, .35); border-radius: 10px; padding: 8px 10px; }
.neuron-eq b { color: var(--ada); }
.nslider { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: 13.5px; }
.nslider input { grid-column: 1 / -1; accent-color: var(--ada); width: 100%; }
.nslider b { font-family: var(--mono); color: var(--yellow); }
.nslider span { color: var(--muted); }
.acc b { color: var(--ada); }
table.truth { border-collapse: collapse; font: 13px var(--mono); }
table.truth th, table.truth td { padding: 3px 10px; border-bottom: 1px solid var(--line); text-align: center; }
table.truth tr.ok td:last-child { color: var(--green); }
table.truth tr.no td:last-child { color: var(--red); }
.nnrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.nnrow select { margin-left: 4px; }
.layers { display: flex; flex-direction: column; gap: 4px; }
.lay { display: flex; gap: 6px; align-items: center; }
.losscurve, .netdiagram { width: 100%; height: auto; }
.losscurve .tick { fill: var(--muted); font: 9px var(--mono); }
.trainbar2 { gap: 6px; }

/* ---------- Level 4: prompt builder ---------- */
.ppart { display: block; margin-bottom: 8px; }
.ppart > span { display: block; margin-bottom: 3px; font-size: 14px; }
.ppart b { color: var(--ada); }
.ppart textarea { width: 100%; }
.ppreview pre { white-space: pre-wrap; font: 13px var(--mono); background: rgba(4, 8, 20, .6); border-radius: 8px; padding: 8px; margin: 6px 0 0; }
.ptext { white-space: pre-wrap; }
.jbadge { display: inline-block; margin-top: 6px; font: 700 12px var(--mono); border-radius: 6px; padding: 1px 7px; }
.jbadge.ok { background: rgba(47, 210, 122, .15); color: var(--green); }
.jbadge.no { background: rgba(255, 107, 129, .15); color: var(--red); }

/* ---------- Starting Line and certificate ---------- */
a.btnlink { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; padding: 9px 14px; border-radius: 12px; font-weight: 800; }
a.btnlink.primary { background: var(--bit); color: #fff; }
.certcard { display: flex; gap: 10px; align-items: center; border-color: rgba(155, 107, 255, .5); box-shadow: 0 0 0 1px rgba(155, 107, 255, .4), 0 8px 26px rgba(155, 107, 255, .2); }
.certcard svg { width: 70px; height: 70px; flex: none; }

/* Game Quest extras */
.ico.t-build { background: linear-gradient(135deg, #4DD4F7, #1C7ED6); }
.ico.t-remix { background: linear-gradient(135deg, #FF8FD0, #C2255C); }
.ico.t-art { background: linear-gradient(135deg, #FFC24D, #F08C00); }
.ico.t-playtest { background: linear-gradient(135deg, #38E0B8, #0CA678); }
.ico.t-boss { background: linear-gradient(135deg, #B794FF, #5B33C9); }
.ov-hero h1 span { font-family: var(--display); color: #C9B3FF; text-shadow: 0 0 22px rgba(155, 107, 255, .7), 2px 2px 0 #5B33C9; }
.lvls.two { grid-template-columns: repeat(2, 1fr); }
.arcade-sign { font: 700 12px var(--mono); letter-spacing: .3em; color: #FFD84D; text-shadow: 0 0 10px rgba(255, 216, 77, .6); }
.tilecard { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: center; }
.tilecard .mascot { width: 120px; height: 112px; }
.wrap.wide { max-width: 1680px; }
.wrap.wide .tasksplit { grid-template-columns: minmax(260px, 320px) 1fr; }
