:root {
  --green: #33ff66;
  --green-dim: #1c8f3c;
  --amber: #ffb000;
  --blue: #4dd0ff;
  --red: #ff5555;
  --bg: #020803;
  --panel-bg: rgba(10, 30, 15, 0.35);
}

* { box-sizing: border-box; }

body {
  background-color: var(--bg);
  background-image: radial-gradient(rgba(0, 100, 0, 0.55), black 120%);
  min-height: 100vh;
  margin: 0;
  padding: 2rem;
  color: var(--green);
  font: 1rem/1.5 "Inconsolata", "Courier New", monospace;
  text-shadow: 0 0 5px rgba(51, 255, 102, 0.35);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.2),
    rgba(0, 0, 0, 0.2) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 10;
}

::selection {
  background: var(--blue);
  color: black;
  text-shadow: none;
}

.crt {
  max-width: 960px;
  margin: 0 auto;
}

/* --- ASCII banner --- */
.ascii-logo {
  margin: 0 0 1.5rem;
  text-align: center;
  color: var(--green);
  text-shadow: 0 0 8px rgba(51, 255, 102, 0.6);
  overflow-x: auto;
}

/* --- Morse divider ---
   Static, hand-encoded — a visual signature between sections.
   "73" in Morse: --... ...-- */
.morse-rule {
  border: none;
  border-top: 1px dashed var(--green-dim);
  position: relative;
  margin: 1.75rem 0;
  height: 1px;
}
.morse-rule::after {
  content: "-- ... --... ...-- --... ...-- --... ...-- --... ...--";
  position: absolute;
  top: -0.7em;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  padding: 0 0.75rem;
  color: var(--green-dim);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  white-space: nowrap;
}

/* --- Panels --- */
.panel {
  border: 1px solid var(--green-dim);
  border-radius: 4px;
  background: var(--panel-bg);
  box-shadow: 0 0 12px rgba(51, 255, 102, 0.08), inset 0 0 20px rgba(0, 0, 0, 0.4);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--green-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.85rem;
  color: var(--amber);
  text-shadow: 0 0 6px rgba(255, 176, 0, 0.5);
}

.panel-body {
  padding: 1rem;
}

/* --- Frequency table --- */
table.freq-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.freq-table th {
  text-align: left;
  color: var(--amber);
  font-weight: normal;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--green-dim);
}

.freq-table td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px dotted rgba(51, 255, 102, 0.25);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.freq-table tr:last-child td {
  border-bottom: none;
}

/* --- Badges --- */
.badge {
  display: inline-block;
  padding: 0.05em 0.55em;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.6;
}
.badge--green  { color: var(--green); }
.badge--amber  { color: var(--amber); }
.badge--blue   { color: var(--blue); }
.badge--red    { color: var(--red); }
.badge--neutral{ color: #999; }

/* --- Status dot --- */
.status-dot {
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
  margin-right: 0.4em;
  vertical-align: middle;
}
.status-dot.pulse { animation: pulse 2s infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* --- Links --- */
a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: rgba(77, 208, 255, 0.4);
}
a:hover, a:focus {
  color: var(--amber);
  text-decoration-color: currentColor;
}
a:focus-visible {
  outline: 1px dashed var(--amber);
  outline-offset: 2px;
}

.blink { animation: blink 1.2s steps(1) infinite; }
@keyframes blink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .status-dot.pulse, .blink { animation: none; }
}

.prompt { color: var(--green); }
.callsign { color: var(--amber); }

footer.sig {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: #8fbf9a;
}

/* --- Responsive: collapse table to stacked cards --- */
@media (max-width: 640px) {
  body { padding: 1rem; font-size: 0.9rem; }

  .freq-table thead { display: none; }
  .freq-table, .freq-table tbody, .freq-table tr, .freq-table td {
    display: block;
    width: 100%;
  }
  .freq-table tr {
    border-bottom: 1px solid var(--green-dim);
    padding: 0.5rem 0;
  }
  .freq-table td {
    border-bottom: none;
    padding: 0.15rem 0.6rem;
    white-space: normal;
  }
  .freq-table td::before {
    content: attr(data-label) ": ";
    color: var(--amber);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
}
