:root {
  --bg0: #0c1110;
  --bg1: #121a18;
  --ink: #e8f0ec;
  --muted: #8fa39a;
  --line: rgba(232, 240, 236, 0.12);
  --accent: #b8ff3c;
  --accent-dim: rgba(184, 255, 60, 0.16);
  --danger: #ff6b4a;
  --font-display: "Syne", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg0);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.45;
}

body {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(184, 255, 60, 0.08), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(70, 140, 120, 0.18), transparent 50%),
    linear-gradient(180deg, #101816 0%, var(--bg0) 45%, #0a0e0d 100%);
}

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

.top,
main,
.foot {
  position: relative;
  z-index: 1;
  width: min(1280px, calc(100% - 2rem));
  margin-inline: auto;
}

body.watch-page .top .brand {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
}

.top {
  padding: 2.75rem 0 1.25rem;
  animation: rise 0.7s ease both;
}

.brand {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.8rem, 9vw, 5.5rem);
  letter-spacing: -0.04em;
  line-height: 0.9;
  color: var(--ink);
  text-decoration: none;
  text-transform: lowercase;
}

.brand:hover {
  color: var(--accent);
}

.tag {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stage {
  margin: 0.5rem 0 1.75rem;
  animation: rise 0.55s ease both;
}

.theater {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 0;
  border: 1px solid var(--line);
  background: #050807;
  min-height: min(70vh, 720px);
}

.theater-video {
  min-width: 0;
  background: #000;
  display: flex;
  align-items: center;
}

.theater-video video,
.stage video {
  display: block;
  width: 100%;
  max-height: min(70vh, 720px);
  background: #000;
  border: 0;
}

.theater-chat {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: linear-gradient(180deg, #0e1513 0%, #0a100e 100%);
  max-height: min(70vh, 720px);
  min-height: 280px;
}

.chat-head {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 0.65rem 0.85rem 1rem;
  font-size: 0.82rem;
  line-height: 1.35;
}

.chat-line {
  margin: 0 0 0.45rem;
  word-break: break-word;
  animation: chatIn 0.18s ease both;
}

.chat-line.is-new {
  background: var(--accent-dim);
}

.parent-link {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.parent-link a {
  color: var(--accent);
  text-decoration: none;
}

.parent-link a:hover {
  text-decoration: underline;
}

@keyframes chatIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-user {
  font-weight: 500;
}

.chat-body {
  color: var(--ink);
}

.chat-empty {
  color: var(--muted);
  padding: 0.5rem 0;
}

.stage-meta {
  margin-top: 0.9rem;
}

@media (max-width: 860px) {
  .theater {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .theater-chat {
    border-left: 0;
    border-top: 1px solid var(--line);
    max-height: 40vh;
  }
}

.stage-meta h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.25rem, 3vw, 1.85rem);
  letter-spacing: -0.02em;
}

.stage-meta p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
}

.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.75rem 0.35rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.tab:hover {
  color: var(--ink);
}

.tab.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.status {
  color: var(--muted);
  font-size: 0.82rem;
  min-height: 1.2em;
}

.list {
  display: grid;
  gap: 0;
  padding-bottom: 3rem;
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem 1.25rem;
  align-items: baseline;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
  width: 100%;
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  color: inherit;
  font: inherit;
  transition: background 0.2s ease, padding-left 0.2s ease;
  animation: rise 0.5s ease both;
}

.row:nth-child(1) { animation-delay: 0.02s; }
.row:nth-child(2) { animation-delay: 0.05s; }
.row:nth-child(3) { animation-delay: 0.08s; }
.row:nth-child(4) { animation-delay: 0.11s; }
.row:nth-child(5) { animation-delay: 0.14s; }

.row:hover,
.row.is-playing {
  background: var(--accent-dim);
  padding-left: 0.5rem;
}

.row-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.row-meta {
  color: var(--muted);
  font-size: 0.78rem;
  grid-column: 1 / -1;
}

.row-dur {
  color: var(--accent);
  font-size: 0.78rem;
  white-space: nowrap;
}

.empty {
  padding: 2rem 0;
  color: var(--muted);
}

.foot {
  padding: 0 0 2.5rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .row {
    grid-template-columns: 1fr;
  }

  .row-dur {
    justify-self: start;
  }
}
