@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/Geist-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/GeistMono-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

@property --sync-ring-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

:root {
  color-scheme: dark;
  --font-sans: "Geist", "Geist Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --bg: #090706;
  --blood-site: #ac231f;
  --bg-2: #120d0d;
  --panel: rgba(18, 16, 15, 0.86);
  --panel-strong: rgba(27, 24, 23, 0.94);
  --surface: #171312;
  --surface-2: #211b19;
  --text: #fff7ed;
  --muted: rgba(255, 247, 237, 0.62);
  --faint: rgba(255, 247, 237, 0.38);
  --line: rgba(255, 247, 237, 0.13);
  --line-strong: rgba(255, 247, 237, 0.22);
  --accent: #f42a24;
  --accent-deep: #8f0d0a;
  --accent-soft: #ff6a55;
  --steel: #a5a5a5;
  --amber: #c7a45b;
  --danger: #ff423a;
  --ok: #5ed98a;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --digit-dur: 500ms;
  --digit-distance: 8px;
  --digit-stagger: 70ms;
  --digit-blur: 2px;
  --digit-ease: cubic-bezier(0.34, 1.45, 0.64, 1);
  --digit-dir-x: 0;
  --digit-dir-y: 1;
  --text-swap-dur: 200ms;
  --text-swap-translate-y: 8px;
  --text-swap-blur: 2px;
  --text-swap-ease: ease-out;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --app-height: 100dvh;
}

@keyframes t-digit-pop-in {
  0% {
    transform: translate(
      calc(var(--digit-distance) * var(--digit-dir-x)),
      calc(var(--digit-distance) * var(--digit-dir-y))
    );
    opacity: 0;
    filter: blur(var(--digit-blur));
  }

  100% {
    transform: translate(0, 0);
    opacity: 1;
    filter: blur(0);
  }
}

.t-digit-group {
  display: inline-flex;
  align-items: baseline;
}

.t-digit {
  display: inline-block;
  will-change: transform, opacity, filter;
}

.t-digit-group.is-animating .t-digit {
  animation: t-digit-pop-in var(--digit-dur) var(--digit-ease) both;
}

.t-digit-group.is-animating .t-digit[data-stagger="1"] {
  animation-delay: var(--digit-stagger);
}

.t-digit-group.is-animating .t-digit[data-stagger="2"] {
  animation-delay: calc(var(--digit-stagger) * 2);
}

.t-text-swap {
  display: inline-block;
  transform: translateY(0);
  filter: blur(0);
  opacity: 1;
  transition:
    transform var(--text-swap-dur) var(--text-swap-ease),
    filter var(--text-swap-dur) var(--text-swap-ease),
    opacity var(--text-swap-dur) var(--text-swap-ease);
  will-change: transform, filter, opacity;
}

.t-text-swap.is-exit {
  transform: translateY(calc(var(--text-swap-translate-y) * -1));
  filter: blur(var(--text-swap-blur));
  opacity: 0;
}

.t-text-swap.is-enter-start {
  transform: translateY(var(--text-swap-translate-y));
  filter: blur(var(--text-swap-blur));
  opacity: 0;
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .t-digit-group .t-digit {
    animation: none !important;
  }

  .t-text-swap {
    transition: none !important;
  }
}

@keyframes syncRing {
  to {
    --sync-ring-angle: 360deg;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: var(--app-height);
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  letter-spacing: 0;
}

body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 800;
  transition:
    transform 150ms var(--ease-out),
    background-color 150ms var(--ease-out),
    border-color 150ms var(--ease-out),
    color 150ms var(--ease-out);
}

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

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(244, 42, 36, 0.82);
  outline-offset: 3px;
}

a {
  color: inherit;
}

.grain-layer {
  display: none;
}

.grain-layer::after {
  content: "";
  position: fixed;
  inset: 0;
  opacity: 0.2;
  background:
    linear-gradient(90deg, rgba(244, 42, 36, 0.16), transparent 12%, transparent 88%, rgba(244, 42, 36, 0.16)),
    repeating-linear-gradient(90deg, transparent 0 26px, rgba(255, 247, 237, 0.035) 26px 27px);
}

.vnvnc-reveal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  pointer-events: none;
  overflow: hidden;
}

.vnvnc-curtain {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
  background: #f42a24;
  transition: transform 420ms var(--ease-in-out);
}

.vnvnc-curtain-left {
  left: 0;
  transform-origin: left center;
}

.vnvnc-curtain-right {
  right: 0;
  transform-origin: right center;
}

.vnvnc-reveal-logo {
  position: relative;
  z-index: 1;
  width: min(178px, 42vw);
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.24));
  transition: opacity 220ms var(--ease-out), transform 420ms var(--ease-in-out);
}

.vnvnc-revealed .vnvnc-curtain-left {
  transform: translateX(-104%);
}

.vnvnc-revealed .vnvnc-curtain-right {
  transform: translateX(104%);
}

.vnvnc-revealed .vnvnc-reveal-logo {
  opacity: 0;
  transform: scale(0.74);
}

.eyebrow {
  margin: 0;
  color: var(--accent-soft);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.primary-button {
  color: #fff7ed;
  background:
    linear-gradient(180deg, rgba(255, 143, 121, 0.32), rgba(244, 42, 36, 0.9)),
    var(--accent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 18px 38px rgba(93, 8, 6, 0.32);
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 247, 237, 0.08);
}

.danger-button {
  color: #fff7ed;
  background: #53100f;
  border: 1px solid rgba(255, 66, 58, 0.34);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.icon-button span {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 247, 237, 0.18);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1;
}

.icon-button img,
.button-icon,
.dj-play-button strong img {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  filter: invert(94%) sepia(8%) saturate(820%) hue-rotate(326deg) brightness(108%);
}

.audience-ready-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.audience-ready-button .button-icon {
  width: 34px;
  height: 34px;
}

/* Audience */

.audience-shell {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: var(--app-height);
  min-height: var(--app-height);
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  background: var(--bg);
}

.audience-shell .grain-layer {
  display: none;
}

.stage-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: var(--app-height);
  display: block;
  background: #090706;
}

.audience-overlay {
  position: fixed;
  inset: 0 0 auto 0;
  width: 100vw;
  height: var(--app-height);
  z-index: 1;
  display: grid;
  place-items: center;
  padding:
    max(22px, var(--safe-top))
    max(18px, env(safe-area-inset-right))
    max(24px, var(--safe-bottom))
    max(18px, env(safe-area-inset-left));
  background: #050404;
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}

.audience-overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.02);
}

.ready-panel {
  width: min(520px, calc(100vw - 32px));
  display: grid;
  justify-items: center;
  gap: 24px;
  text-align: center;
}

.audience-logo {
  width: min(184px, 46vw);
  height: auto;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.46));
}

.audience-shell .eyebrow {
  display: none;
}

.countdown {
  display: none;
  width: 100%;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(7rem, 38vw, 18rem);
  line-height: 0.9;
  font-weight: 900;
  color: var(--text);
  text-shadow: 0 6px 0 rgba(92, 8, 7, 0.5);
}

.ready-message,
.thanks-message {
  display: none;
  width: min(620px, 100%);
  text-align: center;
}

.ready-message strong,
.ready-message span,
.thanks-message strong {
  display: block;
  letter-spacing: 0;
}

.ready-message strong {
  color: #fff7ed;
  font-size: clamp(4.6rem, 19vw, 8.6rem);
  line-height: 0.9;
  font-weight: 900;
}

.ready-message span {
  margin-top: 22px;
  color: rgba(255, 247, 237, 0.74);
  font-size: clamp(1.25rem, 5.8vw, 2.4rem);
  line-height: 1.08;
  font-weight: 900;
}

.audience-overlay.is-countdown {
  background: #050404;
}

.audience-overlay.is-countdown .ready-panel {
  width: 100%;
  gap: 0;
}

.audience-overlay.is-countdown .audience-logo,
.audience-overlay.is-countdown .status-line,
.audience-overlay.is-countdown .audience-ready-button,
.audience-overlay.is-countdown .audience-hint {
  display: none;
}

.audience-overlay.is-countdown .countdown {
  display: block;
}

.audience-overlay.is-ready .audience-logo,
.audience-overlay.is-ready .status-line,
.audience-overlay.is-ready .audience-ready-button,
.audience-overlay.is-ready .audience-hint {
  display: none;
}

.audience-overlay.is-ready .ready-message {
  display: block;
}

.audience-ready-mode,
.audience-overlay.is-ready,
.audience-overlay.is-thanks {
  background: #ffffff;
  color: #050505;
}

.audience-overlay.is-ready .ready-panel,
.audience-overlay.is-thanks .ready-panel {
  width: min(620px, calc(100vw - 36px));
  min-height: calc(var(--app-height) - max(120px, var(--safe-top)) - max(64px, var(--safe-bottom)));
  align-content: center;
}

.audience-overlay.is-ready .ready-message strong {
  color: #050505;
  font-size: clamp(4.2rem, 18vw, 8.6rem);
  line-height: 0.9;
  overflow-wrap: anywhere;
}

.audience-overlay.is-ready .ready-message span {
  color: #050505;
  font-size: clamp(1.25rem, 5.2vw, 2.35rem);
  line-height: 1.06;
  overflow-wrap: anywhere;
}

.audience-overlay.is-thanks .audience-logo,
.audience-overlay.is-thanks .status-line,
.audience-overlay.is-thanks .audience-ready-button,
.audience-overlay.is-thanks .ready-message,
.audience-overlay.is-thanks .audience-hint {
  display: none;
}

.audience-overlay.is-thanks .thanks-message {
  display: grid;
  justify-items: center;
  gap: clamp(28px, 6vh, 64px);
}

.thanks-message img {
  width: min(82vw, 520px);
  max-height: 44vh;
  object-fit: contain;
}

.thanks-message strong {
  color: #050505;
  font-size: clamp(2.4rem, 10vw, 5.8rem);
  line-height: 0.95;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.status-line {
  min-height: 1.5em;
  color: rgba(255, 247, 237, 0.78);
  font-size: 1rem;
  line-height: 1.45;
}

.audience-hint {
  max-width: 320px;
  margin: 0;
  color: rgba(255, 247, 237, 0.56);
  font: 0.94rem/1.4 var(--font-sans);
  font-weight: 700;
}

.audience-ready-button {
  width: min(430px, 100%);
  max-width: 100%;
  min-height: 104px;
  border-radius: 10px;
  font-size: clamp(1.55rem, 7vw, 2.35rem);
  letter-spacing: 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 26px 60px rgba(244, 42, 36, 0.28);
}

.audience-ready-button.is-prepared {
  border: 1px solid rgba(94, 217, 138, 0.42);
  background:
    linear-gradient(180deg, rgba(94, 217, 138, 0.26), rgba(18, 79, 45, 0.88)),
    #124f2d;
  color: #eaffef;
}

.audience-ready-button.is-listening {
  border-color: rgba(244, 42, 36, 0.5);
  background: rgba(244, 42, 36, 0.14);
  color: #ffd6cf;
}

.meter {
  width: min(320px, 100%);
  height: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 247, 237, 0.13);
  border-radius: 8px;
  background: rgba(255, 247, 237, 0.09);
}

.meter-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent), #fff7ed);
  transition: width 180ms var(--ease-out);
}

.corner-status {
  position: fixed;
  z-index: 2;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  padding: 7px 9px;
  border: 1px solid rgba(255, 247, 237, 0.16);
  border-radius: 8px;
  background: rgba(9, 7, 6, 0.62);
  color: rgba(255, 247, 237, 0.72);
  font: 0.72rem/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(12px);
}

.corner-status.is-hidden {
  display: none;
}

.torch-video {
  position: fixed;
  width: 1px;
  height: 1px;
  left: -10px;
  bottom: -10px;
  opacity: 0;
  pointer-events: none;
}

/* Admin */

.admin-shell {
  min-height: 100dvh;
  overflow: auto;
  background:
    radial-gradient(circle at 56% 48%, rgba(255, 48, 43, 0.08), transparent 34%),
    radial-gradient(circle at 20% 0%, rgba(87, 242, 135, 0.04), transparent 22%),
    #080707;
}

.admin-shell::before,
.admin-shell::after {
  display: none;
}

.admin-page {
  width: min(1520px, calc(100% - 56px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.brand-lockup {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 30px;
}

.brand-logo {
  width: 82px;
  max-height: 82px;
  height: auto;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.45));
}

.admin-topbar h1 {
  margin: 0;
  color: #f6f1eb;
  font-size: clamp(2rem, 3vw, 3.05rem);
  line-height: 1;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.connection-pill {
  flex: 0 0 auto;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border: 1px solid rgba(95, 255, 155, 0.25);
  border-radius: 8px;
  background: rgba(38, 180, 95, 0.12);
  color: rgba(246, 241, 235, 0.66);
  font-size: 1.05rem;
  line-height: 1;
  font-weight: 800;
  white-space: nowrap;
}

.connection-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.72;
}

.connection-pill.is-online {
  border-color: rgba(95, 255, 155, 0.25);
  background: rgba(38, 180, 95, 0.12);
  color: #a9ffc8;
}

.connection-pill.is-offline {
  border-color: rgba(255, 48, 43, 0.28);
  background: rgba(255, 48, 43, 0.12);
  color: #ffb0ac;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(720px, 1fr) minmax(360px, 448px);
  gap: 16px;
  align-items: start;
}

.shadow-ring {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.operator-console,
.qr-panel {
  background:
    radial-gradient(circle at 58% 48%, rgba(255, 48, 43, 0.07), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.018));
}

.operator-console {
  min-width: 0;
  padding: 32px 24px 24px;
  display: grid;
  gap: 22px;
}

.console-status {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, auto) minmax(180px, 1fr);
  align-items: center;
  gap: clamp(14px, 2vw, 34px);
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.console-status span,
.program-control > span,
.readiness-strip span,
.section-heading h2,
.timeline-meta > span:first-child,
.offset-readout span,
.audience-stats span {
  color: rgba(246, 241, 235, 0.54);
  font-size: 0.95rem;
  line-height: 1;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.state-block {
  width: fit-content;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  gap: 13px;
  padding: 0 18px;
  background: rgba(87, 242, 135, 0.09);
  color: #8dfc9a;
}

.state-block img {
  width: 29px;
  height: 29px;
  filter: invert(75%) sepia(70%) saturate(473%) hue-rotate(75deg) brightness(105%);
}

#stateValue {
  display: inline-block;
  color: #8dfc9a;
  font-size: 1.05rem;
  line-height: 1;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.timecode {
  color: #f6f1eb;
  font: 2.7rem/1 var(--font-mono);
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-align: center;
}

.timeline-readout {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.sync-readout {
  justify-self: end;
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.sync-readout strong {
  color: #f6f1eb;
  max-width: 100%;
  overflow-wrap: anywhere;
  font: clamp(1rem, 1.7vw, 1.35rem)/1 var(--font-sans);
  font-weight: 850;
}

.sync-readout strong span {
  color: #8dfc9a;
  font-family: var(--font-mono);
}

.console-section {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.program-section {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.program-control {
  position: relative;
  display: grid;
  gap: 10px;
}

.program-control::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: 18px;
  width: 22px;
  height: 22px;
  pointer-events: none;
  background: currentColor;
  color: rgba(246, 241, 235, 0.84);
  mask: url("/assets/icons/chevron-down.svg") center / contain no-repeat;
}

select,
input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 0 16px;
  background: rgba(0, 0, 0, 0.28);
  color: #f6f1eb;
  outline: none;
  transition: border-color 150ms var(--ease-out), background-color 150ms var(--ease-out);
}

select {
  height: 58px;
  border-radius: 8px;
  padding-right: 52px;
  appearance: none;
  font-size: 1.05rem;
  font-weight: 800;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 12px 30px rgba(0, 0, 0, 0.18);
}

input:focus,
select:focus {
  border-color: rgba(255, 48, 43, 0.7);
  background: rgba(0, 0, 0, 0.42);
}

option {
  background: #0b0909;
  color: #f6f1eb;
}

.readiness-strip {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 0.8vw, 14px);
  justify-content: stretch;
}

.hidden-metric {
  display: none;
}

.readiness-strip > div,
.audience-stats > div {
  min-height: 72px;
  display: grid;
  grid-template-columns: clamp(28px, 3vw, 42px) minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: clamp(7px, 0.7vw, 12px);
  padding: 13px clamp(9px, 0.9vw, 16px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.035));
  color: #c7ffd8;
  overflow: hidden;
}

.readiness-strip img,
.audience-stats img {
  grid-row: 1 / span 2;
  align-self: center;
  width: clamp(28px, 2.7vw, 33px);
  height: clamp(28px, 2.7vw, 33px);
  padding: 5px;
  border-radius: 7px;
  background: rgba(87, 242, 135, 0.12);
  filter: invert(75%) sepia(70%) saturate(473%) hue-rotate(75deg) brightness(105%);
  box-shadow: 0 0 18px rgba(87, 242, 135, 0.24);
}

.readiness-strip strong,
.audience-stats strong {
  color: #dfffe9;
  font: clamp(0.9rem, 0.88vw, 1.06rem)/1.06 var(--font-mono);
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.readiness-strip span,
.readiness-strip strong {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.readiness-strip span {
  font-size: clamp(0.68rem, 0.72vw, 0.9rem);
  line-height: 1.06;
}

.launch-section,
.sync-section,
.progress-section,
.checklist-panel,
.log-panel {
  padding: 14px;
  background: rgba(0, 0, 0, 0.16);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.section-heading h2 {
  margin: 0;
  color: #f6f1eb;
  font-size: 1.15rem;
  line-height: 1;
  font-weight: 900;
}

.section-heading span {
  color: rgba(246, 241, 235, 0.56);
  font-size: 0.82rem;
  font-weight: 750;
  text-align: right;
}

.section-heading strong {
  color: #f6f1eb;
  font: inherit;
  font-family: var(--font-mono);
}

.mode-badge {
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.switch-toggle {
  width: fit-content;
  display: inline-grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  color: #f6f1eb;
  cursor: pointer;
}

.switch-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  width: 54px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f6f1eb;
  transition: transform 150ms var(--ease-out), background-color 150ms var(--ease-out);
}

.switch-toggle input:checked + .switch-track {
  border-color: rgba(255, 48, 43, 0.55);
  background: rgba(255, 48, 43, 0.32);
}

.switch-toggle input:checked + .switch-track::after {
  transform: translateX(24px);
  background: #ffffff;
}

.switch-toggle strong,
.switch-toggle em {
  display: block;
}

.switch-toggle strong {
  font-size: 1.05rem;
  line-height: 1.1;
  font-weight: 850;
}

.switch-toggle em {
  margin-top: 3px;
  color: rgba(246, 241, 235, 0.56);
  font-style: normal;
  font-size: 0.85rem;
  line-height: 1.2;
  font-weight: 650;
}

.launch-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 26px;
  align-items: center;
}

.rehearsal-block {
  display: grid;
  align-content: center;
}

.launch-main {
  display: grid;
  gap: 10px;
}

.dj-play-button {
  width: 100%;
  min-height: 104px;
  display: grid;
  place-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 207, 123, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #ff403a 0%, #f51e19 100%);
  color: #fff7ed;
  box-shadow:
    0 0 44px rgba(255, 48, 43, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.dj-play-button strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  font-size: 2.35rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dj-play-button strong img,
.icon-button img {
  width: 22px;
  height: 22px;
  filter: invert(94%) sepia(8%) saturate(820%) hue-rotate(326deg) brightness(108%);
}

.dj-play-button strong img {
  width: 58px;
  height: 58px;
}

.launch-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, auto));
  gap: 10px;
}

.secondary-button,
.danger-button,
.copy-button {
  min-height: 44px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 850;
}

.secondary-button {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.055));
  color: #f6f1eb;
}

.danger-button {
  border: 1px solid rgba(255, 48, 43, 0.32);
  background: rgba(159, 21, 19, 0.34);
  color: #ffd6cf;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.countdown-button {
  width: 100%;
  min-height: 44px;
  border-color: rgba(255, 48, 43, 0.5);
  background: rgba(255, 48, 43, 0.08);
  color: #f6f1eb;
}

.countdown-button img {
  width: 20px;
  height: 20px;
}

.show-stop-button {
  width: 100%;
  min-height: 54px;
  border-color: rgba(255, 48, 43, 0.55);
  background: rgba(159, 21, 19, 0.42);
}

.operator-console:not(.is-live):not(.is-paused) .show-stop-button {
  display: none;
}

.operator-console.is-live .countdown-button,
.operator-console.is-paused .countdown-button {
  display: none;
}

.operator-console:not(.is-live):not(.is-paused) .launch-actions {
  display: none;
}

.operator-console.is-live .launch-actions,
.operator-console.is-paused .launch-actions {
  display: none;
}

.operator-console:not(.is-live):not(.is-paused) #pauseButton,
.operator-console:not(.is-live):not(.is-paused) #resumeButton,
.operator-console:not(.is-live):not(.is-paused) #stopButton {
  display: none;
}

.operator-console.is-live #resumeButton,
.operator-console.is-paused #pauseButton {
  display: none;
}

.launch-guard {
  min-height: 36px;
  display: grid;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid rgba(87, 242, 135, 0.22);
  border-radius: 12px;
  background: rgba(87, 242, 135, 0.08);
  color: #c7ffd8;
  font: 0.84rem/1.25 var(--font-mono);
  font-weight: 750;
}

.launch-guard.is-warning {
  border-color: rgba(255, 204, 102, 0.25);
  background: rgba(255, 204, 102, 0.1);
  color: #ffe1a3;
}

.trigger-link {
  width: fit-content;
  color: rgba(246, 241, 235, 0.62);
  font-size: 0.82rem;
  line-height: 1.25;
  font-weight: 750;
  text-decoration-color: rgba(246, 241, 235, 0.28);
}

.sync-nudge-panel {
  display: grid;
  grid-template-columns: 84px 84px 128px 84px 84px;
  gap: 12px;
  justify-content: end;
  align-items: stretch;
}

.sync-nudge-panel button {
  min-height: 50px;
  padding: 0 10px;
  font: 0.9rem/1 var(--font-mono);
  font-weight: 850;
}

.offset-readout {
  display: grid;
  place-items: center;
  gap: 7px;
  padding: 10px;
  background: rgba(255, 48, 43, 0.05);
}

.offset-readout strong {
  color: #f6f1eb;
  font: 1.35rem/1 var(--font-mono);
  font-weight: 850;
}

.hidden-inputs {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.timeline-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(246, 241, 235, 0.62);
  font-size: 0.86rem;
  font-weight: 750;
}

.timeline-meta strong {
  color: #f6f1eb;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.timeline {
  height: 17px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
}

.timeline-fill {
  width: 0%;
  height: 100%;
  position: relative;
  border-radius: inherit;
  min-width: 10px;
  background: linear-gradient(90deg, #ff302b, #ff6a55);
  transition: width 150ms var(--ease-out);
}

.timeline-fill::after {
  content: "";
  position: absolute;
  top: -4px;
  right: -7px;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 247, 237, 0.86);
  border-radius: 50%;
  background: #ff302b;
  box-shadow: 0 0 18px rgba(255, 48, 43, 0.48);
}

.scene-cues,
.checklist-panel,
.log-panel {
  display: none;
}

.preflight-list {
  display: grid;
  gap: 8px;
}

.preflight-item {
  min-height: 46px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  color: rgba(246, 241, 235, 0.72);
  font-size: 0.82rem;
  line-height: 1.35;
  font-weight: 700;
}

.preflight-item input {
  width: 20px;
  height: 20px;
  padding: 0;
  accent-color: #ff302b;
}

.preflight-item:has(input:checked) {
  border-color: rgba(87, 242, 135, 0.28);
  background: rgba(87, 242, 135, 0.08);
  color: #dfffe9;
}

#checklistValue.is-complete {
  color: #c7ffd8;
}

.log {
  min-height: 210px;
  max-height: 360px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.34);
  color: rgba(246, 241, 235, 0.68);
  font: 12px/1.5 var(--font-mono);
}

.audience-panel {
  position: sticky;
  top: 24px;
  min-width: 360px;
}

.qr-panel {
  padding: 36px 30px 40px;
  display: grid;
  gap: 24px;
}

.qr-frame {
  width: min(340px, 100%);
  justify-self: center;
  padding: 12px;
  border-radius: 8px;
  background: #ffffff;
}

.qr-image {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  border-radius: 4px;
  background: #ffffff;
}

.app-link {
  display: block;
  color: rgba(246, 241, 235, 0.72);
  overflow-wrap: anywhere;
  font-size: 1.05rem;
  line-height: 1.35;
  font-weight: 700;
  text-align: center;
}

.copy-button {
  width: 100%;
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.09));
  color: #f6f1eb;
}

.audience-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.audience-stats > div {
  min-height: 62px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  grid-template-rows: auto;
  border-radius: 8px;
}

.audience-stats strong {
  justify-self: end;
  align-self: center;
  font-size: 1.45rem;
}

.audience-stats img {
  grid-row: auto;
}

@media (hover: hover) and (pointer: fine) {
  .dj-play-button:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
  }

  .secondary-button:hover,
  .copy-button:hover {
    background: rgba(255, 255, 255, 0.12);
  }
}

@media (max-width: 1500px) {
  .console-status {
    grid-template-columns: minmax(160px, 1fr) minmax(190px, auto) minmax(140px, 0.8fr);
  }

  .timecode {
    font-size: clamp(2rem, 3.2vw, 2.7rem);
  }
}

@media (max-width: 1320px) {
  .admin-page {
    width: min(100% - 28px, 1200px);
    padding-top: 22px;
  }

  .brand-lockup {
    gap: 18px;
  }

  .brand-logo {
    width: 68px;
  }

  .admin-topbar h1 {
    font-size: clamp(1.8rem, 3.2vw, 2.4rem);
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .audience-panel {
    position: static;
    min-width: 0;
  }

  .qr-frame {
    width: min(320px, 100%);
  }
}

@media (max-width: 900px) {
  .admin-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .program-section,
  .console-status {
    grid-template-columns: 1fr;
  }

  .timecode,
  .sync-readout {
    justify-self: start;
    text-align: left;
  }

  .readiness-strip {
    justify-content: flex-start;
  }

  .launch-grid {
    grid-template-columns: 1fr;
  }

  .sync-nudge-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .offset-readout {
    grid-column: 1 / -1;
    order: -1;
  }
}

@media (max-width: 560px) {
  .admin-page {
    width: min(100% - 20px, 1200px);
    padding-bottom: 34px;
  }

  .brand-logo {
    width: 74px;
  }

  .admin-topbar h1 {
    font-size: 1.48rem;
    line-height: 1.04;
  }

  .operator-console,
  .qr-panel {
    border-radius: 18px;
  }

  .operator-console {
    padding: 14px;
  }

  .launch-grid,
  .readiness-strip {
    grid-template-columns: 1fr;
  }

  .launch-section,
  .sync-section,
  .progress-section {
    padding: 14px;
  }

  .timecode {
    font-size: 1.75rem;
  }

  .launch-actions,
  .sync-nudge-panel,
  .audience-stats {
    grid-template-columns: 1fr;
  }

  .dj-play-button strong {
    font-size: 1.38rem;
  }
}

/* Remote DJ trigger */

.trigger-shell {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  touch-action: manipulation;
  background:
    linear-gradient(180deg, rgba(244, 42, 36, 0.2), transparent 38%),
    repeating-linear-gradient(90deg, rgba(255, 247, 237, 0.035) 0 1px, transparent 1px 84px),
    var(--bg);
}

.trigger-shell::before,
.trigger-shell::after {
  content: "";
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 0;
  width: min(120px, 16vw);
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(244, 42, 36, 0.24), rgba(9, 7, 6, 0.05)),
    repeating-linear-gradient(90deg, rgba(255, 247, 237, 0.04) 0 1px, transparent 1px 18px);
  opacity: 0.8;
}

.trigger-shell::before {
  left: 0;
}

.trigger-shell::after {
  right: 0;
  transform: scaleX(-1);
}

.trigger-stage {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  width: min(760px, calc(100vw - 28px));
  margin: 0 auto;
  display: grid;
  align-content: center;
  gap: 16px;
  padding:
    max(24px, var(--safe-top))
    max(18px, env(safe-area-inset-right))
    max(24px, var(--safe-bottom))
    max(18px, env(safe-area-inset-left));
}

.trigger-logo {
  width: 154px;
  height: auto;
  filter: drop-shadow(0 20px 36px rgba(0, 0, 0, 0.48));
}

.trigger-stage h1 {
  margin: 0;
  min-width: 0;
  font-size: 5.2rem;
  line-height: 0.95;
  overflow-wrap: anywhere;
}

.trigger-readout {
  display: grid;
  grid-template-columns: 1fr 1.2fr 0.9fr;
  gap: 8px;
}

.trigger-readout > div {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 16, 15, 0.88);
}

.trigger-readout span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.trigger-readout strong {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  font: 1.2rem/1 var(--font-mono);
  font-weight: 900;
  white-space: nowrap;
}

.trigger-play-button {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-height: min(34dvh, 280px);
  display: grid;
  place-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 247, 237, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 247, 237, 0.2), rgba(244, 42, 36, 0.92)),
    #d50000;
  color: #fff7ed;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 28px 70px rgba(143, 13, 10, 0.48);
}

.trigger-play-button.is-live {
  border-color: rgba(94, 217, 138, 0.5);
  background:
    linear-gradient(180deg, rgba(94, 217, 138, 0.18), rgba(244, 42, 36, 0.88)),
    #d50000;
}

.trigger-play-button span {
  font: 1.05rem/1 var(--font-mono);
  font-weight: 900;
  color: rgba(255, 247, 237, 0.72);
}

.trigger-play-button strong {
  font-size: 5.6rem;
  line-height: 0.9;
  max-width: 100%;
  text-align: center;
  white-space: normal;
}

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

.trigger-note {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 247, 237, 0.62);
  font: 0.9rem/1.45 var(--font-sans);
}

@media (hover: hover) and (pointer: fine) {
  button:hover {
    transform: translateY(-1px);
  }

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

@media (max-width: 980px) {
  .admin-layout,
  .console-hero,
  .admin-grid,
  .button-row,
  .sync-nudge-panel,
  .scene-cues,
  .transport-readout,
  .readiness-strip,
  .sync-map {
    grid-template-columns: 1fr;
  }

  .admin-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    align-items: stretch;
  }

  .protocol-pill,
  .connection-pill {
    flex: 1 1 0;
  }

  .console-hero h2 {
    font-size: 1.75rem;
  }
}

@media (max-width: 520px) {
  .admin-topbar,
  .admin-layout {
    width: min(100% - 20px, 1260px);
  }

  .brand-logo {
    width: 66px;
  }

  .admin-topbar h1 {
    font-size: 1.75rem;
  }

  .topbar-actions {
    flex-direction: column;
  }

  .console-hero,
  .panel-section,
  .qr-panel,
  .checklist-panel,
  .log-panel {
    padding: 14px;
  }

  .countdown {
    font-size: 5.1rem;
  }

  .audience-logo {
    width: 96px;
  }

  .trigger-stage {
    align-content: stretch;
    width: min(100% - 20px, 760px);
  }

  .trigger-readout,
  .trigger-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .trigger-logo {
    width: 96px;
  }

  .trigger-stage h1 {
    font-size: clamp(2rem, 10vw, 2.5rem);
  }

  .trigger-readout > div {
    padding: 10px;
  }

  .trigger-readout strong {
    font-size: 0.95rem;
  }

  .trigger-controls button {
    min-height: 46px;
    padding: 0 8px;
    font-size: 0.82rem;
  }

  .trigger-play-button strong {
    font-size: clamp(2rem, 11.2vw, 2.65rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
