/* Learning Lab: a sci-fi quiz room. It is a game scene, so it stays a dark space station in every site theme. */

/* The Serious theme's text face: Nunito (SIL Open Font License 1.1, licence shipped as fonts/Nunito-OFL.txt). Every
   terminal and corner is rounded, so nothing in the theme has a sharp edge. It is used for ALL text of the theme, not only
   the headings: the site's own sans (Barlow) has square terminals and was what still read as sharp in menus, buttons and
   the tutor's speech. One self-hosted variable file (weights 400-800, Latin subset, ~33 kB), so it looks the same on every
   machine. */
@font-face { font-family: "BM Round"; font-weight: 400 800; font-style: normal; font-display: swap; src: url(../fonts/Nunito.woff2) format("woff2"); }
.view[data-view="lab"] { padding: 0; }
.lab {
  --lab-bg: #040712; --lab-bg2: #0b1230; --lab-ink: #e8f1ff; --lab-mute: #93a4c7; --lab-panel: rgba(12, 20, 46, .72);
  --lab-line: rgba(140, 180, 255, .22); --lab-grid: rgba(34, 211, 238, .28); --lab-ruby: #e0115f; --lab-burg: #8a0f2e;
  --c1: #22d3ee; --c2: #a78bfa;
  position: relative; min-height: 100vh; min-height: 100dvh; overflow: hidden; overflow: clip;   /* clip keeps the sticky top bar working */
  color: var(--lab-ink); background: var(--lab-bg); font-family: inherit;
}
.lab-stage { position: relative; min-height: inherit; padding: 0 clamp(16px, 3vw, 40px) 48px; isolation: isolate; }

/* ---------- background ---------- */
.lab-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--c1) 26%, transparent), transparent 60%),
              radial-gradient(800px 500px at 100% 100%, color-mix(in srgb, var(--c2) 22%, transparent), transparent 60%),
              linear-gradient(180deg, var(--lab-bg) 0%, var(--lab-bg2) 100%); }
.lab-stars { position: absolute; inset: -50%; opacity: .7;
  background-image: radial-gradient(1.5px 1.5px at 20px 30px, #fff, transparent), radial-gradient(1px 1px at 120px 80px, #cfe, transparent),
    radial-gradient(1.2px 1.2px at 200px 150px, #fdf, transparent), radial-gradient(1px 1px at 60px 190px, #fff, transparent);
  background-size: 240px 220px; animation: lab-drift 90s linear infinite; }
@keyframes lab-drift { to { transform: translate(240px, 220px); } }
.lab-glow { position: absolute; left: 50%; top: 18%; width: 60vmin; height: 60vmin; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--c1) 30%, transparent), transparent 65%); filter: blur(10px); animation: lab-breathe 6s ease-in-out infinite; }
@keyframes lab-breathe { 50% { opacity: .55; transform: translate(-50%, -50%) scale(1.12); } }
.lab-floor { position: absolute; left: -50%; right: -50%; bottom: -10%; height: 55%; transform-origin: 50% 0; transform: perspective(420px) rotateX(64deg);
  background-image: linear-gradient(var(--lab-grid) 1.5px, transparent 1.5px), linear-gradient(90deg, var(--lab-grid) 1.5px, transparent 1.5px);
  background-size: 56px 56px; animation: lab-floor 2.4s linear infinite;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 40%); mask-image: linear-gradient(180deg, transparent, #000 40%); }
@keyframes lab-floor { to { background-position: 0 56px; } }
.lab-scan { position: absolute; inset: 0; background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 4px); }
.lab-helix { position: absolute; right: 3%; top: 14%; height: 70%; width: auto; color: var(--c1); opacity: .35; animation: lab-helix 9s linear infinite; }
@keyframes lab-helix { to { transform: rotateY(360deg); } }

/* ---------- HUD ---------- */
.lab-hud { position: relative; z-index: 3; display: flex; align-items: center; gap: 14px; padding: 16px 0 6px; flex-wrap: wrap; }
.lab-hud-r { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lab-brand { display: flex; align-items: center; gap: 10px; letter-spacing: .18em; font-size: 13px; }
.lab-brand b { font-weight: 800; background: linear-gradient(90deg, var(--c1), var(--c2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lab-brand small { letter-spacing: .04em; color: var(--lab-mute); font-size: 12px; }
.lab-logo { width: 30px; height: 30px; color: #ff7a2e; filter: drop-shadow(0 0 8px rgba(255, 122, 46, .7)); animation: lab-spin 12s linear infinite; }
.lab-logo svg { width: 100%; height: 100%; }
@keyframes lab-spin { to { transform: rotate(360deg); } }
.lab-icon { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--lab-line); background: var(--lab-panel); color: var(--lab-ink); cursor: pointer; font-size: 16px; }

/* the ruby */
.lab-ruby { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 8px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(90, 0, 24, .85), rgba(30, 0, 10, .85)); border: 1px solid rgba(255, 92, 138, .55);
  box-shadow: 0 0 18px rgba(224, 17, 95, .45), inset 0 0 12px rgba(255, 92, 138, .25); }
.lab-ruby .gem { width: 30px; height: 26px; filter: drop-shadow(0 0 6px rgba(255, 40, 100, .9)); animation: lab-gem 3.2s ease-in-out infinite; overflow: hidden; }
.lab-ruby .gem .shine { animation: lab-shine 2.8s ease-in-out infinite; }
@keyframes lab-shine { 0%, 55% { transform: translateX(-20px) rotate(25deg); } 100% { transform: translateX(110px) rotate(25deg); } }
@keyframes lab-gem { 50% { transform: translateY(-2px) rotate(-4deg); } }
.lab-ruby .num { font: 800 20px/1 ui-monospace, "SFMono-Regular", Menlo, monospace; font-variant-numeric: tabular-nums; letter-spacing: .04em;
  background: linear-gradient(180deg, #ffe3ea 0%, #ff5c8a 45%, #b0103a 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 6px rgba(255, 60, 110, .8)); }
.lab-ruby.small { padding: 4px 12px 4px 6px; } .lab-ruby.small .num { font-size: 18px; }
.lab-ruby.pop { animation: lab-pop .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes lab-pop { 40% { transform: scale(1.25); box-shadow: 0 0 40px rgba(255, 40, 100, .9); } }
.rubytxt { color: #ff5c8a; text-shadow: 0 0 10px rgba(224, 17, 95, .7); font-variant-numeric: tabular-nums; }

/* buttons */
.lab-btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 14px; font: 700 15px/1 inherit; cursor: pointer; text-decoration: none;
  border: 1px solid var(--lab-line); color: var(--lab-ink); background: var(--lab-panel); transition: transform .15s, box-shadow .2s; }
.lab-btn:hover { transform: translateY(-2px); }
.lab-btn.primary { border: 0; color: #050816; background: linear-gradient(90deg, var(--c1), var(--c2)); box-shadow: 0 0 24px color-mix(in srgb, var(--c1) 55%, transparent); }
.lab-btn.primary:hover { box-shadow: 0 0 40px color-mix(in srgb, var(--c1) 80%, transparent); }
.lab-btn.sm { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.lab-btn:focus-visible, .lab-opt:focus-visible, .lab-topic:focus-visible, .lab-node:focus-visible { outline: 3px solid var(--c1); outline-offset: 3px; }

/* ---------- entrance: the robot ---------- */
.lab-hero { display: grid; grid-template-columns: minmax(260px, 380px) minmax(0, 560px); gap: clamp(16px, 4vw, 48px); align-items: center; justify-content: center; padding: 10px 0 18px; }
.rb-scene { position: relative; height: 400px; perspective: 900px; display: grid; place-items: center; }
.rb { --ry: 0deg; --rx: 0deg; --lx: 0px; --ly: 0px; position: relative; width: 200px; height: 330px; transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .35s ease-out; animation: rb-hover 4s ease-in-out infinite; }
@keyframes rb-hover { 50% { translate: 0 -14px; } }
.rb.launch { animation: rb-launch .6s ease-in forwards; }
@keyframes rb-launch { to { translate: 0 -120px; scale: .6; opacity: 0; } }
.rb .visor { position: absolute; inset: 22px 16px 26px; border-radius: 30px; background: radial-gradient(120% 90% at 50% 0%, #1b2a55, #050815 70%);
  box-shadow: inset 0 0 18px rgba(34, 211, 238, .45), 0 0 0 3px rgba(20, 30, 60, .9); display: flex; align-items: center; justify-content: center; gap: 22px; padding-bottom: 14px; }
.rb .eye { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle, rgba(255, 122, 46, .25), rgba(10, 16, 40, .95) 70%); box-shadow: 0 0 0 3px #22d3ee, 0 0 22px #22d3ee, inset 0 0 14px rgba(34, 211, 238, .8);
  animation: rb-blink 5s infinite; }
.rb .pupil { width: 38px; height: 38px; color: #ff7a2e; filter: drop-shadow(0 0 6px #ff7a2e) drop-shadow(0 0 14px rgba(255, 122, 46, .8));
  transform: translate(var(--lx), var(--ly)); transition: transform .25s; }
.rb .pupil svg { width: 100%; height: 100%; animation: lab-spin 10s linear infinite; }
@keyframes rb-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.08); } }
.rb .mouth { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 4px; }
.rb .mouth i { width: 6px; height: 6px; border-radius: 2px; background: #22d3ee; box-shadow: 0 0 6px #22d3ee; opacity: .7; }
.rb.talking .mouth i { animation: rb-talk .32s ease-in-out infinite alternate; }
.rb.talking .mouth i:nth-child(2n) { animation-delay: .1s; } .rb.talking .mouth i:nth-child(3n) { animation-delay: .2s; }
@keyframes rb-talk { to { height: 16px; transform: translateY(-5px); opacity: 1; } }
.rb-ant { position: absolute; left: 96px; top: 0; width: 8px; height: 40px; background: linear-gradient(#cdd6ea, #8c98b3); border-radius: 4px; transform: translateZ(0); }
.rb-ant span { position: absolute; left: -7px; top: -12px; width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, #ff7a2e 50%, #b0103a);
  box-shadow: 0 0 18px #ff7a2e; animation: rb-ping 1.6s ease-in-out infinite; }
@keyframes rb-ping { 50% { box-shadow: 0 0 34px 8px rgba(255, 122, 46, .8); } }
.rb .chest { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); width: 92px; padding: 8px 0 6px; border-radius: 16px; display: grid; justify-items: center; gap: 2px;
  background: #070b1c; box-shadow: inset 0 0 12px rgba(34, 211, 238, .5); }
.rb .chest svg { width: 34px; height: 34px; color: #ff7a2e; filter: drop-shadow(0 0 6px #ff7a2e); animation: rb-heart 1.4s ease-in-out infinite; }
.rb .chest span { font-size: 6.5px; letter-spacing: .12em; color: #67e8f9; font-weight: 800; }
@keyframes rb-heart { 50% { transform: scale(1.12); } }
@keyframes rb-wave { from { transform: translateZ(10px) rotate(-130deg); } to { transform: translateZ(10px) rotate(-170deg); } }
@keyframes rb-arm-l { 50% { transform: translateZ(10px) rotate(8deg); } }
.rb-jet { position: absolute; left: 70px; top: 306px; width: 60px; height: 50px; border-radius: 50%; background: radial-gradient(ellipse at top, rgba(34, 211, 238, .9), rgba(167, 139, 250, .3) 50%, transparent 70%);
  filter: blur(4px); animation: rb-jet .18s ease-in-out infinite alternate; }
@keyframes rb-jet { to { transform: scaleY(1.25); opacity: .7; } }
.rb-shadow { position: absolute; bottom: 8px; left: 50%; width: 180px; height: 26px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(rgba(34, 211, 238, .45), transparent 70%);
  animation: rb-shadow 4s ease-in-out infinite; }
@keyframes rb-shadow { 50% { transform: translateX(-50%) scale(.8); opacity: .6; } }
.rb-rings { position: absolute; left: 50%; bottom: 0; width: 320px; height: 90px; transform: translateX(-50%); }
.rb-rings i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(34, 211, 238, .5); animation: rb-ring 3s linear infinite; }
.rb-rings i:nth-child(2) { animation-delay: 1s; border-color: rgba(167, 139, 250, .5); } .rb-rings i:nth-child(3) { animation-delay: 2s; border-color: rgba(255, 122, 46, .45); }
@keyframes rb-ring { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.1); opacity: 0; } }

.lab-speech { position: relative; padding: 22px 24px; border-radius: 22px; background: var(--lab-panel); border: 1px solid color-mix(in srgb, var(--c1) 45%, transparent);
  box-shadow: 0 0 40px color-mix(in srgb, var(--c1) 22%, transparent), inset 0 0 30px color-mix(in srgb, var(--c1) 8%, transparent); backdrop-filter: blur(10px); min-height: 150px; }
.lab-speech::before { content: ""; position: absolute; left: -12px; top: 50%; width: 22px; height: 22px; transform: translateY(-50%) rotate(45deg); background: inherit;
  border-left: 1px solid color-mix(in srgb, var(--c1) 45%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--c1) 45%, transparent); }
.lab-speech .who { display: block; font-size: 12px; letter-spacing: .16em; color: var(--c1); margin-bottom: 8px; text-transform: uppercase; }
.lab-speech p { margin: 0; font-size: clamp(16px, 1.6vw, 19px); line-height: 1.55; }

.lab-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; max-width: 1280px; margin: 0 auto; }
.lab-topic { position: relative; display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: center; text-align: left; padding: 14px 16px; border-radius: 20px; cursor: pointer;
  color: var(--lab-ink); background: linear-gradient(145deg, color-mix(in srgb, var(--c1) 16%, var(--lab-panel)), var(--lab-panel)); border: 1px solid color-mix(in srgb, var(--c1) 40%, transparent);
  box-shadow: 0 0 0 transparent; transition: transform .2s, box-shadow .25s; animation: lab-rise .6s calc(var(--i) * 70ms) both cubic-bezier(.2, .9, .3, 1.2); font: inherit; }
@keyframes lab-rise { from { opacity: 0; transform: translateY(26px) scale(.96); } }
.lab-topic:hover { transform: translateY(-4px) scale(1.015); box-shadow: 0 10px 40px color-mix(in srgb, var(--c1) 40%, transparent); }
.lab-topic-av .av { width: 92px; height: 100px; }
.lab-topic-t { display: grid; gap: 4px; min-width: 0; }
.lab-topic-t small { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--c1); }
.lab-topic-t strong { font-size: 18px; }
.lab-topic-t > span:not([class]) { font-size: 13.5px; color: var(--lab-mute); line-height: 1.4; }
.lab-topic-bar { height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--lab-ink) 12%, transparent); overflow: hidden; margin-top: 4px; }
.lab-topic-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--c1), var(--c2)); box-shadow: 0 0 10px var(--c1); }
.lab-topic-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--lab-mute); flex-wrap: wrap; }
.lab-badge { position: absolute; top: 10px; right: 12px; font-size: 10px; letter-spacing: .14em; font-weight: 800; padding: 4px 8px; border-radius: 6px; color: #fff;
  background: linear-gradient(90deg, #b0103a, #ff5c8a); box-shadow: 0 0 12px rgba(224, 17, 95, .7); }

/* ---------- avatars ---------- */
.av { overflow: visible; }
.av .av-float { animation: av-bob 3.2s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes av-bob { 50% { transform: translateY(-6px); } }
.av .av-eyes { animation: av-blink 4.5s infinite; transform-origin: 50% 40%; transform-box: fill-box; }
@keyframes av-blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
.av .av-flag { animation: av-flag 1.1s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 0 50%; }
.av .av-flag.f2 { transform-origin: 0 50%; animation-delay: .3s; } .av .av-flag.f3 { animation-delay: .6s; }
@keyframes av-flag { to { transform: skewY(14deg) scaleX(1.1); } }
.av .av-crown { animation: av-crown 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes av-crown { 50% { transform: rotate(-6deg) translateY(-2px); } }
.av .av-spore { animation: av-spore 3s ease-in infinite; }
.av .av-spore.s1 { animation-delay: .6s; } .av .av-spore.s2 { animation-delay: 1.2s; } .av .av-spore.s3 { animation-delay: 1.8s; } .av .av-spore.s4 { animation-delay: 2.4s; }
@keyframes av-spore { from { transform: translateY(0); opacity: 1; } to { transform: translateY(70px) translateX(10px); opacity: 0; } }
.av .av-cap { animation: av-cap 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes av-cap { 50% { transform: scaleX(1.03) scaleY(.98); } }
.av .av-myc { stroke-dasharray: 120; animation: av-myc 4s linear infinite; }
@keyframes av-myc { from { stroke-dashoffset: 240; } }
.av .av-ant { animation: av-ant 1.6s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 100% 100%; }
.av .av-ant.a2 { transform-origin: 0 100%; animation-delay: .4s; }
@keyframes av-ant { to { transform: rotate(8deg); } }
.av .av-leg { animation: av-leg .5s ease-in-out infinite alternate; transform-box: fill-box; }
.av .av-leg.l1, .av .av-leg.r0, .av .av-leg.r2 { animation-delay: .25s; }
@keyframes av-leg { to { transform: rotate(6deg); } }
.av .av-tip, .av .av-core { animation: av-glow 1.4s ease-in-out infinite alternate; }
@keyframes av-glow { to { opacity: .45; } }
.talking .av .av-mouth { animation: av-talk .22s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 0; }
@keyframes av-talk { to { transform: scaleY(2.2); } }
.lab-pilot-av.happy .av { animation: av-jump .7s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes av-jump { 40% { transform: translateY(-26px) rotate(-4deg) scale(1.06); } }
.lab-pilot-av.sad .av { animation: av-shake .45s; }
@keyframes av-shake { 20%, 60% { transform: translateX(-8px) rotate(-3deg); } 40%, 80% { transform: translateX(8px) rotate(3deg); } }

/* ---------- topic room ---------- */
.lab-map { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0; padding: 10px 0 22px; row-gap: 22px; }
.lab-wire { width: clamp(10px, 3vw, 40px); height: 3px; background: linear-gradient(90deg, var(--c1), var(--c2)); opacity: .5; box-shadow: 0 0 8px var(--c1); }
.lab-node { position: relative; width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; cursor: pointer; font: inherit; color: var(--lab-ink);
  background: var(--lab-panel); border: 2px solid color-mix(in srgb, var(--c1) 45%, transparent); border-radius: 50%; transition: transform .2s, box-shadow .2s; }
.lab-node .n { font-weight: 800; font-size: 16px; }
.lab-node .s { position: absolute; top: calc(100% + 3px); left: 50%; transform: translateX(-50%); font-size: 11px; line-height: 1; color: #fbbf24; white-space: nowrap; text-shadow: 0 0 6px rgba(251, 191, 36, .8); }
.lab-node.done { background: linear-gradient(135deg, var(--c1), var(--c2)); color: #050816; border-color: transparent; }
.lab-node.on { box-shadow: 0 0 0 4px color-mix(in srgb, var(--c1) 35%, transparent), 0 0 28px var(--c1); transform: scale(1.14); }
.lab-node.locked { opacity: .45; cursor: not-allowed; }
.lab-node:not(.locked):hover { transform: scale(1.12); }

.lab-main { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(220px, 320px) minmax(0, 820px); gap: clamp(16px, 3vw, 40px); justify-content: center; align-items: start; padding-top: 18px; }
.lab-pilot { position: sticky; top: calc(var(--nav-h) + 12px); display: grid; justify-items: center; gap: 10px; }
.lab-pilot-av { width: 100%; display: grid; place-items: center; }
.lab-pilot-av .av { width: min(260px, 100%); height: auto; filter: drop-shadow(0 0 22px color-mix(in srgb, var(--c1) 55%, transparent)); }
.lab-plate { display: flex; gap: 10px; align-items: baseline; padding: 6px 14px; border-radius: 999px; background: var(--lab-panel); border: 1px solid var(--lab-line); }
.lab-plate b { color: var(--c1); letter-spacing: .08em; } .lab-plate span { color: var(--lab-mute); font-size: 13px; }
.lab-bubble { position: relative; width: 100%; padding: 14px 16px; border-radius: 16px; background: var(--lab-panel); border: 1px solid color-mix(in srgb, var(--c1) 40%, transparent); backdrop-filter: blur(8px); min-height: 70px; }
.lab-bubble::before { content: ""; position: absolute; left: 50%; top: -9px; width: 16px; height: 16px; translate: -50% 0; rotate: 45deg; background: inherit;
  border-left: 1px solid color-mix(in srgb, var(--c1) 40%, transparent); border-top: 1px solid color-mix(in srgb, var(--c1) 40%, transparent); }
.lab-bubble p { margin: 0; font-size: 15px; line-height: 1.5; }

.lab-panel { position: relative; padding: clamp(18px, 3vw, 32px); border-radius: 24px; background: var(--lab-panel); backdrop-filter: blur(14px);
  border: 1px solid color-mix(in srgb, var(--c1) 40%, transparent); box-shadow: 0 0 60px color-mix(in srgb, var(--c1) 16%, transparent), inset 0 1px 0 rgba(255, 255, 255, .08); }
.lab-panel::before, .lab-panel::after { content: ""; position: absolute; width: 22px; height: 22px; border: 3px solid var(--c1); filter: drop-shadow(0 0 6px var(--c1)); }
.lab-panel::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-radius: 12px 0 0 0; }
.lab-panel::after { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-radius: 0 0 12px 0; }
.lab-panel.in { animation: lab-in .45s cubic-bezier(.2, .9, .3, 1.1); }
@keyframes lab-in { from { opacity: 0; transform: translateY(18px) scale(.98); filter: blur(4px); } }
.lab-kicker { font-size: 12px; letter-spacing: .2em; color: var(--c1); font-weight: 800; }
.lab-panel h2 { margin: 8px 0 14px; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.2; }
.lab-panel p { margin: 0 0 12px; line-height: 1.65; color: var(--lab-ink); opacity: .92; }
.lab-sub { margin: 18px 0 8px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--lab-mute); font-weight: 800; }
.lab-list { margin: 0; padding-left: 20px; line-height: 1.6; }
.lab-list li::marker { color: var(--c1); }
.lab-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lab-chips span { padding: 6px 12px; border-radius: 999px; font-size: 13px; border: 1px solid color-mix(in srgb, var(--c2) 45%, transparent); background: color-mix(in srgb, var(--c2) 12%, transparent); }
.lab-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 22px; }
.lab-note { color: var(--lab-mute); font-size: 14px; }

/* quiz */
.lab-pips { display: flex; gap: 6px; margin-top: 10px; }
.lab-pips i { flex: 1; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--lab-ink) 14%, transparent); }
.lab-pips i.ok { background: linear-gradient(90deg, var(--c1), var(--c2)); box-shadow: 0 0 8px var(--c1); }
.lab-pips i.now { background: color-mix(in srgb, var(--c1) 50%, transparent); animation: lab-breathe2 1.2s ease-in-out infinite; }
@keyframes lab-breathe2 { 50% { opacity: .4; } }
.lab-q { font-size: clamp(20px, 2.3vw, 26px) !important; }
.lab-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.lab-opt { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 16px; text-align: left; cursor: pointer; font: 600 16px/1.35 inherit; color: var(--lab-ink);
  background: linear-gradient(145deg, color-mix(in srgb, var(--c1) 10%, transparent), color-mix(in srgb, var(--c2) 8%, transparent)); border: 1px solid color-mix(in srgb, var(--c1) 35%, transparent);
  transition: transform .15s, box-shadow .2s, background .2s; animation: lab-rise .45s calc(var(--j) * 70ms) both; }
.lab-opt:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 0 24px color-mix(in srgb, var(--c1) 45%, transparent); border-color: var(--c1); }
.lab-opt .key { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #050816; background: linear-gradient(135deg, var(--c1), var(--c2)); }
.lab-opt:disabled { cursor: default; }
.lab-opt.wrong { animation: lab-shake .4s; border-color: #f43f5e; background: rgba(244, 63, 94, .14); opacity: .6; }
.lab-opt.wrong .key { background: #f43f5e; color: #fff; }
.lab-opt.right { border-color: #4ade80; background: rgba(74, 222, 128, .18); box-shadow: 0 0 30px rgba(74, 222, 128, .55); transform: scale(1.02); }
.lab-opt.right .key { background: #4ade80; }
@keyframes lab-shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.lab-why { margin-top: 16px; padding: 14px 16px; border-radius: 14px; border-left: 4px solid #4ade80; background: rgba(74, 222, 128, .1); line-height: 1.55; animation: lab-in .4s; }
.lab-why b { color: #ff5c8a; text-shadow: 0 0 8px rgba(224, 17, 95, .6); margin-right: 6px; }

/* level complete */
.lab-panel.done { text-align: center; }
.lab-panel.done .lab-actions { justify-content: center; }
.lab-stars-big { display: flex; justify-content: center; gap: 10px; font-size: 56px; margin-top: 8px; }
.lab-stars-big span { color: color-mix(in srgb, var(--lab-ink) 18%, transparent); }
.lab-stars-big span.on { color: #fbbf24; text-shadow: 0 0 18px rgba(251, 191, 36, .9); animation: lab-star .6s calc(var(--k) * 180ms + .1s) both cubic-bezier(.3, 1.7, .5, 1); }
@keyframes lab-star { from { transform: scale(0) rotate(-90deg); opacity: 0; } }
.lab-earned { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; font-weight: 700; }
.lab-trophy { font-size: 18px; margin-top: 16px; }

/* effects */
.lab-spark { position: absolute; z-index: 20; width: 8px; height: 8px; border-radius: 50%; pointer-events: none; background: hsl(var(--h) 95% 65%); box-shadow: 0 0 10px hsl(var(--h) 95% 65%);
  animation: lab-spark .85s ease-out forwards; }
@keyframes lab-spark { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }
.lab-fly { position: absolute; z-index: 21; pointer-events: none; font: 800 22px/1 ui-monospace, monospace; color: #ff5c8a; text-shadow: 0 0 12px rgba(224, 17, 95, .9);
  animation: lab-fly 1.05s cubic-bezier(.5, -0.3, .7, 1) forwards; }
@keyframes lab-fly { 20% { transform: translate(0, -30px) scale(1.3); } to { transform: translate(var(--tx), var(--ty)) scale(.6); opacity: .2; } }
.lab-warp { position: absolute; inset: 0; z-index: 30; pointer-events: none; background: radial-gradient(circle, transparent 0, rgba(4, 7, 18, .7) 70%); animation: lab-warpbg .6s ease-in forwards; }
.lab-warp i { position: absolute; left: 50%; top: 40%; width: 3px; height: 40vmax; transform-origin: 50% 0; transform: rotate(var(--a)) translateY(20px) scaleY(0);
  background: linear-gradient(var(--c1), transparent); animation: lab-streak .55s var(--d) ease-in forwards; }
@keyframes lab-streak { to { transform: rotate(var(--a)) translateY(80px) scaleY(1); opacity: 0; } }
@keyframes lab-warpbg { to { background-color: rgba(255, 255, 255, .25); } }

/* ---------- phones ---------- */
@media (max-width: 860px) {
  .lab-hero { grid-template-columns: 1fr; }
  .rb-scene { height: 300px; }
  .rb { scale: .72; }
  .lab-speech::before { left: 50%; top: -12px; transform: translateX(-50%) rotate(135deg); }
  /* minmax(0, 1fr) and min-width: 0 (2026-11-19): a long code line or word must not widen the page past the phone screen;
     code scrolls inside its own box, figures and tables shrink to fit */
  .lab-main { grid-template-columns: minmax(0, 1fr); }
  .lab-main > *, .lab-panel, .lab-opts, .lab-opt, .lab-pilot > * { min-width: 0; max-width: 100%; }
  .lab-opts { grid-template-columns: minmax(0, 1fr); }
  .lab-panel pre, .lab-code { max-width: 100%; overflow-x: auto; white-space: pre; }
  .lab-panel img, .lab-panel svg:not(.av), .lab-panel video, .lab-panel figure { max-width: 100%; height: auto; }
  .lab-panel table { display: block; max-width: 100%; overflow-x: auto; }
  .lab-q, .lab-opt, .lab-panel p, .lab-panel li, .lab-why, .lab-bubble { overflow-wrap: break-word; }
  .lab-pilot { position: relative; top: 0; grid-template-columns: 110px 1fr; align-items: center; justify-items: start; }
  .lab-pilot-av { grid-row: span 2; }
  .lab-pilot-av .av { width: 110px; }
  .lab-bubble::before { display: none; }
  .lab-helix { display: none; }
  .lab-node { width: 40px; height: 40px; }
  .lab-topic { grid-template-columns: 70px 1fr; }
  .lab-topic-av .av { width: 70px; height: 78px; }
}
@media (prefers-reduced-motion: reduce) {
  .lab *, .lab *::before, .lab *::after { animation: none !important; transition: none !important; }
}
/* one chance per question: a miss shows the right answer and a red explanation */
.lab-why.miss { border-left-color: #f43f5e; background: rgba(244, 63, 94, .1); }
.lab-why b.no { color: #fb7185; text-shadow: none; }
.lab-why strong { color: #4ade80; }
.lab-opt.right.reveal { transform: none; animation: lab-reveal 1.2s ease-in-out 2; }
@keyframes lab-reveal { 50% { box-shadow: 0 0 44px rgba(74, 222, 128, .85); } }
.lab-opt.wrong { opacity: .75; }
/* the elf (Elara): ears twitch, hair sways, and she now and then turns her sword point-down and plants it in the
   ground, then lifts it again; a wrong answer makes her plant it at once */
.av .av-sword { transform-box: view-box; transform-origin: 160.5px 154px; animation: av-sword 7s cubic-bezier(.5, 0, .3, 1) infinite; }
@keyframes av-sword {
  0%, 45% { transform: rotate(0deg); }
  55% { transform: rotate(180deg) translateY(-6px); }
  58%, 85% { transform: rotate(180deg); }
  95%, 100% { transform: rotate(360deg); }
}
.lab-pilot-av.sad .av-sword { animation: av-sword-rest 3s cubic-bezier(.5, 0, .3, 1); }
@keyframes av-sword-rest {
  0% { transform: rotate(0deg); }
  18% { transform: rotate(180deg) translateY(-6px); }
  22%, 80% { transform: rotate(180deg); }
  100% { transform: rotate(360deg); }
}
.av .av-ear { transform-box: fill-box; animation: av-ear 3.6s ease-in-out infinite; }
.av .av-ear.l { transform-origin: 100% 100%; } .av .av-ear.r { transform-origin: 0 100%; animation-delay: .2s; }
@keyframes av-ear { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-8deg); } 90% { transform: rotate(5deg); } }
.av .av-hair { transform-box: fill-box; transform-origin: 50% 0; animation: av-hair 5s ease-in-out infinite; }
@keyframes av-hair { 50% { transform: skewX(1.5deg); } }

/* ---------- full screen: the site header and phone bar step aside; an orange X closes the lab ---------- */
body.in-lab .nav, body.in-lab .tabbar, body.in-lab .nav-sub, body.in-lab .peek-tab, body.in-lab .peek-zone, body.in-lab .page-close { display: none !important; }
body.in-lab { padding-bottom: 0 !important; }
body.in-lab .lab-pilot { top: 12px; }
.lab-x { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; background: transparent; border: 0; padding: 0; margin-left: 4px; }
.lab-x svg { width: 30px; height: 30px; fill: none; stroke: #ff7a2e; stroke-width: 2.6; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(255, 122, 46, .7)); transition: transform .2s; }
.lab-x:hover svg { transform: rotate(90deg) scale(1.1); }
.lab-x:focus-visible { outline: 3px solid #ff7a2e; outline-offset: 2px; }
.lab-icon.off { opacity: .45; text-decoration: line-through; }

/* ---------- the solid robot: stacked layers ---------- */
.rb .slab { position: absolute; transform-style: preserve-3d; }
.rb .ly { position: absolute; inset: 0; border-radius: inherit; }
.rb .face { background: linear-gradient(150deg, #f7f9fe 0%, #d4dcec 55%, #aeb9d1 100%); box-shadow: inset 0 -14px 26px rgba(40, 60, 110, .28), inset 0 10px 16px rgba(255, 255, 255, .75); }
.rb-head { left: 0; top: 30px; width: 200px; height: 150px; border-radius: 56px; }
.rb-body { left: 24px; top: 166px; width: 152px; height: 128px; border-radius: 44px 44px 60px 60px; }
.rb-ear { top: 76px; width: 24px; height: 56px; border-radius: 12px; }
.rb-ear.l { left: -14px; } .rb-ear.r { right: -14px; }
.rb-ear .face { background: linear-gradient(#ff9a52, #e8590c); box-shadow: 0 0 14px rgba(232, 89, 12, .8); }
.rb-ear .ly:not(.face) { background: #b84a10 !important; }
.rb-arm { top: 178px; width: 24px; height: 92px; border-radius: 12px; transform-origin: 50% 10px; }
.rb-arm.l { left: 8px; animation: rb-arm-l2 4s ease-in-out infinite; }
.rb-arm.r { right: 8px; animation: rb-wave2 1.2s ease-in-out infinite alternate; }
.rb-arm .hand { position: absolute; left: -3px; bottom: -14px; width: 30px; height: 24px; border-radius: 50% 50% 40% 40%; background: #ff7a2e; box-shadow: 0 0 10px rgba(255, 122, 46, .7); }
@keyframes rb-wave2 { from { transform: rotate(-130deg); } to { transform: rotate(-170deg); } }
@keyframes rb-arm-l2 { 0%, 100% { transform: rotate(16deg); } 50% { transform: rotate(8deg); } }
.rb .visor { inset: 22px 18px 26px; border-radius: 36px; }
.rb-jet { top: 292px; left: 70px; }

/* ---------- guests, expert mode and the invitation to ask the admin ---------- */
.lab-topic.locked { cursor: pointer; filter: saturate(.55); }
.lab-topic.locked .lab-topic-av, .lab-topic.locked .lab-topic-t { opacity: .45; }
.lab-lock { position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; justify-items: center; gap: 6px; border-radius: inherit; text-align: center;
  background: rgba(4, 7, 18, .72); font-weight: 700; font-size: 14px; }
.lab-lock b { font-size: 30px; filter: drop-shadow(0 0 10px var(--c1)); }
.lab-topic.locked:hover .lab-lock span { text-decoration: underline; }
.lab-topic-tempt { margin-top: 4px; font-size: 12px; font-weight: 700; color: #fbbf24; }
.lab-banner { position: relative; z-index: 2; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: space-between; max-width: 1280px; margin: 0 auto 16px;
  padding: 12px 16px; border-radius: 16px; background: linear-gradient(90deg, rgba(251, 191, 36, .14), rgba(224, 17, 95, .14)); border: 1px solid rgba(251, 191, 36, .45); }
.lab-banner span { flex: 1 1 320px; line-height: 1.5; }
.lab-tempt { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 18px; padding: 14px 16px; border-radius: 16px;
  background: linear-gradient(90deg, rgba(251, 191, 36, .12), rgba(224, 17, 95, .12)); border: 1px dashed rgba(251, 191, 36, .6); }
.lab-tempt .ic { font-size: 26px; filter: drop-shadow(0 0 8px rgba(251, 191, 36, .8)); }
.lab-tempt > div { flex: 1 1 260px; text-align: left; }
.lab-tempt b { color: #fbbf24; letter-spacing: .04em; }
.lab-tempt p { margin: 4px 0 0 !important; font-size: 14px; }
.lab-tempt.big { border-style: solid; box-shadow: 0 0 30px rgba(251, 191, 36, .25); animation: lab-tempt 3s ease-in-out infinite; }
@keyframes lab-tempt { 50% { box-shadow: 0 0 46px rgba(251, 191, 36, .45); } }

/* a question asked to our AI while the quiz question was open */
.lab-aitag { display: inline-block; margin-left: 8px; padding: 3px 8px; border-radius: 999px; font-size: 11px; letter-spacing: .04em; color: #fff; background: #be123c; box-shadow: 0 0 10px rgba(244, 63, 94, .6); }

/* ---------- new tests, mastery and green rubies ---------- */
.lab-ruby.green { background: linear-gradient(135deg, rgba(0, 70, 35, .85), rgba(0, 25, 12, .85)); border-color: rgba(125, 255, 178, .55);
  box-shadow: 0 0 18px rgba(31, 214, 122, .45), inset 0 0 12px rgba(125, 255, 178, .25); }
.lab-ruby.green .gem { filter: drop-shadow(0 0 6px rgba(40, 255, 140, .9)); }
.lab-ruby.green .num { background: linear-gradient(180deg, #eafff2 0%, #7dffb2 45%, #0f9d58 100%); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 0 6px rgba(40, 255, 140, .8)); }
.lab-ruby.green.pop { animation: lab-pop-g .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes lab-pop-g { 40% { transform: scale(1.25); box-shadow: 0 0 40px rgba(40, 255, 140, .9); } }
.lab-hud-r .lab-ruby + .lab-ruby { margin-left: -2px; }
.greentxt { color: #4ade80; text-shadow: 0 0 10px rgba(31, 214, 122, .6); }
.lab-fly.green { color: #4ade80; text-shadow: 0 0 12px rgba(31, 214, 122, .9); }
.lab-mastery { position: relative; height: 18px; margin: -6px 0 14px; border-radius: 999px; background: color-mix(in srgb, var(--lab-ink) 10%, transparent); overflow: hidden; }
.lab-mastery i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #0f9d58, #4ade80); box-shadow: 0 0 10px rgba(74, 222, 128, .7); }
.lab-mastery span { position: relative; z-index: 1; display: block; padding: 0 10px; font-size: 11px; line-height: 18px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.lab-mastery.full i { background: linear-gradient(90deg, #f59e0b, #fde047); }
.lab-topic-bar.mastery { height: 3px; margin-top: 2px; } .lab-topic-bar.mastery i { background: linear-gradient(90deg, #0f9d58, #4ade80); box-shadow: 0 0 8px #4ade80; }
.lab-topic-tempt.green { color: #4ade80; }
.lab-restart { margin-left: 10px; padding: 3px 9px; border-radius: 999px; font: 700 11px/1.2 inherit; letter-spacing: .04em; color: var(--lab-mute); background: transparent; border: 1px solid var(--lab-line); cursor: pointer; }
.lab-restart:hover { color: var(--lab-ink); border-color: var(--c1); }
.lab-master-call { margin: 18px auto 0; max-width: 560px; padding: 14px 16px; border-radius: 16px; text-align: center; border: 1px solid rgba(74, 222, 128, .5);
  background: linear-gradient(135deg, rgba(15, 157, 88, .16), rgba(34, 211, 238, .1)); box-shadow: 0 0 30px rgba(74, 222, 128, .18); }
.lab-master-call b:first-child { color: #4ade80; letter-spacing: .06em; text-transform: uppercase; font-size: 13px; }
.lab-master-call p { margin: 6px 0 12px !important; font-size: 14.5px; }
.lab-note.small { font-size: 12.5px; margin: 12px 0 0 !important; }
.lab-node.mastered { box-shadow: 0 0 0 3px #fbbf24, 0 0 18px rgba(251, 191, 36, .8); }
.lab-refs { margin-top: 14px; font-size: 13.5px; }
.lab-refs summary { cursor: pointer; color: var(--c1); font-weight: 700; }
.lab-refs ul { margin: 8px 0 0; padding-left: 18px; line-height: 1.5; color: var(--lab-mute); }
/* the UFO: lights blink in turn, the beam breathes */
.av .av-light { animation: av-blink-l 1.2s ease-in-out infinite; }
.av .av-light.l1 { animation-delay: .24s; } .av .av-light.l2 { animation-delay: .48s; } .av .av-light.l3 { animation-delay: .72s; } .av .av-light.l4 { animation-delay: .96s; }
@keyframes av-blink-l { 50% { opacity: .25; } }
.av .av-beam { animation: av-beam 2.6s ease-in-out infinite; transform-origin: 50% 0; transform-box: fill-box; }
@keyframes av-beam { 50% { opacity: .45; transform: scaleX(.85); } }
.av .av-ufo { animation: av-ufo 4s ease-in-out infinite; transform-origin: 50% 60%; transform-box: fill-box; }
@keyframes av-ufo { 25% { transform: translateY(-6px) rotate(-3deg); } 75% { transform: translateY(-2px) rotate(3deg); } }

/* ---------- deep follow-ups and code ---------- */
.lab-depth { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 6px; font-size: 10px; letter-spacing: .12em; color: #050816; background: linear-gradient(90deg, var(--c1), var(--c2)); }
.lab-depth.pro { background: linear-gradient(90deg, #fbbf24, #f472b6); }
.lab-chain { margin: 8px 0 -4px; font-size: 13px; color: var(--lab-mute); }
.lab-chain b { color: var(--c1); }
/* above the question: the handbook chapter it comes from, one tap away */
.lab-src { display: flex; align-items: baseline; gap: 7px; margin: 8px 0 -2px; font-size: 13px; color: var(--lab-mute); }
.lab-src .ic { flex: none; font-size: 12px; opacity: .85; }
.lab-src a, .lab-src b { color: var(--lab-ink); font-weight: 600; }
.lab-src a { text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--c1, #8ab4ff) 55%, transparent); }
.lab-src a:hover, .lab-src a:focus-visible { color: var(--c1); border-bottom-color: var(--c1); }
.lab-code { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; overflow-x: auto; background: #02040b; border: 1px solid color-mix(in srgb, var(--c1) 35%, transparent);
  font: 13px/1.55 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; color: #a5f3fc; white-space: pre; box-shadow: inset 0 0 18px rgba(34, 211, 238, .08); }

/* ---------- lesson chapters ---------- */
.lab-panel.lesson h2 { margin-bottom: 8px; }
.lab-lessons { display: flex; gap: 4px; margin: 0 0 16px; flex-wrap: wrap; }
.lab-lessons i { width: 18px; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--lab-ink) 14%, transparent); }
.lab-lessons i.ok { background: var(--c1); } .lab-lessons i.now { background: linear-gradient(90deg, var(--c1), var(--c2)); box-shadow: 0 0 8px var(--c1); }
.lab-panel.lesson p { font-size: 16px; }
.lab-panel.lesson p b { color: var(--c1); }
.lab-figs { display: flex; gap: 14px; flex-wrap: wrap; margin: 6px 0 14px; }
.lab-fig { flex: 1 1 260px; margin: 0; padding: 12px; border-radius: 16px; background: rgba(2, 4, 11, .55); border: 1px solid color-mix(in srgb, var(--c1) 30%, transparent); }
.lab-fig svg { width: 100%; height: auto; display: block; }
.lab-fig figcaption { margin-top: 8px; font-size: 13px; color: var(--lab-mute); line-height: 1.45; }
.lab-tree .tr-l { stroke: var(--c1); stroke-width: 2.4; stroke-linecap: round; }
.lab-tree .tr-d { fill: var(--c2); }
.lab-tree .tr-t { fill: var(--lab-ink); font: 14px ui-sans-serif, system-ui, sans-serif; font-style: italic; }
.lab-tree .tr-s { fill: #fbbf24; font: 11px ui-monospace, monospace; }
.lab-fig .f-ax { stroke: var(--lab-mute); stroke-width: 1.5; } .lab-fig .f-ln { stroke: var(--c1); stroke-width: 3; fill: none; } .lab-fig .f-ln2 { stroke: var(--c2); stroke-width: 3; fill: none; stroke-dasharray: 6 5; }
.lab-fig .f-tx { fill: var(--lab-ink); font: 12px ui-sans-serif, system-ui, sans-serif; } .lab-fig .f-mu { fill: var(--lab-mute); font: 11px ui-sans-serif, system-ui, sans-serif; }
.lab-fig .f-box { fill: color-mix(in srgb, var(--c1) 14%, transparent); stroke: var(--c1); stroke-width: 1.5; }
.lab-key { margin: 6px 0 12px; padding: 12px 14px; border-radius: 14px; border-left: 4px solid var(--c2); background: color-mix(in srgb, var(--c2) 10%, transparent); line-height: 1.55; }
.lab-key b { display: block; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--c2); margin-bottom: 4px; }
.lab-node.lessons { border-color: var(--c1); }
/* the music, sound and Topics buttons: a thin glowing orange outline, like the X */
.lab-hud .lab-icon, .lab-hud [data-home] { border: 1px solid #ff7a2e; box-shadow: 0 0 6px rgba(255, 122, 46, .55), inset 0 0 4px rgba(255, 122, 46, .2); transition: box-shadow .2s; }
.lab-hud .lab-icon:hover, .lab-hud [data-home]:hover { box-shadow: 0 0 12px rgba(255, 122, 46, .85), inset 0 0 6px rgba(255, 122, 46, .3); }
.lab-hud .lab-icon.off { text-decoration: none; }

/* ---------- certificates ---------- */
.lab-cert-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(2, 4, 12, .82); backdrop-filter: blur(6px); animation: lab-in .4s; overflow-y: auto; }
.lab-cert-box { width: min(1100px, 100%); }
.lab-cert-box .lab-actions { justify-content: center; }
.lab-cert-paper { position: relative; overflow: hidden; border-radius: 10px; box-shadow: 0 0 0 2px #f6d77a, 0 0 60px rgba(246, 215, 122, .55), 0 30px 80px rgba(0, 0, 0, .6); animation: lab-cert-in .9s cubic-bezier(.2, 1.3, .4, 1); }
.lab-cert-paper svg { display: block; width: 100%; height: auto; }
.lab-cert-shine { position: absolute; inset: -20% auto -20% -30%; width: 22%; transform: skewX(-20deg); background: linear-gradient(90deg, transparent, rgba(255, 246, 200, .55), transparent); animation: lab-cert-shine 3.2s ease-in-out infinite; pointer-events: none; }
@keyframes lab-cert-shine { 0% { left: -30%; } 60%, 100% { left: 130%; } }
@keyframes lab-cert-in { from { transform: scale(.6) rotate(-4deg); opacity: 0; } }
.lab-cert-call { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 16px auto 0; max-width: 560px; padding: 12px 16px; border-radius: 16px; text-align: left;
  border: 1px solid rgba(246, 215, 122, .7); background: linear-gradient(135deg, rgba(246, 215, 122, .16), rgba(224, 17, 95, .1)); box-shadow: 0 0 30px rgba(246, 215, 122, .25); }
.lab-cert-call > span { font-size: 34px; } .lab-cert-call > div { flex: 1 1 200px; } .lab-cert-call b { color: #f6d77a; } .lab-cert-call p { margin: 2px 0 0 !important; font-size: 14px; }
.lab-banner.gold { border-color: rgba(246, 215, 122, .7); background: linear-gradient(90deg, rgba(246, 215, 122, .16), rgba(167, 139, 250, .12)); }
.lab-cert-list { display: flex; gap: 8px; flex-wrap: wrap; flex: 0 1 auto !important; }
.lab-badge.cert { background: linear-gradient(90deg, #b8862b, #f6d77a); color: #2b1d02; box-shadow: 0 0 14px rgba(246, 215, 122, .8); }

/* the music hint after a refresh (browsers start sound only after a gesture) */
.lab-music-hint { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 40; padding: 10px 18px; border-radius: 999px; cursor: pointer;
  font: 700 14px/1 inherit; color: #ffd8bf; background: rgba(4, 7, 18, .85); border: 1px solid #ff7a2e; box-shadow: 0 0 14px rgba(255, 122, 46, .6); animation: lab-hint 1.6s ease-in-out infinite; }
@keyframes lab-hint { 50% { box-shadow: 0 0 26px rgba(255, 122, 46, .95); transform: translateX(-50%) scale(1.05); } }
.lab-hud-prog { display: none; }
/* phones: the top bar (topics, title, progress, gems, sound, X) stays at the top and shrinks once you scroll */
@media (max-width: 860px) {
  .lab-hud { position: sticky; top: 0; z-index: 25; margin: 0 -16px; padding: 10px 16px 8px; gap: 8px 10px;
    background: rgba(4, 7, 18, .82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid rgba(255, 122, 46, .25);
    transition: padding .25s, opacity .25s, background .25s; }
  .lab-hud-prog { display: block; position: absolute; left: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, #ff7a2e, #e0115f); box-shadow: 0 0 8px rgba(255, 122, 46, .8); }
  .lab-hud.mini { padding: 4px 16px 5px; opacity: .88; background: rgba(4, 7, 18, .9); }
  .lab-hud.mini .lab-brand small, .lab-hud.mini .lab-logo { display: none; }
  .lab-hud.mini .lab-brand { font-size: 11px; }
  .lab-hud.mini .lab-ruby { padding: 2px 9px 2px 5px; } .lab-hud.mini .lab-ruby .gem { width: 22px; height: 19px; } .lab-hud.mini .lab-ruby .num { font-size: 15px; }
  .lab-hud.mini .lab-icon { width: 30px; height: 30px; font-size: 13px; border-radius: 9px; }
  .lab-hud.mini .lab-x { width: 34px; height: 34px; } .lab-hud.mini .lab-x svg { width: 24px; height: 24px; }
  .lab-hud.mini [data-home] { padding: 5px 10px; font-size: 12px; }
  .lab-hud-r { gap: 6px; }
  /* every control must fit, the X above all (2026-11-19): one row, smaller pieces, the reset button shows only its icon */
  .lab-hud-r { flex: 1 1 auto; min-width: 0; justify-content: flex-end; flex-wrap: nowrap; gap: 5px; }
  .lab-hud .lab-icon { width: 32px; height: 32px; font-size: 14px; border-radius: 10px; flex: none; }
  .lab-hud .lab-ruby { padding: 3px 8px 3px 5px; gap: 5px; min-width: 0; flex: 0 1 auto; }
  .lab-hud .lab-ruby .gem { width: 22px; height: 19px; flex: none; }
  .lab-hud .lab-ruby .num { font-size: 15px; }
  .lab-hud .lab-x { width: 36px; height: 36px; flex: none; } .lab-hud .lab-x svg { width: 24px; height: 24px; }
  .lab-hud .lab-reset { padding: 6px 9px; flex: none; } .lab-hud .lab-reset .t { display: none; }
  .lab-hud [data-home] { padding: 6px 10px; font-size: 12px; }
}
@media (max-width: 380px) {
  .lab-hud .lab-icon { width: 29px; height: 29px; font-size: 12px; }
  .lab-hud .lab-ruby { padding: 2px 6px 2px 4px; } .lab-hud .lab-ruby .gem { width: 18px; height: 16px; } .lab-hud .lab-ruby .num { font-size: 13px; }
  .lab-hud .lab-x { width: 32px; height: 32px; }
}

/* locked levels that can be bought with green rubies */
.lab-node.buy { opacity: .8; cursor: pointer; border-color: rgba(74, 222, 128, .7); }
.lab-node.buy .s { color: #4ade80; text-shadow: 0 0 6px rgba(74, 222, 128, .8); }
.lab-node.buy:hover { opacity: 1; box-shadow: 0 0 16px rgba(74, 222, 128, .7); }
.lab-offer-wallet { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 4px; }
.lab-panel.offer .lab-btn[disabled] { opacity: .45; cursor: not-allowed; }

.lab-topic-cert { font-size: 12px; font-weight: 700; color: #f6d77a; }

/* ---------- the guide's mood (2026-11-19): smiling and shining when right, drooping with a tear when wrong ---------- */
.lab-pilot-av { position: relative; }
.lab-pilot-av .av { transition: filter .5s ease; }
.lab-pilot-av.happy .av { animation: av-jump .7s cubic-bezier(.3, 1.6, .5, 1), av-shine 1.6s ease-in-out .5s infinite alternate;
  filter: drop-shadow(0 0 30px color-mix(in srgb, var(--c1) 80%, #fff)) brightness(1.18) saturate(1.25); }
@keyframes av-shine { to { filter: drop-shadow(0 0 46px color-mix(in srgb, var(--c2) 85%, #fff)) brightness(1.32) saturate(1.35); } }
.lab-pilot-av.happy .av .av-mouth, .lab-pilot-av.happy .av .av-eyes { transform-box: fill-box; transform-origin: center; }
.lab-pilot-av.happy .av .av-mouth { transform: scale(1.35, 1.6); }
.lab-pilot-av.happy .av .av-eyes { transform: scaleY(.72); }
.lab-pilot-av.sad .av { animation: av-shake .45s, av-droop .6s ease .45s forwards;
  filter: grayscale(.55) brightness(.78) drop-shadow(0 0 10px rgba(80, 110, 160, .4)); }
@keyframes av-droop { to { transform: translateY(10px) rotate(-3deg) scale(.96); } }
.lab-pilot-av.sad .av .av-mouth { transform: scaleY(-1) translateY(-4px); transform-box: fill-box; transform-origin: center; }
.lab-pilot-av.sad .av .av-eyes { transform: scaleY(.55) translateY(3px); transform-box: fill-box; transform-origin: center; }
.mood-fx { position: absolute; inset: 0; pointer-events: none; display: block; }
.mood-fx b { position: absolute; width: 14px; height: 14px; opacity: 0;
  background: radial-gradient(circle, #fff 0 18%, transparent 20%), conic-gradient(from 0deg, transparent 0 40deg, #fff7c2 45deg, transparent 50deg 130deg, #fff7c2 135deg, transparent 140deg 220deg, #fff7c2 225deg, transparent 230deg 310deg, #fff7c2 315deg, transparent 320deg);
  border-radius: 50%; filter: drop-shadow(0 0 6px #ffe680); }
.mood-fx b:nth-child(1) { left: 18%; top: 12%; } .mood-fx b:nth-child(2) { right: 16%; top: 20%; width: 18px; height: 18px; }
.mood-fx b:nth-child(3) { left: 24%; bottom: 26%; width: 10px; height: 10px; } .mood-fx b:nth-child(4) { right: 22%; bottom: 18%; }
.lab-pilot-av.happy .mood-fx b { animation: mood-twinkle 1.1s ease-in-out infinite; }
.lab-pilot-av.happy .mood-fx b:nth-child(2) { animation-delay: .3s; } .lab-pilot-av.happy .mood-fx b:nth-child(3) { animation-delay: .55s; } .lab-pilot-av.happy .mood-fx b:nth-child(4) { animation-delay: .8s; }
@keyframes mood-twinkle { 0%, 100% { opacity: 0; transform: scale(.3) rotate(0); } 50% { opacity: 1; transform: scale(1.25) rotate(45deg); } }
.mood-fx .tear { position: absolute; left: 41%; top: 44%; width: 9px; height: 13px; opacity: 0; background: #7cc7ff;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; box-shadow: 0 0 8px #7cc7ff; }
.lab-pilot-av.sad .mood-fx .tear { animation: mood-tear 1.6s ease-in .5s infinite; }
@keyframes mood-tear { 0% { opacity: 0; transform: translateY(0) scale(.6); } 15% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(46px) scale(.8); } }
@media (max-width: 900px) { .mood-fx .tear { left: 44%; top: 40%; } .lab-actions[data-next] { scroll-margin-bottom: 18px; } }
@media (prefers-reduced-motion: reduce) { .lab-pilot-av.happy .av, .lab-pilot-av.sad .av, .mood-fx * { animation: none !important; } }

/* ---------- props: Foundations' hammer, Methodology's map, Statistics' die head ---------- */
.av .av-hammer { transform-box: view-box; transform-origin: 163px 186px; animation: av-hammer 2.6s ease-in-out infinite; }
@keyframes av-hammer { 0%, 55%, 100% { transform: rotate(0); } 68% { transform: rotate(-38deg); } 78% { transform: rotate(8deg); } 86% { transform: rotate(0); } }
.av .av-map { transform-box: fill-box; transform-origin: 50% 100%; animation: av-map 3.2s ease-in-out infinite alternate; }
@keyframes av-map { to { transform: skewX(-3deg) scaleY(1.04); } }
.av .av-dice { transform-box: fill-box; transform-origin: center; transition: transform .25s ease; }
.av .av-dice .pip { transition: opacity .08s; }
.av .av-dice.rolling { animation: av-roll .9s linear; }
.av .av-dice.rolling .av-blur { opacity: .8; }
@keyframes av-roll { 0% { transform: rotate(0) scale(1); } 30% { transform: rotate(160deg) scale(.9); } 65% { transform: rotate(300deg) scale(1.06); } 100% { transform: rotate(360deg) scale(1); } }
@media (prefers-reduced-motion: reduce) { .av .av-hammer, .av .av-map, .av .av-dice.rolling { animation: none; } }
/* General's book (a page turns now and then) and Transcriptomics' cog head (2026-11-19) */
.av .av-page { transform-box: view-box; transform-origin: 100px 190px; animation: av-page 5s ease-in-out infinite; }
@keyframes av-page { 0%, 60% { transform: scaleX(1); opacity: 1; } 78% { transform: scaleX(-1); opacity: 1; } 84%, 92% { transform: scaleX(-1); opacity: 0; } 93% { transform: scaleX(1); opacity: 0; } 100% { opacity: 1; } }
.av .av-gear { transform-box: fill-box; transform-origin: center; animation: av-cog 7s linear infinite; }
@keyframes av-cog { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .av .av-page, .av .av-gear { animation: none; } }

/* desktop: the game's top bar stays at the top while you scroll, slimmer and on a dim glass background */
@media (min-width: 861px) {
  .lab-hud { position: sticky; top: 0; z-index: 25; margin: 0 calc(-1 * clamp(16px, 3vw, 40px)); padding: 16px clamp(16px, 3vw, 40px) 6px;
    border-bottom: 1px solid transparent; transition: padding .25s, background .25s, box-shadow .25s, border-color .25s; }
  .lab-hud.mini { padding-top: 6px; padding-bottom: 6px; background: rgba(4, 7, 18, .72); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom-color: rgba(255, 122, 46, .25); box-shadow: 0 8px 26px rgba(0, 0, 0, .4); }
  .lab-hud .lab-logo, .lab-hud .lab-ruby .gem, .lab-hud .lab-icon, .lab-hud .lab-x { transition: width .25s, height .25s, font-size .25s, padding .25s; }
  .lab-hud.mini .lab-logo { width: 22px; height: 22px; }
  .lab-hud.mini .lab-brand { font-size: 12px; } .lab-hud.mini .lab-brand small { font-size: 11px; }
  .lab-hud.mini .lab-ruby { padding: 2px 10px 2px 6px; } .lab-hud.mini .lab-ruby .gem { width: 22px; height: 19px; } .lab-hud.mini .lab-ruby .num { font-size: 16px; }
  .lab-hud.mini .lab-icon { width: 32px; height: 32px; font-size: 14px; border-radius: 10px; }
  .lab-hud.mini .lab-x { width: 34px; height: 34px; } .lab-hud.mini .lab-x svg { width: 24px; height: 24px; }
  .lab-hud.mini [data-home], .lab-hud.mini .lab-reset { padding: 7px 12px; font-size: 13px; }
  body.in-lab .lab-pilot { top: 70px; }
}

/* ---------- topic views: Grid / Circle / Helix (2026-11-19) ---------- */
.lab-topics-bar { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; max-width: 1280px; margin: 6px auto 14px; }
.lab-topics-bar h3 { margin: 0; font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: var(--lab-mute); }
.lab-views { display: inline-flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--lab-panel); border: 1px solid color-mix(in srgb, var(--lab-ink) 14%, transparent); }
.lab-views button { font: 600 13px/1 inherit; color: var(--lab-mute); background: transparent; border: 0; border-radius: 10px; padding: 8px 12px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.lab-views button:hover { color: var(--lab-ink); }
.lab-views button.on { color: #050816; background: linear-gradient(90deg, #22d3ee, #a78bfa); box-shadow: 0 0 16px rgba(34, 211, 238, .45); }
.lab-topics.v-circle, .lab-topics.v-helix { display: block; position: relative; max-width: 1100px; min-height: 420px; }
.lab-topics.v-circle .lab-topic, .lab-topics.v-helix .lab-topic { position: absolute; left: 0; top: 0; width: 132px; grid-template-columns: 1fr; justify-items: center; text-align: center;
  padding: 10px 8px 12px; gap: 6px; transition: box-shadow .2s, border-color .2s; will-change: transform; }
.lab-topics.v-circle .lab-topic:hover, .lab-topics.v-helix .lab-topic:hover { box-shadow: 0 0 34px color-mix(in srgb, var(--c1) 60%, transparent); }
.lab-topics.v-circle .lab-topic-av .av, .lab-topics.v-helix .lab-topic-av .av { width: 70px; height: 76px; }
.lab-topics.v-circle .lab-topic-t > *:not(strong), .lab-topics.v-helix .lab-topic-t > *:not(strong) { display: none; }
.lab-topics.v-circle .lab-topic, .lab-topics.v-helix .lab-topic { animation: none; }
.lab-topics.v-circle .lab-topic-t strong, .lab-topics.v-helix .lab-topic-t strong { font-size: 13px; line-height: 1.2; }
.lab-topics.v-circle .lab-lock span, .lab-topics.v-helix .lab-lock span, .lab-topics.v-circle .lab-badge, .lab-topics.v-helix .lab-badge { display: none; }
/* circle and helix views: every card is a round disc (like a gene-cluster node); helix discs get a thicker rim */
.lab-topics.v-circle .lab-topic, .lab-topics.v-helix .lab-topic { width: 140px; height: 140px; border-radius: 50%; padding: 12px; align-content: center; gap: 4px; overflow: hidden;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c1) 26%, var(--lab-panel)), var(--lab-panel) 70%); }
.lab-topics.v-circle .lab-topic-t, .lab-topics.v-helix .lab-topic-t { justify-items: center; max-width: 104px; }
.lab-topics.v-helix .lab-topic { border-width: 3px; border-color: color-mix(in srgb, var(--c1) 75%, transparent); box-shadow: 0 0 14px color-mix(in srgb, var(--c1) 35%, transparent); }
.lab-orbit-art { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.lab-orbit-art .ring { fill: none; stroke: rgba(34, 211, 238, .28); stroke-width: 2; stroke-dasharray: 3 9; }
.lab-orbit-art .ring.in { stroke: rgba(167, 139, 250, .2); stroke-dasharray: none; }
/* glows are wide translucent strokes under the line (cheap to redraw every frame; filters made the motion stutter) */
.lab-orbit-art .strand, .lab-orbit-art .strand-glow { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.lab-orbit-art .strand { stroke-width: 9; }
.lab-orbit-art .strand-glow { stroke-width: 20; opacity: .22; }
.lab-orbit-art .strand.a, .lab-orbit-art .strand-glow.a { stroke: #22d3ee; }
.lab-orbit-art .strand.b, .lab-orbit-art .strand-glow.b { stroke: #f472b6; }
.lab-orbit-art .rung line { stroke-width: 5; stroke-linecap: round; }
.lab-orbit-art .rung line.glow { stroke: #fde68a; stroke-width: 13; opacity: .14; }
.lab-orbit-art .rung line.o { stroke: #ff7a2e; }
.lab-orbit-art .rung line.g { stroke: #4ade80; }
.lab-orbit-art .rung .bead { fill: #fff7d6; }
.lab-orbit-art .rung .halo { fill: #fde68a; opacity: .3; }
/* hovered cards pop larger (the orbit code puts scale(var(--pop)) in each card's transform) */
@property --pop { syntax: "<number>"; inherits: false; initial-value: 1; }
.lab-topics.v-circle .lab-topic, .lab-topics.v-helix .lab-topic { --pop: 1; transition: --pop .28s cubic-bezier(.3, 1.5, .5, 1), box-shadow .2s, border-color .2s; }
.lab-topics.v-circle .lab-topic:hover, .lab-topics.v-helix .lab-topic:hover,
.lab-topics.v-circle .lab-topic:focus-visible, .lab-topics.v-helix .lab-topic:focus-visible { --pop: 1.28; z-index: 60 !important; opacity: 1 !important; }
.lab-orbit-hub { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 6px; text-align: center; color: var(--lab-ink); pointer-events: none; }
.lab-orbit-hub .lab-logo svg { width: 56px; height: 56px; color: #22d3ee; filter: drop-shadow(0 0 12px #22d3ee); animation: av-glow 2s ease-in-out infinite alternate; }
.lab-orbit-hub b { font-size: 18px; letter-spacing: .08em; }
.lab-orbit-hub small { color: var(--lab-mute); font-size: 12px; }
@media (max-width: 640px) {
  .lab-topics.v-circle .lab-topic, .lab-topics.v-helix .lab-topic { width: 96px; height: 96px; padding: 8px; }
  .lab-topics.v-circle .lab-topic-t, .lab-topics.v-helix .lab-topic-t { max-width: 76px; }
  .lab-orbit-art .strand { stroke-width: 6; } .lab-orbit-art .rung line { stroke-width: 3.5; }
  .lab-topics.v-circle .lab-topic-av .av, .lab-topics.v-helix .lab-topic-av .av { width: 46px; height: 50px; }
  .lab-topics.v-circle .lab-topic-t strong, .lab-topics.v-helix .lab-topic-t strong { font-size: 11px; }
  .lab-orbit-hub b { font-size: 13px; } .lab-orbit-hub .lab-logo svg { width: 36px; height: 36px; }
  .lab-views button { padding: 7px 9px; font-size: 12px; }
}
/* the large view of one topic */
.lab-zoom { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(2, 4, 12, .72); backdrop-filter: blur(6px); animation: lab-zoom-in .25s ease; }
@keyframes lab-zoom-in { from { opacity: 0; } }
.lab-zoom-box { position: relative; width: min(760px, 100%); max-height: calc(100dvh - 32px); overflow: auto; display: grid; grid-template-columns: minmax(180px, 280px) 1fr; gap: 22px; align-items: center;
  padding: 26px; border-radius: 26px; color: var(--lab-ink); background: linear-gradient(160deg, #0d1638, #060a1c); border: 1px solid color-mix(in srgb, var(--c1) 55%, transparent);
  box-shadow: 0 0 80px color-mix(in srgb, var(--c1) 40%, transparent); animation: lab-zoom-pop .4s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes lab-zoom-pop { from { transform: scale(.4); opacity: 0; } }
.lab-zoom-box > .lab-x { position: absolute; top: 10px; right: 10px; }
.lab-zoom-av .av { width: 100%; height: auto; filter: drop-shadow(0 0 26px color-mix(in srgb, var(--c1) 60%, transparent)); }
.lab-zoom-t small { color: var(--c1); letter-spacing: .16em; text-transform: uppercase; font-size: 12px; }
.lab-zoom-t h2 { margin: 6px 0 4px; font-size: clamp(22px, 3vw, 30px); }
.lab-zoom-t .who { color: var(--c2); font-weight: 700; margin: 0 0 8px; }
.lab-zoom-t p { color: var(--lab-mute); line-height: 1.5; }
@media (max-width: 640px) { .lab-zoom-box { grid-template-columns: 1fr; text-align: center; } .lab-zoom-av { width: 160px; margin: 0 auto; } .lab-zoom-t .lab-actions { justify-content: center; } }
/* admin: reset every game */
.lab-reset { border-color: rgba(248, 113, 113, .6) !important; color: #fecaca !important; }
@media (max-width: 760px) { .lab-reset .t { display: none; } }
.lab-reread { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; margin: 16px 0; padding: 16px 18px; border-radius: 18px;
  background: linear-gradient(135deg, rgba(56, 189, 248, .14), rgba(167, 139, 250, .12)); border: 1px solid rgba(56, 189, 248, .45); }
.lab-reread .ic { font-size: 30px; line-height: 1; }
.lab-reread b { font-size: 16px; } .lab-reread p { margin: 6px 0 10px; color: var(--lab-mute); line-height: 1.5; }
.lab-reread .lab-actions { margin: 0; flex-wrap: wrap; }
/* close crosses: a very thin red → deep-orange ring (house style) */
.lab-x { border: 1px solid transparent; background: linear-gradient(rgba(4, 7, 18, .55), rgba(4, 7, 18, .55)) padding-box, linear-gradient(135deg, #e11d48, #ea580c) border-box; }

/* ================= the two looks (2026-11-19): Droid (everything above) and Serious =================
   Serious is a calm study room: a plain graphite page without stars, scanlines, floor grid or glows, serif headings,
   flat cards with fine rules, the guides as seals and the lab mark as a seal on the entrance. */
.lab-style { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--lab-panel); border: 1px solid var(--lab-line); }
.lab-style button { font: 700 12px/1 inherit; letter-spacing: .06em; color: var(--lab-mute); background: transparent; border: 0; border-radius: 9px; padding: 9px 11px; cursor: pointer; }
.lab-style button:hover { color: var(--lab-ink); }
.lab-style button.on { color: #050816; background: linear-gradient(90deg, #22d3ee, #a78bfa); }
.lab-style button:focus-visible { outline: 2px solid var(--c1); outline-offset: 2px; }
.av-sober, .lab-seal, .for-serious { display: none; }

.lab.lab-serious {
  --lab-bg: #111418; --lab-bg2: #171b21; --lab-ink: #ebe7de; --lab-mute: #a3a9b1; --lab-panel: #1a1e24; --lab-line: rgba(235, 231, 222, .14);
  --lab-grid: transparent; --face: "BM Round", "Nunito", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
}
.lab-serious .av-droid, .lab-serious .rb-scene, .lab-serious .for-droid, .lab-serious .mood-fx { display: none !important; }
.lab-serious .av-sober { display: block; }
.lab-serious .for-serious { display: inline; }
.lab-serious .lab-stars, .lab-serious .lab-glow, .lab-serious .lab-floor, .lab-serious .lab-scan, .lab-serious .lab-helix { display: none; }
.lab-serious .lab-bg { background: linear-gradient(180deg, var(--lab-bg) 0%, var(--lab-bg2) 100%); }
.lab.lab-serious, .lab-serious :is(button, input, select, textarea, a) { font-family: var(--face); }
.lab-serious :is(h1, h2, h3, .lab-q, .lab-topic-t strong, .lab-zoom h2) { font-family: var(--face); letter-spacing: 0; text-shadow: none; font-weight: 700; }
.lab-serious .lab-brand b { font-family: var(--face); letter-spacing: .08em; background: none; color: var(--lab-ink); }
.lab-serious .lab-logo { animation: none; filter: none; color: var(--lab-ink); }
.lab-serious .lab-style button.on, .lab-serious .lab-views button.on { color: var(--lab-bg); background: var(--lab-ink); box-shadow: none; }
/* flat cards and fine rules */
.lab-serious :is(.lab-panel, .lab-topic, .lab-speech, .lab-bubble, .lab-opt, .lab-why, .lab-fig, .lab-key, .lab-code, .lab-banner, .lab-plate, .lab-icon, .lab-btn, .lab-views) {
  box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.lab-serious :is(.lab-panel, .lab-speech, .lab-bubble) { background: var(--lab-panel); border: 1px solid var(--lab-line); border-radius: 10px; }
.lab-serious .lab-panel::before, .lab-serious .lab-panel::after { display: none; }
.lab-serious .lab-speech::before, .lab-serious .lab-bubble::before { border-color: var(--lab-line); }
.lab-serious .lab-speech .who { color: var(--lab-mute); letter-spacing: .12em; }
.lab-serious .lab-topic { background: var(--lab-panel); border: 1px solid var(--lab-line); border-left: 3px solid var(--c1); border-radius: 10px; }
.lab-serious .lab-topic:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); border-color: color-mix(in srgb, var(--c1) 60%, var(--lab-line)); }
.lab-serious .lab-topics.v-circle .lab-topic, .lab-serious .lab-topics.v-helix .lab-topic { border-left-width: 1px; border-radius: 50%; }
.lab-serious .lab-btn { border-radius: 8px; }
.lab-serious .lab-btn.primary { color: var(--lab-bg); background: var(--lab-ink); box-shadow: none; }
.lab-serious .lab-btn.primary:hover { box-shadow: none; background: #fff; }
.lab-serious .lab-btn:hover, .lab-serious .lab-opt:hover:not(:disabled) { transform: none; box-shadow: none; }
.lab-serious .lab-opt { background: transparent; border: 1px solid var(--lab-line); border-radius: 8px; animation: none; }
.lab-serious .lab-opt:hover:not(:disabled) { border-color: var(--lab-ink); background: rgba(235, 231, 222, .04); }
.lab-serious .lab-opt .key { color: var(--lab-ink); background: transparent; border: 1px solid var(--lab-line); border-radius: 6px; font-family: var(--face); }
.lab-serious .lab-opt.right { border-color: #5fbf8a; background: rgba(95, 191, 138, .10); box-shadow: none; transform: none; }
.lab-serious .lab-opt.right .key { color: #111418; background: #5fbf8a; border-color: #5fbf8a; }
.lab-serious .lab-opt.wrong { border-color: #d27a6e; background: rgba(210, 122, 110, .10); animation: none; }
.lab-serious .lab-opt.wrong .key { color: #111418; background: #d27a6e; border-color: #d27a6e; }
.lab-serious .lab-why { border-left-color: #5fbf8a; background: rgba(95, 191, 138, .06); border-radius: 0 8px 8px 0; }
.lab-serious .lab-why b { text-shadow: none; }
.lab-serious .lab-kicker { color: var(--lab-mute); letter-spacing: .14em; }
.lab-serious .lab-ruby { background: var(--lab-panel); border-color: var(--lab-line); box-shadow: none; }
.lab-serious .lab-ruby .gem, .lab-serious .lab-ruby .gem .shine { animation: none; filter: none; }
.lab-serious .lab-ruby .num { filter: none; }
.lab-serious .rubytxt { text-shadow: none; }
.lab-serious .lab-x svg { stroke: var(--lab-ink); filter: none; }
.lab-serious .lab-pilot-av .av { filter: none; }
.lab-serious .lab-pilot-av.happy .av, .lab-serious .lab-pilot-av.sad .av { animation: none; }
.lab-serious .lab-spark, .lab-serious .lab-warp { display: none; }
.lab-serious .lab-orbit-art { opacity: .5; }
@media (min-width: 861px) { .lab-serious .lab-hud.mini { background: rgba(17, 20, 24, .86); } }
/* the seal of a guide */
.av-sober .sb-ring { fill: none; stroke: var(--sc); stroke-opacity: .7; stroke-width: 1.5; transition: stroke .3s; }
.av-sober .sb-ticks { fill: none; stroke: var(--lab-mute); stroke-opacity: .55; stroke-width: 1; }
.av-sober .sb-face { fill: color-mix(in srgb, var(--sc) 10%, var(--lab-panel)); stroke: var(--lab-line); stroke-width: 1; }
.av-sober .sb-ini { font: 600 74px/1 var(--face, system-ui, sans-serif); fill: var(--lab-ink); }
.av-sober .sb-name { font: 600 15px/1 var(--face, system-ui, sans-serif); letter-spacing: .18em; fill: var(--lab-mute); text-transform: uppercase; }
.av-sober:not(.big) .sb-name { display: none; }
.lab-pilot-av.happy .av-sober .sb-ring { stroke: #5fbf8a; stroke-opacity: 1; stroke-width: 3; }
.lab-pilot-av.sad .av-sober .sb-ring { stroke: #d27a6e; stroke-opacity: 1; stroke-width: 3; }
.lab-pilot-av .av-sober { width: min(200px, 100%); }
/* the seal on the entrance */
.lab-serious .lab-seal { display: grid; place-items: center; position: relative; width: min(300px, 100%); aspect-ratio: 1; margin: 0 auto; }
.lab-seal svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.lab-seal .o { fill: none; stroke: var(--lab-ink); stroke-opacity: .5; stroke-width: 1.2; }
.lab-seal .i { fill: var(--lab-panel); stroke: var(--lab-line); stroke-width: 1; }
.lab-seal .t { font: 600 15px var(--face, system-ui, sans-serif); letter-spacing: .1em; fill: var(--lab-mute); }
.lab-seal .m { position: relative; width: 38%; color: var(--lab-ink); }
.lab-seal .m svg { position: static; width: 100%; height: auto; }
@media (max-width: 860px) {
  .lab-serious .lab-seal { width: 160px; }
  .lab-style button { padding: 7px 8px; font-size: 11px; }
}
.lab-serious :is(h1, h2, h3, .lab-q, .lab-topic-t strong) { text-transform: none; }
.lab-serious .lab-q { font-weight: 600; line-height: 1.3; }
.lab-serious .lab-node { box-shadow: none !important; filter: none !important; animation: none !important; }
.lab-serious .lab-wire { background: var(--lab-line); box-shadow: none; }
.lab-serious .lab-icon { border-color: var(--lab-line); }

/* A ruby balance below zero (2026-11-20): wrong answers keep costing after the rubies run out, so the gem goes dark
   until the debt is worked off. The number keeps reading the real value, including the minus sign. */
.lab-ruby.neg { background: linear-gradient(135deg, rgba(20, 20, 24, .95), rgba(6, 6, 8, .95)); border-color: rgba(120, 120, 130, .45); box-shadow: none; }
.lab-ruby.neg .gem { filter: grayscale(1) brightness(.33); animation: none; }
.lab-ruby.neg .gem .shine { animation: none; opacity: 0; }
.lab-ruby.neg .num { background: linear-gradient(180deg, #8b8b93 0%, #4a4a52 60%, #2a2a30 100%); -webkit-background-clip: text; background-clip: text; filter: none; }

/* Phones: a growing ruby number must stay inside its pill (2026-11-20). The number is the part that may shrink; the
   gem and the other controls keep their size, and a long figure (or a minus sign) is scaled down rather than spilling. */
@media (max-width: 860px) {
  .lab-hud .lab-ruby { overflow: hidden; }
  .lab-hud .lab-ruby .num { min-width: 0; overflow: hidden; text-overflow: clip; white-space: nowrap;
    font-size: clamp(11px, 3.4vw, 15px); letter-spacing: 0; }
  .lab-hud-r { overflow: hidden; }
}
@media (max-width: 420px) {
  .lab-hud .lab-ruby { padding: 3px 9px 3px 5px; gap: 4px; }
  .lab-hud .lab-ruby .gem { width: 18px; height: 16px; }
  .lab-hud .lab-ruby .num { font-size: clamp(10px, 3.1vw, 13px); }
}
/* Phones: the look switch becomes two icons so the ruby counters keep their room (it took a third of the row) */
.lab-style button .ic { display: none; font-size: 15px; line-height: 1; }
@media (max-width: 520px) {
  .lab-style button .ic { display: inline; }
  .lab-style button .t { display: none; }
  .lab-style button { padding: 7px 9px; }
}
