body {
  background-color: #0f2027;
  color: white;
  font-family: 'Segoe UI', sans-serif;
}
header {
  background: linear-gradient(90deg, #ff8c00, #007aff);
  padding: 1rem;
  text-align: center;
}
.section-title {
  margin-top: 2rem;
  color: #fff;
  text-align: center;
}
.categorias-lista button {
  margin: 5px;
  border: none;
  padding: 10px 15px;
  border-radius: 8px;
  background: #007aff;
  color: white;
  cursor: pointer;
}
.categorias-lista button:hover {
  background: #0051b2;
}
.modal-content {
  background-color: #1a1a1a;
  color: white;
}
.cuento-img {
  width: 100%;
  max-width: 250px;
  border-radius: 10px;
}
.boton {
  display: inline-block;
  padding: 10px 20px;
  background-color: #ff8c00;
  color: white;
  border-radius: 5px;
  text-decoration: none;
}
.boton:hover {
  background-color: #ff7000;
}



/* Tema claro */
body.light-mode {
  background-color: #fdfdfd;
  color: #222;
}

header {
  background: linear-gradient(90deg, #ff8c00, #007aff); /* Naranja a azul */
  color: white;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 0 0 10px 10px;
}
header {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}


body.light-mode .btn-outline-light {
  border-color: #222;
  color: #222;
}

body.light-mode .btn-outline-light:hover {
  background-color: #ddd;
  color: #000;
}

/* Tema oscuro (por defecto en tu diseño actual) */
body.dark-mode {
  background-color: #0f2027;
  color: white;
}

/* Ajuste para header en modo claro y oscuro en entretenimiento */
body.light-mode header {
  background: linear-gradient(90deg, #ff8c00, #007aff);
  color: white;
}

body.dark-mode header {
  background: linear-gradient(90deg, #0d1b2a, #132743, #1b3b6f); /* Degradado más contrastado */
  color: white;
}


body.light-mode .section-title {
  color: #222 !important;
  font-weight: 600;
}

body.light-mode .btn-warning {
  background-color: #f0ad4e;
  color: #222;
  border: none;
}
body.light-mode .btn-info {
  background-color: #5bc0de;
  color: #222;
  border: none;
}
body.light-mode .btn-success {
  background-color: #5cb85c;
  color: #fff;
  border: none;
}
body.light-mode .categorias-lista button {
  background: #007bff;
  color: white;
}

body.light-mode .btn {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease-in-out;
}
body.light-mode .btn:hover {
  transform: translateY(-1px);
}


/* ===== ESTILOS DE MODALES PARA MODO CLARO ===== */
body.light-mode .modal-content {
  background-color: #ffffff;
  color: #222;
  border: 1px solid #ccc;
}

body.light-mode .modal-header {
  border-bottom: 1px solid #ddd;
}

body.light-mode .btn-close {
  filter: invert(0%);
}

/* ===== ESTILOS DE MODALES PARA MODO OSCURO (ya lo tienes pero los reforzamos) ===== */
body.dark-mode .modal-content {
  background-color: #1a1a1a;
  color: white;
  border: none;
}

body.dark-mode .modal-header {
  border-bottom: 1px solid #333;
}

body.dark-mode .btn-close {
  filter: invert(100%);
}


.boton {
  display: inline-block;
  padding: 10px 20px;
  background-color: #ff8c00;
  color: white;
  border-radius: 5px;
  text-decoration: none;
  transition: background-color 0.2s;
}

.boton:hover {
  background-color: #e67600;
}

body.light-mode .boton {
  background-color: #007aff;
  color: #fff;
}

body.light-mode .boton:hover {
  background-color: #0060c7;
}

body.light-mode .btn-link {
  color: #007aff;
}
body.light-mode .btn-link:hover {
  color: #0056b3;
}

body.dark-mode .btn-link {
  color: #66bfff;
}
body.dark-mode .btn-link:hover {
  color: #99d7ff;
}

@keyframes modalFadeUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-content {
  border-radius: 12px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
  animation: modalFadeUp 0.3s ease-out;
  transition: all 0.3s ease;
}

* {
  transition: all 0.2s ease-in-out;
}


/* BOTONES DE ACCIÓN MODERNOS */
.btn {
  border-radius: 10px;
  padding: 10px 20px;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Sombras específicas por tipo de botón */
.btn-warning {
  background-color: #ffc107;
  color: #000;
}

.btn-warning:hover {
  background-color: #ffb300;
}

.btn-info {
  background-color: #17a2b8;
  color: white;
}

.btn-info:hover {
  background-color: #138a9c;
}

.btn-success {
  background-color: #28a745;
  color: white;
}

.btn-success:hover {
  background-color: #218838;
}

.categorias-lista button {
  margin: 6px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: #007bff;
  color: white;
  cursor: pointer;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.25s, box-shadow 0.25s;
}

.categorias-lista button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}


/* LOGO animado */
.logo-header {
  height: 75px;
  transition: all 0.4s ease-in-out;
  animation: zoomIn 0.6s ease forwards;
  filter: drop-shadow(0 0 0 transparent); /* base sin sombra */
}

.logo-header:hover {
  transform: scale(1.1);
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5)) brightness(1.1);
}

.logo-header {
  height: 75px;
  transition: all 0.4s ease-in-out;
  animation: zoomIn 0.6s ease forwards;
  filter: drop-shadow(0 0 0 transparent); /* base sin sombra */
}

.logo-header:hover {
  transform: scale(1.1);
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5)) brightness(1.1);
}

/* TÍTULO animado */
.titulo-header {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
  text-align: center;
  animation: fadeInDown 0.8s ease forwards;
}

/* Botón de modo */
#modoBtn {
  transition: all 0.3s ease;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 1.2rem;
}

#modoBtn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

/* Animaciones keyframes */
@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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


/* footer */

.footer {
  background-color: #1c1c1c;
  color: #fff;
  font-size: 0.9rem;
}

.footer .social-icons a {
  color: #fff;
  margin: 0 10px;
  font-size: 1.2rem;
  transition: transform 0.2s ease;
}

.footer .social-icons a:hover {
  transform: scale(1.2);
  color: #007aff;
}

/* Botones flotantes */
.botones-contacto {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-floating {
  background-color: #0a1a56;
  color: white;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  text-decoration: none;
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.btn-floating:hover {
  background-color: #007aff;
  transform: scale(1.1);
}

html, body {
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.contenido-principal {
  flex: 1;
}
footer {
  width: 100%;
  margin-top: auto;
}



.seccion-box {
  background-color: white;
  border-radius: 12px;
  padding: 2rem;
  margin: 2rem auto;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
  width: 95%;
  max-width: 1000px;
  transition: all 0.3s ease;
}

/* Estilo adaptado para modo oscuro */
body.dark-mode .seccion-box {
  background-color: #1e1e1e;
  color: white;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* ajuste cuento ilustrados */
.btn-outline-primary {
  min-width: 100px;
  font-weight: 500;
}


.volver-container {
  text-align: center;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.btn-volver {
  display: inline-block;
  background: linear-gradient(to right, #ff8c00, #007aff);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: bold;
  text-decoration: none;
  transition: background 0.3s, transform 0.3s;
}

.btn-volver:hover {
  background: linear-gradient(to right, #007aff, #ff8c00);
  transform: scale(1.05);
}


/* ✅ RESPONSIVE ESPECIAL PARA PANTALLAS PEQUEÑAS */
@media (max-width: 768px) {

  /* Ajuste general para las secciones */
  .seccion-box {
    width: 90%;
    padding: 1.5rem;
    margin: 1rem auto;
  }

  /* Títulos más pequeños */
  .section-title, .modal-title, .titulo-header {
    font-size: 1.5rem;
    text-align: center;
  }

  /* Botones grandes que ocupen bien */
  .btn, .btn-volver {
    width: 100%;
    padding: 12px 18px;
    font-size: 1rem;
  }

  /* Botón modo oscuro tamaño más amigable */
  #modoBtn {
    padding: 8px 12px;
    font-size: 1rem;
  }

  /* Ajustar footer */
  .footer {
    font-size: 0.8rem;
  }

  /* Ajuste botones flotantes (WhatsApp, Email, Teléfono) */
  .btn-floating {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }

  /* Logo */
  .logo-header {
    height: 60px;
  }
  
  /* Contenedor del logo y botón volver */
  header {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  /* Ajuste en el contenedor del botón de volver */
  .volver-container {
    margin-top: 1rem;
    margin-bottom: 0;
  }

}

/* ✅ Animación de aparición flotante para móviles */
@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Aplicar animación a los botones flotantes */
.botones-contacto {
  animation: floatIn 0.8s ease forwards;
}



/* Fondo oscuro del modal (fondo general) */
body.dark-mode #modalMenuJuegos {
  background-color: rgba(0, 0, 0, 0.8);
}

/* Fondo interno del cuadro de selección */
body.dark-mode .contenido-modal-juego {
  background-color: #1e1e1e;
  color: #f1f1f1;
  border-radius: 10px;
}

/* Título del modal */
body.dark-mode .contenido-modal-juego h4 {
  color: #f8f8f8;
}

/* Botón de juego */
body.dark-mode .contenido-modal-juego .btn-outline-primary {
  color: #9ecfff;
  border-color: #9ecfff;
}

body.dark-mode .contenido-modal-juego .btn-outline-primary:hover {
  background-color: #1a5c94;
  color: white;
}

/* Botón de cancelar */
body.dark-mode .contenido-modal-juego .btn-danger {
  background-color: #992222;
  color: white;
}
/* Fondo claro por defecto */
.contenido-modal-juego {
  background-color: white;
  color: black;
}

/* Modo oscuro */
body.dark-mode .contenido-modal-juego {
  background-color: #1e1e1e;
  color: #f1f1f1;
}


/* Animación fade-in */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Aplica animación al contenido del modal */
.contenido-modal-juego {
  animation: fadeInUp 0.4s ease-out;
}

/* Animaciones */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOutDown {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(30px);
  }
}

/* Clases que activan las animaciones */
.fade-in {
  animation: fadeInUp 0.4s ease-out forwards;
}

.fade-out {
  animation: fadeOutDown 0.3s ease-in forwards;
}




/* Cargar juegos */
/* Fondo dinámico con gradiente animado */
.pantalla-carga {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999;
  background-size: 800% 800%;
  animation: fondoGradiente 8s ease infinite;
  color: white;
  font-size: 1.8em;
  font-family: 'Segoe UI', sans-serif;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  text-align: center;
  display: flex;
}

.pantalla-carga.claro {
  background: linear-gradient(270deg, #3f51b5, #673ab7, #e91e63, #ff5722);
}

.pantalla-carga.oscuro {
  background: linear-gradient(270deg, #0f2027, #203a43, #2c5364, #000000);
}

@keyframes fondoGradiente {
  0% {background-position: 0% 50%;}
  50% {background-position: 100% 50%;}
  100% {background-position: 0% 50%;}
}

