@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --bg: #06080f;
  --bg2: #0c101c;
  --card: #12182a;
  --card2: #181f33;
  --text: #eef2ff;
  --muted: #8b95b0;
  --dim: #5c6580;
  --accent: #00e5ff;
  --accent2: #7c5cff;
  --green: #00e5a0;
  --danger: #ff3b5c;
  --border: rgba(255,255,255,0.08);
  --glow: rgba(0,229,255,0.25);
  --font: 'Outfit', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --radius: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(0,229,255,0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(124,92,255,0.08), transparent);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #7af0ff; }

.site-header {
  padding: 1.25rem 1rem 0.5rem;
  text-align: center;
}
.brand-banner {
  max-width: min(720px, 96vw);
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 40px rgba(0,229,255,0.08);
}
.tagline {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero {
  text-align: center;
  padding: 1rem 1rem 0.5rem;
}
.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 20%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p { color: var(--muted); max-width: 520px; margin: 0.4rem auto 0; font-size: 1rem; }

.how-strip {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem;
  padding: 0.85rem 1rem; max-width: 640px; margin: 0 auto;
}
.how-step {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.8rem; font-weight: 600; color: var(--muted);
  background: var(--card); border: 1px solid var(--border);
  padding: 0.4rem 0.7rem; border-radius: 999px;
}
.how-step span {
  width: 1.3rem; height: 1.3rem; border-radius: 50%;
  background: var(--accent); color: #041018;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 800;
}

.console-main {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 320px);
  gap: 1.25rem;
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
}
@media (max-width: 860px) {
  .console-main { grid-template-columns: 1fr; }
}

.radio-panel {
  background: linear-gradient(165deg, var(--card2), var(--card));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
  box-shadow: 0 16px 48px rgba(0,0,0,0.45);
}

.virtual-radio { max-width: 400px; margin: 0 auto; }
.radio-brand {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 0.5rem; text-align: center;
}
.online-banner {
  font-size: 0.75rem; text-align: center; padding: 0.4rem 0.6rem;
  border-radius: 8px; margin-bottom: 0.65rem;
  background: rgba(0,229,160,0.1); border: 1px solid rgba(0,229,160,0.3); color: var(--green);
}
.online-banner.off {
  background: rgba(255,255,255,0.03); border-color: var(--border); color: var(--dim);
}

.radio-lcd {
  background: #050a12;
  border: 2px solid #0a3d4a;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  font-family: var(--mono);
  margin-bottom: 0.75rem;
  box-shadow: inset 0 0 24px rgba(0,229,255,0.06);
}
.lcd-top { display: flex; justify-content: space-between; font-size: 0.68rem; color: #3d8a9a; }
.lcd-channel {
  font-size: 1.85rem; font-weight: 700; color: var(--accent);
  letter-spacing: 0.04em; margin: 0.2rem 0;
}
.lcd-freq { font-size: 0.9rem; color: #7ec8d6; }
.lcd-status { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 0.4rem; font-size: 0.7rem; color: #3d8a9a; }
.lcd-bars { display: flex; gap: 3px; align-items: flex-end; height: 14px; }
.lcd-bars span { width: 5px; background: #1a3d48; border-radius: 1px; 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; }
.lcd-bars span.on { background: var(--accent); }

.channel-row { display: flex; gap: 0.4rem; align-items: center; margin-bottom: 0.55rem; }
.ch-btn, .ctrl-btn {
  flex: 1; border: 1px solid var(--border); background: var(--bg2); color: var(--text);
  border-radius: 10px; padding: 0.5rem; font-weight: 600; font-size: 0.78rem;
  cursor: pointer; font-family: var(--font);
}
.ch-btn:active, .ctrl-btn:active { transform: scale(0.97); }
.ch-display { flex: 1.3; text-align: center; font-weight: 700; font-size: 0.85rem; font-family: var(--mono); color: var(--accent); }
.radio-controls { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.35rem; margin-bottom: 0.5rem; }
.ctrl-btn.online-active { border-color: rgba(0,229,255,0.4); color: var(--accent); background: rgba(0,229,255,0.08); }
.btn-online-main {
  background: linear-gradient(135deg, var(--accent), #00a8c0) !important;
  color: #041018 !important; border: none !important; font-weight: 800 !important;
}
.btn-online-main.online-active {
  background: linear-gradient(135deg, var(--green), #00a878) !important;
}

.ptt-wrapper { text-align: center; margin: 0.6rem 0; }
.ptt-btn {
  width: min(100%, 220px); height: 120px; border-radius: 50%;
  border: 4px solid #5a1020;
  background: radial-gradient(circle at 40% 30%, #ff6b7a, #c9183a 55%, #7a0a20);
  color: #fff; font-weight: 800; font-size: 1.1rem; letter-spacing: 0.06em;
  cursor: pointer; font-family: var(--font);
  box-shadow: 0 10px 0 #4a0818, 0 14px 28px rgba(0,0,0,0.5);
  touch-action: none; user-select: none;
}
.ptt-btn:active, .ptt-btn.transmitting {
  transform: translateY(6px);
  box-shadow: 0 4px 0 #4a0818, 0 8px 16px rgba(0,0,0,0.4);
  background: radial-gradient(circle at 40% 30%, #ff8a95, #e02040 60%);
}
.ptt-label, .ptt-map-hint { font-size: 0.7rem; color: var(--dim); margin-top: 0.4rem; text-align: center; }
.peer-line { text-align: center; font-size: 0.78rem; color: var(--muted); margin-bottom: 0.4rem; }

.fx-panel { margin-top: 0.5rem; border-top: 1px solid var(--border); padding-top: 0.5rem; }
.fx-row {
  display: grid; grid-template-columns: 4.5rem 1fr 2rem; gap: 0.35rem; align-items: center;
  font-size: 0.72rem; color: var(--muted); margin-bottom: 0.3rem;
}
.fx-row input[type=range] { width: 100%; }
.fx-row .val { font-family: var(--mono); font-size: 0.68rem; text-align: right; }

.radio-log {
  margin-top: 0.65rem; max-height: 110px; overflow-y: auto;
  font-family: var(--mono); font-size: 0.68rem; color: var(--dim);
}
.radio-log .tx { color: var(--danger); }
.radio-log .rx { color: var(--green); }
.radio-log .sys { color: var(--accent); }

.info-panel {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.15rem;
}
.info-panel h2 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.info-panel p { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.75rem; }
.feature-list { list-style: none; display: grid; gap: 0.35rem; margin-bottom: 1rem; }
.feature-list li {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.88rem; padding: 0.45rem 0.6rem;
  background: var(--bg2); border-radius: 10px; border: 1px solid var(--border);
}
.legal-box {
  font-size: 0.78rem; color: var(--dim); border-left: 3px solid var(--accent2);
  padding: 0.5rem 0.75rem; background: rgba(124,92,255,0.06); border-radius: 0 8px 8px 0;
  margin-bottom: 1rem;
}
.pmr-facts h3 { font-size: 0.85rem; margin-bottom: 0.4rem; color: var(--muted); }
.pmr-facts dl { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0.25rem 0.5rem; font-size: 0.8rem; }
.pmr-facts dt { color: var(--dim); }
.pmr-facts dd { color: var(--text); }

.channel-guide, .links-section, .share-section, .map-section, .call-log-section {
  max-width: 1000px; margin: 0 auto 2rem; padding: 0 1rem;
}
.channel-guide h2, .links-section h2, .share-section h2, .map-section h2, .call-log-section h2 {
  font-size: 1.15rem; margin-bottom: 0.5rem;
}
.ch-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.45rem;
}
.ch-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 0.65rem; text-align: left; cursor: pointer; font-family: var(--font);
  color: var(--text);
}
.ch-card strong { display: block; font-family: var(--mono); color: var(--accent); font-size: 0.85rem; }
.ch-card span { font-size: 0.72rem; color: var(--muted); font-family: var(--mono); }
.ch-card em { display: block; font-style: normal; font-size: 0.68rem; color: var(--green); margin-top: 0.15rem; }
.ch-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--glow); }

.group-links { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.group-link a {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 0.85rem 1rem; background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; color: inherit;
}
.group-link a:hover { border-color: rgba(0,229,255,0.35); }
.group-link.featured a { border-color: rgba(0,229,255,0.35); }
.group-link strong { display: block; }
.group-link em { display: block; font-style: normal; font-size: 0.8rem; color: var(--muted); }

.share-buttons { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.share-btn {
  padding: 0.5rem 0.9rem; border-radius: 999px; font-weight: 700; font-size: 0.82rem;
  border: none; cursor: pointer; font-family: var(--font); color: #fff; text-decoration: none;
}
.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: var(--card2); color: var(--muted); border: 1px solid var(--border); }

.map-wrap {
  border-radius: 14px; overflow: hidden; border: 1px solid var(--border);
  aspect-ratio: 16/10; background: var(--bg2);
}
.york-map, .crew-map { width: 100%; height: 100%; min-height: 260px; border: 0; }
.map-caption { font-size: 0.82rem; color: var(--muted); margin-top: 0.5rem; }

.site-footer {
  text-align: center; padding: 2rem 1rem 3rem; color: var(--dim); font-size: 0.82rem;
  border-top: 1px solid var(--border);
}
.site-footer a { color: var(--muted); }

.mic-gate {
  position: fixed; inset: 0; z-index: 100; background: rgba(6,8,15,0.88);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.mic-gate[hidden] { display: none !important; pointer-events: none !important; }
.mic-gate-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; max-width: 360px; text-align: center;
}
.mic-gate-btn {
  background: linear-gradient(135deg, var(--accent), #00a8c0);
  color: #041018; border: none; padding: 0.7rem 1.3rem; border-radius: 999px;
  font-weight: 800; cursor: pointer; font-family: var(--font); margin-top: 0.75rem;
}
.mic-gate-skip {
  display: block; width: 100%; margin-top: 0.6rem; padding: 0.55rem;
  background: transparent; border: 1px solid var(--border); border-radius: 999px;
  color: var(--muted); cursor: pointer; font-family: var(--font);
}

.call-log-form {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 1rem; margin-bottom: 1rem;
}
.call-log-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem; margin-bottom: 0.65rem; }
@media (max-width: 600px) { .call-log-row { grid-template-columns: 1fr; } }
.call-log-form label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.call-log-form input, .call-log-form select {
  padding: 0.5rem 0.65rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font: inherit;
}
.call-log-submit {
  border: none; border-radius: 999px; padding: 0.6rem 1.2rem; font-weight: 800;
  background: linear-gradient(135deg, var(--green), #00a878); color: #041018; cursor: pointer; font-family: var(--font);
}
.call-log-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.call-log-table th, .call-log-table td { text-align: left; padding: 0.4rem; border-bottom: 1px solid var(--border); }
.section-lead { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.75rem; }

body.radio-only-mode .site-header,
body.radio-only-mode .hero,
body.radio-only-mode .how-strip,
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 { display: none !important; }
body.radio-only-mode .console-main { grid-template-columns: 1fr; max-width: 440px; min-height: 100vh; }
body.radio-only-mode .ptt-btn { width: 100%; max-width: none; min-height: 140px; font-size: 1.3rem; }

@media (max-width: 640px) {
  .radio-controls { grid-template-columns: 1fr 1fr; }
  .ptt-btn { height: 130px; width: min(78vw, 200px); }
}

.settings-section {
  max-width: 1000px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
}
.settings-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
}
.settings-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
@media (max-width: 640px) {
  .settings-row { grid-template-columns: 1fr; }
}
.settings-card label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}
.settings-card input[type=text],
.settings-card input[type=url],
.settings-card input[type=number] {
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.settings-h3 {
  font-size: 0.9rem;
  margin: 0.5rem 0 0.5rem;
  color: var(--muted);
}
.cfg-link-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr auto;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}
@media (max-width: 720px) {
  .cfg-link-row { grid-template-columns: 1fr; }
}
.cfg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}
.cfg-btn {
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.82rem;
  border: 1px solid var(--border);
  cursor: pointer;
  font-family: var(--font);
  background: var(--bg2);
  color: var(--text);
}
.cfg-btn.primary {
  background: linear-gradient(135deg, var(--accent), #00a8c0);
  color: #041018;
  border: none;
}
.cfg-btn.danger {
  color: #ff8a9a;
  border-color: rgba(255,59,92,0.35);
}
.cfg-btn.secondary:hover { border-color: var(--accent); }
.cfg-file { display: inline-flex; align-items: center; }
.cfg-status { margin-top: 0.65rem; font-size: 0.85rem; }
.cfg-status.ok { color: var(--green); }
.cfg-status.err { color: #ff8a9a; }
.cfg-hint { font-size: 0.75rem; color: var(--dim); margin-top: 0.65rem; }
.cfg-hint code { color: var(--accent); }
