/**
 * Stripchat-style viewer room layout: stage + chat side-by-side, subheader below stage.
 */
body.sl-live-room-shell-enabled {
  --sl-viewer-stage-min: min(62dvh, 760px);
}

body.sl-live-room-shell-enabled .sl-room-topbar {
  flex-wrap: nowrap;
  height: 44px;
  background: rgba(5, 7, 12, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.sl-live-room-shell-enabled .sl-room-topbar-main {
  flex: 1 1 auto;
}

body.sl-live-room-shell-enabled .sl-room-topbar-actions .sl-room-action[data-room-shell-action="tip"],
body.sl-live-room-shell-enabled .sl-room-topbar-actions .sl-room-action[data-room-shell-action="private"] {
  display: none !important;
}

body.sl-live-room-shell-enabled .sl-room-subheader {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 10px 12px;
  box-sizing: border-box;
  background: rgba(8, 10, 16, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.sl-live-room-shell-enabled .sl-room-subheader .sl-room-header-nav {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
}

body.sl-live-room-shell-enabled .sl-room-stage-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

body.sl-live-room-shell-enabled .sl-room-action-rail {
  flex-shrink: 0;
  padding: 10px 12px 0;
  margin: 0;
}

body.sl-live-room-shell-enabled .sl-room-action-rail .sl-room-action[data-room-shell-action="tip"] {
  background: linear-gradient(135deg, #059669 0%, #22c55e 100%);
  border-color: rgba(34, 197, 94, 0.45);
  color: #fff !important;
}

body.sl-live-room-shell-enabled .sl-room-action-rail .sl-room-action.primary {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(251, 191, 36, 0.35);
  color: #fde68a !important;
}

body.sl-live-room-shell-enabled .sl-room-promo-bar,
body.sl-live-room-shell-enabled #slRoomPromoBar {
  display: none !important;
}

body.sl-live-room-shell-enabled.has-sl-room-promo .sl-room-goal-bar {
  bottom: 0;
}

body.sl-live-room-shell-enabled .sl-room-goal-bar {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: 1;
  margin: 10px 12px 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.sl-live-room-shell-enabled #roomEngagementDock,
body.sl-live-room-shell-enabled .join-popup,
body.sl-live-room-shell-enabled #addonPanel,
body.sl-live-room-shell-enabled #privateShowBtn {
  display: none !important;
}

body.sl-live-room-shell-enabled .vdchat-overlay .videoContainer {
  position: relative;
}

body.sl-live-room-shell-enabled .sl-room-video-chrome-top {
  padding-top: 8px;
}

body.sl-live-room-shell-enabled .vdchat-overlay .container {
  width: 100% !important;
}

body.sl-live-room-shell-enabled .sl-room-subheader {
  margin-bottom: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

body.sl-live-room-shell-enabled .sl-room-video-chrome-bottom,
body.sl-live-room-shell-enabled .sl-room-join-free {
  display: none !important;
}

@media (max-width: 860px) {
  body.sl-live-room-shell-enabled .sl-room-subheader {
    padding: 8px;
  }

  body.sl-live-room-shell-enabled .sl-room-topbar-actions .sl-room-action.primary,
  body.sl-live-room-shell-enabled .sl-room-topbar-actions .sl-room-action.danger {
    padding: 0 8px;
  }
}

/* Model stream pause / BRB wait overlay (viewers) — premium countdown stage */
.sl-model-stream-pause-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 14px 18px;
  text-align: center;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 55% at 50% 18%, rgba(245, 197, 66, 0.16), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(219, 39, 119, 0.12), transparent 40%),
    linear-gradient(180deg, rgba(4, 6, 12, 0.72), rgba(4, 6, 12, 0.92));
  backdrop-filter: blur(14px) saturate(1.15);
  color: #f8fafc;
  animation: sl-pause-overlay-in 0.34s ease;
}

.sl-model-stream-pause-overlay[hidden] {
  display: none !important;
}

.sl-model-stream-pause-card {
  max-width: 440px;
  width: min(92vw, 440px);
  padding: 28px 24px 22px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(245, 197, 66, 0.1), transparent 50%),
    linear-gradient(180deg, rgba(16, 20, 32, 0.98), rgba(8, 10, 16, 0.99));
  box-shadow:
    0 0 0 1px rgba(245, 197, 66, 0.06) inset,
    0 28px 70px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.sl-model-stream-pause-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 7px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(245, 197, 66, 0.18), rgba(219, 39, 119, 0.12));
  border: 1px solid rgba(245, 197, 66, 0.32);
  color: #fde68a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sl-brb-countdown {
  --sl-brb-progress: 1;
  width: 108px;
  height: 108px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, rgba(8, 10, 16, 0.96) 58%, transparent 59%),
    conic-gradient(#f5c542 calc(var(--sl-brb-progress) * 1turn), rgba(255, 255, 255, 0.08) 0);
  box-shadow: 0 0 32px rgba(245, 197, 66, 0.18);
  animation: sl-brb-pulse 2.4s ease-in-out infinite;
}

.sl-brb-countdown[hidden] {
  display: none !important;
}

.sl-brb-countdown__inner {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #0a0d14;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.sl-brb-countdown__time {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #fff8e7;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.sl-brb-countdown__label {
  margin-top: 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #94a3b8;
}

.sl-model-stream-pause-message {
  margin: 0;
  font-size: clamp(18px, 3vw, 26px);
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #f8fafc;
}

.sl-model-stream-pause-sub {
  margin: 12px 0 0;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.45;
}

.sl-model-stream-pause-dots {
  display: inline-flex;
  gap: 6px;
  margin-top: 16px;
}

.sl-model-stream-pause-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f5c542;
  opacity: 0.35;
  animation: sl-brb-dot 1.2s ease-in-out infinite;
}

.sl-model-stream-pause-dots span:nth-child(2) { animation-delay: 0.15s; }
.sl-model-stream-pause-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes sl-pause-overlay-in {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes sl-brb-pulse {
  0%, 100% { box-shadow: 0 0 28px rgba(245, 197, 66, 0.14); }
  50% { box-shadow: 0 0 42px rgba(245, 197, 66, 0.28); }
}

@keyframes sl-brb-dot {
  0%, 100% { opacity: 0.28; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
}

/* Mobile: compact BRB card so Tip Menu / chat never crowd the countdown */
@media (max-width: 860px) {
  .sl-model-stream-pause-overlay {
    padding: 10px 10px 12px;
    align-items: flex-start;
    padding-top: min(10vh, 64px);
  }
  .sl-model-stream-pause-card {
    width: min(94vw, 360px);
    padding: 14px 12px 12px;
    border-radius: 18px;
  }
  .sl-brb-countdown {
    width: 84px;
    height: 84px;
    margin-bottom: 8px;
  }
  .sl-brb-countdown__inner {
    width: 64px;
    height: 64px;
  }
  .sl-brb-countdown__time {
    font-size: 17px;
  }
  .sl-model-stream-pause-message {
    font-size: clamp(14px, 3.5vw, 18px);
  }
  .sl-model-stream-pause-sub {
    display: none;
  }
  .sl-model-stream-pause-badge {
    margin-bottom: 8px;
    padding: 5px 10px;
    font-size: 10px;
  }
  .sl-model-stream-pause-dots {
    margin-top: 10px;
  }
}

/* Broadcaster pause controls */
.sl-broadcast-pause-btn.is-paused {
  background: rgba(251, 191, 36, 0.18) !important;
  border-color: rgba(251, 191, 36, 0.35) !important;
  color: #fde68a !important;
}

.sl-broadcast-pause-panel {
  position: fixed;
  inset: 0;
  z-index: 1000005;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 5, 10, 0.72);
  backdrop-filter: blur(8px);
}

.sl-broadcast-pause-panel[hidden] {
  display: none !important;
}

.sl-broadcast-pause-panel-card {
  width: min(100%, 460px);
  padding: 22px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #10141f;
  color: #e8edf7;
}

.sl-broadcast-pause-panel-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.sl-broadcast-pause-panel-card p {
  margin: 0 0 14px;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.5;
}

.sl-broadcast-pause-panel-card textarea {
  width: 100%;
  min-height: 92px;
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0a0d14;
  color: #f8fafc;
  resize: vertical;
  font: inherit;
}

.sl-broadcast-pause-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.sl-broadcast-pause-actions button {
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 800;
  cursor: pointer;
}

.sl-broadcast-pause-actions .cancel {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.sl-broadcast-pause-actions .confirm {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #111827;
}

/* R19 — Model-side private-only corner chip (camera stays visible) */
.sl-model-private-only-chip {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 42;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(88, 28, 135, 0.88);
  border: 1px solid rgba(216, 180, 254, 0.35);
  color: #f3e8ff;
  font-size: 11px;
  font-weight: 800;
  pointer-events: none;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.sl-model-private-only-chip[hidden] {
  display: none !important;
}

/* R19 — Model room status (broadcast bar + viewer private-only banner) */
.sl-room-status-bar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  padding: 4px;
  margin: 0 0 8px;
  border-radius: 999px;
  background: rgba(8, 12, 20, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  z-index: 40;
}

.sl-room-status-bar.is-floating {
  position: fixed;
  top: calc(64px + env(safe-area-inset-top, 0px));
  left: 12px;
  z-index: 100050;
}

.sl-room-status-bar-label {
  padding: 0 8px 0 10px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sl-room-status-bar button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 7px 11px;
  background: transparent;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  line-height: 1;
}

.sl-room-status-bar button.is-active {
  background: rgba(248, 250, 252, 0.12);
  color: #f8fafc;
}

.sl-room-status-bar[data-current="brb"] button[data-sl-room-status="brb"].is-active {
  background: rgba(251, 191, 36, 0.22);
  color: #fde68a;
}

.sl-room-status-bar[data-current="private_only"] button[data-sl-room-status="private_only"].is-active {
  background: rgba(168, 85, 247, 0.28);
  color: #e9d5ff;
}

.sl-room-status-panel {
  position: fixed;
  inset: 0;
  z-index: 1000006;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 5, 10, 0.72);
  backdrop-filter: blur(8px);
}

.sl-room-status-panel[hidden] {
  display: none !important;
}

.sl-room-status-panel-card {
  width: min(100%, 460px);
  padding: 22px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #10141f;
  color: #e8edf7;
}

.sl-room-status-panel-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.sl-room-status-panel-card p {
  margin: 0 0 14px;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.5;
}

.sl-room-status-panel-card textarea {
  width: 100%;
  min-height: 92px;
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0a0d14;
  color: #f8fafc;
  resize: vertical;
  font: inherit;
}

.sl-room-status-eta {
  margin: 0 0 14px;
  text-align: left;
}

.sl-room-status-eta[hidden] {
  display: none !important;
}

.sl-room-status-eta label {
  display: block;
  margin: 0 0 8px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sl-room-status-eta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sl-room-status-eta-chips button {
  appearance: none;
  min-width: 52px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
}

.sl-room-status-eta-chips button.is-active {
  border-color: rgba(245, 197, 66, 0.55);
  background: linear-gradient(180deg, #ffd56a, #f5c542);
  color: #111;
}

.sl-room-status-panel-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.sl-room-status-panel-actions button {
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 800;
  cursor: pointer;
}

.sl-room-status-panel-actions .cancel {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.sl-room-status-panel-actions .confirm {
  background: linear-gradient(135deg, #a855f7, #c084fc);
  color: #111827;
}

.sl-room-live-pill.is-brb {
  background: rgba(251, 191, 36, 0.18) !important;
  border-color: rgba(251, 191, 36, 0.35) !important;
  color: #fde68a !important;
}

.sl-room-live-pill.is-brb::before {
  background: #fbbf24 !important;
  box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.45);
}

.sl-room-live-pill.is-private-only {
  background: rgba(168, 85, 247, 0.2) !important;
  border-color: rgba(168, 85, 247, 0.4) !important;
  color: #e9d5ff !important;
}

.sl-room-live-pill.is-private-only::before {
  background: #a855f7 !important;
}

.sl-room-status-private-banner {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 14px;
  z-index: 38;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.sl-room-status-private-banner[hidden] {
  display: none !important;
}

.sl-room-status-private-banner__card {
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  max-width: min(520px, 100%);
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(168, 85, 247, 0.35);
  background: linear-gradient(180deg, rgba(28, 16, 42, 0.94), rgba(12, 10, 20, 0.94));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  color: #f3e8ff;
}

.sl-room-status-private-banner__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.35);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.sl-room-status-private-banner__msg {
  margin: 0;
  flex: 1 1 180px;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 650;
}

.sl-room-status-private-banner__cta {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  background: linear-gradient(135deg, #a855f7, #c084fc);
  color: #111827;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .sl-room-status-bar {
    max-width: calc(100vw - 24px);
  }

  .sl-room-status-bar button {
    padding: 7px 9px;
    font-size: 10px;
  }

  .sl-room-status-private-banner {
    left: 8px;
    right: 8px;
    bottom: 10px;
  }
}
