:root {
  /* Base: deep forest at your feet, dusk-blue sky overhead, slate-grey surfaces */
  --bg: #0d1913;
  --bg-sky: #0c1a26;
  --panel: #16261d;
  --panel-2: #1e3428;
  --ink: #eef3ee;
  --muted: #93a89b;
  --line: rgba(147, 168, 155, 0.18);

  /* Accents from the road: highway "go" green + highway-sign yellow */
  --green: #2fa25c;
  --green-soft: rgba(47, 162, 92, 0.15);
  --hi: #f4c22b;
  --hi-soft: rgba(244, 194, 43, 0.14);

  --sky: #4aa8ff; /* the "you" dot */
  --live: #ff5a4f; /* on-air indicator */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  /* forest floor rising into a deep evening sky */
  background: linear-gradient(180deg, var(--bg-sky) 0%, var(--bg) 55%) fixed;
  background-color: var(--bg);
  min-height: 100vh;
}

#app {
  max-width: 720px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand h1 {
  font-size: 1.15rem;
  margin: 0;
  letter-spacing: 0.2px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 0 rgba(255, 90, 79, 0.6);
}

.dot.live {
  background: var(--live);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 90, 79, 0.55);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(255, 90, 79, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 90, 79, 0);
  }
}

.status {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: right;
  max-width: 55%;
}

#map {
  height: 240px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  z-index: 0;
}

.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  gap: 14px;
  transition: border-color 0.3s;
}

.card.speaking {
  border-color: var(--hi);
  box-shadow: 0 0 0 1px var(--hi-soft), 0 8px 30px rgba(0, 0, 0, 0.4);
}

.np-art {
  width: 74px;
  height: 74px;
  border-radius: 12px;
  flex: 0 0 auto;
  background: var(--hi-soft) center/cover no-repeat;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
}

.np-art::after {
  content: "📻";
}

.np-art.has-img::after {
  content: "";
}

.np-body {
  min-width: 0;
}

.np-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--hi);
  font-weight: 700;
}

.np-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 2px 0 6px;
}

.np-script {
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
  font-size: 0.96rem;
}

.card.idle .np-script {
  color: var(--muted);
}

.controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

button {
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.05s, opacity 0.2s;
}

button:active {
  transform: scale(0.99);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Green = go */
button.primary {
  background: var(--green);
  color: #06140c;
  font-weight: 700;
}

button.secondary {
  background: var(--green-soft);
  color: #7fd6a0;
  border-color: rgba(47, 162, 92, 0.3);
}

button.tertiary {
  background: rgba(238, 243, 238, 0.04);
  color: var(--muted);
  border-color: var(--line);
}

.voice-picker {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--panel);
}

.voice-picker .np-label {
  display: block;
  margin-bottom: 8px;
}

.vp-row {
  display: flex;
  gap: 10px;
}

#voice-select {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 0.95rem;
}

.vp-btn {
  width: auto;
  flex: 0 0 auto;
  padding: 11px 16px;
  background: var(--green-soft);
  color: #7fd6a0;
  border: 1px solid rgba(47, 162, 92, 0.3);
  font-size: 0.9rem;
}

.log-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px 14px;
  background: var(--panel);
}

.log-wrap summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 6px 0;
}

#log {
  list-style: none;
  margin: 0;
  padding: 4px 0 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#log li {
  border-left: 2px solid var(--hi-soft);
  padding-left: 12px;
}

#log .lt {
  font-weight: 600;
  font-size: 0.9rem;
}

#log .ls {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

/* Access gate */
.rr-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: linear-gradient(180deg, var(--bg-sky), var(--bg));
  display: grid;
  place-items: center;
  padding: 24px;
}

.rr-gate-card {
  width: 100%;
  max-width: 360px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
}

.rr-gate-badge {
  font-size: 1.8rem;
}

.rr-gate-card h2 {
  margin: 8px 0 4px;
}

.rr-gate-card p {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 18px;
}

.rr-gate-card input {
  width: 100%;
  padding: 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 1rem;
  margin-bottom: 12px;
}

.rr-gate-card button {
  background: var(--green);
  color: #06140c;
  font-weight: 700;
}

.rr-gate-err {
  color: var(--live);
  font-size: 0.85rem;
  min-height: 1.2em;
  margin-top: 10px;
}
