/* reactor R-1. A machine, not a web page. */

:root {
  --desk: #1b1a17;
  --body: #e8e3d7;
  --body-hi: #f3efe5;
  --body-lo: #d3cdbf;
  --ink: #1a1916;
  --ink-2: #57544c;
  --ink-3: #8c877b;
  --orange: #ff5b14;
  --orange-hi: #ff8243;
  --orange-lo: #b9400b;
  --lcd: #b6c298;
  --lcd-ink: #24301a;
  --nixie: #ffad5c;
  --paper: #f4efe3;
  --green: #79f05a;
  --cond: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --dot: 'Doto', 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .25 0 0 0 0 .12 0 0 0 .12 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #d58459 0, #cd7a4e 600px, #c06e45 1400px, #b3653f 100%);
  color: var(--ink);
  font: 15px/1.5 var(--cond);
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

.desk { --pad: clamp(10px, 3vw, 40px); padding: 0 var(--pad) 60px; }
/* -------------------------------------------------------------------- sky */
.sky {
  position: relative; overflow: hidden;
  margin: 0 calc(-1 * var(--pad)); min-height: clamp(420px, 52vh, 520px);
  padding: 18px var(--pad) 150px;
  display: flex; flex-direction: column; align-items: center;
}
.sky-scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.embers { position: absolute; inset: 0; pointer-events: none; }
.embers i { position: absolute; bottom: 18%; border-radius: 50%; background: #fff2e0; box-shadow: 0 0 8px 3px rgba(255, 160, 80, .7); opacity: 0; animation: ember linear infinite; }
@keyframes ember { 0% { transform: translate(0, 0); opacity: 0; } 12% { opacity: .9; } 80% { opacity: .5; } 100% { transform: translate(30px, -340px); opacity: 0; } }
.sky-top { position: relative; z-index: 2; width: 100%; max-width: 1120px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sky-brand { white-space: nowrap; flex-shrink: 0; display: flex; align-items: baseline; gap: 8px; padding: 7px 12px 8px; border-radius: 8px; background: var(--ink); color: #f3efe5; box-shadow: 0 6px 14px rgba(110, 50, 15, .25); }
.sky-brand b { font: 800 18px/1 var(--cond); font-stretch: 125%; letter-spacing: -.02em; }
.sky-brand span { font: 700 12px/1 var(--cond); font-stretch: 75%; color: var(--orange); letter-spacing: .1em; }
.sky-stats { display: flex; gap: 18px; flex-wrap: wrap; justify-content: flex-end; font: 500 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: #6d3b1f; }
.sky-stats span { display: inline-flex; align-items: center; gap: 6px; }
.sky-stats b { font-weight: 600; color: #2a160a; }
.sky-stats .led { width: 9px; height: 9px; }
.sky-copy { position: relative; z-index: 2; text-align: center; margin-top: clamp(28px, 6vh, 64px); }
.kicker { margin: 0 0 10px; font: 500 12px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: #8a4b26; }
.sky-copy h1 { margin: 0; color: #2a160a; font: 900 clamp(56px, 9vw, 112px)/.88 var(--cond); font-stretch: 66%; letter-spacing: -.015em; text-transform: uppercase; }
.lede { max-width: 46ch; margin: 14px auto 0; font-size: 17px; line-height: 1.5; color: #6d3b1f; }
.lede b { color: #2a160a; }
.grid-strip { position: relative; z-index: 2; margin-top: 22px; display: flex; align-items: center; gap: 12px; max-width: min(760px, 100%); padding: 8px 14px; border-radius: 99px; background: rgba(255, 244, 230, .55); box-shadow: inset 0 0 0 1px rgba(120, 60, 20, .12); backdrop-filter: blur(4px); }
.grid-label { font: 800 10px var(--cond); font-stretch: 75%; letter-spacing: .22em; text-transform: uppercase; color: #8a4b26; flex-shrink: 0; }
.grid-dots { display: flex; flex-wrap: wrap; gap: 6px; min-height: 12px; max-width: 420px; }
.gdot { width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #ffe6c8, #ff9a4a 55%, #c4520f); box-shadow: 0 0 6px rgba(255, 120, 30, .6); }
.gdot.born { animation: born .5s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes born { from { transform: scale(0); } }
.gdot.me { outline: 2px solid #2a160a; outline-offset: 2px; }
.gdot.flash { animation: gflash .7s ease-out; }
@keyframes gflash { 0% { transform: scale(1.9); box-shadow: 0 0 18px 8px rgba(255, 190, 110, .95); background: #fff7ea; } }
.grid-count { font: 500 12px var(--mono); color: #6d3b1f; white-space: nowrap; }

.lever.nudge .lever-handle { animation: lever-nudge 0.9s ease-in-out 3; }
@keyframes lever-nudge { 30% { transform: translateY(46px); } 60% { transform: translateY(8px); } }
.lever.nudge .lever-slot { box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.8), 0 0 0 4px #cfc9bb, 0 0 0 9px rgba(255, 91, 20, 0.5); }

.reprint { border: 0; background: none; padding: 0; font: 500 12px var(--mono); color: var(--orange-lo); text-decoration: underline; }

/* ---------------------------------------------------------------- chassis */
.device {
  position: relative;
  max-width: 1120px; margin: -150px auto 0; z-index: 3;
  padding: 22px 26px 18px;
  border-radius: 28px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(180deg, var(--body-hi), var(--body) 30%, var(--body-lo));
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.9),
    inset 0 -4px 0 rgba(0, 0, 0, 0.12),
    inset 0 0 0 1px rgba(0, 0, 0, 0.08),
    0 2px 0 #9b958a,
    0 50px 90px rgba(90, 35, 8, 0.55),
    0 14px 24px rgba(90, 35, 8, 0.35);
}
.screw {
  position: absolute; width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fbfaf6, #a9a395 70%, #7d786d);
  box-shadow: inset 0 -1px 1px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.8);
}
.screw::after { content: ''; position: absolute; left: 3px; right: 3px; top: 7px; height: 2px; background: #5f5a50; border-radius: 1px; transform: rotate(var(--r, 35deg)); }
.screw.tl { top: 12px; left: 12px; }
.screw.tr { top: 12px; right: 12px; --r: -20deg; }
.screw.bl { bottom: 12px; left: 12px; --r: 70deg; }
.screw.br { bottom: 12px; right: 12px; --r: 5deg; }

/* top strip */
.strip { display: flex; align-items: center; gap: 18px; padding: 4px 14px 16px; min-height: 64px; }
.plate {
  display: flex; align-items: baseline; gap: 10px;
  padding: 8px 14px 9px; border-radius: 8px; background: var(--ink); color: #f3efe5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 0 rgba(255, 255, 255, 0.7);
}
.plate b { font: 800 22px/1 var(--cond); font-stretch: 125%; letter-spacing: -0.02em; }
.plate span { font: 700 13px/1 var(--cond); font-stretch: 75%; color: var(--orange); letter-spacing: 0.1em; }
.leds { display: flex; gap: 14px; }
.led-unit { display: flex; flex-direction: column; align-items: center; gap: 4px; font: 600 9px var(--cond); font-stretch: 75%; letter-spacing: 0.16em; color: var(--ink-2); }
.led {
  width: 11px; height: 11px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #8a867c, #4c4943);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: background 0.08s, box-shadow 0.08s;
}
.led.on { background: radial-gradient(circle at 35% 30%, #e8ffd9, var(--green) 55%, #3fa82a); box-shadow: 0 0 8px var(--green), 0 0 18px rgba(121, 240, 90, 0.5); }
.led.amber.on { background: radial-gradient(circle at 35% 30%, #fff1d6, #ffb02e 55%, #c46d00); box-shadow: 0 0 8px #ffb02e, 0 0 18px rgba(255, 176, 46, 0.6); }
.led.red.on { background: radial-gradient(circle at 35% 30%, #ffd9cc, #ff4b2b 55%, #a8200a); box-shadow: 0 0 8px #ff4b2b, 0 0 18px rgba(255, 75, 43, 0.5); }

.stickers { flex: 1; display: flex; align-items: center; justify-content: center; gap: 2px; min-height: 52px; flex-wrap: wrap; }
.sticker {
  width: 54px; height: 54px; display: grid; place-items: center; text-align: center;
  font: 800 8.5px/1.05 var(--cond); font-stretch: 75%; letter-spacing: 0.04em; text-transform: uppercase;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.25)) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.15));
  transform: rotate(var(--rot, 0deg));
  margin: -6px -3px;
}
.sticker.slap { animation: slap 0.45s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes slap { from { transform: scale(1.8) rotate(calc(var(--rot) - 30deg)); opacity: 0; } }
.sticker.s-circle { border-radius: 50%; }
.sticker.s-hex { clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); }
.sticker.s-star { clip-path: polygon(50% 0, 61% 18%, 82% 10%, 80% 32%, 100% 42%, 85% 58%, 94% 79%, 72% 80%, 62% 100%, 50% 85%, 38% 100%, 28% 80%, 6% 79%, 15% 58%, 0 42%, 20% 32%, 18% 10%, 39% 18%); width: 60px; height: 60px; }
.sticker.s-pill { width: 70px; height: 30px; border-radius: 99px; }
.sticker.s-square { border-radius: 8px; width: 48px; height: 48px; }

.toggle {
  position: relative; width: 44px; height: 52px; border: 0; background: none; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
}
.toggle::before { content: ''; position: absolute; top: 14px; width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff, #b4ae9f 70%); box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3), inset 0 -1px 1px rgba(0, 0, 0, 0.2); }
.toggle-bat {
  position: absolute; top: 4px; left: 50%; width: 8px; height: 22px; margin-left: -4px; border-radius: 4px;
  background: linear-gradient(90deg, #9c968a, #f6f3ec 40%, #8f897d); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  transform-origin: 50% 100%; transform: translateY(10px) rotate(180deg); transition: transform 0.12s;
  z-index: 1;
}
.toggle[aria-checked=true] .toggle-bat { transform: translateY(10px) rotate(0deg); }
.toggle em { font: 600 9px var(--cond); font-style: normal; font-stretch: 75%; letter-spacing: 0.16em; color: var(--ink-2); }

.dymo {
  border: 0; padding: 7px 12px 8px; border-radius: 3px;
  background: linear-gradient(180deg, #232220, #111);
  color: #f2f0ea; font: 700 13px var(--cond); font-stretch: 80%; letter-spacing: 0.18em; text-transform: uppercase;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.7), 0 1px 0 rgba(255, 255, 255, 0.25);
  transform: rotate(-1.2deg);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.35);
  white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis;
}
.dymo:hover { background: linear-gradient(180deg, #2c2a27, #151412); }

/* powered off until the first pull */
.device.off .lcd { background: radial-gradient(ellipse at 50% 40%, #59614a, #474e3a 70%, #3c4231); }
.device.off .lcd-line { color: transparent; text-shadow: none; }
.device.off .lcd::after { content: 'PULL THE LEVER'; position: absolute; inset: 0; display: grid; place-items: center; font: 800 18px var(--dot); letter-spacing: .1em; color: rgba(200, 214, 160, .18); }
.device.off .tube .nx-digit { color: rgba(255, 140, 60, .1); text-shadow: none; }
.device.off .nx-dot { background: rgba(255, 140, 60, .15); box-shadow: none; }
.device.off .led.on { background: radial-gradient(circle at 35% 30%, #8a867c, #4c4943); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6), 0 1px 0 rgba(255, 255, 255, .8); }
.device.off .ledbar i { background: #2c2a26 !important; box-shadow: none !important; }
.device.booting .lcd { animation: backlight .5s steps(4); }
@keyframes backlight { 0% { filter: brightness(.4); } 50% { filter: brightness(1.3); } }

/* ------------------------------------------------------------------ panel */
.panel {
  display: grid; gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) 150px;
  grid-template-areas:
    'port  gauge lever'
    'lcd   lcd   lever'
    'earn  earn  knob'
    'fuel  card  card'
    'flap  flap  flap';
}
.m-port { grid-area: port; }
.m-gauge { grid-area: gauge; }
.m-lever { grid-area: lever; }
.m-lcd { grid-area: lcd; }
.m-earn { grid-area: earn; }
.m-knob { grid-area: knob; }
.m-fuel { grid-area: fuel; }
.m-card { grid-area: card; }
.m-flap { grid-area: flap; }

.mod {
  position: relative; min-width: 0;
  padding: 34px 16px 16px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.035), rgba(255, 255, 255, 0.25));
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.16), inset 0 0 0 1px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.85);
}
.lbl {
  position: absolute; top: 11px; left: 14px;
  display: flex; align-items: center; gap: 7px;
  font: 700 10px var(--cond); font-stretch: 75%; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-2);
}
.lbl i { font-style: normal; display: inline-grid; place-items: center; min-width: 20px; height: 15px; padding: 0 3px; border-radius: 3px; background: var(--orange); color: #fff; letter-spacing: 0.05em; }

/* 01 porthole */
.m-port { display: grid; place-items: center; }
.porthole {
  container-type: inline-size;
  position: relative; width: min(100%, 250px); aspect-ratio: 1; border-radius: 50%; padding: 18px;
  background: conic-gradient(from 20deg, #cbc5b8, #f8f6f0, #b3ad9f, #efebe2, #c4beb0, #faf8f3, #b8b2a4, #e9e5dc, #cbc5b8);
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.28), 0 2px 0 rgba(0, 0, 0, 0.15), inset 0 2px 1px rgba(255, 255, 255, 0.9), inset 0 -2px 2px rgba(0, 0, 0, 0.2);
}
.porthole canvas {
  display: block; width: 100%; height: 100%; border-radius: 50%;
  background: radial-gradient(circle, #241208 0%, #0b0604 70%);
  box-shadow: inset 0 6px 14px rgba(0, 0, 0, 0.9), 0 0 0 3px #2a2722, 0 0 0 5px #8d877b;
}
.porthole .glass {
  position: absolute; inset: 18px; border-radius: 50%; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 35% at 32% 22%, rgba(255, 255, 255, 0.32), transparent 60%),
    radial-gradient(ellipse 30% 15% at 70% 82%, rgba(255, 255, 255, 0.08), transparent 70%);
}
.bolt {
  position: absolute; left: 50%; top: 50%; width: 11px; height: 11px; margin: -5.5px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #9d978a 70%);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
  transform: rotate(var(--a)) translateY(calc(-50cqw + 9px));
}

/* 02 gauge */
.m-gauge { display: flex; flex-direction: column; align-items: center; }
.gauge-face {
  position: relative; width: 100%; max-width: 380px;
  border-radius: 14px 14px 10px 10px; padding: 8px 8px 0;
  background: radial-gradient(ellipse at 50% 100%, #fffdf6, #f1ecdf 70%);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.25), inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}
.gauge-svg { display: block; width: 100%; height: auto; }
.gauge-glass { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(160deg, rgba(255, 255, 255, 0.55), transparent 35%); }
.g-rim { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.g-red { fill: none; stroke: var(--orange); stroke-width: 7; }
.g-major { stroke: var(--ink); stroke-width: 2.5; }
.g-minor { stroke: var(--ink); stroke-width: 1; }
.g-label { font: 700 12px var(--cond); font-stretch: 75%; fill: var(--ink); text-anchor: middle; letter-spacing: 0.04em; }
.g-unit { font: 600 9px var(--cond); font-stretch: 75%; fill: var(--ink-3); text-anchor: middle; letter-spacing: 0.24em; }
.g-needle path { fill: var(--orange); }
.g-needle { filter: drop-shadow(2px 3px 1.5px rgba(0, 0, 0, 0.3)); }
.g-hub { fill: var(--ink); }
.g-hub-cap { fill: #6e6a61; }
.gauge-read { margin-top: 10px; display: flex; align-items: baseline; gap: 8px; }
.gauge-read span { font: 800 40px/1 var(--cond); font-stretch: 70%; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.gauge-read small { font: 700 13px var(--cond); font-stretch: 75%; letter-spacing: 0.18em; color: var(--ink-2); }

/* 03 lever */
.m-lever { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lever { flex: 1; width: 100%; display: flex; justify-content: center; min-height: 250px; }
.lever-slot {
  position: relative; width: 30px; height: 100%; border-radius: 15px;
  background: linear-gradient(90deg, #0f0e0d, #2b2925 50%, #0f0e0d);
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.8), 0 1px 0 rgba(255, 255, 255, 0.8), 0 0 0 4px #cfc9bb, 0 0 0 5px rgba(0, 0, 0, 0.15);
}
.lever.is-on .lever-slot { box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.8), inset 0 0 12px rgba(255, 91, 20, 0.7), 0 1px 0 rgba(255, 255, 255, 0.8), 0 0 0 4px #cfc9bb, 0 0 0 5px rgba(0, 0, 0, 0.15); }
.lever-mark { position: absolute; left: 44px; font: 800 11px var(--cond); font-stretch: 75%; letter-spacing: 0.18em; color: var(--ink-3); }
.lever-mark.off { top: 12px; }
.lever-mark.on { bottom: 12px; }
.lever.is-on .lever-mark.on { color: var(--orange); }
.lever:not(.is-on) .lever-mark.off { color: var(--ink); }
.lever-handle {
  position: absolute; left: 50%; top: 0; width: 76px; height: 76px; margin-left: -38px;
  border: 0; padding: 0; background: none; touch-action: none; cursor: grab;
  transition: transform 0.35s cubic-bezier(.3, 1.5, .5, 1);
}
.lever-handle:active { cursor: grabbing; }
.lever-shaft { position: absolute; left: 50%; top: 30px; width: 12px; height: 34px; margin-left: -6px; border-radius: 3px; background: linear-gradient(90deg, #8b857a, #f4f1ea 45%, #77726a); }
.lever-ball {
  position: absolute; left: 6px; top: 0; width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #ffd2b8 0%, var(--orange-hi) 18%, var(--orange) 50%, var(--orange-lo) 100%);
  box-shadow: 0 10px 14px rgba(0, 0, 0, 0.45), inset 0 -4px 8px rgba(0, 0, 0, 0.25);
}
.lever-hint { font: 700 10px var(--cond); font-stretch: 75%; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-2); text-align: center; }

/* 04 lcd */
.lcd {
  position: relative; padding: 12px 16px; border-radius: 8px;
  background:
    linear-gradient(rgba(36, 48, 26, 0.06) 1px, transparent 1px) 0 0 / 100% 3px,
    linear-gradient(90deg, rgba(36, 48, 26, 0.06) 1px, transparent 1px) 0 0 / 3px 100%,
    radial-gradient(ellipse at 50% 40%, #c3cea4, var(--lcd) 70%, #a2ae84);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.35), 0 0 0 6px #23221f, 0 0 0 7px rgba(255, 255, 255, 0.6);
  margin: 6px;
}
.lcd-line {
  font: 800 19px/1.35 var(--dot); color: var(--lcd-ink); letter-spacing: 0.04em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: clip;
  text-shadow: 1px 1px 0 rgba(36, 48, 26, 0.18);
}
.lcd-line .blink { animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* 05 earned */
.earn-row { display: flex; gap: 18px; align-items: stretch; }
.nixie-window {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 12px;
  background: linear-gradient(180deg, #0c0907, #1a120c);
  box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 255, 255, 0.8), 0 0 0 1px rgba(0, 0, 0, 0.3);
}
.nx-cur { font: 300 42px/1 var(--cond); font-stretch: 62%; color: var(--nixie); opacity: 0.85; text-shadow: 0 0 10px rgba(255, 120, 30, 0.8); }
.nixie { display: flex; align-items: flex-end; gap: 6px; min-width: 0; }
.tube {
  position: relative; width: clamp(30px, 4.2vw, 46px); aspect-ratio: 0.58; border-radius: 22px 22px 8px 8px;
  background:
    repeating-linear-gradient(60deg, rgba(255, 170, 90, 0.05) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(-60deg, rgba(255, 170, 90, 0.05) 0 1px, transparent 1px 5px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02) 30%, rgba(255, 255, 255, 0.09) 80%, rgba(255, 255, 255, 0.03));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), inset 0 -6px 10px rgba(0, 0, 0, 0.6);
  display: grid; place-items: center; overflow: hidden;
}
.nx-ghost, .nx-digit { grid-area: 1 / 1; font: 300 clamp(36px, 5.2vw, 58px)/1 var(--cond); font-stretch: 62%; }
.nx-ghost { color: rgba(255, 140, 60, 0.07); }
.nx-digit { color: #ffd2a1; text-shadow: 0 0 4px #ff9a3c, 0 0 12px #ff7a1a, 0 0 26px rgba(255, 90, 0, 0.75); }
.tube.dim .nx-digit { color: rgba(255, 140, 60, 0.1); text-shadow: none; }
.nx-flash { animation: nxflash 0.25s; }
@keyframes nxflash { 0% { opacity: 0.2; filter: brightness(2); } 40% { opacity: 1; } 60% { opacity: 0.7; } }
.nx-dot { width: 8px; height: 8px; border-radius: 50%; margin-bottom: 8px; background: #ffd2a1; box-shadow: 0 0 6px #ff9a3c, 0 0 14px #ff7a1a; }
.earn-sub { margin-top: 10px; font: 500 12px var(--mono); color: var(--ink-2); }
.earn-sub b { color: var(--ink); font-weight: 600; }

.key {
  width: 104px; flex-shrink: 0; border: 0; border-radius: 16px; padding: 0;
  background: linear-gradient(180deg, var(--orange-hi), var(--orange));
  box-shadow: 0 7px 0 var(--orange-lo), 0 12px 18px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transform: translateY(-4px);
  transition: transform 0.06s, box-shadow 0.06s;
}
.key span { display: block; font: 900 17px/1 var(--cond); font-stretch: 75%; letter-spacing: 0.12em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2); }
.key:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--orange-lo), 0 3px 6px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.45); }
.key.locked { background: linear-gradient(180deg, #d9d4c8, #c5bfb1); box-shadow: 0 7px 0 #9f998c, 0 12px 18px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.7); }
.key.locked span { color: var(--ink-2); text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6); }

/* 06 knob */
.m-knob { display: grid; place-items: center; }
.knob-ring { position: relative; width: 132px; height: 132px; }
.knob-label {
  position: absolute; transform: translate(-50%, -50%); border: 0; background: none; padding: 2px 4px;
  font: 800 10px var(--cond); font-stretch: 75%; letter-spacing: 0.16em; color: var(--ink-3);
}
.knob-label.active { color: var(--orange); }
.knob {
  position: absolute; left: 50%; top: 56%; width: 78px; height: 78px; margin: -39px 0 0 -39px; border: 0; padding: 0; border-radius: 50%;
  background:
    radial-gradient(circle at 50% 45%, #f6f3ec 0 46%, transparent 47%),
    repeating-conic-gradient(#8f897d 0 4deg, #d6d1c5 4deg 9deg);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.35), 0 2px 0 rgba(0, 0, 0, 0.25), inset 0 2px 1px rgba(255, 255, 255, 0.8);
  transition: transform 0.25s cubic-bezier(.3, 1.4, .5, 1);
}
.knob-dot { position: absolute; left: 50%; top: 9px; width: 7px; height: 16px; margin-left: -3.5px; border-radius: 4px; background: var(--orange); }

/* 07 fuel */
.ledbar {
  display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; padding: 9px; border-radius: 8px;
  background: #151412; box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.8), 0 1px 0 rgba(255, 255, 255, 0.8);
}
.ledbar i { height: 26px; border-radius: 2px; background: #2c2a26; }
.ledbar i.g { background: var(--green); box-shadow: 0 0 6px rgba(121, 240, 90, 0.7); }
.ledbar i.a { background: #ffb02e; box-shadow: 0 0 6px rgba(255, 176, 46, 0.7); }
.ledbar i.r { background: #ff4b2b; box-shadow: 0 0 6px rgba(255, 75, 43, 0.7); }
.fuel-read { margin-top: 12px; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; font: 500 12px var(--mono); color: var(--ink-2); }
.fuel-read b { font: 800 26px/1.1 var(--cond); font-stretch: 70%; color: var(--ink); grid-column: 1 / -1; }
.fuel-read a { color: var(--ink); }

/* operator card */
.m-card { padding: 16px; display: flex; align-items: center; justify-content: center; }
.opcard {
  width: 100%; max-width: 560px; border-radius: 6px; overflow: hidden;
  background: linear-gradient(180deg, #fbf8ef, var(--paper));
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 0 6px 12px rgba(0, 0, 0, 0.18);
  transform: rotate(-0.6deg);
  font: 500 12px var(--mono);
}
.opcard header { display: flex; justify-content: space-between; align-items: center; padding: 7px 14px; background: var(--orange); color: #fff; font: 800 11px var(--cond); font-stretch: 75%; letter-spacing: 0.22em; text-transform: uppercase; }
.opcard .rows { padding: 12px 14px 14px; display: grid; grid-template-columns: max-content 1fr; gap: 9px 14px; align-items: center; position: relative; }
.opcard dt { font: 700 10px var(--cond); font-stretch: 75%; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); }
.opcard dd { margin: 0; color: var(--ink); }
.holes { display: flex; gap: 7px; }
.hole { width: 20px; height: 20px; border-radius: 50%; border: 1.5px dashed #b3ad9f; display: grid; place-items: center; font: 600 9px var(--mono); color: #b3ad9f; }
.hole.punched { border: 0; background: var(--desk); box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.8); color: transparent; }
.hole.today { border-color: var(--orange); color: var(--orange); }
.perf { height: 8px; border-radius: 4px; background: repeating-linear-gradient(90deg, #d8d2c4 0 6px, transparent 6px 9px); position: relative; overflow: hidden; }
.perf i { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(90deg, var(--ink) 0 6px, transparent 6px 9px); transition: width 0.6s; }
.stamp {
  position: absolute; right: 18px; bottom: 14px; padding: 4px 10px; border: 2.5px solid #d6301a; border-radius: 6px;
  font: 900 15px var(--cond); font-stretch: 75%; letter-spacing: 0.1em; color: #d6301a; text-transform: uppercase;
  transform: rotate(-9deg); opacity: 0.85; mix-blend-mode: multiply;
}

/* 08 split-flap */
.m-flap { padding-bottom: 14px; }
.board {
  container-type: inline-size;
  display: flex; flex-direction: column; gap: 5px; padding: 12px; border-radius: 10px;
  background: linear-gradient(180deg, #1c1b19, #121110);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.8), 0 1px 0 rgba(255, 255, 255, 0.8);
}
.flap-row { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 2px; border-radius: 4px; }
.flap-row.link { cursor: pointer; }
.flap-row.link:hover .flap { background: linear-gradient(180deg, #34312d 50%, #2b2926 50%); }
.flap {
  position: relative; aspect-ratio: 0.68; border-radius: 2px; overflow: hidden;
  background: linear-gradient(180deg, #2b2926 50%, #232120 50%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 1px 1px rgba(0, 0, 0, 0.6);
  display: grid; place-items: center;
  font: 700 calc(100cqw / var(--cols) * 1.02)/1 var(--cond); font-stretch: 75%; color: #f3efe5;
}
.flap::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0, 0, 0, 0.75); }
.flap.flip .flap-ch { animation: flip 0.09s ease-out; }
@keyframes flip { from { transform: scaleY(0.1) translateY(-40%); filter: brightness(0.5); } }
.flap-row:first-child .flap { color: #ffd2a1; }

.serial { margin-top: 14px; text-align: center; font: 600 10px var(--cond); font-stretch: 75%; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-3); text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7); }

/* ----------------------------------------------------------------- manual */
.manual {
  max-width: 1040px; margin: 56px auto 0; padding: clamp(24px, 5vw, 56px);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .25 0 0 0 0 .2 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    var(--paper);
  box-shadow: 0 30px 60px rgba(80, 30, 5, 0.45);
  transform: rotate(0.25deg);
  color: var(--ink);
}
.man-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 3px solid var(--ink); padding-bottom: 18px; }
.man-head h1 { margin: 0; font: 900 clamp(32px, 6vw, 60px)/0.9 var(--cond); font-stretch: 70%; text-transform: uppercase; letter-spacing: -0.01em; }
.man-head p { margin: 8px 0 0; font: 500 13px var(--mono); color: var(--ink-2); }
.man-stamp { flex-shrink: 0; width: 96px; height: 96px; border-radius: 50%; border: 3px solid #d6301a; display: grid; place-items: center; text-align: center; font: 900 14px/1 var(--cond); font-stretch: 75%; text-transform: uppercase; letter-spacing: 0.08em; color: #d6301a; transform: rotate(12deg); opacity: 0.85; }
.man-sec { padding: 28px 0 8px; }
.man-sec h2 { margin: 0 0 16px; font: 800 22px var(--cond); font-stretch: 75%; text-transform: uppercase; letter-spacing: 0.02em; display: flex; align-items: baseline; gap: 10px; }
.man-sec h2 i { font-style: normal; color: var(--orange); }
.man-sec h2 span { font: 500 13px var(--mono); color: var(--ink-3); }
.man-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; border-top: 1px solid rgba(0, 0, 0, 0.2); border-bottom: 1px solid rgba(0, 0, 0, 0.2); }
.note { margin: -8px 0 14px; font: 500 13px var(--mono); color: var(--ink-2); }

.ops { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.ops li { font-size: 15px; color: var(--ink-2); }
.ops svg { width: 48px; height: 48px; display: block; margin-bottom: 10px; color: var(--ink); }
.ops b { display: block; color: var(--ink); font-size: 17px; font-stretch: 85%; }

.seg { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 6px; overflow: hidden; margin-bottom: 14px; }
.seg button { border: 0; background: none; padding: 5px 12px; font: 700 12px var(--cond); font-stretch: 75%; letter-spacing: 0.14em; text-transform: uppercase; }
.seg button[aria-selected=true] { background: var(--ink); color: var(--paper); }
.ranks { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.ranks li { display: flex; align-items: baseline; gap: 10px; padding: 6px 0; font: 500 14px var(--mono); counter-increment: r; }
.ranks li::before { content: counter(r, decimal-leading-zero); font: 800 14px var(--cond); color: var(--ink-3); width: 24px; }
.ranks li:first-child::before { color: var(--orange); }
.ranks .dots { flex: 1; border-bottom: 2px dotted rgba(0, 0, 0, 0.35); transform: translateY(-4px); }
.ranks li.me { color: var(--orange-lo); font-weight: 600; }
.ranks .empty { color: var(--ink-3); }

.sticker-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 14px; }
.sticker-list li { display: flex; align-items: center; gap: 10px; font: 500 12px/1.3 var(--mono); color: var(--ink-2); }
.sticker-list .sticker { flex-shrink: 0; margin: 0; width: 40px; height: 40px; font-size: 6.5px; }
.sticker-list .sticker.s-star { width: 44px; height: 44px; }
.sticker-list .sticker.s-pill { width: 50px; height: 22px; }
.sticker-list li.locked .sticker { filter: grayscale(1) opacity(0.25); }
.sticker-list li b { display: block; color: var(--ink); font: 700 13px var(--cond); font-stretch: 85%; }

.faq details { border-top: 1px solid rgba(0, 0, 0, 0.18); padding: 12px 0; }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; font: 700 17px var(--cond); font-stretch: 85%; }
.faq summary::after { content: '+'; font: 500 18px var(--mono); color: var(--orange); }
.faq details[open] summary::after { content: '−'; }
.faq p { margin: 8px 0 0; max-width: 68ch; font-size: 15px; color: var(--ink-2); }
.spec { display: grid; grid-template-columns: max-content 1fr; margin: 0; font: 500 13px var(--mono); }
.spec dt, .spec dd { padding: 8px 0; border-bottom: 1px dotted rgba(0, 0, 0, 0.3); }
.spec dt { color: var(--ink-2); padding-right: 24px; text-transform: uppercase; font: 700 12px var(--cond); font-stretch: 75%; letter-spacing: 0.14em; display: flex; align-items: center; }
.spec dd { margin: 0; text-align: right; word-break: break-all; }
.man-foot { margin-top: 30px; padding-top: 14px; border-top: 3px solid var(--ink); font: 500 12px var(--mono); color: var(--ink-3); display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

/* ------------------------------------------------------------- dialogs */
.dlg {
  width: min(460px, calc(100vw - 24px)); padding: 30px 26px 24px; border: 0; border-radius: 22px;
  background: linear-gradient(180deg, var(--body-hi), var(--body-lo)); color: var(--ink);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.9), 0 40px 80px rgba(0, 0, 0, 0.6);
}
.dlg::backdrop { background: rgba(10, 9, 8, 0.7); backdrop-filter: blur(3px); }
.dlg-x { position: absolute; top: 12px; right: 12px; margin: 0; }
.dlg-x button { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--body-lo); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2); font-size: 18px; }
.dlg h3 { margin: 0 0 6px; font: 900 26px/1 var(--cond); font-stretch: 70%; text-transform: uppercase; }
.dlg p { margin: 0 0 16px; color: var(--ink-2); font-size: 14px; }
.dlg .lcd { margin: 6px 6px 18px; }
.lcd-input { width: 100%; border: 0; background: none; outline: none; font: 800 17px var(--dot); color: var(--lcd-ink); text-transform: uppercase; letter-spacing: 0.02em; }
.lcd-input::placeholder { color: rgba(36, 48, 26, 0.35); }
.dlg-keys { display: flex; gap: 12px; }
.pkey {
  flex: 1; height: 50px; border: 0; border-radius: 12px;
  font: 900 14px var(--cond); font-stretch: 75%; letter-spacing: 0.14em; text-transform: uppercase;
  background: linear-gradient(180deg, #f6f3ec, #d7d1c4); color: var(--ink);
  box-shadow: 0 5px 0 #a39d90, 0 8px 12px rgba(0, 0, 0, 0.2), inset 0 1px 0 #fff;
  transform: translateY(-3px);
}
.pkey.orange { background: linear-gradient(180deg, var(--orange-hi), var(--orange)); color: #fff; box-shadow: 0 5px 0 var(--orange-lo), 0 8px 12px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.pkey:active { transform: translateY(2px); box-shadow: 0 0 0 #a39d90; }
.pkey:disabled { opacity: 0.5; cursor: not-allowed; }
.dlg-err { min-height: 20px; margin-top: 12px; font: 500 13px var(--mono); color: #c2260f; }
.dlg .small { font: 500 12px var(--mono); color: var(--ink-3); margin-top: 6px; }
.dlg .small a { color: var(--ink-2); }

/* receipt */
.receipt-layer { position: fixed; inset: 0; z-index: 80; background: rgba(10, 9, 8, 0.72); display: flex; flex-direction: column; align-items: center; padding-top: 5vh; overflow-y: auto; }
.receipt-slot { width: 360px; max-width: calc(100vw - 32px); height: 16px; border-radius: 8px; background: #0a0908; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15), inset 0 3px 4px rgba(0, 0, 0, 0.9); position: relative; z-index: 2; }
.receipt-clip { overflow: hidden; margin-top: -8px; padding: 0 20px 30px; }
.receipt {
  width: 316px; max-width: calc(100vw - 72px); padding: 24px 22px 34px;
  background: #fbfaf4; color: #22201c; font: 500 12.5px/1.6 var(--mono);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
  transform: translateY(-105%);
}
.receipt.printing { animation: print 1.7s steps(16) forwards; }
@keyframes print { to { transform: translateY(0); } }
.receipt h4 { margin: 0; text-align: center; font: 900 22px var(--cond); font-stretch: 75%; letter-spacing: 0.1em; text-transform: uppercase; }
.receipt .c { text-align: center; }
.receipt hr { border: 0; border-top: 1.5px dashed #9c978b; margin: 10px 0; }
.receipt .r { display: flex; justify-content: space-between; gap: 10px; }
.receipt .big { font: 900 36px/1.1 var(--cond); font-stretch: 70%; text-align: center; margin: 6px 0; }
.receipt a { color: inherit; word-break: break-all; }
.receipt .share { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.receipt .share button, .receipt .share a {
  height: 40px; display: grid; place-items: center; border-radius: 6px; text-decoration: none;
  font: 800 13px var(--cond); font-stretch: 75%; letter-spacing: 0.16em; text-transform: uppercase;
}
.receipt .share .x { grid-column: 1 / -1; background: #22201c; color: #fbfaf4; border: 0; }
.receipt .share .ghost { background: none; border: 1.5px dashed #22201c; color: #22201c; }
.receipt .tear { margin-top: 8px; width: 100%; height: 40px; border: 1.5px solid #22201c; background: none; border-radius: 6px; font: 800 13px var(--cond); font-stretch: 75%; letter-spacing: 0.2em; text-transform: uppercase; }

/* toasts: little printed tags */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast {
  max-width: min(360px, calc(100vw - 32px)); padding: 10px 14px; border-radius: 4px;
  background: #121110; color: #f2f0ea; font: 500 13px var(--mono);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5); border-left: 4px solid var(--orange);
  animation: tag 0.35s cubic-bezier(.2, 1.3, .4, 1);
}
.toast.good { border-left-color: var(--green); }
.toast b { color: #fff; }
.toast a { color: var(--nixie); }
@keyframes tag { from { transform: translateX(30px) rotate(3deg); opacity: 0; } }

/* -------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  .device { padding: 16px 14px 14px; border-radius: 22px; }
  .strip { flex-wrap: wrap; gap: 12px 14px; padding: 6px 8px 14px; }
  .stickers { order: 5; flex-basis: 100%; justify-content: flex-start; min-height: 0; }
  .dymo { margin-left: auto; max-width: 52vw; }
  .panel {
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: 'port lever' 'gauge gauge' 'lcd lcd' 'earn earn' 'fuel fuel' 'knob card' 'flap flap';
  }
  .lever { min-height: 200px; }
  .knob-ring { transform: scale(0.9); }
  .lcd-line { font-size: 15px; }
  .key { width: 84px; }
  .man-cols, .ops { grid-template-columns: 1fr; gap: 18px; }
  .sky { padding-bottom: 130px; min-height: 0; }
  .sky-stats { gap: 10px; font-size: 11px; }
  .sky-stats .hide-sm { display: none; }
  .lede { font-size: 15px; }
  .device { margin-top: -110px; }
  .grid-strip { flex-wrap: wrap; justify-content: center; border-radius: 16px; }
  .man-stamp { width: 74px; height: 74px; font-size: 11px; }
}
@media (max-width: 520px) {
  .panel { grid-template-areas: 'port lever' 'gauge gauge' 'lcd lcd' 'earn earn' 'fuel fuel' 'knob knob' 'card card' 'flap flap'; }
  .leds { gap: 10px; }
  .plate b { font-size: 18px; }
  .earn-row { gap: 12px; }
  .nixie { gap: 3px; }
  .nx-cur { font-size: 30px; }
  .stamp { font-size: 12px; right: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
