/* Imaginarium — Studio-Room aesthetic.
   Physical-studio framing: companion = recording booth, tv = screening
   room, tv-join = hallway of doors, admin = mixing console.
   Color palette: dark wood, brass, chrome, record-red, label cream. */

:root {
  --wood-dark: #3a2418;
  --wood-mid: #5a3a26;
  --wood-light: #7a5238;
  --wood-grain: #2c1b11;
  --metal-light: #d8d4cc;
  --metal-mid: #8a8680;
  --metal-dark: #4a4640;
  --panel-grey: #6a6660;
  --panel-grey-dark: #3a3630;
  --brass: #c89640;
  --brass-light: #e8c878;
  --brass-dark: #8a6420;
  --record-red: #d22020;
  --record-glow: #ff4040;
  --foam-grey: #2a2a2c;
  --curtain-red: #5c1818;
  --curtain-dark: #2a0a0a;
  --screen-bg: #0a0a08;
  --led-green: #4aff4a;
  --led-amber: #ffaa30;
  --led-red: #ff4040;
  --ink: #1a1410;
  --label-cream: #ece4d2;
  --label-ink: #2a2018;
  --door-mid: #6a3a1c;
  --door-light: #8a4e26;
  --door-shadow: #2a1408;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }

[hidden] { display: none !important; }

body {
  font-family: system-ui, sans-serif;
  color: var(--label-cream);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
/* Defense-in-depth: kid presses-and-holds the mic frequently; nothing on
   the companion page should be selectable. */
body.companion, body.companion * {
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  user-select: none;
}

/* ============================= COMPANION PAGE (recording booth) ============================= */

body.companion {
  background:
    radial-gradient(ellipse 70% 60% at 50% 30%, rgba(0,0,0,0) 0%, rgba(0,0,0,0.55) 100%),
    repeating-linear-gradient(90deg,
      var(--wood-dark) 0px,
      var(--wood-dark) 96px,
      var(--wood-grain) 96px,
      var(--wood-grain) 98px),
    var(--wood-dark);
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 1.2rem 0.75rem 3rem;
}

.stage {
  width: 100%;
  max-width: 22rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.9rem;
  text-align: center;
  position: relative;
}

/* ON-AIR header strip */
.on-air {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  background: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%);
  border: 1px solid #000;
  border-top: 1px solid #333;
  border-radius: 0.3rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 2px 0 rgba(0,0,0,0.5);
}
.on-air__light {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--record-glow), var(--record-red) 50%, #5a0808);
  box-shadow: 0 0 8px var(--record-red), inset 0 -1px 2px rgba(0,0,0,0.5);
  flex-shrink: 0;
}
.on-air__text {
  font-family: Menlo, Consolas, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  color: var(--record-glow);
  font-weight: 700;
  text-transform: uppercase;
}
.on-air__spacer { flex: 1; }
.on-air__meter { display: flex; gap: 2px; align-items: flex-end; height: 1rem; }
.on-air__meter span { width: 3px; background: #2a8a30; border-radius: 1px; }
.on-air__meter span:nth-child(1) { height: 30%; }
.on-air__meter span:nth-child(2) { height: 55%; }
.on-air__meter span:nth-child(3) { height: 70%; background: #8aa830; }
.on-air__meter span:nth-child(4) { height: 85%; background: #c8a020; }
.on-air__meter span:nth-child(5) { height: 95%; background: var(--record-red); }

/* Room badge — restyled as brass studio plate */
.room-badge {
  appearance: none;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(180deg, var(--brass-light) 0%, var(--brass) 40%, var(--brass-dark) 100%);
  border: 2px solid var(--brass-dark);
  border-radius: 0.3rem;
  color: var(--label-ink);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.4),
    inset 0 -1px 0 rgba(0,0,0,0.2),
    0 2px 4px rgba(0,0,0,0.4);
  cursor: pointer;
  font-family: Georgia, serif;
  position: relative;
  transition: transform 100ms ease;
}
.room-badge:hover { transform: translateY(-1px); }
.room-badge::before, .room-badge::after {
  content: "";
  position: absolute;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff8d8, var(--brass-dark));
  top: 50%; transform: translateY(-50%);
}
.room-badge::before { left: 4px; }
.room-badge::after { right: 4px; }
.room-badge__caption {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--label-ink);
  opacity: 0.75;
}
.room-badge__code {
  font-size: 1.4rem;
  font-weight: 700;
  font-family: Menlo, Consolas, monospace;
  color: var(--label-ink);
}
.room-badge__icon { font-size: 0.85rem; opacity: 0.6; }
.room-badge__hint {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.4rem);
  transform: translateX(-50%);
  background: var(--label-ink);
  color: var(--led-green);
  padding: 0.25rem 0.6rem;
  border-radius: 0.3rem;
  font-family: Menlo, Consolas, monospace;
  font-size: 0.78rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease;
  border: 1px solid #000;
}
.room-badge__hint.is-visible { opacity: 1; }

/* Marquee title */
.title {
  margin: 0;
  text-align: center;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 1.55rem;
  color: var(--label-cream);
  text-shadow: 0 2px 0 rgba(0,0,0,0.5), 0 0 12px rgba(232,200,120,0.2);
  letter-spacing: 0.02em;
}

/* TV invite — paper "patch" on the booth wall */
.tv-invite {
  position: relative;
  background: linear-gradient(180deg, #f2ead2 0%, #e2d6b2 100%);
  border: 1px solid #8a7440;
  border-radius: 0.35rem;
  padding: 0.85rem 1rem 0.75rem;
  color: var(--label-ink);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.5),
    0 4px 8px rgba(0,0,0,0.4);
  font-family: Georgia, serif;
  text-align: left;
}
.tv-invite::before {
  content: "";
  position: absolute;
  top: -0.4rem;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 3rem; height: 0.7rem;
  background: rgba(220, 200, 150, 0.55);
  border: 1px solid rgba(140, 110, 60, 0.3);
  border-radius: 1px;
}
.tv-invite__dismiss {
  position: absolute;
  top: 0.3rem;
  right: 0.45rem;
  width: 1.6rem; height: 1.6rem;
  background: transparent;
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: 50%;
  color: var(--label-ink);
  font-size: 0.8rem;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tv-invite__dismiss:hover { background: rgba(0,0,0,0.06); }
.tv-invite__title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--label-ink);
}
.tv-invite__hint {
  margin: 0;
  font-size: 0.8rem;
  color: #4a3a26;
  line-height: 1.4;
}
.tv-invite__url-row { margin-top: 0.1rem; }
.tv-invite__url {
  display: block;
  background: var(--label-ink);
  color: #b8e8b8;
  border-radius: 0.2rem;
  padding: 0.4rem 0.55rem;
  font-family: Menlo, Consolas, monospace;
  font-size: 0.78rem;
  word-break: break-all;
  border: 1px solid #000;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}
.tv-invite__actions {
  display: flex;
  gap: 0.4rem;
}
.tv-invite__btn {
  appearance: none;
  text-decoration: none;
  flex: 1 1 6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.7rem;
  font-family: Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  color: var(--label-ink);
  border-radius: 0.25rem;
  border: 1px solid var(--brass-dark);
  background: linear-gradient(180deg, var(--brass-light), var(--brass) 50%, var(--brass-dark));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 2px 0 rgba(0,0,0,0.3);
}
.tv-invite__btn--primary { /* same as default brass */ }
.tv-invite__btn--ghost {
  background: linear-gradient(180deg, var(--metal-light), var(--metal-mid));
  color: var(--label-ink);
  border-color: var(--metal-dark);
}
.tv-invite__status {
  margin: 0;
  min-height: 1rem;
  font-size: 0.74rem;
  color: #4a3a26;
  font-style: italic;
}
.tv-invite__status.is-good { color: #2a6a20; }
.tv-invite__status.is-warn { color: #8a3a20; }

/* Instructions */
.instructions {
  margin: 0.1rem 0;
  text-align: center;
  font-size: 0.92rem;
  color: var(--label-cream);
  line-height: 1.4;
  opacity: 0.9;
  font-family: Georgia, serif;
}

/* Style picker — "Style Selector" panel with knob */
.style-picker {
  background: linear-gradient(180deg, var(--metal-light) 0%, #b0aca4 50%, var(--metal-mid) 100%);
  border: 1px solid var(--metal-dark);
  border-radius: 0.3rem;
  padding: 0.7rem 0.75rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 2px 4px rgba(0,0,0,0.4);
  position: relative;
}
.style-picker::before, .style-picker::after {
  content: "";
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #888, #222);
  top: 6px;
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.6);
}
.style-picker::before { left: 6px; }
.style-picker::after { right: 6px; }
.style-picker__caption {
  text-align: center;
  font-family: Menlo, Consolas, monospace;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--metal-dark);
  font-weight: 700;
}
.style-picker__row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.style-picker__knob {
  flex-shrink: 0;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, #6a6660, #2a2624 70%),
    var(--metal-dark);
  border: 2px solid var(--metal-dark);
  position: relative;
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.2),
    inset 0 -2px 2px rgba(0,0,0,0.5),
    0 1px 2px rgba(0,0,0,0.4);
}
.style-picker__knob::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%) rotate(35deg);
  transform-origin: center 0.9rem;
  width: 2px;
  height: 0.6rem;
  background: var(--brass-light);
  border-radius: 1px;
  box-shadow: 0 0 3px var(--brass);
}
.style-picker__select {
  flex: 1;
  appearance: none;
  -webkit-appearance: none;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--metal-dark);
  border-radius: 0.2rem;
  background: var(--label-ink);
  color: var(--brass-light);
  font-family: Menlo, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.6);
  text-align: center;
}
.style-picker__select option {
  background: var(--label-ink);
  color: var(--brass-light);
}
.apply-style {
  appearance: none;
  align-self: stretch;
  padding: 0.42rem 0.7rem;
  background: linear-gradient(180deg, #555, #2c2c2c);
  border: 1px solid #111;
  border-radius: 0.2rem;
  font: inherit;
  font-family: Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--metal-light);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
  transition: opacity 200ms ease;
}
.apply-style:not(:disabled):hover {
  background: linear-gradient(180deg, #666, #353535);
}
.apply-style:disabled { opacity: 0.45; cursor: not-allowed; }
.apply-style.is-busy { opacity: 0.7; cursor: progress; }
.apply-style__icon { font-size: 0.9rem; }

/* THE MICROPHONE — centerpiece, in a curtain rig with a chunky brass
   nameplate at the bottom that reads as the primary CTA. */
.mic {
  appearance: none;
  border: 2px solid var(--brass-dark);
  align-self: center;
  width: 15rem;
  min-height: 18rem;
  margin: 0.3rem 0 0.2rem;
  padding: 0 0 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(0,0,0,0.5), transparent 60%),
    repeating-linear-gradient(90deg,
      var(--curtain-red) 0px,
      var(--curtain-dark) 14px,
      var(--curtain-red) 28px);
  border-radius: 0.4rem;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  box-shadow:
    inset 0 6px 12px rgba(0,0,0,0.6),
    inset 0 -2px 8px rgba(0,0,0,0.4),
    0 6px 0 #000,
    0 12px 24px rgba(0,0,0,0.5),
    0 0 0 4px rgba(232, 200, 120, 0.0);
  transition: transform 120ms ease, box-shadow 250ms ease;
  outline: none;
}
.mic:hover {
  box-shadow:
    inset 0 6px 12px rgba(0,0,0,0.6),
    inset 0 -2px 8px rgba(0,0,0,0.4),
    0 6px 0 #000,
    0 12px 24px rgba(0,0,0,0.5),
    0 0 0 4px rgba(232, 200, 120, 0.4);
}
.mic:focus-visible {
  box-shadow:
    inset 0 6px 12px rgba(0,0,0,0.6),
    inset 0 -2px 8px rgba(0,0,0,0.4),
    0 6px 0 #000,
    0 12px 24px rgba(0,0,0,0.5),
    0 0 0 4px var(--brass-light);
}
.mic:active {
  transform: translateY(3px);
  box-shadow:
    inset 0 6px 12px rgba(0,0,0,0.6),
    inset 0 -2px 8px rgba(0,0,0,0.4),
    0 3px 0 #000,
    0 6px 12px rgba(0,0,0,0.5),
    0 0 0 4px rgba(255, 64, 64, 0.5);
}
.mic.is-recording { animation: studio-pulse 1.3s ease-in-out infinite; }
.mic.is-disabled { filter: grayscale(60%) brightness(0.6); cursor: not-allowed; }

.mic__star {
  width: 100%;
  flex: 1;
  min-height: 14rem;
  fill: none;
  display: block;
  pointer-events: none;
}

/* Chunky brass nameplate at the bottom — the "this is a button" cue */
.mic__label {
  display: block;
  margin: 0 -2px -2px;  /* extend to the border edge */
  padding: 0.65rem 0.7rem 0.7rem;
  background:
    linear-gradient(180deg, var(--brass-light) 0%, var(--brass) 45%, var(--brass-dark) 100%);
  border-top: 2px solid var(--brass-dark);
  border-radius: 0 0 0.35rem 0.35rem;
  font-family: Menlo, Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--label-ink);
  text-shadow: 0 1px 0 rgba(255,255,255,0.3);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
  pointer-events: none;
  position: relative;
}
.mic__label::before,
.mic__label::after {
  content: "";
  position: absolute;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff8d8, var(--brass-dark));
  top: 50%; transform: translateY(-50%);
  box-shadow: inset 0 -1px 1px rgba(0,0,0,0.3);
}
.mic__label::before { left: 5px; }
.mic__label::after { right: 5px; }
.mic.is-recording .mic__label {
  background: linear-gradient(180deg, #ff8a8a 0%, var(--record-red) 50%, #6a0808 100%);
  color: #fff8d8;
  text-shadow: 0 1px 0 rgba(0,0,0,0.3);
}

@keyframes studio-pulse {
  0%, 100% {
    box-shadow:
      inset 0 6px 12px rgba(0,0,0,0.6),
      inset 0 -2px 8px rgba(0,0,0,0.4),
      0 6px 0 #000,
      0 12px 24px rgba(0,0,0,0.5),
      0 0 0 4px rgba(255, 64, 64, 0);
  }
  50% {
    box-shadow:
      inset 0 6px 12px rgba(0,0,0,0.6),
      inset 0 -2px 8px rgba(0,0,0,0.4),
      0 6px 0 #000,
      0 12px 24px rgba(0,0,0,0.5),
      0 0 0 6px rgba(255, 64, 64, 0.5);
  }
}

/* Idle attention-grab: subtle brass-rim shimmer pulsing once every few
   seconds so the kid's eye lands on it. Pauses when recording. */
@keyframes mic-idle-shimmer {
  0%, 92%, 100% { filter: brightness(1); }
  95% { filter: brightness(1.06); }
}
.mic:not(.is-recording):not(.is-disabled) .mic__label {
  animation: mic-idle-shimmer 5s ease-in-out infinite;
}

/* Restyle button — patch-cable toggle */
.restyle {
  appearance: none;
  align-self: center;
  padding: 0.45rem 1rem;
  border: 1px solid var(--metal-dark);
  border-radius: 0.2rem;
  background: linear-gradient(180deg, var(--metal-light), var(--metal-mid));
  color: var(--label-ink);
  font-family: Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
  outline: none;
  transition: filter 150ms ease;
}
.restyle:not(:disabled):hover { filter: brightness(1.08); }
.restyle:disabled { opacity: 0.45; cursor: not-allowed; }
.restyle.is-busy { opacity: 0.7; cursor: progress; }
.restyle__icon { font-size: 0.9rem; }

/* Status line — LCD readout. Hidden when empty so the strip doesn't
   show a blank green box in idle state (kid sees the brass nameplate
   "HOLD TO TALK" already; we only need transient status). */
.status {
  margin: 0;
  min-height: 1.7rem;
  padding: 0.35rem 0.6rem;
  text-align: center;
  background: var(--label-ink);
  border: 1px solid #000;
  border-radius: 0.2rem;
  color: var(--led-green);
  font-family: Menlo, Consolas, monospace;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.7), 0 0 4px rgba(74, 255, 74, 0.12);
  transition: color 200ms ease;
}
.status:empty { display: none; }
.status.is-good { color: var(--led-green); }
.status.is-warn { color: var(--led-amber); }
.status.is-error { color: var(--led-red); }

/* Random Idea Jack — brass-fronted module */
.samples {
  align-self: stretch;
  background: linear-gradient(180deg, #4a4640 0%, #2a2624 100%);
  border: 1px solid #000;
  border-radius: 0.25rem;
  padding: 0.55rem 0.7rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}
.samples__caption {
  font-family: Menlo, Consolas, monospace;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--metal-light);
  opacity: 0.8;
  text-align: center;
}
.samples__try-btn {
  appearance: none;
  padding: 0.55rem 1rem;
  background: linear-gradient(180deg, var(--brass-light), var(--brass) 50%, var(--brass-dark));
  border: 1px solid var(--brass-dark);
  border-radius: 0.25rem;
  color: var(--label-ink);
  font-family: Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 2px 0 rgba(0,0,0,0.4);
}
.samples__try-btn:not(:disabled):hover { filter: brightness(1.05); }
.samples__try-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.samples__try-btn.is-busy { opacity: 0.65; cursor: progress; }
.samples__hint {
  margin: 0;
  min-height: 1rem;
  font-size: 0.78rem;
  color: var(--brass-light);
  text-align: center;
  font-family: Georgia, serif;
  font-style: italic;
}

/* ============================= TV PAGE (CRT bezel, no curtains) ============================= */

body.tv {
  background: #000;
  overflow: hidden;
}

.tv-stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

/* CRT bezel — full canvas, image fills the viewport with just a chrome strip
   around it for the studio framing (ON-AIR + Studio plate + corner screws). */
.crt-frame {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #2a2624 0%, #181614 100%);
  border-radius: 0;
  padding: 1.1rem 1.1rem 1.9rem;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.08),
    inset 0 -4px 0 rgba(0,0,0,0.5);
  border: 2px solid #0a0a0a;
  z-index: 4;
}
.crt-frame::before,
.crt-frame::after,
.crt-frame > .crt-frame__screw {
  content: "";
  position: absolute;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #aaa 0%, #555 50%, #222 100%);
  box-shadow: inset 0 -1px 1px rgba(0,0,0,0.5), 0 1px 1px rgba(0,0,0,0.5);
}
.crt-frame::before { left: 10px; bottom: 10px; }
.crt-frame::after { right: 10px; bottom: 10px; }
.crt-frame__screw--tl { top: 10px; left: 10px; }
.crt-frame__screw--tr { top: 10px; right: 10px; }

.crt-on-air {
  position: absolute;
  top: 0.7rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  background: linear-gradient(180deg, #1a1a1a, #050505);
  border: 1px solid #000;
  border-radius: 999px;
  z-index: 2;
}
.crt-on-air__light {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--record-glow), var(--record-red) 50%, #5a0808);
  box-shadow: 0 0 6px var(--record-red);
}
.crt-on-air__text {
  font-family: Menlo, Consolas, monospace;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  color: var(--record-glow);
  font-weight: 700;
  text-transform: uppercase;
}

.crt-plate {
  position: absolute;
  bottom: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.25rem 1.2rem;
  background: linear-gradient(180deg, var(--brass-light), var(--brass) 50%, var(--brass-dark));
  border: 1px solid var(--brass-dark);
  border-radius: 0.2rem;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--label-ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 1px 2px rgba(0,0,0,0.5);
  letter-spacing: 0.05em;
  z-index: 2;
}

.tv-screen {
  position: absolute;
  inset: 1.1rem 1.1rem 1.9rem 1.1rem;
  background: var(--screen-bg);
  border-radius: 0.4rem;
  overflow: hidden;
  box-shadow:
    inset 0 0 80px rgba(0, 0, 0, 0.9),
    inset 0 0 4px rgba(0, 0, 0, 0.8);
}
.tv-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg,
      rgba(255,255,255,0.025) 0px,
      rgba(255,255,255,0.025) 1px,
      transparent 1px,
      transparent 3px);
  pointer-events: none;
  z-index: 2;
}
.tv-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 25% 15%, rgba(255,255,255,0.06), transparent 40%),
    radial-gradient(ellipse at 50% 50%, transparent 60%, rgba(0,0,0,0.4) 100%);
  pointer-events: none;
  z-index: 3;
}

.tv-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
  z-index: 1;
  transition: opacity 600ms ease;
}
.tv-placeholder h1 {
  margin: 0 0 0.8rem;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: clamp(2rem, 7vw, 4.4rem);
  color: var(--brass-light);
  letter-spacing: 0.02em;
  text-shadow: 0 0 24px rgba(232,200,120,0.35), 0 2px 0 rgba(0,0,0,0.6);
}
.tv-placeholder p {
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: rgba(232, 228, 220, 0.7);
  letter-spacing: 0.04em;
}
.tv-placeholder::before {
  content: "NOW SHOWING";
  position: absolute;
  top: 1.8rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: Menlo, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  color: var(--brass);
  opacity: 0.6;
}
.tv-placeholder.is-hidden { opacity: 0; pointer-events: none; }

.tv-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: var(--screen-bg);
  opacity: 0;
  transition: opacity 350ms ease;
}
.tv-img.is-visible { opacity: 1; }

.tv-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 1.4rem 2rem 1.6rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  color: var(--label-cream);
  text-align: center;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: clamp(1rem, 2vw, 1.4rem);
  letter-spacing: 0.02em;
  text-shadow: 0 2px 8px rgba(0,0,0,0.95);
  opacity: 0;
  transition: opacity 350ms ease;
  pointer-events: none;
  z-index: 4;
}
.tv-caption.is-visible { opacity: 1; }

.tv-idle-badge {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  background: linear-gradient(180deg, #1a1a1a, #0a0a0a);
  color: var(--brass-light);
  border: 1px solid var(--brass-dark);
  border-radius: 999px;
  font-family: Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  z-index: 4;
  box-shadow: 0 2px 8px rgba(0,0,0,0.6);
  opacity: 0;
  transition: opacity 400ms ease;
}
.tv-idle-badge.is-visible { opacity: 1; }
.tv-idle-badge::before {
  content: "";
  display: inline-block;
  width: 0.55rem; height: 0.55rem;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--led-amber), #c87020);
  box-shadow: 0 0 6px #c87020;
  margin-right: 0.1rem;
}

.tv-closed-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 5, 0.78);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  opacity: 0;
  transition: opacity 600ms ease;
  pointer-events: none;
}
.tv-closed-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.tv-stage.is-closed .tv-img.is-visible { opacity: 0.3; }

.tv-closed-overlay__card {
  width: min(28rem, 80%);
  background: linear-gradient(180deg, #f2ead2 0%, #e2d6b2 100%);
  border: 3px solid var(--brass-dark);
  border-radius: 0.4rem;
  padding: 2.2rem 2.2rem 1.7rem;
  text-align: center;
  color: var(--label-ink);
  font-family: Georgia, serif;
  box-shadow: 0 12px 36px rgba(0,0,0,0.7);
  position: relative;
}
.tv-closed-overlay__card::before {
  content: "";
  position: absolute;
  top: -1px; left: 0; right: 0;
  height: 14px;
  background: radial-gradient(circle at 12px 7px, #050505 4px, transparent 4.5px) repeat-x;
  background-size: 24px 14px;
}
.tv-closed-overlay__card::after {
  content: "";
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 14px;
  background: radial-gradient(circle at 12px 7px, #050505 4px, transparent 4.5px) repeat-x;
  background-size: 24px 14px;
}
.tv-closed-overlay__caption {
  margin: 0.4rem 0 0.6rem;
  font-family: Menlo, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  color: var(--brass-dark);
  text-transform: uppercase;
}
.tv-closed-overlay__title {
  margin: 0;
  font-size: 1.7rem;
  font-style: italic;
  color: var(--label-ink);
}
.tv-closed-overlay__title #closed-code { font-family: Menlo, Consolas, monospace; font-style: normal; }
.tv-closed-overlay__desc {
  margin: 0.5rem 0 1.4rem;
  font-size: 1rem;
  color: #4a3a26;
}
.tv-closed-overlay__actions {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
}
.tv-closed-overlay__btn {
  appearance: none;
  padding: 0.55rem 1.2rem;
  border: 1px solid var(--brass-dark);
  border-radius: 0.25rem;
  font-family: Menlo, Consolas, monospace;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 2px 0 rgba(0,0,0,0.3);
}
.tv-closed-overlay__btn--primary {
  background: linear-gradient(180deg, var(--brass-light), var(--brass) 50%, var(--brass-dark));
  color: var(--label-ink);
}
.tv-closed-overlay__btn--ghost {
  background: linear-gradient(180deg, #ece4d2, #b8b0a0);
  color: var(--label-ink);
  border-color: var(--metal-dark);
}
.tv-closed-overlay__btn:focus-visible {
  outline: 2px solid var(--brass-light);
  outline-offset: 2px;
}

/* ============================= TV JOIN (hallway of doors) ============================= */

body.tv-join {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(0,0,0,0) 0%, rgba(0,0,0,0.55) 100%),
    repeating-linear-gradient(90deg,
      var(--wood-dark) 0px,
      var(--wood-dark) 110px,
      var(--wood-grain) 110px,
      var(--wood-grain) 112px),
    var(--wood-dark);
  min-height: 100dvh;
  padding: 2rem 1rem 4rem;
  display: flex;
  justify-content: center;
}

.join-stage {
  width: 100%;
  max-width: 42rem;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

.join-header { text-align: center; }
.join-title {
  margin: 0;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: clamp(2rem, 5vw, 2.8rem);
  color: var(--label-cream);
  text-shadow: 0 2px 0 rgba(0,0,0,0.5), 0 0 12px rgba(232,200,120,0.2);
}
.join-sub {
  margin: 0.5rem 0 0;
  color: rgba(232, 228, 220, 0.7);
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 1rem;
}

/* Keypad — manual code entry */
.join-manual {
  background: linear-gradient(180deg, var(--metal-light) 0%, #b0aca4 50%, var(--metal-mid) 100%);
  border: 1px solid var(--metal-dark);
  border-radius: 0.3rem;
  padding: 0.85rem 1rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), 0 3px 6px rgba(0,0,0,0.4);
  position: relative;
}
.join-manual::before, .join-manual::after {
  content: "";
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #888, #222);
  top: 7px;
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.6);
}
.join-manual::before { left: 7px; }
.join-manual::after { right: 7px; }
.join-manual__label {
  font-family: Menlo, Consolas, monospace;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  /* Compensate for letter-spacing's trailing space so the rendered text
     centers correctly (same fix as .join-manual__input below). */
  text-indent: 0.25em;
  text-transform: uppercase;
  color: var(--metal-dark);
  font-weight: 700;
  text-align: center;
}
.join-manual__row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
/* Group label + input together so the label centers over the same
   horizontal extent the input occupies (not the form's full width).
   That keeps "OR TYPE A CODE" stacked directly above "000". */
.join-manual__input-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}
.join-manual__input {
  /* width:100% — the input lives inside a flex-column .join-manual__input-col
     so we can't rely on row-flex `flex:1` to size it horizontally; explicit
     full-width ensures the input fills the col so text-align:center lands
     at the same x as the label above. min-width:0 lets it shrink below
     its intrinsic ~20ch default. */
  width: 100%;
  min-width: 0;
  background: var(--label-ink);
  border: 1px solid #000;
  border-radius: 0.2rem;
  color: var(--led-green);
  font-family: Menlo, Consolas, monospace;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.18em;
  /* letter-spacing adds trailing space after the last char, which makes
     text-align:center visually shift the run leftward. Match it with a
     text-indent so "000" actually looks centered. */
  text-indent: 0.18em;
  padding: 0.55rem 0.9rem;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.7), 0 0 4px rgba(74, 255, 74, 0.12);
}
.join-manual__input.is-invalid {
  color: var(--led-red);
  animation: join-shake 250ms ease;
}
@keyframes join-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.join-manual__btn {
  appearance: none;
  /* Bottom-align with the LCD input AND match its height so the
     pair reads as one row. Without min-height the Go button is 9px
     shorter than the input (smaller font), which made its top look
     lower than the input's top. */
  align-self: flex-end;
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--brass-light), var(--brass) 50%, var(--brass-dark));
  color: var(--label-ink);
  border: 1px solid var(--brass-dark);
  border-radius: 0.25rem;
  padding: 0 1.4rem;
  font-family: Menlo, Consolas, monospace;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 2px 0 rgba(0,0,0,0.3);
}

/* Corridor sign + section */
.join-section {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.join-section__title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0.4rem 0.6rem;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(232, 200, 120, 0.25);
  border-radius: 0.3rem;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--brass-light);
  letter-spacing: 0.04em;
}
.join-section__title::before {
  content: "";
  width: 0.55rem; height: 0.55rem;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--led-green), #2a8a30);
  box-shadow: 0 0 6px var(--led-green);
}
.join-section__title--amber::before {
  background: radial-gradient(circle at 30% 30%, var(--led-amber), #c87020);
  box-shadow: 0 0 6px #c87020;
}
.join-section__hint {
  margin: 0;
  color: rgba(232, 228, 220, 0.7);
  font-size: 0.85rem;
  font-family: Georgia, serif;
  font-style: italic;
}
.join-section__hint code {
  font-family: Menlo, Consolas, monospace;
  background: rgba(255,255,255,0.08);
  padding: 0.05rem 0.4rem;
  border-radius: 0.25rem;
}

/* Door grid */
.join-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.9rem;
}
.join-list__item { display: block; }

.join-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(180deg, var(--door-light) 0%, var(--door-mid) 50%, var(--door-shadow) 100%);
  border: 2px solid var(--door-shadow);
  border-radius: 0.3rem 0.3rem 0.2rem 0.2rem;
  padding: 0.9rem 0.8rem 0.8rem;
  min-height: 9rem;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.15),
    inset 0 -2px 0 rgba(0,0,0,0.4),
    0 4px 8px rgba(0,0,0,0.5);
  transition: transform 100ms ease;
}
.join-card:hover { transform: translateY(-2px); }
.join-card::before {
  content: "";
  position: absolute;
  inset: 8px 12px 28px 12px;
  border: 1px solid rgba(0,0,0,0.4);
  border-radius: 0.15rem;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}
.join-card::after {
  content: "";
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.7rem; height: 0.7rem;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--brass-light), var(--brass) 50%, var(--brass-dark));
  box-shadow: 0 1px 1px rgba(0,0,0,0.5);
}
.join-card__plate {
  align-self: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(180deg, var(--brass-light) 0%, var(--brass) 40%, var(--brass-dark) 100%);
  border: 2px solid var(--brass-dark);
  border-radius: 0.25rem;
  padding: 0.4rem 1rem 0.5rem;
  color: var(--label-ink);
  margin-top: 0.4rem;
  min-width: 6rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 2px 4px rgba(0,0,0,0.5);
}
.join-card__plate::before, .join-card__plate::after {
  content: "";
  position: absolute;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff8d8, var(--brass-dark));
  top: 50%; transform: translateY(-50%);
}
.join-card__plate::before { left: 3px; }
.join-card__plate::after { right: 3px; }
.join-card__caption {
  font-family: Menlo, Consolas, monospace;
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--label-ink);
  opacity: 0.7;
}
.join-card__code {
  font-family: Menlo, Consolas, monospace;
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--label-ink);
  letter-spacing: 0.04em;
  line-height: 1.1;
}
.join-card__meta {
  margin: 0.5rem 0 0;
  text-align: center;
  font-family: Menlo, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--label-cream);
  text-shadow: 0 1px 0 rgba(0,0,0,0.5);
  opacity: 0.85;
}
.join-card__status-light {
  position: absolute;
  top: 0.5rem;
  left: 0.6rem;
  width: 0.5rem; height: 0.5rem;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--led-green), #2a8a30);
  box-shadow: 0 0 5px var(--led-green);
}

.join-empty {
  margin: 0;
  padding: 1rem 1.2rem;
  border: 2px dashed rgba(232, 200, 120, 0.3);
  border-radius: 0.3rem;
  color: rgba(232, 228, 220, 0.65);
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 0.9rem;
  text-align: center;
  background: rgba(0,0,0,0.25);
}

/* ============================= ADMIN PAGE (mixing console) ============================= */

body.admin {
  background:
    radial-gradient(ellipse at 50% 25%, rgba(0,0,0,0) 0%, rgba(0,0,0,0.6) 100%),
    repeating-linear-gradient(90deg,
      var(--wood-dark) 0px,
      var(--wood-dark) 100px,
      var(--wood-grain) 100px,
      var(--wood-grain) 102px),
    var(--wood-dark);
  min-height: 100dvh;
  padding: 2rem 1rem 4rem;
  display: flex;
  justify-content: center;
}

.admin-stage {
  width: 100%;
  max-width: 44rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.admin-header { text-align: center; position: relative; }
.admin-title {
  margin: 0;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  color: var(--label-cream);
  text-shadow: 0 2px 0 rgba(0,0,0,0.5), 0 0 12px rgba(232,200,120,0.2);
}
.admin-sub {
  margin: 0.5rem 0 0;
  color: rgba(232, 228, 220, 0.7);
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 0.95rem;
}

/* Decorative VU strip below header */
.admin-vu-strip {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 0.75rem;
  padding: 0.5rem 0.8rem;
  background: linear-gradient(180deg, #1a1a1a, #050505);
  border: 1px solid #000;
  border-radius: 0.3rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.admin-vu {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 1.4rem;
}
.admin-vu span {
  width: 4px;
  border-radius: 1px;
}
.admin-vu span:nth-child(1) { height: 25%; background: #2a8a30; }
.admin-vu span:nth-child(2) { height: 40%; background: #2a8a30; }
.admin-vu span:nth-child(3) { height: 55%; background: var(--led-green); }
.admin-vu span:nth-child(4) { height: 70%; background: #8aa830; }
.admin-vu span:nth-child(5) { height: 80%; background: var(--led-amber); }
.admin-vu span:nth-child(6) { height: 92%; background: var(--led-red); }

/* Console panel = each admin-form / section */
.admin-form {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: linear-gradient(180deg, var(--panel-grey) 0%, var(--panel-grey-dark) 100%);
  border: 1px solid #1a1a1a;
  border-radius: 0.4rem;
  padding: 1.4rem 1.2rem 1.2rem;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 -2px 0 rgba(0,0,0,0.4),
    0 4px 8px rgba(0,0,0,0.5);
}
.admin-form::before, .admin-form::after {
  content: "";
  position: absolute;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #aaa 0%, #555 50%, #222 100%);
  box-shadow: inset 0 -1px 1px rgba(0,0,0,0.5), 0 1px 1px rgba(0,0,0,0.5);
  top: 8px;
}
.admin-form::before { left: 8px; }
.admin-form::after { right: 8px; }

.admin-section-title {
  margin: 0;
  padding: 0.3rem 0.6rem;
  font-family: Menlo, Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass-light);
  background: rgba(0,0,0,0.45);
  border: 1px solid #000;
  border-radius: 0.2rem;
  align-self: flex-start;
}

.admin-field {
  border: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.admin-field > label,
.admin-field > label:first-child {
  font-family: Menlo, Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--label-cream);
}
.admin-hint {
  margin: 0;
  color: rgba(232, 228, 220, 0.6);
  font-family: Georgia, serif;
  font-size: 0.78rem;
  line-height: 1.4;
}
.admin-hint.is-good { color: var(--led-green); }

.admin-row {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}
.admin-row--gap > .admin-mini {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-family: Menlo, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--label-cream);
  opacity: 0.85;
}

/* Inputs / selects styled as console controls */
.admin-form input[type="text"],
.admin-form input[type="number"],
.admin-form select,
.admin-form textarea {
  background: var(--label-ink);
  border: 1px solid #000;
  border-radius: 0.2rem;
  padding: 0.4rem 0.55rem;
  color: var(--led-green);
  font-family: Menlo, Consolas, monospace;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.6);
}
.admin-form select option { background: var(--label-ink); color: var(--led-green); }
.admin-form input[type="number"] { width: 5rem; text-align: center; font-weight: 700; }
.admin-form textarea {
  width: 100%;
  min-height: 10rem;
  resize: vertical;
}

/* Range sliders as faders */
.admin-form input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  flex: 1;
  height: 1.4rem;
  background: transparent;
}
.admin-form input[type="range"]::-webkit-slider-runnable-track {
  height: 0.5rem;
  background: linear-gradient(180deg, #1a1614, #2a2624);
  border: 1px solid #000;
  border-radius: 999px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.7);
}
.admin-form input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  margin-top: -0.5rem;
  width: 1.2rem;
  height: 1.4rem;
  background: linear-gradient(180deg, var(--metal-light) 0%, var(--metal-mid) 100%);
  border: 1px solid var(--metal-dark);
  border-radius: 0.2rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), 0 2px 3px rgba(0,0,0,0.5);
  cursor: pointer;
}
.admin-form input[type="range"]::-moz-range-track {
  height: 0.5rem;
  background: linear-gradient(180deg, #1a1614, #2a2624);
  border: 1px solid #000;
  border-radius: 999px;
}
.admin-form input[type="range"]::-moz-range-thumb {
  width: 1.2rem;
  height: 1.4rem;
  background: linear-gradient(180deg, var(--metal-light) 0%, var(--metal-mid) 100%);
  border: 1px solid var(--metal-dark);
  border-radius: 0.2rem;
  cursor: pointer;
}

/* Action buttons — brass primary, chrome ghost */
.admin-actions {
  display: flex;
  gap: 0.6rem;
}
.admin-btn {
  appearance: none;
  padding: 0.5rem 1.1rem;
  border-radius: 0.25rem;
  font-family: Menlo, Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid var(--brass-dark);
  background: linear-gradient(180deg, var(--brass-light), var(--brass) 50%, var(--brass-dark));
  color: var(--label-ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 2px 0 rgba(0,0,0,0.3);
}
.admin-btn:not(:disabled):hover { filter: brightness(1.05); }
.admin-btn--ghost {
  background: linear-gradient(180deg, var(--metal-light), var(--metal-mid));
  border-color: var(--metal-dark);
  color: var(--label-ink);
}
.admin-btn--small { padding: 0.3rem 0.55rem; font-size: 0.7rem; }

.admin-status {
  margin: 0;
  min-height: 1.2rem;
  padding: 0.3rem 0.5rem;
  font-family: Menlo, Consolas, monospace;
  font-size: 0.8rem;
  text-align: center;
  background: var(--label-ink);
  border: 1px solid #000;
  border-radius: 0.2rem;
  color: var(--led-green);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.7);
}
.admin-status.is-good { color: var(--led-green); }
.admin-status.is-warn { color: var(--led-amber); }
.admin-status.is-error { color: var(--led-red); }

/* Toggles */
.admin-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: Georgia, serif;
  font-size: 0.9rem;
  color: var(--label-cream);
  text-transform: none;
  letter-spacing: 0;
  font-weight: normal;
}
.admin-toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.2rem;
  height: 1.2rem;
  border: 1px solid #000;
  border-radius: 0.2rem;
  background: linear-gradient(180deg, var(--metal-light), var(--metal-mid));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
  position: relative;
  cursor: pointer;
}
.admin-toggle input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  inset: 0.2rem;
  background: var(--led-red);
  border-radius: 0.1rem;
  box-shadow: 0 0 6px var(--led-red);
}

/* Sandbox sub-panel */
.admin-field--sandbox {
  background: linear-gradient(180deg, var(--panel-grey-dark) 0%, #1a1614 100%);
  border: 1px solid #000;
  border-radius: 0.3rem;
  padding: 0.85rem 0.9rem 1rem;
  gap: 0.6rem;
}
.admin-sandbox-advanced summary {
  cursor: pointer;
  font-family: Menlo, Consolas, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--brass-light);
  padding: 0.25rem 0;
}
.admin-sandbox-advanced[open] summary { color: var(--brass); }
.admin-sandbox-out {
  margin: 0;
  min-height: 5rem;
  background: var(--label-ink);
  border: 1px solid #000;
  border-radius: 0.2rem;
  padding: 0.55rem 0.7rem;
  font-family: Menlo, Consolas, monospace;
  font-size: 0.78rem;
  white-space: pre-wrap;
  color: var(--led-green);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.7), 0 0 4px rgba(74, 255, 74, 0.1);
  line-height: 1.45;
}

.admin-footer {
  text-align: center;
  color: rgba(232, 228, 220, 0.65);
  font-family: Georgia, serif;
  font-size: 0.9rem;
}
.admin-footer a {
  color: var(--brass-light);
  text-decoration: none;
  border-bottom: 1px solid var(--brass-dark);
}
.admin-footer a:hover { color: var(--brass); }
