/* Computing Ninja Games: the data lab's look (D, 25 Oct 2026; docs/games.md). The seven GCSE microgames about units,
   files and media (KibiCracker, KiloCracker, CharMapper, PixelPicker, WaveSampler, ZipSquasher, NetCalc) are the same
   product as the binary arcade but older: where the arcade is a pale page, violet, rounded and bouncy, the lab is an
   instrument bench. Dark by default, on graph paper; a cool signal blue for the live value; square corners, hairlines
   and the screen font for every label; the engines' readouts as lit screens with a scan on every change; and measured
   motion (a sweep, a glow, a settle) instead of pops. It builds on arcade.css, which lays the page and the card, and
   overrides its tokens and shapes. arcade.js runs the motion; <body data-family="lab"> turns off the pixel horizon
   and the burst of pixels, and turns on the readout scan and the solved glow. */
@import url("arcade.css?v=20261025w");

:root, html[data-theme="dark"] {
  --bg: #0D1117; --panel: #141A24; --ink: #E7ECF5; --muted: #97A2B8; --faint: #5A6579;
  --line: #222B3A; --line-strong: #344059; --grey: #1A2130;
  /* arcade.css names its accent violet; here it is the lab's signal blue */
  --violet: #3FC3E8; --violet-dark: #7ADCF7; --violet-soft: #0F2B37; --violet-ink: #8DE4FB;
  --amber: #F0B542; --amber-soft: #3A2A0E; --amber-ink: #FFD98A;
  --red: #F0675C; --red-soft: #3A1A18;
  --green: #3DD68C; --green-soft: #113124; --green-ink: #8FF0C2;
  --screen: #070A10; --screen-ink: #C8F3FF; --screen-dim: #6C96A6; --screen-line: rgba(63, 195, 232, .22);
  --grid: rgba(255, 255, 255, .035); --grid-bold: rgba(255, 255, 255, .06);
  --shadow: 0 30px 70px rgba(0, 0, 0, .6);
  --flash-color: #F0675C; --bg-color: #141A24; --text-color: #E7ECF5; --text-secondary: #97A2B8; --primary-color: #3FC3E8;
  --card-bg: #141A24; --box-bg-color: #0D1117; --border-color: #222B3A;
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg: #F1F4F9; --panel: #FFFFFF; --ink: #131926; --muted: #5C6679; --faint: #8A94A8;
  --line: #DCE2EC; --line-strong: #BCC6D8; --grey: #E8EDF5;
  --violet: #0A7FA6; --violet-dark: #065F7E; --violet-soft: #DCF1F8; --violet-ink: #075D7A;
  --amber: #D79A2B; --amber-soft: #F8EBD0; --amber-ink: #7A5614;
  --red: #C9463B; --red-soft: #F9E3E0;
  --green: #1C9A62; --green-soft: #DDF3E8; --green-ink: #15724A;
  --screen: #0E1622; --screen-ink: #CFF4FF; --screen-dim: #7FA5B4; --screen-line: rgba(63, 195, 232, .22);
  --grid: rgba(19, 25, 38, .05); --grid-bold: rgba(19, 25, 38, .08);
  --shadow: 0 24px 60px rgba(19, 25, 38, .16);
  --flash-color: #C9463B; --bg-color: #FFFFFF; --text-color: #131926; --text-secondary: #5C6679; --primary-color: #0A7FA6;
  --card-bg: #FFFFFF; --box-bg-color: #F1F4F9; --border-color: #DCE2EC;
  color-scheme: light;
}

/* Graph paper, a fine grid with a bolder line every fifth, under a slow vignette */
body { background-color: var(--bg); background-image:
    radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--violet) 9%, transparent), transparent 60%),
    linear-gradient(var(--grid-bold) 1px, transparent 1px), linear-gradient(90deg, var(--grid-bold) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 100% 100%, 120px 120px, 120px 120px, 24px 24px, 24px 24px; background-attachment: fixed; }

/* Square corners and hairlines everywhere the arcade was round */
.arcade-top { background: color-mix(in srgb, var(--bg) 82%, transparent); }
.wordmark .prod { border-radius: 4px; padding: 5px 9px 6px; }
.tools .all, .game-theme-toggle, .game-calc-toggle { border-radius: 6px; }
.card { border-radius: 10px; padding: 22px 28px 24px; gap: 16px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 1px 0 rgba(0, 0, 0, .2); animation: power 600ms var(--ease) both; }
@keyframes power { from { opacity: 0; transform: translateY(6px); clip-path: inset(0 0 100% 0); } 60% { clip-path: inset(0 0 0 0); } }
.card.solved { box-shadow: 0 0 0 1px var(--green), 0 0 48px color-mix(in srgb, var(--green) 25%, transparent); transition: box-shadow 150ms; }
.card { transition: box-shadow 700ms var(--ease); }

/* Title: the name, the level as a readout, the topic as a spec label */
.title { gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.title h1 { font-size: 21px; letter-spacing: -0.01em; }
.title .pill { border-radius: 4px; padding: 5px 9px 6px; background: var(--grey); color: var(--muted); border: 1px solid var(--line-strong); }
.title .pill b { color: var(--violet-ink); }
.title .topic { color: var(--muted); }
.title .topic::before { content: "GCSE  ·  "; color: var(--faint); }

/* The HUD: instrument tiles, digits in the screen font, a segmented clock */
.stat-box { border-radius: 6px; background: var(--grey); padding: 10px 14px 12px; }
.stat-box > div:first-child { color: var(--faint); }
.stat-box > div:last-child { font: 400 30px/1.1 var(--arcade); letter-spacing: 0; color: var(--ink); }
.stat-box .tm { height: 6px; border-radius: 0; background: transparent; margin-top: 8px; -webkit-mask: repeating-linear-gradient(90deg, #000 0 9px, transparent 9px 12px); mask: repeating-linear-gradient(90deg, #000 0 9px, transparent 9px 12px); }
.stat-box .tm::before { content: ""; position: absolute; inset: 0; background: var(--line-strong); opacity: .5; }
.stat-box .tm b { position: relative; border-radius: 0; }
.stat-box.low > div:last-child { animation: none; color: var(--red); }

/* The brief: the round's prompt as a note on the bench, not a bubble */
.mode-note { text-align: left; color: var(--violet-ink); }
.prompt-display { text-align: left; background: transparent; border: 1px solid var(--line-strong); border-left: 3px solid var(--violet); border-radius: 6px; padding: 14px 18px; font-size: clamp(15.5px, 2vw, 17px); font-weight: 400; color: var(--ink); animation: none; }
.prompt-display strong { color: var(--violet-ink); font-weight: 600; }
.microgame-card .instruction { text-align: left; align-self: stretch; max-width: none; color: var(--faint); font-size: 12.5px; }

/* The engines: an instrument with a lit screen above its keys */
.unit-ladder-engine, .char-dial-engine, .raster-engine, .pcm-stack-engine, .colour-power-engine { margin: 0 auto; max-width: 560px; width: 100%; padding: 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--grey); order: 4; }
.unit-ladder__readout, .char-dial__display, .raster-engine__readout, .pcm-stack__readout, .colour-power__readout {
  position: relative; overflow: hidden; margin: 0 0 12px; padding: 16px 18px; border-radius: 5px; background: var(--screen); color: var(--screen-ink); text-align: center;
  font: 400 15px/1.5 var(--arcade); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), inset 0 10px 30px rgba(0, 0, 0, .5);
  background-image: repeating-linear-gradient(0deg, transparent 0 2px, rgba(255, 255, 255, .025) 2px 3px); }
.unit-ladder__readout::after, .char-dial__display::after, .raster-engine__readout::after, .pcm-stack__readout::after, .colour-power__readout::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; background: linear-gradient(90deg, transparent, var(--screen-line), transparent); opacity: 0; pointer-events: none; }
.tick::after { animation: scan 420ms var(--ease) both !important; }
@keyframes scan { 0% { left: -40%; opacity: 1; } 100% { left: 100%; opacity: 0; } }
.unit-ladder__readout strong, .char-dial__display strong, .raster-engine__readout strong, .pcm-stack__readout strong, .colour-power__readout strong { color: var(--screen-ink); font-weight: 400; text-shadow: 0 0 12px color-mix(in srgb, var(--violet) 55%, transparent); }
.unit-ladder__readout { font-size: clamp(26px, 4.5vw, 36px); line-height: 1.2; padding: 18px; }
.unit-ladder__number { font-weight: 400; text-shadow: 0 0 14px color-mix(in srgb, var(--violet) 55%, transparent); }
.unit-ladder__unit { color: var(--violet); font-weight: 400; margin-left: 6px; }
.char-dial__display { min-height: 0; display: grid; gap: 4px; }
.char-dial__big, .char-dial__glyph--large { font-family: var(--arcade); font-weight: 400; font-size: clamp(40px, 7vw, 56px); line-height: 1.05; text-shadow: 0 0 14px color-mix(in srgb, var(--violet) 55%, transparent); }
.char-dial__sub, .raster-stack__sub, .pcm-stack__sub, .colour-power__sub { color: var(--screen-dim); font-size: 12.5px; margin-top: 6px; }
.raster-stack__bytes, .pcm-stack__bytes, .colour-power__value { font-size: clamp(18px, 3vw, 24px); line-height: 1.3; margin-top: 4px; }
.pcm-stack__seconds, .raster-stack__rows { color: var(--screen-dim); }
.pcm-stack__seconds strong, .raster-stack__rows strong { color: var(--screen-ink); }
.unit-ladder__actions, .char-dial__actions, .raster-engine__actions, .pcm-stack__actions, .colour-power__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
/* the engine's keys are controls, not the move to make: outlined, in the screen font */
.card .button.unit-ladder__btn, .card .button.char-dial__btn, .card .button.raster-engine__btn, .card .button.pcm-stack__btn, .card .button.colour-power__btn {
  background: var(--panel); border: 1px solid var(--line-strong); color: var(--ink); font: 400 15px/1.2 var(--arcade); letter-spacing: .02em; padding: 10px 14px; min-width: 0; border-radius: 6px; }
.card .button.unit-ladder__btn:hover, .card .button.char-dial__btn:hover, .card .button.raster-engine__btn:hover, .card .button.pcm-stack__btn:hover, .card .button.colour-power__btn:hover { background: var(--violet-soft); border-color: var(--violet); color: var(--violet-ink); }
.card .button.unit-ladder__btn:active, .card .button.char-dial__btn:active, .card .button.raster-engine__btn:active, .card .button.pcm-stack__btn:active, .card .button.colour-power__btn:active { transform: translateY(1px); }
.card .button.unit-ladder__btn:disabled, .card .button.char-dial__btn:disabled, .card .button.raster-engine__btn:disabled, .card .button.pcm-stack__btn:disabled, .card .button.colour-power__btn:disabled { background: var(--panel); color: var(--ink); opacity: .35; }
.card .button.char-dial__btn { min-width: 64px; font-size: 22px; }
.unit-ladder__btn-hint, .raster-engine__btn-hint, .pcm-stack__btn-hint, .colour-power__btn-hint { font-size: 11px; color: var(--faint); opacity: 1; letter-spacing: .04em; text-transform: uppercase; }

/* The answer line and the buttons */
.answer-input { border-radius: 6px; font-family: var(--arcade); font-weight: 400; background: var(--screen); color: var(--screen-ink); border-color: var(--line-strong); }
.answer-input::placeholder { color: var(--screen-dim); font-size: 14px; }
.answer-input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--violet) 25%, transparent); }
.button { border-radius: 6px; font-family: var(--arcade); font-weight: 400; letter-spacing: .03em; }
.button.button-submit { color: #06131A; background: var(--violet); border-color: var(--violet); border-radius: 6px; font-size: 16px; }
.button.button-submit:hover, html[data-theme="dark"] .button.button-submit:hover { background: var(--violet-dark); border-color: var(--violet-dark); color: #06131A; }
html[data-theme="light"] .button.button-submit, html[data-theme="light"] .button.button-submit:hover { color: #fff; }
.current-value { font-family: var(--arcade); color: var(--muted); }
.remaining-toggle, .calc-inline-toggle { font-family: var(--arcade); font-weight: 400; font-size: 13px; }
.remaining-value { font-family: var(--arcade); font-weight: 400; }

/* The result line: a square LED instead of a round tick; wrong flashes a hairline, right lights the card */
.message { font-family: var(--arcade); font-size: 15px; letter-spacing: .01em; }
.message.ok { animation: none; color: var(--green-ink); }
.message.ok::before { border-radius: 3px; width: 14px; height: 14px; background: var(--green); box-shadow: 0 0 12px var(--green); animation: led 500ms var(--ease); }
@keyframes led { 0% { opacity: 0; transform: scale(.6); } 100% { opacity: 1; transform: scale(1); } }
.message.bad { animation: none; color: var(--red); }
.message.bad::before { content: ""; width: 14px; height: 14px; border-radius: 3px; background: var(--red); box-shadow: 0 0 12px var(--red); animation: blink 420ms steps(2, end) 2; }
@keyframes blink { 50% { opacity: .2; } }
.microgame-engine-yep { outline: 1px solid var(--green); outline-offset: 0; border-radius: 8px; animation: yepglow 700ms ease-out; }
@keyframes yepglow { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 50%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
.microgame-engine-nope { outline: 1px solid var(--red); outline-offset: 0; border-radius: 8px; }
.microgame-interaction-tick { animation: none; }

/* The small print and the foot */
.controls { font-size: 12px; }
.controls kbd { background: var(--panel); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 6px; }
.foot .button { font-size: 13px; }

/* Game over and the calculator, squared */
.overlay-content { border-radius: 10px; }
.game-summary h2 { font-family: var(--arcade); font-weight: 400; letter-spacing: .02em; font-size: 28px; }
.overlay .target-display { border-radius: 6px; font-family: var(--arcade); font-weight: 400; }
.overlay .target-display span { font-size: 34px; letter-spacing: 0; }
.game-calc-panel { border-radius: 8px; }

@media (max-width: 560px) {
  .card { padding: 18px 16px 20px; border-radius: 8px; }
  .title .topic { display: none; }
  .unit-ladder-engine, .char-dial-engine, .raster-engine, .pcm-stack-engine, .colour-power-engine { padding: 8px; }
  .unit-ladder__readout, .char-dial__display, .raster-engine__readout, .pcm-stack__readout, .colour-power__readout { padding: 12px; }
}
