:root {
  --bg: #0a0d11;
  --panel: #12171d;
  --panel-raised: #171e25;
  --line: #232b33;
  --line-bright: #34404b;
  --text: #f3f6f8;
  --muted: #8b96a2;
  --lamp: #ffb300;   /* brand accent — wordmark, focus rings, controls */
  --live: #ff3b30;   /* tally red — reserved for "this is live" state only */
}

* { box-sizing: border-box; margin: 0; }

body {
  background:
    radial-gradient(1200px 700px at 50% -10%, color-mix(in srgb, var(--lamp) 4%, transparent), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Fine broadcast-monitor grain — a filmic, non-repeating-looking texture at
   near-zero cost (one inline SVG turbulence filter, no image request). */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.wrap { width: min(960px, 100% - 2rem); margin-inline: auto; position: relative; z-index: 1; }

/* --- top bar ------------------------------------------------------------ */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
  /* hoger dan .wrap's z-index:1 — anders tekent main (later in de DOM) zich
     over de Regie-dropdown heen */
  position: relative;
  z-index: 20;
}

.wordmark {
  font-family: "Archivo Black", "Archivo", sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.wordmark span { color: var(--lamp); }
.wordmark::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--lamp);
  box-shadow: 0 0 8px color-mix(in srgb, var(--lamp) 70%, transparent);
}

.topbar-right { display: flex; align-items: center; gap: 0.9rem; }

.clock {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.onair {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
}
.onair .dot { width: 8px; height: 8px; border-radius: 50%; background: #3a444e; }
.onair.live { color: var(--live); border-color: color-mix(in srgb, var(--live) 45%, var(--line)); }
.onair.live .dot { background: var(--live); box-shadow: 0 0 10px var(--live); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* --- face-off ----------------------------------------------------------- */

.faceoff {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 1.4fr) 1fr;
  gap: 1rem;
  align-items: stretch;
  padding: 2rem 0 1.5rem;
}

.debater {
  border: 1px solid var(--line);
  border-top: 4px solid var(--dc, var(--line));
  border-radius: 10px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--dc, var(--line)) 5%, transparent), transparent 40%),
    var(--panel);
  box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.02) inset;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: box-shadow 0.3s, border-color 0.3s;
}
.debater.speaking {
  border-color: var(--dc);
  box-shadow: 0 0 24px color-mix(in srgb, var(--dc) 35%, transparent);
}
.avatar-badge {
  width: 2.9rem;
  height: 2.9rem;
  padding: 0.32rem;
  border-radius: 50%;
  background: var(--panel-raised);
  color: var(--dc);
  flex-shrink: 0;
  transition: background 0.3s;
}
.debater.speaking .avatar-badge { background: color-mix(in srgb, var(--dc) 18%, var(--panel-raised)); }
.avatar-badge svg { width: 100%; height: 100%; display: block; }

.debater .name {
  font-family: "Archivo", sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--dc);
}
.debater .company { color: var(--muted); font-size: 0.85rem; }
.debater .stance {
  margin-top: auto;
  align-self: flex-start;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--dc);
  color: var(--dc);
  border-radius: 4px;
  visibility: hidden;
}
.debater .stance.show { visibility: visible; }

.debater .mic {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  visibility: hidden;
}
.debater.speaking .mic { visibility: visible; color: var(--dc); }

/* Level meter — four bars pulsing out of phase, standing in for a live
   audio signal (the debate itself has no real waveform to read). */
.meter { display: flex; align-items: flex-end; gap: 2px; height: 11px; }
.meter i {
  display: block;
  width: 3px;
  background: currentColor;
  border-radius: 1px;
  height: 25%;
}
.debater.speaking .meter i,
.bcspeaker.speaking .meter i { animation: meter 0.9s ease-in-out infinite; }
.meter i:nth-child(1) { animation-delay: 0s; }
.meter i:nth-child(2) { animation-delay: 0.15s; }
.meter i:nth-child(3) { animation-delay: 0.3s; }
.meter i:nth-child(4) { animation-delay: 0.45s; }
@keyframes meter { 0%, 100% { height: 25%; } 50% { height: 100%; } }

.center {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  gap: 0.9rem;
  padding: 0.5rem;
}

.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  color: var(--muted);
  text-transform: uppercase;
}

.tagline {
  font-family: "Archivo", sans-serif;
  font-weight: 800;
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  line-height: 1.15;
}

#topic-form { display: flex; flex-direction: column; gap: 0.6rem; }
#topic-input {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  padding: 0.75rem 0.9rem;
}
#topic-input:focus-visible { outline: 2px solid var(--lamp); outline-offset: 1px; }
#topic-form button {
  background: var(--lamp);
  color: #14100a;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  padding: 0.75rem;
  cursor: pointer;
}
#topic-form button:disabled { opacity: 0.5; cursor: wait; }
#topic-form button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.chyron {
  display: none;
  font-family: "Archivo", sans-serif;
  font-weight: 800;
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  line-height: 1.25;
}

.status {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  min-height: 1.2em;
}

.queue { text-align: left; border-top: 1px solid var(--line); padding-top: 0.8rem; }
.queue ul { list-style: none; padding: 0.4rem 0 0; display: flex; flex-direction: column; gap: 0.35rem; }
.queue li { font-size: 0.85rem; color: var(--muted); }
.queue .chip {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  text-transform: uppercase;
}

.foot-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

/* Discreet link to the separate admin page; viewers do not need it. */
.foot-admin {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}
.foot-admin:hover { color: var(--text); }
.foot-admin:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }

.iconbtn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  padding: 0.2rem 0.55rem;
}
.iconbtn:hover { color: var(--text); border-color: var(--muted); }

.admin-tabs {
  display: flex;
  gap: 0.1rem;
  border-bottom: 1px solid var(--line);
  margin: -0.1rem -0.1rem 0.2rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.45rem 0.55rem 0.4rem;
  white-space: nowrap;
}
.admin-tab:hover { color: var(--text); }
.admin-tab[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--lamp);
}
.admin-tab:focus-visible { outline: 2px solid var(--lamp); outline-offset: -2px; }

.admin-tabpanel { display: flex; flex-direction: column; gap: 0.4rem; }
.admin-tabpanel[hidden] { display: none; }

.admin-status {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  color: var(--muted);
  text-align: right;
}

/* 1-hour live-duration alarm (see app.js's refreshStreamStatus) */
.admin-status.stream-status-warn {
  color: #ff8a7a;
  font-weight: 600;
}

.admin-section { display: flex; flex-direction: column; gap: 0.4rem; }
.admin-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}
.admin-section-title {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.admin-action-row { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.admin-action-row .admin-action { flex: 1; min-width: 7rem; }

.admin-divider { height: 1px; background: var(--line); margin: 0.15rem 0; }

.admin-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  text-align: left;
  padding: 0.5rem 0.7rem;
  cursor: pointer;
}
.admin-action[hidden] { display: none; }
.admin-action:hover { border-color: var(--muted); }
.admin-action:focus-visible { outline: 2px solid var(--lamp); outline-offset: 1px; }
.admin-action:disabled { opacity: 0.4; cursor: not-allowed; }
.admin-icon { width: 1rem; height: 1rem; flex-shrink: 0; }

.admin-action.admin-primary {
  background: var(--lamp);
  color: #14100a;
  border-color: var(--lamp);
  font-weight: 700;
}
.admin-action.admin-primary:hover { background: color-mix(in srgb, var(--lamp) 88%, white 12%); }
.admin-action.admin-primary:disabled { background: var(--bg); color: var(--text); border-color: var(--line); font-weight: 400; }

.admin-action.admin-danger {
  color: #ff8a7a;
  border-color: color-mix(in srgb, #ff8a7a 45%, var(--line));
  background: color-mix(in srgb, #ff8a7a 8%, var(--bg));
}
.admin-action.admin-danger:hover {
  border-color: #ff8a7a;
  background: color-mix(in srgb, #ff8a7a 14%, var(--bg));
}

.pacing-switch {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  background: none;
  border: 0;
  padding: 0.3rem 0;
  font: inherit;
  cursor: pointer;
}
.pacing-switch-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  transition: color 0.2s, font-weight 0.2s;
}
/* Position-based (first/last label), not keyed to specific data-mode
   values — makes .pacing-switch a reusable two-way-toggle component rather
   than something tied to "synced"/"fast" specifically. Added 2026-08-24
   when the same switch markup/styling was reused for the admin panel's
   Google/Polly voice-provider toggle. */
.pacing-switch[aria-checked="false"] .pacing-switch-label:first-of-type,
.pacing-switch[aria-checked="true"] .pacing-switch-label:last-of-type {
  color: var(--text);
  font-weight: 700;
}
.pacing-switch-track {
  position: relative;
  flex: 1;
  min-width: 2.6rem;
  max-width: 2.6rem;
  height: 1.4rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.pacing-switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.4rem - 6px);
  height: calc(1.4rem - 6px);
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s ease, background 0.2s ease;
}
.pacing-switch[aria-checked="true"] .pacing-switch-knob {
  /* track width minus its own 2px border on each side (box-sizing:
     border-box), minus the knob diameter, minus the knob's 2px gap on
     each side — mirrors the knob's own left:2px so it lands flush
     against the right edge with the same gap it starts with on the
     left. */
  transform: translateX(calc(2.6rem - (1.4rem - 6px) - 6px));
  background: var(--lamp);
  box-shadow: 0 0 8px color-mix(in srgb, var(--lamp) 60%, transparent);
}
.pacing-switch:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; border-radius: 999px; }

.admin-input {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
  padding: 0.45rem 0.6rem;
}
.admin-input:focus-visible { outline: 2px solid var(--lamp); outline-offset: 1px; }

.cost-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-family: "IBM Plex Mono", monospace;
}
.cost-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.78rem;
}
.cost-row .cost-name { color: var(--text); letter-spacing: 0.02em; }
.cost-row .cost-value { color: var(--lamp); font-variant-numeric: tabular-nums; }
.cost-row .cost-value.cost-flat { color: var(--muted); }
.cost-row .cost-value.cost-error { color: #ff8a7a; }
.cost-sub {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: -0.3rem;
  font-variant-numeric: tabular-nums;
}

.doc-links { display: flex; flex-direction: column; gap: 0.3rem; }
.doc-links a {
  font-size: 0.78rem;
  color: var(--lamp);
  text-decoration: none;
  padding: 0.15rem 0;
}
.doc-links a:hover { text-decoration: underline; }
.doc-links a[aria-disabled="true"] { color: var(--muted); pointer-events: none; opacity: 0.5; }

/* --- transcript --------------------------------------------------------- */

.transcript { display: flex; flex-direction: column; gap: 1rem; padding-bottom: 3rem; }

.turn {
  border-left: 3px solid var(--dc, var(--line));
  background: var(--panel);
  border-radius: 0 10px 10px 0;
  padding: 0.9rem 1.1rem;
}
.turn .tag {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--dc);
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}
.turn .tag .seg { color: var(--muted); letter-spacing: 0.05em; }
.turn .text { line-height: 1.65; white-space: pre-wrap; }
.turn.streaming .text::after { content: "▍"; color: var(--dc); animation: pulse 1s infinite; }
.turn.notice { border-left-color: var(--line); color: var(--muted); font-size: 0.9rem; }
.turn.hostturn { background: color-mix(in srgb, var(--lamp) 6%, var(--panel)); }

/* --- footer / history --------------------------------------------------- */

.foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 1rem 0 2rem;
  display: flex;
  gap: 1.5rem;
}
.foot a, a.back { color: var(--muted); font-size: 0.85rem; }
.foot a:hover, a.back:hover { color: var(--text); }

.episodes { list-style: none; padding: 2rem 0 3rem; display: flex; flex-direction: column; gap: 0.6rem; }
.episodes a {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  color: var(--text);
  text-decoration: none;
}
.episodes a:hover { border-color: var(--muted); }
.episodes .num { font-family: "IBM Plex Mono", monospace; color: var(--muted); font-size: 0.8rem; }
.episodes .topic { flex: 1; }
.episodes .chip {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  text-transform: uppercase;
}
.episodes .chip.finished { color: #6fcf8f; border-color: #2c4436; }

h1.pagetitle { font-family: "Archivo", sans-serif; font-weight: 800; padding-top: 2rem; }

@media (max-width: 720px) {
  .faceoff { grid-template-columns: 1fr; }
  .debater { flex-direction: row; align-items: center; gap: 0.8rem; }
  .debater .stance, .debater .mic { margin: 0; }
}

@media (max-width: 560px) {
  .clock { display: none; }
  .wordmark { font-size: 0.85rem; letter-spacing: 0.16em; gap: 0.4rem; }
  .admin-tab { padding-inline: 0.4rem; font-size: 0.62rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

#comment-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}
#comment-form .comment-name { max-width: 8rem; }
#comment-form .comment-hint {
  flex-basis: 100%;
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
}
#comment-form .comment-hint code {
  font-family: "IBM Plex Mono", monospace;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05rem 0.3rem;
}
