* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-image: url('../images/fondo.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: clamp(10px, 3vw, 30px);
}

.container {
  max-width: 100%;
  width: clamp(300px, 90vw, 800px);
  margin: 0 auto;
  padding: clamp(15px, 4vw, 30px);
  background-color: rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}

.header-logo {
  width: clamp(150px, 50%, 250px);
  height: auto;
  display: block;
  margin: 0 auto clamp(15px, 4vw, 30px);
}

.video-section {
  margin: 15px 0;
  position: relative;
  width: 100%;
  background-color: #000;
  border-radius: 8px;
}

.video-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#live-video {
  display: block;
  width: 100%;
  height: 56vw; /* 16:9 ratio, se ajusta al ancho de pantalla */
  max-height: 415px;
  margin: 0 auto;
  border-radius: 8px 8px 0 0;
}

#offline-image,
#loading-message {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  object-fit: cover;
}

#loading-message {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.85);
  color: white;
  font-size: 1.4rem;
  z-index: 3;
}

#offline-image {
  display: none;
  z-index: 2;
}

#chat-container {
  width: 100%;
  max-width: 720px;
  margin: 24px auto 0 auto; /* Separación arriba */
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

#live-chat {
  width: 95%;
  min-height: 400px;
  height: 60vh;      /* Más alto: 60% de la ventana */
  max-height: 700px; /* Más espacio en escritorio */
  border: none;
  display: block;
}

/* Chat flotante sobre el video en fullscreen */
.fullscreen-chat #chat-container {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw !important;
  max-width: none !important;
  height: 60vh;
  z-index: 9999;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 0;
}
.fullscreen-chat #chat-container iframe {
  width: 100vw !important;
  height: 60vh !important;
  max-width: none !important;
  border: none;
}

iframe {
  width: 100%;
  height: 100%;
  border: none;
}

header {
  text-align: center;
  margin-bottom: clamp(20px, 5vw, 30px);
}

h1 {
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  margin-bottom: clamp(10px, 3vw, 15px);
}

h2 {
  text-align: center;
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  margin-bottom: clamp(10px, 3vw, 15px);
}

p {
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  margin-bottom: clamp(10px, 3vw, 15px);
}

.social-links {
  margin-top: clamp(20px, 5vw, 30px);
}

.buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(10px, 3vw, 20px);
  justify-content: center;
}

.social-link {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 100px;
  transition: transform 0.3s;
}

.social-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.social-link:hover {
  transform: scale(1.1);
}

footer {
  text-align: center;
  margin-top: clamp(20px, 5vw, 30px);
  font-size: clamp(0.8rem, 2vw, 0.9rem);
}

.live-button {
  text-align: center;
  margin-top: clamp(20px, 5vw, 30px);
}

.button {
  display: inline-block;
  padding: clamp(10px, 2vw, 15px) clamp(20px, 4vw, 30px);
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: #fff;
  background-color: #007bff;
  text-decoration: none;
  border-radius: 5px;
  transition: background-color 0.3s, transform 0.3s;
}

.button:hover {
  background-color: #0056b3;
  transform: scale(1.05);
}

/* Responsive para móvil */
@media (max-width: 600px) {
  #live-video {
    height: 48vw;      /* Un poco menos alto en móvil */
    max-height: 220px;
  }
  #live-chat {
    height: 48vw;
    min-height: 150px;
    max-height: 300px;
  }
  .fullscreen-chat #chat-container,
  .fullscreen-chat #chat-container iframe {
    height: 50vh !important;
  }
  #chat-container {
    margin-top: 16px;
  }
  #live-chat {
    min-height: 150px;
    height: 35vh;
    max-height: 300px;
  }
}
