/* ==========================================================================
   KICK DUAL VIEWER — STYLES (MILULIVE WATCH PARTY AESTHETIC + ADMIN/VIEWER MODES)
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-main: #000000;
  --bg-darker: #060809;
  --bg-surface: #0e1113;
  --bg-surface-elevated: #15191c;
  --bg-surface-card: #14171a;
  --bg-glass: rgba(14, 17, 19, 0.85);
  --bg-glass-heavy: rgba(8, 10, 11, 0.94);

  /* Kick Brand Neon Green */
  --kick-green: #53fc18;
  --kick-green-hover: #45e012;
  --kick-green-glow: rgba(83, 252, 24, 0.28);
  --kick-green-subtle: rgba(83, 252, 24, 0.12);

  /* Admin Badge Purple / Cyan */
  --admin-gold: #ffb703;
  --admin-gold-glow: rgba(255, 183, 3, 0.3);

  /* Borders & Dividers */
  --border-subtle: #1c2124;
  --border-focus: #2d343a;
  --border-glow: rgba(83, 252, 24, 0.4);

  /* Text */
  --text-primary: #ffffff;
  --text-secondary: #9aa4ad;
  --text-muted: #626c75;

  /* Status Colors */
  --live-red: #ff334b;
  --live-red-glow: rgba(255, 51, 75, 0.4);

  /* Dimensions */
  --topbar-height: 48px;
  --footer-height: 42px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  /* Chat width (Dynamic CSS Variable modified by JS resizer) */
  --chat-width: 320px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   MODE VISIBILITY TOGGLES (ADMIN VS VIEWER)
   ========================================================================== */

body.mode-viewer .admin-only {
  display: none !important;
}

body.mode-admin .viewer-only {
  display: none !important;
}

/* Sleek Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: var(--bg-surface);
}
::-webkit-scrollbar-thumb {
  background: var(--border-focus);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ==========================================================================
   TOP BAR / HEADER
   ========================================================================== */

.topbar {
  height: var(--topbar-height);
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 50;
  user-select: none;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: default;
}

.brand-badge {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #18201a 0%, #0d120f 100%);
  border: 1px solid var(--kick-green);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px var(--kick-green-glow);
}

.kick-k {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 17px;
  color: var(--kick-green);
  line-height: 1;
}

.brand-text {
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.app-title span {
  color: var(--kick-green);
  margin-left: 2px;
}

.badge-tag {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  background: var(--kick-green-subtle);
  color: var(--kick-green);
  border: 1px solid rgba(83, 252, 24, 0.3);
  border-radius: var(--radius-full);
}

.badge-tag.admin-badge {
  background: rgba(255, 183, 3, 0.15);
  color: var(--admin-gold);
  border-color: rgba(255, 183, 3, 0.4);
  box-shadow: 0 0 8px var(--admin-gold-glow);
}

/* Streamer Pill */
.streamer-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  transition: border-color var(--transition-fast);
}

.streamer-pill:hover {
  border-color: var(--border-focus);
}

.live-dot {
  width: 7px;
  height: 7px;
  background-color: var(--live-red);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--live-red-glow);
  animation: pulse-live 1.8s infinite;
}

@keyframes pulse-live {
  0% { transform: scale(0.95); box-shadow: 0 0 4px var(--live-red-glow); }
  50% { transform: scale(1.2); box-shadow: 0 0 10px var(--live-red); }
  100% { transform: scale(0.95); box-shadow: 0 0 4px var(--live-red-glow); }
}

.streamer-name {
  color: var(--text-primary);
  font-weight: 600;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-btn-pill {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 3px;
  transition: color var(--transition-fast);
}

.icon-btn-pill:hover {
  color: var(--kick-green);
}

/* Center Social Buttons (Alineado exactamente al centro del video y escenario) */
.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
}

.topbar-left {
  display: none;
}

.topbar-right {
  display: none;
}

.topbar-center {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
}

.video-info-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  max-width: 280px;
}

.video-info-pill svg {
  color: var(--kick-green);
  flex-shrink: 0;
}

.video-info-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Topbar Right Social Buttons */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-topbar-social {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  height: 28px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.btn-topbar-social svg {
  flex-shrink: 0;
}

/* Botón Kick Subscribe / Ingresar */
.btn-topbar-social.btn-kick-sub {
  background: rgba(83, 252, 24, 0.12);
  border-color: rgba(83, 252, 24, 0.4);
  color: var(--kick-green);
}

.btn-topbar-social.btn-kick-sub:hover {
  background: var(--kick-green);
  color: #000000;
  border-color: var(--kick-green);
  box-shadow: 0 0 12px var(--kick-green-glow);
  transform: translateY(-1px);
}

/* Botón YouTube */
.btn-topbar-social.btn-yt {
  background: rgba(255, 0, 0, 0.1);
  border-color: rgba(255, 0, 0, 0.35);
  color: #ff4444;
}

.btn-topbar-social.btn-yt:hover {
  background: #ff0000;
  color: #ffffff;
  border-color: #ff0000;
  box-shadow: 0 0 12px rgba(255, 0, 0, 0.4);
  transform: translateY(-1px);
}

/* Botón Instagram */
.btn-topbar-social.btn-ig {
  background: rgba(225, 48, 108, 0.1);
  border-color: rgba(225, 48, 108, 0.35);
  color: #f472b6;
}

.btn-topbar-social.btn-ig:hover {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 0 12px rgba(225, 48, 108, 0.5);
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .btn-topbar-social span {
    display: none;
  }
  .btn-topbar-social {
    padding: 4px 8px;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 13px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-primary {
  background: var(--kick-green);
  color: #050806;
  box-shadow: 0 0 10px rgba(83, 252, 24, 0.2);
}

.btn-primary:hover {
  background: var(--kick-green-hover);
  box-shadow: 0 0 16px var(--kick-green-glow);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-focus);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
}

/* ==========================================================================
   MAIN WATCH CONTAINER
   ========================================================================== */

.watch-container {
  height: calc(100vh - var(--topbar-height));
  display: flex;
  width: 100%;
  overflow: hidden;
  background-color: var(--bg-main);
  position: relative;
}

/* Main Left Stage Section */
.stage-section {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: #000000;
  position: relative;
  overflow: hidden;
}

/* 16:9 Video Theater Container */
.video-theater {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #000000;
  overflow: hidden;
}

/* Ambient glow matching theater video */
.ambient-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 80%;
  background: radial-gradient(circle, rgba(83, 252, 24, 0.04) 0%, rgba(0, 0, 0, 0) 70%);
  pointer-events: none;
  z-index: 1;
}

/* Movie Player Box */
.movie-player-box {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

/* Shield Overlay: Bloquea que el espectador pause o altere el video */
.viewer-video-shield {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 8;
  display: none;
  cursor: default;
  background: transparent;
}

body.mode-viewer .viewer-video-shield {
  display: block !important;
  pointer-events: auto;
}

body.mode-admin .viewer-video-shield {
  display: none !important;
  pointer-events: none;
}

/* Banner de Desbloqueo Móvil / Audio para Espectadores */
.mobile-sync-unlock-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 12;
  display: none;
}

/* ==========================================================================
   THEATER STANDBY SCREENS (OFFLINE & ONLINE COVER)
   ========================================================================== */

.theater-standby-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  overflow: hidden;
}

.standby-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 1;
}

.theater-offline .standby-backdrop {
  opacity: 1;
  filter: none;
}

.standby-card {
  position: relative;
  z-index: 2;
  max-width: 480px;
  width: 90%;
  padding: 36px 28px;
  background: rgba(14, 17, 19, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.standby-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
}

.offline-badge {
  background: rgba(255, 75, 75, 0.15);
  color: #ff5252;
  border: 1px solid rgba(255, 75, 75, 0.4);
}

.offline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff5252;
  box-shadow: 0 0 8px #ff5252;
}

.online-badge {
  background: rgba(83, 252, 24, 0.15);
  color: var(--kick-green);
  border: 1px solid rgba(83, 252, 24, 0.4);
}

.standby-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.standby-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 8px 0;
}

.standby-streamer-highlight {
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.standby-streamer-highlight.online-name {
  color: var(--kick-green);
  background: var(--kick-green-subtle);
  border: 1px solid rgba(83, 252, 24, 0.3);
}

.standby-streamer-highlight.offline-name {
  color: #ff5252;
  background: rgba(255, 75, 75, 0.1);
  border: 1px solid rgba(255, 75, 75, 0.3);
}

.btn-connect-watchparty {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  background: var(--kick-green);
  color: #000000;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 800;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(83, 252, 24, 0.4), 0 0 15px var(--kick-green-glow);
  transition: all var(--transition-fast);
  animation: pulse-glow 2.2s infinite ease-in-out;
}

.btn-connect-watchparty:hover {
  transform: scale(1.05);
  box-shadow: 0 14px 35px rgba(83, 252, 24, 0.6), 0 0 25px var(--kick-green-glow);
}

.connect-icon {
  width: 22px;
  height: 22px;
  background: #000000;
  color: var(--kick-green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

/* Pantallas de Espera y Standby */
body.viewer-standby #theater-offline-screen {
  display: flex;
}

/* Ocultar la webcam y controles flotantes si el espectador ve las pantallas de espera (desconectado o previo a conectar) */
body.mode-viewer:has(#theater-offline-screen[style*="display: flex"]) #webcam-card,
body.mode-viewer:has(#theater-online-screen[style*="display: flex"]) #webcam-card,
body.mode-viewer:has(#theater-offline-screen[style*="display: flex"]) #floating-video-controls,
body.mode-viewer:has(#theater-online-screen[style*="display: flex"]) #floating-video-controls,
body.mode-viewer.viewer-standby #webcam-card,
body.mode-viewer.viewer-standby #floating-video-controls {
  display: none !important;
}

/* Media Element Containers */
.media-container,
.media-frame,
.native-video-player {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.media-container {
  z-index: 5;
}

.native-video-player {
  object-fit: contain;
  background-color: #000000;
}

/* Floating Controls on top-right of main video */
.floating-video-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 50 !important;
  opacity: 0.85;
  transition: opacity var(--transition-fast);
}

.floating-video-controls:hover {
  opacity: 1;
}

.viewer-volume-control {
  display: flex;
  align-items: center;
  background: rgba(14, 17, 19, 0.85);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0 4px;
  gap: 4px;
  height: 28px;
}

.viewer-volume-control .control-badge-btn {
  background: none;
  border: none;
  width: 20px;
  height: 20px;
}

.viewer-volume-slider {
  width: 60px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  accent-color: var(--kick-green);
}

.viewer-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--kick-green);
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.control-badge-btn {
  background: rgba(14, 17, 19, 0.85);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.control-badge-btn:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-focus);
  color: var(--text-primary);
}

/* ==========================================================================
   WEBCAM / STREAMER OVERLAY CARD (HIDDEN 1PX BACKGROUND FOR VIEWS ONLY LIKE MILULIVE)
   ========================================================================== */

.webcam-card {
  display: none !important; /* Oculto visualmente: el stream de OBS principal ocupa la pantalla */
}

.webcam-frame-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden !important;
}

/* El iframe de Kick está permanentemente en vivo y NUNCA se pausa ni genera scrollbars */
.webcam-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  overflow: hidden !important;
  pointer-events: none !important; /* Deshabilita completamente cualquier evento del ratón hacia Kick */
}

/* Escudo protector transparente inerte */
.webcam-inert-shield {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  background: transparent;
  pointer-events: none;
  user-select: none;
}

/* Overlay transparente para arrastrar en Admin */
.webcam-drag-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  display: none;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

/* En Modo Admin: Cursor grab y borde fino solo al pasar el cursor */
body.mode-admin .webcam-drag-overlay {
  display: block;
  cursor: grab;
}

body.mode-admin .webcam-card:hover .webcam-drag-overlay {
  border: 1px solid rgba(83, 252, 24, 0.6);
  background: rgba(83, 252, 24, 0.03);
}

body.mode-admin .webcam-card.is-dragging .webcam-drag-overlay {
  cursor: grabbing !important;
  border: 1px solid var(--kick-green);
  background: rgba(83, 252, 24, 0.08);
}

/* En Modo Espectador (Viewer): Totalmente limpio */
body.mode-viewer .webcam-drag-overlay {
  display: none !important;
}

/* Redimensionador en la esquina inferior derecha */
.webcam-resize-handle {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 24px;
  height: 24px;
  cursor: se-resize;
  z-index: 30;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 17, 19, 0.7);
  border-radius: 4px;
}

.webcam-resize-handle::after {
  content: '';
  width: 9px;
  height: 9px;
  border-right: 2.5px solid var(--kick-green);
  border-bottom: 2.5px solid var(--kick-green);
  border-radius: 1px;
}

body.mode-admin .webcam-card:hover .webcam-resize-handle {
  opacity: 1;
}

body.mode-admin .webcam-resize-handle:hover {
  background: rgba(14, 17, 19, 0.95);
  transform: scale(1.1);
}

body.mode-viewer .webcam-resize-handle {
  display: none !important;
}

.webcam-card.hidden {
  display: none !important;
}

.webcam-header {
  height: 28px;
  min-height: 28px;
  background: rgba(14, 17, 19, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  user-select: none;
}

.webcam-badge {
  display: flex;
  align-items: center;
  gap: 5px;
}

.live-dot-mini {
  width: 6px;
  height: 6px;
  background-color: var(--kick-green);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--kick-green);
}

.webcam-streamer-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.webcam-header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.webcam-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  width: 20px;
  height: 20px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.webcam-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.webcam-frame-wrapper {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
  background: #000000;
}

/* ==========================================================================
   DRAGGABLE RESIZER SEPARATOR (ESTIRAR Y ACHICAR CHAT)
   ========================================================================== */

.chat-resizer {
  width: 8px;
  height: 100%;
  background: rgba(255, 255, 255, 0.03);
  cursor: col-resize;
  position: relative;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
  user-select: none;
  touch-action: none;
}

.chat-resizer:hover,
.chat-resizer.dragging {
  background: var(--kick-green) !important;
  box-shadow: 0 0 12px var(--kick-green-glow);
}

.resizer-handle {
  width: 2px;
  height: 32px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  transition: background var(--transition-fast);
}

.chat-resizer:hover .resizer-handle,
.chat-resizer.dragging .resizer-handle {
  background: #000000;
}

/* ==========================================================================
   14. RESPONSIVE DESIGN (MOBILE PORTRAIT & LANDSCAPE)
   ========================================================================== */

/* Tablet & Mobile Portrait (max-width: 768px) */
@media (max-width: 768px) and (orientation: portrait) {
  :root {
    --topbar-height: 38px;
  }

  .topbar {
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    padding: 0 8px;
    gap: 6px;
  }

  .brand {
    gap: 6px;
  }

  .brand-badge {
    width: 22px;
    height: 22px;
    font-size: 11px;
    border-radius: 4px;
  }

  .brand-text .app-title {
    font-size: 11px;
    letter-spacing: -0.2px;
  }

  /* Ocultar badge tag en móvil para que no ocupe espacio */
  .badge-tag,
  .mode-badge,
  .topbar-center {
    display: none !important;
  }

  .streamer-pill {
    padding: 2px 6px;
    gap: 4px;
    border-radius: var(--radius-full);
  }

  .streamer-pill .streamer-name {
    font-size: 10px;
    max-width: 85px;
  }

  .live-dot {
    width: 6px;
    height: 6px;
  }

  .topbar-right {
    gap: 4px;
  }

  .topbar-right .btn-icon {
    width: 26px;
    height: 26px;
    padding: 4px;
  }

  .topbar-right .btn-icon svg {
    width: 13px;
    height: 13px;
  }

  .watch-container {
    flex-direction: column !important;
    height: calc(100dvh - var(--topbar-height));
    overflow: hidden;
  }

  .stage-section {
    flex: 0 0 auto !important;
    width: 100% !important;
    height: auto !important;
    max-height: 40vh;
    aspect-ratio: 16 / 9;
  }

  .video-theater {
    width: 100%;
    height: 100%;
  }

  .movie-player-box {
    width: 100%;
    height: 100%;
  }

  /* Si está en standby (esperando conectar o desconectado) en celular, expandir el video-theater para ver la tarjeta cómodamente */
  body.mode-viewer.viewer-standby .stage-section {
    max-height: 55vh !important;
    min-height: 280px !important;
  }

  .standby-card {
    padding: 20px 16px !important;
    gap: 8px !important;
    max-width: 95% !important;
  }

  .standby-title {
    font-size: 17px !important;
  }

  .standby-subtitle {
    font-size: 11.5px !important;
    line-height: 1.4 !important;
  }

  .btn-connect-watchparty {
    padding: 10px 18px !important;
    font-size: 12px !important;
    gap: 8px !important;
  }

  .btn-connect-watchparty .connect-icon {
    width: 18px !important;
    height: 18px !important;
    font-size: 9px !important;
  }

  .webcam-card {
    min-width: 100px !important;
    max-width: 135px !important;
    border-radius: var(--radius-sm);
  }

  .chat-resizer {
    display: none !important;
  }

  .chat-section {
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    border-left: none !important;
    border-top: 1px solid var(--border-subtle);
    display: flex !important;
  }

  .chat-header {
    height: 36px;
    min-height: 36px;
    padding: 0 8px;
  }
}

.chat-header {
  height: 32px !important;
  min-height: 32px !important;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  padding: 0 8px;
  z-index: 10;
  box-sizing: border-box;
}

/* Botón Cerrar Chat Estilo Kick Verde con Cruz Elegante */
.chat-close-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 24px !important;
  height: 24px !important;
  padding: 0 !important;
  background: rgba(83, 252, 24, 0.12) !important;
  border: 1px solid rgba(83, 252, 24, 0.35) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--kick-green) !important;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(83, 252, 24, 0.2);
  transition: all var(--transition-fast);
}

.chat-close-btn:hover {
  background: var(--kick-green) !important;
  color: #000000 !important;
  border-color: var(--kick-green) !important;
  box-shadow: 0 0 14px var(--kick-green-glow);
  transform: scale(1.08);
}

.chat-close-btn svg {
  stroke-width: 2.6;
}

.btn-floating-chat-toggle {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999 !important;
  pointer-events: auto !important;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(14, 17, 19, 0.96);
  backdrop-filter: blur(14px);
  border: 1.5px solid var(--kick-green);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8), 0 0 16px rgba(83, 252, 24, 0.35);
  transition: all var(--transition-fast);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn-floating-chat-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9), 0 0 22px rgba(83, 252, 24, 0.5);
}

.btn-floating-chat-toggle svg {
  color: var(--kick-green);
}

/* Mostrar botón flotante siempre que el chat esté cerrado (PC, Laptop, Tablet y Móvil) */
body.chat-is-closed .btn-floating-chat-toggle,
body.chat-is-hidden .btn-floating-chat-toggle {
  display: inline-flex !important;
}

@media (max-width: 768px) and (orientation: portrait) {
  body.chat-is-closed .stage-section {
    max-height: 100vh !important;
    height: 100% !important;
    flex: 1 1 auto !important;
  }
}

/* Mobile Landscape / Rotado (max-height: 520px) */
@media (orientation: landscape) and (max-height: 520px) {
  :root {
    --topbar-height: 0px;
  }

  /* Ocultar barra superior en rotación para cine fullscreen */
  .topbar {
    display: none !important;
  }

  .watch-container {
    height: 100dvh !important;
    flex-direction: row !important;
  }

  .stage-section {
    flex: 1 1 auto !important;
    height: 100dvh !important;
    width: 100% !important;
  }

  .video-theater {
    width: 100% !important;
    height: 100% !important;
  }

  .movie-player-box {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 16 / 9;
  }

  .standby-card {
    padding: 14px 18px !important;
    gap: 6px !important;
    max-width: 85% !important;
  }

  .standby-title {
    font-size: 15px !important;
  }

  .standby-subtitle {
    font-size: 11px !important;
    line-height: 1.3 !important;
    margin-bottom: 2px !important;
  }

  .btn-connect-watchparty {
    padding: 8px 16px !important;
    font-size: 11.5px !important;
  }

  /* Barra divisoria redimensionable en horizontal táctil */
  .chat-resizer {
    display: none !important;
    width: 8px !important;
    cursor: col-resize !important;
    background: transparent !important;
    position: relative !important;
    z-index: 25 !important;
    touch-action: none !important;
  }

  body.landscape-chat-open .chat-resizer {
    display: flex !important;
  }

  /* En horizontal el chat respeta el ancho interactivo y la pantalla de video se achica para no ser tapada */
  .chat-section {
    display: none !important;
    width: var(--chat-width, 280px) !important;
    min-width: 160px !important;
    max-width: 65vw !important;
    height: 100dvh !important;
    position: relative !important;
    border-left: 1px solid var(--border-subtle) !important;
    flex-direction: column !important;
    background: var(--bg-surface) !important;
  }

  /* Se abre dividiendo el espacio con el video (el video se adapta al lado izquierdo) */
  body.landscape-chat-open .chat-section {
    display: flex !important;
  }

  /* La sección del video se adapta al espacio restante sin ser tapada */
  body.landscape-chat-open .stage-section {
    flex: 1 1 auto !important;
    width: calc(100% - var(--chat-width, 280px) - 8px) !important;
    height: 100dvh !important;
  }

  /* Controles flotantes anclados en la esquina superior derecha del reproductor de video */
  .floating-video-controls {
    display: flex !important;
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    z-index: 40 !important;
    opacity: 0.9 !important;
  }

  .control-badge-btn {
    width: 32px !important;
    height: 32px !important;
    background: rgba(14, 17, 19, 0.9) !important;
    border: 1px solid var(--border-subtle) !important;
  }

  /* Ocultar encabezados de streaming en horizontal */
  .webcam-header,
  .badge-tag,
  .streamer-pill {
    display: none !important;
  }

  /* Mostrar botón flotante en horizontal si el chat no está abierto */
  body:not(.landscape-chat-open) .btn-floating-chat-toggle {
    display: inline-flex !important;
    bottom: 24px !important;
    right: 28px !important;
  }

  .chat-header {
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 10px !important;
    background: #0e1113 !important;
  }

  .chat-frame-wrapper {
    height: calc(100dvh - 38px) !important;
  }
}

/* ==========================================================================
   CHAT SIDEBAR SECTION
   ========================================================================== */

.chat-section {
  width: var(--chat-width);
  min-width: 260px;
  max-width: 550px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  flex-shrink: 0;
  transition: transform var(--transition-normal), width var(--transition-fast);
}

.chat-section.collapsed {
  display: none !important;
}

.chat-collapsed-trigger {
  display: none;
  position: fixed;
  right: 14px;
  bottom: 18px;
  z-index: 50;
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.chat-collapsed-trigger:hover {
  background: var(--bg-surface);
  border-color: var(--kick-green);
  color: var(--kick-green);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--kick-green-glow);
}

.chat-collapsed-trigger svg {
  color: var(--kick-green);
}

body.chat-is-hidden .chat-collapsed-trigger {
  display: inline-flex !important;
}

@media (max-width: 768px) {
  .chat-collapsed-trigger {
    display: none !important;
  }
}

.chat-header {
  height: var(--topbar-height);
  min-height: var(--topbar-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
}

.chat-header-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-primary);
}

.chat-header-title svg {
  color: var(--kick-green);
}

.chat-online-badge {
  font-size: 9px;
  font-weight: 700;
  background: rgba(83, 252, 24, 0.12);
  color: var(--kick-green);
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

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

.player-action-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.player-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.chat-viewport {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
  background: #0e1113;
}

.chat-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ==========================================================================
   PLACEHOLDER (INITIAL VIDEO STATE)
   ========================================================================== */

.player-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at center, #15191d 0%, #060809 100%);
  text-align: center;
  z-index: 5;
}

.placeholder-glow {
  position: absolute;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(83, 252, 24, 0.08) 0%, rgba(0, 0, 0, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

.placeholder-content {
  position: relative;
  z-index: 2;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.placeholder-icon-wrapper {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: rgba(83, 252, 24, 0.06);
  border: 1px solid rgba(83, 252, 24, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--kick-green);
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.placeholder-icon-wrapper.pulse-anim {
  animation: float-pulse 2.5s infinite ease-in-out;
}

@keyframes float-pulse {
  0% { transform: translateY(0); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); }
  50% { transform: translateY(-6px); box-shadow: 0 14px 28px var(--kick-green-glow); }
  100% { transform: translateY(0); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); }
}

.placeholder-title {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.placeholder-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

.placeholder-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ==========================================================================
   MODALS
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  width: 100%;
  max-width: 500px;
  background: var(--bg-surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  transform: translateY(20px) scale(0.97);
  transition: transform var(--transition-normal);
}

.modal-card-lg {
  max-width: 600px;
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface-elevated);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-icon-badge {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--kick-green);
}

.modal-icon-badge.kick-bg {
  background: rgba(83, 252, 24, 0.12);
  border: 1px solid rgba(83, 252, 24, 0.25);
}

.kick-k-small {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 15px;
  color: var(--kick-green);
}

.modal-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 2px;
  transition: color var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 18px;
}

.modal-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.modal-desc code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--kick-green);
}

.input-group {
  margin-bottom: 14px;
}

.input-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.input-group textarea,
.input-group input[type="text"],
.input-group input[type="url"],
.input-group input[type="password"] {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  padding: 8px 10px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.input-group textarea:focus,
.input-group input[type="text"]:focus,
.input-group input[type="url"]:focus,
.input-group input[type="password"]:focus {
  border-color: var(--kick-green);
  box-shadow: 0 0 0 2px var(--kick-green-glow);
}

.input-prefix-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.input-prefix-wrapper:focus-within {
  border-color: var(--kick-green);
  box-shadow: 0 0 0 2px var(--kick-green-glow);
}

.input-prefix {
  padding: 8px 8px 8px 10px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

.input-prefix-wrapper input {
  flex: 1;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding-left: 0;
}

/* Upload Dropzone & MP4 Uploader Box */
.upload-mp4-box {
  margin-bottom: 14px;
}

.upload-dropzone {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1.5px dashed var(--border-focus);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
  background: var(--kick-green-subtle);
  border-color: var(--kick-green);
}

.upload-icon-wrapper {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--kick-green-subtle);
  color: var(--kick-green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.upload-texts {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.upload-main-text {
  font-size: 12px;
  color: var(--text-primary);
}

.upload-main-text strong {
  color: var(--kick-green);
}

.upload-sub-text {
  font-size: 10px;
  color: var(--text-muted);
}

.upload-progress-container {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.upload-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.upload-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.upload-progress-bar {
  width: 0%;
  height: 100%;
  background: var(--kick-green);
  transition: width 0.2s ease;
}

.quick-presets {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.presets-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.preset-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.preset-chip:hover {
  background: rgba(83, 252, 24, 0.08);
  border-color: rgba(83, 252, 24, 0.3);
  color: var(--kick-green);
}

.modal-actions,
.publish-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.publish-modal-actions {
  justify-content: space-between;
}

/* Guide Modal */
.sync-tips-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.sync-tip-item {
  display: flex;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 10px 12px;
  border-radius: var(--radius-md);
}

.tip-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--kick-green-subtle);
  color: var(--kick-green);
  border: 1px solid rgba(83, 252, 24, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}

.tip-content h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.tip-content p {
  font-size: 11px;
  color: var(--text-secondary);
}

.url-example-box {
  display: block;
  margin-top: 4px;
  padding: 4px 8px;
  background: #060809;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--kick-green);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  word-break: break-all;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  pointer-events: none;
}

.toast {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-focus);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  pointer-events: auto;
  animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.toast-success {
  border-color: rgba(83, 252, 24, 0.4);
}

.toast.toast-success svg {
  color: var(--kick-green);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast.toast-out {
  opacity: 0;
  transform: translateY(6px) scale(0.95);
  transition: opacity 0.25s, transform 0.25s;
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE & TABLET < 768px)
   ========================================================================== */

.hide-mobile {
  display: none !important;
}

@media (max-width: 900px) {
  .topbar-center {
    display: none;
  }
}

@media (max-width: 768px) {
  html, body {
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .hide-mobile {
    display: none !important;
  }

  .hide-desktop {
    display: inline-flex !important;
  }

  .chat-resizer {
    display: none;
  }

  .watch-container {
    height: auto;
    flex-direction: column;
    overflow: visible;
  }

  .stage-section {
    flex: none;
    width: 100%;
    height: auto;
  }

  .video-theater {
    width: 100%;
    height: auto;
    min-height: unset;
    aspect-ratio: 16 / 9;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .movie-player-box {
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9;
    position: relative;
  }

  .webcam-card {
    border-radius: var(--radius-sm);
  }

  .webcam-header {
    height: 22px;
    min-height: 22px;
    padding: 0 4px;
  }

  .webcam-streamer-name {
    font-size: 9px;
  }

  .chat-section {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 400px;
    height: 400px;
    border-left: none;
    border-top: 1px solid var(--border-subtle);
  }
}

/* ==========================================================================
   STREAM TELEMETRY & DIAGNOSTICS HUD (Stats for Nerds)
   ========================================================================== */
.stream-telemetry-hud {
  position: absolute;
  top: 12px;
  left: 12px;
  max-width: 440px;
  width: calc(100% - 24px);
  background: rgba(10, 14, 20, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(83, 252, 24, 0.35);
  border-radius: 12px;
  padding: 14px;
  z-index: 9999;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.8), 0 0 20px rgba(83, 252, 24, 0.15);
  color: #f1f5f9;
  font-family: 'JetBrains Mono', monospace, Consolas, sans-serif;
  font-size: 11px;
  animation: hudFadeIn 0.2s ease-out;
  user-select: none;
}

@keyframes hudFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.telemetry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.telemetry-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: #53fc18;
}

.telemetry-pulse {
  width: 8px;
  height: 8px;
  background: #53fc18;
  border-radius: 50%;
  box-shadow: 0 0 8px #53fc18;
  animation: livePulse 1.5s infinite;
}

.telemetry-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-telemetry-copy {
  background: rgba(83, 252, 24, 0.12);
  border: 1px solid rgba(83, 252, 24, 0.4);
  color: #53fc18;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-telemetry-copy:hover {
  background: #53fc18;
  color: #000;
}

.btn-telemetry-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  border-radius: 6px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-telemetry-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
}

.telemetry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.telemetry-card {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.telemetry-label {
  font-size: 9px;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.telemetry-val {
  font-size: 14px;
  font-weight: 700;
  color: #38bdf8;
}

.telemetry-val.good { color: #53fc18; }
.telemetry-val.warn { color: #f59e0b; }
.telemetry-val.bad { color: #ef4444; }

.telemetry-sub {
  font-size: 9px;
  color: #94a3b8;
}

.telemetry-buffer-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 3px;
}

.telemetry-buffer-fill {
  height: 100%;
  width: 0%;
  background: #53fc18;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.telemetry-logs-wrapper {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 8px;
}

.telemetry-logs-title {
  font-size: 9px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.telemetry-logs {
  max-height: 110px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 10px;
  line-height: 1.3;
}

.telemetry-log-item {
  color: #94a3b8;
  word-break: break-all;
}

.telemetry-log-item.success { color: #53fc18; }
.telemetry-log-item.warn { color: #f59e0b; }
.telemetry-log-item.error { color: #f87171; }
.telemetry-log-item.info { color: #38bdf8; }

