/* ==========================================================================
   RESET BÁSICO Y CORRECCIÓN GLOBAL ANTI-DESBORDAMIENTO
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: #f8fafc;
}

/* ==========================================================================
   HEADER PRINCIPAL
   ========================================================================== */
.main-header {
  background-color: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.header-container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 6px 12px;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 60px;
  width: 100%;
}

.logo-container {
  flex-shrink: 0;
}

.nav-menu {
  flex-shrink: 1;
  min-width: 0;
}

.header-right-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

/* ==========================================================================
   1. ESTILOS DEL LOGO BAHIENSES.COM
   ========================================================================== */
.logo-container {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  user-select: none;
  padding: 2px 4px;
  border-radius: 8px;
  transition: transform 0.2s ease, opacity 0.2s ease;
  flex-shrink: 0;
}

.logo-container:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

/* Bandera argentina sin Sol de Mayo */
.flag-icon,
.argentina-flag {
  display: flex;
  flex-direction: column;
  width: 30px;
  height: 20px;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.stripe {
  flex: 1;
  width: 100%;
  height: auto;
  position: relative;
}

.stripe.sky-blue {
  background-color: #c0392b;
}

.stripe.white {
  background-color: #ffffff;
}

/* Texto del logo */
.logo-text {
  display: inline-flex;
  align-items: baseline;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
  white-space: nowrap;
}

.text-sky-blue {
  color: #74ACDF;
}

.text-gold {
  color: #F6B40E;
}

.text-green {
  color: #74ACDF !important;
}

.text-white {
  color: #1a1a1a;
}

.text-red {
  color: #F6B40E;
}

/* ==========================================================================
   2. MENÚ DE NAVEGACIÓN (DESKTOP POR DEFECTO)
   ========================================================================== */
.hamburger-btn {
  display: none; 
}

.menu-overlay,
.menu-header {
  display: none;
}

.nav-menu {
  display: flex;
  align-items: center;
}

.menu-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 16px;
}

.menu-links li a {
  text-decoration: none;
  color: #475569;
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.menu-links li a:hover {
  color: #2685c5;
}

.menu-divider-vertical {
  width: 1px;
  height: 16px;
  background-color: #cbd5e1;
}

/* ==========================================================================
   3. BLOQUE DERECHO: CONTADOR COMPACTO + BOTÓN CHAT
   ========================================================================== */
.live-activity-card {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: #f1f5f9;
  padding: 4px 8px;
  border-radius: 50px;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
  user-select: none;
}

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

.pulse-dot {
  width: 6px;
  height: 6px;
  background-color: #10b981;
  border-radius: 50%;
  position: relative;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  width: 12px;
  height: 12px;
  background-color: rgba(16, 185, 129, 0.4);
  border-radius: 50%;
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

.activity-title {
  font-size: 0.58rem;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.5px;
}

.activity-body {
  display: flex;
  align-items: center;
  gap: 3px;
}

.counter-number {
  font-size: 0.82rem;
  font-weight: 800;
  color: #0f172a;
  transition: opacity 0.3s ease;
}

.counter-number.updating {
  opacity: 0.2;
}

.counter-label {
  font-size: 0.7rem;
  color: #2685c5;
  font-weight: 700;
}

/* Botón "Entrar al Chat" cambiado a rojo */
.btn-header-chat {
  background: #c0392b;
  color: #ffffff;
  padding: 5px 10px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  text-decoration: none;
  border: 1.5px solid #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(192, 57, 43, 0.3);
  transition: transform 0.2s ease, background 0.2s ease;
  animation: blink-btn 1.5s infinite ease-in-out;
}

.btn-header-chat:hover {
  transform: scale(1.04);
  background: #a93226;
  box-shadow: 0 4px 10px rgba(192, 57, 43, 0.4);
}

@keyframes blink-btn {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 6px rgba(38, 133, 197, 0.6);
  }
  50% {
    opacity: 0.75;
    box-shadow: 0 0 12px rgba(116, 172, 223, 0.8);
  }
}

/* ==========================================================================
   4. MODAL DEL CHAT
   ========================================================================== */
.chat-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  z-index: 10000;
  justify-content: center;
  align-items: center;
}

.chat-modal-overlay.active {
  display: flex;
}

.chat-modal-container {
  width: 98vw;
  height: 85vh;
  background-color: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.chat-modal-header {
  background-color: #111111;
  color: #ffffff;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-modal-header h3 {
  margin: 0;
  font-size: 0.95rem;
}

.btn-close-chat {
  background: #2685c5;
  color: #ffffff;
  border: none;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.8rem;
}

.chat-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ==========================================================================
   5. ADAPTACIÓN RESPONSIVA (MÓVILES Y TABLETS)
   ========================================================================== */
@media (max-width: 1023px) {
  .hamburger-btn {
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 100001;
    flex-shrink: 0;
  }

  .hamburger-line {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #0f172a;
    border-radius: 2px;
  }

  .menu-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 99998;
  }

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

  .nav-menu {
    position: fixed;
    top: 0;
    left: -280px;
    width: 260px;
    height: 100vh;
    background-color: #ffffff;
    z-index: 99999;
    transition: left 0.3s ease;
    flex-direction: column;
    align-items: flex-start;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.15);
  }

  .nav-menu.active {
    left: 0;
  }

  .menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
  }

  .menu-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
  }

  .close-btn {
    background: none;
    border: none;
    font-size: 1.6rem;
    color: #64748b;
    cursor: pointer;
  }

  .menu-links {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: 12px 0;
    gap: 0;
  }

  .menu-links li {
    width: 100%;
  }

  .menu-links li a {
    display: block;
    padding: 12px 20px;
    width: 100%;
  }

  .menu-divider-vertical {
    width: 90%;
    height: 1px;
    margin: 8px auto;
  }
}

/* Optimización extra para celulares pequeños Y modo horizontal (landscape) */
@media (max-width: 768px), (max-height: 500px) {
  .header-container {
    padding: 4px 8px;
    gap: 6px;
    min-height: 50px;
  }

  .logo-text {
    font-size: 0.95rem;
  }

  .flag-icon, .argentina-flag {
    width: 24px;
    height: 16px;
  }

  .header-right-actions {
    gap: 4px;
  }

  .live-activity-card {
    padding: 2px 6px;
    gap: 4px;
  }

  .activity-title {
    display: none;
  }

  .counter-number {
    font-size: 0.75rem;
  }

  .counter-label {
    font-size: 0.65rem;
  }

  .btn-header-chat {
    font-size: 0.68rem;
    padding: 3px 6px;
    gap: 2px;
    border-width: 1px;
  }
  
  .btn-header-chat svg {
    display: none !important;
  }
}

/* Hero Section & Títulos en Celestito #74ACDF */
.hero-section {
  padding: 40px 20px 20px 20px;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.hero-section h1 {
  font-size: 2rem;
  color: #74ACDF !important; /* <-- Título principal en celestito */
  margin-bottom: 10px;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: #555;
  margin-bottom: 25px;
}

/* Títulos de sección en color celestito #74ACDF */
.section-header h2 {
  color: #74ACDF !important;
}

.chat-access-card {
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  max-width: 500px;
  margin: 0 auto;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.nick-label {
  display: block;
  text-align: left;
  font-weight: bold;
  margin-bottom: 8px;
  color: #333;
}

.input-group {
  display: flex;
  gap: 10px;
}

.input-group input {
  flex: 1;
  padding: 12px 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  outline: none;
}

.input-group input:focus {
  border-color: #2685c5;
}

.btn-primary-chat {
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.btn-primary-chat:hover {
  background: #a93226;
}

/* ==========================================================================
   CHAT A PANTALLA COMPLETA ABSOLUTA (ANCHO Y ALTO 100%)
   ========================================================================== */
body.chat-active {
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
}

body.chat-active > *:not(#chat-section) {
  display: none !important;
}

body.chat-active .embedded-chat-section,
#chat-section.chat-active-mode {
  display: block !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
  z-index: 999999 !important;
  background-color: #000000;
}

.chat-wrapper {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #000000 !important;
}

.inline-chat-iframe {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  display: block !important;
}

/* ==========================================================================
   CORRECCIÓN GLOBAL PARA BOTONES Y TÍTULOS VERDES A ROJO/CELESTE
   ========================================================================== */

/* 1. Todos los botones que tengan fondo verde o estilo principal de juego/acción se pasan a rojo #c0392b */
.btn-primary,
.btn-game,
.game-button,
.btn-play,
.card-button,
a.btn-green,
button.btn-green {
  background-color: #c0392b !important;
  color: #ffffff !important;
  border-color: #c0392b !important;
}

.btn-primary:hover,
.btn-game:hover,
.game-button:hover,
.btn-play:hover,
.card-button:hover,
a.btn-green:hover,
button.btn-green:hover {
  background-color: #a93226 !important;
}

/* 2. Si los botones de las tarjetas usan clases genéricas de fondo, forzamos el rojo en los botones dentro de las cards */
.custom-card .card-link,
.custom-card .btn,
.card-content a.btn {
  background-color: #c0392b !important;
  color: #ffffff !important;
  padding: 8px 14px;
  border-radius: 6px;
  text-align: center;
  display: inline-block;
  font-weight: 600;
}

.custom-card .card-link:hover {
  background-color: #a93226 !important;
  color: #ffffff !important;
  text-decoration: none;
}

/* 3. Forzar los títulos principales y de sección a celestito #74ACDF por si el HTML los pisa */
h1, h2, .hero-section h1, .section-header h2 {
  color: #74ACDF !important;
}

/* Botones de salas de juegos en rojo #c0392b */
.game-card button.btn-game-chat,
button.btn-game-chat {
  width: 100%;
  background: #c0392b !important;
  color: #fff !important;
  border: none;
  padding: 10px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
}

.game-card button.btn-game-chat:hover,
button.btn-game-chat:hover {
  background: #a93226 !important;
}

/* Títulos principales y de sección en celestito */
h1, h2, .hero-section h1, .seo-games-section h2, .seo-tips-section h2, .seo-reviews-section h2 {
  color: #74ACDF !important;
}