/* Network Yorkshire Virtual PMR Radio */
:root {
  --bg: #0a1620;
  --bg-card: #12202c;
  --surface: #1a2d3a;
  --border: #2a4555;
  --text: #e8f0f4;
  --text-muted: #8ba3b0;
  --accent: #1a7a5c;
  --accent-bright: #2ecc9a;
  --accent-dark: #0d4f3c;
  --rose: #f5f5f0;
  --tx-red: #e53935;
  --rx-green: #43a047;
  --lcd-teal: #80cbc4;
  --shadow: 0 12px 40px rgba(0,0,0,0.45);
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* Header */
.site-header {
  background: linear-gradient(180deg, #0d1f2d 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1rem 0.5rem;
  text-align: center;
}
.header-inner { max-width: 900px; margin: 0 auto; }
.brand { display: inline-block; text-decoration: none; }
.brand-banner {
  display: block;
  max-width: min(100%, 720px);
  height: auto;
  border-radius: 10px;
  box-shadow: var(--shadow);
  margin: 0 auto;
}
.tagline {
  margin: 0.75rem 0 0.25rem;
  font-size: 0.9rem;
  color: var(--accent-bright);
  letter-spacing: 0.03em;
}

/* How strip */
.how-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.5rem;
  padding: 1rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.how-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
}
.how-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
}

/* Mic gate */
.mic-gate {
  position: fixed;
  inset: 0;
  background: rgba(5,12,18,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.mic-gate[hidden] { display: none !important; }
.mic-gate-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  max-width: 360px;
  text-align: center;
  box-shadow: var(--shadow);
}
.mic-gate-icon { font-size: 2.5rem; margin: 0 0 0.5rem; }
.mic-gate-card h2 { margin: 0 0 0.5rem; font-size: 1.25rem; }
.mic-gate-card p { color: var(--text-muted); font-size: 0.95rem; margin: 0 0 1.25rem; }
.mic-gate-btn {
  background: linear-gradient(145deg, var(--accent-bright), var(--accent));
  color: #062018;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}
.mic-gate-btn:hover { filter: brightness(1.08); }

/* Main layout */
.console-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: 980px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
}
@media (min-width: 800px) {
  .console-main {
    grid-template-columns: minmax(280px, 340px) 1fr;
    align-items: start;
  }
}

.radio-panel { display: flex; justify-content: center; }

/* Virtual radio shell */
.virtual-radio {
  width: 100%;
  max-width: 320px;
  border-radius: 18px;
  padding: 1rem 1rem 0.85rem;
  position: relative;
  box-shadow: var(--shadow);
  user-select: none;
}
.virtual-radio.transmitting-active {
  box-shadow: var(--shadow), 0 0 36px rgba(229, 57, 53, 0.35);
}
.skin-yorkshire {
  background: linear-gradient(165deg, #1e3a32 0%, #0f221c 55%, #0a1814 100%);
  border: 2px solid #2d5a4a;
}
.radio-antenna {
  width: 10px;
  height: 48px;
  margin: -4px auto 8px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(to bottom, #a8c5b8, #5a7a6c);
  position: relative;
}
.radio-antenna::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 8px;
  border-radius: 4px 4px 0 0;
  background: #a8c5b8;
}
.radio-brand {
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9ec9b8;
  margin-bottom: 0.55rem;
  font-weight: 600;
}

/* LCD */
.radio-lcd {
  background: #061410;
  border: 3px solid #1a3a30;
  border-radius: 8px;
  color: var(--lcd-teal);
  padding: 0.55rem 0.65rem 0.5rem;
  margin-bottom: 0.75rem;
  box-shadow: inset 0 0 22px rgba(128, 203, 196, 0.07);
  font-variant-numeric: tabular-nums;
}
.radio-lcd.powered-off { filter: brightness(0.12); }
.lcd-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  opacity: 0.8;
  margin-bottom: 0.2rem;
}
.lcd-channel {
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.1;
  letter-spacing: 0.02em;
}
.lcd-freq {
  font-size: 0.88rem;
  text-align: center;
  margin: 0.15rem 0 0.1rem;
  opacity: 0.92;
}
.lcd-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  margin-top: 0.25rem;
  opacity: 0.85;
}
.lcd-bars {
  display: flex;
  gap: 2px;
  align-items: flex-end;
  height: 12px;
}
.lcd-bars span {
  width: 4px;
  background: currentColor;
  opacity: 0.22;
  border-radius: 1px;
}
.lcd-bars span.on { opacity: 1; }
.lcd-bars span:nth-child(1) { height: 4px; }
.lcd-bars span:nth-child(2) { height: 6px; }
.lcd-bars span:nth-child(3) { height: 8px; }
.lcd-bars span:nth-child(4) { height: 10px; }
.lcd-bars span:nth-child(5) { height: 12px; }

/* Channel row */
.channel-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}
.ch-btn, .ctrl-btn {
  flex: 1;
  border: 1px solid #2d5a4a;
  background: #152e28;
  color: #c8e0d6;
  border-radius: 8px;
  padding: 0.45rem 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.ch-btn:hover, .ctrl-btn:hover { background: #1e4038; }
.ch-btn:active, .ctrl-btn:active { transform: scale(0.97); }
.ch-display {
  flex: 1.2;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--lcd-teal);
}

/* Controls grid */
.radio-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
}
.ctrl-btn.online-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent-dark);
}

/* PTT */
.ptt-wrapper { text-align: center; margin: 0.35rem 0 0.5rem; }
.ptt-btn {
  width: 100%;
  max-width: 200px;
  margin: 0 auto;
  display: block;
  padding: 0.95rem 1rem;
  border-radius: 12px;
  border: 2px solid #004d40;
  background: linear-gradient(145deg, #00897b, #00695c);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 5px 0 #004d40, 0 8px 16px rgba(0,0,0,0.4);
  transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
  touch-action: none;
}
.ptt-btn:hover { filter: brightness(1.08); }
.ptt-btn:active,
.ptt-btn.transmitting {
  transform: translateY(3px) scale(0.97);
  box-shadow: 0 2px 0 #004d40, 0 3px 8px rgba(0,0,0,0.3);
  background: linear-gradient(145deg, #e53935, #c62828);
  border-color: #7f0000;
  box-shadow: 0 2px 0 #7f0000, 0 3px 8px rgba(0,0,0,0.35);
}
.ptt-label {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-top: 0.4rem;
  opacity: 0.55;
  color: #9ec9b8;
}

/* FX / volume */
.fx-panel {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(45, 90, 74, 0.6);
}
.fx-row {
  display: grid;
  grid-template-columns: 72px 1fr 36px;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  color: #9ec9b8;
}
.fx-row label { text-align: right; }
.fx-row input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: #1a3028;
  outline: none;
}
.fx-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--lcd-teal);
  cursor: pointer;
  border: none;
}
.fx-row .val { text-align: right; font-variant-numeric: tabular-nums; opacity: 0.9; }

.radio-footer {
  margin-top: 0.45rem;
  font-size: 0.68rem;
  color: #7a9a8c;
  text-align: center;
}
.radio-log {
  margin-top: 0.4rem;
  max-height: 72px;
  overflow-y: auto;
  font-size: 0.68rem;
  font-family: ui-monospace, monospace;
  background: rgba(0,0,0,0.25);
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  text-align: left;
}
.radio-log .tx { color: #f87171; }
.radio-log .rx { color: #4ade80; }
.radio-log .sys { color: #60a5fa; }

/* Info panel */
.info-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
}
.info-panel h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  color: var(--accent-bright);
}
.info-panel p { margin: 0 0 1rem; color: var(--text-muted); font-size: 0.95rem; }
.feature-list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}
.feature-list li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--surface);
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  font-size: 0.88rem;
  border: 1px solid var(--border);
}
.feature-list .ico { font-size: 1.1rem; }
.legal-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: rgba(229, 57, 53, 0.08);
  border-left: 3px solid var(--tx-red);
  padding: 0.65rem 0.85rem;
  border-radius: 0 8px 8px 0;
  margin-bottom: 1.25rem;
}
.pmr-facts h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: var(--text);
}
.pmr-facts dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.75rem;
  font-size: 0.85rem;
}
.pmr-facts dt { color: var(--text-muted); }
.pmr-facts dd { margin: 0; font-weight: 600; }

/* Channel guide */
.channel-guide {
  max-width: 980px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
}
.channel-guide h2 {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
  color: var(--accent-bright);
}
.ch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
}
.ch-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.ch-card:hover, .ch-card.active {
  border-color: var(--accent-bright);
  background: #143028;
}
.ch-card .n { font-weight: 700; color: var(--lcd-teal); }
.ch-card .f { color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* Footer */
.site-footer {
  text-align: center;
  padding: 1.5rem 1rem 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.88rem;
}
.site-footer strong { color: var(--accent-bright); }
.footer-legal { font-size: 0.75rem; margin-top: 0.5rem; opacity: 0.85; }

/* Online banner (local sim mode note) */
.online-banner {
  font-size: 0.72rem;
  text-align: center;
  padding: 0.35rem 0.5rem;
  margin-bottom: 0.5rem;
  border-radius: 6px;
  background: rgba(26, 122, 92, 0.2);
  color: var(--accent-bright);
}
.online-banner.off {
  background: rgba(100, 100, 100, 0.15);
  color: var(--text-muted);
}

/* Mic gate: never intercept clicks when hidden */
.mic-gate[hidden],
.mic-gate[aria-hidden="true"] {
  display: none !important;
  pointer-events: none !important;
}
.mic-gate-skip {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border, #2d5a4a);
  background: transparent;
  color: var(--text-muted, #9ec9b8);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}
.mic-gate-skip:hover { color: #e8f5f0; border-color: #3d7a68; }

/* Ensure radio controls always clickable above page chrome */
.radio-panel, .virtual-radio, .ptt-btn, .ch-btn, .ctrl-btn, .ch-card {
  position: relative;
  z-index: 2;
}
.ch-card {
  cursor: pointer;
  touch-action: manipulation;
}
.ch-btn, .ctrl-btn, .ptt-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.net-banner {
  max-width: 980px;
  margin: 0.5rem auto 0;
  padding: 1rem 1.15rem;
  background: linear-gradient(135deg, rgba(13, 79, 60, 0.5), rgba(0, 40, 30, 0.8));
  border: 1px solid rgba(0, 200, 150, 0.25);
  border-radius: 14px;
  text-align: center;
}
.net-banner h2 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
  color: #5dffb0;
}
.net-banner p { margin: 0.25rem 0; color: #c8e0d6; font-size: 0.95rem; }
.net-banner-note { font-size: 0.8rem !important; color: #8bb3a4 !important; }

.radio-controls {
  grid-template-columns: 1fr 1fr 1fr !important;
}

.call-log-section {
  max-width: 980px;
  margin: 0 auto 2rem;
  padding: 1.25rem 1rem;
}
.call-log-section h2 { margin: 0 0 0.4rem; font-size: 1.2rem; }
.call-log-intro { color: var(--text-muted, #9ec9b8); font-size: 0.92rem; margin-bottom: 1rem; }
.call-log-form {
  background: var(--surface, #0f231e);
  border: 1px solid var(--border, #2d5a4a);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.call-log-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
@media (max-width: 600px) {
  .call-log-row { grid-template-columns: 1fr; }
  .radio-controls { grid-template-columns: 1fr 1fr !important; }
}
.call-log-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #9ec9b8;
}
.call-log-form input,
.call-log-form select {
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid #2d5a4a;
  background: #0a1814;
  color: #e8f5f0;
  font: inherit;
}
.call-log-submit {
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.25rem;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(145deg, #00c853, #009624);
  color: #04120e;
  font-family: inherit;
}
.call-log-status { margin-top: 0.65rem; font-size: 0.88rem; }
.call-log-status.ok { color: #5dffb0; }
.call-log-status.err { color: #fca5a5; }
.call-log-table-wrap { overflow-x: auto; }
.call-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.call-log-table th,
.call-log-table td {
  text-align: left;
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid rgba(45, 90, 74, 0.5);
}
.call-log-table th { color: #8bb3a4; font-size: 0.75rem; text-transform: uppercase; }
.dist-list { margin: 0.5rem 0; padding-left: 1.1rem; color: #c8e0d6; font-size: 0.88rem; }
.dim { color: #6a9080; font-size: 0.85em; }

.btn-online-main {
  background: linear-gradient(145deg, #00c853, #009624) !important;
  color: #04120e !important;
  border-color: #1b5e20 !important;
  font-weight: 800 !important;
  letter-spacing: 0.03em;
}
.btn-online-main.online-active {
  background: linear-gradient(145deg, #34d399, #059669) !important;
}
.online-banner:not(.off) {
  background: rgba(0, 200, 120, 0.15);
  border-color: rgba(0, 200, 120, 0.35);
  color: #5dffb0;
}

.section-lead {
  color: var(--text-muted, #9ec9b8);
  font-size: 0.92rem;
  margin: 0 0 1rem;
}
.links-section, .map-section, .share-section {
  max-width: 980px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
}
.links-section h2, .map-section h2, .share-section h2 {
  font-size: 1.2rem;
  margin: 0 0 0.35rem;
}
.group-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.group-link a {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--surface, #0f231e);
  border: 1px solid var(--border, #2d5a4a);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.group-link a:hover {
  border-color: rgba(0, 200, 150, 0.45);
  background: #132e27;
}
.group-link.featured a {
  border-color: rgba(0, 200, 150, 0.4);
  box-shadow: 0 0 0 1px rgba(0, 200, 150, 0.12);
}
.gl-icon { font-size: 1.4rem; line-height: 1; }
.group-link strong { display: block; color: #e8f5f0; font-size: 0.95rem; }
.group-link em {
  display: block;
  font-style: normal;
  font-size: 0.8rem;
  color: #8bb3a4;
  margin-top: 0.15rem;
}

.map-wrap {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border, #2d5a4a);
  box-shadow: 0 8px 28px rgba(0,0,0,0.35);
  aspect-ratio: 16 / 10;
  background: #0a1814;
}
.york-map {
  width: 100%;
  height: 100%;
  min-height: 280px;
  border: 0;
  display: block;
}
.map-caption {
  font-size: 0.82rem;
  color: #8bb3a4;
  margin: 0.65rem 0 0.75rem;
  line-height: 1.45;
}
.county-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.county-chips li {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: rgba(0, 200, 150, 0.1);
  border: 1px solid rgba(0, 200, 150, 0.25);
  color: #9ec9b8;
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  color: #fff;
}
.share-btn.fb { background: #1877f2; }
.share-btn.tw { background: #111; border: 1px solid #333; }
.share-btn.wa { background: #25d366; color: #062018; }
.share-btn.tg { background: #229ed9; }
.share-btn.copy { background: #1e4038; color: #c8e0d6; border: 1px solid #2d5a4a; }
.share-btn:hover { filter: brightness(1.08); }


/* Fullscreen / PoC radio-only */
.radio-panel:fullscreen,
.radio-panel:-webkit-full-screen {
  background: #050d0a;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}
.radio-panel:fullscreen .virtual-radio,
.radio-panel:-webkit-full-screen .virtual-radio {
  max-width: 420px;
  width: 100%;
}
body.radio-only-mode .site-header,
body.radio-only-mode .how-strip,
body.radio-only-mode .net-banner,
body.radio-only-mode .info-panel,
body.radio-only-mode .channel-guide,
body.radio-only-mode .call-log-section,
body.radio-only-mode .links-section,
body.radio-only-mode .map-section,
body.radio-only-mode .share-section,
body.radio-only-mode .site-footer,
body.radio-only-mode .mic-gate {
  display: none !important;
}
body.radio-only-mode .console-main {
  grid-template-columns: 1fr;
  max-width: 440px;
  margin: 0 auto;
  padding: 0.5rem;
  min-height: 100vh;
}
body.radio-only-mode .radio-panel {
  width: 100%;
}
body.radio-only-mode .ptt-btn {
  max-width: none;
  width: 100%;
  min-height: 120px;
  font-size: 1.4rem;
}
.ptt-map-hint {
  text-align: center;
  font-size: 0.7rem;
  color: #6a9080;
  margin: 0 0 0.5rem;
  line-height: 1.35;
}
