@font-face {
  font-family: "Silkscreen"; font-style: normal; font-weight: 400;
  src: url("/static/fonts/Silkscreen-Regular.ttf") format("truetype"); font-display: swap;
}
@font-face {
  font-family: "Silkscreen"; font-style: normal; font-weight: 700;
  src: url("/static/fonts/Silkscreen-Bold.ttf") format("truetype"); font-display: swap;
}

:root {
  --bg: #000;
  --bg-2: #000;
  --bg-3: #0c0c12;
  --line: #333a48;
  --fg: #e8ecf4;
  --fg-dim: #97a1b4;
  --fg-faint: #6b7488;
  --accent: #7cc4ff;
  --radius: 0px;
  --shadow: 0 0 0 rgba(0, 0, 0, 0);
  --pixel: "Silkscreen", ui-monospace, monospace;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;
  font-synthesis: none;
}

* { box-sizing: border-box; }

/* Black on the html element too, so the overscroll/bounce area isn't white */
html { background: #000; }

body {
  margin: 0;
  color: var(--fg);
  font: 14px/1.55 var(--mono);
  min-height: 100vh;
  /* Pixel starfield: sparse crisp dots tiled over pure black, fixed behind content. */
  background-color: #000;
  background-image:
    radial-gradient(1px 1px at 24px 32px, #ffffff, transparent),
    radial-gradient(1px 1px at 88px 220px, #9fb0d6, transparent),
    radial-gradient(1px 1px at 150px 96px, #cdd8f2, transparent),
    radial-gradient(2px 2px at 210px 300px, #ffffff, transparent),
    radial-gradient(1px 1px at 300px 60px, #8ea0c6, transparent),
    radial-gradient(1px 1px at 350px 200px, #cdd8f2, transparent),
    radial-gradient(1px 1px at 60px 320px, #9fb0d6, transparent),
    radial-gradient(1px 1px at 260px 150px, #ffffff, transparent);
  background-size: 400px 360px;
  background-attachment: fixed;
}
::selection { background: var(--accent); color: #05121f; }

/* Retro pixel-art chrome: pixel font on headings/labels/pills, sharp edges, crisp borders */
.site-head h1, .card-name, .panel h3, .toggle button, .segmented button, .badge,
.viewnote strong, .stat .n {
  font-family: var(--pixel);
  -webkit-font-smoothing: none; font-smooth: never;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 28px 20px 80px; }

/* Header */
.site-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.site-head h1 { font-size: 26px; margin: 0; letter-spacing: -0.02em; }
.tagline { color: var(--fg-dim); font-size: 14px; }
.subhead { color: var(--fg-faint); font-size: 13px; margin: 6px 0 24px; max-width: 70ch; }

/* Stats strip */
.stats { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 22px; }
.stat {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; min-width: 120px;
}
.stat .n { font-size: 20px; font-weight: 650; letter-spacing: -0.02em; }
.stat .l { font-size: 12px; color: var(--fg-dim); }

/* Controls */
.controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.controls input, .controls select {
  background: var(--bg-2); border: 1px solid var(--line); color: var(--fg);
  border-radius: 9px; padding: 9px 12px; font-size: 14px;
}
.controls input { min-width: 220px; }
.controls .spacer { flex: 1; }
.count { color: var(--fg-faint); font-size: 13px; }

/* Gallery grid — planet-first cards: no background, border only on hover */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(188px, 1fr)); gap: 10px; }
.card {
  background: none; border: 1px solid transparent; border-radius: var(--radius);
  display: block; color: var(--fg); padding: 16px 12px 16px; text-align: center;
  transition: border-color .14s;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.card:hover { border-color: var(--line); text-decoration: none; }
.card-planet { width: 160px; height: 160px; display: block; margin: 0 auto 12px; }
.card-planet.pixel { image-rendering: pixelated; image-rendering: crisp-edges; }
.card-name { font-size: 13px; font-weight: 550; color: var(--fg-dim); letter-spacing: -0.01em; }
.card-host { font-size: 11px; color: var(--fg-faint); margin-top: 1px; }
.card-meta { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; justify-content: center; }

/* Sphere/Pixel segmented toggle */
.segmented {
  display: inline-flex; background: var(--bg-3); border: 1px solid var(--line);
  border-radius: 9px; padding: 3px; gap: 2px;
}
.segmented button {
  border: 0; background: transparent; color: var(--fg-dim); font-size: 13px; cursor: pointer;
  padding: 7px 13px; border-radius: 7px; font-weight: 540;
}
.segmented button.on { background: var(--accent); color: #05121f; }

/* ---- Retro pixel-art sizing + hard edges (overrides above) ---- */
.site-head h1 { font-size: 18px; letter-spacing: 0; line-height: 1.3; }
.tagline { font-size: 12px; }
.panel h3 { font-size: 11px; letter-spacing: .04em; }
.card-name { font-size: 10px; letter-spacing: .3px; }
.badge {
  border-radius: 0; font-size: 8.5px; padding: 4px 7px; letter-spacing: .3px; text-transform: uppercase;
}
.toggle, .toggle button, .segmented, .segmented button { border-radius: 0; }
.toggle button, .segmented button { font-size: 9.5px; letter-spacing: .4px; padding: 8px 12px; }
.controls input, .controls select { border-radius: 0; }
.drawer-close { border-radius: 0; }
.detail-swatch { border-radius: 0; }  /* square in retro */
.count { font-size: 11px; }

/* Detail hero: the planet itself. Pixel by default; smooth sphere when the RENDER knob is turned. */
.detail-hero {
  width: 160px; height: 160px; display: block; flex: none; background: transparent;
}
.detail-hero.pixel { image-rendering: pixelated; image-rendering: crisp-edges; border-radius: 0; }
.detail-hero:not(.pixel) { border-radius: 50%; }
/* Pixel-y dashed dividers + tactile button press */
.params td { border-bottom-style: dashed; }
.toggle button:active, .segmented button:active, .badge:active,
a.badge:active, .drawer-close:active { transform: translateY(1px); }
.toggle button, .segmented button, .badge { transition: transform .04s; }

/* ---- Accent theme + switcher (retro palettes) ---- */
:root[data-accent="blue"]    { --accent: #7cc4ff; }  /* default cobalt */
:root[data-accent="mustard"] { --accent: #e3b23c; }  /* gold */
:root[data-accent="green"]   { --accent: #3bf07a; }  /* phosphor CRT */
:root[data-accent="amber"]   { --accent: #ffb000; }  /* amber terminal */
:root[data-accent="pink"]    { --accent: #ff5fa2; }  /* synthwave */
:root[data-accent="cyan"]    { --accent: #37e6d6; }  /* teletext */
:root[data-accent="violet"]  { --accent: #b98cff; }  /* vaporwave */
.accents { display: inline-flex; gap: 5px; align-items: center; }
.acc { width: 24px; height: 24px; border: 1px solid var(--line); cursor: pointer; padding: 0; }
.acc.acc-blue    { background: #7cc4ff; }
.acc.acc-mustard { background: #e3b23c; }
.acc.acc-green   { background: #3bf07a; }
.acc.acc-amber   { background: #ffb000; }
.acc.acc-pink    { background: #ff5fa2; }
.acc.acc-cyan    { background: #37e6d6; }
.acc.acc-violet  { background: #b98cff; }
.acc.on { outline: 2px solid var(--fg); outline-offset: 1px; }

/* ---- Chunky 8-bit depth on toggles + action pills ---- */
.segmented, .toggle { box-shadow: 3px 3px 0 var(--line); }
button.badge, a.badge { box-shadow: 2px 2px 0 var(--line); }
button.badge:active, a.badge:active { box-shadow: none; }

/* ---- Hex colour chip ---- */
.chip {
  display: inline-block; width: 8px; height: 8px; margin-right: 5px;
  border: 1px solid rgba(255, 255, 255, .3); vertical-align: middle;
}

/* ---- Notched (chamfered) pixel panel corners ---- */
.panel {
  clip-path: polygon(5px 0, calc(100% - 5px) 0, 100% 5px, 100% calc(100% - 5px),
    calc(100% - 5px) 100%, 5px 100%, 0 calc(100% - 5px), 0 5px);
}

/* ---- Subtle CRT scanlines ---- */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 60;
  background: repeating-linear-gradient(to bottom,
    rgba(0, 0, 0, 0), rgba(0, 0, 0, 0) 2px, rgba(0, 0, 0, .20) 3px, rgba(0, 0, 0, 0) 4px);
  opacity: .5;
}

/* ---- Custom retro dropdowns (replace native selects) ---- */
.dropdown { position: relative; display: inline-block; }
.dd-btn {
  background: var(--bg-3); border: 1px solid var(--line); color: var(--fg);
  font: inherit; font-size: 13px; padding: 9px 12px; cursor: pointer; min-width: 160px;
  display: inline-flex; align-items: center; justify-content: space-between; gap: 10px;
  box-shadow: 3px 3px 0 var(--line);
}
.dd-btn:active { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--line); }
.dd-arrow { font-size: 10px; color: var(--fg-dim); }
.dd-menu {
  position: absolute; top: calc(100% + 5px); left: 0; z-index: 40; min-width: 100%;
  background: #000; border: 1px solid var(--line); box-shadow: 4px 4px 0 rgba(0, 0, 0, .7);
  display: flex; flex-direction: column;
}
.dd-menu button {
  background: transparent; border: 0; color: var(--fg-dim); font: inherit; font-size: 13px;
  text-align: left; padding: 9px 12px; cursor: pointer; white-space: nowrap;
}
.dd-menu button:hover { background: var(--bg-3); color: var(--fg); }
.dd-menu button.on { color: var(--accent); }

/* ---- Sharpen the last rounded boxes on the planet page ---- */
.assume, .banner, .palette { border-radius: 0; }
.palette .stop code { border-radius: 0; font-family: var(--pixel); font-size: 8px; }

/* ---- Unify all pills with the chunky 8-bit shadow ---- */
.badge { box-shadow: 2px 2px 0 var(--line); }
.badge:active { box-shadow: none; }

/* ---- The oscilloscope instrument: spectrum screen + readouts + palette channels ---- */
.scope-unit {
  background: linear-gradient(180deg, #14171e, #0b0d12); border: 1px solid var(--line);
  box-shadow: 4px 4px 0 var(--line); margin-top: 4px;
}
.scope-top {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px;
  border-bottom: 1px solid var(--line); background: #0a0c11;
  font-family: var(--pixel); font-size: 9px; letter-spacing: .5px;
}
.scope-brand { color: var(--accent); }
.scope-model { color: var(--fg-dim); }
.led { width: 7px; height: 7px; display: inline-block; background: #2a2f3a; border: 1px solid #000; }
.led.on { background: #4ade80; box-shadow: 0 0 5px #4ade80; }
/* Plain-labelled view selector (the two ways to see a planet's colour). */
.scope-view { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.scope-view-lbl { font-family: var(--pixel); font-size: 8px; letter-spacing: 1px; color: var(--fg-faint); }
.led-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid transparent;
  background: none; color: var(--fg-dim); font: inherit; font-size: 12px; cursor: pointer;
}
.led-btn.on { color: var(--fg); border-color: var(--line); background: var(--bg-3); }
.led-btn:active { transform: translateY(1px); }
/* Explainer bar the ℹ buttons reveal — plain English, accent-flagged. */
.scope-info {
  border: 1px solid var(--accent); border-left-width: 4px; background: var(--bg-3);
  padding: 10px 14px; font-size: 12.5px; line-height: 1.5; color: var(--fg-dim);
}
.scope-info strong { color: var(--fg); }
.scope-main { display: grid; grid-template-columns: 1fr 200px; }
.scope-screen {
  position: relative; background: #04070c; padding: 12px 12px 8px; overflow: hidden;
  box-shadow: inset 0 0 34px rgba(0, 0, 0, .95); border-right: 1px solid var(--line);
}
.scope-screen::after {  /* scanlines + screen vignette */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0 2px, rgba(0, 0, 0, .32) 3px),
    radial-gradient(130% 130% at 50% 45%, transparent 55%, rgba(0, 0, 0, .5));
}
.scope-screen .spectrum { display: block; position: relative; z-index: 1; }
.scope-side {
  padding: 12px; display: flex; flex-direction: column; gap: 6px; background: #0a0c11;
  font-family: var(--mono); font-size: 11px;
}
.ro-ch { display: flex; align-items: center; gap: 6px; font-size: 9.5px; letter-spacing: .3px; }
.ro-ch .sw { width: 9px; height: 9px; display: inline-block; border: 1px solid #000; }
.ro-ch.ch1 { color: #ffd23f; } .ro-ch.ch1 .sw { background: #ffd23f; }
.ro-ch.ch2 { color: #3fd0ff; } .ro-ch.ch2 .sw { background: #3fd0ff; }
.ro-ch code { color: var(--fg-faint); margin-left: auto; font-size: 9.5px; }
.ro-sep { height: 1px; background: var(--line); margin: 3px 0; }
.ro-row { display: flex; justify-content: space-between; align-items: baseline; color: var(--fg-dim); }
.ro-row b { color: var(--fg); font-family: var(--pixel); font-size: 10px; }
.ro-note { color: var(--fg-faint); font-size: 9px; line-height: 1.5; margin-top: auto; }
.scope-bottom {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px; border-top: 1px solid var(--line); background: #0a0c11;
}
.scope-pallabel { font-family: var(--pixel); font-size: 8.5px; color: var(--fg-dim); }
.scope-pal { flex: 1; min-width: 200px; }
.scope-pal .palette { border: 1px solid var(--line); }
.scope-pal .palette .stop { height: 44px; }
.scope-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Scope traces: CH1 (full) yellow, CH2 (Roman) cyan — like a real multi-channel scope */
.spectrum .grid { stroke: rgba(170, 190, 210, .12); }
.spectrum .line-true {
  stroke: #ffd23f; stroke-width: 1.5; filter: drop-shadow(0 0 3px #ffd23f);
}
.spectrum .line-roman {
  stroke: #3fd0ff; filter: drop-shadow(0 0 2.5px #3fd0ff);
}
.spectrum .ytick, .spectrum .xtick {
  fill: rgba(190, 205, 225, .7); font-family: var(--pixel); font-size: 7px;
}
.spectrum .hatchline { stroke: rgba(190, 205, 225, .22); }
.spectrum .hatchlabel { fill: rgba(190, 205, 225, .55); }

/* Badges */
.badge {
  font-size: 11px; padding: 2px 8px; border-radius: 0; border: 1px solid var(--line);
  color: var(--fg-dim); background: var(--bg-3); white-space: nowrap;
}
.badge.model { }
.badge.simulated-cgi { border-color: #3a4d6b; color: #9fc0ef; }
.badge.measured-cgi { border-color: #2f6b45; color: #86e0aa; background: #12241a; }
.badge.model-microlensing { border-color: #6b5330; color: #e6c07a; background: #241d12; }
.badge.hex { font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* Detail page */
.back { font-size: 13px; color: var(--fg-dim); }
.detail-head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin: 12px 0 22px; }
.detail-swatch { width: 200px; height: 200px; border-radius: var(--radius); border: 1px solid var(--line); flex: none; box-shadow: var(--shadow); }
.detail-title h1 { margin: 0 0 4px; font-size: 28px; letter-spacing: -0.02em; }
.detail-title .host { color: var(--fg-dim); }
.detail-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 26px; }
@media (max-width: 820px) { .detail-cols { grid-template-columns: 1fr; } }

.panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.panel h3 { margin: 0 0 12px; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-dim); }

/* Toggle */
.toggle { display: inline-flex; background: var(--bg-3); border: 1px solid var(--line); border-radius: 0; padding: 3px; gap: 2px; }
.toggle button {
  border: 0; background: transparent; color: var(--fg-dim); font-size: 13px; cursor: pointer;
  padding: 6px 14px; border-radius: 0; font-weight: 560;
}
.toggle button.on { background: var(--accent); color: #05121f; }

/* Palette */
.palette { display: flex; gap: 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.palette .stop { flex: 1; height: 64px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; }
.palette .stop code { font-size: 10px; background: rgba(0,0,0,.45); padding: 1px 5px; border-radius: 5px; color: #fff; cursor: pointer; }

/* Params table */
.params { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.params td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.params td:first-child { color: var(--fg-dim); }
.params td:last-child { text-align: right; font-variant-numeric: tabular-nums; }

/* Assumptions / banner */
.assume { font-size: 12.5px; color: var(--fg-dim); background: var(--bg-3); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; }
.banner {
  border-radius: 10px; padding: 11px 14px; font-size: 13px; margin-bottom: 16px;
  background: #241d12; border: 1px solid #6b5330; color: #e6c07a;
}
.de { font-variant-numeric: tabular-nums; }
.viewnote { margin: 10px 0 0; font-size: 12.5px; color: var(--fg-dim); max-width: 52ch; }

/* Spectrum SVG */
.spectrum { width: 100%; height: auto; }
.spectrum .grid { stroke: var(--line); stroke-width: 1; }
.spectrum .ytick, .spectrum .xtick { fill: var(--fg-faint); font-size: 10px; font-family: ui-monospace, monospace; }
.spectrum .ytick { text-anchor: end; }
.spectrum .line-true { fill: none; stroke: var(--fg); stroke-width: 2; }
.spectrum .line-roman { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 5 4; }
.spectrum .hatchline { stroke: var(--fg-faint); stroke-width: 1; }
.spectrum .hatchlabel { fill: var(--fg-faint); font-size: 10px; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--fg-dim); margin-top: 8px; }
.legend .k { display: inline-block; width: 22px; height: 0; border-top: 2px solid; vertical-align: middle; margin-right: 6px; }
.legend .k.true { border-color: var(--fg); }
.legend .k.roman { border-color: var(--accent); border-top-style: dashed; }

.foot { margin-top: 40px; color: var(--fg-faint); font-size: 12px; }
.copied { color: #86e0aa; font-size: 12px; align-self: center; }

/* Drawer */
.drawer { position: fixed; inset: 0; z-index: 50; pointer-events: none; visibility: hidden; }
.drawer.open { pointer-events: auto; visibility: visible; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(4, 6, 10, 0.6);
  opacity: 0; transition: opacity .18s; }
.drawer.open .drawer-backdrop { opacity: 1; }
.drawer-panel {
  position: absolute; top: 0; right: 0; height: 100%; width: min(760px, 94vw);
  background: var(--bg); border-left: 1px solid var(--line); box-shadow: var(--shadow);
  overflow-y: auto; padding: 24px 26px 60px; transform: translateX(100%);
  transition: transform .22s cubic-bezier(.2,.7,.2,1);
}
.drawer.open .drawer-panel { transform: translateX(0); }
.drawer-close {
  position: sticky; top: 0; float: right; background: var(--bg-3); border: 1px solid var(--line);
  color: var(--fg); border-radius: 0; width: 34px; height: 34px; font-size: 20px; cursor: pointer;
}


/* ---- Dossier: combined renders + colour + planet info card ---- */
.dossier-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.info-btn {
  width: 22px; height: 22px; flex: none; border: 1px solid var(--line); background: var(--bg-3);
  color: var(--fg-dim); font-family: var(--pixel); font-size: 11px; line-height: 1; cursor: pointer;
  box-shadow: 2px 2px 0 var(--line);
}
.info-btn.on { background: var(--accent); color: #05121f; }
.info-btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--line); }
/* Accent so the "there's an explanation here" affordance reads at a glance. */
.info-btn:not(.on) { color: var(--accent); border-color: var(--accent); }
.info-btn.sm { width: 18px; height: 18px; font-size: 9px; box-shadow: 1px 1px 0 var(--line); }
.info-btn.xs { width: 13px; height: 13px; font-size: 7px; box-shadow: none; vertical-align: middle; }
.dossier-help { overflow: hidden; margin-top: 12px; }
.dossier-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 14px; }
@media (max-width: 720px) { .dossier-grid { grid-template-columns: 1fr; } }
.dossier-sub {
  font-family: var(--pixel); font-size: 10px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--fg-dim); margin-bottom: 6px;
}

/* ---- Scope control rail: faux knobs + function buttons ---- */
.scope-main { grid-template-columns: 1fr 190px auto; }
@media (max-width: 760px) { .scope-main { grid-template-columns: 1fr; } .scope-rail { flex-direction: row; flex-wrap: wrap; border-left: 0; border-top: 1px solid var(--line); } }
.scope-rail {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 16px;
  background: linear-gradient(180deg, #171a22, #0d0f14); border-left: 1px solid var(--line);
}
.knob-tag { font-family: var(--pixel); font-size: 7px; letter-spacing: .5px; color: var(--fg-faint); }
.knob-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.knob-name { font-size: 11px; color: var(--fg-dim); display: inline-flex; align-items: center; gap: 4px; }
.knob-val { font-family: var(--pixel); font-size: 8px; letter-spacing: .3px; color: var(--accent); }
.knob {
  width: 34px; height: 34px; border-radius: 50%; position: relative; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #3a4150, #14171e 70%);
  border: 1px solid #000; box-shadow: 0 2px 3px rgba(0, 0, 0, .6), inset 0 1px 1px rgba(255, 255, 255, .15);
  transition: box-shadow .12s;
}
.knob:hover { box-shadow: 0 2px 3px rgba(0, 0, 0, .6), inset 0 1px 1px rgba(255, 255, 255, .15), 0 0 0 2px var(--line); }
.knob:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.knob:active { transform: translateY(1px); }
.knob-dot {
  position: absolute; top: 3px; left: 50%; width: 2px; height: 9px; background: var(--accent);
  transform-origin: 50% 14px; transform: translateX(-50%) rotate(var(--a, 0deg));
  box-shadow: 0 0 3px var(--accent); transition: transform .18s cubic-bezier(.4, 1.4, .6, 1);
}
.scope-fbtn {
  margin-top: 4px; width: 54px; padding: 6px 0; border: 1px solid var(--line); background: var(--bg-3);
  color: var(--fg-dim); font-family: var(--pixel); font-size: 8px; cursor: pointer; box-shadow: 2px 2px 0 var(--line);
}
.scope-fbtn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--line); }
.scope-fbtn.on { background: var(--accent); color: #05121f; border-color: var(--accent); }

/* ---- CRT screen curvature + glare ---- */
.scope-screen { border-radius: 12px / 9px; }
.scope-screen::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2; border-radius: inherit;
  background: radial-gradient(120% 90% at 30% 10%, rgba(255, 255, 255, .06), transparent 45%);
  box-shadow: inset 0 0 44px rgba(0, 0, 0, .75);
}

/* ---- RUN LED: slow pulse for life, quick flash on view change ---- */
.led.on { animation: ledpulse 2.4s ease-in-out infinite; }
@keyframes ledpulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.led.flash { animation: ledflash .32s ease-out; }
@keyframes ledflash { 0% { background: #fff; box-shadow: 0 0 9px #fff; } 100% { background: #4ade80; } }
