/* MskProd Computational Thinking Adventure. Generated by build.py. */
/* ---- 00-base.css ---- */
/* Computational Thinking Adventure: the frame, buttons, cards and boxes.
   World colours arrive as --w (main), --wl (light wash) and --wd (deep). */
.ct-page .mascot-dock { display: none !important; }
.ct-shell { padding-bottom: var(--sp-7); }
.ct {
  --ct-card: var(--surface);
  --ct-card-2: var(--surface-2);
  --ct-line: var(--border);
  --ct-shadow: 0 10px 30px rgba(15, 32, 38, .10);
  --w: #0D9488; --wl: #CCFBF1; --wd: #115E59;
  position: relative; font-family: var(--font-body); color: var(--ink);
}
.ct .sr-only, .sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.ct h1, .ct h2, .ct h3 { font-family: var(--font-display); letter-spacing: -.01em; }
.ct a { color: inherit; }
.ct :focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
/* headings take focus on a new screen for screen readers; they need no ring */
.ct [tabindex="-1"]:focus, .ct-cel [tabindex="-1"]:focus { outline: none; }
.ct [hidden], .ct-cel [hidden] { display: none !important; }
.ct-kicker { margin: 0 0 .3rem; font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--wd); }
.ct-lead { font-size: var(--step-0); color: var(--ink-2); margin: .3rem 0 0; max-width: 60ch; }
.ctl-muted { font-size: .84rem; color: var(--ink-3); margin: .5rem 0 0; }

/* ------------------------------------------------------------- buttons */
.ct-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: .55rem 1.1rem; border-radius: 999px; cursor: pointer;
  font: 700 .95rem/1.2 var(--font-body); text-decoration: none; border: 2px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.ct-btn:hover { transform: translateY(-1px); }
.ct-btn:active { transform: translateY(1px); }
.ct-btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.ct-btn-big {
  min-height: 54px; padding: .8rem 1.6rem; font-size: 1.08rem; color: #fff;
  background: linear-gradient(135deg, color-mix(in srgb, var(--w) 50%, var(--wd)), var(--wd)); box-shadow: 0 8px 22px color-mix(in srgb, var(--w) 40%, transparent);
}
.ct-btn-big:hover { box-shadow: 0 12px 28px color-mix(in srgb, var(--w) 50%, transparent); color: #fff; }
.ct-btn-go { color: #fff; background: linear-gradient(135deg, #0F766E, #115E59); box-shadow: 0 6px 16px rgba(13, 148, 136, .3); }
.ct-btn-go:hover { color: #fff; }
.ct-btn-soft { color: var(--ink); background: var(--ct-card); border-color: var(--border-strong); }
.ct-btn-ghost { color: var(--ink); background: transparent; border-color: var(--border-strong); }
.ct-btn-danger { color: #fff; background: #B91C1C; }
.ct-btn-mini { min-height: 36px; padding: .35rem .8rem; font-size: .84rem; color: var(--ink-2); background: var(--ct-card-2); border-color: var(--ct-line); }

/* --------------------------------------------------------------- cards */
.ct-card {
  display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left;
  min-height: 48px; padding: .55rem .8rem; border-radius: 14px; cursor: grab; touch-action: none;
  font: 600 .95rem/1.3 var(--font-body); color: var(--ink);
  background: var(--ct-card); border: 2px solid var(--ct-line); box-shadow: 0 2px 0 var(--ct-line), 0 4px 12px rgba(15, 32, 38, .06);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, opacity .15s ease;
  -webkit-user-select: none; user-select: none;
}
.ct-card:hover { transform: translateY(-2px); border-color: var(--w); }
.ct-card-i { flex: none; font-size: 1.35rem; line-height: 1; }
.ct-card-t { min-width: 0; overflow-wrap: break-word; hyphens: auto; }
/* In a narrow column the icon sits above the words, so the words get the full width. */
.ctr-col, .cas-st { container-type: inline-size; }
@container (max-width: 190px) {
  .ct-card { flex-direction: column; gap: .2rem; padding: .45rem .4rem; text-align: center; font-size: .86rem; }
}
.ct-card.is-picked { border-color: var(--w); box-shadow: 0 0 0 4px color-mix(in srgb, var(--w) 30%, transparent), 0 10px 24px rgba(15, 32, 38, .15); transform: translateY(-3px) scale(1.02); }
.ct-card.is-dragging { opacity: .35; }
.ct-card.is-wrong { border-color: #DC2626; background: #FEF2F2; animation: ct-shake .4s ease 1; }
.ct-card.is-right { border-color: #059669; background: #ECFDF5; }
.ct-ghost { position: fixed; left: 0; top: 0; z-index: 9000; pointer-events: none; opacity: .95; box-shadow: 0 18px 36px rgba(15, 32, 38, .25); }
.ct-hand { position: fixed; left: 0; top: 0; z-index: 9001; width: 34px; height: 34px; margin: 6px 0 0 -8px; pointer-events: none; }
.ct-hand svg { width: 100%; height: 100%; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .25)); }
@keyframes ct-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }

.ct-problem {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; margin: 0 0 1rem;
  padding: .8rem 1rem; border-radius: 16px; font: 700 1.05rem/1.35 var(--font-display);
  background: linear-gradient(135deg, var(--wl), var(--ct-card)); border: 2px solid color-mix(in srgb, var(--w) 45%, transparent);
}
.ct-problem-k { font: 800 .72rem/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--wd); padding: .3rem .55rem; border-radius: 999px; }

.ct-tray {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: .55rem;
  padding: .8rem; margin-bottom: 1rem; border-radius: 16px; background: var(--ct-card-2); border: 2px dashed var(--border-strong);
}
.ct-tray-h { grid-column: 1 / -1; max-width: none; margin: 0; font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.ct-tray-empty { grid-column: 1 / -1; margin: .2rem 0; font-weight: 700; color: var(--ok); }

.ct-drop {
  display: none; align-self: flex-start; margin: .2rem 0 .3rem; padding: .3rem .8rem; border-radius: 999px; cursor: pointer;
  font: 800 .8rem/1.2 var(--font-body); color: #fff; background: var(--wd); border: 0;
}
.ct-picking .ct-drop { display: inline-flex; animation: ct-pulse 1.2s ease-in-out infinite; }
@keyframes ct-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--w) 45%, transparent); } 50% { box-shadow: 0 0 0 6px transparent; } }

.cg-zones { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.cg-zone, .ct-zone {
  display: flex; flex-direction: column; gap: .45rem; min-height: 150px; padding: .75rem; border-radius: 18px;
  background: color-mix(in srgb, var(--wl) 55%, var(--ct-card)); border: 2px dashed color-mix(in srgb, var(--w) 55%, transparent);
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.cg-zone.is-over, .ct-zone.is-over { border-style: solid; border-color: var(--w); transform: scale(1.01); background: var(--wl); }
.ct-picking .cg-zone, .ct-picking .ct-zone { border-color: var(--w); }
.cg-zone-h { display: flex; align-items: center; gap: .5rem; font: 700 1rem/1.25 var(--font-display); }
.cg-zone-i { font-size: 1.5rem; }
.cg-count { margin-left: auto; min-width: 1.7rem; height: 1.7rem; display: inline-grid; place-items: center; border-radius: 999px;
  font: 800 .8rem/1 var(--font-body); color: #fff; background: color-mix(in srgb, var(--w) 50%, var(--wd)); }
.ct-chip { display: inline-block; padding: .18rem .55rem; border-radius: 999px; font: 800 .72rem/1.2 var(--font-body);
  letter-spacing: .05em; text-transform: uppercase; color: #fff; background: var(--wd); }

/* multiple choice, used by Remember and the daily challenge */
.ct-mcq { display: grid; gap: .55rem; margin: .8rem 0; }
.ct-mcq-opt { text-align: left; min-height: 48px; padding: .7rem 1rem; border-radius: 14px; cursor: pointer;
  font: 600 1rem/1.35 var(--font-body); color: var(--ink); background: var(--ct-card); border: 2px solid var(--ct-line); }
.ct-mcq-opt:hover:not([disabled]) { border-color: var(--w); }
.ct-mcq-opt.is-right { border-color: #059669; background: #ECFDF5; }
.ct-mcq-opt.is-wrong { border-color: #DC2626; background: #FEF2F2; }
.ct-mcq-opt[disabled] { cursor: default; }

.ct-toast {
  position: fixed; left: 50%; top: 18%; z-index: 9500; transform: translate(-50%, -20px) scale(.9); opacity: 0;
  padding: .9rem 1.4rem; border-radius: 18px; font: 800 1.15rem/1.3 var(--font-display); color: #fff;
  background: linear-gradient(135deg, #C2410C, #9A3412); box-shadow: 0 16px 40px rgba(0, 0, 0, .25);
  transition: transform .3s cubic-bezier(.3, .7, .4, 1.4), opacity .3s ease;
}
.ct-toast.is-on { transform: translate(-50%, 0) scale(1); opacity: 1; }

/* the companion: Pixel with a speech bubble */
.ct-companion { display: flex; align-items: flex-end; gap: .6rem; }
.ct-companion-cat { flex: none; width: 96px; }
.ct-companion-cat .px { width: 100%; height: auto; }
.ct-say {
  position: relative; flex: 1; min-width: 0; padding: .7rem .9rem; border-radius: 18px 18px 18px 6px;
  background: var(--ct-card); border: 2px solid color-mix(in srgb, var(--w) 40%, var(--ct-line)); box-shadow: var(--ct-shadow);
}
.ct-say-text { margin: 0; font-weight: 600; font-size: .95rem; line-height: 1.45; }
.ct-say.is-pop { animation: ct-pop .35s cubic-bezier(.3, .7, .4, 1.4) 1; }
@keyframes ct-pop { from { transform: scale(.9); opacity: .4; } to { transform: scale(1); opacity: 1; } }
[data-ct-motion="calm"] .ct-say.is-pop, [data-ct-motion="calm"] .ct-card.is-wrong, [data-ct-motion="calm"] .ct-picking .ct-drop { animation: none; }

/* The drawn pictures (static/js/ct/14-icons.js) and the site's line icons. */
.ct-ico { display: inline-block; width: 1.25em; height: 1.25em; vertical-align: -.3em; flex: none; line-height: 1; }
.ct-ico svg { display: block; width: 100%; height: 100%; max-width: none; }
.ct-ui { display: inline-flex; vertical-align: -.15em; }
.ct-ui .icon { width: 1.1em; height: 1.1em; }
.ct-icorow { display: inline-flex; gap: .15em; align-items: center; }
.ct-icosvg { overflow: visible; max-width: none; }
/* ---- 10-pixel.css ---- */
/* Pixel, the adventure companion. The rig (mskbuild/cat.py rig()) carries every
   pose's pieces; a class on the <svg> picks which are shown and how they move.
   Poses: is-wave, is-think, is-happy, is-cheer, is-proud. Accessories: wear-*. */
.px { display: block; overflow: visible; }
.px .px-arm, .px .px-trophy, .px .px-eyes-happy, .px .px-m, .px .px-acc, .px .px-q, .px .px-spark { display: none; }
.px .px-arm-rest, .px .px-m-smile { display: inline; }

.px.is-wave .px-arm-r.px-arm-rest, .px.is-proud .px-arm-r.px-arm-rest,
.px.is-think .px-arm-l.px-arm-rest, .px.is-cheer .px-arm-rest { display: none; }
.px.is-wave .px-arm-wave, .px.is-cheer .px-arm-cheer, .px.is-think .px-arm-scratch,
.px.is-proud .px-arm-hold, .px.is-proud .px-trophy { display: inline; }

.px.is-happy .px-eyes, .px.is-cheer .px-eyes, .px.is-proud .px-eyes { display: none; }
.px.is-happy .px-eyes-happy, .px.is-cheer .px-eyes-happy, .px.is-proud .px-eyes-happy { display: inline; }
.px.is-cheer .px-m-smile, .px.is-proud .px-m-smile, .px.is-think .px-m-smile { display: none; }
.px.is-cheer .px-m-grin, .px.is-proud .px-m-grin, .px.is-think .px-m-o, .px.is-think .px-q { display: inline; }
.px.is-happy .px-spark, .px.is-cheer .px-spark, .px.is-proud .px-spark { display: inline; }

.px.wear-party .px-acc-party, .px.wear-shades .px-acc-shades, .px.wear-scarf .px-acc-scarf,
.px.wear-wizard .px-acc-wizard, .px.wear-crown .px-acc-crown { display: inline; }
/* a hat replaces the visor's little light, and only one hat at a time */
.px.wear-wizard .px-acc-party, .px.wear-crown .px-acc-party, .px.wear-crown .px-acc-wizard { display: none; }

.px .px-all, .px .px-head, .px .px-eyes, .px .px-arm-wave, .px .px-arm-scratch, .px .px-q, .px .px-spark,
.px .px-trophy, .px .px-shadow, .px .px-arm-cheer { transform-box: view-box; }
.px .px-all { transform-origin: 50px 90px; }
.px .px-head { transform-origin: 50px 76px; transition: transform .35s ease; }
.px .px-eyes { transform-origin: 50px 53px; }
.px .px-arm-wave { transform-origin: 70px 77px; }
.px .px-arm-scratch { transform-origin: 30px 77px; }
.px .px-arm-cheer { transform-origin: 50px 77px; }
.px .px-trophy { transform-origin: 102px 52px; }
.px .px-shadow { transform-origin: 50px 91px; }
.px .px-q { transform-origin: 92px 2px; }
.px .px-spark-1 { transform-origin: 4px 4px; }
.px .px-spark-2 { transform-origin: 100px 18px; }
.px .px-spark-3 { transform-origin: -4px 56px; }

@media (prefers-reduced-motion: no-preference) {
  [data-motion="full"] .px .px-eyes { animation: px-blink 5.2s infinite; }
  [data-motion="full"] .px.is-idle .px-all { animation: px-breathe 3.4s ease-in-out infinite; }
  [data-motion="full"] .px.is-wave .px-arm-wave { animation: px-wave .55s ease-in-out infinite alternate; }
  [data-motion="full"] .px.is-think .px-head { transform: rotate(-7deg); }
  [data-motion="full"] .px.is-think .px-arm-scratch { animation: px-scratch .5s ease-in-out infinite alternate; }
  [data-motion="full"] .px.is-think .px-q { animation: px-bob 1.4s ease-in-out infinite; }
  [data-motion="full"] .px.is-happy .px-all { animation: px-jump .62s cubic-bezier(.3,.7,.4,1.3) 3; }
  [data-motion="full"] .px.is-happy .px-shadow { animation: px-shadow .62s cubic-bezier(.3,.7,.4,1.3) 3; }
  [data-motion="full"] .px.is-cheer .px-all { animation: px-dance 1.6s ease-in-out infinite; }
  [data-motion="full"] .px.is-cheer .px-arm-cheer { animation: px-arms .4s ease-in-out infinite alternate; }
  [data-motion="full"] .px.is-proud .px-trophy { animation: px-shine 1.8s ease-in-out infinite; }
  [data-motion="full"] .px .px-spark { animation: px-twinkle 1.3s ease-in-out infinite; }
  [data-motion="full"] .px .px-spark-2 { animation-delay: .4s; }
  [data-motion="full"] .px .px-spark-3 { animation-delay: .8s; }
}
.px.is-think .px-head { transform: rotate(-7deg); }

@keyframes px-blink { 0%, 45%, 49%, 100% { transform: scaleY(1); } 47% { transform: scaleY(.12); } }
@keyframes px-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.012, .988); } }
@keyframes px-wave { from { transform: rotate(-10deg); } to { transform: rotate(8deg); } }
@keyframes px-scratch { from { transform: rotate(-4deg); } to { transform: rotate(5deg); } }
@keyframes px-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes px-jump { 0%, 100% { transform: translateY(0) scale(1, 1); } 15% { transform: translateY(0) scale(1.06, .92); }
  50% { transform: translateY(-18px) scale(.97, 1.04); } 85% { transform: translateY(0) scale(1.04, .95); } }
@keyframes px-shadow { 0%, 100% { transform: scale(1); opacity: .16; } 50% { transform: scale(.7); opacity: .08; } }
@keyframes px-dance {
  0% { transform: translateY(0) rotate(0); } 12% { transform: translateY(-10px) rotate(-8deg); }
  25% { transform: translateY(0) rotate(0); } 37% { transform: translateY(-10px) rotate(8deg); }
  50% { transform: translateY(0) rotate(0); } 62% { transform: translateY(-16px) rotate(0) scale(1.04); }
  80% { transform: translateY(-6px) rotate(360deg); } 100% { transform: translateY(0) rotate(360deg); } }
@keyframes px-arms { from { transform: scaleY(1); } to { transform: scaleY(.94) translateY(3px); } }
@keyframes px-shine { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(6deg) scale(1.05); } }
@keyframes px-twinkle { 0%, 100% { transform: scale(.4); opacity: .3; } 50% { transform: scale(1.15); opacity: 1; } }
/* ---- 20-views.css ---- */
/* The screens around the levels: HUD, island map, world path, Me and daily. */
.ct-hud {
  position: sticky; top: 64px; z-index: 40; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  margin: 0 0 1.2rem; padding: .5rem .7rem; border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--border); box-shadow: var(--shadow-1);
}
.ct-hud-home { font: 800 .95rem/1 var(--font-display); text-decoration: none; padding: .45rem .6rem; border-radius: 12px; }
.ct-hud-home:hover { background: var(--surface-2); }
.ct-hud-stats { display: flex; gap: .35rem; flex-wrap: wrap; margin-left: auto; }
.ct-hud-chip { display: inline-flex; align-items: center; gap: .25rem; padding: .32rem .6rem; border-radius: 999px;
  font-size: .86rem; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); }
.ct-hud-btns { display: flex; gap: .35rem; }
.ct-hud-btn { min-width: 44px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 .6rem;
  border-radius: 12px; font-size: 1.05rem; font-weight: 700; text-decoration: none; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--ink); }
.ct-hud-btn[aria-pressed="true"] { background: var(--accent-quiet); border-color: var(--teal); }
/* Focus scrolling clears the site header and this bar together. */
@media (min-width: 641px) { html:has(.ct-hud) { scroll-padding-top: 8.75rem; } }
@media (max-width: 640px) {
  .ct-hud { position: static; }
  .ct-hud-home { font-size: .85rem; }
  .ct-hud-pct, .ct-hud-me span { display: none; }
  .ct-hud-stats { margin-left: 0; order: 3; width: 100%; justify-content: space-between; }
  .ct-hud-btns { margin-left: auto; }
}

/* ----------------------------------------------------------------- home */
.ct-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.4rem; align-items: center; margin-bottom: 1.2rem; }
.ct-home-h { font-size: var(--step-4); line-height: 1.05; margin: .2rem 0 .4rem; }
.ct-home-h span { display: block; background: linear-gradient(90deg, #EA580C, #0284C7 35%, #9333EA 65%, #059669); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ct-hero-btns { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; }
.ct-hero .ct-btn-big { --w: #0D9488; --wd: #115E59; }
.ct-home-pal .ct-companion-cat { width: 150px; }
@media (max-width: 760px) { .ct-hero { grid-template-columns: 1fr; } .ct-home-pal .ct-companion-cat { width: 110px; } }

.ct-map { position: relative; margin: 0 0 1.4rem; border-radius: 28px; overflow: hidden; box-shadow: var(--ct-shadow); }
.ct-map-svg { display: block; width: 100%; height: auto; }
.ct-map-svg .sea-a { stop-color: #BAE6FD; } .ct-map-svg .sea-b { stop-color: #7DD3FC; }
.ct-waves path { fill: none; stroke: #fff; stroke-opacity: .55; stroke-width: 3; stroke-linecap: round; }
.ct-route { fill: none; stroke: #fff; stroke-width: 6; stroke-dasharray: 2 16; stroke-linecap: round; }
[data-ct-motion="full"] .ct-route { animation: ct-route 6s linear infinite; }
@keyframes ct-route { to { stroke-dashoffset: -180; } }
.ct-isle { cursor: pointer; outline: none; }
.ct-isle > g { transition: transform .2s ease; }
.ct-isle:hover > g, .ct-isle:focus-visible > g { filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .25)); }
.ct-isle:focus-visible rect { stroke-width: 6; }
.ct-isle-name { font: 800 17px var(--font-display); text-anchor: middle; }
.ct-isle-sub { font: 600 12.5px var(--font-body); text-anchor: middle; fill: #334155; }
.ct-map-pixel { position: absolute; width: 11%; min-width: 64px; transform: translate(-50%, -10%); pointer-events: none; }
.ct-map-pixel .px { width: 100%; height: auto; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .25)); }

.ct-worlds { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); margin-bottom: 1.4rem; }
.ct-world-card {
  display: block; padding: 1rem 1.1rem; border-radius: 20px; text-decoration: none;
  background: linear-gradient(160deg, var(--wl), var(--surface) 70%); border: 2px solid color-mix(in srgb, var(--w) 40%, transparent);
  box-shadow: var(--shadow-1); transition: transform .15s ease, box-shadow .15s ease;
}
.ct-world-card:hover { transform: translateY(-3px); box-shadow: var(--ct-shadow); }
.ct-world-card h2 { margin: .2rem 0 .1rem; font-size: var(--step-1); }
.ct-world-n { font: 800 .74rem/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--wd); padding: .28rem .55rem; border-radius: 999px; }
.ct-world-tag { margin: 0 0 .6rem; font-weight: 700; color: var(--wd); }
.ct-world-meta { margin: .45rem 0 0; font-size: .86rem; color: var(--ink-3); }
.ct-world-next { margin: .3rem 0 0; font-size: .86rem; font-weight: 700; }
.ct-bar { height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.ct-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--w), var(--wd)); transition: width .6s ease; }

.ct-extras { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); }
.ct-extra { display: flex; gap: .75rem; align-items: center; padding: .8rem .9rem; border-radius: 16px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1); transition: transform .15s ease; }
.ct-extra:hover { transform: translateY(-2px); }
.ct-extra-i { font-size: 1.7rem; }
.ct-extra b { display: block; font-family: var(--font-display); }
.ct-extra small { display: block; color: var(--ink-3); font-size: .84rem; margin-top: .1rem; }

/* ---------------------------------------------------------------- world */
.ct-world-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .4rem 1rem; align-items: center; margin-bottom: 1rem;
  padding: 1.1rem 1.2rem; border-radius: 24px; background: linear-gradient(135deg, var(--wl), var(--surface)); border: 2px solid color-mix(in srgb, var(--w) 35%, transparent); }
.ct-world-head .ct-back { grid-column: 1 / -1; }
.ct-world-head h1 { margin: 0; font-size: var(--step-3); line-height: 1.1; }
.ct-world-head h1 span { color: var(--wd); }
.ct-back { display: inline-block; font-weight: 700; text-decoration: none; padding: .3rem .5rem; margin-left: -.5rem; border-radius: 10px; }
.ct-back:hover { background: var(--surface-2); }
.ct-world-stats { display: flex; gap: .9rem; align-items: center; }
.ct-world-stats b { display: block; font-family: var(--font-display); }
.ct-world-stats small { color: var(--ink-3); }
.ct-ring { width: 64px; }
.ct-ring svg { display: block; width: 100%; }
.ct-ring .bg { fill: none; stroke: var(--surface-2); stroke-width: 7; }
.ct-ring .fg { fill: none; stroke: var(--w); stroke-width: 7; stroke-linecap: round; }
.ct-ring text { font: 800 12px var(--font-body); text-anchor: middle; fill: var(--ink); }
.ct-world-badge { width: 84px; text-align: center; opacity: .65; }
.ct-world-badge.is-earned { opacity: 1; }
.ct-world-badge small { display: block; font-size: .72rem; line-height: 1.2; }
.ct-medal svg { display: block; width: 100%; height: auto; }
@media (max-width: 760px) { .ct-world-head { grid-template-columns: 1fr; } .ct-world-stats { flex-wrap: wrap; } }

.ct-world-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1rem; align-items: start; }
@media (max-width: 980px) { .ct-world-grid { grid-template-columns: 1fr; } .ct-world-side { order: -1; } }
.ct-world-side { display: grid; gap: .9rem; position: sticky; top: 140px; }
.ct-next-card { padding: 1rem; border-radius: 20px; background: var(--surface); border: 2px solid color-mix(in srgb, var(--w) 40%, transparent); box-shadow: var(--shadow-1); }
.ct-next-card h2 { margin: .1rem 0 .4rem; font-size: var(--step-1); }
.ct-next-card p { margin: 0 0 .8rem; color: var(--ink-2); }

.ct-path { position: relative; width: 100%; border-radius: 26px; overflow: hidden;
  background: radial-gradient(circle at 20% 10%, var(--wl), transparent 55%), radial-gradient(circle at 80% 90%, var(--wl), transparent 50%), var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-1); }
.ct-path-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ct-path-svg .road { fill: none; stroke: color-mix(in srgb, var(--w) 25%, var(--surface-2)); stroke-width: 34; stroke-linecap: round; }
.ct-path-svg .road-dash { fill: none; stroke: #fff; stroke-width: 3; stroke-dasharray: 10 14; stroke-opacity: .9; }
.ct-path-svg .road-done { fill: none; stroke: var(--w); stroke-width: 12; stroke-linecap: round; opacity: .85; }
.ct-path-svg .dc { fill: var(--w); stroke: var(--w); stroke-width: 3; opacity: .12; }
.ct-node-li { position: absolute; transform: translate(-50%, -50%); }
.ct-node { position: relative; display: flex; flex-direction: column; align-items: center; gap: .3rem;
  width: 150px; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: var(--ink); }
.ct-node-dot { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 50%;
  font: 800 1.35rem/1 var(--font-display); color: #fff; background: linear-gradient(145deg, var(--w), var(--wd));
  border: 4px solid #fff; box-shadow: 0 6px 0 var(--wd), 0 10px 20px rgba(0, 0, 0, .18); transition: transform .15s ease; }
.ct-node:hover .ct-node-dot, .ct-node:focus-visible .ct-node-dot { transform: translateY(-3px) scale(1.06); }
.ct-node.is-done .ct-node-dot { background: linear-gradient(145deg, #F5B700, #D97706); box-shadow: 0 6px 0 #B45309, 0 10px 20px rgba(0, 0, 0, .18); }
.ct-node.is-locked .ct-node-dot { background: #CBD5E1; box-shadow: 0 6px 0 #94A3B8; font-size: 1.1rem; }
.ct-node.is-current .ct-node-dot { animation: ct-node-pulse 1.6s ease-in-out infinite; }
[data-ct-motion="calm"] .ct-node.is-current .ct-node-dot { animation: none; box-shadow: 0 0 0 6px color-mix(in srgb, var(--w) 35%, transparent), 0 6px 0 var(--wd); }
@keyframes ct-node-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--w) 50%, transparent), 0 6px 0 var(--wd); } 50% { box-shadow: 0 0 0 12px transparent, 0 6px 0 var(--wd); } }
.ct-node-label { display: flex; flex-direction: column; align-items: center; padding: .25rem .55rem; border-radius: 12px; text-align: center;
  background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: var(--shadow-1); font-size: .82rem; line-height: 1.2; }
.ct-node-label b { font-weight: 700; }
.ct-node-stars i { font-style: normal; color: #CBD5E1; font-size: .9rem; }
.ct-node-stars i.on { color: #F5B700; }
.ct-node.is-locked .ct-node-label { opacity: .7; }
.ct-path-pixel { position: absolute; width: 74px; transform: translate(-30%, -150%); pointer-events: none; }
.ct-path-pixel .px { width: 100%; height: auto; }
@media (max-width: 639px) { .ct-node { width: 130px; } .ct-path-pixel { width: 60px; transform: translate(-30%, -150%); } }

/* ------------------------------------------------------------- Me, daily */
.ct-me-head { margin-bottom: 1rem; }
.ct-me-head h1, .is-daily h1 { margin: .2rem 0 .3rem; font-size: var(--step-3); }
.ct-me-stats { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); margin-bottom: 1.2rem; }
.ct-stat { padding: .8rem; border-radius: 16px; text-align: center; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1); }
.ct-stat span { font-size: 1.4rem; }
.ct-stat b { display: block; font: 800 1.35rem/1.2 var(--font-display); }
.ct-stat small { color: var(--ink-3); }
.ct-me-sec { margin: 0 0 1.4rem; }
.ct-me-sec h2 { font-size: var(--step-2); margin: 0 0 .7rem; }
.ct-me-worlds { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.ct-me-world { display: grid; gap: .35rem; padding: .7rem .9rem; border-radius: 14px; text-decoration: none; background: var(--surface); border: 1px solid var(--border); }
.ct-me-world small { color: var(--ink-3); }
.ct-badges { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.ct-badge { display: grid; justify-items: center; gap: .3rem; padding: .8rem .6rem; border-radius: 16px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); opacity: .75; }
.ct-badge.is-earned { opacity: 1; border-color: #F5B700; box-shadow: 0 0 0 3px rgba(245, 183, 0, .25); }
.ct-badge .ct-medal { width: 70px; }
.ct-badge small { color: var(--ink-3); font-size: .78rem; line-height: 1.3; }
.ct-chests { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.ct-chest { display: grid; justify-items: center; gap: .35rem; padding: .8rem; border-radius: 16px; text-align: center; background: var(--surface); border: 1px solid var(--border); }
.ct-chest-i { font-size: 2rem; }
.ct-chest.is-ready { border: 2px solid #F59E0B; box-shadow: 0 0 0 4px rgba(245, 158, 11, .2); }
[data-ct-motion="full"] .ct-chest.is-ready .ct-chest-i { animation: ct-wiggle 1.2s ease-in-out infinite; }
@keyframes ct-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
.ct-chest small { color: var(--ink-3); }
.ct-wardrobe { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.ct-wardrobe-cat { width: 140px; }
.ct-wardrobe-cat .px { width: 100%; height: auto; }
.ct-wardrobe-list { display: flex; gap: .5rem; flex-wrap: wrap; flex: 1; }
.ct-chipbtn { min-height: 40px; padding: .4rem .9rem; border-radius: 999px; cursor: pointer; font: 700 .9rem var(--font-body);
  background: var(--surface); color: var(--ink); border: 2px solid var(--border-strong); }
.ct-chipbtn.is-on { border-color: var(--teal); background: var(--accent-quiet); }
.ct-certs { display: flex; flex-wrap: wrap; gap: .5rem; }
.ct-cert-link { padding: .55rem .9rem; border-radius: 999px; text-decoration: none; font-weight: 700; background: var(--surface-2); border: 1px solid var(--border); opacity: .8; }
.ct-cert-link.is-ready { opacity: 1; background: #FEF3C7; border-color: #F59E0B; color: #78350F; }
.ct-settings { display: grid; gap: .7rem; max-width: 520px; }
.ct-switch, .ct-select { display: flex; align-items: center; gap: .6rem; font-weight: 600; }
.ct-switch input { width: 1.3rem; height: 1.3rem; accent-color: var(--teal); }
.ct-select select { padding: .45rem .6rem; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); font: inherit; }
.ct-daily { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 800px) { .ct-daily { grid-template-columns: 1fr; } }
.ct-daily-card { padding: 1.2rem; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1); }
.ct-daily-card h2 { margin: .2rem 0 .4rem; font-size: var(--step-2); }
.is-daily { --w: #F59E0B; --wd: #B45309; --wl: #FEF3C7; }
/* ---- 30-level.css ---- */
/* The level player. */
.ctl-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .8rem; align-items: center; margin-bottom: .7rem;
  padding: .8rem 1rem; border-radius: 22px; background: linear-gradient(135deg, var(--wl), var(--surface)); border: 2px solid color-mix(in srgb, var(--w) 35%, transparent); }
.ctl-back { font-weight: 700; text-decoration: none; padding: .45rem .7rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); white-space: nowrap; }
.ctl-h { margin: 0; font-size: var(--step-3); line-height: 1.1; }
.ctl-kicker { margin: 0 0 .2rem; font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.ctl-num { color: var(--wd); }
.ctl-band { padding: .12rem .5rem; border-radius: 999px; color: #fff; background: #0F766E; }
.ctl-band-intermediate { background: #2563EB; } .ctl-band-advanced { background: #9333EA; } .ctl-band-expert { background: #DC2626; }
.ctl-preview { margin-left: .4rem; padding: .12rem .5rem; border-radius: 999px; color: #78350F; background: #FDE68A; }
.ctl-best { display: flex; gap: .1em; font-size: 1.6rem; }
@media (max-width: 640px) {
  .ctl-top { grid-template-columns: 1fr auto; }
  .ctl-back { grid-column: 1 / -1; justify-self: start; }
  .ctl-best { font-size: 1.2rem; }
}

.ctl-steps-wrap { margin: 0 0 1rem; }
.ctl-steps { display: flex; gap: .4rem; list-style: none; margin: 0; padding: 0; counter-reset: s; }
.ctl-step { counter-increment: s; flex: 1; padding: .45rem .5rem; border-radius: 12px; text-align: center; font-size: .85rem; font-weight: 700;
  color: var(--ink-3); background: var(--surface-2); border: 1px solid var(--border); }
.ctl-step::before { content: counter(s) " "; font-weight: 800; }
.ctl-step.is-past { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.ctl-step.is-past::before { content: ""; display: inline-block; width: .32em; height: .62em; margin-right: .5em; border: solid currentColor; border-width: 0 .14em .14em 0; transform: translateY(-.1em) rotate(45deg); }
.ctl-step.is-on { color: #fff; background: linear-gradient(135deg, color-mix(in srgb, var(--w) 50%, var(--wd)), var(--wd)); border-color: transparent; box-shadow: 0 4px 12px color-mix(in srgb, var(--w) 35%, transparent); }

.ctl-body { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 900px) { .ctl-body { grid-template-columns: 1fr; } .ctl-side { order: 2; } }
.ctl-side { display: grid; gap: .8rem; position: sticky; top: 140px; }
@media (max-width: 900px) { .ctl-side { position: static; } }
.ctl-pal .ct-companion-cat { width: 104px; }
.ctl-card { padding: .8rem .9rem; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1); }
.ctl-card h2 { margin: 0 0 .3rem; font-size: 1rem; }
.ctl-card p { margin: 0; color: var(--ink-2); }
.ctl-task .ct-btn-mini { margin-top: .6rem; }
.ctl-hints { margin: .2rem 0 0; padding-left: 1.3rem; }
.ctl-hints li { margin: .35rem 0; font-weight: 600; color: var(--ink); }
.ctl-hints li.is-new { animation: ct-pop .35s ease 1; }

.ctl-main { min-width: 0; }
.ctl-taskline { display: none; margin: 0 0 .7rem; padding: .6rem .8rem; border-radius: 14px; font-weight: 700; background: var(--wl); border: 2px solid color-mix(in srgb, var(--w) 40%, transparent); }
@media (max-width: 900px) { [data-phase="play"] .ctl-taskline { display: block; } }
.ctl-stage { min-height: 320px; }
.ctl-panel { padding: 1.3rem; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1); }
.ctl-learn-text { font-size: var(--step-1); line-height: 1.5; margin: .2rem 0 1rem; max-width: 60ch; }
.ctl-learn-btns { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .8rem; }
.ctl-skip { margin-top: .8rem; background: none; border: 0; color: var(--ink-3); text-decoration: underline; cursor: pointer; font: inherit; }
.ctl-remember h2 { font-size: var(--step-2); margin: .2rem 0 .3rem; }
.ctl-why { margin: .6rem 0; padding: .6rem .8rem; border-radius: 12px; background: var(--surface-2); font-weight: 600; }
.ctl-watchbar { display: flex; align-items: center; gap: .7rem; margin: 0 0 .8rem; padding: .6rem .8rem; border-radius: 14px;
  background: #FEF3C7; color: #78350F; border: 2px solid #F59E0B; }
.ctl-watchbar .ctl-kicker { margin: 0; color: inherit; }
.ctl-caption { margin: 0; font-weight: 700; }
[data-phase="watch"] .ctl-board { pointer-events: none; }
.ctl-board { padding: 1rem; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1); }
.ctl-controls { position: sticky; bottom: .6rem; z-index: 20; display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; padding: .6rem;
  border-radius: 18px; background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--border); box-shadow: var(--ct-shadow); }
.ctl-controls .ct-btn-go { flex: 1 1 160px; font-size: 1.05rem; }
/* Keep a focused card clear of the sticky bar, so Tab never hides it underneath. */
html:has(.ctl-controls:not([hidden])) { scroll-padding-bottom: 8rem; }
.ctl-feedback { margin-top: .7rem; min-height: 1.4rem; font-weight: 700; }
.ctl-feedback:empty { display: none; }
.ctl-feedback.is-bad { padding: .7rem .9rem; border-radius: 14px; color: var(--bad); background: var(--bad-bg); border: 1px solid var(--bad); }
.ctl-feedback.is-good { padding: .7rem .9rem; border-radius: 14px; color: var(--ok); background: var(--ok-bg); border: 1px solid var(--ok); }
.ctl-feedback.is-info { padding: .7rem .9rem; border-radius: 14px; color: var(--ink); background: #FEF3C7; border: 1px solid #F59E0B; }

/* the Learn picture, one per world */
.ctl-art { max-width: 420px; margin: 0 0 .6rem; }
.ctl-art svg { display: block; width: 100%; height: auto; }
.ctl-art text { font: 700 12px var(--font-body); text-anchor: middle; fill: #fff; }
.ctl-art .ln { fill: none; stroke: var(--w); stroke-width: 3; stroke-linecap: round; }
.ctl-art-decomposition .a1 { fill: var(--wd); }
.ctl-art-decomposition .a2 { fill: var(--w); }
[data-ct-motion="full"] .ctl-art-decomposition .a2 { animation: ct-drop-in .6s cubic-bezier(.3, .7, .4, 1.4) both; }
[data-ct-motion="full"] .ctl-art-decomposition .d1 { animation-delay: .15s; } [data-ct-motion="full"] .ctl-art-decomposition .d2 { animation-delay: .3s; }
@keyframes ct-drop-in { from { transform: translateY(-30px); opacity: 0; } to { transform: none; opacity: 1; } }
.ctl-art-abstraction .busy rect { fill: var(--wl); stroke: var(--w); stroke-width: 2; }
.ctl-art-abstraction .busy circle, .ctl-art-abstraction .busy rect + * { fill: var(--w); opacity: .5; }
.ctl-art-abstraction .busy path { fill: none; stroke: var(--w); stroke-width: 3; opacity: .5; }
.ctl-art-abstraction .simple rect { fill: var(--surface); stroke: var(--w); stroke-width: 3; }
.ctl-art-abstraction .simple circle { fill: var(--wd); } .ctl-art-abstraction .simple path { stroke: var(--wd); stroke-width: 5; }
.ctl-art-patterns .unit rect { fill: none; stroke: var(--w); stroke-width: 3; stroke-dasharray: 6 5; }
.ctl-art-patterns .s1 { fill: var(--w); } .ctl-art-patterns .s2 { fill: var(--wd); } .ctl-art-patterns .q { fill: none; stroke: var(--wd); stroke-width: 3; stroke-dasharray: 4 4; }
.ctl-art-patterns text { fill: var(--wd); font-size: 20px; }
.ctl-art-algorithms .t { fill: var(--wd); } .ctl-art-algorithms .p { fill: var(--w); } .ctl-art-algorithms .d { fill: #F59E0B; }
.ctl-art-algorithms text { font-size: 11px; }
/* ---- 40-celebrate.css ---- */
/* Celebrations. */
.ct-locked, .ct-locked body { overflow: hidden; }
.ct-cel { --w: #EA580C; --wd: #9A3412; --wl: #FFEDD5; position: fixed; inset: 0; z-index: 9800; display: grid; place-items: center; padding: 1rem;
  background: rgba(10, 20, 26, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .25s ease; }
.ct-cel.is-open { opacity: 1; }
.ct-confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.ct-cel-card { position: relative; z-index: 2; width: min(560px, 100%); max-height: calc(100vh - 2rem); overflow: auto;
  padding: 1.4rem 1.4rem 1.2rem; border-radius: 30px; text-align: center; color: var(--ink);
  background: radial-gradient(circle at 50% 0%, #FFF7D6, var(--surface) 60%); border: 4px solid #F5B700;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35); transform: scale(.7) translateY(40px); transition: transform .45s cubic-bezier(.3, .7, .4, 1.4); }
.ct-cel.is-open .ct-cel-card { transform: none; }
.ct-cel-pixel { width: 190px; margin: -.4rem auto .2rem; }
.ct-cel-pixel .px { width: 100%; height: auto; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .2)); }
.ct-cel-pixel-xl { width: 230px; }
.ct-cel-duo { display: flex; justify-content: center; align-items: flex-end; gap: .4rem; }
.ct-cel-duo .ct-medal { width: 120px; }
[data-ct-motion="full"] .ct-cel-duo .ct-medal { animation: ct-medal 1s cubic-bezier(.3, .7, .4, 1.4) .2s both; }
@keyframes ct-medal { from { transform: scale(0) rotate(-30deg); } to { transform: none; } }
.ct-cel-kicker { margin: 0; font: 800 .95rem/1.2 var(--font-body); letter-spacing: .12em; color: #B45309; }
.ct-cel-h { margin: .3rem 0 .4rem; font-size: clamp(1.5rem, 4.5vw, 2.3rem); line-height: 1.08;
  background: linear-gradient(90deg, #EA580C, #DB2777, #7C3AED); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ct-cel-h-xl { font-size: clamp(1.7rem, 5.5vw, 2.7rem); }
.ct-cel-stars { display: flex; justify-content: center; gap: .3rem; margin: .2rem 0; }
.ct-star { display: inline-block; font-size: 3rem; line-height: 1; }
.ct-star .ct-ico { width: 1em; height: 1em; }
.ct-star.is-on .ct-ico { filter: drop-shadow(0 0 10px rgba(245, 183, 0, .55)); }
[data-ct-motion="full"] .ct-cel:not(.is-skipped) .ct-star.is-on { animation: ct-star-pop .55s cubic-bezier(.3, .7, .4, 1.6) both; animation-delay: calc(.7s + var(--i) * .26s); }
@keyframes ct-star-pop { from { transform: scale(0) rotate(-90deg); opacity: 0; } to { transform: none; opacity: 1; } }
.ct-cel-xp { margin: .2rem 0 .6rem; font: 800 1.35rem/1.2 var(--font-display); color: #0D9488; }
.ct-cel-say { margin: .4rem 0 .6rem; padding: .7rem .9rem; border-radius: 16px; background: var(--surface-2); border: 0; font-size: 1rem; line-height: 1.45; text-align: left; }
.ct-cel-skill { margin: .3rem 0 .6rem; font-weight: 600; color: var(--ink-2); }
.ct-cel-badge { margin: .3rem 0; font-weight: 800; color: #92400E; }
.ct-cel-note { margin: .3rem 0; font-size: .85rem; color: var(--ink-3); }
.ct-cel-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: .8rem; }
.ct-cel-btns .ct-btn-big { flex: 1 1 100%; --w: #EA580C; --wd: #C2410C; font-size: 1.2rem; letter-spacing: .03em; }
.ct-cel-skip { margin-top: .6rem; background: none; border: 0; color: var(--ink-3); font: 600 .82rem var(--font-body); text-decoration: underline; cursor: pointer; }
.ct-cel.is-skipped .ct-cel-skip { visibility: hidden; }
.ct-cel.is-skipped .px * { animation: none !important; }
.is-world .ct-cel-card { border-color: var(--w, #F5B700); }
.is-champion .ct-cel-card { border-image: linear-gradient(90deg, #EA580C, #0284C7, #9333EA, #059669) 1; border-width: 6px; border-radius: 0; }
@media (max-height: 640px) { .ct-cel-pixel { width: 130px; } .ct-star { font-size: 2.3rem; } }
/* ---- 50-decomp.css ---- */
/* Decomposition engines: order, tree, assembly, maze, and the shared grid. */
.ct-round { display: inline-block; margin: 0 0 .7rem; padding: .25rem .7rem; border-radius: 999px; font-weight: 800; font-size: .82rem;
  color: #fff; background: var(--wd); }

/* order */
.co-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.co-wrap.has-flow { grid-template-columns: minmax(0, 1.3fr) minmax(220px, 1fr); align-items: start; }
@media (max-width: 760px) { .co-wrap.has-flow { grid-template-columns: 1fr; } }
.co-list { list-style: none; margin: 0; padding: .7rem; min-height: 0; }
.co-row { display: flex; align-items: center; gap: .5rem; }
.co-row + .co-row { margin-top: .45rem; }
.co-n { flex: none; width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 50%; font-weight: 800; color: #fff; background: color-mix(in srgb, var(--w) 50%, var(--wd)); }
.co-row .ct-card { flex: 1; }
.co-moves { display: flex; flex-direction: column; gap: 2px; }
.co-mv { width: 34px; height: 24px; border-radius: 8px; cursor: pointer; font-size: .7rem; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--border-strong); }
.co-mv:disabled { opacity: .35; cursor: default; }
.co-flow { padding: .7rem; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); position: sticky; top: 150px; }
.ct-flow-mini { display: block; width: 100%; max-width: 300px; margin: 0 auto; height: auto; }
.fl-term { fill: var(--wd); }
.fl-proc { fill: var(--surface); stroke: var(--w); stroke-width: 2.5; }
.fl-arrow { stroke: var(--ink-3); stroke-width: 2.5; fill: none; }
.fl-head { fill: var(--ink-3); }
.fl-t { font: 700 12px var(--font-body); text-anchor: middle; fill: #fff; }
.fl-t-s { fill: var(--ink); font-size: 11px; }

/* tree */
.ctr-dia { margin-top: .4rem; overflow-x: auto; padding-bottom: .4rem; }
.ctr-root { position: relative; display: table; margin: 0 auto 2rem; padding: .7rem 1.2rem; border-radius: 14px; text-align: center;
  font: 700 1.05rem/1.3 var(--font-display); color: #fff; background: linear-gradient(135deg, color-mix(in srgb, var(--w) 50%, var(--wd)), var(--wd)); box-shadow: var(--shadow-2); }
.ctr-root::after { content: ""; position: absolute; left: 50%; top: 100%; width: 3px; height: 1rem; background: var(--w); }
.ctr-k { display: block; font: 800 .66rem/1 var(--font-body); letter-spacing: .1em; text-transform: uppercase; opacity: .85; margin-bottom: .2rem; }
.ctr-cols { position: relative; display: grid; gap: .7rem; grid-template-columns: repeat(var(--n, 4), minmax(150px, 1fr)); padding-top: 1rem; min-width: min(100%, 640px); }
.ctr-n3 { --n: 3; } .ctr-n4 { --n: 4; } .ctr-n5 { --n: 5; }
.ctr-cols::before { content: ""; position: absolute; top: 0; left: calc(100% / var(--n) / 2); right: calc(100% / var(--n) / 2); height: 3px; background: var(--w); }
.ctr-col { position: relative; display: flex; flex-direction: column; gap: .5rem; }
.ctr-col::before { content: ""; position: absolute; left: 50%; top: -1rem; width: 3px; height: 1rem; background: var(--w); }
.ctr-head { display: flex; flex-direction: column; gap: .3rem; min-height: 60px; padding: .45rem; border-radius: 14px; text-align: center;
  background: var(--surface); border: 2px dashed var(--w); }
.ctr-head.is-full { border-style: solid; }
.ctr-head.is-given { justify-content: center; font: 700 1rem/1.3 var(--font-display); background: var(--wl); }
.ctr-headtxt { padding: .3rem; }
.ctr-empty { font-size: .84rem; font-weight: 700; color: var(--ink-3); padding: .4rem 0; }
.ctr-under { min-height: 110px; }
.ctr-under.is-off { border-style: dotted; background: transparent; }
.ctr-wait { font-size: .8rem; color: var(--ink-3); text-align: center; margin: auto 0; }
.ctr-role { min-height: 70px; background: #FEF9C3; border-color: #CA8A04; }
.ct-card.is-head { border-color: var(--wd); font-weight: 800; background: var(--wl); }
.ct-card.is-role { border-color: #CA8A04; }
.ctr-roles { margin-top: 1rem; border-color: #CA8A04; }
.ctr-mission { margin-bottom: 1rem; padding: .7rem; border-radius: 16px; background: linear-gradient(180deg, #0B1026, #1E1B4B); color: #E0E7FF; overflow: hidden; }
.ctr-lane { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.ctr-stage { display: grid; justify-items: center; gap: .2rem; padding: .5rem .3rem; border-radius: 12px; border: 2px dashed rgba(224, 231, 255, .35); text-align: center; }
.ctr-stage small { font-size: .74rem; line-height: 1.2; }
.ctr-stage-i { font-size: 1.5rem; }
.ctr-stage.is-ok { border-style: solid; border-color: #34D399; background: rgba(52, 211, 153, .15); }
.ctr-stage.is-fail { border-style: solid; border-color: #F87171; background: rgba(248, 113, 113, .2); animation: ct-shake .4s ease 2; }
.ctr-rocket { position: absolute; top: -6px; left: -40px; font-size: 1.8rem; transition: left .55s cubic-bezier(.5, 0, .3, 1); filter: drop-shadow(0 0 8px #F59E0B); }

@media (max-width: 640px) {
  .ctr-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: 0; padding-top: 0; }
  .ctr-cols::before, .ctr-col::before, .ctr-root::after { display: none; }
  .ctr-root { margin-bottom: 1rem; }
  .ctr-head { border-top-width: 5px; }
}

/* assembly */
.cas-belt { overflow-x: auto; padding: .6rem; border-radius: 18px; background: repeating-linear-gradient(90deg, #E2E8F0 0 18px, #CBD5E1 18px 36px); }
.cas-line { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: .6rem; min-width: 660px; }
@media (max-width: 640px) { .cas-line { grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: 0; } }
.cas-st { display: flex; flex-direction: column; gap: .45rem; padding: .5rem; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-1); }
.cas-head { display: flex; flex-direction: column; gap: .3rem; padding: .4rem; border-radius: 12px; border: 2px dashed var(--w); text-align: center; }
.cas-st.is-full .cas-head { border-style: solid; }
.cas-num { align-self: center; width: 1.6rem; height: 1.6rem; display: grid; place-items: center; border-radius: 50%; font-weight: 800; font-size: .8rem; color: #fff; background: var(--wd); }
.cas-jobs { min-height: 100px; }
.cas-jobs.is-off { border-style: dotted; background: transparent; }
.cas-carpos svg, .cas-out svg { display: block; width: 120px; margin: 0 auto; }
.cas-car.is-broken { animation: ct-shake .45s ease 2; }
.cas-out { margin-top: .8rem; text-align: center; font-weight: 800; }
[data-ct-motion="full"] .cas-out svg { animation: cas-drive 1.2s ease-out both; }
@keyframes cas-drive { from { transform: translateX(-60px); opacity: 0; } to { transform: none; opacity: 1; } }

/* grid worlds */
.cg-map { display: block; width: 100%; height: auto; max-height: 70vh; border-radius: 16px; background: var(--surface-2); }
.cg-wall { fill: var(--wd); }
.cg-floor { fill: #F8FAFC; }
.cg-floor.is-alt { fill: #F1F5F9; }
.cg-gate { fill: #FDE68A; } .cg-open { fill: #BBF7D0; } .cg-exit { fill: #BFDBFE; }
.cg-piece { transition: transform .22s ease; }
.cg-piece.is-bump { animation: cg-bump .3s ease 1; }
@keyframes cg-bump { 50% { opacity: .5; } }
.cg-trail { fill: var(--w); opacity: .35; }
.cg-pad { display: grid; grid-template-columns: repeat(3, 52px); grid-template-rows: repeat(2, 48px); gap: 6px; justify-content: center; margin: .8rem 0 .3rem; }
.cg-pad button { border-radius: 12px; cursor: pointer; font-size: 1.15rem; color: var(--ink); background: var(--surface); border: 2px solid var(--border-strong); box-shadow: 0 3px 0 var(--border-strong); }
.cg-pad button:active { transform: translateY(2px); box-shadow: none; }
.cg-pad-up { grid-column: 2; grid-row: 1; } .cg-pad-left { grid-column: 1; grid-row: 2; } .cg-pad-down { grid-column: 2; grid-row: 2; } .cg-pad-right { grid-column: 3; grid-row: 2; }

/* maze */
.cmz-wrap { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(240px, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 760px) { .cmz-wrap { grid-template-columns: 1fr; } }
.cmz-map { border-radius: 18px; }
.cmz-map:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.cmz-slots { list-style: none; margin: 0 0 .8rem; padding: 0; display: grid; gap: .5rem; }
.cmz-slot { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .45rem; min-height: 56px; border-radius: 14px; border: 2px dashed var(--w); background: var(--wl); }
.cmz-slot .ct-card { flex: 1; }
.cmz-slot.is-over { border-style: solid; }
.cmz-check { margin: 0; padding-left: 0; list-style: none; display: grid; gap: .4rem; }
.cmz-check li { padding: .5rem .7rem; border-radius: 12px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--border); }
.cmz-check li.is-now { border: 2px solid var(--w); background: var(--wl); }
.cmz-check li.is-done { color: var(--ok); background: var(--ok-bg); }
.cmz-tick { display: inline-block; width: 1.2rem; }

/* group pictures and follow-up */
.cg-picwrap { max-width: 260px; margin: 0 auto 1rem; }
.cg-pic { display: block; width: 100%; height: auto; }
.cg-pin { flex: none; width: 1.6rem; height: 1.6rem; display: inline-grid; place-items: center; border-radius: 50%; font: 800 .8rem/1 var(--font-body); color: #fff; background: #C2410C; }
.cg-follow { margin-top: 1rem; padding: 1rem; border-radius: 18px; border: 2px solid var(--w); background: var(--wl); }
.cg-follow h3 { margin: .2rem 0 .3rem; font-size: var(--step-1); }
/* ---- 60-abstract.css ---- */
/* Abstraction engines: select, identify, graph, fields, model, datamaze, quest. */
.ct-readings { display: flex; flex-wrap: wrap; gap: .3rem; list-style: none; margin: .35rem 0 0; padding: 0; }
.ct-readings li { padding: .15rem .5rem; border-radius: 999px; font-size: .76rem; font-weight: 600; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--border); }
.ct-readings b { font-weight: 800; }

/* select */
.csel-job { align-items: center; }
.csel-job-i { font-size: 1.4rem; }
.csel-pic { margin: 0 0 1rem; }
.csel-big svg { display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto; border-radius: 16px; box-shadow: var(--shadow-1); }
.csel-pic.is-icon .csel-big svg { max-width: 220px; background: var(--surface-2); }
.csel-svg text { font-family: var(--font-body); }
.csel-pic [data-d] { transition: opacity .35s ease, filter .35s ease; }
.csel-pic [data-d].is-gone { opacity: .1; filter: grayscale(1); }
.csel-pic [data-d].is-kept { filter: drop-shadow(0 0 3px #FACC15); }
.csel-pic .mp { display: none; }
.csel-pic.is-map.is-done .mp { display: inline; }
.csel-pic.is-map.is-done .ph, .csel-pic.is-done [data-d].is-gone { display: none; }
.csel-pic.is-done [data-d].is-kept { filter: none; }
.csel-pic.is-map .bg { transition: fill .6s ease; }
.csel-pic.is-map.is-done .bg { fill: #FEFCE8; }
.csel-pic .tile { opacity: 0; transition: opacity .5s ease; }
.csel-pic.is-done .tile { opacity: 1; }
.csel-sizes { display: flex; justify-content: center; align-items: flex-end; gap: 1.2rem; margin-top: .8rem; }
.csel-size { margin: 0; display: grid; justify-items: center; gap: .3rem; }
.csel-size figcaption { font-size: .78rem; font-weight: 700; color: var(--ink-3); }
.csel-tile { display: grid; place-items: center; overflow: hidden; border-radius: 22%; background: var(--surface-2); border: 1px solid var(--border); }
.csel-tile svg { display: block; width: 100%; height: 100%; }
.csel-note { margin: .5rem 0 0; text-align: center; font-size: .85rem; color: var(--ink-3); }
.cg-zone.csel-keep { border-color: #059669; }
.cg-zone.csel-bin { border-color: #94A3B8; background: var(--surface-2); }
[data-ct-motion="full"] .csel-pic.is-done .csel-big svg { animation: ct-pop .5s ease 1; }

/* identify: poster */
.cid-top { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 1rem; align-items: start; margin-bottom: 1rem; }
@media (max-width: 560px) { .cid-top { grid-template-columns: 1fr; } }
.cid-mine { margin: 0; padding: .6rem; border-radius: 18px; text-align: center; background: var(--surface-2); border: 3px solid var(--w); }
.cid-mine svg { width: 110px; height: auto; }
.cid-mine figcaption { font-weight: 700; }
.cid-poster { padding: .8rem; border-radius: 6px; background: #FFFBEB; border: 2px solid #F59E0B; box-shadow: 4px 4px 0 rgba(15, 32, 38, .12); display: grid; gap: .45rem; }
.cid-poster-h { margin: 0; text-align: center; font: 800 1.3rem/1.1 var(--font-display); letter-spacing: .06em; color: #B91C1C; }
.cid-poster-s { margin: 0; text-align: center; font-size: .8rem; font-weight: 700; color: var(--ink-3); }
.cid-slot { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; min-height: 56px; padding: .4rem; }
.cid-slot .ct-card { flex: 1; }
.cid-tablewrap { margin-bottom: 1rem; }
.cid-table { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: .5rem; }
.cid-t { margin: 0; padding: .3rem; border-radius: 14px; text-align: center; background: var(--surface); border: 2px solid var(--border); transition: opacity .25s ease, transform .25s ease, border-color .25s ease; }
.cid-t svg { width: 100%; max-width: 74px; height: auto; }
.cid-t figcaption { font-weight: 800; font-size: .85rem; color: var(--ink-3); }
.cid-t.is-match { border-color: #059669; box-shadow: 0 0 0 3px rgba(5, 150, 105, .25); transform: translateY(-3px); }
.cid-t.is-out { opacity: .3; filter: grayscale(.8); }

/* identify: sensors */
.cid-bot { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: .8rem; align-items: center; padding: .7rem; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--border); }
.cid-robot { width: 100%; height: auto; }
.cid-sockets { display: grid; gap: .4rem; }
.cid-sensors .cid-top { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
@media (max-width: 700px) { .cid-sensors .cid-top { grid-template-columns: 1fr; } }
.cid-belt-h { margin: 0 0 .4rem; }
.cid-belt { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 42%), 1fr)); gap: .5rem; padding: .6rem; border-radius: 16px;
  background: repeating-linear-gradient(90deg, #E2E8F0 0 16px, #CBD5E1 16px 32px); }
.cid-item { display: grid; gap: .25rem; padding: .5rem .6rem; border-radius: 14px; background: var(--surface); border: 2px solid var(--border); }
.cid-item-i { font-size: 1.5rem; line-height: 1; }
.cid-item.is-done { border-color: var(--w); }
.cid-item.is-bad { border-color: #DC2626; background: #FEF2F2; animation: ct-shake .4s ease 2; }
.cid-bin { justify-self: start; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 800; color: #fff; background: #475569; }
.cid-bin-paper { background: #2563EB; } .cid-bin-plastic { background: #A16207; } .cid-bin-metal { background: #64748B; } .cid-bin-glass { background: #047857; }
.cid-mcard { flex-direction: column; align-items: flex-start; }
.cid-bins { margin-top: .8rem; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
[data-ct-motion="full"] .cid-beam { animation: cid-scan 1.4s ease-in-out infinite; transform-origin: 60px 62px; }
@keyframes cid-scan { 50% { opacity: .15; } }

/* graph */
.cgr-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; margin-bottom: .6rem; }
.cgr-head .ct-round { margin: 0; }
.cgr-goal { margin: 0; font-weight: 800; }
.cgr-clock { margin: 0 auto 0 0; padding: .2rem .7rem; border-radius: 999px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--border); }
.cgr-mapwrap { border-radius: 18px; overflow: hidden; border: 1px solid var(--border); }
.cgr-map { display: block; width: 100%; height: auto; background: #F0FDF4; transition: background .4s ease; }
.cgr-map.is-street { background: #DCFCE7; }
.cgr-decor { opacity: 0; transition: opacity .4s ease; font-size: 26px; }
.cgr-map.is-street .cgr-decor { opacity: 1; }
.cgr-road { stroke-linecap: round; transition: stroke .3s ease, stroke-width .3s ease; }
.cgr-road-bed { stroke: transparent; stroke-width: calc(22px * var(--k, 1)); }
.cgr-road-top { stroke: #64748B; stroke-width: calc(4px * var(--k, 1)); }
.cgr-map.is-street .cgr-road-bed { stroke: #6B7280; }
.cgr-map.is-street .cgr-road-top { stroke: #F8FAFC; stroke-width: 2; stroke-dasharray: 8 8; }
.cgr-road-top.is-used { stroke: var(--w); stroke-width: calc(8px * var(--k, 1)); }
.cgr-map.is-street .cgr-road-top.is-used { stroke: var(--w); stroke-width: 6; stroke-dasharray: none; }
.cgr-road-top.is-closed { stroke: #DC2626; stroke-dasharray: 6 6; }
.cgr-tag rect { fill: #fff; stroke: #94A3B8; stroke-width: 1.5; }
.cgr-tag text { font: 800 calc(12px * var(--k, 1)) var(--font-body); text-anchor: middle; fill: #0F172A; }
.cgr-tag.is-closed rect { fill: #FEE2E2; stroke: #DC2626; }
.cgr-map.is-street .cgr-tag { opacity: 0; }
.cgr-tag { transition: opacity .3s ease; }
.cgr-node { cursor: pointer; }
.cgr-node circle { fill: #fff; stroke: var(--wd); stroke-width: 3; transition: fill .2s ease; }
.cgr-node.is-place circle { fill: var(--wl); }
.cgr-node.is-been circle { fill: color-mix(in srgb, var(--w) 30%, #fff); }
.cgr-node.is-here circle { fill: var(--w); }
.cgr-node.is-next circle { stroke: #F59E0B; stroke-width: 5; }
[data-ct-motion="full"] .cgr-node.is-next circle { animation: cgr-pulse 1.2s ease-in-out infinite; }
@keyframes cgr-pulse { 50% { stroke-width: 8; } }
.cgr-lab { font: 800 calc(14px * var(--k, 1)) var(--font-body); text-anchor: middle; fill: #0F172A; pointer-events: none; }
.cgr-node.is-here .cgr-lab { fill: #fff; }
.cgr-ico { pointer-events: none; }
.cgr-name { font: 800 calc(12px * var(--k, 1)) var(--font-body); text-anchor: middle; fill: #0F172A; paint-order: stroke; stroke: #fff; stroke-width: 3px; pointer-events: none; }
.cgr-carg { transition: transform .45s ease-in-out; pointer-events: none; }
[data-ct-motion="calm"] .cgr-carg { transition: none; }
.cgr-opts { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .7rem; }
.cgr-opts .ct-tray-h { flex-basis: 100%; max-width: none; }
.cgr-opt { min-height: 42px; padding: .35rem .8rem; }

/* fields (and the datamaze table) */
.cfl-rule { align-items: flex-start; }
.cfl-step { margin: .2rem 0 .6rem; color: var(--ink-2); }
.cfl-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 .7rem; }
.cfl-chips .cfl-col { width: auto; }
.cfl-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.cfl-wrap:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.cfl-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.cfl-table th, .cfl-table td { padding: .45rem .6rem; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border); }
.cfl-table thead th { background: var(--surface-2); font-size: .8rem; }
.cfl-table th[scope="row"] { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.cfl-table .is-on { background: var(--wl); }
.cfl-col { width: 100%; min-height: 40px; padding: .3rem .4rem; border-radius: 10px; cursor: pointer; text-align: left; font: 700 .8rem/1.2 var(--font-body);
  color: var(--ink); background: transparent; border: 2px dashed var(--border-strong); }
.cfl-col[aria-pressed="true"] { border-style: solid; border-color: var(--w); background: var(--surface); }
.cfl-table th.is-wrong .cfl-col { border-color: #DC2626; background: #FEF2F2; }
.cfl-table tr.is-wrong td, .cfl-table tr.is-wrong th { background: #FEF2F2; }
.cfl-table.is-label { font-size: 1rem; }
.cfl-dec { white-space: normal; }
.cfl-seg { display: flex; flex-wrap: wrap; gap: .3rem; }
.cfl-opt { min-height: 38px; padding: .3rem .7rem; border-radius: 999px; cursor: pointer; font: 700 .85rem/1.1 var(--font-body);
  color: var(--ink); background: var(--surface-2); border: 2px solid var(--border-strong); }
.cfl-opt.is-on { color: #fff; background: var(--wd); border-color: var(--wd); }
[data-ct-motion="full"] .cfl-table.is-label .cfl-dec { animation: ct-pop .4s ease 1; }

/* model */
.cmd-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 1rem; align-items: start; margin-bottom: 1rem; }
@media (max-width: 700px) { .cmd-top { grid-template-columns: 1fr; } }
.cmd-who { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .7rem; padding: .8rem; border-radius: 18px; background: var(--wl); border: 2px solid var(--w); }
.cmd-ava { font-size: 3rem; line-height: 1; }
.cmd-name { margin: 0 0 .3rem; font: 800 1.15rem/1.2 var(--font-display); }
.cmd-needs { margin: 0; padding: 0; list-style: none; display: grid; gap: .3rem; }
.cmd-needs li { margin: 0; font-weight: 600; line-height: 1.35; }
.cmd-needs li.is-met { color: var(--ok); }
.cmd-build { display: grid; grid-template-columns: minmax(110px, 170px) minmax(0, 1fr); gap: .8rem; align-items: center; }
@media (max-width: 420px) { .cmd-build { grid-template-columns: 1fr; } }
.cmd-phone { display: block; width: 100%; max-width: 170px; height: auto; margin: 0 auto; }
[data-ct-motion="full"] .cmd-phonewrap.is-met .cmd-phone { animation: ct-pop .5s ease 1; }
.cmd-slots { display: grid; gap: .4rem; }

/* datamaze */
.cdm-hall { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0 0 .8rem; padding: 0; }
.cdm-door { position: relative; display: flex; align-items: center; gap: .35rem; padding: .45rem .7rem; border-radius: 12px; font-weight: 700;
  background: var(--surface-2); border: 2px solid var(--border); }
.cdm-door.is-now { border-color: var(--w); background: var(--wl); }
.cdm-door.is-open { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.cdm-exit.is-open { color: #fff; background: var(--wd); }
.cdm-door-i { font-size: 1.2rem; }
.cdm-pixel { margin-left: .2rem; }
[data-ct-motion="full"] .cdm-pixel { display: inline-block; animation: ct-bob 1.6s ease-in-out infinite; }
@keyframes ct-bob { 50% { transform: translateY(-4px); } }
.cdm-filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; margin: .2rem 0 .6rem; }
.cdm-filters .ct-tray-h { flex-basis: 100%; max-width: none; }
.cdm-f { display: grid; gap: .2rem; font-size: .8rem; font-weight: 700; color: var(--ink-2); }
.cdm-f select { min-height: 40px; padding: .3rem .5rem; border-radius: 10px; font: 600 .9rem var(--font-body); color: var(--ink); background: var(--surface); border: 2px solid var(--border-strong); }
.cdm-f.is-on select { border-color: var(--w); background: var(--wl); }
.cdm-cols { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin-bottom: .6rem; }
.cdm-cols .ct-tray-h { margin-right: .3rem; }
.cdm-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 700; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); }
.cdm-chip.is-on { background: var(--wl); border-color: var(--w); }
.cdm-table caption { caption-side: top; padding: .5rem .6rem; text-align: left; font-weight: 800; }
.cdm-keypad { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: .8rem; font-weight: 800; }
.cdm-code { width: 7ch; min-height: 52px; padding: .2rem .5rem; border-radius: 12px; text-align: center; letter-spacing: .2em;
  font: 800 1.6rem var(--font-mono, monospace); color: var(--ink); background: var(--surface); border: 3px solid var(--w); }

/* quest */
.cq-strip { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0 0 .8rem; padding: 0; }
.cq-step { flex: 1 1 160px; padding: .45rem .7rem; border-radius: 12px; font-size: .88rem; font-weight: 700; color: var(--ink-3); background: var(--surface-2); border: 1px solid var(--border); }
.cq-step b { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; color: #fff; background: #64748B; }
.cq-step.is-now { color: var(--ink); border: 2px solid var(--w); background: var(--wl); }
.cq-step.is-now b { background: var(--w); }
.cq-step.is-done { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.cq-step.is-done b { background: var(--ok); }
.cq-title { margin: 0 0 .6rem; font-size: var(--step-1); }
/* ---- 70-patterns.css ---- */
/* Pattern engines: sequence, dance, snakepat, codepat, and the shared code view. */

/* code view */
.ct-code { margin: 0; padding: .5rem 0; list-style: none; border-radius: 14px; overflow-x: auto; background: #0F172A; color: #E2E8F0; font: 500 .95rem/1.55 var(--font-mono, ui-monospace, monospace); }
.ct-code li { display: flex; align-items: baseline; padding: 0 .8rem 0 0; }
.ct-code li.is-picked, .ct-code li.is-mark { background: rgba(250, 204, 21, .18); box-shadow: inset 4px 0 0 #FACC15; }
.ct-ln { flex: none; width: 2.4rem; padding-right: .6rem; text-align: right; color: #94A3B8; user-select: none; }
.ct-code code { white-space: pre; font: inherit; color: inherit; background: none; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
.ct-code-line { display: flex; align-items: baseline; width: 100%; padding: .1rem .8rem .1rem 0; border: 0; cursor: pointer; text-align: left; font: inherit; color: inherit; background: none; }
.ct-code-line:hover { background: rgba(148, 163, 184, .15); }
.ct-code-line:focus-visible { outline: 3px solid #FACC15; outline-offset: -3px; }
.hl-k { color: #F472B6; font-weight: 700; } .hl-s { color: #86EFAC; } .hl-n { color: #FDBA74; } .hl-c { color: #94A3B8; font-style: italic; }

/* sequence */
.cseq-text { margin: 0 0 .6rem; font-weight: 700; }
.cseq-row { display: flex; flex-wrap: wrap; gap: .45rem; align-items: flex-end; padding: .8rem; margin-bottom: .8rem; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--border); }
.cseq-slot { display: grid; justify-items: center; gap: .15rem; }
.cseq-pos { font-size: .68rem; font-weight: 700; color: var(--ink-3); }
.cseq-cell, .cseq-gap, .cseq-in { min-width: 54px; min-height: 54px; display: grid; place-items: center; border-radius: 14px; background: var(--surface); border: 2px solid var(--border); }
.cseq-gap { cursor: pointer; border: 3px dashed var(--w); background: var(--wl); }
.cseq-gap.is-full { border-style: solid; background: var(--surface); }
.cseq-gap.is-active { box-shadow: 0 0 0 4px color-mix(in srgb, var(--w) 35%, transparent); }
[data-ct-motion="full"] .cseq-gap.is-active:not(.is-full) { animation: ct-pulse 1.4s ease-in-out infinite; }
.cseq-gap.is-wrong, .cseq-in.is-wrong, .cseq-cell.is-wrong { border-color: #DC2626; background: #FEF2F2; }
.cseq-q { font: 800 1.5rem var(--font-display); color: var(--wd); }
.cseq-pickable { cursor: pointer; }
.cseq-pickable:hover { border-color: var(--w); }
.cseq-pickable.is-picked { border-color: #DC2626; box-shadow: 0 0 0 4px rgba(220, 38, 38, .2); }
.cseq-more { align-self: center; font-size: 1.6rem; font-weight: 800; color: var(--ink-3); }
.cseq-emo { font-size: 1.9rem; line-height: 1; }
.cseq-num { font: 800 1.3rem var(--font-display); padding: 0 .4rem; }
.cseq-in { width: 4.2rem; padding: 0 .3rem; text-align: center; font: 800 1.3rem var(--font-display); color: var(--ink); border: 3px dashed var(--w); }
.cseq-in:focus { border-style: solid; outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--w) 35%, transparent); }
.cseq-in-big { width: 7rem; margin-top: .4rem; }
.cseq-bead { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font: 800 .8rem/1 var(--font-body); color: rgba(15, 23, 42, .85); border: 3px solid rgba(15, 23, 42, .25); box-shadow: inset -5px -6px 0 rgba(0, 0, 0, .12), inset 4px 4px 0 rgba(255, 255, 255, .35); }
.cseq-light { display: grid; gap: 3px; padding: 4px; border-radius: 9px; background: #1F2937; }
.cseq-l { display: block; width: 13px; height: 13px; border-radius: 50%; background: #374151; }
.cseq-l-r.is-on { background: #EF4444; box-shadow: 0 0 8px #EF4444; }
.cseq-l-a.is-on { background: #F59E0B; box-shadow: 0 0 8px #F59E0B; }
.cseq-l-g.is-on { background: #22C55E; box-shadow: 0 0 8px #22C55E; }
.cseq-pal { display: flex; flex-wrap: wrap; gap: .5rem; margin: .4rem 0 .8rem; }
.cseq-pbtn small { display: block; margin-top: .2rem; font-size: .68rem; font-weight: 700; color: var(--ink-2); }
.cseq-hint { margin: -.3rem 0 .8rem; font-weight: 700; color: var(--ink-2); }
.cseq-pbtn { min-width: 58px; min-height: 58px; display: grid; place-items: center; padding: .3rem; border-radius: 14px; cursor: pointer; background: var(--surface); border: 2px solid var(--border-strong); box-shadow: 0 3px 0 var(--border-strong); }
.cseq-pbtn:hover { border-color: var(--w); }
.cseq-pbtn:active { transform: translateY(2px); box-shadow: none; }
.cseq-pbtn.is-chosen, .ct-mcq-opt.is-chosen { border-color: var(--w); background: var(--wl); box-shadow: 0 0 0 3px color-mix(in srgb, var(--w) 30%, transparent); }
.cseq-pbtn.is-struck, .ct-mcq-opt.is-struck { opacity: .35; text-decoration: line-through; }
.cseq-fix { margin-top: .6rem; }
.cseq-code { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 700px) { .cseq-code { grid-template-columns: 1fr; } }
.cseq-outs { display: grid; gap: .6rem; }
.cseq-out pre, .ccp-out { color: var(--ink); margin: .2rem 0 0; padding: .5rem .8rem; border-radius: 12px; font: 600 .95rem/1.5 var(--font-mono, ui-monospace, monospace); background: var(--surface-2); border: 2px solid var(--border); white-space: pre-wrap; }
.cseq-out.is-bad pre { border-color: #FCA5A5; }
.cseq-out.is-good pre { border-color: #86EFAC; background: var(--ok-bg); }
.cseq-fixopt code { font: 600 .95rem var(--font-mono, ui-monospace, monospace); white-space: pre; background: none; border: 0; padding: 0; }
.cseq-fixopt code .hl-k { color: #BE185D; } .cseq-fixopt code .hl-s { color: #15803D; } .cseq-fixopt code .hl-n { color: #C2410C; }

/* dance */
.cdz-stage { position: relative; display: grid; justify-items: center; gap: .3rem; padding: 1rem .5rem .6rem; margin-bottom: .8rem; border-radius: 20px; overflow: hidden;
  background: radial-gradient(circle at 50% 0%, #FDE68A 0, transparent 55%), linear-gradient(180deg, #312E81, #1E1B4B); }
.cdz-floor { position: absolute; left: 10%; right: 10%; bottom: 38px; height: 22px; border-radius: 50%; background: rgba(250, 204, 21, .35); }
.cdz-dancer { position: relative; width: 150px; transition: transform .3s cubic-bezier(.3, .7, .4, 1.3); }
.cdz-dancer svg { display: block; width: 100%; height: auto; }
.cdz-dancer.dz-left { transform: rotate(-14deg) translateX(-14px); }
.cdz-dancer.dz-right { transform: rotate(14deg) translateX(14px); }
.cdz-dancer.dz-jump { transform: translateY(-26px); }
.cdz-dancer.dz-up { transform: scale(1.06); }
.cdz-dancer.dz-spin { transform: scaleX(-1); }
[data-ct-motion="full"] .cdz-dancer.dz-spin { animation: cdz-spin .6s ease-in-out 1; transform: none; }
@keyframes cdz-spin { to { transform: rotate(360deg); } }
[data-ct-motion="calm"] .cdz-dancer { transition: none; }
.cdz-cap { position: relative; margin: 0; padding: .25rem .8rem; border-radius: 999px; font-weight: 800; color: #1E1B4B; background: #FDE68A; }
.cdz-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: .8rem; }
.cdz-strip { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.cdz-strip li { border-radius: 14px; }
.cdz-strip li.is-now { box-shadow: 0 0 0 4px #FACC15; }
.cdz-chip { display: grid; justify-items: center; gap: .05rem; min-width: 62px; padding: .35rem .3rem; border-radius: 14px; font-size: 1.5rem; line-height: 1; background: var(--surface); border: 2px solid var(--border); }
.cdz-chip small { font-size: .62rem; font-weight: 700; color: var(--ink-3); }
.cdz-chip.is-empty { font: 800 1.3rem var(--font-display); color: var(--wd); border: 0; background: none; }
.cdz-slot { padding: 0; border-radius: 16px; cursor: pointer; border: 3px dashed var(--w); background: var(--wl); }
.cdz-slot .cdz-chip { border: 0; background: transparent; min-height: 56px; align-content: center; }
.cdz-slot.is-full { border-style: solid; background: var(--surface); }
.cdz-slot.is-active { box-shadow: 0 0 0 4px color-mix(in srgb, var(--w) 35%, transparent); }
.cdz-slot.is-wrong { border-color: #DC2626; }
.cdz-loop { display: grid; gap: .4rem; padding: .8rem; margin-bottom: .8rem; border-radius: 16px; border-left: 6px solid var(--w); background: var(--surface-2); font-family: var(--font-mono, ui-monospace, monospace); }
.cdz-kw { margin: 0; display: flex; align-items: center; gap: .4rem; }
.cdz-kw b { color: var(--wd); }
.cdz-step { width: 38px; height: 38px; border-radius: 10px; cursor: pointer; font: 800 1.1rem var(--font-body); color: var(--ink); background: var(--surface); border: 2px solid var(--border-strong); }
.cdz-times { min-width: 2.2rem; text-align: center; font: 800 1.3rem var(--font-display); }
.cdz-body { display: flex; flex-wrap: wrap; gap: .4rem; padding-left: 1.5rem; }
.cdz-count { margin: 0; font: 600 .85rem var(--font-body); color: var(--ink-2); }
.cdz-pal { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.cdz-pal .ct-tray-h { flex-basis: 100%; }
.cdz-move { display: inline-flex; align-items: center; gap: .35rem; min-height: 46px; padding: .3rem .8rem; border-radius: 14px; cursor: pointer; font: 700 .9rem var(--font-body);
  color: var(--ink); background: var(--surface); border: 2px solid var(--border-strong); box-shadow: 0 3px 0 var(--border-strong); }
.cdz-move span { font-size: 1.3rem; }
.cdz-move:active { transform: translateY(2px); box-shadow: none; }

/* snake */
.csn-top { margin-bottom: .6rem; }
.csn-strip { display: flex; flex-wrap: wrap; gap: .25rem; margin: .3rem 0 0; padding: .4rem .6rem; list-style: none; border-radius: 999px; background: #DCFCE7; border: 2px solid #22C55E; width: fit-content; max-width: 100%; }
.csn-strip li { font-size: 1.4rem; line-height: 1; }
.csn-next { font-size: 1.2rem; }
[data-ct-motion="full"] .csn-next { animation: ct-bob 1.4s ease-in-out infinite; }
.csn-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 1rem; align-items: start; }
@media (max-width: 640px) { .csn-wrap { grid-template-columns: 1fr; } }
.csn-map { display: block; width: 100%; max-width: 440px; height: auto; border-radius: 16px; background: #14532D; touch-action: none; }
.csn-map:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.csn-cell { fill: #22C55E; } .csn-cell.is-alt { fill: #16A34A; }
.csn-seg rect { fill: #FDE047; stroke: #A16207; stroke-width: 2; }
.csn-seg.is-head rect { fill: #FACC15; }
.csn-eye { fill: #fff; } .csn-pupil { fill: #111827; }
.csn-glow { fill: none; stroke: #fff; stroke-width: 4; }
[data-ct-motion="full"] .csn-glow { animation: cgr-pulse 1s ease-in-out infinite; }
.csn-side { display: grid; gap: .5rem; justify-items: center; }
.csn-progress { margin: 0; text-align: center; font-weight: 600; }
.csn-tip { margin: 0; font-size: .8rem; color: var(--ink-3); text-align: center; }

/* codepat */
.ccp-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 760px) { .ccp-wrap { grid-template-columns: 1fr; } }
.ccp-pane { display: grid; gap: .4rem; }
.ccp-in { min-width: 3ch; padding: .05rem .3rem; border-radius: 6px; font: 700 .95rem var(--font-mono, ui-monospace, monospace); color: #0F172A; background: #FEF9C3; border: 2px solid #FACC15; }
.ccp-in:focus { outline: 3px solid #fff; outline-offset: 1px; }
.ccp-cmp { margin: 0; padding: .4rem .8rem; list-style: none; border-radius: 12px; font: 600 .95rem/1.5 var(--font-mono, ui-monospace, monospace); background: var(--surface-2); border: 1px solid var(--border); }
.ccp-cmp .is-ok { color: var(--ok); } .ccp-cmp .is-bad { color: var(--bad); }
.ccp-err { margin: 0; font-weight: 700; color: var(--bad); }

/* the Pattern Vault */
.cq-step.is-lock b { width: auto; height: auto; background: none; font-size: 1.2rem; }
/* ---- 80-algo.css ---- */
/* Algorithms: flowcharts, robot programs, the car and snake coders, tests and traces. */

/* flowcharts: standard symbols */
.fc { display: block; width: 100%; height: auto; margin: 0 auto; }
.fc .fc-shape { fill: var(--surface); stroke: var(--ink-2); stroke-width: 2.5; transition: fill .2s ease, stroke .2s ease; }
.fc .fc-start .fc-shape, .fc .fc-end .fc-shape { fill: #D1FAE5; stroke: #047857; }
.fc .fc-io .fc-shape { fill: #E0F2FE; stroke: #0369A1; }
.fc .fc-process .fc-shape { fill: #FEF9C3; stroke: #A16207; }
.fc .fc-decision .fc-shape, .fc .fc-while .fc-shape, .fc .fc-until .fc-shape { fill: #FCE7F3; stroke: #BE185D; }
.fc .fc-shape.fc-empty, .fc .is-empty .fc-shape { fill: var(--surface-2); stroke: var(--w); stroke-dasharray: 7 5; }
.fc .fc-node.is-path .fc-shape { stroke: #2563EB; stroke-width: 4; }
.fc .fc-t { font: 700 13px var(--font-body); text-anchor: middle; fill: var(--ink); }
.fc .fc-q { fill: var(--wd); font-weight: 800; }
.fc .fc-line { fill: none; stroke: var(--ink-3); stroke-width: 2.2; }
.fc .fc-headfill { fill: var(--ink-3); }
.fc .fc-dot { fill: var(--ink-3); }
.fc .fc-yn { font: 800 12px var(--font-body); fill: var(--ink-2); }
.fc .fc-node.is-on .fc-shape { stroke: #F59E0B; stroke-width: 5; fill: #FEF3C7; }
.fc .fc-node.is-picked .fc-shape { stroke: #DC2626; stroke-width: 4; }
.fc .fc-node.is-bad .fc-shape { stroke: #DC2626; stroke-width: 4; }
.fc [role="button"] { cursor: pointer; }
.fc [role="button"]:hover .fc-shape { stroke-width: 4; }
.fc [role="button"]:focus-visible .fc-shape { stroke: var(--focus-ring); stroke-width: 5; }
.fc [role="button"]:focus { outline: none; }

/* order: lines of pseudocode */
.ct-card.is-code { font: 600 .95rem/1.4 var(--font-mono, ui-monospace, monospace); background: #0F172A; color: #E2E8F0; border-color: #334155; }
.ct-card.is-code .ct-card-t { display: block; max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; }
.co-row .ct-card { min-width: 0; }
@media (max-width: 480px) { .ct-card.is-code { font-size: .8rem; } .cbc-sel { font-size: .78rem; } }
.ct-card.is-code.is-wrong { background: #3B1219; border-color: #DC2626; }

/* program: robots and the cat */
.cpg-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 1rem; align-items: start; }
@media (max-width: 760px) { .cpg-wrap { grid-template-columns: 1fr; } }
.cpg-map .cg-map { max-height: 60vh; }
.cg-pond { fill: #BAE6FD; }
.cpg-bot-body { fill: #475569; stroke: #0F172A; stroke-width: 2; }
.cpg-bot-nose { fill: #F59E0B; stroke: #0F172A; stroke-width: 1.5; }
.cpg-side { display: grid; gap: .6rem; }
.cpg-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.cpg-main { padding: .3rem .7rem; border-radius: 10px; cursor: pointer; font: 800 .95rem var(--font-display); color: var(--ink); background: var(--surface-2); border: 2px solid var(--border); }
.cpg-main.is-into { border-color: var(--w); background: var(--wl); }
.cpg-count { font-weight: 800; font-size: .85rem; color: var(--ink-2); }
.cpg-count.is-over { color: var(--bad); }
.cpg-list, .cpg-inner { display: grid; gap: .3rem; margin: 0; padding: 0; list-style: none; counter-reset: blk; }
.cpg-list { min-height: 60px; padding: .5rem; border-radius: 14px; background: var(--surface-2); border: 2px dashed var(--border-strong); }
.cpg-blk { counter-increment: blk; display: flex; align-items: center; gap: .4rem; padding: .3rem .5rem; border-radius: 10px; font-weight: 700; background: var(--surface); border: 2px solid var(--w); }
.cpg-list > .cpg-blk::before { content: counter(blk); min-width: 1.4rem; font-size: .75rem; color: var(--ink-3); }
.cpg-blk.is-bad { border-color: #DC2626; background: #FEF2F2; }
.cpg-blk.is-into { box-shadow: 0 0 0 3px color-mix(in srgb, var(--w) 35%, transparent); }
.cpg-ico { font-size: 1.1rem; }
.cpg-x { margin-left: auto; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; color: var(--ink-3); background: transparent; border: 1px solid var(--border); }
.cpg-blk:has(.cpg-rep) { flex-direction: column; align-items: stretch; border-color: #7C3AED; }
.cpg-rep { display: flex; align-items: center; gap: .3rem; }
.cpg-rep-h { flex: 1; text-align: left; padding: .2rem .4rem; border-radius: 8px; cursor: pointer; font: 800 .9rem var(--font-body); color: #6D28D9; background: #F3E8FF; border: 1px solid #C4B5FD; }
.cpg-inner { margin-left: 1rem; padding: .3rem 0 .1rem .5rem; border-left: 4px solid #C4B5FD; }
.cpg-inner .cpg-blk { border-color: #A78BFA; }
.cpg-empty { padding: .4rem; font-size: .85rem; color: var(--ink-3); }
.cpg-pal { display: flex; flex-wrap: wrap; gap: .4rem; }
.cpg-pal .ct-tray-h { flex-basis: 100%; }
.cpg-pad { display: grid; justify-items: center; }

/* flowbuild and flowfix */
.cfb-wrap { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(240px, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 800px) { .cfb-wrap { grid-template-columns: 1fr; } }
.cfb-chart { padding: .5rem; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--border); overflow-x: auto; }
.cfb-right { display: grid; gap: .7rem; align-content: start; }
.cfb-slots { display: grid; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.cfb-slot { display: flex; align-items: center; gap: .5rem; }
.cfb-num { flex: none; width: 1.8rem; height: 1.8rem; display: grid; place-items: center; border-radius: 50%; font-weight: 800; color: #fff; background: var(--wd); }
.cfb-slot .ct-card { flex: 1; }
.fcs { flex: none; width: 34px; height: 20px; }
.fcs path { stroke-width: 2; }
.fcs-io path { fill: #E0F2FE; stroke: #0369A1; }
.fcs-process path { fill: #FEF9C3; stroke: #A16207; }
.fcs-decision path { fill: #FCE7F3; stroke: #BE185D; }
.fcs-start path { fill: #D1FAE5; stroke: #047857; }
.cfb-tests caption { caption-side: top; padding: .4rem .6rem; text-align: left; font-weight: 800; }
.cfb-tests tr.is-pass td { background: var(--ok-bg); }
.cfb-tests tr.is-fail td { background: #FEF2F2; }
.cfb-tests td { white-space: normal; }
.cfb-sim { display: grid; grid-template-columns: auto auto 1fr; gap: 1rem; align-items: center; padding: .8rem; border-radius: 16px; background: #1F2937; color: #F8FAFC; }
.cfb-tl { display: grid; gap: 5px; padding: 7px; border-radius: 12px; background: #111827; border: 2px solid #374151; }
.cfb-lamp { display: block; width: 26px; height: 26px; border-radius: 50%; background: #374151; }
.cfb-red.is-on { background: #EF4444; box-shadow: 0 0 14px #EF4444; }
.cfb-amber.is-on { background: #F59E0B; box-shadow: 0 0 14px #F59E0B; }
.cfb-green.is-on { background: #22C55E; box-shadow: 0 0 14px #22C55E; }
.cfb-ped { display: grid; gap: 5px; padding: 6px; border-radius: 10px; background: #111827; }
.cfb-man { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; font-size: 1.3rem; opacity: .25; filter: grayscale(1); }
.cfb-man.is-red { opacity: 1; filter: none; background: #7F1D1D; }
.cfb-man.is-green { opacity: 1; filter: none; background: #14532D; }
.cfb-info p { margin: 0 0 .3rem; font-weight: 700; color: #F8FAFC; }
.cfb-info b { color: #FDE68A; }
.cfb-btn.is-on { color: #FCA5A5; }
.cff-title { margin: 0 0 .6rem; font-size: var(--step-1); }
.cff-note { margin: 0; font-weight: 600; color: var(--ink-2); }

/* trace */
.ctt-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 760px) { .ctt-wrap { grid-template-columns: 1fr; } }
.ctt-note { margin: 0 0 .5rem; font-size: .9rem; color: var(--ink-2); }
.ctt-table td { padding: .3rem; text-align: center; }
.ctt-table td.is-given { font-weight: 800; background: var(--surface-2); }
.ctt-in { width: 4.2rem; min-height: 38px; text-align: center; border-radius: 8px; font: 700 1rem var(--font-mono, ui-monospace, monospace); color: var(--ink); background: var(--surface); border: 2px solid var(--border-strong); }
.ctt-in:focus { outline: none; border-color: var(--w); box-shadow: 0 0 0 3px color-mix(in srgb, var(--w) 30%, transparent); }
.ctt-in.is-wrong { border-color: #DC2626; background: #FEF2F2; }

/* botcode: the car and the snake */
.cbc-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 860px) { .cbc-wrap { grid-template-columns: 1fr; } }
.cbc-left { display: grid; gap: .6rem; }
.cbc-tabs { display: flex; flex-wrap: wrap; gap: .3rem; }
.cbc-tab { padding: .35rem .8rem; border-radius: 999px; cursor: pointer; font: 700 .88rem var(--font-body); color: var(--ink); background: var(--surface-2); border: 2px solid var(--border); }
.cbc-tab.is-on { border-color: var(--w); background: var(--wl); }
.cbc-tab.is-pass { color: var(--ok); } .cbc-tab.is-fail { color: var(--bad); }
.cbc-map { display: block; width: 100%; height: auto; max-height: 52vh; border-radius: 16px; background: #14532D; }
.cbc-grass { fill: #4ADE80; } .cbc-road { fill: #64748B; }
.cbc-wall { fill: #334155; } .cbc-floor { fill: #DCFCE7; }
.cbc-car-body { fill: #EF4444; stroke: #7F1D1D; stroke-width: 1.5; }
.cbc-seg { fill: #FDE047; stroke: #A16207; stroke-width: 2; }
.cbc-head { fill: #FACC15; stroke: #A16207; stroke-width: 2; }
.cbc-practice { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.cbc-practice .ct-tray-h { flex-basis: 100%; }
.cbc-code { display: grid; gap: .5rem; align-content: start; }
.cbc-tpl code { white-space: pre; }
.cbc-sel { margin: 1px 0; padding: .1rem .2rem; border-radius: 6px; font: 700 .9rem var(--font-mono, ui-monospace, monospace); color: #0F172A; background: #FEF9C3; border: 2px solid #FACC15; }
.cbc-ta { width: 100%; min-height: 240px; padding: .7rem .8rem; border-radius: 14px; resize: vertical; tab-size: 4;
  font: 500 .95rem/1.55 var(--font-mono, ui-monospace, monospace); color: #E2E8F0; background: #0F172A; border: 2px solid #334155; }
.cbc-ta:focus { outline: none; border-color: var(--w); }
.cbc-ref { font-size: .88rem; color: var(--ink-2); }
.cbc-ref summary { cursor: pointer; font-weight: 700; }
.cbc-ref p { margin: .3rem 0; }
/* ---- 90-labs.css ---- */
/* The labs: Pseudocode Playground and Flowchart Lab. */
.clab { display: grid; gap: .8rem; }
.clab-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.clab-bar select { min-height: 44px; padding: .3rem .6rem; border-radius: 12px; font: 600 .95rem var(--font-body); color: var(--ink); background: var(--surface); border: 2px solid var(--border-strong); }
.clab-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 860px) { .clab-grid { grid-template-columns: 1fr; } }
.clab-edit { display: grid; grid-template-columns: auto minmax(0, 1fr); border-radius: 14px; overflow: hidden; background: #0F172A; border: 2px solid #334155; }
.clab-nums { margin: 0; padding: .7rem .5rem; overflow: hidden; text-align: right; user-select: none; color: #94A3B8; background: #0B1222;
  font: 500 .95rem/1.55 var(--font-mono, ui-monospace, monospace); border: 0; border-radius: 0; box-shadow: none; }
.clab-ta { width: 100%; min-height: 260px; padding: .7rem .8rem; resize: vertical; tab-size: 4; white-space: pre; overflow: auto;
  font: 500 .95rem/1.55 var(--font-mono, ui-monospace, monospace); color: #E2E8F0; background: transparent; border: 0; }
.clab-ta:focus { outline: none; }
.clab-edit:focus-within { border-color: var(--w); box-shadow: 0 0 0 3px color-mix(in srgb, var(--w) 30%, transparent); }
.clab-view .ct-code { min-height: 200px; }
.clab-note { margin: .4rem 0 0; font-size: .85rem; color: var(--ink-2); }
.clab-inputs { display: grid; gap: .3rem; margin-top: .6rem; font-weight: 700; font-size: .88rem; }
.clab-inputs textarea { width: 100%; padding: .5rem .6rem; border-radius: 10px; font: 600 .95rem var(--font-mono, ui-monospace, monospace); color: var(--ink); background: var(--surface); border: 2px solid var(--border-strong); }
.clab-out pre { min-height: 90px; margin: .2rem 0 0; padding: .6rem .8rem; border-radius: 12px; white-space: pre-wrap;
  font: 600 .95rem/1.5 var(--font-mono, ui-monospace, monospace); color: #A7F3D0; background: #052E16; border: 2px solid #14532D; }
.clab-err { margin: .4rem 0 0; padding: .5rem .7rem; border-radius: 10px; font-weight: 700; color: var(--bad); background: var(--bad-bg); border: 1px solid var(--bad); }
.clab-vars { margin-top: .6rem; }
.clab-vars td { font-family: var(--font-mono, ui-monospace, monospace); }
.clab-trace caption { caption-side: top; padding: .4rem .6rem; text-align: left; font-weight: 800; }
.clab-tracewrap { max-height: 420px; overflow: auto; }
.clab-guide { padding: .6rem .9rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.clab-guide summary { cursor: pointer; font-weight: 800; }
.clab-guide p { margin: .5rem 0; }
.clab-ref th { white-space: normal; width: 34%; }
.clab-ref pre { margin: 0; padding: .3rem .5rem; font-size: .82rem; line-height: 1.45; border-radius: 8px; white-space: pre-wrap; }
.clab-add { display: flex; flex-wrap: wrap; gap: .35rem; margin: .3rem 0 .6rem; }
.clab-add .ct-tray-h { flex-basis: 100%; }
.clab-list { display: grid; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.clab-blk { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; padding: .4rem .5rem; border-radius: 12px; background: var(--surface); border: 2px solid var(--border-strong); }
.clab-blk.is-on { border-color: #F59E0B; box-shadow: 0 0 0 3px rgba(245, 158, 11, .3); }
.clab-input, .clab-output { border-left: 6px solid #0369A1; }
.clab-process { border-left: 6px solid #A16207; }
.clab-if, .clab-while, .clab-until { border-left: 6px solid #BE185D; }
.clab-kind { font-size: .78rem; font-weight: 800; color: var(--ink-2); min-width: 6.5rem; }
.clab-val { flex: 1 1 140px; min-width: 0; min-height: 36px; padding: .2rem .45rem; border-radius: 8px; font: 600 .92rem var(--font-mono, ui-monospace, monospace); color: var(--ink); background: var(--surface-2); border: 1px solid var(--border-strong); }
.clab-num { font-size: .8rem; font-weight: 700; }
.clab-ops { display: inline-flex; gap: .2rem; margin-left: auto; }
.clab-ops button { width: 30px; height: 30px; border-radius: 8px; cursor: pointer; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--border); }
.clab-sub { flex-basis: 100%; margin-left: .8rem; padding: .3rem 0 .2rem .5rem; border-left: 3px dashed var(--border-strong); }
.clab-sub.is-into { border-left-color: var(--w); }
.clab-subh { margin-bottom: .3rem; padding: .15rem .5rem; border-radius: 8px; cursor: pointer; font: 700 .8rem var(--font-body); color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--border); }
.clab-sub.is-into .clab-subh { color: #fff; background: var(--wd); border-color: var(--wd); }
