/* ===================== THEME TOKENS ===================== */
:root,
[data-theme="dark"] {
  --bg: #0e0e10;
  --bg-elevated: #18181b;
  --bg-elevated-2: #1f1f23;
  --border: #2d2d33;
  --text: #efeff1;
  --text-muted: #adadb8;
  --text-faint: #71717a;
  /* Color-theme accent tokens default to US Open; overridden below per
     [data-color-theme]. --accent-text is a lighter/readable variant for
     standalone colored text (bot name, mentions); --accent-strong-soft is a
     stronger tint used for mention backgrounds; --accent-2 is the secondary
     brand-highlight color. */
  --accent: #155EEF;
  --accent-hover: #0F4FC0;
  --accent-soft: rgba(21, 94, 239, 0.15);
  --accent-strong-soft: rgba(21, 94, 239, 0.25);
  --accent-text: #5B9CFF;
  --accent-2: #D4FF3D;
  --accent-2-soft: rgba(212, 255, 61, 0.15);
  --live-red: #eb0400;
  --online-green: #00c781;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  --chat-bg: #18181b;
  --input-bg: #0e0e10;
  --scrollbar: #3a3a3d;
  --site-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---- Color theme: Classic Purple (the site's original/previous theme) ---- */
[data-color-theme="purple"] {
  --bg: #0e0e10;
  --bg-elevated: #18181b;
  --bg-elevated-2: #1f1f23;
  --chat-bg: #18181b;
  --input-bg: #0e0e10;
  --accent: #9147ff;
  --accent-hover: #7d2ff0;
  --accent-soft: rgba(145, 71, 255, 0.15);
  --accent-strong-soft: rgba(145, 71, 255, 0.25);
  --accent-text: #a970ff;
  --accent-2: #9147ff;       /* single unified purple — matches the original look */
  --accent-2-soft: rgba(145, 71, 255, 0.15);
}

/* ---- Color theme: US Open (court blue + tennis-ball green) ---- */
[data-color-theme="usopen"] {
  --bg: #070738;
  --bg-elevated: #0c0c46;
  --bg-elevated-2: #121254;
  --chat-bg: #0c0c46;
  --input-bg: #070738;
  --accent: #155EEF;
  --accent-hover: #0F4FC0;
  --accent-soft: rgba(21, 94, 239, 0.15);
  --accent-strong-soft: rgba(21, 94, 239, 0.25);
  --accent-text: #5B9CFF;
  --accent-2: #D4FF3D;
  --accent-2-soft: rgba(212, 255, 61, 0.15);
}

/* ---- Color theme: Apple (iOS / macOS dark-mode system colors) ----
   Pure black canvas, grouped gray surfaces, systemBlue tint, hairline
   separators and SF system font. Component shape changes (glass bars,
   rounded cards, pill buttons) live in the APPLE THEME section at the end
   of this file, all scoped to [data-color-theme="apple"]. */
[data-color-theme="apple"] {
  --bg: #000000;                          /* systemBackground */
  --bg-elevated: #1C1C1E;                 /* secondarySystemBackground */
  --bg-elevated-2: #2C2C2E;               /* tertiarySystemBackground */
  --border: rgba(84, 84, 88, 0.55);       /* separator */
  --text: #F5F5F7;                        /* label */
  --text-muted: rgba(235, 235, 245, 0.62);/* secondaryLabel */
  --text-faint: rgba(235, 235, 245, 0.38);/* tertiaryLabel */
  --chat-bg: #1C1C1E;
  --input-bg: #2C2C2E;
  --scrollbar: rgba(235, 235, 245, 0.22);
  --accent: #0A84FF;                      /* systemBlue (dark) */
  --accent-hover: #409CFF;
  --accent-soft: rgba(10, 132, 255, 0.14);
  --accent-strong-soft: rgba(10, 132, 255, 0.26);
  --accent-text: #64B5FF;
  --accent-2: #0A84FF;
  --accent-2-soft: rgba(10, 132, 255, 0.14);
  --live-red: #FF453A;                    /* systemRed (dark) */
  --online-green: #30D158;                /* systemGreen (dark) */
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --fill: rgba(118, 118, 128, 0.24);      /* tertiarySystemFill — buttons, chips */
  --fill-hover: rgba(118, 118, 128, 0.34);
  --glass: rgba(28, 28, 30, 0.72);
  --glass-blur: saturate(180%) blur(20px);
  --radius-card: 18px;
  --radius-field: 12px;
  /* GCash QR popup (inline styles in index.php read these, with the old
     purple values as fallbacks for the other themes). */
  --modal-bg: #1C1C1E;
  --modal-border: rgba(84, 84, 88, 0.55);
  --modal-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  --modal-hint: rgba(235, 235, 245, 0.45);
}
/* Apple theme always uses the San Francisco system font. Higher specificity
   than the :root{--site-font} rule the admin font picker prints. */
html[data-color-theme="apple"] {
  --site-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* Belt-and-suspenders: an author rule like `.foo { display: flex }` beats the
   browser's own `[hidden] { display: none }` in the cascade, since author
   styles always win over user-agent styles regardless of specificity. Any
   element using the hidden attribute must stay hidden no matter what other
   classes it carries. */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--site-font);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ===================== FLYOUT MENU ===================== */
.flyout-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.flyout-backdrop.is-open {
  opacity: 1;
  pointer-events: all;
}

.flyout-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  height: 100%;
  width: 280px;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 40px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.flyout-drawer.is-open {
  transform: translateX(0);
}

.flyout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.flyout-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 15px;
  color: var(--text);
}
.flyout-brand-name { color: var(--text); }
.flyout-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated-2);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.flyout-close:hover { background: var(--accent-soft); color: var(--text); }

.flyout-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 12px;
}
.flyout-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.flyout-link:hover { background: var(--bg-elevated-2); color: var(--text); }
.flyout-link--active {
  background: var(--accent-soft);
  color: var(--accent);
}
.flyout-link--active:hover { background: var(--accent-soft); color: var(--accent); }
.flyout-link--muted { color: var(--text-faint); font-size: 13px; }
.flyout-link--app {
  background: var(--accent-soft);
  color: var(--accent);
  margin-top: 4px;
}
.flyout-link--app:hover { background: var(--accent); color: #fff; }
.flyout-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 800;
  background: var(--live-red);
  color: #fff;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.flyout-divider { border-top: 1px solid var(--border); margin: 0 12px; }

.flyout-footer-links {
  padding: 12px 12px 0;
}
.flyout-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px 4px;
}
.flyout-qr__box {
  width: 130px;
  height: 130px;
  background: #fff;
  border-radius: 10px;
  padding: 8px;
  box-sizing: border-box;
}
.flyout-qr__label {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--text-faint);
  text-align: center;
}
.flyout-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
}

.chat-msg__pin {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 13px;
  opacity: 0.7;
  border-radius: 4px;
  line-height: 1;
}
.chat-msg__pin:hover { opacity: 1; background: var(--accent-soft); }
.is-mod .chat-msg:hover .chat-msg__pin { display: inline-flex; }

.chat-msg__timeout {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 13px;
  opacity: 0.9;
  border-radius: 4px;
  line-height: 1;
}
.chat-msg__timeout:hover { opacity: 1; background: #92400e; }
.is-mod .chat-msg:hover .chat-msg__timeout { display: inline-flex; }

@media (max-width: 900px) {
  .is-mod .chat-msg .chat-msg__pin,
  .is-mod .chat-msg .chat-msg__timeout { display: inline-flex; }
}

.timeout-menu {
  position: fixed;
  z-index: 1000;
  background: var(--bg-elevated-2, #1f1f23);
  border: 1px solid var(--border, #2d2d33);
  border-radius: 8px;
  padding: 4px;
  min-width: 140px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.timeout-menu__header {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint, #71717a);
  padding: 6px 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border, #2d2d33);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.timeout-menu__item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text, #efeff1);
  padding: 8px 10px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 5px;
}
.timeout-menu__item:hover { background: #92400e; color: #fff; }

@media (max-width: 900px) {
  .is-mod .chat-msg .chat-msg__pin { display: inline-flex; }
  .is-mod .chat-msg .chat-msg__actions { display: flex; }
}

.pinned-bar {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--accent);
  font-size: 13px;
}
.pinned-bar__icon { flex-shrink: 0; font-size: 14px; padding-top: 1px; }
.pinned-bar__content {
  flex: 1;
  min-width: 0;
  white-space: normal;
  word-break: break-word;
  color: var(--text-muted);
  max-height: 30vh;
  overflow-y: auto;
}
.pinned-bar__content strong { color: var(--accent); margin-right: 4px; }
.pinned-bar__unpin {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
}
.pinned-bar__unpin:hover { color: var(--text); background: var(--bg-elevated-2); }

@media (max-width: 900px) {
  /* Keep the pinned message INSIDE the Stream Chat on mobile (in normal flow),
     rather than fixing it to the top of the screen over the video. It already
     sits just above the chat messages in the markup. */
  .pinned-bar {
    position: static;
    z-index: auto;
    border-top: none;
    border-bottom: 2px solid var(--accent);
    background: rgba(20, 10, 40, 0.95);
  }
}

/* ---- COUNTDOWN ---- */
.offline-overlay__next {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin: 4px 0;
}
.offline-overlay__day {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  margin: 0 0 16px;
}
.offline-overlay__countdown {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 12px;
}
.countdown__block {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 10px 16px;
  min-width: 64px;
}
.countdown__num {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.countdown__label {
  font-size: 10px;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}
/* When the admin turns off "show unit names", hide the day/hr/min/sec labels. */
.countdown--no-units .countdown__label { display: none; }
.countdown__sep {
  font-size: 24px;
  font-weight: 800;
  color: rgba(255,255,255,0.4);
  margin-bottom: 16px;
}

/* ---- ANNOUNCEMENT ---- */
.announce-bar {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(255, 180, 0, 0.08);
  border-top: 1px solid rgba(255, 180, 0, 0.25);
  border-bottom: 1px solid rgba(255, 180, 0, 0.25);
}
.announce-bar__input {
  flex: 1;
  background: rgba(255, 180, 0, 0.1);
  border: 1px solid rgba(255, 180, 0, 0.3);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text);
  outline: none;
}
.announce-bar__input:focus { border-color: rgba(255, 180, 0, 0.7); }
.announce-bar__input::placeholder { color: rgba(255, 180, 0, 0.5); }
.announce-bar__btn {
  background: rgba(255, 180, 0, 0.85);
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #000;
  cursor: pointer;
  white-space: nowrap;
}
.announce-bar__btn:hover { background: rgba(255, 180, 0, 1); }

/* ---- LIVE POLL ---- */
.poll-bar {
  padding: 10px 12px;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--accent);
  font-size: 13px;
}
.poll-bar__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.poll-bar__question {
  font-weight: 700;
  color: var(--text);
  word-break: break-word;
}
.poll-bar__badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  white-space: nowrap;
  cursor: pointer;
}
.poll-bar__badge--closed { background: var(--bg-elevated-2); color: var(--text-faint); }
.poll-bar__head-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.poll-bar__mini-summary { font-size: 11px; color: var(--text-faint); white-space: nowrap; }
.poll-bar__min-btn {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.poll-bar__min-btn:hover { color: var(--text); background: var(--bg-elevated-2); border-color: var(--accent); }
/* Minimized: just the question + vote count + badge on one line, no options/footer */
.poll-bar--minimized { padding: 7px 12px; }
.poll-bar--minimized .poll-bar__head { margin-bottom: 0; }
.poll-bar--minimized .poll-bar__question {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.poll-option {
  display: block;
  width: 100%;
  position: relative;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: 8px;
  padding: 0;
  margin-bottom: 6px;
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  font: inherit;
  color: var(--text);
}
.poll-option:hover { border-color: var(--accent); }
.poll-option:disabled { cursor: default; }
.poll-option__fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: var(--accent-soft);
  transition: width 0.3s ease;
}
.poll-option--picked .poll-option__fill { background: var(--accent-strong-soft); }
.poll-option--picked { border-color: var(--accent); }
.poll-option__row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
}
.poll-option__label { min-width: 0; word-break: break-word; }
.poll-option--picked .poll-option__label { font-weight: 700; }
.poll-option__pct { flex-shrink: 0; font-variant-numeric: tabular-nums; color: var(--text-muted); font-size: 12px; }
.poll-bar__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--text-faint);
}
.poll-bar__mod-actions { display: flex; gap: 6px; }
.poll-bar__mod-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.poll-bar__mod-btn:hover { color: var(--text); background: var(--bg-elevated-2); }

@media (max-width: 900px) {
  .poll-bar { position: static; }
}

.chat-msg--announcement {
  background: rgba(255, 180, 0, 0.1);
  border: 1px solid rgba(255, 180, 0, 0.35);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 4px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  position: relative; /* anchor the mod delete (✕) button */
}
/* Give the ✕ room so it doesn't sit on top of the text, and nudge it inside
   the padded/bordered announcement box. Only shows for mods on hover. */
.chat-msg--announcement .chat-msg__actions {
  top: 6px;
  right: 8px;
}
.is-mod .chat-msg--announcement:hover .announce-text {
  padding-right: 22px;
}
.chat-msg--announcement .announce-icon {
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 1px;
}
.chat-msg--announcement .announce-text {
  color: #fbbf24;
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.4;
  word-break: break-word;
}

/* ---- CLAPPR / HLS PLAYER (Stream 3 — live .m3u8 via Clappr) ----
   Clappr renders its own default media control (play/pause, volume/
   mute, fullscreen, and a "LIVE" indicator for live sources) — we don't
   rebuild any of that. The only thing we override is the seek/progress
   bar: player.js already sets hlsMinimumDvrSize high enough that Clappr
   should never turn on DVR mode (which is what draws the seek bar), but
   this is a hard CSS backstop in case a source's DVR window ever grows
   past that anyway. `data-seekbar` is Clappr's own attribute, stable
   across its skins. */
#clapprPlayer .bar-container[data-seekbar] {
  display: none !important;
}
#clapprPlayer,
#clapprPlayer .player-wrapper,
#clapprPlayer video {
  width: 100%;
  height: 100%;
}

/* ===================== TOPBAR ===================== */
.topbar {
  height: 56px;
  flex: 0 0 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.2px;
}

.brand__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
}

.brand__accent { color: var(--accent-2); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated-2);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.icon-btn:hover { background: var(--accent-soft); border-color: var(--accent); }
.icon-btn--ghost { border: none; background: transparent; width: 28px; height: 28px; }

.icon { width: 18px; height: 18px; }

/* ===================== LAYOUT ===================== */
.layout {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  min-height: 0;
  overflow: hidden;
}

.stage {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  flex: 0 0 auto;
  overflow: hidden;
  /* Keep a true 16:9 box on every screen. Previously max-height:80vh
     clamped the HEIGHT while width stayed 100%, which broke the ratio on
     wide monitors (box got wider than 16:9 → video/poster stretched
     horizontally). Instead we cap the WIDTH to whatever 80vh of height
     allows at 16:9, so the aspect-ratio rule is never overridden. The box
     is centered in the stage via the auto margins below. */
  max-width: calc(80vh * 16 / 9);
  margin-left: auto;
  margin-right: auto;
}
.player-wrap iframe,
.player-wrap video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.live-badge--hidden { display: none !important; }
.offline-overlay--hidden { display: none !important; }

.live-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--live-red);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 4px;
  pointer-events: none;
}
.live-badge--replay {
  background: #f59e0b;
  color: #1a1200;
}
.live-badge--replay .dot { background: #1a1200; }
.live-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 1.6s infinite;
  flex: 0 0 auto;
}
.live-badge__viewers {
  opacity: 0.85;
  font-size: 11px;
  font-weight: 600;
}

.live-duration {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}
.live-duration--hidden { display: none !important; }
@media (max-width: 560px) {
  .live-duration { top: 10px; right: 10px; font-size: 11px; padding: 3px 8px; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Offline overlay — sits ABOVE iframe (z-index 2), covers it completely */
.offline-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0e0e10;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: opacity 0.3s;
}

/* Looping background video behind the offline message */
.offline-overlay__video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0; pointer-events: none; background: #05071a;
}

/* With a background video, park the message in the lower part of the
   player so the video's top half (face, name, facts) stays visible. */
.offline-overlay--video { align-items: flex-end; padding-bottom: 3.5%; }

/* Dark scrim so text stays readable over any background image */
.offline-overlay__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 32px;
  background: rgba(0, 0, 0, 0.52);
  border-radius: 12px;
  backdrop-filter: blur(4px);
  text-align: center;
}
.offline-overlay__text {
  font-size: 40px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.offline-overlay__viewers {
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  margin: 0;
}

.stream-meta {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
/* Ad slots beside the Live Stream info. The wrapper centers up to three
   468x60 units in the empty space to the right of the title; they sit in a
   row on wide screens and wrap to new lines as space runs out. */
.stream-meta__ads {
  margin-left: auto;
  margin-right: auto;
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
}
.stream-meta__ad {
  flex: 0 0 auto;
  width: 468px;
  height: 60px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stream-meta__ad iframe,
.stream-meta__ad ins,
.stream-meta__ad img {
  max-width: 100%;
  max-height: 60px;
}

.stream-meta__avatar {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #4f2db8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
}

.stream-meta__title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px;
  line-height: 1.3;
}

.stream-meta__sub {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.streamer-name { color: var(--accent); font-weight: 600; }

.viewer-count::before {
  content: "●";
  color: var(--online-green);
  margin-right: 5px;
  font-size: 9px;
}

/* ===================== NEWS TICKER ===================== */
.news-ticker {
  display: flex;
  align-items: center;
  height: 32px;
  background: var(--bg-elevated-2);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.news-ticker--hidden { display: none !important; }
.news-ticker__label {
  flex: 0 0 auto;
  background: var(--accent);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 12px;
}
.news-ticker__viewport {
  flex: 1 1 auto;
  overflow: hidden;
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}
.news-ticker__track {
  display: inline-flex;
  white-space: nowrap;
  will-change: transform;
  animation: news-ticker-scroll linear infinite;
}
.news-ticker__item {
  display: inline-block;
  padding-right: 64px;
  font-size: 13px;
  font-weight: 600;
}
@keyframes news-ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(var(--ticker-shift, -20%)); }
}

/* ===================== CHAT ===================== */
.chat {
  display: flex;
  flex-direction: column;
  background: var(--chat-bg);
  border-left: 1px solid var(--border);
  min-height: 0;
}

.chat__header {
  flex: 0 0 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-weight: 700;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.chat__messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
  line-height: 1.45;
}

.chat-msg { word-wrap: break-word; }
.chat-msg__name { font-weight: 700; margin-right: 4px; }
.chat-msg__name--system { color: var(--text-faint); font-style: italic; font-weight: 500; }
.chat-msg__text { color: var(--text); white-space: pre-wrap; }

.chat-msg--system { color: var(--text-faint); font-size: 12.5px; }
.chat-msg--welcome .chat-msg__welcome-name { font-weight: 800; }
.chat-msg--welcome {
  transition: opacity 2.5s ease, max-height 2.5s ease, margin 2.5s ease, padding 2.5s ease;
  overflow: hidden;
}
.chat-msg--welcome-leaving {
  opacity: 0;
  max-height: 0 !important;
  margin: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.chat__status {
  flex: 0 0 auto;
  padding: 4px 14px;
  font-size: 11px;
  color: var(--text-faint);
}

.chat__form {
  flex: 0 0 auto;
  padding: 10px 12px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat__name,
.chat__input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 9px 10px;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease;
}
.chat__name:focus,
.chat__input:focus { border-color: var(--accent); }

.chat__name-row { position: relative; }
.chat__name[readonly] {
  background: var(--bg-elevated-2);
  color: var(--text-muted);
  cursor: default;
  padding-right: 30px;
}
.chat__name-lock {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}

.chat__name-hint {
  margin: -4px 0 0;
  font-size: 11px;
  color: var(--text-faint);
}
.chat__name-hint[hidden] { display: none !important; }

.chat__input {
  resize: vertical;
  min-height: 92px;
  max-height: 180px;
  font-family: inherit;
  line-height: 1.4;
  padding-bottom: 40px;
  padding-right: 6px;
}

.chat__composer { position: relative; }

.chat__composer-icons {
  position: absolute;
  left: 1px;
  right: 1px;
  bottom: 1px;
  height: 34px;
  background: var(--input-bg);
  border-top: 1px solid var(--border);
  border-radius: 0 0 5px 5px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
}

.chat__icon-btn {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 5px;
  background: transparent;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background 0.15s;
}
.chat__icon-btn:hover { background: var(--bg-elevated-2); }
.chat__icon-btn[hidden] { display: none !important; }

.chat__send--inline {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 80px;
  height: 26px;
  z-index: 1;
}

.chat__send {
  flex: 0 0 auto;
  width: 80px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.chat__send:hover { background: var(--accent-hover); }
.chat__send svg { width: 16px; height: 16px; }

.chat-expand-btn {
  display: none;
}

.chat__header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn--active {
  color: var(--accent);
}

.mod-popover {
  position: relative;
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated-2);
}
.mod-popover[hidden] { display: none !important; }
.mod-popover input {
  flex: 1 1 auto;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 7px 9px;
  font-size: 12.5px;
  outline: none;
}
.mod-popover input:focus { border-color: var(--accent); }
.mod-popover input:disabled {
  background: var(--bg-elevated-2);
  color: var(--text-faint);
  cursor: not-allowed;
  opacity: 0.6;
}
.mod-popover button {
  flex: 0 0 auto;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 0 12px;
  cursor: pointer;
}
.mod-popover button:hover { background: var(--accent-hover); }

.mod-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--accent-soft);
  font-size: 11.5px;
}
.mod-bar__label {
  font-weight: 700;
  color: var(--accent);
  margin-right: auto;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.mod-bar__btn {
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  border-radius: 5px;
  padding: 4px 9px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.mod-bar__btn:hover { background: var(--accent); color: #fff; }
.mod-bar__btn--ghost { border-color: var(--border); color: var(--text-muted); }
.mod-bar__btn--ghost:hover { background: var(--bg-elevated-2); color: var(--text); }

.chat-msg {
  position: relative;
  padding-right: 44px;
}
/* Relative timestamp — hidden until the row is hovered (Twitch/Discord style) */
.chat-msg__time {
  position: absolute;
  right: 8px;
  top: 1px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-faint);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.12s ease;
  user-select: none;
}
.chat-msg:hover .chat-msg__time {
  opacity: 1;
}
/* When mod actions are visible, shift the timestamp left so it doesn't overlap */
.is-mod .chat-msg:hover .chat-msg__time {
  right: 92px;
}
/* Touch devices have no hover — keep a faint timestamp always visible */
@media (hover: none) {
  .chat-msg__time {
    opacity: 0.55;
  }
  .is-mod .chat-msg .chat-msg__time {
    right: 92px;
  }
}
.chat-msg__actions {
  display: none;
  position: absolute;
  right: 0;
  top: 0;
  gap: 3px;
}
.is-mod .chat-msg:hover .chat-msg__actions {
  display: flex;
}
.chat-msg__delete,
.chat-msg__ban {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 4px;
  color: #fff;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.chat-msg__delete { background: var(--live-red); }
.chat-msg__ban { background: #92400e; font-size: 11px; }
.chat-msg.is-removed {
  opacity: 0.4;
}

.emoji-picker {
  border-top: 1px solid var(--border);
  background: var(--bg-elevated-2);
}
.emoji-picker__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 4px;
}
.chat-msg__name--mod {
  color: #52e0a0 !important;
  font-weight: 700;
}

.chat-msg__name--bot {
  color: var(--accent-text) !important;
  font-weight: 700;
}

/* MOD / BOT badges in chat (match the OBS overlay) */
.chat-msg__badge {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1px 5px;
  border-radius: 5px;
  margin-right: 5px;
  vertical-align: middle;
}
.chat-msg__badge--mod { background: #52e0a0; color: #06251a; }
.chat-msg__badge--bot { background: var(--accent); color: #fff; }

.chat-emoji {
  display: inline-block;
  width: 22px;
  height: 22px;
  vertical-align: middle;
  margin: 0 1px;
  animation: emoji-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes emoji-pop {
  0%   { transform: scale(0); }
  70%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.chat-mention {
  background: var(--accent-strong-soft);
  color: var(--accent-text);
  border-radius: 3px;
  padding: 0 4px;
  font-weight: 600;
}

.chat-link {
  color: var(--accent);
  text-decoration: underline;
  word-break: break-all;
}
.chat-link:hover { color: var(--accent-hover); }

.chat-msg__image {
  display: block;
  max-width: 200px;
  max-height: 150px;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-top: 6px;
  cursor: zoom-in;
  object-fit: cover;
}
.chat-msg__image:hover { border-color: var(--accent); }

/* Chat image lightbox — styled to match the GCash QR popup modal */
.chat-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.chat-lightbox.is-open { display: flex; }
.chat-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}
.chat-lightbox__box {
  position: relative;
  z-index: 1;
  background: #1a1a2e;
  border: 1px solid #3b2868;
  border-radius: 16px;
  padding: 16px;
  max-width: 90vw;
  max-height: 85vh;
  box-shadow: 0 8px 40px rgba(80, 30, 160, 0.4);
}
.chat-lightbox__close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: #aaa;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}
.chat-lightbox__close:hover { color: #fff; }
.chat-lightbox__img {
  display: block;
  max-width: 100%;
  max-height: calc(85vh - 32px);
  border-radius: 10px;
  margin: 0 auto;
}

.emoji-picker__close {
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}
.emoji-picker__close:hover { background: var(--bg-elevated); color: var(--text); }
.emoji-picker__grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
  padding: 4px 8px 8px;
  max-height: 220px;
  overflow-y: auto;
}
.emoji-btn {
  border: none;
  background: none;
  font-size: 20px;
  padding: 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s;
  line-height: 1;
}
.emoji-btn:hover { background: var(--accent-soft); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }
  .chat {
    border-left: none;
    border-top: 1px solid var(--border);
    height: 50vh;
  }
  .player-wrap {
    aspect-ratio: 16 / 9;
    max-height: none;
    width: 100%;
    /* On phones the height-based width cap isn't needed — full width at
       16:9 always fits. Reset it so the box spans the column. */
    max-width: 100%;
  }
  .stage { overflow-y: visible; }
}

@media (max-width: 560px) {
  .stream-meta { padding: 12px 14px; flex-wrap: wrap; }
  /* Hide the 468x60 stream ad banners on mobile — they don't fit the layout
     here and the row reads cleaner without them. */
  .stream-meta__ads {
    display: none;
  }
  .stream-meta__avatar { width: 40px; height: 40px; font-size: 15px; }
  .stream-meta__title { font-size: 15.5px; }
  .chat { height: 46vh; }
  .brand__name { font-size: 14px; }
  .news-ticker { height: 28px; }
  .news-ticker__label { font-size: 9.5px; padding: 0 8px; }
  .news-ticker__item { font-size: 12px; padding-right: 40px; }
}

/* collapsed chat (mobile toggle) */
.chat.is-collapsed { display: none; }
.chat-expand-btn[hidden] { display: none !important; }
@media (max-width: 900px) {
  .chat-expand-btn {
    display: block;
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 60;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 10px 18px;
    font-weight: 700;
    font-size: 13px;
    box-shadow: var(--shadow);
    cursor: pointer;
  }
}

/* ---- Agora click-to-unmute button ---- */
/* Shown when audio autoplay was blocked by the browser (no user gesture
   yet). Sits over the video, non-intrusive, tap-to-enable-sound. */
.agora-unmute-btn {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 0.15s;
}
.agora-unmute-btn:hover {
  background: rgba(0, 0, 0, 0.9);
}
.agora-unmute-btn[hidden] {
  display: none !important;
}

/* ---- Agora custom control bar ---- */
/* Agora ships no player UI, so we render our own — sits over the video,
   fades on hover, mirrors what viewers expect from Twitch/YouTube. */
.agora-controls {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.player-wrap:hover .agora-controls,
.player-wrap:focus-within .agora-controls,
.agora-controls:focus-within {
  opacity: 1;
  pointer-events: auto;
}
.agora-controls__btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.15s;
}
.agora-controls__btn:hover {
  background: rgba(255,255,255,0.15);
}
.agora-controls__volume {
  width: 90px;
  height: 4px;
  accent-color: #fff;
  cursor: pointer;
}
.agora-controls__spacer {
  flex: 1;
}
.agora-controls__quality-wrap {
  position: relative;
}
.agora-controls__quality-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: rgba(20,20,24,0.98);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  min-width: 160px;
  padding: 4px 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.agora-controls__quality-menu[hidden] {
  display: none;
}
.agora-controls__quality-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: #efeff1;
  font-size: 13px;
  padding: 8px 14px;
  cursor: pointer;
}
.agora-controls__quality-menu button:hover {
  background: rgba(255,255,255,0.08);
}
.agora-controls__quality-menu button.is-active {
  color: var(--accent-text);
  font-weight: 700;
}
.agora-controls__quality-menu button.is-active::before {
  content: "✓ ";
}

/* ---- On-screen popup / banner over the video (automation) ---- */
.stream-popup {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translate(-50%, -12px);
  z-index: 6;
  max-width: 82%;
  padding: 12px 22px;
  background: linear-gradient(135deg, rgba(125,47,240,0.96), rgba(90,30,190,0.96));
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  word-break: break-word;
}
.stream-popup--show {
  opacity: 1;
  transform: translate(-50%, 0);
}
@media (max-width: 560px) {
  .stream-popup { font-size: 14px; padding: 9px 16px; max-width: 90%; }
}

/* ---- Name-required entry modal ---- */
.namegate {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 4, 12, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.namegate[hidden] { display: none; }
.namegate__card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-elevated, #17151f);
  border: 1px solid rgba(169, 112, 255, 0.28);
  border-radius: 16px;
  padding: 32px 26px;
  text-align: center;
  box-shadow: 0 18px 60px rgba(0,0,0,0.5);
  animation: namegate-pop 0.28s cubic-bezier(0.2,0.9,0.3,1.15) both;
}
@keyframes namegate-pop {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.namegate__logo {
  font-size: 22px; font-weight: 800; margin-bottom: 18px; color: #fff;
}
.namegate__logo span { color: var(--accent-2, #D4FF3D); }
.namegate__title {
  font-size: 19px; font-weight: 800; margin: 0 0 6px; color: #fff; line-height: 1.3;
}
.namegate__sub {
  font-size: 13.5px; color: rgba(255,255,255,0.6); margin: 0 0 20px; line-height: 1.5;
}
.namegate__input {
  width: 100%;
  padding: 13px 15px;
  font-size: 16px;
  color: #fff;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s;
}
.namegate__input:focus { border-color: var(--accent, #155EEF); }
.namegate__input::placeholder { color: rgba(255,255,255,0.35); }
.namegate__check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 16px 0 4px;
  text-align: left;
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  line-height: 1.45;
}
.namegate__check input {
  width: 17px; height: 17px; margin-top: 1px; flex-shrink: 0;
  accent-color: var(--accent, #155EEF); cursor: pointer;
}
.namegate__error {
  color: #f87171; font-size: 12.5px; margin: 8px 0 0; text-align: left;
}
.namegate__error[hidden] { display: none; }
.namegate__btn {
  width: 100%;
  margin-top: 18px;
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: var(--accent, #155EEF);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.namegate__btn:hover { background: var(--accent-hover, #0F4FC0); }
.namegate__btn:active { transform: scale(0.98); }
/* brief welcome state */
.namegate__card.welcome .namegate__input,
.namegate__card.welcome .namegate__check,
.namegate__card.welcome .namegate__btn,
.namegate__card.welcome .namegate__sub,
.namegate__card.welcome .namegate__error { display: none; }
.namegate__welcome { display: none; font-size: 15px; color: rgba(255,255,255,0.8); margin-top: 8px; }
.namegate__card.welcome .namegate__welcome { display: block; }
.namegate__card.welcome .namegate__title { display: none; }
.namegate__card.welcome .namegate__welcome { font-size: 18px; font-weight: 700; color: #fff; }

/* Donation ask shown after the name gate (see index.php). */
.namegate__donate { margin-top: 18px; text-align: center; }
.namegate__donate[hidden] { display: none; }
.namegate__donate-lead {
  margin: 0 0 8px; font-size: 17px; font-weight: 800; color: #fff;
}
.namegate__donate-text {
  margin: 0 0 18px; font-size: 14px; line-height: 1.55; color: rgba(255,255,255,0.72);
}
.namegate__donate-text strong { color: #fff; }
.namegate__donate-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  width: 100%; padding: 13px 14px; box-sizing: border-box;
  font-size: 16px; font-weight: 800; color: #fff; text-decoration: none;
  background: linear-gradient(135deg, #007DFE 0%, #0057D9 100%);
  border: none; border-radius: 10px; cursor: pointer;
  box-shadow: 0 6px 22px rgba(0, 125, 254, 0.35);
  transition: transform 0.1s, box-shadow 0.15s, filter 0.15s;
  animation: namegate-donate-pulse 2.4s ease-in-out 0.6s infinite;
}
.namegate__donate-btn[hidden] { display: none; }
.namegate__donate-btn:hover { filter: brightness(1.08); box-shadow: 0 8px 28px rgba(0, 125, 254, 0.5); }
.namegate__donate-btn:active { transform: scale(0.98); }
.namegate__donate-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.namegate__donate-sub { font-size: 12px; font-weight: 600; opacity: 0.85; }
.namegate__donate-sub:empty { display: none; }
@keyframes namegate-donate-pulse {
  0%, 100% { box-shadow: 0 6px 22px rgba(0, 125, 254, 0.35); }
  50%      { box-shadow: 0 6px 30px rgba(0, 125, 254, 0.65); }
}
@media (prefers-reduced-motion: reduce) { .namegate__donate-btn { animation: none; } }
.namegate__continue {
  margin-top: 12px; padding: 8px 12px;
  background: none; border: none; cursor: pointer;
  font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.75);
}
.namegate__continue:hover { color: #fff; text-decoration: underline; }
.namegate__donate-note { margin: 6px 0 0; font-size: 12px; color: rgba(255,255,255,0.45); }

/* Image brand logo (tennis) in the site header — transparent box */
.brand__logo--img { background: transparent !important; overflow: hidden; }
.brand__logo--img img { width: 100%; height: 100%; object-fit: contain; }

/* Chat disabled notice (master chat toggle) */
.chat-disabled-notice {
  display: none;
  text-align: center;
  padding: 14px 12px;
  margin: 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-faint, #71717a);
  font-size: 13px;
  font-weight: 600;
}

/* ---- Danger icon button (clear chat, etc.) ---- */
.chat__icon-btn--danger { color: #f87171; }
.chat__icon-btn--danger:hover { color: #fca5a5; background: rgba(248,113,113,0.12); }

/* ---- VOICE (request to speak, audio-only via Agora) ---- */
.voice-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(235, 4, 0, 0.08);
  border-top: 1px solid rgba(235, 4, 0, 0.25);
  border-bottom: 1px solid rgba(235, 4, 0, 0.25);
  font-size: 12px;
  color: var(--text-muted);
}
.voice-bar #voiceBarNames { color: var(--text); font-weight: 600; }
.chat__icon-btn--live {
  color: var(--live-red);
  animation: voice-live-pulse 1.6s ease-in-out infinite;
}
@keyframes voice-live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* ---- Reusable yes/no confirm modal ---- */
.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 3100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 4, 12, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.confirm-modal[hidden] { display: none; }
.confirm-modal__card {
  width: 100%;
  max-width: 360px;
  background: var(--bg-elevated, #17151f);
  border: 1px solid rgba(248, 113, 113, 0.28);
  border-radius: 14px;
  padding: 24px 22px;
  text-align: center;
  box-shadow: 0 18px 50px rgba(0,0,0,0.5);
  animation: namegate-pop 0.22s cubic-bezier(0.2,0.9,0.3,1.15) both;
}
.confirm-modal__title { font-size: 17px; font-weight: 800; color: #fff; margin: 0 0 8px; }
.confirm-modal__body { font-size: 13.5px; color: rgba(255,255,255,0.65); margin: 0 0 20px; line-height: 1.5; }
.confirm-modal__actions { display: flex; gap: 10px; }
.confirm-modal__btn {
  flex: 1;
  padding: 11px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.confirm-modal__btn:active { transform: scale(0.97); }
.confirm-modal__btn--no { background: rgba(255,255,255,0.08); color: #efeff1; }
.confirm-modal__btn--no:hover { background: rgba(255,255,255,0.14); }
.confirm-modal__btn--yes { background: #ef4444; color: #fff; }
.confirm-modal__btn--yes:hover { background: #dc2626; }

/* Compact offline message on phones — the player is only ~220px tall there,
   so the full-size box (40px headline + big countdown) overflowed and got
   clipped. Scales everything down so it fits inside the 16:9 player and the
   background (image or video) stays visible around it. */
@media (max-width: 600px) {
  .offline-overlay__inner { gap: 2px; padding: 8px 14px; max-width: 90%; border-radius: 10px; }
  .offline-overlay__text { font-size: min(20px, 5.4vw) !important; line-height: 1.15; }
  .offline-overlay__next { font-size: 13px; margin: 2px 0; }
  .offline-overlay__day { font-size: 11px; margin: 0 0 4px; }
  .offline-overlay__countdown { gap: 4px; margin: 4px 0 2px; }
  .countdown__block { padding: 4px 7px; min-width: 38px; border-radius: 7px; }
  .countdown__num { font-size: 16px; }
  .countdown__label { font-size: 8px; margin-top: 2px; letter-spacing: 0.5px; }
  .countdown__sep { font-size: 12px; }
  .offline-overlay__viewers { font-size: 11px; }
}

/* =====================================================================
   APPLE THEME — component styling
   Everything below is scoped to [data-color-theme="apple"] so the US Open
   and Classic Purple themes are untouched. Design cues: frosted-glass
   bars, rounded "card" surfaces on a black canvas, pill-shaped buttons,
   filled (borderless) controls, hairline separators, SF type with tight
   tracking on headings, and systemBlue as the single tint colour.
   ===================================================================== */
[data-color-theme="apple"] body {
  letter-spacing: -0.01em;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
[data-color-theme="apple"] ::selection { background: rgba(10, 132, 255, 0.45); }
[data-color-theme="apple"] :focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.45);
}

/* ---- Top bar: translucent glass, like the apple.com / Safari toolbar ---- */
[data-color-theme="apple"] .topbar {
  background: rgba(22, 22, 23, 0.72);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-bottom: 0.5px solid var(--border);
}
[data-color-theme="apple"] .brand { font-weight: 600; letter-spacing: -0.02em; font-size: 18px; }
[data-color-theme="apple"] .brand__logo { border-radius: 12px; }
[data-color-theme="apple"] #smartlinkBtn {
  border-radius: 980px !important;
  padding: 6px 14px !important;
  font-weight: 600 !important;
  font-size: 12px !important;
}

/* Filled circular icon buttons */
[data-color-theme="apple"] .icon-btn {
  border: none;
  border-radius: 50%;
  background: var(--fill);
  transition: background 0.2s ease, transform 0.12s ease;
}
[data-color-theme="apple"] .icon-btn:hover { background: var(--fill-hover); border: none; }
[data-color-theme="apple"] .icon-btn:active { transform: scale(0.94); }
[data-color-theme="apple"] .icon-btn--ghost { background: transparent; border-radius: 50%; width: 30px; height: 30px; }
[data-color-theme="apple"] .icon-btn--ghost:hover { background: var(--fill); }
[data-color-theme="apple"] .icon-btn--active { color: var(--accent); }

/* ---- Layout: player and chat as rounded cards on the black canvas ---- */
@media (min-width: 901px) {
  [data-color-theme="apple"] .stage { padding: 16px 0 0 16px; }
  [data-color-theme="apple"] .player-wrap {
    border-radius: var(--radius-card);
    box-shadow: 0 0 0 0.5px var(--border), var(--shadow);
    max-width: calc(78vh * 16 / 9);
  }
  [data-color-theme="apple"] .chat {
    margin: 16px;
    border: none;
    border-radius: var(--radius-card);
    box-shadow: 0 0 0 0.5px var(--border);
    overflow: hidden;
  }
  [data-color-theme="apple"] .stream-meta { padding: 18px 4px; }
  [data-color-theme="apple"] .news-ticker { border-radius: 12px; margin: 0 0 16px; }
}
@media (max-width: 900px) {
  [data-color-theme="apple"] .chat {
    border-top: none;
    border-radius: var(--radius-card) var(--radius-card) 0 0;
    margin-top: 8px;
  }
}

[data-color-theme="apple"] .stream-meta { border-bottom: none; }
[data-color-theme="apple"] .stream-meta__avatar {
  background: linear-gradient(135deg, #0A84FF, #5E5CE6);
  box-shadow: 0 0 0 0.5px var(--border);
}
[data-color-theme="apple"] .stream-meta__title { font-size: 21px; font-weight: 700; letter-spacing: -0.025em; }
[data-color-theme="apple"] .stream-meta__sub { font-size: 13px; }

/* Live / replay badge and timer: pills */
[data-color-theme="apple"] .live-badge {
  border-radius: 980px;
  padding: 5px 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 10px rgba(255, 69, 58, 0.35);
}
[data-color-theme="apple"] .live-badge--replay { background: #FF9F0A; color: #1a1000; box-shadow: none; }
[data-color-theme="apple"] .live-duration {
  border-radius: 980px;
  background: rgba(28, 28, 30, 0.6);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  font-weight: 600;
}

/* ---- Offline screen: frosted panel, large-title typography ---- */
[data-color-theme="apple"] .offline-overlay { background-color: #000; }
[data-color-theme="apple"] .offline-overlay__inner {
  background: rgba(28, 28, 30, 0.55);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-radius: 22px;
  box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.08);
  padding: 22px 34px;
}
[data-color-theme="apple"] .offline-overlay__text { font-weight: 700; letter-spacing: -0.03em; text-shadow: none; }
[data-color-theme="apple"] .offline-overlay__next { font-weight: 600; letter-spacing: -0.02em; }
[data-color-theme="apple"] .countdown__block {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 14px;
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.1);
}
[data-color-theme="apple"] .countdown__num { font-weight: 600; letter-spacing: -0.02em; }
[data-color-theme="apple"] .countdown__label { letter-spacing: 0.06em; color: rgba(235, 235, 245, 0.5); }
[data-color-theme="apple"] .countdown__sep { color: rgba(235, 235, 245, 0.3); font-weight: 500; }

/* ---- News ticker ---- */
[data-color-theme="apple"] .news-ticker { background: var(--bg-elevated); border-bottom: none; }
[data-color-theme="apple"] .news-ticker__label { font-weight: 700; letter-spacing: 0.06em; }

/* ---- On-screen popup: glass notification banner ---- */
[data-color-theme="apple"] .stream-popup {
  background: rgba(30, 30, 32, 0.78);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 0.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

/* ---- Chat panel ---- */
[data-color-theme="apple"] .chat__header {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-bottom: 0.5px solid var(--border);
}
[data-color-theme="apple"] .chat__messages { font-size: 14px; gap: 7px; }
[data-color-theme="apple"] .chat-msg__name { font-weight: 600; }
[data-color-theme="apple"] .chat-msg__name--mod { color: #30D158 !important; font-weight: 600; }
[data-color-theme="apple"] .chat-msg__name--bot { font-weight: 600; }
[data-color-theme="apple"] .chat-msg__badge { border-radius: 980px; padding: 1px 6px; font-weight: 700; letter-spacing: 0.04em; }
[data-color-theme="apple"] .chat-msg__badge--mod { background: #30D158; color: #04210f; }
[data-color-theme="apple"] .chat-mention { border-radius: 6px; }
[data-color-theme="apple"] .chat-link { text-decoration: none; }
[data-color-theme="apple"] .chat-link:hover { text-decoration: underline; }
[data-color-theme="apple"] .chat-msg__image { border-radius: 12px; border: none; box-shadow: 0 0 0 0.5px var(--border); }
[data-color-theme="apple"] .chat-msg__delete,
[data-color-theme="apple"] .chat-msg__ban { border-radius: 50%; width: 20px; height: 20px; }
[data-color-theme="apple"] .chat-msg__ban { background: #FF9F0A; color: #1a1000; }
[data-color-theme="apple"] .chat-msg__pin:hover,
[data-color-theme="apple"] .chat-msg__timeout:hover { background: var(--fill); }

[data-color-theme="apple"] .chat__form { border-top: 0.5px solid var(--border); padding: 12px 12px 14px; }
[data-color-theme="apple"] .chat__name,
[data-color-theme="apple"] .chat__input,
[data-color-theme="apple"] .mod-popover input {
  border: none;
  border-radius: var(--radius-field);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.06);
  transition: box-shadow 0.2s ease;
}
[data-color-theme="apple"] .chat__name:focus,
[data-color-theme="apple"] .chat__input:focus,
[data-color-theme="apple"] .mod-popover input:focus {
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.5);
}
[data-color-theme="apple"] .chat__name[readonly] { background: var(--bg-elevated-2); box-shadow: none; }
[data-color-theme="apple"] .chat__composer-icons {
  border-top: 0.5px solid var(--border);
  border-radius: 0 0 var(--radius-field) var(--radius-field);
}
[data-color-theme="apple"] .chat__icon-btn { border-radius: 50%; width: 28px; height: 28px; }
[data-color-theme="apple"] .chat__icon-btn:hover { background: var(--fill); }
[data-color-theme="apple"] .chat__send { border-radius: 980px; font-weight: 600; }
[data-color-theme="apple"] .chat__send:active,
[data-color-theme="apple"] .mod-popover button:active { transform: scale(0.96); }
[data-color-theme="apple"] .mod-popover { background: var(--bg-elevated); border-bottom: 0.5px solid var(--border); }
[data-color-theme="apple"] .mod-popover button { border-radius: 980px; padding: 0 16px; font-weight: 600; }
[data-color-theme="apple"] .chat-disabled-notice { border-radius: 14px; background: var(--fill); border: none; }

/* Emoji picker / timeout menu: popover style */
[data-color-theme="apple"] .emoji-picker { background: var(--bg-elevated-2); border-top: 0.5px solid var(--border); }
[data-color-theme="apple"] .emoji-btn { border-radius: 10px; }
[data-color-theme="apple"] .emoji-btn:hover { background: var(--fill); }
[data-color-theme="apple"] .timeout-menu {
  background: rgba(44, 44, 46, 0.85);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 0.5px solid var(--border);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
[data-color-theme="apple"] .timeout-menu__header { text-transform: none; letter-spacing: 0; font-weight: 600; border-bottom: 0.5px solid var(--border); }
[data-color-theme="apple"] .timeout-menu__item { border-radius: 8px; }
[data-color-theme="apple"] .timeout-menu__item:hover { background: var(--accent); color: #fff; }

/* Pinned message, poll, announcement, voice bar */
[data-color-theme="apple"] .pinned-bar {
  background: var(--accent-soft);
  border-bottom: 0.5px solid var(--border);
}
@media (max-width: 900px) {
  [data-color-theme="apple"] .pinned-bar { background: rgba(10, 132, 255, 0.16); border-bottom: 0.5px solid var(--border); }
}
[data-color-theme="apple"] .pinned-bar__content strong { font-weight: 600; }
[data-color-theme="apple"] .pinned-bar__unpin { border-radius: 50%; }

[data-color-theme="apple"] .poll-bar { background: var(--bg-elevated); border-bottom: 0.5px solid var(--border); }
[data-color-theme="apple"] .poll-bar__question { font-weight: 600; letter-spacing: -0.01em; }
[data-color-theme="apple"] .poll-bar__badge { font-weight: 700; padding: 3px 9px; }
[data-color-theme="apple"] .poll-bar__badge--closed { background: var(--fill); }
[data-color-theme="apple"] .poll-bar__min-btn { border: none; border-radius: 50%; background: var(--fill); width: 22px; height: 22px; }
[data-color-theme="apple"] .poll-bar__min-btn:hover { background: var(--fill-hover); }
[data-color-theme="apple"] .poll-option {
  border: none;
  border-radius: 12px;
  background: var(--bg-elevated-2);
  margin-bottom: 7px;
}
[data-color-theme="apple"] .poll-option:hover { box-shadow: inset 0 0 0 1px var(--accent); }
[data-color-theme="apple"] .poll-option--picked { box-shadow: inset 0 0 0 1.5px var(--accent); }
[data-color-theme="apple"] .poll-option__row { padding: 9px 12px; }
[data-color-theme="apple"] .poll-bar__mod-btn { border: none; background: var(--fill); border-radius: 980px; padding: 4px 11px; }

[data-color-theme="apple"] .announce-bar {
  background: rgba(255, 159, 10, 0.08);
  border-top: 0.5px solid var(--border);
  border-bottom: 0.5px solid var(--border);
}
[data-color-theme="apple"] .announce-bar__input {
  background: var(--bg-elevated-2);
  border: none;
  border-radius: var(--radius-field);
  padding: 9px 12px;
}
[data-color-theme="apple"] .announce-bar__input:focus { box-shadow: 0 0 0 3px rgba(255, 159, 10, 0.45); }
[data-color-theme="apple"] .announce-bar__input::placeholder { color: rgba(255, 159, 10, 0.6); }
[data-color-theme="apple"] .announce-bar__btn { background: #FF9F0A; border-radius: 980px; padding: 8px 16px; font-weight: 600; }
[data-color-theme="apple"] .announce-bar__btn:hover { background: #FFB340; }
[data-color-theme="apple"] .chat-msg--announcement {
  background: rgba(255, 159, 10, 0.12);
  border: none;
  border-radius: 14px;
  padding: 10px 14px;
}
[data-color-theme="apple"] .chat-msg--announcement .announce-text { color: #FFB340; font-weight: 600; }
[data-color-theme="apple"] .voice-bar {
  background: rgba(255, 69, 58, 0.1);
  border-top: 0.5px solid var(--border);
  border-bottom: 0.5px solid var(--border);
}

/* ---- Player controls (Agora / VideoSDK / GetStream) ---- */
[data-color-theme="apple"] .agora-controls__btn { border-radius: 50%; }
[data-color-theme="apple"] .agora-controls__quality-menu {
  background: rgba(44, 44, 46, 0.82);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 6px;
}
[data-color-theme="apple"] .agora-controls__quality-menu button { border-radius: 8px; }
[data-color-theme="apple"] .agora-unmute-btn {
  background: rgba(28, 28, 30, 0.7);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 0.5px solid rgba(255, 255, 255, 0.16);
  font-weight: 600;
}

/* ---- Flyout menu: glass sidebar ---- */
[data-color-theme="apple"] .flyout-backdrop { background: rgba(0, 0, 0, 0.45); }
[data-color-theme="apple"] .flyout-drawer {
  background: rgba(28, 28, 30, 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  backdrop-filter: saturate(180%) blur(30px);
  border-left: 0.5px solid var(--border);
}
[data-color-theme="apple"] .flyout-header,
[data-color-theme="apple"] .flyout-footer { border-color: var(--border); border-width: 0.5px; }
[data-color-theme="apple"] .flyout-brand { font-weight: 600; letter-spacing: -0.01em; }
[data-color-theme="apple"] .flyout-close { border: none; border-radius: 50%; background: var(--fill); }
[data-color-theme="apple"] .flyout-close:hover { background: var(--fill-hover); }
[data-color-theme="apple"] .flyout-link { font-weight: 500; color: var(--text); }
[data-color-theme="apple"] .flyout-link:hover { background: var(--fill); }
[data-color-theme="apple"] .flyout-link--active { background: var(--accent); color: #fff; }
[data-color-theme="apple"] .flyout-link--active:hover { background: var(--accent); color: #fff; }
[data-color-theme="apple"] .flyout-link--muted { color: var(--text-muted); }
[data-color-theme="apple"] .flyout-badge { background: #fff; color: #FF453A; }
[data-color-theme="apple"] .flyout-divider { border-top-width: 0.5px; }
[data-color-theme="apple"] .flyout-qr__box { border-radius: 16px; }

/* ---- Name gate / donation card: iOS sheet ---- */
[data-color-theme="apple"] .namegate {
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
}
[data-color-theme="apple"] .namegate__card {
  background: rgba(28, 28, 30, 0.92);
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 26px;
  padding: 34px 28px 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
[data-color-theme="apple"] .namegate__logo { font-weight: 700; letter-spacing: -0.02em; }
[data-color-theme="apple"] .namegate__title { font-weight: 700; font-size: 22px; letter-spacing: -0.025em; }
[data-color-theme="apple"] .namegate__sub { color: var(--text-muted); }
[data-color-theme="apple"] .namegate__input {
  background: var(--bg-elevated-2);
  border: none;
  border-radius: var(--radius-field);
  font-size: 17px;
  transition: box-shadow 0.2s ease;
}
[data-color-theme="apple"] .namegate__input:focus { box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.5); }
[data-color-theme="apple"] .namegate__check { color: var(--text-muted); }
[data-color-theme="apple"] .namegate__error { color: #FF453A; }
[data-color-theme="apple"] .namegate__btn,
[data-color-theme="apple"] .namegate__donate-btn {
  border-radius: 980px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 14px;
}
[data-color-theme="apple"] .namegate__btn:active,
[data-color-theme="apple"] .namegate__donate-btn:active { transform: scale(0.97); }
[data-color-theme="apple"] .namegate__donate-btn {
  background: #0A84FF;
  box-shadow: none;
  animation: none;
}
[data-color-theme="apple"] .namegate__donate-btn:hover { filter: none; background: #409CFF; box-shadow: none; }
[data-color-theme="apple"] .namegate__donate-lead { font-weight: 700; letter-spacing: -0.02em; }
[data-color-theme="apple"] .namegate__donate-text { color: var(--text-muted); }
[data-color-theme="apple"] .namegate__continue { color: var(--accent); font-weight: 500; font-size: 15px; }
[data-color-theme="apple"] .namegate__continue:hover { color: var(--accent-hover); text-decoration: none; }

/* ---- Confirm dialog: iOS alert ---- */
[data-color-theme="apple"] .confirm-modal {
  background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
[data-color-theme="apple"] .confirm-modal__card {
  max-width: 300px;
  background: rgba(44, 44, 46, 0.88);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 0.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
}
[data-color-theme="apple"] .confirm-modal__title { font-size: 17px; font-weight: 600; margin: 20px 18px 4px; }
[data-color-theme="apple"] .confirm-modal__body { font-size: 13px; margin: 0 18px 18px; color: var(--text-muted); }
[data-color-theme="apple"] .confirm-modal__actions { gap: 0; border-top: 0.5px solid var(--border); }
[data-color-theme="apple"] .confirm-modal__btn {
  border-radius: 0;
  background: transparent;
  font-size: 17px;
  font-weight: 400;
  padding: 12px;
}
[data-color-theme="apple"] .confirm-modal__btn:active { transform: none; background: var(--fill); }
[data-color-theme="apple"] .confirm-modal__btn--no { color: var(--accent); font-weight: 600; border-right: 0.5px solid var(--border); }
[data-color-theme="apple"] .confirm-modal__btn--no:hover,
[data-color-theme="apple"] .confirm-modal__btn--yes:hover { background: var(--fill); }
[data-color-theme="apple"] .confirm-modal__btn--yes { color: #FF453A; }

/* ---- Image lightbox ---- */
[data-color-theme="apple"] .chat-lightbox__backdrop {
  background: rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
[data-color-theme="apple"] .chat-lightbox__box {
  background: #1C1C1E;
  border: 0.5px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
[data-color-theme="apple"] .chat-lightbox__img { border-radius: 14px; }
[data-color-theme="apple"] .chat-lightbox__close {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--fill); color: var(--text-muted); font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}

/* ---- Mobile chat button ---- */
@media (max-width: 900px) {
  [data-color-theme="apple"] .chat-expand-btn { border-radius: 980px; font-weight: 600; }
}

/* ---- Content pages (blog / schedule / about — site.css) ---- */
[data-color-theme="apple"] .site-nav {
  background: rgba(22, 22, 23, 0.72);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-bottom: 0.5px solid var(--border);
}
[data-color-theme="apple"] .site-nav__link { border-radius: 980px; font-weight: 500; }
[data-color-theme="apple"] .site-smartlink-bar { background: var(--bg); }
[data-color-theme="apple"] .site-smartlink-btn { border-radius: 980px; box-shadow: none; font-weight: 600; }
[data-color-theme="apple"] .page-hero__title,
[data-color-theme="apple"] .post-title { font-weight: 700; letter-spacing: -0.035em; }
[data-color-theme="apple"] .blog-card,
[data-color-theme="apple"] .schedule-card {
  border: none;
  border-radius: var(--radius-card);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 0.5px var(--border);
}
[data-color-theme="apple"] .blog-card:hover { border-color: transparent; transform: scale(1.015); box-shadow: 0 0 0 0.5px var(--border), var(--shadow); }
[data-color-theme="apple"] .blog-card__title,
[data-color-theme="apple"] .schedule-card__title { font-weight: 600; letter-spacing: -0.015em; }
[data-color-theme="apple"] .post-body img { border-radius: 14px; }

@media (prefers-reduced-motion: reduce) {
  [data-color-theme="apple"] .blog-card:hover { transform: none; }
}

/* Apple theme fit-and-finish */
[data-color-theme="apple"] .chat__header > span:first-child { white-space: nowrap; }
@media (max-width: 900px) {
  /* Don't let the grid stretch rows to fill the screen (left an empty band above chat). */
  [data-color-theme="apple"] .layout { align-content: start; }
}

/* =====================================================================
   BAHAY LIVE THEME — original reality-house look (Admin → Appearance)
   Night-sky navy, hot magenta + marquee gold, CCTV-style player overlay,
   bubble chat, big live-vote poll bars. Everything is scoped to
   [data-color-theme="bahay"] so the other themes are untouched.
   ===================================================================== */
[data-color-theme="bahay"] {
  --bg: #0b0630;
  --bg-elevated: #160c4a;
  --bg-elevated-2: #21125f;
  --border: rgba(255, 255, 255, 0.10);
  --text: #fff7fb;
  --text-muted: #c9bfe8;
  --text-faint: #8a7fb5;
  --chat-bg: #120a3d;
  --input-bg: #0b0630;
  --scrollbar: #3a2a7a;
  --accent: #ff2e93;
  --accent-hover: #e3167a;
  --accent-soft: rgba(255, 46, 147, 0.16);
  --accent-strong-soft: rgba(255, 46, 147, 0.30);
  --accent-text: #ff7cbc;
  --accent-2: #ffcf3f;
  --accent-2-soft: rgba(255, 207, 63, 0.16);
  --live-red: #ff3b3b;
  --online-green: #3dffb0;
  --shadow: 0 10px 30px rgba(5, 0, 30, 0.55);
  --modal-bg: #160c4a;
  --modal-border: rgba(255, 46, 147, 0.45);
  --modal-shadow: 0 20px 60px rgba(255, 46, 147, 0.25);
  --modal-hint: #c9bfe8;
  --bahay-glow: 0 0 18px rgba(255, 46, 147, 0.55);
  --bahay-display: "Baloo 2", var(--site-font);
  --bahay-mono: "Share Tech Mono", ui-monospace, Menlo, Consolas, monospace;
}
[data-color-theme="bahay"] body {
  background:
    radial-gradient(1200px 500px at 15% -10%, rgba(255, 46, 147, 0.18), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(255, 207, 63, 0.10), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}
[data-color-theme="bahay"] ::selection { background: rgba(255, 46, 147, 0.45); }

/* ---- Header ---- */
[data-color-theme="bahay"] .topbar {
  background: linear-gradient(90deg, rgba(22, 12, 74, 0.95), rgba(40, 10, 80, 0.95));
  border-bottom: 1px solid rgba(255, 46, 147, 0.35);
  box-shadow: 0 2px 24px rgba(255, 46, 147, 0.12);
}
[data-color-theme="bahay"] .brand__name {
  font-family: var(--bahay-display);
  font-weight: 800;
  letter-spacing: 0.01em;
  font-size: 22px;
}
[data-color-theme="bahay"] .brand__accent {
  color: var(--accent-2);
  text-shadow: 0 0 12px rgba(255, 207, 63, 0.55);
}
[data-color-theme="bahay"] .bahay-logo { background: none; display: inline-flex; align-items: center; }
.bahay-day {
  margin-left: 12px;
  font-family: var(--bahay-display, inherit);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: #0b0630;
  background: linear-gradient(90deg, #ffcf3f, #ff9f3f);
  padding: 3px 10px;
  border-radius: 999px;
  box-shadow: 0 0 14px rgba(255, 207, 63, 0.45);
  white-space: nowrap;
  align-self: center;
}
@media (max-width: 560px) {
  [data-color-theme="bahay"] .brand__name { font-size: 17px; }
  .bahay-day { font-size: 11px; padding: 2px 8px; margin-left: 8px; }
}
[data-color-theme="bahay"] #smartlinkBtn {
  background: linear-gradient(90deg, #ff2e93, #ff6a3d) !important;
  border-radius: 999px !important;
  box-shadow: var(--bahay-glow);
}

/* ---- Player: framed like a house camera monitor ---- */
[data-color-theme="bahay"] .player-wrap {
  border-radius: 14px;
  border: 2px solid rgba(255, 46, 147, 0.55);
  box-shadow: 0 0 0 4px rgba(255, 46, 147, 0.10), 0 0 40px rgba(255, 46, 147, 0.22);
}
@media (min-width: 901px) {
  [data-color-theme="bahay"] .stage { padding: 16px 0 0 16px; }
}
.cctv {
  position: absolute;
  inset: 0;
  z-index: 3;            /* above video (1) & offline screen (2), below badges (4-5) */
  pointer-events: none;
  font-family: var(--bahay-mono, monospace);
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}
.cctv__scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}
.cctv__corner {
  position: absolute;
  width: 26px;
  height: 26px;
  border-color: rgba(255, 255, 255, 0.75);
  border-style: solid;
  border-width: 0;
}
.cctv__corner--tl { top: 10px;    left: 10px;  border-top-width: 2px;    border-left-width: 2px; }
.cctv__corner--tr { top: 10px;    right: 10px; border-top-width: 2px;    border-right-width: 2px; }
.cctv__corner--bl { bottom: 10px; left: 10px;  border-bottom-width: 2px; border-left-width: 2px; }
.cctv__corner--br { bottom: 10px; right: 10px; border-bottom-width: 2px; border-right-width: 2px; }
.cctv__tag,
.cctv__clock {
  position: absolute;
  bottom: 18px;
  font-size: 13px;
  letter-spacing: 0.12em;
  background: rgba(0, 0, 0, 0.45);
  padding: 3px 8px;
  border-radius: 4px;
}
.cctv__tag   { left: 22px; display: flex; align-items: center; gap: 7px; }
.cctv__clock { right: 22px; font-variant-numeric: tabular-nums; }
.cctv__rec {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff3b3b;
  box-shadow: 0 0 8px #ff3b3b;
  animation: cctvBlink 1.2s steps(2, start) infinite;
}
@keyframes cctvBlink { to { visibility: hidden; } }
@media (max-width: 560px) {
  .cctv__tag, .cctv__clock { font-size: 10px; bottom: 12px; padding: 2px 6px; }
  .cctv__tag { left: 14px; } .cctv__clock { right: 14px; }
  .cctv__corner { width: 16px; height: 16px; }
}
@media (prefers-reduced-motion: reduce) { .cctv__rec { animation: none; } }

[data-color-theme="bahay"] .live-badge {
  border-radius: 999px;
  padding: 5px 12px;
  font-family: var(--bahay-display);
  font-weight: 800;
  letter-spacing: 0.1em;
  background: linear-gradient(90deg, #ff3b3b, #ff2e93);
  box-shadow: 0 0 16px rgba(255, 59, 59, 0.6);
}
[data-color-theme="bahay"] .live-duration {
  font-family: var(--bahay-mono);
  border-radius: 999px;
  border: 1px solid rgba(255, 207, 63, 0.5);
  color: var(--accent-2);
}

/* ---- Offline screen ---- */
[data-color-theme="bahay"] .offline-overlay__text {
  font-family: var(--bahay-display);
  font-weight: 800;
  text-shadow: 0 0 22px rgba(255, 46, 147, 0.7), 0 2px 6px rgba(0, 0, 0, 0.8);
}
[data-color-theme="bahay"] .offline-overlay__next { color: var(--accent-2); font-family: var(--bahay-display); font-weight: 700; }
[data-color-theme="bahay"] .countdown__block {
  background: rgba(11, 6, 48, 0.72);
  border: 1px solid rgba(255, 46, 147, 0.5);
  border-radius: 12px;
  box-shadow: 0 0 18px rgba(255, 46, 147, 0.25);
}
[data-color-theme="bahay"] .countdown__num { font-family: var(--bahay-mono); color: var(--accent-2); }

/* ---- Under-player meta + ticker ---- */
[data-color-theme="bahay"] .stream-meta__title { font-family: var(--bahay-display); font-weight: 800; font-size: 22px; }
[data-color-theme="bahay"] .stream-meta__avatar { box-shadow: 0 0 0 2px var(--accent), var(--bahay-glow); }
[data-color-theme="bahay"] .news-ticker {
  background: linear-gradient(90deg, #160c4a, #2a0f5c);
  border-top: 1px solid rgba(255, 207, 63, 0.35);
  border-bottom: 1px solid rgba(255, 207, 63, 0.35);
}
[data-color-theme="bahay"] .news-ticker__label {
  background: linear-gradient(90deg, #ffcf3f, #ff9f3f);
  color: #0b0630;
  font-family: var(--bahay-display);
  font-weight: 800;
}

/* ---- Chat: housemate bubbles ---- */
[data-color-theme="bahay"] .chat { border-left: 1px solid rgba(255, 46, 147, 0.25); }
[data-color-theme="bahay"] .chat__header {
  font-family: var(--bahay-display);
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(90deg, rgba(255, 46, 147, 0.18), transparent);
}
[data-color-theme="bahay"] .chat-msg:not(.chat-msg--system):not(.chat-msg--announcement):not(.chat-msg--welcome) {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px 14px 14px 4px;
  padding: 6px 44px 6px 10px;
  margin: 5px 0;
}
[data-color-theme="bahay"] .chat-msg__name--mod { color: var(--accent-2) !important; }
[data-color-theme="bahay"] .chat-msg__badge--mod { background: var(--accent-2); color: #0b0630; }
[data-color-theme="bahay"] .chat-msg__badge--bot { background: var(--accent); }
[data-color-theme="bahay"] .chat-msg--system { font-style: italic; text-align: center; }
[data-color-theme="bahay"] .chat__input,
[data-color-theme="bahay"] .chat__name { border-radius: 12px; }
[data-color-theme="bahay"] .chat__send { background: linear-gradient(135deg, #ff2e93, #ff6a3d); box-shadow: var(--bahay-glow); }

/* Announcements read like a house broadcast */
[data-color-theme="bahay"] .chat-msg--announcement {
  background: linear-gradient(90deg, rgba(255, 207, 63, 0.18), rgba(255, 46, 147, 0.14));
  border: 1px solid rgba(255, 207, 63, 0.55);
  border-radius: 12px;
  box-shadow: 0 0 16px rgba(255, 207, 63, 0.15);
}
[data-color-theme="bahay"] .chat-msg--announcement .announce-text {
  color: #ffe9a8;
  font-family: var(--bahay-display);
  font-weight: 700;
  font-size: 15px;
}
[data-color-theme="bahay"] .pinned-bar { background: rgba(255, 207, 63, 0.10); border-bottom: 1px solid rgba(255, 207, 63, 0.3); }
[data-color-theme="bahay"] .stream-popup {
  font-family: var(--bahay-display);
  font-weight: 800;
  background: linear-gradient(90deg, rgba(255, 46, 147, 0.95), rgba(255, 106, 61, 0.95));
  box-shadow: 0 0 30px rgba(255, 46, 147, 0.6);
}

/* ---- Poll: live-vote board with big bars ---- */
[data-color-theme="bahay"] .poll-bar {
  background: linear-gradient(180deg, rgba(255, 46, 147, 0.14), rgba(18, 10, 61, 0.9));
  border-bottom: 1px solid rgba(255, 46, 147, 0.35);
}
[data-color-theme="bahay"] .poll-bar__question { font-family: var(--bahay-display); font-weight: 800; font-size: 15px; }
[data-color-theme="bahay"] .poll-bar__badge { background: var(--accent-2); color: #0b0630; }
[data-color-theme="bahay"] .poll-option {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(11, 6, 48, 0.7);
}
[data-color-theme="bahay"] .poll-option__row { padding: 10px 12px; }
[data-color-theme="bahay"] .poll-option__fill { background: linear-gradient(90deg, rgba(255, 46, 147, 0.55), rgba(255, 106, 61, 0.45)); }
[data-color-theme="bahay"] .poll-option--picked { border-color: var(--accent-2); box-shadow: 0 0 12px rgba(255, 207, 63, 0.35); }
[data-color-theme="bahay"] .poll-option--picked .poll-option__fill { background: linear-gradient(90deg, rgba(255, 207, 63, 0.6), rgba(255, 159, 63, 0.45)); }
[data-color-theme="bahay"] .poll-option__pct { font-family: var(--bahay-mono); font-size: 16px; color: #fff; }

/* ---- Name gate + menu ---- */
[data-color-theme="bahay"] .namegate__card {
  border: 1px solid rgba(255, 46, 147, 0.5);
  box-shadow: 0 0 50px rgba(255, 46, 147, 0.3);
  border-radius: 20px;
}
[data-color-theme="bahay"] .namegate__title,
[data-color-theme="bahay"] .namegate__logo { font-family: var(--bahay-display); font-weight: 800; }
[data-color-theme="bahay"] .namegate__logo span { color: var(--accent-2); }
[data-color-theme="bahay"] .namegate__btn {
  background: linear-gradient(90deg, #ff2e93, #ff6a3d);
  border-radius: 999px;
  box-shadow: var(--bahay-glow);
  font-family: var(--bahay-display);
  font-weight: 800;
  letter-spacing: 0.03em;
}
[data-color-theme="bahay"] .flyout-drawer { background: #120a3d; border-right: 1px solid rgba(255, 46, 147, 0.3); }
[data-color-theme="bahay"] .topbar__left { display: flex; flex-direction: row; align-items: center; flex-wrap: nowrap; }
[data-color-theme="bahay"] .live-badge { top: 18px; left: 20px; }
[data-color-theme="bahay"] .live-duration { top: 18px; right: 20px; }
@media (max-width: 560px) {
  [data-color-theme="bahay"] .live-badge { top: 12px; left: 14px; }
  [data-color-theme="bahay"] .live-duration { top: 12px; right: 14px; }
}
