/* Shared interface colors. Games keep their own illustrated playfields. */
:root {
  --bg: #0c1221;
  --surface: #151e32;
  --line: #374660;
  --text: #f5f7fb;
  --muted: #bccee2;
  --gold: #ffda85;
  --studio-mint: #85eed1;
  --studio-mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  --studio-font: Mulish, system-ui, sans-serif;
}
:focus-visible { outline: 3px solid #8ef3d4; outline-offset: 3px; }
.world-home .site-header, .lab-page .lab-topbar { background: #101727; border-bottom: 1px solid var(--line); }
.world-home .site-header nav a { font: 800 1rem/1.2 var(--studio-font); }
.world-home .hero-content { max-width: min(48rem, 93%); }
.world-home #hero-title { display: block; margin: .22em 0; font: 800 clamp(3rem, 6.4vw, 6rem)/.98 var(--studio-font); letter-spacing: -.058em; text-transform: none; text-shadow: 0 3px 16px #070d1d; }
.world-home #hero-title span { color: var(--studio-mint); }
.world-home .hero-description { max-width: 37rem; font: 600 clamp(1rem, 1.6vw, 1.25rem)/1.55 var(--studio-font); color: #edf4ff; }
.world-home .hero-shade { background: linear-gradient(90deg, #091222ee 0%, #091222bc 38%, #09122215 83%), linear-gradient(0deg, #0b1322ad, transparent 30%); }
.world-home .pixel-button, .world-home .text-link, .world-home .project-filters button, .world-home .auth-button, .world-home .github-link {
  font: 800 .94rem/1.35 var(--studio-font); letter-spacing: normal;
}
.world-home .pixel-button { border-radius: .45rem; }
.world-home .hero-actions .gold { background: var(--studio-mint); color: #102826; box-shadow: 0 3px #386f67; border-color: #a3ffe7; }
.world-home .project-body, .world-home .game-info { background: #141e31; }
.world-home .project-card, .world-home .game-card { border-radius: .8rem; overflow: hidden; }
.world-home .project-title h3, .world-home .game-info h3, .world-home .arcade-header h2, .world-home .arcade-overlay h3 { font-family: var(--studio-font); letter-spacing: -.03em; }
.world-home .section-kicker, .world-home .eyebrow, .world-home .game-tag, .world-home .arcade-eyebrow { font: 700 .81rem/1.45 var(--studio-mono); letter-spacing: .075em; }
.world-home .section-kicker > span:first-child { display: none; }
.learning-section { scroll-margin-top: 1rem; padding-block: clamp(3rem, 6vw, 6rem); }
.learning-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.5rem; }
.learning-heading h2 { font: 800 clamp(2.15rem, 4.5vw, 4rem)/1 var(--studio-font); letter-spacing: -.055em; }
.learning-heading p { max-width: 27rem; color: var(--muted); font-size: 1rem; }
.learning-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.learning-card { --ink: #8af0cf; display: flex; flex-direction: column; border: 1px solid #385448; border-radius: .9rem; overflow: hidden; background: #141e31; }
.ai-card { --ink: #c1adff; border-color: #4a425f; }
.signal-card { --ink: #ffc790; border-color: #5c4938; }
.course-copy { padding: clamp(1rem, 2.5vw, 1.75rem); display: flex; flex-direction: column; flex: 1; align-items: start; }
.course-copy small { font: 600 .8rem/1.5 var(--studio-mono); color: var(--ink); }
.course-copy h3 { font: 800 clamp(1.55rem, 2.5vw, 2rem)/1.16 var(--studio-font); letter-spacing: -.04em; margin: .55rem 0; }
.course-copy p { font-size: 1rem; color: var(--muted); margin-bottom: 1.25rem; }
.course-copy strong { margin-top: auto; color: var(--ink); border-bottom: 1px solid currentColor; }

/* The workbench and its list of lessons use selectable, resizable type. */
.lab-page { --lab-panel: #172136; --lab-panel-2: #1b2840; --lab-rim: #34455d; --lab-rim-strong: #50647c; --lab-code-bg: #101c2d; --lab-console-bg: #0b1423; --lab-lime: var(--studio-mint); --lab-gold: #ffda85; --pixel: var(--studio-font); }
.lab-page .lab-topbar { gap: .75rem; padding: .6rem clamp(.65rem, 3vw, 2.5rem); height: auto; min-height: 3.6rem; align-items: center; }
.lab-page .lab-topnav { display: flex; margin: 0 auto 0 0; font: 800 .94rem/1.25 var(--studio-font); letter-spacing: normal; }
.studio-control, .lab-page .lab-rail-filter { font: 800 .9rem/1.25 var(--studio-font); border: 1px solid #51627a; border-radius: .45rem; color: var(--text); background: #202e45; padding: .55rem .85rem; cursor: pointer; }
.studio-control[aria-pressed=true] { background: #153e38; color: #a1f8df; }
.lab-page .lab-xp { color: var(--gold); font: 700 .8rem/1.3 var(--studio-mono); border-radius: .4rem; }
.lab-page .lab-brief { position: static; background: transparent; }
.lab-page .lab-kicker, .lab-page .lab-coursebar-chapter { font: 700 .85rem/1.4 var(--studio-mono); letter-spacing: .02em; color: var(--studio-mint); }
.lab-page .lab-title { font: 800 clamp(1.8rem, 3.2vw, 3.1rem)/1.08 var(--studio-font); letter-spacing: -.045em; color: var(--text); overflow-wrap: anywhere; }
.lab-page .lab-lead { font: 500 1.05rem/1.6 var(--studio-font); color: #d6e3f2; }
.lab-page .lab-pane-title, .lab-page .lab-instructions-title, .lab-page .lab-help-title, .lab-page .lab-rail-title { font: 800 1.1rem/1.3 var(--studio-font); letter-spacing: -.02em; }
.lab-page .lab-tab, .lab-page .nes-button { font: 800 .94rem/1.25 var(--studio-font); letter-spacing: 0; border-radius: .45rem; min-height: 2.5rem; }
.lab-page .lab-code { font: 400 1rem/1.65 var(--studio-mono); tab-size: 2; }
.lab-page .lab-actions, .lab-page .lab-work-top, .lab-page .lab-tabs { flex-wrap: wrap; }
.lab-page .lab-status { position: static; color: var(--text); font: 700 1rem/1.45 var(--studio-font); }
.lab-status:empty { display: none; }
.lab-page .lab-status[data-state=ok] { color: #91f5cc; }
.lab-page .lab-status:is([data-state=error],[data-state=bad]) { color: #ffb4bf; }
.workbench-link { display: inline-block; margin: .7rem 0; color: var(--studio-mint); text-decoration: underline; font-weight: 800; }
.lab-example { background: var(--lab-panel); border-left: 3px solid var(--studio-mint); padding: .7rem 1rem; margin: .7rem 0 1.25rem; }
.lab-example summary { font-weight: 800; cursor: pointer; }
.lab-example p { margin: .6rem 0; overflow-wrap: anywhere; }
.lesson-dialog { border: 1px solid #52627d; border-radius: .8rem; background: #111c2e; color: var(--text); padding: 1.15rem; width: min(38rem,94vw); max-height: 85dvh; }
.lesson-dialog::backdrop { background: #040813cf; }
.lesson-dialog form { text-align: right; }
.lab-page .lesson-dialog .lab-rail { position: static; inset: auto; width: 100%; max-height: none; margin: .4rem 0 0; padding: 0; transform: none; border: 0; box-shadow: none; background: transparent; overflow: visible; }
.lesson-search { display: grid; gap: .3rem; font-weight: 800; margin: .9rem 0 .4rem; }
.lesson-search input { width: 100%; background: #0c1524; color: #fff; border: 1px solid #64758b; border-radius: .4rem; padding: .7rem .85rem; font: inherit; }
.lesson-dialog [data-search-summary] { margin: .4rem 0 1rem; font-size: .92rem; color: var(--muted); }
.lab-page .lab-rail-label { font-size: 1rem; line-height: 1.45; }
.lab-page .lab-rail-chapter { color: var(--studio-mint); font: 800 1rem/1.35 var(--studio-font); }
.lab-page .lab-rail-star { min-width: 2.65rem; min-height: 2.65rem; }
.lab-page .lab-rail-link { min-width: 0; flex: 1; }
.lab-page .lab-rail-item { display: flex; align-items: center; }
.download-page { font-family: var(--studio-font); color: var(--text); background: linear-gradient(145deg,#192f36,#101827 38%); min-height: 100vh; }
.download-page h1 { color: var(--studio-mint); }
.download-page .links a, .tools-page .tool-panel, .auth-page .auth-card, .game-layout .panel { border-radius: .65rem; }
.tools-page, .privacy-page, .auth-page { --pixel: var(--studio-font); }
.world-home .arcade-modal { --pixel: var(--studio-font); }
.world-home .arcade-settings label, .world-home .arcade-btn, .world-home .arcade-secondary { font: 800 .9rem/1.3 var(--studio-font); }
@media (prefers-reduced-motion: no-preference) {
  .learning-card { transition: transform .18s ease, border-color .18s ease; }
  .learning-card:is(:hover,:focus-visible) { transform: translateY(-4px); border-color: var(--ink); }
  .lesson-dialog[open] { animation: lesson-open .17s ease-out; }
  @keyframes lesson-open { from { opacity: .3; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}
@media (max-width: 780px) {
  .learning-heading { display: block; }
  .learning-heading p { margin-top: .8rem; }
  .learning-grid { grid-template-columns: 1fr; }
  .lab-page { height: auto; overflow: visible; }
  .lab-page .lab-layout { display: flex; flex-direction: column; height: auto; overflow: visible; }
  .lab-page .lab-lesson, .lab-page .lab-work, .lab-page .lab-work-scroll { height: auto; overflow: visible; min-width: 0; }
  .lab-page .lab-work { scroll-margin-top: .5rem; padding: 1rem; }
  .lab-page .lab-coursebar { position: static; margin: 0; }
  .lab-page .lab-topbar { position: static; flex-wrap: wrap; gap: .45rem; }
  .lab-page .lab-topbar [data-wordmark] { display: none; }
  .lab-page .lab-topnav a { font-size: .9rem; }
  .world-home .site-header.is-nav-open nav a { height: 44px; }
  .world-home .hero-shade { background: linear-gradient(90deg,#071323e6,#0b172859),linear-gradient(0deg,#0a1424ae,transparent); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms!important; animation-iteration-count: 1!important; transition-duration: .01ms!important; scroll-behavior: auto!important; }
}
/* Pixel edges are drawn in CSS so menu labels stay selectable at every scale. */
.world-home .site-header { isolation: isolate; border-bottom: 3px solid #3b5775; box-shadow: inset 0 -2px #142237; }
.world-home .site-header::after { content: ''; position: absolute; bottom: -3px; right: 6%; width: 5rem; height: 3px; background: repeating-linear-gradient(90deg,#78ecd3 0 8px, transparent 8px 12px); pointer-events: none; }
.world-home .brand-mark { background: #fbd16e; border-color: #ffdf8c; }
.world-home .nav-toggle { width: auto; min-height: 40px; gap: .55rem; padding-inline: .75rem; color: #9bf4d8; background: #172a35; border: 2px solid #537a7e; box-shadow: 3px 3px #080e1b; }
.nav-toggle-label { font: .7rem/1.3 Pixel, monospace; }
.world-home .nav-toggle-bars i { background: #a8f0d9; }
.world-home .learning-card, .world-home .project-card, .world-home .game-card { border-radius: 0; border-width: 2px; box-shadow: 4px 4px #060b15; }
.world-home .learning-heading h2 { font: 400 clamp(1.4rem,2.9vw,2.6rem)/1.5 Pixel,monospace; letter-spacing: -.065em; }
.world-home .course-copy h3 { font: 400 clamp(.9rem,1.2vw,1.1rem)/1.65 Pixel,monospace; letter-spacing: -.045em; }
.world-home .course-copy strong { border: 0; padding: .35rem .6rem; background: var(--ink); color: #142134; box-shadow: 3px 3px #060b15; }
.world-home .pixel-button, .lab-page .nes-button, .studio-control { border-radius: 0; }
.lab-page .lab-work-top .nes-button { background: #273951; color: white; border: 1px solid #647995; padding: .5rem .85rem; box-shadow: 2px 2px #070e1b; }
.lab-page .lab-work-top .lab-check { background: #9eeecf; color: #102a23; }
.lab-page .lab-work-top .lab-run { background: #92d8ff; color: #0f2741; }
.lab-page .lab-work-top .nes-button::before,.lab-page .lab-work-top .nes-button::after { display:none; }
.lab-page .lab-title { text-shadow: none; }
.lab-page .lab-help a { color: var(--studio-mint); text-decoration: underline; }
html[data-scene="neon-coast"] .world-home { --studio-mint:#ffb9df; --gold:#ffd798; }
html[data-scene="cyberpunk"] .world-home { --studio-mint:#80f6ef; --line:#534568; }
@media(max-width:900px) {
  .world-home .site-header .nav-toggle { margin-left:auto; }
  .world-home .site-header .command-palette-launcher { margin-left:0; }
}
.cartridge-shelf { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.8rem;margin:0 0 1.25rem; }
.cartridge-shelf a { display:flex;align-items:center;gap:.85rem;padding:1.1rem;background:#18253a;border:2px solid #3d556a;box-shadow:3px 3px #080e1b; }
.cartridge-shelf a:is(:focus-visible,:hover) { border-color:var(--studio-mint); }
.cartridge-shelf strong,.cartridge-shelf small { display:block; }
.cartridge-shelf strong { font:400 .82rem/1.6 Pixel,monospace;color:#eaf6ff; }
.cartridge-shelf small { margin-top:.35rem;font:500 .92rem/1.45 var(--studio-font);color:var(--muted); }
.cart-icon { color:#9aefcf;font-size:2rem; }
.cartridge-shelf a:nth-child(2) .cart-icon { color:#ffc781; }
.cartridge-shelf a:nth-child(3) .cart-icon { color:#c3adff; }
@media(max-width:780px){.cartridge-shelf{grid-template-columns:1fr;}}
html:not([data-scene="neon-coast"]) .world-home .sky-controls .coastal-radio { display:none; }
html[data-scene="neon-coast"] .coastal-radio { display:inline-block;color:#ffe0f1;border-color:#c074a9; }
.world-home #hero-title { font:400 clamp(1.65rem,3.5vw,3.4rem)/1.45 Pixel,monospace;letter-spacing:-.065em;text-shadow:3px 4px #162639; }
.world-home .hero-content { max-width:min(50rem,94%); }
.world-home .sky-controls { flex-wrap:wrap;justify-content:flex-end; }
.world-home .sky-controls .cyber-mode-button { position:static;box-shadow:none;font:800 .8rem/1.3 var(--studio-font); }
.world-home .sky-controls > button { font:800 .8rem/1.3 var(--studio-font);min-height:2.3rem; }
@media(min-width:1001px) { .world-home .site-header .brand [data-wordmark] { display:inline-flex; } }
@media(max-width:700px) {
  .world-home .sky-controls { justify-content:center; }
  .world-home .world-toolbar { gap:.4rem; }
}

/* Keep the condition line in the hero flow so it clears the wrapping toolbar. */
.world-home .hero { display:flex; flex-direction:column; }
.world-home .hero-content { flex:none; }
.world-home .world-conditions { position:static; transform:none; margin:auto auto .6rem; font:650 .875rem/1.45 var(--studio-font); }
.world-home .world-toolbar { position:relative; inset:auto; flex:none; display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:1.5rem; padding:.9rem clamp(1rem,5vw,5rem); background:#0e1828f5; }
.world-home .world-toolbar .coin-counter { display:grid; grid-template-columns:24px auto; justify-content:start; gap:.3rem .65rem; white-space:nowrap; padding:.4rem .1rem; }
.coin-counter .coin-icon { grid-row:span 2; align-self:center; justify-self:center; }
.world-home #coin-count { font:400 .82rem/1.45 Pixel,monospace; color:#ffe194; }
.world-home .coin-counter .coin-label { display:block; font:750 .8rem/1.2 var(--studio-font); color:#c4d5e5; text-transform:none; }
.world-home .sky-controls { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); width:min(100%,52rem); margin-left:auto; gap:.5rem; }
.world-home .world-toolbar .sky-controls > button { display:inline-flex; align-items:center; justify-content:center; gap:.4rem; position:static; inset:auto; margin:0; width:100%; min-width:0; min-height:44px; padding:.5rem; background:#1a2b41; color:#e3eff7; border:1px solid #51677f; border-radius:2px; box-shadow:inset 0 -2px #101d2e; font:750 .94rem/1.25 var(--studio-font); white-space:normal; text-align:center; }
.world-home .world-toolbar .sky-controls > button:is(:hover,:focus-visible,[aria-pressed="true"]) { background:#223d47; border-color:#85dccb; color:#c6ffeb; }
html:not([data-scene="neon-coast"]) .world-home .world-toolbar .sky-controls .coastal-radio { display:none; }
@media(min-width:1250px) {
  .world-home .sky-controls { width:100%; grid-template-columns:repeat(auto-fit,minmax(8rem,1fr)); }
}
@media(max-width:620px) {
  .world-home .world-toolbar { grid-template-columns:1fr; gap:.5rem; padding:.75rem 1rem; }
  .world-home .sky-controls { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .world-home .world-toolbar .coin-counter { grid-template-columns:auto auto auto; align-items:center; justify-self:center; }
  .coin-counter .coin-icon { grid-row:auto; }
}
.world-home .quick-weather { padding:clamp(1.25rem,3.6vw,3.25rem) max(1rem,calc((100% - 76rem)/2)); background:linear-gradient(150deg,#142838,#101b2c 70%); }
.weather-deck-heading h2 { margin:0; font:400 clamp(1.05rem,2.1vw,1.8rem)/1.6 Pixel,monospace; color:#edf8ff; }
.world-home .weather-running { display:inline-flex; align-items:center; gap:.55rem; margin:0; padding:.45rem .7rem; color:#c4edda; font:700 .875rem/1.4 var(--studio-font); }
.weather-running::before { content:''; width:.5rem; height:.5rem; background:#8de7ad; }
.quick-weather[data-moving="false"] .weather-running::before { background:#ffcd82; }
.world-home .weather-choices { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); grid-auto-rows:1fr; gap:.55rem; }
.world-home .weather-choices button { position:relative; display:grid; grid-template-columns:2.5rem minmax(0,1fr); align-items:center; justify-items:start; gap:.85rem; padding:.85rem 1rem; min-height:64px; text-align:left; color:#eaf4ff; border:1px solid #486279; border-bottom-width:2px; background:#192b40; box-shadow:0 2px #0a1321; }
.world-home .weather-choices button .weather-name { color:inherit; font:750 1rem/1.35 var(--studio-font); letter-spacing:normal; overflow-wrap:anywhere; }
.weather-icon { width:2.5rem; height:2.5rem; padding:3px; overflow:visible; color:var(--sprite-accent); }
.sprite-base { fill:var(--sprite-accent); }
.sprite-detail { fill:var(--sprite-accent); }
.world-home .weather-choices button:is(:hover,:focus-visible) { transform:none; background:#233a4c; border-color:#92acbd; }
.world-home .weather-choices button[aria-pressed="true"] { background:#233e45; color:#e0fff5; border-color:#90e8ce; box-shadow:inset 3px 0 #90e8ce,0 2px #0a1321; }
@media(prefers-reduced-motion:no-preference) {
  .quick-weather[data-moving="true"] .sprite-detail { animation:sprite-tint 4s ease-in-out infinite alternate; }
  .quick-weather[data-moving="true"] .sprite-fall { animation:sprite-fall 1.6s steps(3,end) infinite,sprite-tint 4s ease-in-out infinite alternate; }
  .quick-weather[data-moving="true"] .sprite-drift { animation:sprite-drift 2.8s steps(4,end) infinite alternate,sprite-tint 4s ease-in-out infinite alternate; }
  .quick-weather[data-moving="true"] .sprite-shift { animation:sprite-shift 3s steps(1,end) infinite,sprite-tint 4s ease-in-out infinite alternate; }
  .weather-choices button:nth-child(3n) .sprite-detail { animation-delay:-.65s; }
  .weather-choices button:nth-child(3n + 1) .sprite-detail { animation-delay:-1.15s; }
  @keyframes sprite-tint { to { fill:#ffedc3; } }
  @keyframes sprite-fall { from { transform:translateY(-2px); } to { transform:translateY(2px); } }
  @keyframes sprite-drift { from { transform:translateX(-1px); } to { transform:translateX(2px); } }
  @keyframes sprite-shift { 0%,70%,87%,100% { transform:none; } 76% { transform:translateX(-2px); } 82% { transform:translateX(2px); } }
}
.world-home .weather-deck-tools { display:flex; align-items:stretch; flex-wrap:wrap; gap:.6rem; margin-top:1.1rem; }
.world-home .weather-deck-tools :is(button,label),.world-home .weather-deck-tools select { margin:0; min-height:44px; font:700 .95rem/1.35 var(--studio-font); }
.world-home .weather-deck-tools label { display:flex; align-items:center; gap:.5rem; }
.world-home .weather-sliders label,.world-studio .weather-sliders label { font:700 .94rem/1.5 var(--studio-font); }
.world-home .quick-world-intro>span,.world-home .quick-world-studio,.world-home .studio-eyebrow { font:750 .85rem/1.5 var(--studio-font); }
@media(max-width:800px) {
  .world-home .weather-choices { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .world-home .weather-choices button { padding:.65rem; gap:.55rem; }
}
@media(max-width:560px) {
  .weather-deck-heading { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:.5rem; }
  .world-home .weather-deck-tools { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .world-home .weather-deck-tools>label { grid-column:span 2; }
  .world-home .weather-deck-tools select { flex:1; }
  .world-home .weather-deck-tools button { width:100%; padding:.4rem; }
  .world-home .weather-choices button { grid-template-columns:1.9rem minmax(0,1fr); gap:.45rem; }
  .weather-icon { width:1.9rem; height:1.9rem; padding:1px; }
}
body[data-weather="drizzle"] { --weather-glaze:#83bcc70b; }
body[data-weather="rain"],body[data-weather="glass-rain"] { --weather-glaze:#527bb91a; }
body[data-weather="heavy-rain"],body[data-weather="storm"] { --weather-glaze:#29356535; }
body[data-weather="light-snow"] { --weather-glaze:#e2faff0a; }
body[data-weather="snow"] { --weather-glaze:#c8def71a; }
body[data-weather="heavy-snow"] { --weather-glaze:#c5d5ee2e; }
.hero-shade::before { content:''; position:absolute; inset:0; background:var(--weather-glaze,transparent); transition:background 1s; }

.lab-page { --reading:system-ui,-apple-system,sans-serif; }
.lab-page :is(.lab-lesson,.lab-work,.lab-coursebar,.lesson-dialog) { font-family:var(--reading); }
.lab-page :is(.lab-lead,.lab-help-note,.lab-steps li,.lab-example p,.lab-learn-block p,.lab-quiz-option-text,.ai-python-list li) { font:400 1rem/1.6 var(--reading); color:#dfebf5; }
.lab-page :is(.lab-learn-block-title,.lab-notes-title,.lab-lookup-title,.lab-feedback-title,.circuits-probe-title,.ai-python-note-title) { font:750 1rem/1.4 var(--reading); letter-spacing:normal; }
.lab-page :is(.lab-kicker,.lab-coursebar-counter,.lab-track-summary,.lab-track-name,.lab-track-count,.lab-notes-sub,.lab-note-lookup,.lab-terminal-clear,.circuits-label,.circuits-part-value,.lab-quiz-progress,.lab-rail-link span,.lab-feedback-where) { font:650 .875rem/1.45 var(--reading); letter-spacing:normal; }
.lab-page :is(.circuits-part-name,.circuits-pane-note,.ai-expected) { font-size:.95rem; }
.lab-page :is(code,.lab-code,.ai-expected,.lab-feedback-code) { font-family:var(--studio-mono); }
.lab-page :is(.lab-help-note,.lab-learn-block,.ai-python-list,.lab-example) code { font-size:.94em; }
.lab-page :is(.lab-example,.lab-learn-block,.lab-quiz-options) { min-width:0; }
.lab-page .lab-example code { white-space:pre-wrap; overflow-wrap:anywhere; }
.lab-page .lab-track-summary { cursor:pointer; }
.lab-page .lab-quiz-question { max-width:48ch; font:720 clamp(1.2rem,2vw,1.55rem)/1.45 var(--reading); color:#f5f8fd; }
.lab-page .lab-quiz-options { display:grid; gap:.6rem; }
.lab-page .lab-quiz-option { display:grid; grid-template-columns:2.2rem minmax(0,1fr); align-items:center; gap:.8rem; padding:.8rem 1rem; min-height:54px; background:#18283d; border:1px solid #576c87; color:#edf5fb; text-align:left; }
.lab-page .lab-quiz-letter { display:grid; place-items:center; width:2.2rem; height:2.2rem; background:#253a51; color:inherit; font:700 1rem/1 var(--reading); }
.lab-page .lab-quiz-option:hover { border-color:#acd6ff; }
.lab-page .lab-quiz-option-correct { background:#173a33; border:2px solid #89dcb6; }
.lab-page .lab-quiz-option-wrong { background:#432a34; border:2px solid #f9a8a7; }
.lab-page .lab-quiz-verdict { font:650 1rem/1.5 var(--reading); }
.lab-page .lab-quiz-option-text { overflow-wrap:anywhere; }
.lab-page :is(.lab-note-lookup,.lab-terminal-clear,.lab-quiz-retry) { min-height:40px; }
.tools-page :is(.seg-button,.copy-chip,.tool-select,label),.auth-page label,.privacy-page :is(dt,th,.privacy-subhead,.privacy-back) { font:700 .875rem/1.45 var(--studio-font); }
.gridworks-page :is(.hud-item small,.hud-item div>span,.build-card-cost,.build-card-unlock,.campaign-xp,.map-hint,.weather-control,.objective-value,.footer-message,.map-toolbar button,.header-actions button,.eyebrow) { font:650 .8rem/1.4 var(--studio-font); }
.gridworks-page .build-card-name { font:750 .95rem/1.35 var(--studio-font); }
.world-home .sky-controls { grid-auto-rows:1fr; align-items:stretch; }
.world-home .world-toolbar .sky-controls > button { align-self:stretch; height:100%; }
.world-home .world-toolbar :is(#ambient-toggle,#sfx-toggle) { font:750 .94rem/1.25 var(--studio-font); }
.world-home .skip-link:not(:focus) { clip-path:inset(50%); width:1px; height:1px; overflow:hidden; }
@media(max-width:440px) {
  .world-home .weather-choices button { grid-template-columns:1fr; grid-template-rows:2rem auto; justify-items:center; align-content:center; text-align:center; padding:.55rem .3rem; min-height:78px; gap:.15rem; }
  .world-home .weather-choices button .weather-name { overflow-wrap:normal; }
}
@media(max-width:1100px) {
  .lab-page .lab-layout { display:flex; flex-direction:column; align-items:stretch; width:100%; min-width:0; }
  .lab-page .lab-layout > :is(.lab-lesson,.lab-work) { width:100%; min-width:0; }
  .lab-page .lab-work-scroll,.lab-page .lab-coursebar { min-width:0; }
}
@media(max-width:560px) {
  .gridworks-page .map-toolbar { flex-wrap:wrap; row-gap:.4rem; }
  .gridworks-page .map-overlays { flex-wrap:wrap; }
}
.lab-page :is(.lab-learn-code,.lab-note-example) { max-width:100%; overflow-x:auto; tab-size:2; }
.lab-page :is(.lab-learn-code,.lab-note-example) code { font:400 .94rem/1.5 var(--studio-mono); }
.lab-page .lab-help .lab-help-note { font:400 1rem/1.55 var(--reading); }
.lab-page .lab-work-top .nes-button span { font:inherit; color:inherit; }
.lab-page:is(.ai-lab-page,.circuits-page) .lab-learn-block { margin:.9rem 0; padding:1rem; border:1px solid #3b5069; background:#142337; }
.lab-page:is(.ai-lab-page,.circuits-page) .lab-learn-code { padding:.75rem; background:#0b1727; }
.lab-page .lab-learn-card-title { margin-top:.8rem; font:700 1rem/1.45 var(--reading); }
.world-home :is(.news-sources button,.news-tabs button,.news-more,.player-pose-controls button,.world-map-picker label,.achievement-name,.achievement-count,.achievement-note,.now-learning>span,.stats-label,.github-stats-meta,.social-links a,.experimental) { font:700 .875rem/1.45 var(--studio-font); }
.world-home :is(.hero-location,.game-tag,.section-kicker,.github-stats-title) { font:400 .75rem/1.65 Pixel,monospace; }
.tools-page :is(.tool-tabs button,.tool-seg .seg-button,.tool-field-head .copy-chip,.tool-actions button,.tool-actions .pixel-button),.privacy-page .privacy-contact a { font:700 .9rem/1.45 var(--studio-font); }
.gridworks-page :is(.build-categories,.simulation-controls,.render-controls,.management-tabs,.city-actions,.story-log,.starter-guide,.map-bottom)>button,
.gridworks-page :is(.header-button,.mode-buttons button,.map-overlays button)>span,
.gridworks-page :is(.event-heading h2,.event-feed p,.event-feed time,.tool-description p,.toolbox-footer p,.map-legend span,.story-task b,.starter-guide b,.render-controls output,.mission-copy p) { font:650 .82rem/1.4 var(--studio-font); }
.gridworks-page :is(.build-categories,.render-controls,.map-bottom) { flex-wrap:wrap; }

.course-cover { position:relative; aspect-ratio:3/1; border-bottom:2px solid var(--ink); background:#171f32; }
.course-cover img, .course-cover canvas, .meadow-banner canvas { position:absolute; inset:0; width:100%; height:100%; image-rendering:pixelated; pointer-events:none; }
.meadow-banner { isolation:isolate; position:relative; overflow:hidden; background:#254e66 url("art/learning-meadow.webp") 70% center/cover; border:2px solid #629e99; min-height:clamp(15rem,29vw,22rem); align-content:end; }
.meadow-banner canvas { object-fit:cover; object-position:70% center; z-index:-2; }
.meadow-banner::after { content:""; position:absolute; inset:0; background:linear-gradient(90deg,#0b2035ef,#10273ac4 36%,transparent 78%); z-index:-1; }
.meadow-copy { align-self:end; padding:clamp(1.1rem,3.5vw,3rem); max-width:38rem; }
.world-home .meadow-copy h2 { color:#fff0bc; text-shadow:3px 3px #1e2037; }
.meadow-copy p { margin:.6rem 0 1rem; color:#fff; line-height:1.55; }
.meadow-copy a { display:inline-block; padding:.65rem .95rem; background:#ffe382; color:#25203a; font-weight:800; box-shadow:3px 3px #21233e; }
@media(max-width:560px) { .meadow-banner::after { background:linear-gradient(0deg,#10243af5,#10243aa6 55%,transparent); } .meadow-copy { padding-top:6rem; } }
.lab-page .study-actions,.quiz-top { display:flex; flex-wrap:wrap; align-items:center; gap:.65rem; margin-block:.9rem; }
.study-actions .workbench-link { display:inline-flex; align-items:center; margin:0; min-height:44px; padding:.55rem .9rem; font:700 1rem/1.35 var(--reading); }
.lab-page .quiz-launch { background:#332f4a; color:#f4dcff; cursor:pointer; border:1px solid #9383b7; }
.lab-page .lab-learn-block { border:1px solid #40516c; border-inline-start:3px solid #84d7c9; padding:clamp(.9rem,2vw,1.35rem); margin-block:1rem; background:#121f32; }
.lab-page .lab-learn-block-title { color:#a4ead9; font:750 1.15rem/1.4 var(--reading); }
.lab-page .lab-learn-card { padding:.8rem 0; border:0; border-bottom:1px solid #394a62; background:transparent; }
.lab-page :is(.lab-learn-card-body,.lab-learn-block-body,.lab-learn-topics) { font:400 1rem/1.65 var(--reading); color:#dae4ef; }
.quiz-dialog { width:min(35rem,94vw); padding:clamp(1rem,4vw,2rem); color:#eff7ff; background:#142036; }
.quiz-top { justify-content:space-between; margin-top:0; }
.quiz-dialog fieldset { border:0; padding:0; margin:1rem 0; min-width:0; }
.quiz-dialog legend { font:750 1.2rem/1.5 var(--reading); margin-bottom:.8rem; }
.quiz-dialog label { display:flex; gap:.7rem; align-items:center; cursor:pointer; padding:.7rem; min-height:44px; background:#1c3047; border:1px solid #586e85; margin:.45rem 0; }
.quiz-dialog label:has(:checked) { background:#244e4a; border-color:#91efd3; }
.quiz-dialog [role=status] { color:#c1f0df; line-height:1.55; margin-bottom:1rem; }
.quiz-dialog button:disabled { opacity:.6; }
.catalog-page { margin:0; background:#0b1322; color:#e3ebf5; font:1rem/1.55 system-ui,sans-serif; }
.catalog-page main,.catalog-page header { max-width:76rem; margin:auto; padding:1.5rem clamp(1rem,4vw,3rem); }
.catalog-page header { border-bottom:1px solid #36485f; }
.catalog-page h1 { margin:0; font-size:clamp(2rem,5vw,3.4rem); }
.catalog-page a { color:#a6f1de; text-underline-offset:.18em; }
.catalog-page nav { display:flex; flex-wrap:wrap; gap:1rem; margin:1.4rem 0; }
.catalog-list { display:grid; align-items:start; grid-template-columns:repeat(auto-fit,minmax(min(100%,20rem),1fr)); gap:1rem; }
.catalog-list section { background:#152337; border:1px solid #435b71; }
.catalog-list img { width:100%; height:auto; display:block; image-rendering:pixelated; }
.catalog-copy { padding:1.1rem; }
.catalog-copy h2 { margin:0; }
.catalog-copy details { padding:.75rem 0; border-top:1px solid #3c5066; }
.catalog-copy details:first-of-type { margin-top:1rem; }
.catalog-copy summary { font-weight:650; cursor:pointer; }
.catalog-copy li { padding:.3rem 0; }
.world-home .course-copy small { font:700 .94rem/1.5 var(--studio-font); letter-spacing:.015em; }
@media(max-width:620px){
  .world-home .hero-shade { background:linear-gradient(180deg,#0713238a 0%,#071323a6 38%,#07132318 65%,#07132312 82%,#0a1424bd); }
}
.study-chapter { margin:.6rem 0 1rem; background:#16283a; border-left:3px solid #a29ae1; }
.study-chapter:has(.lab-learn:empty) { display:none; }
.study-chapter>summary { cursor:pointer; padding:.8rem 1rem; font-weight:750; color:#e9e6ff; }
.study-chapter .lab-learn { padding:0 .75rem .75rem; }
.study-chapter .lab-learn-piece { padding:1rem; margin:.65rem 0; border:1px solid #465a72; background:#122133; }
.study-chapter .lab-learn-piece p { font-size:1rem; line-height:1.65; }
.study-actions .workbench-link { text-decoration:none; border:1px solid #6c9b95; background:#193736; }
.quiz-dialog label[data-result=correct] { border-color:#86e5b1; background:#234939; }
.quiz-dialog label[data-result=incorrect] { border-color:#e9a5b8; background:#462d3c; }

@font-face { font-family:Silkscreen; src:url("fonts/silkscreen-regular.ttf") format("truetype"); font-weight:400; font-display:swap; }
:root { --title-face:Pixel,monospace; --heading-ink:#a3efd4; --heading-light:#ffe5a1; --heading-extra:#a9ddff; }
html[data-theme=morning] { --heading-ink:#dcf3a8; --heading-light:#fff0bd; --heading-extra:#a8e9cb; }
html[data-theme=sunset], html[data-scene=neon-coast] { --heading-ink:#ffb3bc; --heading-light:#ffe294; --heading-extra:#aadcf0; }
html[data-theme=twilight],html:is([data-scene=cyberpunk],[data-scene=neon-forest]) { --heading-ink:#edaaff; --heading-light:#a8f6f0; --heading-extra:#ffcf9d; }
html[data-title-palette=orchard] { --heading-ink:#a9efc6; --heading-light:#fff0a7; --heading-extra:#b2dfff; }
html[data-title-palette=coast] { --heading-ink:#ffb4b0; --heading-light:#ffdf97; --heading-extra:#a2f0e8; }
html[data-title-palette=arcade] { --heading-ink:#f1adff; --heading-light:#94f7f2; --heading-extra:#ffd392; }
html[data-title-face=compact] { --title-face:Silkscreen,monospace; }
.world-home :is(h1,h2,h3,h4,.quick-world-intro>strong) { font-family:var(--title-face); font-weight:400; color:var(--heading-ink); letter-spacing:-.035em; }
.world-home h1#hero-title,.world-home h1#hero-title span { font-family:var(--title-face); color:var(--heading-light); }
.world-home h1#hero-title span { color:var(--heading-ink); }
.world-home :is(.section-heading,.meadow-copy,.weather-deck-heading,.studio-header,.studio-panel,.sound-mixer-header) h2 { font-family:var(--title-face); color:var(--heading-light); }
.world-home :is(.learning-card,.project-card,.game-card,.studio-panel) h3, .world-home .quick-world-intro>strong { font:400 clamp(.94rem,1.35vw,1.2rem)/1.6 var(--title-face); color:var(--heading-extra); }
.world-home .title-typeset .text-gold { color:var(--heading-extra); }
.world-home h2[data-pixel-display] { display:block; line-height:1.55; }
.world-home h2[data-pixel-display]>.pixel-display { display:none; }
html[data-title-face=sprite] .world-home h2>.title-typeset { display:none; }
html[data-title-face=sprite] .world-home h2[data-pixel-display]>.pixel-display { display:block; }
.world-home h2[data-pixel-display] .pixel-display rect { fill:var(--heading-light); }
.world-home .world-toolbar .sky-controls > button,.world-home .world-toolbar :is(#ambient-toggle,#sfx-toggle),.world-home .world-toolbar .coin-counter .coin-label { font:400 clamp(.94rem,1.15vw,1.1rem)/1.35 Silkscreen,monospace; color:var(--heading-light); letter-spacing:0; }
.world-home .world-toolbar .sky-controls > button:nth-child(3n+1) { color:var(--heading-ink); }
.world-home .world-toolbar .sky-controls > button:nth-child(3n+2) { color:var(--heading-extra); }
.studio-type-controls { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,11rem),1fr)); gap:.75rem; margin:1rem 0; }
.studio-type-controls label { display:grid; gap:.35rem; color:#e3eef8; }
.studio-type-controls select { width:100%; min-height:44px; color:#eef8fc; background:#18273d; border:1px solid #647a92; font:inherit; }

.results-page header nav { margin:0; }
.results-page footer { max-width:76rem; margin:auto; padding:2rem; }
.result-total { font-size:1.35rem; font-weight:750; color:var(--gold); }
.results-grid { margin-block:1.5rem; }
.results-grid section { padding:1.25rem; }
.results-grid h2 { color:var(--studio-mint); margin:0; }
.results-grid progress { width:100%; height:.8rem; accent-color:var(--studio-mint); }
.results-grid details { margin:1rem 0; }
.score-scroll { overflow-x:auto; margin:1.4rem 0; }
.score-scroll table { border-collapse:collapse; width:100%; }
.score-scroll th,.score-scroll td { padding:.6rem; text-align:start; border-bottom:1px solid var(--line); }
.score-scroll caption { text-align:start; color:var(--studio-mint); }
[data-practice-guide] details { padding:.7rem 0; }
.lab-example code { white-space:pre-wrap; overflow-wrap:anywhere; }
.mastery { padding:.8rem 1rem; margin:1rem 0; border:1px solid #486477; border-left:4px solid #71dfbb; background:#132137; color:#e2f1fc; font:1rem/1.45 var(--studio-font); }
.mastery strong { color:#ffdb86; }
.mastery p { margin:.25rem 0; }
.mastery a { color:#91eddb; }
.systems-page #chapter { color:#a2eedc; margin:1.8rem 0 .2rem; }
.systems-page #brief { max-width:64ch; font-size:1.1rem; }
.systems-page label { display:block; font-weight:650; margin-bottom:.4rem; }
.systems-page select,.systems-page input[type=number] { box-sizing:border-box; max-width:100%; font:inherit; background:#0c172a; color:#f3f6fe; border:1px solid #839bad; padding:.55rem; }
.sim-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,21rem),1fr)); gap:1rem; }
.sim-panel { padding:1rem 1.3rem; border:1px solid #486477; background:#142238; }
.sim-panel h2 { color:#a7efdf; }
.sim-panel code { white-space:normal; }
.sim-inputs,#check { display:flex; gap:.65rem; flex-wrap:wrap; align-items:center; }
#check label { width:100%; }
.sim-inputs { margin:.7rem 0 1.4rem; }
.sim-inputs input[type=range] { flex:1; min-width:7rem; accent-color:#8de9ce; }
.sim-panel input[type=number] { width:6rem; }
#model { display:flex; align-content:center; flex-wrap:wrap; gap:4px; min-height:7rem; padding:.7rem; background:#0a1525; }
#model i { width:12px; height:14px; background:#34445e; }
#model i.network { background:#67b9e3; } #model i.source { background:#80e5bb; } #model i.host { background:#ffd782; } #model i.alert { background:#f69d9d; }
#model.wave { position:relative; flex-wrap:nowrap; gap:2px; height:8rem; background:linear-gradient(#0a1525 49%,#6b8395 50%,#0a1525 51%); }
#model.wave i { position:relative; flex:1; background:#8fe7cd; }
.library-lesson { max-width:52rem; padding:1.25rem; background:#152337; border:1px solid #425e74; margin:1rem 0; }
.library-material { white-space:pre-line; }
.library-lesson h2 { color:#9ef2d3; }
.library-lesson input { display:block; font:inherit; margin:.5rem 0; border:1px solid #6986a2; color:white; background:#0a182a; padding:.6rem; }
@media (max-width:650px) {
  .world-home #pixel-world { filter:saturate(1.18) contrast(1.04); }
  .world-home .hero-shade { background:linear-gradient(180deg,#07132358 0%,#08152888 36%,#0b1a3210 61%,transparent 80%,#0a142474); }
  .world-home .hero-description { text-shadow:0 1px 3px #081323,0 1px 8px #081323; }
  .world-home .learning-card .course-cover img { filter:saturate(1.13); }
  .world-home .code-card { border-color:#55c6a7; }
  .world-home .ai-card { border-color:#a28be5; }
  .world-home .signal-card { border-color:#de9c61; }
}

/* Chunky control faces sit outside the reading and practice surfaces. */
.world-home .world-toolbar .sky-controls>button,
.world-home .weather-choices button,
.world-home .weather-deck-tools :is(button,select),
.world-home .studio-controls select,
.catalog-page .studio-control,.tools-page [role=tab] {
  border-radius:0; border-width:2px; border-style:solid;
  box-shadow:inset 0 2px #c9f5ff28, 3px 3px #061022;
}
.world-home .weather-name,.world-home .quick-world-choices span,
.tools-page [role=tab],.recordings h3 {
  font:400 clamp(1rem,1.2vw,1.15rem)/1.35 Silkscreen,monospace;
}
.world-home .quick-world-choices {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));flex:1;min-width:0}
.world-home .quick-world-choices>button {width:100%;min-width:0;border-radius:0}
.world-home .quick-world-choices img {image-rendering:pixelated}
.world-home .precipitation-size[hidden] {display:none}
@media(max-width:700px){.world-home .quick-world-choices{width:100%;grid-template-columns:repeat(2,minmax(0,1fr))}}
