/* ==========================================================================
   National Covenant Household Receiver — Model HR-7C (radio.css)
   Warm state-issued gold/crimson/obsidian hardware aesthetic that fractures
   into emerald/cyan phosphor & warning amber during a Resistance takeover.
   ========================================================================== */

:root {
  --bg-deep: #07080a;
  --bg-panel: #101216;
  --bg-chassis: #15181e;
  --bg-chassis-hi: #1d212a;
  --bg-glass: #090c0f;
  --ink: #ece8dc;
  --ink-muted: #9f9b8e;
  --ink-dim: #68655c;
  --gold: #c9a452;
  --gold-bright: #e8c674;
  --crimson: #9e1f28;
  --crimson-bright: #d42c38;
  --phosphor: #46d884;
  --phosphor-dim: rgba(70, 216, 132, 0.22);
  --pirate-amber: #f29d38;
  --pirate-cyan: #57e2d9;
  --border-subtle: rgba(201, 164, 82, 0.22);
  --border-hard: #2a2f3a;
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --font-display: "Anton", Impact, sans-serif;
  --font-serif: "Cormorant Garamond", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(158, 31, 40, 0.16) 0%, transparent 55%),
    radial-gradient(circle at 85% 20%, rgba(201, 164, 82, 0.1) 0%, transparent 45%),
    var(--bg-deep);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.6s ease;
}

/* Resistance Takeover Global State */
body.takeover-active {
  background:
    radial-gradient(circle at 50% 10%, rgba(242, 157, 56, 0.18) 0%, transparent 55%),
    radial-gradient(circle at 20% 40%, rgba(70, 216, 132, 0.14) 0%, transparent 50%),
    #050708;
}

.wrap {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

/* ---------- Masthead ---------- */
.receiver-masthead {
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(10, 12, 16, 0.88);
  backdrop-filter: blur(8px);
}

.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.seal-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: radial-gradient(circle, rgba(201, 164, 82, 0.25), rgba(158, 31, 40, 0.35));
  display: grid;
  place-items: center;
  color: var(--gold-bright);
  font-size: 16px;
}

.brand-lockup strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--ink);
}

.brand-lockup small {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--gold);
}

.masthead-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.masthead-nav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.masthead-nav a:hover,
.masthead-nav a:focus-visible {
  color: var(--gold-bright);
}

/* ---------- Top Civic Brief ---------- */
.receiver-stage {
  padding: 28px 0 64px;
}

.civic-brief {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 26px;
}

@media (max-width: 860px) {
  .civic-brief {
    grid-template-columns: 1fr;
  }
}

.eyebrow {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.brief-copy h1 {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: clamp(32px, 4.5vw, 48px);
  font-weight: 600;
  line-height: 1.06;
  color: var(--ink);
}

.brief-copy .lead {
  margin: 0;
  color: var(--ink-muted);
  font-size: 15px;
  max-width: 64ch;
}

.compliance-card {
  background: linear-gradient(160deg, rgba(22, 25, 32, 0.95), rgba(13, 15, 19, 0.95));
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--gold);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

body.takeover-active .compliance-card {
  border-color: rgba(242, 157, 56, 0.55);
  border-left-color: var(--pirate-amber);
  box-shadow: 0 0 28px rgba(242, 157, 56, 0.15);
}

.comp-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.comp-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--phosphor);
  box-shadow: 0 0 8px var(--phosphor);
}

.comp-dot.warning {
  background: var(--pirate-amber);
  box-shadow: 0 0 10px var(--pirate-amber);
  animation: pulse-fast 0.8s infinite alternate;
}

.comp-dot.alert {
  background: var(--crimson-bright);
  box-shadow: 0 0 12px var(--crimson-bright);
  animation: pulse-fast 0.45s infinite alternate;
}

.comp-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ink);
}

.comp-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding: 10px 0;
}

.comp-metrics small {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
}

.comp-metrics b {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold-bright);
}

.comp-note {
  margin: 0;
  font-size: 12px;
  color: var(--ink-muted);
}

/* ---------- Physical Radio Chassis ---------- */
.chassis {
  position: relative;
  background:
    linear-gradient(180deg, #1f242d 0%, #14171d 14%, #101318 88%, #0b0d11 100%);
  border: 2px solid #2e3440;
  border-radius: 10px;
  padding: 22px 24px 26px;
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 0 0 1px rgba(201, 164, 82, 0.14);
  margin-bottom: 28px;
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

body.takeover-active .chassis {
  border-color: var(--pirate-amber);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.85),
    0 0 36px rgba(242, 157, 56, 0.18),
    inset 0 0 24px rgba(242, 157, 56, 0.08);
}

.chassis-screws span {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, #3b4250 30%, #171a20 90%);
  border: 1px solid #0c0e12;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2);
}
.chassis-screws span:nth-child(1) { top: 10px; left: 10px; }
.chassis-screws span:nth-child(2) { top: 10px; right: 10px; }
.chassis-screws span:nth-child(3) { bottom: 10px; left: 10px; }
.chassis-screws span:nth-child(4) { bottom: 10px; right: 10px; }

.hardware-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid #262b35;
  flex-wrap: wrap;
}

.model-plate {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.plate-brand {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.14em;
  color: var(--gold-bright);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.plate-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
}

.hardware-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hw-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  padding: 4px 9px;
  border-radius: 3px;
  background: #0c0e12;
  border: 1px solid #2a303c;
  color: var(--ink-muted);
}

.hw-pill.on {
  color: var(--gold-bright);
  border-color: rgba(201, 164, 82, 0.5);
  background: rgba(201, 164, 82, 0.1);
}

.hw-pill.active-green {
  color: var(--phosphor);
  border-color: rgba(70, 216, 132, 0.5);
  background: rgba(70, 216, 132, 0.1);
}

.hw-pill.alert {
  color: #fff;
  background: var(--crimson);
  border-color: var(--crimson-bright);
  animation: pulse-fast 0.6s infinite alternate;
}

/* ---------- Display Bay (Frequency Scale + CRT Scope) ---------- */
.display-bay {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

@media (max-width: 920px) {
  .display-bay {
    grid-template-columns: 1fr;
  }
}

.dial-window {
  position: relative;
  background:
    radial-gradient(circle at 50% 0%, rgba(201, 164, 82, 0.14), transparent 70%),
    linear-gradient(180deg, #07090c 0%, #0b0f14 100%);
  border: 2px solid #2b313d;
  border-radius: 6px;
  padding: 16px 18px;
  box-shadow: inset 0 6px 22px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

body.takeover-active .dial-window {
  background:
    radial-gradient(circle at 50% 0%, rgba(242, 157, 56, 0.22), transparent 70%),
    linear-gradient(180deg, #090b08 0%, #12100b 100%);
  border-color: rgba(242, 157, 56, 0.6);
}

.dial-glass-glare {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.04) 0%, transparent 38%, transparent 100%);
}

.dial-header-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.band-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--gold);
}

body.takeover-active .band-tag {
  color: var(--pirate-amber);
}

.freq-digital {
  font-family: var(--font-mono);
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
  text-shadow: 0 0 14px rgba(232, 198, 116, 0.45);
}

body.takeover-active .freq-digital {
  color: var(--pirate-cyan);
  text-shadow: 0 0 16px rgba(87, 226, 217, 0.6);
}

.freq-digital small {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
}

/* Interactive Frequency Scale Track */
.scale-track {
  position: relative;
  height: 68px;
  background: rgba(4, 6, 8, 0.9);
  border: 1px solid rgba(201, 164, 82, 0.28);
  border-radius: 4px;
  cursor: ew-resize;
  user-select: none;
  overflow: hidden;
}

.scale-track:focus-visible {
  outline: 2px solid var(--gold-bright);
}

.scale-ticks {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 10px 6px;
  pointer-events: none;
}

.scale-tick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.scale-tick i {
  display: block;
  width: 1px;
  height: 12px;
  background: rgba(236, 232, 220, 0.3);
}

.scale-tick.major i {
  height: 20px;
  width: 1.5px;
  background: rgba(201, 164, 82, 0.7);
}

.scale-tick span {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink-muted);
}

/* Markers on the scale for official and hidden stations */
.scale-stations {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.st-pip {
  position: absolute;
  top: 8px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.st-pip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
}

.st-pip.pirate .st-pip-dot {
  width: 6px;
  height: 6px;
  background: var(--pirate-amber);
  box-shadow: 0 0 8px var(--pirate-amber);
  opacity: 0.35;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.st-pip.pirate.revealed .st-pip-dot {
  opacity: 1;
  background: var(--pirate-cyan);
  box-shadow: 0 0 10px var(--pirate-cyan);
  transform: scale(1.25);
}

.st-pip-label {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
  white-space: nowrap;
}

.st-pip.pirate .st-pip-label {
  color: var(--pirate-amber);
  opacity: 0;
}

.st-pip.pirate.revealed .st-pip-label {
  opacity: 0.95;
  color: var(--pirate-cyan);
}

/* Glowing Dial Needle */
.dial-needle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--crimson-bright);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 4;
  box-shadow: 0 0 10px var(--crimson-bright);
  transition: left 0.06s linear;
}

body.takeover-active .dial-needle {
  background: var(--pirate-cyan);
  box-shadow: 0 0 14px var(--pirate-cyan);
}

.needle-glow {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 100%;
  background: radial-gradient(circle, rgba(212, 44, 56, 0.35), transparent 70%);
}

/* Station Readout Banner inside Glass Window */
.station-banner {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
}

.st-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--gold);
  flex-wrap: wrap;
}

.st-origin {
  color: var(--ink-muted);
}

.st-title {
  margin: 4px 0 2px;
  font-family: var(--font-serif);
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 600;
  color: var(--ink);
}

body.takeover-active .st-title {
  color: var(--pirate-amber);
}

.st-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--ink-muted);
}

/* ---------- Right Column: CRT Oscilloscope & Analog Meters ---------- */
.scope-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.crt-frame {
  position: relative;
  background: #040a07;
  border: 2px solid #28312c;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.9);
  flex: 1;
  min-height: 132px;
}

#scope-canvas {
  display: block;
  width: 100%;
  height: 132px;
}

.crt-overlay {
  position: absolute;
  top: 7px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: rgba(70, 216, 132, 0.75);
}

body.takeover-active .crt-overlay {
  color: var(--pirate-amber);
}

.meters-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.analog-meter {
  background: #0b0d11;
  border: 1px solid #2b303c;
  border-radius: 5px;
  padding: 8px 10px 10px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.8);
}

.meter-face {
  position: relative;
  height: 52px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.meter-label {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  text-align: center;
}

.meter-scale {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--gold);
  padding: 0 4px 12px;
  border-bottom: 1px solid rgba(201, 164, 82, 0.25);
}

.meter-scale .red {
  color: var(--crimson-bright);
  font-weight: 700;
}

.meter-needle {
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 2px;
  height: 44px;
  background: var(--gold-bright);
  transform-origin: bottom center;
  transform: rotate(-38deg);
  transition: transform 0.12s ease-out;
  box-shadow: 0 0 6px rgba(232, 198, 116, 0.6);
}

/* ---------- Teleprinter / Live Transcript Strip ---------- */
.teleprinter-bay {
  background: #080a0d;
  border: 1px solid #282e38;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 18px;
  box-shadow: inset 0 3px 14px rgba(0, 0, 0, 0.8);
}

body.takeover-active .teleprinter-bay {
  border-color: rgba(87, 226, 217, 0.5);
  background: #060b0d;
}

.tp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
  flex-wrap: wrap;
}

.tp-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  font-weight: 600;
}

.tp-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-dim);
}

.tp-led.live {
  background: var(--phosphor);
  box-shadow: 0 0 8px var(--phosphor);
}

.tp-led.pirate {
  background: var(--pirate-amber);
  box-shadow: 0 0 10px var(--pirate-amber);
  animation: pulse-fast 0.45s infinite alternate;
}

.tp-screen {
  min-height: 54px;
  max-height: 92px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  padding-right: 4px;
}

.tp-line {
  margin: 0 0 6px;
}

.tp-line:last-child {
  margin-bottom: 0;
}

.tp-line.system {
  color: var(--ink-muted);
  font-size: 12px;
}

.tp-line.regime {
  color: #f3ebd3;
}

.tp-line.bleed {
  color: var(--pirate-amber);
  font-style: italic;
}

.tp-line.pirate {
  color: var(--pirate-cyan);
  font-weight: 600;
}

.tp-line.jammer {
  color: var(--crimson-bright);
  font-weight: 700;
}

.subcarrier-strip {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(242, 157, 56, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  flex-wrap: wrap;
}

.sc-tag {
  color: var(--pirate-amber);
  letter-spacing: 0.12em;
  font-weight: 600;
}

.sc-code {
  color: var(--phosphor);
  background: rgba(70, 216, 132, 0.08);
  padding: 2px 8px;
  border-radius: 3px;
}

/* ---------- Control Deck (3 Columns) ---------- */
.control-deck {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr 1.15fr;
  gap: 16px;
}

@media (max-width: 980px) {
  .control-deck {
    grid-template-columns: 1fr;
  }
}

.deck-panel {
  background: rgba(11, 13, 17, 0.78);
  border: 1px solid #262b36;
  border-radius: 6px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.13em;
  color: var(--gold);
}

.panel-header small {
  color: var(--ink-muted);
  font-size: 9px;
}

/* Power & Volume Row */
.power-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.power-btn {
  flex: 1;
  min-width: 155px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 14px;
  background: linear-gradient(180deg, #272d38, #181c24);
  border: 1px solid var(--gold);
  border-radius: 5px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  transition: all 0.18s ease;
}

.power-btn:hover {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}

.power-btn[aria-pressed="true"] {
  background: linear-gradient(180deg, #1d3528, #102018);
  border-color: var(--phosphor);
  color: #fff;
  box-shadow: 0 0 18px rgba(70, 216, 132, 0.25);
}

.pwr-led {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #555;
}

.power-btn[aria-pressed="true"] .pwr-led {
  background: var(--phosphor);
  box-shadow: 0 0 8px var(--phosphor);
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
}

.volume-control input[type="range"] {
  width: 90px;
  accent-color: var(--gold);
}

/* Preset Buttons */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
}

.preset-btn {
  text-align: left;
  background: #12151c;
  border: 1px solid #2b313e;
  border-radius: 4px;
  padding: 8px 10px;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-btn:hover {
  border-color: var(--gold);
  background: #171b24;
}

.preset-btn.active {
  background: linear-gradient(180deg, rgba(201, 164, 82, 0.2), rgba(158, 31, 40, 0.18));
  border-color: var(--gold-bright);
  box-shadow: inset 0 0 10px rgba(201, 164, 82, 0.18);
}

.preset-btn .p-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--gold);
}

.preset-btn strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  margin: 2px 0;
}

.preset-btn small {
  display: block;
  font-size: 10.5px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Rotary VFO Tuning Wheel ---------- */
.knob-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
}

.rotary-wheel {
  position: relative;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #394150, #161920 72%);
  border: 3px solid #3c4352;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.7),
    inset 0 2px 4px rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.rotary-wheel:active {
  cursor: grabbing;
}

.rotary-wheel:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

.wheel-knurl {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 2px dashed rgba(201, 164, 82, 0.35);
  pointer-events: none;
}

.wheel-cap {
  position: relative;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: radial-gradient(circle, #1e232c 0%, #101318 100%);
  border: 1px solid rgba(201, 164, 82, 0.4);
  display: grid;
  place-items: center;
  transform: rotate(0deg);
  transition: transform 0.05s linear;
}

.wheel-marker {
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: var(--gold-bright);
  box-shadow: 0 0 6px var(--gold-bright);
}

body.takeover-active .wheel-marker {
  background: var(--pirate-cyan);
  box-shadow: 0 0 8px var(--pirate-cyan);
}

.wheel-center-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-align: center;
  color: var(--ink-muted);
  line-height: 1.25;
  pointer-events: none;
}

.fine-nudge-controls {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.nudge-btn {
  background: #141820;
  border: 1px solid #2e3543;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 5px 9px;
  border-radius: 4px;
  cursor: pointer;
}

.nudge-btn:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
}

.nudge-btn.scan-btn {
  border-color: rgba(201, 164, 82, 0.45);
  color: var(--gold-bright);
}

.knob-hint {
  margin: 0;
  font-size: 11px;
  color: var(--ink-muted);
  text-align: center;
}

/* ---------- Service & Filter Switches (Column 3) ---------- */
.toggle-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toggle-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.toggle-item strong {
  display: block;
  font-size: 12.5px;
  color: var(--ink);
}

.toggle-item small {
  display: block;
  font-size: 11px;
  color: var(--ink-muted);
}

.hw-switch {
  min-width: 78px;
  padding: 6px 10px;
  border-radius: 4px;
  background: #151922;
  border: 1px solid #323947;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hw-switch.on {
  background: rgba(201, 164, 82, 0.16);
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}

.hw-switch.pirate-on {
  background: rgba(242, 157, 56, 0.18);
  border-color: var(--pirate-amber);
  color: var(--pirate-amber);
  box-shadow: 0 0 12px rgba(242, 157, 56, 0.2);
}

.phase-align-box {
  background: #0c0f14;
  border: 1px solid #262c38;
  border-radius: 5px;
  padding: 10px 12px;
}

.phase-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.phase-row b {
  color: var(--gold-bright);
}

#phase-slider {
  width: 100%;
  accent-color: var(--pirate-amber);
  margin-bottom: 8px;
}

.hold-carrier-btn {
  width: 100%;
  padding: 8px 10px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  background: #171b22;
  border: 1px solid #2e3442;
  color: var(--ink-dim);
  cursor: not-allowed;
  transition: all 0.2s ease;
}

.hold-carrier-btn:not(:disabled) {
  background: linear-gradient(180deg, rgba(242, 157, 56, 0.28), rgba(158, 31, 40, 0.32));
  border-color: var(--pirate-amber);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(242, 157, 56, 0.3);
  animation: pulse-fast 0.7s infinite alternate;
}

/* ---------- Lower Two-Column Grid ---------- */
.lower-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 22px;
}

@media (max-width: 900px) {
  .lower-grid {
    grid-template-columns: 1fr;
  }
}

.schedule-card,
.logbook-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-hard);
  border-radius: 8px;
  padding: 20px 22px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.card-head h2 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 600;
}

.card-intro {
  margin: 0 0 16px;
  font-size: 13.5px;
  color: var(--ink-muted);
}

.freq-directory {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dir-tune {
  width: 100%;
  text-align: left;
  background: #14171f;
  border: 1px solid #262c38;
  border-radius: 5px;
  padding: 10px 12px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dir-tune:hover {
  border-color: var(--gold);
  background: #191d27;
}

.dir-tune strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gold-bright);
  margin-bottom: 2px;
}

.dir-tune span {
  display: block;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.tech-bulletin {
  border-top: 1px solid #262b36;
  padding-top: 12px;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.tech-bulletin summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.tb-body {
  margin-top: 8px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.35);
  border-left: 2px solid var(--crimson);
}

.tb-body p {
  margin: 0 0 8px;
}
.tb-body p:last-child {
  margin-bottom: 0;
}

/* Intercept Logbook */
.log-counter {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--gold);
  background: rgba(201, 164, 82, 0.12);
  border: 1px solid rgba(201, 164, 82, 0.3);
  padding: 4px 8px;
  border-radius: 3px;
}

.intercept-progress {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.ip-slot {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 6px 4px;
  background: #0c0e13;
  border: 1px solid #262b36;
  border-radius: 4px;
  color: var(--ink-dim);
}

.ip-slot.found {
  border-color: var(--pirate-cyan);
  color: var(--pirate-cyan);
  background: rgba(87, 226, 217, 0.1);
}

.ip-slot.takeover.found {
  border-color: var(--pirate-amber);
  color: var(--pirate-amber);
  background: rgba(242, 157, 56, 0.15);
  font-weight: 700;
}

.tape-log {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 290px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tape-entry {
  background: #0c0e13;
  border: 1px solid #232833;
  border-left: 3px solid var(--gold);
  padding: 9px 12px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.tape-entry.pirate {
  border-left-color: var(--pirate-cyan);
  background: rgba(14, 24, 26, 0.75);
}

.tape-entry.takeover {
  border-left-color: var(--pirate-amber);
  background: rgba(32, 22, 12, 0.75);
}

.tape-entry.jammed {
  border-left-color: var(--crimson-bright);
}

.tape-meta {
  display: flex;
  justify-content: space-between;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.tape-entry p {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
}

/* ---------- Footer ---------- */
.receiver-footer {
  border-top: 1px solid #222630;
  padding: 20px 0 36px;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-inner nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-inner a {
  color: var(--ink-muted);
  text-decoration: none;
}

.footer-inner a:hover {
  color: var(--gold-bright);
}

@keyframes pulse-fast {
  from { opacity: 0.65; }
  to { opacity: 1; }
}

@keyframes spin-reel {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ---------- Row 2: Magnetic Cassette Deck & Field Transponder Keypad ---------- */
.auxiliary-bay {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #262b36;
}

@media (max-width: 980px) {
  .auxiliary-bay {
    grid-template-columns: 1fr;
  }
}

.cassette-bay,
.transponder-bay {
  background: rgba(11, 13, 17, 0.84);
  border: 1px solid #262b36;
  border-radius: 6px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.cassette-body {
  display: grid;
  grid-template-columns: 1.05fr 1.2fr;
  gap: 14px;
  align-items: stretch;
}

@media (max-width: 640px) {
  .cassette-body {
    grid-template-columns: 1fr;
  }
}

.cassette-window {
  background: linear-gradient(180deg, #0b0e13 0%, #131820 100%);
  border: 2px solid #2e3543;
  border-radius: 6px;
  padding: 10px 12px;
  box-shadow: inset 0 4px 16px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.cassette-window.playing {
  border-color: var(--gold-bright);
  box-shadow: inset 0 4px 16px rgba(0, 0, 0, 0.85), 0 0 14px rgba(201, 164, 82, 0.22);
}

.cassette-window.pirate-tape {
  border-color: var(--pirate-amber);
}

.cassette-label-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #f0e6d0;
  color: #1e1a14;
  padding: 4px 8px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  border-left: 4px solid var(--crimson);
}

.cassette-window.pirate-tape .cassette-label-strip {
  background: #d8e5df;
  border-left-color: #1f5c4b;
}

.cassette-label-strip .c-side {
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--crimson);
}

.cassette-label-strip strong {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 9px;
}

.cassette-label-strip .c-counter {
  background: #14171d;
  color: var(--gold-bright);
  padding: 1px 5px;
  border-radius: 2px;
  font-weight: 700;
}

.cassette-reels {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 10px;
  padding: 6px 4px;
  background: rgba(4, 6, 9, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 4px;
}

.tape-reel {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid #3c4352;
  background: radial-gradient(circle, #11141a 32%, #292f3b 35%, #171b22 70%);
  display: grid;
  place-items: center;
  position: relative;
}

.tape-reel .reel-spokes {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px dashed rgba(201, 164, 82, 0.55);
}

.cassette-window.playing .tape-reel {
  animation: spin-reel 2.4s linear infinite;
}

.cassette-window.rewinding .tape-reel {
  animation: spin-reel 0.45s linear infinite reverse;
}

.tape-bridge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.tape-oxide-line {
  display: block;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, rgba(169, 132, 47, 0.25), rgba(201, 164, 82, 0.8), rgba(169, 132, 47, 0.25));
}

.tape-bridge small {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
}

.cassette-controls-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.cartridge-picker-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
}

.cartridge-picker-label select {
  background: #12161e;
  color: var(--ink);
  border: 1px solid #2e3543;
  border-radius: 4px;
  padding: 6px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.transport-btns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.tr-btn {
  background: #151922;
  border: 1px solid #303746;
  border-radius: 4px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 7px 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tr-btn:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
}

.tr-btn[aria-pressed="true"] {
  background: rgba(70, 216, 132, 0.16);
  border-color: var(--phosphor);
  color: var(--phosphor);
}

.tr-btn.rec[aria-pressed="true"] {
  background: rgba(212, 44, 56, 0.24);
  border-color: var(--crimson-bright);
  color: #fff;
  animation: pulse-fast 0.6s infinite alternate;
}

.warble-controls {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.warble-slider-wrap {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
}

.warble-slider-wrap b {
  color: var(--gold-bright);
}

#tape-warble-slider {
  width: 100%;
  accent-color: var(--gold);
}

/* Transponder Keypad */
.transponder-readout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #080a0e;
  border: 1px solid #262c38;
  border-radius: 5px;
  padding: 8px 12px;
  flex-wrap: wrap;
}

.transponder-readout small {
  display: block;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
}

.cipher-entry-box {
  display: inline-block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--phosphor);
}

.transponder-hint {
  font-size: 11px;
  color: var(--ink-muted);
}

.transponder-hint a {
  color: var(--gold-bright);
  text-decoration: none;
}

.transponder-hint a:hover {
  text-decoration: underline;
}

.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.kp-btn {
  background: #141820;
  border: 1px solid #2b3240;
  border-radius: 4px;
  padding: 7px 0;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s ease;
}

.kp-btn:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  background: #1a1f29;
}

.kp-btn.action {
  color: var(--ink-muted);
  font-size: 10.5px;
}

.kp-btn.send {
  background: rgba(201, 164, 82, 0.16);
  border-color: rgba(201, 164, 82, 0.5);
  color: var(--gold-bright);
  font-size: 10.5px;
}

.morse-paddle-row {
  display: flex;
}

.cw-key-btn {
  width: 100%;
  padding: 8px 10px;
  background: #12161d;
  border: 1px solid #2d3442;
  border-radius: 4px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.cw-key-btn:active,
.cw-key-btn.keying {
  background: rgba(87, 226, 217, 0.16);
  border-color: var(--pirate-cyan);
  color: var(--pirate-cyan);
}

.cw-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pirate-cyan);
}
