:root {
  --bg-main: #0a0b12;
  --bg-card: rgba(18, 20, 32, 0.75);
  --bg-card-hover: rgba(26, 29, 46, 0.85);
  --bg-input: #121422;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #6366f1;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --secondary: #a855f7;
  --accent-pink: #ec4899;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --font-main: 'Vazirmatn', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ==================== LANDING PAGE ==================== */
.landing-body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}
.orb-1 {
  top: -150px;
  left: 20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.22) 0%, transparent 70%);
}
.orb-2 {
  bottom: -150px;
  right: 15%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.18) 0%, transparent 70%);
}

.landing-nav {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1200px;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand, .brand-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.logo-icon {
  font-size: 24px;
}
.logo-text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 40%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.badge-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.nav-links {
  display: flex;
  gap: 20px;
}
.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}
.nav-link:hover {
  color: #fff;
}

.landing-hero {
  position: relative;
  z-index: 10;
  max-width: 860px;
  padding: 40px 24px 80px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: 20px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
}

.hero-title {
  font-size: 52px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
}
.gradient-text {
  background: linear-gradient(135deg, #818cf8 0%, #c084fc 50%, #f472b6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 680px;
  margin-bottom: 40px;
}

/* Landing Action Card */
.hero-action-card {
  width: 100%;
  max-width: 580px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  margin-bottom: 60px;
}

.tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}
.tab-btn {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.tab-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.action-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.input-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.input-group input, .input-group select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}
.input-group input:focus, .input-group select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 6px 20px var(--primary-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}
.btn-primary:active {
  transform: translateY(0);
}

/* Feature Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  width: 100%;
  text-align: left;
}
.feature-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 24px;
  border-radius: var(--radius-md);
  transition: var(--transition);
}
.feature-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
}
.f-icon {
  font-size: 28px;
  margin-bottom: 12px;
}
.feature-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}
.feature-card p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dim);
}

.landing-footer {
  position: relative;
  z-index: 10;
  padding: 30px;
  color: var(--text-dim);
  font-size: 13px;
}

/* ==================== CINEMA THEATER ROOM ==================== */
.room-body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.room-header {
  height: 60px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: rgba(10, 11, 18, 0.95);
  backdrop-filter: blur(10px);
  z-index: 100;
  flex-shrink: 0;
}

.nav-left, .nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.room-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  transition: var(--transition);
}
.room-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary);
}
.pill-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-green);
}
.room-code-label {
  color: var(--text-dim);
}
.copy-icon {
  font-size: 11px;
  opacity: 0.6;
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}
.status-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
}
.sync-status.syncing .status-indicator {
  background: var(--accent-amber);
  animation: pulse 1s infinite alternate;
}
@keyframes pulse {
  from { opacity: 0.3; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1.2); }
}

.btn-tool {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}
.btn-tool:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}
.chat-toggle-btn {
  position: relative;
}
.chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent-pink);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 8px;
}

/* Theater Layout Container */
.theater-container {
  display: flex;
  flex: 1;
  height: calc(100vh - 60px);
  position: relative;
  overflow: hidden;
}

/* Cinema Stage (Video area) */
.cinema-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #000;
  position: relative;
  overflow: hidden;
}

.player-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #000;
  overflow: hidden;
}

#video-player {
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 110px);
  object-fit: contain;
  background: #000;
  cursor: pointer;
}

/* Center Play / Pause Floating Action Button */
.center-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 25;
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.55), 0 0 0 2px rgba(255, 255, 255, 0.3);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, background 0.2s ease;
}
.center-play-btn:hover {
  transform: translate(-50%, -50%) scale(1.12);
  background: #4f46e5;
  box-shadow: 0 12px 36px rgba(99, 102, 241, 0.7), 0 0 0 3px rgba(255, 255, 255, 0.5);
}
.center-play-btn svg {
  margin-left: 4px;
}
.center-play-btn.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.7);
}

/* Flying Reactions Overlay */
.reactions-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 20;
}

.flying-emoji {
  position: absolute;
  bottom: 20px;
  font-size: 32px;
  animation: flyUpward 2.4s ease-out forwards;
}
@keyframes flyUpward {
  0% {
    transform: translateY(0) scale(0.6) rotate(0deg);
    opacity: 0.9;
  }
  50% {
    transform: translateY(-200px) scale(1.2) rotate(15deg);
    opacity: 1;
  }
  100% {
    transform: translateY(-450px) scale(1) rotate(-15deg);
    opacity: 0;
  }
}

/* Buffering / Loading Spinner */
.buffering-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 30;
}
.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.player-toast {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 20, 32, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  z-index: 40;
  box-shadow: 0 8px 20px rgba(0,0,0,0.5);
  pointer-events: none;
}

/* Toolbar under video */
.cinema-toolbar {
  height: 50px;
  padding: 0 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-action:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
}
.media-title-label {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.btn-icon:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* ==================== SIDE PANEL (CHAT & USERS) ==================== */
.side-panel {
  width: 340px;
  height: 100%;
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  z-index: 50;
}
.side-panel.closed {
  transform: translateX(-100%);
  width: 0;
  border-right: none;
}

.panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
}
.panel-tab {
  flex: 1;
  padding: 14px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}
.panel-tab.active {
  color: #fff;
  border-bottom-color: var(--primary);
}

.panel-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.system-msg {
  font-size: 12px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  text-align: center;
  line-height: 1.4;
}

.chat-bubble {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 90%;
}
.chat-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}
.chat-sender {
  font-weight: 700;
}
.chat-host-tag {
  background: rgba(236, 72, 153, 0.15);
  color: var(--accent-pink);
  font-size: 9px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
}
.chat-time {
  color: var(--text-dim);
}
.chat-text {
  font-size: 13px;
  line-height: 1.4;
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  word-break: break-word;
}
.chat-bubble.mine {
  align-self: flex-end;
}
.chat-bubble.mine .chat-text {
  background: var(--primary);
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* Quick Reaction Bar */
.reaction-bar {
  display: flex;
  justify-content: space-around;
  padding: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-color);
}
.rx-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: transform 0.15s ease;
}
.rx-btn:hover {
  transform: scale(1.3);
}

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.3);
}
.chat-input-row input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 13px;
  outline: none;
}
.chat-input-row input:focus {
  border-color: var(--primary);
}
.btn-send {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 700;
  transition: var(--transition);
}
.btn-send:hover {
  filter: brightness(1.1);
}

/* Viewers list */
.viewers-list {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}
.viewer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
}
.viewer-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}
.viewer-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
}
.viewer-drift {
  font-size: 11px;
  color: var(--text-dim);
}
.viewer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-host-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.btn-host-action.promote:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--accent-amber);
  color: var(--accent-amber);
}
.btn-host-action.kick:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: var(--accent-pink);
  color: var(--accent-pink);
}
.host-crown-badge {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

/* ==================== MODALS ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-card {
  width: 90%;
  max-width: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px rgba(0,0,0,0.6);
  overflow: hidden;
  animation: modalIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}
.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.modal-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

.share-box {
  display: flex;
  gap: 8px;
}
.share-box input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: #fff;
  font-size: 13px;
}
.share-box button {
  white-space: nowrap;
  width: auto;
  padding: 10px 18px;
}

.social-share-row {
  display: flex;
  gap: 10px;
}
.social-btn {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.social-btn.tg { background: #229ed9; }
.social-btn.wa { background: #25d366; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}
.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.btn-secondary:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}

.input-divider {
  text-align: center;
  position: relative;
}
.input-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-color);
}
.input-divider span {
  position: relative;
  background: var(--bg-card);
  padding: 0 10px;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 700;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(18, 20, 32, 0.95);
  border: 1px solid var(--primary);
  color: #fff;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9999;
  pointer-events: none;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ==================== THEATER MODE ==================== */
.theater-container.theater-wide .side-panel {
  display: none !important;
}
.theater-container.theater-wide .cinema-stage {
  flex: 1 1 100%;
}

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

/* Tablet & Smaller Desktops (<= 1024px) */
@media (max-width: 1024px) {
  .side-panel {
    width: 300px;
  }
}

/* Mobile & Small Tablets (<= 820px) */
@media (max-width: 820px) {
  .room-header {
    height: 54px;
    padding: 0 12px;
  }
  .nav-left, .nav-right {
    gap: 8px;
  }
  .btn-tool {
    padding: 6px 10px;
    font-size: 12px;
  }
  .theater-container {
    flex-direction: column;
    height: calc(100vh - 54px);
    height: calc(100dvh - 54px);
  }
  .cinema-stage {
    flex: 0 0 auto;
    width: 100%;
    max-height: 48vh;
    max-height: 48dvh;
  }
  .player-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 38vh;
    max-height: 38dvh;
    background: #000;
  }
  #video-player {
    width: 100%;
    height: 100%;
    max-height: 100%;
  }
  .center-play-btn {
    width: 60px;
    height: 60px;
  }
  .center-play-btn svg {
    width: 32px;
    height: 32px;
  }
  .cinema-toolbar {
    height: 44px;
    padding: 0 10px;
  }
  .media-title-label {
    max-width: 140px;
    font-size: 12px;
  }
  .side-panel {
    flex: 1 1 auto;
    width: 100%;
    height: auto;
    min-height: 0;
    border-right: none;
    border-top: 1px solid var(--border-color);
  }
  .side-panel.closed {
    display: none !important;
  }
  .theater-container.side-closed .cinema-stage {
    flex: 1 1 100%;
    max-height: 100%;
  }
  .theater-container.side-closed .player-wrapper {
    max-height: calc(100vh - 100px);
    max-height: calc(100dvh - 100px);
    flex: 1;
  }
}

/* Phones (<= 640px) */
@media (max-width: 640px) {
  .room-header {
    height: 52px;
    padding: 0 8px;
  }
  .nav-left, .nav-right {
    gap: 5px;
  }
  .room-pill {
    padding: 4px 8px;
    font-size: 12px;
    gap: 5px;
  }
  .sync-status {
    padding: 5px 7px;
    gap: 0;
  }
  .sync-status .sync-label {
    display: none;
  }
  .status-indicator {
    width: 8px;
    height: 8px;
  }
  .btn-tool {
    padding: 6px 8px;
    font-size: 12px;
    gap: 4px;
    border-radius: 8px;
  }
  /* Hide text labels for secondary buttons to save space */
  .invite-tool-btn .btn-label,
  .settings-tool-btn .btn-label,
  .user-btn .btn-label {
    display: none;
  }
  #voice-btn-text {
    font-size: 11px;
  }
  .cinema-stage {
    max-height: 42vh;
    max-height: 42dvh;
  }
  .player-wrapper {
    max-height: 34vh;
    max-height: 34dvh;
  }
  .btn-action {
    padding: 4px 8px;
    font-size: 11px;
    gap: 4px;
  }
  .media-title-label {
    max-width: 100px;
    font-size: 11px;
  }
  .reaction-bar {
    padding: 4px 6px;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .rx-btn {
    font-size: 18px;
    padding: 4px 7px;
    min-width: 32px;
  }
  .chat-input-row {
    padding: 6px 8px;
    gap: 6px;
  }
  #chat-input {
    font-size: 16px; /* Prevents auto-zoom in iOS Safari */
    padding: 8px 12px;
  }
  .btn-send {
    padding: 8px 14px;
    font-size: 13px;
  }

  /* Landing Page Mobile */
  .landing-nav {
    padding: 16px 18px;
  }
  .hero-title {
    font-size: 32px;
    line-height: 1.25;
    letter-spacing: -0.5px;
  }
  .hero-desc {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
  }
  .hero-action-card {
    padding: 16px;
    margin-bottom: 32px;
  }
  .features-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    text-align: right;
  }
  .modal-card {
    width: 95%;
    max-height: 90vh;
    max-height: 90dvh;
  }
  .modal-body {
    padding: 16px;
  }
}

/* Small Phones (<= 420px) */
@media (max-width: 420px) {
  .room-header {
    padding: 0 6px;
  }
  .brand-mini .logo-text {
    display: none;
  }
  .room-pill .room-code-label {
    display: none;
  }
  .btn-tool {
    padding: 5px 6px;
    font-size: 11px;
  }
  #voice-btn-text, #mute-btn-text {
    display: none;
  }
  .cinema-toolbar {
    padding: 0 6px;
  }
  .media-title-label {
    max-width: 80px;
    font-size: 10px;
  }
}

/* Mobile Landscape Orientation */
@media (max-height: 520px) and (orientation: landscape) {
  .room-header {
    height: 42px;
    padding: 0 10px;
  }
  .theater-container {
    flex-direction: row;
    height: calc(100vh - 42px);
    height: calc(100dvh - 42px);
  }
  .cinema-stage {
    flex: 1;
    height: 100%;
    max-height: 100%;
  }
  .player-wrapper {
    aspect-ratio: auto;
    height: calc(100% - 40px);
    max-height: 100%;
  }
  .cinema-toolbar {
    height: 40px;
  }
  .side-panel {
    width: 270px;
    height: 100%;
    border-top: none;
    border-right: 1px solid var(--border-color);
  }
  .side-panel.closed {
    display: none !important;
  }
}

/* ==================== WebRTC Voice Chat Styles ==================== */
.voice-btn {
  border: 1px solid rgba(16, 185, 129, 0.4) !important;
  color: #10b981 !important;
  transition: all 0.2s ease;
}
.voice-btn:hover {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: #10b981 !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}
.voice-btn.active {
  background: rgba(16, 185, 129, 0.25) !important;
  border-color: #10b981 !important;
  color: #fff !important;
}

.mic-btn {
  border: 1px solid rgba(99, 102, 241, 0.4) !important;
  color: #a5b4fc !important;
  transition: all 0.2s ease;
}
.mic-btn.muted {
  border-color: rgba(239, 68, 68, 0.5) !important;
  color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.15) !important;
}

.voice-badge {
  font-size: 13px;
  margin-right: 6px;
  display: inline-flex;
  align-items: center;
}
.voice-badge.unmuted {
  color: #10b981;
}
.voice-badge.muted {
  color: #ef4444;
}

/* Speaking Pulse on Avatar */
.viewer-avatar.speaking {
  box-shadow: 0 0 0 3px #10b981, 0 0 16px rgba(16, 185, 129, 0.8) !important;
  animation: speakingPulse 0.9s infinite alternate ease-in-out;
}

@keyframes speakingPulse {
  0% {
    box-shadow: 0 0 0 2px #10b981, 0 0 8px rgba(16, 185, 129, 0.5);
  }
  100% {
    box-shadow: 0 0 0 4px #34d399, 0 0 22px rgba(16, 185, 129, 0.95);
  }
}

/* Landing Page PWA Install Button */
.nav-install-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
  font-family: inherit;
}
.nav-install-btn:hover {
  background: #4f46e5;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.55);
  transform: translateY(-1px);
}

.install-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseDot 1.4s infinite ease-in-out;
}
@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

/* Landing Page Quick Install Card */
.landing-install-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 16px;
  padding: 14px 20px;
  margin: 20px auto;
  max-width: 600px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.landing-install-card:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.lic-icon {
  font-size: 32px;
  flex-shrink: 0;
}
.lic-text {
  flex: 1;
  text-align: right;
}
.lic-text strong {
  display: block;
  font-size: 15px;
  color: #fff;
  margin-bottom: 3px;
}
.lic-text span {
  font-size: 12px;
  color: #a5b4fc;
  line-height: 1.4;
}
.lic-btn {
  background: #fff;
  color: #4f46e5;
  border: none;
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: all 0.2s ease;
}
.lic-btn:hover {
  background: #f0f0ff;
  transform: scale(1.03);
}

@media (max-width: 640px) {
  .landing-install-card {
    flex-direction: column;
    text-align: center;
    gap: 12px;
    padding: 14px;
  }
  .lic-text {
    text-align: center;
  }
  .lic-btn {
    width: 100%;
  }
}
