.live-page {
  --live: #ff3b30;
  --screen-radius: 18px;
}

.live-onair {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0 auto;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.live-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.55);
  animation: live-beat 2.4s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

@keyframes live-beat {
  0% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.55); }
  70% { box-shadow: 0 0 0 0.55rem rgba(255, 59, 48, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}

.live-viewers {
  color: var(--mute);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.live-viewers[hidden] { display: none; }

.live {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 21rem);
  gap: 1.75rem;
  align-items: start;
  padding: 1.5rem var(--pad) 3rem;
}

.live-stage {
  min-width: 0;
}

.live-screen {
  position: relative;
  width: min(100%, calc((100dvh - 13rem) * 16 / 9));
  min-width: min(100%, 20rem);
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--screen-radius);
  overflow: hidden;
  isolation: isolate;
}

.live-mount,
.live-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.live-gate {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 4vw, 3rem);
  padding: clamp(1.25rem, 5vw, 3.5rem);
  background:
    radial-gradient(120% 90% at 85% 10%, rgba(41, 151, 255, 0.14), transparent 60%),
    #0a0a0b;
}

.live-gate[hidden] { display: none; }

.live-gate-art {
  flex: 0 0 auto;
  height: min(78%, 22rem);
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.7);
}

.live-gate-art[hidden] { display: none; }

.live-gate-copy {
  display: grid;
  gap: 0.6rem;
  min-width: 0;
  max-width: 30rem;
}

.live-gate-title {
  margin: 0;
  font-size: clamp(1.5rem, 3.4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-wrap: balance;
}

.live-gate-meta {
  margin: 0;
  color: #a1a1a6;
  font-size: clamp(0.92rem, 1.4vw, 1.05rem);
  font-variant-numeric: tabular-nums;
}

.live-join {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 46px;
  margin-top: 0.65rem;
  padding: 0 1.4rem 0 1.15rem;
  border: 0;
  border-radius: 980px;
  background: var(--cta);
  color: var(--cta-ink);
  font: 600 1rem/1 var(--type);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease;
}

.live-join:hover { background: #fff; transform: scale(1.03); }
.live-join:active { transform: scale(0.98); }
.live-join:disabled { opacity: 0.45; cursor: default; transform: none; }

.live-break {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.35rem;
  padding: 1.5rem;
  background: #0a0a0b;
  text-align: center;
}

.live-break[hidden] { display: none; }

.live-break-lead {
  margin: 0;
  color: #a1a1a6;
  font-size: 1rem;
}

.live-break-time {
  margin: 0;
  font-size: clamp(3rem, 9vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.live-break-next {
  margin: 0.6rem 0 0;
  max-width: 32rem;
  font-size: 1.15rem;
  font-weight: 600;
  text-wrap: balance;
}

.live-return {
  position: absolute;
  left: 1rem;
  bottom: 4.5rem;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 40px;
  padding: 0 1.05rem 0 0.9rem;
  border: 0;
  border-radius: 980px;
  background: var(--live);
  color: #fff;
  font: 600 0.95rem/1 var(--type);
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.6);
  cursor: pointer;
}

.live-return:hover { background: #ff5147; }
.live-return[hidden] { display: none; }

/* Sits exactly over the embed's own fullscreen button (bottom-right corner of
   a cross-origin player), so that corner toggles our fullscreen instead. */
.live-theater {
  position: absolute;
  right: 0;
  bottom: 1px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ececec;
  cursor: pointer;
}

/* The embed hides its controls once the pointer leaves the iframe for this
   button, so we draw a matching icon in the same spot while hovered. */
.live-theater svg {
  box-sizing: border-box;
  width: 30px;
  height: 30px;
  padding: 8px;
  border-radius: 6px;
  background: #171717;
  opacity: 0;
}
.live-theater:hover svg,
.live-theater:focus-visible svg { opacity: 1; }
.live-theater .live-theater-exit,
.live-theater[aria-pressed="true"] .live-theater-enter { display: none; }
.live-theater[aria-pressed="true"] .live-theater-exit { display: block; }

.live-theater[hidden] { display: none; }
.live-theater:focus-visible { outline: none; }
.live-theater:focus-visible svg { outline: 2px solid var(--blue); outline-offset: 1px; }

.live-now {
  display: grid;
  gap: 0.9rem;
  width: min(100%, calc((100dvh - 13rem) * 16 / 9));
  margin-top: 1.15rem;
}

.live-now-head {
  display: grid;
  gap: 0.3rem;
}

.live-now h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  text-wrap: balance;
}

.live-meta {
  margin: 0;
  color: var(--mute);
  font-size: 0.95rem;
}

.live-meta:empty { display: none; }

.live-progress {
  display: grid;
  gap: 0.45rem;
}

.live-progress[hidden] { display: none; }

.live-track {
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.live-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.5s linear;
}

.live-clock {
  display: flex;
  justify-content: space-between;
  margin: 0;
  color: var(--mute);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.live-side {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: calc(100dvh - 6.5rem);
  min-height: 44rem;
}

.live-side-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ---- Vote ---- */

.live-poll {
  display: grid;
  gap: 0.75rem;
}

.live-poll-head {
  display: grid;
  gap: 0.2rem;
}

.live-poll-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.live-poll-hide,
.live-poll-show {
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--mute);
  font: 600 0.85rem/1.2 var(--type);
  cursor: pointer;
}

.live-poll-hide:hover,
.live-poll-show:hover { color: var(--ink); }

.live-poll-show {
  width: 100%;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  background: var(--fill);
  text-align: left;
}

.live-poll-show[hidden] { display: none; }

.live-poll.is-collapsed .live-poll-body,
.live-poll.is-collapsed .live-poll-status,
.live-poll.is-collapsed .live-poll-hide { display: none; }

.live-poll.is-collapsed .live-side-title { font-size: 0.95rem; color: var(--mute); }

.live-side.is-poll-hidden .live-poll { display: none; }

.live-poll-status {
  margin: 0;
  color: var(--mute);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  text-wrap: pretty;
}

.live-options {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.live-option {
  position: relative;
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.45rem 0.75rem 0.45rem 0.45rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--fill);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s ease, background 0.2s ease, opacity 0.3s ease;
}

.live-option:hover:not(:disabled) { background: #232325; }
.live-option:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.live-option:disabled { cursor: default; }
.live-option.is-mine { border-color: var(--blue); }
.live-option.is-winner { border-color: var(--ink); }
.live-option.is-out { opacity: 0.45; }

.live-option-shot {
  position: relative;
  z-index: 1;
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  background: var(--line);
  overflow: hidden;
}

.live-option-shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.live-option-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.live-option-title {
  overflow: hidden;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-option-meta {
  color: var(--mute);
  font-size: 0.82rem;
}

.live-option-count {
  position: relative;
  z-index: 1;
  color: #d2d2d7;
  font-size: 0.88rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.live-option-bar {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.live-option-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: rgba(41, 151, 255, 0.16);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.live-option.is-winner .live-option-fill { background: rgba(245, 245, 247, 0.14); }

.live-poll-foot {
  margin: 0;
  color: var(--mute);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.live-poll-foot[hidden] { display: none; }

/* ---- Chat ---- */

.live-chat {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1 1 auto;
  min-height: 0;
}

.live-chat-log {
  flex: 1 1 auto;
  min-height: 9rem;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  background: var(--fill);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.live-chat-empty {
  margin: 0;
  color: var(--mute);
  font-size: 0.9rem;
}

.live-chat-empty[hidden] { display: none; }

.live-msg {
  position: relative;
  margin: 0;
  padding: 0.25rem 0.35rem;
  margin-left: -0.35rem;
  margin-right: -0.35rem;
  border-radius: 8px;
  font-size: 0.92rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.live-msg:hover,
.live-msg.is-selected {
  background: rgba(255, 255, 255, 0.06);
}

.live-msg.is-flash {
  animation: live-msg-flash 1.4s ease;
}

@keyframes live-msg-flash {
  0%, 100% { background: transparent; }
  15%, 55% { background: rgba(100, 210, 255, 0.28); }
}

.live-msg-reply {
  display: block;
  width: 100%;
  margin: 0 0 0.2rem;
  padding: 0.2rem 0.5rem;
  border: 0;
  border-left: 2px solid rgba(100, 210, 255, 0.7);
  border-radius: 0 6px 6px 0;
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.live-msg-reply:hover { background: rgba(255, 255, 255, 0.1); }

.live-msg-reply-nick {
  display: block;
  color: #64d2ff;
  font-size: 0.78rem;
  font-weight: 600;
}

.live-msg-reply-text {
  display: block;
  color: var(--mute);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-msg-actions {
  display: none;
  gap: 0.5rem;
  margin-top: 0.15rem;
}

.live-msg.is-selected .live-msg-actions { display: inline-flex; }

.live-msg-nick {
  margin-right: 0.4rem;
  font-weight: 600;
}

.live-msg-nick::after { content: ":"; }

.live-msg-nick.c0 { color: #64d2ff; }
.live-msg-nick.c1 { color: #ff9f0a; }
.live-msg-nick.c2 { color: #30d158; }
.live-msg-nick.c3 { color: #ff6482; }
.live-msg-nick.c4 { color: #bf9af5; }
.live-msg-nick.c5 { color: #ffd60a; }
.live-msg-nick.c6 { color: #66d4cf; }
.live-msg-nick.c7 { color: #ff8a65; }

.live-msg-text {
  color: #e5e5ea;
  font-family: var(--type), "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.live-msg-tools {
  display: inline-flex;
  gap: 0.6rem;
  margin-left: 0.5rem;
}

.live-chat-more {
  position: absolute;
  left: 50%;
  bottom: 6.75rem;
  transform: translateX(-50%);
  min-height: 32px;
  padding: 0 0.9rem;
  border: 0;
  border-radius: 980px;
  background: var(--ink);
  color: #000;
  font: 600 0.85rem/1 var(--type);
  cursor: pointer;
}

.live-chat-more[hidden] { display: none; }

.live-chat-form {
  display: grid;
  gap: 0.5rem;
}

.live-reply {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.4rem;
  padding: 0.4rem 0.55rem;
  border-radius: 10px;
  background: rgba(100, 210, 255, 0.12);
  border-left: 2px solid #64d2ff;
}

.live-reply[hidden] { display: none; }

.live-reply-jump {
  display: grid;
  gap: 0.1rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}

.live-reply-label {
  color: #64d2ff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.live-reply-nick {
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
}

.live-reply-text {
  color: var(--mute);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-reply-cancel {
  margin: 0;
  padding: 0 0.35rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--mute);
  font: 600 1.2rem/1 var(--type);
  cursor: pointer;
}

.live-reply-cancel:hover { color: var(--ink); }

.live-nick {
  display: grid;
  gap: 0.3rem;
}

.live-nick[hidden],
.live-me[hidden] { display: none; }

.live-label {
  color: var(--mute);
  font-size: 0.85rem;
}

.live-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.live-input {
  width: 100%;
  min-height: 42px;
  padding: 0 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #000;
  color: var(--ink);
  font: 0.95rem var(--type);
}

.live-input::placeholder { color: #6e6e73; }
.live-input:focus { outline: none; border-color: var(--blue); }

.live-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: end;
}

.live-compose-field {
  position: relative;
  min-width: 0;
}

.live-compose-field .live-input {
  padding-right: 2.6rem;
}

.live-emoji-btn {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
}

.live-emoji-btn:hover,
.live-emoji-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.08);
  opacity: 1;
}

.live-emoji-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.4rem);
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(8, 1.7rem);
  gap: 0.2rem;
  width: max-content;
  max-width: min(100vw - 2rem, 17.5rem);
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #141416;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.live-emoji-panel[hidden] { display: none; }

.live-emoji-panel button {
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.live-emoji-panel button:hover,
.live-emoji-panel button:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.live-send {
  min-height: 42px;
  padding: 0 1rem;
  border: 0;
  border-radius: 10px;
  background: var(--cta);
  color: var(--cta-ink);
  font: 600 0.92rem/1 var(--type);
  cursor: pointer;
}

.live-send:disabled { opacity: 0.5; cursor: default; }

.live-me {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin: 0;
  color: var(--mute);
  font-size: 0.85rem;
}

.live-me b { color: var(--ink); font-weight: 600; }

.live-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.live-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.live-chat-note {
  min-height: 1.2em;
  margin: 0;
  color: #ff6961;
  font-size: 0.85rem;
}

.live-debug {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 20;
  margin: 0;
  padding: 0.85rem 1rem;
  opacity: 0.92;
  border-radius: 12px;
  background: var(--fill);
  color: #d2d2d7;
  font: 0.78rem/1.55 ui-monospace, "SF Mono", Consolas, monospace;
  white-space: pre-wrap;
}

.live-debug[hidden] { display: none; }

@media (max-width: 900px) {
  .live {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    padding-top: 1rem;
  }

  .live-screen,
  .live-now {
    width: 100%;
  }

  .live-side {
    position: static;
    height: auto;
    min-height: 0;
  }

  .live-chat-log {
    flex: none;
    height: min(55dvh, 26rem);
  }
}

@media (max-width: 600px) {
  .live {
    padding-left: 0;
    padding-right: 0;
  }

  .live-screen { border-radius: 0; }

  .live-now,
  .live-side {
    padding: 0 var(--pad);
  }

  .live-gate-art { display: none; }

  .live-return { bottom: 3.75rem; left: 0.75rem; }
}

/* Theater: our own fullscreen. Video on the left, chat beside it, so the
   embed's bottom-right controls stay uncovered. JS sets .is-theater both for
   the Fullscreen API and for the CSS-only fallback. */
.live.is-theater {
  --live-panel-w: clamp(13rem, 30vw, 22rem);
  position: fixed;
  inset: 0;
  z-index: 40;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  padding: 0;
  margin: 0;
  background: #000;
  overflow: hidden;
}

.live-page.is-theater .nav { display: none; }

.live.is-theater .live-stage { height: 100%; }

.live.is-theater .live-screen {
  width: auto;
  height: 100%;
  min-width: 0;
  margin-right: 0;
  aspect-ratio: auto;
  border-radius: 0;
}

.live.is-theater .live-now,
.live.is-theater .live-debug { display: none; }

/* Chat overlays the film: transparent until the pointer is over the panel. */
.live.is-theater .live-side {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 4.5rem;
  z-index: 6;
  width: var(--live-panel-w);
  height: auto;
  min-height: 0;
  padding: 0.85rem 0.85rem 0.75rem;
  border-bottom-left-radius: 14px;
  background: transparent;
  box-sizing: border-box;
  transition: background 0.2s ease, backdrop-filter 0.2s ease;
}

.live.is-theater .live-side:hover,
.live.is-theater .live-side:focus-within {
  background: rgba(10, 10, 11, 0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.live.is-theater .live-poll {
  flex: 0 0 auto;
  max-height: 38%;
  overflow: auto;
  scrollbar-width: thin;
}

.live.is-theater .live-chat { min-height: 0; }

.live.is-theater .live-chat-log {
  flex: 1 1 auto;
  height: auto;
  min-height: 8rem;
  background: transparent;
}

.live.is-theater .live-side:hover .live-chat-log,
.live.is-theater .live-side:focus-within .live-chat-log {
  background: rgba(255, 255, 255, 0.05);
}

.live.is-theater .live-msg-text,
.live.is-theater .live-msg-nick,
.live.is-theater .live-side-title,
.live.is-theater .live-poll-status,
.live.is-theater .live-chat-empty,
.live.is-theater .live-me,
.live.is-theater .live-label {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 10px rgba(0, 0, 0, 0.55);
}

.live.is-theater .live-side:hover .live-msg-text,
.live.is-theater .live-side:focus-within .live-msg-text,
.live.is-theater .live-side:hover .live-msg-nick,
.live.is-theater .live-side:focus-within .live-msg-nick,
.live.is-theater .live-side:hover .live-side-title,
.live.is-theater .live-side:focus-within .live-side-title,
.live.is-theater .live-side:hover .live-poll-status,
.live.is-theater .live-side:focus-within .live-poll-status,
.live.is-theater .live-side:hover .live-chat-empty,
.live.is-theater .live-side:focus-within .live-chat-empty,
.live.is-theater .live-side:hover .live-me,
.live.is-theater .live-side:focus-within .live-me,
.live.is-theater .live-side:hover .live-label,
.live.is-theater .live-side:focus-within .live-label {
  text-shadow: none;
}

.live.is-theater .live-input,
.live.is-theater .live-send,
.live.is-theater .live-emoji-btn,
.live.is-theater .live-emoji-panel,
.live.is-theater .live-option,
.live.is-theater .live-poll-show,
.live.is-theater .live-reply {
  opacity: 0.55;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.live.is-theater .live-side:hover .live-input,
.live.is-theater .live-side:focus-within .live-input,
.live.is-theater .live-side:hover .live-send,
.live.is-theater .live-side:focus-within .live-send,
.live.is-theater .live-side:hover .live-emoji-btn,
.live.is-theater .live-side:focus-within .live-emoji-btn,
.live.is-theater .live-side:hover .live-emoji-panel,
.live.is-theater .live-side:focus-within .live-emoji-panel,
.live.is-theater .live-side:hover .live-option,
.live.is-theater .live-side:focus-within .live-option,
.live.is-theater .live-side:hover .live-poll-show,
.live.is-theater .live-side:focus-within .live-poll-show,
.live.is-theater .live-side:hover .live-reply,
.live.is-theater .live-side:focus-within .live-reply {
  opacity: 1;
}

.live.is-theater .live-return { bottom: 1.25rem; }

/* Quiet spell: the overlay hides; activity or hover peeks it back. */
.live.is-theater.is-chat-folded .live-side {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

/* With nothing of ours over the video (a 16:9 film on a wider screen leaves
   the folded chat on the black bars), Chrome on Windows hands the video to a
   hardware overlay and stops showing page updates until something covers it.
   An invisible pixel over the picture keeps the chat able to come back. */
.live.is-theater.is-chat-folded::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 8;
  width: 1px;
  height: 1px;
  background: rgba(255, 255, 255, 0.01);
  pointer-events: none;
}

.live.is-theater.is-chat-peek .live-side {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.2s ease;
}

.live-chat-edge { display: none; }

.live.is-theater.is-chat-folded:not(.is-chat-peek) .live-chat-edge {
  display: block;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 4.5rem;
  z-index: 7;
  width: 1.25rem;
}

/* Short landscape screens (phones): keep the chat, drop the poll, and let the
   log shrink when the on-screen keyboard eats the height. */
@media (max-height: 560px) {
  .live.is-theater .live-poll { display: none; }
  .live.is-theater .live-chat-log { min-height: 3rem; }
}

/* Portrait: a side column would squeeze the video, so the chat goes below. */
@media (max-aspect-ratio: 1 / 1) {
  .live.is-theater .live-screen {
    width: 100%;
    height: auto;
    margin-right: 0;
    aspect-ratio: 16 / 9;
  }

  .live.is-theater .live-side {
    top: calc(100vw * 9 / 16);
    left: 0;
    width: auto;
  }

  .live.is-theater .live-poll { max-height: 32%; }

  .live.is-theater.is-chat-folded .live-side {
    bottom: 0;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .live.is-theater.is-chat-folded .live-chat-edge { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
  .live-join,
  .live-fill,
  .live-option,
  .live-option-fill,
  .live.is-theater.is-chat-folded .live-side { transition: none; }
}
