:root {
  color-scheme: dark;
  --bg: #0a0d0f;
  --panel: #151918;
  --panel-strong: #1f2522;
  --text: #f3efe7;
  --muted: #a9b1aa;
  --line: rgba(255, 255, 255, 0.14);
  --red: #ff3b30;
  --gold: #d8b46a;
  --green: #5cc08b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
}

.stage {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(145deg, rgba(216, 180, 106, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(92, 192, 139, 0.09), transparent 36%),
    var(--bg);
}

.viewer {
  width: min(1180px, 100%);
}

.video-shell {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #050607;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.video-shell iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-shield {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.waiting,
.ended {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(10, 13, 15, 0.92);
  text-align: center;
}

.waiting.is-visible,
.ended.is-visible {
  display: grid;
}

.waiting-time {
  font-size: clamp(42px, 9vw, 104px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.waiting-label,
.ended-copy {
  margin-top: 14px;
  color: var(--muted);
  font-size: clamp(14px, 2.2vw, 18px);
}

.ended-title {
  font-size: clamp(24px, 4vw, 44px);
  font-weight: 700;
}

.controls {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 14px 4px 0;
}

.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 76px;
  height: 34px;
  justify-content: center;
  border: 1px solid rgba(255, 59, 48, 0.55);
  border-radius: 999px;
  background: rgba(255, 59, 48, 0.12);
  color: #ffd9d7;
  font-size: 13px;
  font-weight: 700;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(255, 59, 48, 0.16);
}

.time-stack {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
}

#clockLabel {
  font-size: 20px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

#statusLabel {
  color: var(--muted);
  font-size: 14px;
}

.sound-button {
  min-width: 112px;
  min-height: 40px;
  border: 1px solid rgba(216, 180, 106, 0.58);
  border-radius: 999px;
  background: rgba(216, 180, 106, 0.12);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
}

.sound-button:hover {
  background: rgba(216, 180, 106, 0.2);
}

.progress {
  overflow: hidden;
  width: 100%;
  height: 7px;
  margin-top: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--green));
  transition: width 450ms ease;
}

@media (max-width: 720px) {
  .stage {
    align-items: start;
    padding: 12px;
  }

  .video-shell {
    border-radius: 6px;
  }

  .controls {
    grid-template-columns: 1fr auto;
    gap: 10px;
  }

  .live-chip {
    grid-column: 1 / 2;
    justify-self: start;
  }

  .time-stack {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .sound-button {
    grid-column: 2 / 3;
    grid-row: 1;
  }
}
