/* The live stream player. Two columns on a desktop, stacked on anything narrow. */
.stream-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  padding: 18px;
  align-items: start;
  max-width: 1600px;
  margin: 0 auto;
}
@media (max-width: 1000px) {
  .stream-page { grid-template-columns: minmax(0, 1fr); }
}

.stream-stage { padding: 14px; display: flex; flex-direction: column; gap: 12px; }

.stream-board {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2, #f4f4f0);
  border: 1px solid var(--line, #e3e3dd);
  display: grid;
  place-items: center;
}
.stream-board svg { width: 100%; height: 100%; display: block; }

.curtain {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center; padding: 24px;
  background: color-mix(in srgb, currentColor 6%, transparent);
  backdrop-filter: blur(2px);
}
.curtain.hidden { display: none; }
.curtain strong { font-size: 16px; }
.curtain span { font-size: 13px; color: var(--muted, #6b6b63); max-width: 42ch; }

/* transport ------------------------------------------------------------- */
.stream-transport { display: flex; align-items: center; gap: 12px; }
.track {
  position: relative; flex: 1; height: 8px; border-radius: 999px; cursor: pointer;
  background: var(--line, #e3e3dd); overflow: hidden;
}
.track-buffered, .track-played {
  position: absolute; inset: 0 auto 0 0; border-radius: 999px; width: 0;
}
/* buffered is what has arrived; played is where the clock is inside it */
.track-buffered { background: var(--line-strong, #cfcfc6); }
.track-played { background: var(--accent, #e5484d); }

.stream-status {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted, #6b6b63);
}
.stream-status .spacer { flex: 1; }
.dot { width: 8px; height: 8px; border-radius: 999px; background: #b9b9b1; flex: none; }
.dot.working { background: #e6a23c; animation: pulse 1.2s ease-in-out infinite; }
.dot.live { background: #2e9e5b; }
.dot.buffering { background: #e6a23c; }
.dot.done { background: #2e9e5b; }
.dot.failed { background: #d64545; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* side panel ------------------------------------------------------------ */
.stream-side {
  padding: 14px;
  display: flex; flex-direction: column; gap: 14px;
  max-height: calc(100vh - 110px);
}
.stream-form { display: flex; flex-direction: column; gap: 10px; }
.stream-actions { display: flex; gap: 8px; }
.stream-actions .btn { flex: 1; }

.stream-log-head { display: flex; align-items: baseline; justify-content: space-between; }
.stream-log {
  flex: 1; min-height: 120px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px;
}
.log-row {
  display: flex; gap: 8px; align-items: baseline;
  padding: 5px 7px; border-radius: 6px;
  background: color-mix(in srgb, currentColor 7%, transparent);
}
.log-name {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em;
  opacity: 0.55; flex: none; min-width: 56px;
}
.log-detail { color: inherit; overflow-wrap: anywhere; }
.log-error .log-name, .log-error .log-detail { color: #d64545; }
.log-scene .log-name { color: #2e9e5b; }
