/* ───────────────────── tokens ───────────────────── */
:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --bg-2: #141414;
  --bg-3: #1d1d1d;
  --fg: #ededed;
  --fg-muted: #9a9a9a;
  --fg-dim: #6a6a6a;
  --border: #2a2a2a;
  --accent: #5865f2;       /* discord blurple */
  --accent-hover: #4752c4;
  --live: #f23f5b;         /* live-red */
  --radius: 10px;
  --max-w: 1100px;
}

/* ───────────────────── reset / base ───────────────────── */
* { box-sizing: border-box; }

/* Dark, thin scrollbars that blend with the theme. Default OS scrollbars
   are visually loud on a black UI. */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--bg-3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border);
}
/* Firefox */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--bg-3) transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--bg-3);
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

/* ───────────────────── header / footer ───────────────────── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--fg);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; opacity: 0.85; }

.site-nav a {
  color: var(--fg-muted);
  margin-left: 1.5rem;
  font-size: 0.95rem;
}
.site-nav a:hover { color: var(--fg); text-decoration: none; }

.site-footer {
  max-width: var(--max-w);
  margin: 4rem auto 2rem;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--fg-dim);
  font-size: 0.85rem;
  text-align: center;
}
.site-footer a { color: var(--fg-muted); }

/* ───────────────────── layout ───────────────────── */
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  margin-top: 5rem;
}
.section-title {
  font-size: 1.5rem;
  margin: 0 0 1.5rem;
  letter-spacing: -0.02em;
}

/* ───────────────────── hero ───────────────────── */
.hero {
  padding: 5rem 0 1rem;
  max-width: 720px;
}
.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.05;
  margin: 0 0 1.25rem;
  letter-spacing: -0.035em;
  font-weight: 800;
}
.hero .lede {
  font-size: 1.15rem;
  color: var(--fg-muted);
  margin: 0 0 2.25rem;
  max-width: 56ch;
}
.hero-narrow { max-width: 560px; }

.cta-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ───────────────────── buttons ───────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 120ms, border-color 120ms;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--fg);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--fg-muted); }

/* ───────────────────── empty state ───────────────────── */
.empty-state {
  padding: 3rem 2rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.empty-heading {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.empty-sub {
  margin: 0;
  color: var(--fg-muted);
}

/* ───────────────────── how it works ───────────────────── */
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
}
.steps li {
  display: flex;
  gap: 1.25rem;
  padding: 1.5rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.step-num {
  flex-shrink: 0;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.95rem;
}
.step-body h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
}
.step-body p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.95rem;
}

/* ───────────────────── placeholder card (login) ───────────────────── */
.placeholder-card {
  padding: 2rem;
  background: var(--bg-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  margin-top: 1rem;
}
.placeholder-card p {
  margin: 0 0 1.25rem;
  color: var(--fg-muted);
  font-size: 0.95rem;
}
.back-link {
  margin-top: 2rem;
  color: var(--fg-dim);
}

/* ───────────────────── forms ───────────────────── */
.slug-form {
  margin-top: 1.5rem;
}
.slug-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}
.slug-input-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-2);
  overflow: hidden;
  transition: border-color 120ms;
}
.slug-input-wrap:focus-within {
  border-color: var(--accent);
}
.slug-prefix {
  padding: 0.75rem 0.85rem;
  background: var(--bg-3);
  color: var(--fg-muted);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.95rem;
  border-right: 1px solid var(--border);
  white-space: nowrap;
}
.slug-input-wrap input {
  flex: 1;
  padding: 0.75rem 0.9rem;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--fg);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.95rem;
  min-width: 0;
}
.slug-help {
  color: var(--fg-muted);
  font-size: 0.85rem;
  margin: 0.5rem 0 1.5rem;
}

.form-error {
  background: rgba(242, 63, 91, 0.08);
  border: 1px solid rgba(242, 63, 91, 0.3);
  color: #ff8593;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}
.form-error a { color: inherit; text-decoration: underline; }

/* ───────────────────── inline form buttons (logout etc.) ───────────────────── */
.inline-form {
  display: inline;
  margin: 0;
  padding: 0;
}
.link-button {
  background: none;
  border: 0;
  color: var(--fg-muted);
  font: inherit;
  font-size: 0.95rem;
  padding: 0;
  margin-left: 1.5rem;
  cursor: pointer;
}
.link-button:hover { color: var(--fg); }

/* ───────────────────── dashboard ───────────────────── */
.dash {
  padding-top: 3rem;
  max-width: 760px;
}
.dash-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.dash-head h1 {
  font-size: 2rem;
  margin: 0 0 0.25rem;
  letter-spacing: -0.03em;
}

.muted { color: var(--fg-muted); font-size: 0.95rem; }

/* ───────────────────── live badge ───────────────────── */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--border);
}
.live-badge.is-live {
  background: rgba(242, 63, 91, 0.12);
  border-color: rgba(242, 63, 91, 0.4);
  color: #ff8593;
}
.live-badge.is-offline {
  background: var(--bg-2);
  color: var(--fg-dim);
}
.live-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 rgba(242, 63, 91, 0.7);
  animation: live-pulse 1.6s infinite;
}
@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(242, 63, 91, 0.7); }
  70%  { box-shadow: 0 0 0 8px rgba(242, 63, 91, 0); }
  100% { box-shadow: 0 0 0 0   rgba(242, 63, 91, 0); }
}

/* ───────────────────── one-click setup card (no creds yet) ───────────────────── */
.stream-card {
  padding: 2rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.stream-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}
.stream-card.setup p { margin-bottom: 1.5rem; }

/* ───────────────────── OBS setup card (creds present) ───────────────────── */
.obs-setup {
  padding: 2rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.obs-setup h2 {
  margin: 0 0 1.5rem;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}

.obs-steps {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}
.obs-steps li {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--fg);
  font-size: 0.95rem;
}
.obs-steps .step-n {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--fg-muted);
}
.obs-steps .hl {
  background: var(--accent);
  color: white;
  padding: 0.1em 0.5em;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.obs-steps em { font-style: normal; color: var(--fg-muted); }

.obs-fields {
  display: grid;
  gap: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.obs-field label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
  margin-bottom: 0.5rem;
}
.obs-field label small {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  color: var(--fg-dim);
  margin-left: 0.5rem;
}

.copy-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.copy-row input {
  flex: 1;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.85rem;
  color: var(--fg);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9rem;
  min-width: 0;
}
.copy-row .btn {
  padding: 0.55rem 0.9rem;
  font-size: 0.85rem;
}

.btn-flash {
  background: rgba(80, 200, 120, 0.15) !important;
  border-color: rgba(80, 200, 120, 0.5) !important;
  color: #6ed99b !important;
}

/* ───────────────────── settings card (privacy etc.) ───────────────────── */
.settings-card {
  margin-top: 2rem;
  padding: 1.5rem 2rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.settings-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.settings-card .muted { margin-bottom: 1.25rem; }

.discovery-form {
  display: grid;
  gap: 0.6rem;
}
.discovery-form .radio {
  display: flex;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 120ms, background 120ms;
}
.discovery-form .radio:hover {
  border-color: var(--fg-muted);
}
.discovery-form .radio input[type="radio"] {
  margin: 0.25rem 0 0;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.discovery-form .radio:has(input:checked) {
  border-color: var(--accent);
  background: rgba(88, 101, 242, 0.06);
}
.discovery-form .radio strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}
.discovery-form .radio .muted {
  display: block;
  font-size: 0.85rem;
  margin: 0;
}

/* ───────────────────── danger zone (regenerate) ───────────────────── */
.danger-zone {
  margin-top: 2.5rem;
  padding: 1.5rem 2rem;
  background: var(--bg-2);
  border: 1px solid rgba(242, 63, 91, 0.25);
  border-radius: var(--radius);
}
.danger-zone h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: #ff8593;
  letter-spacing: 0.01em;
}
.danger-zone p { margin-top: 0.25rem; margin-bottom: 1rem; }

.btn-danger {
  background: transparent;
  border: 1px solid rgba(242, 63, 91, 0.5);
  color: #ff8593;
  font-weight: 600;
}
.btn-danger:hover:not(:disabled) {
  background: rgba(242, 63, 91, 0.1);
  border-color: rgba(242, 63, 91, 0.7);
}

/* ───────────────────── discovery (live cards on landing) ───────────────────── */
.section-count {
  display: inline-block;
  margin-left: 0.6rem;
  padding: 0.15rem 0.55rem;
  background: var(--bg-3);
  color: var(--fg-muted);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  vertical-align: middle;
}
.section-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg-muted);
  margin-left: 1rem;
  vertical-align: middle;
}
.section-link:hover { color: var(--accent); text-decoration: none; }

.live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.live-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--fg);
  transition: border-color 120ms, transform 120ms;
}
.live-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}

.live-card-thumb {
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
  position: relative;
  display: grid;
  place-items: center;
}
/* V1.5 will swap this for a real thumbnail; for now show a play-glyph */
.live-card-thumb::before {
  content: '▶';
  font-size: 2.5rem;
  color: rgba(255, 255, 255, 0.08);
}

.live-card-pill {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  background: rgba(242, 63, 91, 0.15);
  border: 1px solid rgba(242, 63, 91, 0.4);
  color: #ff8593;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}
.live-card-pill .live-dot {
  width: 0.4rem;
  height: 0.4rem;
}

.live-card-viewers {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  padding: 0.25rem 0.65rem;
  background: rgba(0, 0, 0, 0.55);
  color: var(--fg);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  backdrop-filter: blur(4px);
}

.live-card-info {
  padding: 1rem 1.25rem;
}
.live-card-info h3 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.live-card-info .muted {
  margin: 0;
  font-size: 0.85rem;
}

/* ───────────────────── channel page (viewer) ───────────────────── */
.channel-main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.5rem;
}

.player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.player-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(4px);
  text-align: center;
}
.player-overlay[hidden] { display: none; }

.overlay-content { padding: 2rem; }
.overlay-label {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg);
}
.player-overlay.is-offline .overlay-label { color: var(--fg-dim); }
.overlay-sub {
  margin-top: 0.5rem;
  color: var(--fg-muted);
  font-size: 0.95rem;
}

.spinner {
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  border: 3px solid var(--bg-3);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.unmute-hint {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.unmute-hint:hover { background: rgba(0, 0, 0, 0.85); }

.channel-info { margin-top: 1.5rem; }
.channel-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.25rem;
}
.channel-head h1 {
  font-size: 1.5rem;
  margin: 0;
  letter-spacing: -0.02em;
}

/* ───────────────────── watch layout (player + chat) ───────────────────── */
.watch-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
}
.watch-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.5rem;
  min-height: 70vh;
}
.watch-player { min-width: 0; }
.chat-side {
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: calc(100vh - 8rem);
}
.chat-head {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border);
}
.chat-head h3 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  scrollbar-width: thin;
}
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-thumb {
  background: var(--bg-3);
  border-radius: 3px;
}

.chat-msg {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
}
.chat-msg:hover { background: rgba(255, 255, 255, 0.02); }

.chat-avatar {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  overflow: hidden;
}
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; }

.chat-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-size: 0.9rem;
  line-height: 1.35;
}
.chat-name {
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 0.05rem;
}
.chat-text {
  color: var(--fg);
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.chat-system {
  text-align: center;
  color: var(--fg-dim);
  font-size: 0.8rem;
  padding: 0.4rem;
}
.chat-system strong { color: var(--fg-muted); }

.chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.chat-form input {
  flex: 1;
  min-width: 0;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55rem 0.75rem;
  color: var(--fg);
  font-size: 0.9rem;
  font-family: inherit;
}
.chat-form input:focus {
  outline: none;
  border-color: var(--accent);
}
.chat-form .btn {
  padding: 0.55rem 0.95rem;
  font-size: 0.85rem;
}

.chat-login {
  padding: 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
  text-align: center;
}
.chat-login p { margin: 0 0 0.75rem; font-size: 0.85rem; }

/* ───────────────────── chat header viewer count ───────────────────── */
.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-viewers {
  font-size: 0.78rem;
  color: var(--fg-muted);
  padding: 0.15rem 0.55rem;
  background: var(--bg-3);
  border-radius: 999px;
}

/* ───────────────────── chat header line (crown / name / pill / cam) ─── */
.chat-line {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.1rem;
}
.chat-crown {
  font-size: 0.85rem;
  filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.4));
}
.chat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.05rem 0.5rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.7rem;
  color: var(--fg-muted);
  text-decoration: none;
}
.chat-pill:hover {
  color: var(--fg);
  border-color: var(--fg-muted);
  text-decoration: none;
}
.chat-pill.is-live {
  border-color: rgba(242, 63, 91, 0.45);
  color: #ff8593;
  background: rgba(242, 63, 91, 0.08);
}
.chat-cam { font-size: 0.7rem; }

.chat-msg.is-owner {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.06), transparent 60%);
}

/* ───────────────────── channel title / byline / description ───────── */
.channel-head h1 {
  /* allow longer titles than the global name fallback */
  font-size: 1.6rem;
  line-height: 1.2;
}
.channel-byline {
  margin: 0.25rem 0 0;
  color: var(--fg-muted);
  font-size: 0.95rem;
}
.channel-byline strong { color: var(--fg); }
.channel-description {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  white-space: pre-wrap;
  color: var(--fg);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* ───────────────────── metadata form (dashboard) ───────────────────── */
.metadata-form label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
  margin: 1rem 0 0.4rem;
}
.metadata-form label:first-of-type { margin-top: 0; }
.metadata-form input[type="text"],
.metadata-form input[type="url"],
.metadata-form input[type="email"],
.metadata-form textarea {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.85rem;
  color: var(--fg);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
}
.metadata-form input[type="text"]:focus,
.metadata-form input[type="url"]:focus,
.metadata-form input[type="email"]:focus,
.metadata-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.metadata-form .field-help {
  margin: 0.3rem 0 0;
  font-size: 0.8rem;
  color: var(--fg-dim);
}
.metadata-form button[type="submit"] {
  margin-top: 1.25rem;
}

/* ───────────────────── toast ───────────────────── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 0.65rem 1.1rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg);
  opacity: 0;
  transition: opacity 240ms, transform 240ms;
  z-index: 1000;
  pointer-events: none;
}
.toast.toast-in {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.is-ok   { border-color: rgba(110, 217, 155, 0.4); color: #6ed99b; }
.toast.is-err  { border-color: rgba(242, 63, 91, 0.4);   color: #ff8593; }

/* ───────────────────── multi-view grid ───────────────────── */
.multi-main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1rem;
}
.multi-grid {
  display: grid;
  gap: 0.75rem;
}
.multi-grid[data-count="1"] { grid-template-columns: 1fr; }
.multi-grid[data-count="2"] { grid-template-columns: 1fr 1fr; }
.multi-grid[data-count="3"] { grid-template-columns: repeat(3, 1fr); }
.multi-grid[data-count="4"] { grid-template-columns: 1fr 1fr; }
.multi-grid[data-count="5"],
.multi-grid[data-count="6"] { grid-template-columns: repeat(3, 1fr); }
.multi-grid[data-count="7"],
.multi-grid[data-count="8"],
.multi-grid[data-count="9"] { grid-template-columns: repeat(3, 1fr); }
.multi-grid[data-count="10"],
.multi-grid[data-count="11"],
.multi-grid[data-count="12"] { grid-template-columns: repeat(4, 1fr); }

.multi-cell {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.multi-cell.is-live { border-color: rgba(242, 63, 91, 0.5); }
.multi-cell.is-error { border-color: rgba(242, 63, 91, 0.4); opacity: 0.5; }
.multi-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.multi-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(0deg, rgba(0,0,0,0.7), rgba(0,0,0,0));
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
}
.multi-overlay > * { pointer-events: auto; }
.multi-label {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.multi-name {
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.multi-slug {
  color: var(--fg-muted);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.75rem;
  text-decoration: none;
}
.multi-slug:hover { color: white; }
.multi-mute {
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
}
.multi-mute:hover { background: rgba(0,0,0,0.85); }
.multi-mute.is-active {
  background: var(--accent);
  border-color: var(--accent);
}

/* ───────────────────── multi-view header ───────────────────── */
.multi-header {
  margin: 0 0 1rem;
}
.multi-header h1 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}
.multi-header .muted { margin-top: 0.25rem; }

/* ───────────────────── multi-view builder ───────────────────── */
.multi-builder {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
  margin: 1.5rem 0;
  padding: 1rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 4rem;
}
.multi-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85rem;
}
.multi-check:has(input:checked) {
  border-color: var(--accent);
  background: rgba(88, 101, 242, 0.08);
}
.multi-check input[type="checkbox"] {
  accent-color: var(--accent);
  margin: 0;
}
.multi-check .live-dot {
  display: inline-block;
  margin-right: 0.35rem;
}

.multi-builder-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ───────────────────── dashboard tabs (V1.8) ───────────────────── */
.dash-tabs {
  display: flex;
  gap: 0.25rem;
  margin: 0 -0.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.dash-tab {
  background: none;
  border: 0;
  color: var(--fg-muted);
  font: inherit;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color 120ms, border-color 120ms;
}
.dash-tab:hover { color: var(--fg); }
.dash-tab.is-active {
  color: var(--fg);
  border-bottom-color: var(--accent);
}

.dash-panel { display: none; }
.dash-panel.is-active { display: block; }

/* Backend-mode chip on the Stream tab — tells streamers which SFU
   their creds are minted against so they know to re-copy after a flip. */
.backend-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  margin: 0 0 1rem;
  border-radius: 999px;
  border: 1px solid var(--border, rgba(255,255,255,0.15));
  background: rgba(255,255,255,0.04);
  color: var(--muted, #999);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.backend-badge strong { color: var(--fg); font-weight: 700; }

/* Profile-tab social link grid */
.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin: 0.5rem 0 1.5rem;
}
.social-label {
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 0.85rem !important;
  margin: 0 0 0.35rem !important;
  display: block;
  color: var(--fg-muted);
}

/* ───────────────────── /u/<slug> profile page (V1.8) ───────────────────── */
.profile-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.profile-card {
  padding: 2rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.profile-head {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-3);
  border: 2px solid var(--border);
}
.profile-avatar-fallback {
  display: grid;
  place-items: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
}
.profile-meta {
  flex: 1;
  min-width: 200px;
}
.profile-meta h1 {
  margin: 0 0 0.25rem;
  font-size: 1.8rem;
  letter-spacing: -0.02em;
}
.profile-badges {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.profile-actions { margin-left: auto; }
.profile-bio {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--bg-3);
  border-radius: var(--radius);
  white-space: pre-wrap;
  color: var(--fg);
  font-size: 0.95rem;
  line-height: 1.55;
}
.profile-links {
  margin: 1rem 0;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.profile-link {
  padding: 0.5rem 1rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg);
  font-size: 0.9rem;
  text-decoration: none;
}
.profile-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.profile-stream-meta {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.profile-stream-meta h3 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
}
.profile-title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
}

/* Generic badges — share the same pill geometry as .live-badge so
   they don't visually mismatch when shown side-by-side (profile page,
   admin tables). Only color/border vary by modifier. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--fg-muted);
}
.badge-admin {
  background: rgba(88, 101, 242, 0.15);
  border-color: rgba(88, 101, 242, 0.4);
  color: #8b97ff;
}
.badge-banned {
  background: rgba(242, 63, 91, 0.15);
  border-color: rgba(242, 63, 91, 0.4);
  color: #ff8593;
}
.badge-action {
  background: var(--bg-3);
  border-color: var(--border);
  color: var(--fg);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  text-transform: none;
  letter-spacing: 0;
}

/* ───────────────────── /admin pages (V1.8) ───────────────────── */
.admin-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.admin-nav {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.admin-nav a {
  padding: 0.75rem 1.25rem;
  color: var(--fg-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-size: 0.95rem;
  transition: color 120ms, border-color 120ms;
}
.admin-nav a:hover { color: var(--fg); text-decoration: none; }
.admin-nav a.is-active {
  color: var(--fg);
  border-bottom-color: var(--accent);
}

.admin-section h1 {
  font-size: 1.5rem;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}
.admin-filter {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0 1.25rem;
}
.admin-filter input[type="text"],
.admin-filter select {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  color: var(--fg);
  font-family: inherit;
  font-size: 0.9rem;
}
.admin-filter input[type="text"] { flex: 1; min-width: 0; }
.admin-filter input:focus,
.admin-filter select:focus { outline: none; border-color: var(--accent); }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.admin-table thead th {
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
}
.admin-table tbody td {
  padding: 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tbody tr:hover { background: var(--bg-2); }
.admin-table .user-cell strong { display: block; }
.admin-table .user-cell .muted { font-size: 0.8rem; }
.admin-table .actions-cell {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.admin-table .actions-cell .btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

/* ───────────────────── voice channel cards (/c) ───────────────────── */
.c-multi-form { display: contents; }

.c-multi-actions {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.vc-check {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  accent-color: var(--accent);
  z-index: 2;
}
.vc-link {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  font-size: 0.75rem;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-3);
  z-index: 2;
}
.vc-link:hover {
  color: var(--fg);
  border-color: var(--fg-muted);
  text-decoration: none;
}

.vc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.vc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.1rem 1.25rem 1.1rem 2.5rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 120ms, transform 120ms;
}
.vc-card:hover {
  border-color: var(--fg-muted);
  transform: translateY(-2px);
  text-decoration: none;
}
.vc-card.has-live {
  border-color: rgba(242, 63, 91, 0.45);
}
.vc-card.has-live:hover {
  border-color: rgba(242, 63, 91, 0.7);
}
.vc-card:has(input:checked) {
  border-color: var(--accent);
  background: rgba(88, 101, 242, 0.06);
}
.vc-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}
.vc-name {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
}
.vc-count {
  font-size: 0.8rem;
  color: var(--fg-muted);
  white-space: nowrap;
}
.vc-meta {
  font-size: 0.85rem;
  color: var(--fg-dim);
}
.vc-live {
  margin-top: 0.25rem;
}
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.6rem;
  background: rgba(242, 63, 91, 0.12);
  border: 1px solid rgba(242, 63, 91, 0.4);
  color: #ff8593;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.live-pill .live-dot {
  width: 0.4rem;
  height: 0.4rem;
}

/* ───────────────────── mobile ───────────────────── */
@media (max-width: 900px) {
  .watch-layout {
    grid-template-columns: 1fr;
  }
  .chat-side {
    max-height: 50vh;
  }
  .multi-grid[data-count="3"],
  .multi-grid[data-count="5"],
  .multi-grid[data-count="6"],
  .multi-grid[data-count="7"],
  .multi-grid[data-count="8"],
  .multi-grid[data-count="9"],
  .multi-grid[data-count="10"],
  .multi-grid[data-count="11"],
  .multi-grid[data-count="12"] { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .hero { padding-top: 3rem; }
  .steps li { padding: 1.25rem; gap: 1rem; }
  .watch-main { padding: 0; }
  .player-wrap { border-radius: 0; border-left: 0; border-right: 0; }
  .channel-info { padding: 1rem; }
  .chat-side { border-radius: 0; border-left: 0; border-right: 0; }
}
