:root {
  color-scheme: dark;
  --ink: #0c0d11;
  --paper: #e8e4dc;
  --muted: #a69f92;
  --line: rgba(232, 228, 220, 0.16);
  --heat: #ff6544;
  --heat-soft: rgba(255, 101, 68, 0.22);
  --ready: #c4f26b;
  --status-color: var(--muted);
  --stream-color: #d4a85f;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--ink);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--paper);
  background:
    radial-gradient(circle at 84% 24%, rgba(255, 101, 68, 0.13), transparent 26rem),
    radial-gradient(circle at 8% 96%, rgba(99, 104, 166, 0.15), transparent 34rem),
    var(--ink);
  font-family: "Fragment Mono", monospace;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--ready);
  outline-offset: 4px;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  opacity: 0.36;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
}

.room-shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 30px clamp(22px, 5vw, 78px) 22px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 28px;
}

.topline,
.footer-line,
.screen-topline,
.room-meta,
.actions {
  display: flex;
  align-items: center;
}

.topline,
.footer-line {
  justify-content: space-between;
}

.wordmark {
  color: var(--paper);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-decoration: none;
}

.room-meta,
.footer-line,
.screen-topline {
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.09em;
}

.room-meta {
  gap: 9px;
}

.room-code {
  color: var(--paper);
}

.meta-divider {
  color: var(--line);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--stream-color);
  box-shadow: 0 0 10px var(--stream-color);
}

.room-shell[data-stream-status="live"] {
  --stream-color: var(--ready);
}

.room-shell[data-stream-status="offline"] {
  --stream-color: #76716a;
}

.room-shell[data-stream-status="live"] .live-dot,
.room-shell[data-stream-status="unknown"] .live-dot {
  animation: pulse 2.2s ease-in-out infinite;
}

#stream-status {
  color: var(--stream-color);
}

.room-shell[data-player-state="connecting"] {
  --status-color: var(--heat);
}

.room-shell[data-player-state="connecting"] .live-dot {
  animation: pulse 1.5s ease-in-out infinite;
}

.room-shell[data-player-state="error"] {
  --status-color: var(--heat);
}

.stage {
  display: grid;
  grid-template-columns: minmax(250px, 0.72fr) minmax(0, 1.45fr);
  align-items: center;
  gap: clamp(32px, 7vw, 120px);
  padding: clamp(18px, 4vh, 56px) 0;
}

.stage-copy {
  max-width: 410px;
}

.eyebrow {
  margin: 0 0 20px;
  color: var(--heat);
  font-size: 0.67rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: "Bodoni Moda", Georgia, serif;
  font-size: clamp(3.7rem, 8vw, 7.8rem);
  font-weight: 500;
  line-height: 0.8;
  letter-spacing: -0.075em;
}

.intro {
  max-width: 340px;
  margin: 32px 0 28px;
  color: var(--muted);
  font-family: "Bodoni Moda", Georgia, serif;
  font-size: 1.14rem;
  line-height: 1.35;
}

.access-note {
  max-width: 290px;
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  line-height: 1.6;
  text-transform: uppercase;
}

.watch-button {
  appearance: none;
  border: 1px solid var(--heat);
  padding: 13px 15px 12px 17px;
  display: inline-flex;
  align-items: center;
  gap: 34px;
  color: var(--ink);
  background: var(--heat);
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.watch-button:hover,
.watch-button:focus-visible {
  color: var(--paper);
  background: transparent;
  transform: translateY(-2px);
}

.watch-button:disabled {
  cursor: default;
  color: var(--ink);
  background: var(--muted);
  border-color: var(--muted);
  transform: none;
}

.new-window {
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-underline-offset: 4px;
}

.screen-wrap {
  position: relative;
}

.screen-glow {
  position: absolute;
  z-index: -1;
  inset: 12% -7%;
  opacity: 0.9;
  filter: blur(45px);
  background: linear-gradient(122deg, transparent 10%, var(--heat-soft), transparent 72%);
  transform: rotate(-3deg);
}

.screen-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #06070a;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
}

.screen-frame::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  opacity: 0.22;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(232, 228, 220, 0.07), transparent);
  transform: translateX(-100%);
  animation: screen-sweep 8s ease-in-out infinite;
}

.screen-topline {
  position: absolute;
  z-index: 2;
  inset: 0 0 auto;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to bottom, rgba(12, 13, 17, 0.82), transparent);
  pointer-events: none;
}

.screen-topline span:last-child {
  color: var(--status-color);
}

.screen-placeholder {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 16px;
  padding: 50px 24px 34px;
  color: var(--muted);
  background: radial-gradient(circle at 50% 48%, rgba(232, 228, 220, 0.04), transparent 37%);
  transition: opacity 260ms ease, visibility 260ms ease;
}

.placeholder-mark {
  color: rgba(232, 228, 220, 0.16);
  font-family: "Bodoni Moda", Georgia, serif;
  font-size: clamp(5rem, 12vw, 10rem);
  line-height: 0.7;
}

.placeholder-copy {
  display: grid;
  justify-items: center;
  gap: 8px;
  max-width: 320px;
}

.screen-placeholder p {
  margin: 0;
}

.placeholder-eyebrow {
  color: var(--status-color);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.placeholder-message {
  color: var(--paper);
  font-family: "Bodoni Moda", Georgia, serif;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  line-height: 1.1;
  text-align: center;
}

#screen-placeholder .watch-button {
  margin-top: 4px;
}

#stream-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  transition: opacity 300ms ease;
}

.is-playing #stream-player {
  opacity: 1;
}

.is-playing .screen-placeholder {
  visibility: hidden;
  opacity: 0;
}

.is-playing .screen-frame::before {
  opacity: 0;
}

.screen-note {
  margin: 14px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-line {
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 0.65rem;
}

@keyframes pulse {
  50% {
    opacity: 0.4;
    box-shadow: 0 0 4px var(--stream-color);
  }
}

@keyframes screen-sweep {
  12%,
  100% {
    transform: translateX(100%);
  }
}

@media (max-width: 820px) {
  .room-shell {
    padding-top: 22px;
  }

  .stage {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .screen-wrap {
    order: -1;
  }

  .stage-copy {
    max-width: 520px;
  }

  h1 {
    font-size: clamp(4.3rem, 19vw, 7rem);
  }
}

@media (max-width: 520px) {
  .room-meta > span {
    display: none;
  }

  .room-meta > .live-dot,
  .room-meta > #stream-status {
    display: inline;
  }

  .footer-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .watch-button {
    min-width: min(100%, 260px);
    justify-content: space-between;
  }

  .screen-note {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .placeholder-mark {
    font-size: 5rem;
  }

  .screen-placeholder {
    padding-top: 44px;
  }
}

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