:root {
  --accent: #7065ff;
  --accent-rgb: 112, 101, 255;
  --background: #07080d;
  --card: rgba(15, 17, 26, 0.92);
  --border: rgba(255, 255, 255, 0.09);
  --text: #f7f8fc;
  --muted: #9397a7;
  --live: #ff405f;
}

* {
  box-sizing: border-box;
}

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

body {
  color: var(--text);
  font-family: "Inter", sans-serif;
  background:
    radial-gradient(
      circle at 15% 20%,
      rgba(var(--accent-rgb), 0.15),
      transparent 32%
    ),
    radial-gradient(
      circle at 87% 80%,
      rgba(var(--accent-rgb), 0.11),
      transparent 30%
    ),
    var(--background);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

.ambient {
  position: fixed;
  z-index: 0;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: var(--accent);
  filter: blur(125px);
  opacity: 0.2;
  pointer-events: none;
  animation: ambientMove 14s ease-in-out infinite alternate;
}

.ambient-one {
  top: -250px;
  left: -190px;
}

.ambient-two {
  right: -190px;
  bottom: -250px;
  animation-delay: -7s;
}

.page {
  position: relative;
  z-index: 1;
  width: min(1650px, calc(100% - 42px));
  height: 100dvh;
  margin: auto;
  padding: 18px 0 14px;
  display: flex;
  flex-direction: column;
}

.hero {
  flex: 0 0 auto;
  padding: 20px 150px 23px;
  text-align: center;
}

.hero h1 {
  display: inline-block;
  max-width: 100%;
  margin: 0;
  color: white;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(30px, 3.3vw, 50px);
  line-height: 1;
  letter-spacing: -0.045em;
  white-space: nowrap;
  background:
    linear-gradient(
      105deg,
      #ffffff 15%,
      rgba(var(--accent-rgb), 1) 47%,
      #ffffff 78%
    );
  background-size: 220% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 16px rgba(var(--accent-rgb), 0.28));
  animation: titleShimmer 7s linear infinite;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.hero h1:hover {
  transform: translateY(-3px) scale(1.025);
  filter: drop-shadow(0 0 24px rgba(var(--accent-rgb), 0.55));
}

.hero p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.theme-button {
  position: absolute;
  z-index: 10;
  top: 19px;
  right: 0;
  min-height: 38px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #dedfe7;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 17, 26, 0.86);
  cursor: pointer;
}

.theme-button span {
  color: var(--accent);
}

.content-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(430px, 0.86fr) minmax(650px, 1.34fr);
  gap: 18px;
}

.video-card,
.chat-card {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--card);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.36);
  overflow: hidden;
}

.video-card {
  align-self: start;
}

.video-wrapper {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #010204;
  overflow: hidden;
}

#video-player {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #010204;
}

.video-badges {
  position: absolute;
  z-index: 8;
  top: 13px;
  left: 13px;
  display: flex;
  gap: 7px;
  pointer-events: none;
}

.badge {
  min-height: 30px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: white;
  font-size: 10px;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(5, 6, 10, 0.76);
  backdrop-filter: blur(12px);
}

.badge.quality {
  color: #e2e0ff;
  border-color: rgba(var(--accent-rgb), 0.38);
  background: rgba(var(--accent-rgb), 0.19);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #777c89;
}

.badge.online {
  background: rgba(255, 64, 95, 0.88);
}

.badge.online .live-dot {
  background: white;
  animation: livePulse 1.4s infinite;
}

.custom-fullscreen {
  position: absolute;
  z-index: 10;
  top: 13px;
  right: 13px;
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  color: white;
  font-size: 19px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 11px;
  background: rgba(4, 5, 9, 0.73);
  backdrop-filter: blur(12px);
  cursor: pointer;
}

.fullscreen-chat-button {
  display: none;
}

.floating-video-close {
  display: none;
}

.offline-screen {
  position: absolute;
  z-index: 6;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    radial-gradient(
      circle at center,
      rgba(var(--accent-rgb), 0.2),
      transparent 42%
    ),
    linear-gradient(145deg, #0c0e17, #05060a);
}

.offline-screen.hidden {
  display: none;
}

.offline-light {
  width: 18px;
  height: 18px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 34px rgba(var(--accent-rgb), 0.85);
}

.offline-screen h2 {
  margin: 0 0 7px;
  font-size: 20px;
}

.offline-screen p {
  margin: 0 0 17px;
  color: var(--muted);
  font-size: 12px;
}

.offline-screen button {
  padding: 9px 15px;
  color: white;
  font-size: 12px;
  font-weight: 700;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  cursor: pointer;
}

.stream-bar {
  min-height: 88px;
  padding: 15px;
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 7px;
  border-top: 1px solid var(--border);
}

.stream-item {
  min-width: 0;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.042);
}

.cabin-item {
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  background: rgba(var(--accent-rgb), 0.09);
}

.stream-item span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
}

.stream-item strong {
  display: block;
  overflow: hidden;
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.video-footer {
  min-height: 48px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #8a8e9c;
  font-size: 12px;
  border-top: 1px solid var(--border);
}

.video-footer a {
  color: #c6c8d2;
  font-weight: 700;
  text-decoration: none;
}

.video-footer a:hover {
  color: var(--accent);
}

.chat-card {
  height: 100%;
  background: #0b0d14;
}

.chat-card iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

/* Pantalla completa personalizada */

.video-wrapper:fullscreen {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  background: black;
}

.video-wrapper:fullscreen #video-player {
  width: 100%;
  height: 100%;
}

.video-wrapper:fullscreen .fullscreen-chat-button {
  position: absolute;
  z-index: 20;
  right: 18px;
  bottom: 25px;
  min-height: 49px;
  padding: 0 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(var(--accent-rgb), 0.6);
  border-radius: 16px;
  background: rgba(var(--accent-rgb), 0.8);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.48);
  cursor: pointer;
}

.notification-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 13px;
  height: 13px;
  display: none;
  border: 2px solid #080910;
  border-radius: 50%;
  background: #ff405f;
  box-shadow: 0 0 12px rgba(255, 64, 95, 0.8);
}

.notification-dot.visible {
  display: block;
}

/* Selector de color */

.theme-panel {
  position: fixed;
  z-index: 100;
  top: 68px;
  right: 22px;
  width: 290px;
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(13, 15, 23, 0.97);
  box-shadow: 0 25px 75px rgba(0, 0, 0, 0.48);
  transition: 0.2s ease;
}

.theme-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.theme-header {
  display: flex;
  justify-content: space-between;
}

.theme-header strong,
.theme-header span {
  display: block;
}

.theme-header span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.theme-header button {
  color: var(--muted);
  font-size: 22px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.color-options {
  margin: 18px 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 9px;
}

.color-options button {
  width: 31px;
  height: 31px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: var(--option);
  cursor: pointer;
}

.custom-color {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.custom-color input {
  width: 44px;
  height: 31px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
}

.theme-reset {
  width: 100%;
  margin-top: 16px;
  padding: 10px;
  color: #dddfe7;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

/* Móvil */

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

  .page {
    width: calc(100% - 18px);
    height: auto;
    min-height: 100dvh;
    padding-top: 10px;
    padding-bottom: 20px;
  }

  .theme-button {
    top: 11px;
    right: 0;
    width: 38px;
    padding: 0;
    justify-content: center;
    font-size: 0;
  }

  .theme-button span {
    font-size: 17px;
  }

  .hero {
    padding: 48px 2px 16px;
  }

  .hero h1 {
    width: 100%;
    font-size: clamp(23px, 7.2vw, 35px);
  }

  .hero p {
    margin-top: 7px;
    font-size: 10px;
  }

  .content-grid {
    display: flex;
    flex-direction: column;
    height: auto;
    gap: 16px;
  }

  .video-card {
    width: 100%;
  }

  .stream-bar {
    grid-template-columns: 1fr 1fr;
    min-height: 0;
    padding: 9px;
  }

  .stream-item {
    padding: 8px;
  }

  .video-footer {
    min-height: 42px;
    font-size: 10px;
  }

  .chat-card {
    width: 100%;
    height: max(650px, calc(100dvh - 25px));
    min-height: 650px;
    border-radius: 18px;
  }

  .chat-card iframe {
    min-height: 650px;
  }

  /* Video flotante mientras se está viendo el XAT */

  .video-card.video-floating {
    position: fixed;
    z-index: 80;
    right: 11px;
    bottom: 11px;
    width: min(47vw, 235px);
    border-radius: 14px;
    box-shadow:
      0 20px 55px rgba(0, 0, 0, 0.65),
      0 0 22px rgba(var(--accent-rgb), 0.25);
    animation: floatingEnter 0.24s ease;
  }

  .video-card.video-floating .stream-bar,
  .video-card.video-floating .video-footer {
    display: none;
  }

  .video-card.video-floating .video-wrapper {
    border-radius: 13px;
  }

  .video-card.video-floating .video-badges {
    top: 6px;
    left: 6px;
  }

  .video-card.video-floating .badge {
    min-height: 21px;
    padding: 0 6px;
    font-size: 7px;
  }

  .video-card.video-floating .custom-fullscreen {
    display: none;
  }

  .video-card.video-floating .floating-video-close {
    position: absolute;
    z-index: 25;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    color: white;
    font-size: 19px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: rgba(4, 5, 9, 0.8);
    cursor: pointer;
  }

  .video-card.video-floating .offline-screen h2,
  .video-card.video-floating .offline-screen p,
  .video-card.video-floating .offline-screen button,
  .video-card.video-floating .offline-light {
    display: none;
  }
}

@keyframes ambientMove {
  from {
    transform: translate3d(-3%, -2%, 0) scale(1);
  }

  to {
    transform: translate3d(5%, 5%, 0) scale(1.1);
  }
}

@keyframes titleShimmer {
  from {
    background-position: 210% center;
  }

  to {
    background-position: -10% center;
  }
}

@keyframes livePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.55);
  }

  70% {
    box-shadow: 0 0 0 7px rgba(255, 255, 255, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

@keyframes floatingEnter {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.92);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =========================================================
   CORRECCIÓN MÓVIL, XAT DE ESCRITORIO Y VIDEO FLOTANTE
   ========================================================= */

.video-placeholder {
  display: none;
}

/*
  Contenedor externo del XAT. Su scrollbar sí puede diseñarse.
  El scrollbar interno generado por xat.com pertenece a XAT
  y no puede modificarse desde este dominio.
*/

.xat-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: auto;
  background: #090b11;
  scrollbar-width: thin;
  scrollbar-color:
    rgba(var(--accent-rgb), 0.8)
    rgba(255, 255, 255, 0.045);
}

.xat-viewport::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.xat-viewport::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.035);
}

.xat-viewport::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background:
    linear-gradient(
      180deg,
      rgba(var(--accent-rgb), 0.95),
      rgba(var(--accent-rgb), 0.48)
    );
  background-clip: padding-box;
}

.xat-viewport::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(
      180deg,
      rgba(var(--accent-rgb), 1),
      rgba(var(--accent-rgb), 0.7)
    );
  background-clip: padding-box;
}

/*
  En computadora ocupa exactamente el tamaño disponible.
*/

.xat-desktop-canvas {
  width: 100%;
  height: 100%;
  min-height: 100%;
}

.xat-desktop-canvas iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  border: 0;
}

/* Panel de XAT emergente dentro de la pantalla completa */

.fullscreen-chat-panel {
  position: absolute;
  z-index: 50;
  right: 18px;
  bottom: 88px;
  width: min(680px, calc(100% - 36px));
  height: min(650px, calc(100% - 125px));
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 19px;
  background: rgba(8, 10, 16, 0.97);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.72),
    0 0 35px rgba(var(--accent-rgb), 0.25);
  backdrop-filter: blur(18px);
}

.fullscreen-chat-panel.open {
  display: flex;
  animation: fullscreenChatEnter 0.22s ease;
}

.fullscreen-chat-toolbar {
  flex: 0 0 48px;
  padding: 0 11px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.035);
}

.fullscreen-chat-toolbar strong {
  font-size: 12px;
}

.fullscreen-chat-toolbar button {
  width: 34px;
  height: 34px;
  color: white;
  font-size: 21px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
  cursor: pointer;
}

.fullscreen-chat-host {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.fullscreen-chat-host .xat-desktop-canvas {
  width: 100%;
  height: 100%;
}

.fullscreen-chat-host iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Mientras el panel está abierto, el botón sirve para minimizar */

.video-wrapper:fullscreen
.fullscreen-chat-button.chat-panel-open {
  background: rgba(13, 15, 23, 0.9);
  border-color: rgba(255, 255, 255, 0.22);
}

/* =========================================================
   MÓVIL
   ========================================================= */

@media (max-width: 900px) {
  html,
  body {
    height: auto !important;
    min-height: 100%;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    scroll-behavior: smooth;
  }

  body {
    min-height: 100dvh;
  }

  .page {
    height: auto !important;
    min-height: 100dvh;
    overflow: visible;
  }

  .content-grid {
    display: flex !important;
    flex-direction: column;
    height: auto !important;
    min-height: 0;
    overflow: visible;
  }

  .video-placeholder.active {
    display: block;
    flex: 0 0 auto;
  }

  /*
    XAT completo debajo del reproductor.
  */

  .chat-card {
    position: relative !important;
    inset: auto !important;
    width: 100%;
    height: 720px;
    min-height: 720px;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
  }

  /*
    Se fuerza un lienzo de escritorio dentro del iframe.
    JavaScript lo escala para que encaje en el ancho móvil.
  */

  .xat-viewport {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  .xat-desktop-canvas {
    width: 1000px;
    height: 720px;
    min-height: 720px;
    transform-origin: top left;
  }

  .xat-desktop-canvas iframe {
    width: 1000px;
    height: 720px;
    min-height: 720px;
  }

  /*
    Se vuelve flotante solamente la tarjeta del video,
    pero el placeholder conserva su espacio original.
  */

  .video-card.video-floating {
    position: fixed !important;
    z-index: 90;
    right: 11px;
    bottom: 11px;
    width: min(48vw, 235px);
    height: auto !important;
    margin: 0;
    border-radius: 14px;
    box-shadow:
      0 22px 65px rgba(0, 0, 0, 0.72),
      0 0 24px rgba(var(--accent-rgb), 0.28);
    animation: floatingEnter 0.22s ease;
  }

  .video-card.video-floating .stream-bar,
  .video-card.video-floating .video-footer {
    display: none;
  }

  .video-card.video-floating .video-wrapper {
    border-radius: 13px;
  }

  .video-card.video-floating .floating-video-close {
    position: absolute;
    z-index: 80;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    color: white;
    font-size: 20px;
    line-height: 1;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 50%;
    background: rgba(3, 4, 8, 0.86);
    cursor: pointer;
  }

  .video-card.video-floating .custom-fullscreen {
    display: none;
  }

  .video-card.video-floating .video-badges {
    top: 7px;
    left: 7px;
  }

  .video-card.video-floating .badge {
    min-height: 22px;
    padding: 0 7px;
    font-size: 7px;
  }

  .video-card.video-floating .offline-screen h2,
  .video-card.video-floating .offline-screen p,
  .video-card.video-floating .offline-screen button,
  .video-card.video-floating .offline-light {
    display: none;
  }

  /*
    En pantalla completa móvil, el panel XAT ocupa casi
    toda la pantalla pero permite seguir viendo el video atrás.
  */

  .video-wrapper:fullscreen .fullscreen-chat-panel {
    inset: 54px 8px 76px;
    width: auto;
    height: auto;
    border-radius: 16px;
  }

  .video-wrapper:fullscreen .fullscreen-chat-host {
    overflow: hidden;
  }

  .video-wrapper:fullscreen
  .fullscreen-chat-host
  .xat-desktop-canvas {
    width: 1000px;
    height: 720px;
    transform-origin: top left;
  }

  .video-wrapper:fullscreen
  .fullscreen-chat-host
  iframe {
    width: 1000px;
    height: 720px;
  }
}

@keyframes fullscreenChatEnter {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =========================================================
   XAT OFICIAL EN FORMATO ESCRITORIO
   ========================================================= */

.video-placeholder,
.floating-video-close {
  display: none !important;
}

.chat-card {
  position: relative;
  overflow: hidden;
}

.xat-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #080a10;
}

.xat-desktop-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  transform-origin: top left;
}

.xat-desktop-canvas iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
}

/* Panel de chat sobre el video en pantalla completa */

.fullscreen-chat-panel {
  position: absolute;
  z-index: 70;
  right: 18px;
  bottom: 86px;
  width: min(650px, calc(100% - 36px));
  aspect-ratio: 650 / 486;
  height: auto;
  max-height: calc(100% - 120px);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background: rgba(7, 9, 15, 0.98);
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.78),
    0 0 35px rgba(var(--accent-rgb), 0.27);
  backdrop-filter: blur(20px);
}

.fullscreen-chat-panel.open {
  display: flex;
  animation: xatPanelEnter 0.22s ease;
}

.fullscreen-chat-toolbar {
  flex: 0 0 46px;
  padding: 0 10px 0 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.04);
}

.fullscreen-chat-toolbar strong {
  font-size: 12px;
}

.fullscreen-chat-toolbar button {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  color: white;
  font-size: 21px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.fullscreen-chat-host {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/*
  Pantalla completa personalizada.
  Se utiliza en celulares para conservar los controles superpuestos.
*/

body.player-fullscreen {
  overflow: hidden !important;
}

.video-wrapper.mobile-fullscreen {
  position: fixed !important;
  z-index: 1000;
  inset: 0;
  width: 100vw !important;
  height: 100dvh !important;
  aspect-ratio: auto !important;
  border-radius: 0 !important;
  background: #000;
}

.video-wrapper.mobile-fullscreen #video-player {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-wrapper.mobile-fullscreen .fullscreen-chat-button {
  position: absolute;
  z-index: 80;
  right: 16px;
  bottom: 22px;
  min-height: 48px;
  padding: 0 15px;
  display: flex !important;
  align-items: center;
  gap: 8px;
  color: white;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(var(--accent-rgb), 0.7);
  border-radius: 16px;
  background: rgba(var(--accent-rgb), 0.86);
  box-shadow:
    0 14px 38px rgba(0, 0, 0, 0.58),
    0 0 24px rgba(var(--accent-rgb), 0.28);
  cursor: pointer;
}

.video-wrapper.mobile-fullscreen .fullscreen-chat-button.chat-panel-open {
  background: rgba(13, 15, 23, 0.94);
  border-color: rgba(255, 255, 255, 0.2);
}

/* =========================================================
   XAT DE ESCRITORIO ADAPTADO AL CELULAR
   ========================================================= */

@media (max-width: 900px) {
  html,
  body {
    height: auto !important;
    min-height: 100%;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  .page {
    height: auto !important;
    min-height: 100dvh;
    overflow: visible;
  }

  .content-grid {
    display: flex !important;
    flex-direction: column;
    height: auto !important;
    overflow: visible;
  }

  .video-card {
    position: relative !important;
    width: 100%;
    height: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
  }

  /*
    La tarjeta toma exactamente la proporción del iframe oficial.
    Así no queda un espacio oscuro debajo.
  */

  .chat-card {
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 650 / 486;
    border-radius: 17px;
  }

  .xat-viewport,
  .xat-desktop-canvas {
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  /*
    El iframe conserva internamente 650 × 486.
    JavaScript lo escala proporcionalmente al ancho disponible.
  */

  .xat-desktop-canvas iframe {
    width: 650px;
    height: 486px;
    min-height: 486px;
    transform-origin: top left;
  }

  .video-wrapper.mobile-fullscreen .fullscreen-chat-panel {
    inset: 52px 7px 78px;
    width: auto;
    height: auto;
    max-height: none;
    aspect-ratio: auto;
    border-radius: 16px;
  }

  .video-wrapper.mobile-fullscreen .fullscreen-chat-host {
    position: relative;
    width: 100%;
    height: 100%;
  }
}

@keyframes xatPanelEnter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =========================================================
   BOTÓN XAT SIEMPRE VISIBLE EN PANTALLA COMPLETA
   ========================================================= */

.video-wrapper:fullscreen .fullscreen-chat-button,
.video-wrapper:-webkit-full-screen .fullscreen-chat-button,
.video-wrapper.mobile-fullscreen .fullscreen-chat-button {
  position: absolute !important;
  z-index: 2147483647 !important;
  right: 18px !important;
  bottom: 22px !important;

  min-width: 76px;
  min-height: 50px;
  padding: 0 15px;

  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;

  align-items: center;
  justify-content: center;
  gap: 8px;

  color: #fff;
  font-size: 12px;
  font-weight: 800;

  border: 1px solid rgba(var(--accent-rgb), 0.75);
  border-radius: 16px;

  background:
    linear-gradient(
      145deg,
      rgba(var(--accent-rgb), 0.96),
      rgba(var(--accent-rgb), 0.72)
    );

  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.62),
    0 0 25px rgba(var(--accent-rgb), 0.34);

  cursor: pointer;
  animation: floatingXatButton 3s ease-in-out infinite;
}

.video-wrapper:fullscreen .custom-fullscreen,
.video-wrapper:-webkit-full-screen .custom-fullscreen,
.video-wrapper.mobile-fullscreen .custom-fullscreen {
  z-index: 2147483647 !important;
}

.video-wrapper:fullscreen .fullscreen-chat-panel,
.video-wrapper:-webkit-full-screen .fullscreen-chat-panel,
.video-wrapper.mobile-fullscreen .fullscreen-chat-panel {
  z-index: 2147483646 !important;
}

/* Indicador preparado, pero oculto mientras no haya datos reales */

.notification-dot {
  position: absolute;
  top: -5px;
  right: -5px;

  min-width: 20px;
  height: 20px;
  padding: 0 5px;

  display: none;
  place-items: center;

  color: #fff;
  font-size: 10px;
  font-weight: 800;

  border: 2px solid #050609;
  border-radius: 999px;
  background: #ff405f;

  box-shadow: 0 0 15px rgba(255, 64, 95, 0.78);
}

.notification-dot.visible {
  display: grid;
}

@keyframes floatingXatButton {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

/* =========================================================
   FULLSCREEN: VIDEO + BOTÓN XAT + PANEL DE CHAT
   ========================================================= */

body.fullscreen-active {
  overflow: hidden !important;
}

.video-wrapper.player-fullscreen {
  position: fixed !important;
  z-index: 2147483000 !important;
  inset: 0 !important;

  width: 100vw !important;
  height: 100dvh !important;

  aspect-ratio: auto !important;
  border-radius: 0 !important;
  background: #000 !important;
}

.video-wrapper.player-fullscreen #video-player,
.video-wrapper:fullscreen #video-player,
.video-wrapper:-webkit-full-screen #video-player {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

/* Botón XAT visible solo en pantalla completa */

.video-wrapper.player-fullscreen .fullscreen-chat-button,
.video-wrapper:fullscreen .fullscreen-chat-button,
.video-wrapper:-webkit-full-screen .fullscreen-chat-button {
  position: absolute !important;
  z-index: 2147483646 !important;

  right: 18px !important;
  bottom: 24px !important;

  min-width: 84px;
  height: 50px;
  padding: 0 16px;

  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;

  align-items: center;
  justify-content: center;
  gap: 8px;

  color: #fff;
  font-size: 12px;
  font-weight: 800;

  border: 1px solid rgba(var(--accent-rgb), 0.85);
  border-radius: 16px;

  background:
    linear-gradient(
      145deg,
      rgba(var(--accent-rgb), 0.97),
      rgba(var(--accent-rgb), 0.72)
    );

  box-shadow:
    0 16px 45px rgba(0, 0, 0, 0.65),
    0 0 28px rgba(var(--accent-rgb), 0.36);

  cursor: pointer;
}

/* Botón para salir del fullscreen */

.video-wrapper.player-fullscreen .custom-fullscreen,
.video-wrapper:fullscreen .custom-fullscreen,
.video-wrapper:-webkit-full-screen .custom-fullscreen {
  position: absolute !important;
  z-index: 2147483647 !important;
  top: 16px !important;
  right: 16px !important;

  display: grid !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Panel del XAT encima del video */

.video-wrapper.player-fullscreen .fullscreen-chat-panel,
.video-wrapper:fullscreen .fullscreen-chat-panel,
.video-wrapper:-webkit-full-screen .fullscreen-chat-panel {
  z-index: 2147483645 !important;
}

/* Celular */

@media (max-width: 900px) {
  .video-wrapper.player-fullscreen .fullscreen-chat-panel,
  .video-wrapper:fullscreen .fullscreen-chat-panel,
  .video-wrapper:-webkit-full-screen .fullscreen-chat-panel {
    position: absolute !important;
    inset: 58px 8px 82px !important;

    width: auto !important;
    height: auto !important;
    max-height: none !important;

    border-radius: 16px;
  }
}

/* =========================================================
   RESTAURAR PANTALLA COMPLETA NATIVA DEL REPRODUCTOR
   ========================================================= */

.custom-fullscreen,
.fullscreen-chat-button,
.fullscreen-chat-panel,
.floating-video-close {
  display: none !important;
}

/* Elimina cualquier modo de pantalla completa simulado anterior. */
.video-wrapper.player-fullscreen,
.video-wrapper.mobile-fullscreen {
  position: relative !important;
  z-index: auto !important;
  inset: auto !important;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9 !important;
  border-radius: inherit !important;
}

body.fullscreen-active,
body.player-fullscreen {
  overflow: auto !important;
}

/* El video conserva los controles originales del navegador. */
#video-player {
  width: 100%;
  height: 100%;
  display: block;
}

/* =========================================================
   TÍTULO DINÁMICO Y BOTÓN DE COLORES
   ========================================================= */

.hero {
  padding-top: 20px;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-width: 0;
}

.hero h1 {
  max-width: calc(100% - 130px);
  margin: 0;
  overflow: hidden;
  font-family: "Outfit", sans-serif;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.title-row .theme-button {
  position: static;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 13px;
}

@media (max-width: 900px) {
  .hero {
    padding: 15px 0 16px;
  }

  .title-row {
    width: 100%;
    gap: 8px;
  }

  .hero h1 {
    flex: 1 1 auto;
    width: auto;
    max-width: none;
    min-width: 0;
    font-size: clamp(23px, 7vw, 34px);
    text-align: left;
  }

  .title-row .theme-button {
    width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 12px;
  }

  .title-row .theme-button > span:first-child {
    font-size: 17px;
  }

  .theme-button-text {
    display: none;
  }

  .hero p {
    margin-top: 7px;
    padding-right: 46px;
    text-align: left;
  }
}

@media (max-width: 420px) {
  .hero h1 {
    font-size: clamp(21px, 6.8vw, 29px);
  }

  .hero p {
    padding-right: 0;
    font-size: 9px;
  }
}

/* Corrección: evitar que se corten letras como g, y, p o j */
.title-row {
  overflow: visible !important;
  padding-bottom: 4px;
}

.hero h1 {
  overflow: visible !important;
  line-height: 1.18 !important;
  padding: 2px 3px 7px !important;
  text-overflow: clip !important;
}

@media (max-width: 900px) {
  .hero {
    overflow: visible !important;
  }

  .title-row {
    min-height: 48px;
    padding-bottom: 3px;
  }

  .hero h1 {
    line-height: 1.18 !important;
    padding-bottom: 6px !important;
  }
}
