/* Brand: change these to re-skin the app. */
:root {
  --brand: #7cc7ff;
  --brand-strong: #b7e2ff;
  --brand-ink: #04121f;
  --live: #ff4d6d;

  --bg: #070b12;
  --bg-glow: #10233a;
  --surface: #0e1521;
  --surface-2: #142033;
  --border: #22324a;
  --text: #e8eef7;
  --muted: #8ea0b8;
  --ok: #4ade80;
  --warn: #fbbf24;
  --danger: #f87171;

  --radius: 14px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, monospace;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --brand: #0a6fc2;
    --brand-strong: #075493;
    --brand-ink: #ffffff;
    --live: #e11d48;
    --bg: #f4f7fb;
    --bg-glow: #dcebfa;
    --surface: #ffffff;
    --surface-2: #eef3f9;
    --border: #d5dfeb;
    --text: #0d1724;
    --muted: #556479;
    --ok: #15803d;
    --warn: #b45309;
    --danger: #dc2626;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  line-height: 1.55;
  color: var(--text);
  background: radial-gradient(1200px 500px at 50% -200px, var(--bg-glow), transparent), var(--bg);
}

a { color: var(--brand); }

main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

h1, h2 { line-height: 1.2; margin: 0 0 8px; }
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); letter-spacing: -0.02em; }
h2 { font-size: 1.1rem; }
p { margin: 0 0 12px; }

.site-header, .site-footer {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px;
}
.site-footer { color: var(--muted); font-size: 0.85rem; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
}
.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: conic-gradient(from 200deg, var(--brand), var(--brand-strong), var(--brand));
  box-shadow: 0 0 18px color-mix(in srgb, var(--brand) 55%, transparent);
}

.hero { padding: 24px 0 4px; }
.lede { font-size: 1.1rem; color: var(--muted); max-width: 56ch; }
.eyebrow {
  margin: 0 0 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
}
.dj { color: var(--muted); font-size: 1.1rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-quiet { background: transparent; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.stack .field { margin-bottom: 0; }
.field-label { font-weight: 600; font-size: 0.9rem; }
.optional, .hint { color: var(--muted); font-weight: 400; font-size: 0.85rem; }

input {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
input:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.mono { font-family: var(--mono); font-size: 0.9em; overflow-wrap: anywhere; }

.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-strong); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--brand); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }

.alert { padding: 12px 16px; border-radius: 10px; border: 1px solid; margin: 0; }
.alert-error { border-color: var(--danger); color: var(--danger); }
.alert-warn { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.alert-ok { border-color: var(--ok); }

.steps { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.step { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); }
.step strong { color: var(--text); }
.step-n {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--brand);
  color: var(--brand);
  font-weight: 700;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.9rem;
}
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.status[data-status='live'] { border-color: var(--live); color: var(--live); }
.status[data-status='live'] .status-dot { background: var(--live); animation: pulse 1.6s ease-in-out infinite; }
.status[data-status='unknown'] .status-dot { background: var(--warn); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 60%, transparent); }
  50% { box-shadow: 0 0 0 6px transparent; }
}

.settings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}
.settings div { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.settings dt { font-size: 0.8rem; color: var(--muted); }
.settings dd { margin: 0; font-weight: 600; }

.tips { padding-left: 20px; margin: 0; }
.tips li { margin-bottom: 8px; }

details { border-top: 1px solid var(--border); padding: 12px 0 0; margin-top: 12px; }
summary { cursor: pointer; font-weight: 600; }
details ol { padding-left: 20px; }
details li { margin-bottom: 6px; }

.controls { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; justify-content: space-between; }
.controls form { display: flex; flex-direction: column; gap: 6px; }

/* Listener player */
.player { text-align: center; padding: 32px 20px; margin-top: 4vh; }
.player-controls { display: flex; flex-direction: column; align-items: center; gap: 18px; margin: 28px 0 12px; }
.play {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  background: var(--brand);
  box-shadow: 0 0 40px color-mix(in srgb, var(--brand) 45%, transparent);
  transition: transform 0.15s ease;
}
.play:hover:not(:disabled) { transform: scale(1.04); }
.play:disabled { opacity: 0.4; cursor: default; box-shadow: none; }
.play-icon {
  width: 0;
  height: 0;
  margin-left: 6px;
  border-style: solid;
  border-width: 16px 0 16px 26px;
  border-color: transparent transparent transparent var(--brand-ink);
}
.play.is-playing .play-icon {
  width: 26px;
  height: 26px;
  margin: 0;
  border: none;
  background: var(--brand-ink);
  border-radius: 4px;
}
.volume input { width: min(240px, 70vw); accent-color: var(--brand); padding: 0; background: none; border: none; }
.player-message { min-height: 1.5em; font-weight: 500; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 480px) {
  .copy-row { flex-wrap: wrap; }
  .copy-row input { flex-basis: 100%; }
  .card { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .status-dot { animation: none !important; }
  .play { transition: none; }
}
