/* ============================================================================
   MINI CINEMA — Cinematic Obsidian & Ambient Glow Design System
   ============================================================================ */

:root {
  --bg-base: #08090e;
  --bg-elevated: #11131d;
  --bg-surface: rgba(18, 21, 32, 0.76);
  --bg-surface-strong: rgba(14, 16, 25, 0.92);
  --bg-hover: rgba(255, 255, 255, 0.07);

  --text-primary: #f5f6fa;
  --text-secondary: #a1a8bd;
  --text-muted: #69718a;

  --accent: #ff2e55;
  --accent-2: #e50914;
  --accent-soft: rgba(255, 46, 85, 0.16);
  --accent-glow: rgba(255, 46, 85, 0.42);

  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.72);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.5);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --font-sans: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  /* Dynamic subtitle styling variables */
  --sub-size: 1.35rem;
  --sub-bg-opacity: 0.68;
  --sub-bottom: 11%;
}

[data-theme="pink"] {
  --bg-base: #160c13;
  --bg-elevated: #22121d;
  --bg-surface: rgba(42, 20, 35, 0.8);
  --bg-surface-strong: rgba(31, 14, 26, 0.94);
  --bg-hover: rgba(255, 165, 205, 0.11);

  --text-primary: #fff3f8;
  --text-secondary: #dfafc6;
  --text-muted: #9e6e86;

  --accent: #ff6b9d;
  --accent-2: #ec4899;
  --accent-soft: rgba(255, 107, 157, 0.2);
  --accent-glow: rgba(255, 107, 157, 0.48);

  --border: rgba(255, 182, 213, 0.14);
  --border-strong: rgba(255, 182, 213, 0.26);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body.page-room {
  overflow: hidden;
}

body.page-home {
  overflow-x: hidden;
  overflow-y: auto;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.26); }

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

svg.ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

/* ============================================================================
   SHARED BUTTONS, INPUTS, CHIPS, BADGES, TOASTS
   ============================================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  color: var(--text-primary);
  background: var(--bg-surface);
  white-space: nowrap;
}

.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 8px 24px var(--accent-glow);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 12px 30px var(--accent-glow);
  filter: brightness(1.06);
}

.btn-glass {
  background: var(--bg-surface);
  border-color: var(--border);
  backdrop-filter: blur(16px);
}
.btn-glass:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}
.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.28);
  color: #fff;
}

.btn-success {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}
.btn-success:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.3);
  color: #fff;
}

.btn-sm { padding: 7px 12px; font-size: 0.78rem; border-radius: 10px; }
.btn-lg { padding: 13px 24px; font-size: 0.96rem; border-radius: 14px; }

.icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(14px);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.16s ease;
}
.icon-btn:hover { background: var(--bg-hover); border-color: var(--border-strong); transform: translateY(-1px); }
.icon-btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.icon-btn.voice-live { background: rgba(16, 185, 129, 0.18); border-color: rgba(16, 185, 129, 0.55); color: #34d399; }
.icon-btn.voice-muted { background: rgba(239, 68, 68, 0.18); border-color: rgba(239, 68, 68, 0.45); color: #f87171; }

.badge-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.field {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.92rem;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: rgba(0, 0, 0, 0.52);
}
.field::placeholder { color: var(--text-muted); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}
.chip:hover { color: var(--text-primary); border-color: var(--border-strong); background: var(--bg-hover); }
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--text-primary); }

/* Toast stack */
.toast-stack {
  position: fixed;
  top: 76px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 340px;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-strong);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow-md);
  font-size: 0.84rem;
  line-height: 1.35;
  animation: toastIn 0.24s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.toast.warn { border-color: rgba(245, 158, 11, 0.5); }
.toast.error { border-color: rgba(239, 68, 68, 0.55); }
.toast.success { border-color: rgba(16, 185, 129, 0.5); }
.toast.fade { opacity: 0; transform: translateX(18px); transition: all 0.22s ease; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px) scale(0.96); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent);
  animation: spin 0.85s linear infinite;
}

/* ============================================================================
   HOME PAGE
   ============================================================================ */

.home-ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, var(--accent-soft), transparent 70%),
    radial-gradient(ellipse 45% 40% at 85% 20%, rgba(99, 102, 241, 0.1), transparent 70%),
    var(--bg-base);
}

.home-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: rgba(8, 9, 14, 0.72);
  backdrop-filter: blur(22px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.08rem;
  letter-spacing: 0.04em;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 6px 20px var(--accent-glow);
}

.home-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nick-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 99px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}
.nick-pill input {
  width: 115px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
}
.nick-pill input:focus { outline: none; }

.home-main {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin: 0 auto;
  padding: 36px 24px 80px;
}

.hero {
  text-align: center;
  max-width: 820px;
  margin: 12px auto 34px;
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 99px;
  background: var(--accent-soft);
  border: 1px solid rgba(255, 46, 85, 0.3);
  color: var(--text-primary);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(2rem, 4.4vw, 3.35rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
}
.hero h1 span {
  background: linear-gradient(135deg, #fff 10%, var(--accent) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.55;
  margin-bottom: 26px;
}

/* Search Bar */
.search-bar-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 18px;
  border-radius: 18px;
  background: var(--bg-surface-strong);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-bar-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg), 0 0 0 4px var(--accent-soft);
}
.search-bar-wrap input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1.02rem;
  padding: 6px 4px;
}
.search-bar-wrap input:focus { outline: none; }
.search-bar-wrap input::placeholder { color: var(--text-muted); }

.search-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.filter-group, .quick-picks {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Room Quick Bar (Join or Create Empty Room) */
.room-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 0 auto 36px;
  max-width: 820px;
}
.room-strip-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px);
}
.room-strip-card .join-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.room-strip-card .code-input {
  font-family: var(--font-mono);
  letter-spacing: 0.14em;
  text-align: center;
  max-width: 155px;
}
.room-preview-line {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Catalog Poster Grid */
.catalog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.catalog-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
}
.catalog-meta {
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 20px;
}

.poster-card {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1), border-color 0.22s, box-shadow 0.22s;
  display: flex;
  flex-direction: column;
}
.poster-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.65), 0 0 24px var(--accent-soft);
}

.poster-art {
  position: relative;
  aspect-ratio: 2 / 3;
  background: linear-gradient(145deg, #171a26, #0d0f17);
  overflow: hidden;
}
.poster-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.poster-card:hover .poster-art img { transform: scale(1.05); }

.poster-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(8, 9, 14, 0.78);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.poster-badge.series { color: #7dd3fc; }
.poster-badge.movie { color: #fda4af; }

.poster-year {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(8, 9, 14, 0.72);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.poster-hover-play {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8, 9, 14, 0.9) 0%, rgba(8, 9, 14, 0.2) 55%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.poster-card:hover .poster-hover-play { opacity: 1; }
.poster-play-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px var(--accent-glow);
  transform: scale(0.88);
  transition: transform 0.22s ease;
}
.poster-card:hover .poster-play-circle { transform: scale(1); }

.poster-body {
  padding: 12px 13px 14px;
}
.poster-title {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.skeleton-card {
  aspect-ratio: 2 / 3.45;
  border-radius: var(--radius-lg);
  background: linear-gradient(110deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.empty-state {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-secondary);
}
.empty-state h3 { color: var(--text-primary); margin-bottom: 8px; font-size: 1.15rem; }

/* ============================================================================
   MODALS (SHOW DETAILS & IN-ROOM CATALOG)
   ============================================================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(4, 5, 10, 0.78);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-shell {
  position: relative;
  width: 100%;
  max-width: 920px;
  max-height: 88vh;
  border-radius: var(--radius-xl);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-shell.wide { max-width: 1080px; height: 86vh; }

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 20;
}

.modal-scroll {
  overflow-y: auto;
  flex: 1;
}

/* Show Details Hero inside Modal */
.detail-hero {
  position: relative;
  padding: 28px 28px 24px;
  display: grid;
  grid-template-columns: 185px 1fr;
  gap: 24px;
  align-items: end;
  min-height: 280px;
  overflow: hidden;
}
.detail-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(14px) brightness(0.42);
  transform: scale(1.1);
}
.detail-backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg-elevated) 5%, rgba(17, 19, 29, 0.65) 60%, rgba(17, 19, 29, 0.35) 100%);
}
.detail-poster {
  position: relative;
  z-index: 2;
  width: 185px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.16);
}
.detail-info {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.detail-title {
  font-size: clamp(1.4rem, 3vw, 2.05rem);
  font-weight: 800;
  line-height: 1.15;
}
.detail-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
  color: var(--text-secondary);
}
.rating-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 7px;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fcd34d;
  font-weight: 800;
}
.detail-desc {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
  max-height: 105px;
  overflow-y: auto;
}
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}
.limit-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.limit-inline select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.limit-inline select option { background: #141724; color: #fff; }

.detail-body {
  padding: 18px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.season-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.episode-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  transition: border-color 0.18s, background 0.18s;
}
.episode-card:hover { border-color: var(--accent); background: var(--bg-hover); }
.ep-thumb {
  width: 72px;
  height: 46px;
  border-radius: 7px;
  object-fit: cover;
  background: #141724;
  flex-shrink: 0;
}
.ep-info { flex: 1; min-width: 0; }
.ep-title { font-size: 0.84rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-sub { font-size: 0.74rem; color: var(--text-muted); margin-top: 2px; }
.ep-btns { display: flex; gap: 5px; flex-shrink: 0; }

.related-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
  gap: 12px;
}

/* ============================================================================
   ROOM LAYOUT
   ============================================================================ */

.room-app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-base);
}

.room-ambient-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  filter: blur(60px) saturate(1.3) brightness(0.26);
  transform: scale(1.18);
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}
.room-ambient-backdrop.visible { opacity: 1; }

.room-header {
  position: relative;
  z-index: 120;
  height: 60px;
  min-height: 60px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(8, 9, 14, 0.76);
  backdrop-filter: blur(22px);
  border-bottom: 1px solid var(--border);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.room-app:fullscreen .room-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.78), transparent);
  border-bottom: none;
}
.room-app:fullscreen.controls-hidden .room-header {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-100%);
}

.header-left, .header-center, .header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.header-center {
  flex: 1;
  justify-content: center;
  overflow: hidden;
}

.room-code-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-primary);
  transition: border-color 0.16s, background 0.16s;
}
.room-code-pill:hover { border-color: var(--accent); background: var(--bg-hover); }

.now-playing-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 420px;
  padding: 6px 14px;
  border-radius: 99px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  font-size: 0.84rem;
  font-weight: 700;
  overflow: hidden;
}
.now-playing-pill .title-ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
  flex-shrink: 0;
}
.live-dot.paused { background: var(--warning); box-shadow: 0 0 8px rgba(245, 158, 11, 0.7); }

/* Room Body */
.room-body {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

/* ============================================================================
   VIDEO STAGE & CUSTOM CINEMA PLAYER
   ============================================================================ */

.stage-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
}

.stage-wrap video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* Empty Stage (no movie selected yet) */
.stage-empty {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  text-align: center;
  background: radial-gradient(circle at 50% 40%, var(--accent-soft), rgba(6, 7, 12, 0.94) 68%);
}
.stage-empty-card {
  max-width: 460px;
  padding: 32px;
  border-radius: var(--radius-xl);
  background: var(--bg-surface-strong);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow-lg);
}
.stage-empty-card h2 { font-size: 1.45rem; font-weight: 800; margin: 14px 0 8px; }
.stage-empty-card p { color: var(--text-secondary); font-size: 0.92rem; line-height: 1.5; margin-bottom: 22px; }

/* Buffering Overlay */
.buffering-overlay {
  position: absolute;
  inset: 0;
  z-index: 55;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(6px);
  pointer-events: none;
}
.buffering-overlay span {
  font-size: 0.94rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--border);
}

/* Center Action Flash (Play/Pause/Seek feedback) */
.stage-flash {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  z-index: 58;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(10, 12, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  pointer-events: none;
  opacity: 0;
}
.stage-flash.pop {
  animation: flashPop 0.55s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes flashPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.25); }
}

/* Custom Subtitle Renderer Overlay */
.subtitle-layer {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: var(--sub-bottom);
  z-index: 52;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  pointer-events: none;
  transition: bottom 0.22s ease;
}
.subtitle-cue {
  display: inline-block;
  max-width: 90%;
  padding: 5px 14px;
  border-radius: 8px;
  background: rgba(0, 0, 0, var(--sub-bg-opacity));
  color: #ffffff;
  font-size: var(--sub-size);
  font-weight: 700;
  line-height: 1.45;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95);
  white-space: pre-wrap;
}

/* Floating Active Speakers Pill (top-left of stage) */
.active-speakers-hud {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 54;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  pointer-events: none;
}
.room-app:fullscreen .active-speakers-hud { top: 68px; }

.speaker-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 99px;
  background: rgba(10, 12, 18, 0.72);
  border: 1px solid rgba(16, 185, 129, 0.55);
  backdrop-filter: blur(12px);
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}
.eq-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}
.eq-bars i {
  width: 2.5px;
  background: #34d399;
  border-radius: 2px;
  animation: eqBounce 0.6s ease-in-out infinite alternate;
}
.eq-bars i:nth-child(2) { animation-delay: 0.18s; }
.eq-bars i:nth-child(3) { animation-delay: 0.34s; }
@keyframes eqBounce { from { height: 3px; } to { height: 12px; } }

/* Floating Live Emoji Reactions Layer */
.reactions-layer {
  position: absolute;
  inset: 0;
  z-index: 53;
  pointer-events: none;
  overflow: hidden;
}
.floating-emoji {
  position: absolute;
  bottom: 85px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  animation: floatUp 2.6s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
  will-change: transform, opacity;
}
.floating-emoji .em { font-size: 2.1rem; filter: drop-shadow(0 6px 14px rgba(0,0,0,0.65)); }
.floating-emoji .who {
  font-size: 0.66rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
}
@keyframes floatUp {
  0% { opacity: 0; transform: translateY(20px) scale(0.5); }
  15% { opacity: 1; transform: translateY(-25px) scale(1.12); }
  80% { opacity: 0.92; }
  100% { opacity: 0; transform: translateY(-320px) translateX(var(--drift, 0px)) scale(0.95); }
}

/* Next Up Countdown Banner */
.next-up-banner {
  position: absolute;
  right: 24px;
  bottom: 105px;
  z-index: 65;
  width: 310px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface-strong);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.next-up-label { font-size: 0.72rem; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em; }
.next-up-title { font-size: 0.98rem; font-weight: 800; }
.next-up-actions { display: flex; gap: 8px; }

/* Fullscreen Translucent Chat Overlay */
.fs-chat-overlay {
  position: absolute;
  left: 20px;
  bottom: 102px;
  z-index: 62;
  width: 340px;
  max-width: calc(100% - 40px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.fs-chat-feed {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow: hidden;
  justify-content: flex-end;
}
.fs-chat-bubble {
  align-self: flex-start;
  padding: 7px 12px;
  border-radius: 12px;
  background: rgba(10, 12, 18, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  font-size: 0.83rem;
  line-height: 1.35;
  color: #fff;
  max-width: 100%;
  animation: fadeIn 0.2s ease;
}
.fs-chat-bubble b { margin-right: 6px; }
.fs-chat-composer {
  pointer-events: auto;
  display: flex;
  gap: 6px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(10, 12, 18, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(14px);
}
.fs-chat-composer input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.84rem;
  padding: 4px 8px;
}
.fs-chat-composer input:focus { outline: none; }

/* Custom Controls Bar */
.player-controls {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.28s ease;
}
.player-controls.fade-out { opacity: 0; }
.player-controls.fade-out .controls-dock { pointer-events: none; }

.controls-gradient {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 175px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.45) 55%, transparent 100%);
  pointer-events: none;
}

.controls-dock {
  position: relative;
  z-index: 2;
  padding: 12px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: auto;
}

.timeline-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 16px;
}
.timeline-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  outline: none;
  transition: height 0.12s ease;
}
.timeline-slider:hover { height: 7px; }
.timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  cursor: pointer;
}

.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ctrl-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ctrl-btn {
  position: relative;
  height: 36px;
  min-width: 36px;
  padding: 0 8px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.14s;
}
.ctrl-btn:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.ctrl-btn.active { color: var(--accent); background: var(--accent-soft); }

.vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 78px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
}
.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
}

.time-code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.82);
  padding: 0 6px;
  white-space: nowrap;
}

/* Reaction Quick Bar inside Controls */
.reaction-strip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.react-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: transparent;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}
.react-btn:hover { transform: scale(1.28); background: rgba(255, 255, 255, 0.12); }

/* Popover Menus (Quality, Subtitles, Speed) */
.ctrl-popover {
  position: absolute;
  right: 20px;
  bottom: 78px;
  z-index: 80;
  width: 270px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface-strong);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.popover-title {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.popover-list { display: flex; flex-direction: column; gap: 4px; }
.popover-option {
  width: 100%;
  padding: 8px 11px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.popover-option:hover { background: var(--bg-hover); }
.popover-option.selected { background: var(--accent-soft); border-color: var(--accent); color: #fff; }
.popover-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ============================================================================
   SIDE PANEL (CHAT, QUEUE, PEOPLE & VOICE)
   ============================================================================ */

.side-panel {
  position: relative;
  z-index: 90;
  width: 0;
  background: var(--bg-surface-strong);
  backdrop-filter: blur(24px);
  border-left: 0 solid transparent;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.26s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.side-panel.open {
  width: 370px;
  border-left: 1px solid var(--border);
}

.panel-tabs {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 6px 8px 0;
  gap: 4px;
}
.panel-tab {
  flex: 1;
  padding: 11px 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: color 0.16s, border-color 0.16s;
}
.panel-tab:hover { color: var(--text-primary); }
.panel-tab.active { color: var(--text-primary); border-bottom-color: var(--accent); }
.tab-pill {
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Chat Messages */
.chat-msg {
  position: relative;
  display: flex;
  gap: 9px;
  align-items: flex-start;
  max-width: 100%;
}
.chat-msg.me { flex-direction: row-reverse; }
.chat-msg.system {
  justify-content: center;
  margin: 4px 0;
}
.sys-pill {
  font-size: 0.73rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 99px;
  text-align: center;
}

.msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  margin-top: 2px;
}

.msg-bubble-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 82%;
  min-width: 0;
}
.chat-msg.me .msg-bubble-wrap { align-items: flex-end; }

.msg-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.71rem;
  color: var(--text-muted);
}
.msg-sender { font-weight: 700; color: var(--text-secondary); }
.msg-movie-ts {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
  border: none;
}
.msg-movie-ts:hover { filter: brightness(1.2); }

.msg-bubble {
  position: relative;
  padding: 9px 13px;
  border-radius: 15px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  font-size: 0.87rem;
  line-height: 1.45;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.chat-msg.me .msg-bubble {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
}

.msg-reply-quote {
  padding: 5px 8px;
  margin-bottom: 6px;
  border-left: 2px solid var(--accent);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.78);
}

.msg-hover-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.15s;
}
.chat-msg:hover .msg-hover-actions { opacity: 1; }
.msg-mini-btn {
  padding: 2px 6px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.72rem;
  cursor: pointer;
}
.msg-mini-btn:hover { border-color: var(--accent); color: #fff; }

.msg-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.msg-react-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.74rem;
  cursor: pointer;
}
.msg-react-pill.mine { border-color: var(--accent); background: var(--accent-soft); }

.typing-bar {
  padding: 4px 14px;
  font-size: 0.74rem;
  color: var(--text-muted);
  min-height: 22px;
}

.reply-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-top: 1px solid var(--border);
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.chat-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Queue Tab */
.queue-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
}
.queue-card img {
  width: 46px;
  height: 64px;
  border-radius: 7px;
  object-fit: cover;
  background: #141724;
  flex-shrink: 0;
}
.queue-info { flex: 1; min-width: 0; }
.queue-title { font-size: 0.85rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-sub { font-size: 0.74rem; color: var(--text-muted); margin-top: 2px; }

/* People & Voice Tab */
.voice-control-card {
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.voice-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.voice-status-text {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.voice-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.voice-settings-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 21px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.16);
  cursor: pointer;
  transition: background 0.18s;
}
.switch-track::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s;
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(17px); }

.user-card {
  padding: 11px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.16s, box-shadow 0.16s;
}
.user-card.speaking {
  border-color: rgba(16, 185, 129, 0.7);
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.22);
}
.user-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.user-identity {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.user-avatar-ring {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  border: 2px solid transparent;
  transition: border-color 0.14s, box-shadow 0.14s;
}
.user-card.speaking .user-avatar-ring {
  border-color: #34d399;
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.65);
}
.user-name {
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-badges { display: flex; align-items: center; gap: 5px; font-size: 0.7rem; color: var(--text-muted); }
.host-tag {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
  font-weight: 800;
  font-size: 0.65rem;
}
.user-vol-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.user-vol-row input { flex: 1; }

.host-settings-card {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.8rem;
}

.https-warning {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fde68a;
  font-size: 0.76rem;
  line-height: 1.45;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 900px) {
  .room-strip { grid-template-columns: 1fr; }
  .detail-hero { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .detail-meta-row, .detail-actions { justify-content: center; }
  .reaction-strip { display: none; }
  .now-playing-pill { display: none; }
}

@media (max-width: 768px) and (orientation: portrait) {
  .home-nav { padding: 12px 14px; }
  .home-main { padding: 20px 14px 60px; }
  .poster-grid { grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 12px; }
  .room-body { flex-direction: column; }
  .side-panel {
    width: 100% !important;
    height: 0;
    border-left: none !important;
    transition: height 0.25s ease;
  }
  .side-panel.open {
    height: calc(100% - (100vw * 9 / 16));
    border-top: 1px solid var(--border);
  }
  .room-body:has(.side-panel.open) .stage-wrap {
    flex: 0 0 auto;
    aspect-ratio: 16 / 9;
    height: auto;
  }
}

@media (max-width: 950px) and (orientation: landscape) {
  .room-header { height: 48px; min-height: 48px; }
  .side-panel.open { width: 300px; }
}

/* ============================================================================
   BILINGUAL ARABIC (RTL) + EASE-OF-USE ENHANCEMENTS
   ============================================================================ */

html[lang="ar"],
html[dir="rtl"] body {
  --font-sans: 'Cairo', 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  letter-spacing: 0;
}

html[dir="rtl"] .hero h1,
html[dir="rtl"] .brand,
html[dir="rtl"] .hero-kicker,
html[dir="rtl"] .panel-tab,
html[dir="rtl"] .popover-title,
html[dir="rtl"] .next-up-label {
  letter-spacing: 0;
}

/* Labeled compact pill buttons in header (no mystery icons!) */
.pill-action {
  position: relative;
  height: 36px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  backdrop-filter: blur(14px);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.16s ease;
  white-space: nowrap;
}
.pill-action:hover { background: var(--bg-hover); border-color: var(--border-strong); transform: translateY(-1px); }
.pill-action.active { background: var(--accent-soft); border-color: var(--accent); color: var(--text-primary); }
.pill-action.voice-live { background: rgba(16, 185, 129, 0.18); border-color: rgba(16, 185, 129, 0.55); color: #34d399; }
.pill-action.voice-muted { background: rgba(239, 68, 68, 0.18); border-color: rgba(239, 68, 68, 0.45); color: #f87171; }

.lang-btn {
  min-width: 44px;
  height: 36px;
  padding: 0 11px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.16s ease;
}
.lang-btn:hover { border-color: var(--accent); background: var(--accent-soft); }

/* Invite Friends helper banner inside room when alone in a multi-seat party */
.invite-helper-pill {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 56;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-radius: 14px;
  background: var(--bg-surface-strong);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-md);
  max-width: calc(100% - 32px);
}
.invite-helper-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 0.8rem;
}
.invite-helper-text strong { font-size: 0.84rem; color: var(--text-primary); }
.invite-helper-text span { font-size: 0.74rem; color: var(--text-secondary); }

/* Keep video player timeline, controls, and timecodes strictly LTR even in Arabic RTL mode */
.controls-dock,
.timeline-wrap,
.controls-row,
.time-code,
.code-input {
  direction: ltr;
}

/* RTL Flip Adjustments */
html[dir="rtl"] .toast-stack {
  right: auto;
  left: 20px;
}
html[dir="rtl"] .modal-close {
  right: auto;
  left: 14px;
}
html[dir="rtl"] .side-panel.open {
  border-left: none;
  border-right: 1px solid var(--border);
}
html[dir="rtl"] .msg-reply-quote {
  border-left: none;
  border-right: 2px solid var(--accent);
}
html[dir="rtl"] .popover-option {
  text-align: right;
}
html[dir="rtl"] .fs-chat-overlay {
  left: auto;
  right: 20px;
}
html[dir="rtl"] .fs-chat-bubble b {
  margin-right: 0;
  margin-left: 6px;
}
html[dir="rtl"] .next-up-banner {
  right: auto;
  left: 24px;
}
html[dir="rtl"] .active-speakers-hud {
  left: auto;
  right: 16px;
}
html[dir="rtl"] .badge-count {
  right: auto;
  left: -5px;
}
html[dir="rtl"] .room-strip-card > div:first-child {
  text-align: right;
}
html[dir="rtl"] .switch-track::after {
  left: auto;
  right: 3px;
}
html[dir="rtl"] .switch input:checked + .switch-track::after {
  transform: translateX(-17px);
}

@media (max-width: 700px) {
  .pill-action .btn-label { display: none; }
  .pill-action { padding: 0 9px; }
  .invite-helper-pill { flex-wrap: wrap; justify-content: center; text-align: center; }
}
