
/* Minimal styles */
html,
body,
#map {
  height: 100%;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

/* ============================================
   ESTILOS PARA POPUPS DE LEAFLET EN MÓVILES
   ============================================ */
/* Hacer los popups de Leaflet scrolleables */
.leaflet-popup-content-wrapper {
  max-height: 60vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.leaflet-popup-content {
  margin: 12px;
  touch-action: pan-y;
}

/* Ocultar botón de corregir posición y coordenadas */
.fix-coords {
  display: none !important;
}

/* En móviles, hacer el popup más grande y scrolleable */
@media (max-width: 600px) {
  .leaflet-popup-content-wrapper {
    max-height: 50vh;
    max-width: 85vw !important;
  }
  
  .leaflet-popup-content {
    width: auto !important;
    max-width: 100%;
  }
}

body {
  display: flex;
  flex-direction: column;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  height: 100vh;
}
header {
  padding: 15px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
header h1 {
  margin: 0;
  font-size: 1.3rem;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* PROFESOR: AÑADIDO - Media Query para hacer el HEADER responsivo en pantallas pequeñas */
@media (max-width: 600px) {
  header {
    flex-direction: column; /* Apila el título y el selector de idioma */
  }

  .toolbar{ /* También incluye tu antiguo .toolbar para apilarlo verticalmente */
    flex-direction: column;
  }
  
  .splash-title {
    font-size: 1.3rem;
  }
  
  .splash-logo {
    max-width: 180px !important;
  }
  
  .splash-inner {
    padding: 25px 20px;
    max-height: 85vh;
    overflow-y: auto;
  }
  
  .feature-cards {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .feature-card {
    padding: 20px;
  }
  
  .feature-card h3 {
    font-size: 1.1rem;
  }
  
  .feature-card p {
    font-size: 0.85rem;
    line-height: 1.5;
  }
  
  .steps {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }
  
  .step p {
    font-size: 0.85rem;
    line-height: 1.4;
  }
  
  .steps-section {
    margin-top: 25px;
    padding-top: 20px;
  }
  
  .hero-emoji {
    font-size: 2rem;
  }
  
  .btn {
    font-size: 0.95rem;
    padding: 10px 20px;
  }
}
/* FIN PROFESOR: AÑADIDO */

#map {
  flex: 1;
}
/* Make main a flex container so #map can flex to fill remaining space */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#map {
  flex: 1;
  min-height: 0;
  width: 100%;
}

#lang select {
  padding: 8px 12px;
  border-radius: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.2);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}
#lang select:hover {
  background: rgba(255,255,255,0.3);
}
#lang select option {
  background: #764ba2;
  color: white;
}
#lang label {
  color: white;
  font-weight: 600;
}

.leaflet-container {
  height: 100%;
  width: 100%;
}

/* Toolbar (Estilos de tu viejo toolbar) */
.toolbar {
  display: flex;
  gap: 8px;
  padding: 8px;
  background: #eee;
  align-items: center;
}
.toolbar input[type="search"] {
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* PROFESOR: AÑADIDO - INICIO de estilos para el nuevo menú RESPONSIVO (.topnav) */

/* toolbar responsive - Estilos base para el nuevo menú */
.topnav {
  overflow: hidden;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* MODIFICACIÓN: Estilos para botones del menú (topnav a) - Más interactivo y con transiciones */
.topnav a {
  float: left;
  display: block;
  color: #f2f2f2;
  text-align: center;
  padding: 12px 14px;
  text-decoration: none;
  font-size: 16px;
  transition: all 0.3s ease; /* Transición suave para el efecto de mouse */
  border-radius: 6px;  /* Bordes redondeados modernos */
  margin: 4px 5px;
  font-weight: 500;  
}

/* MODIFICACIÓN: Efecto al pasar el ratón (Hover) con brillo azul */
.topnav a:hover {
  background-color: rgba(255, 255, 255, 0.2); /* Fondo sutilmente visible */
  color: #fff; 
  box-shadow: 0 0 10px rgba(102, 126, 234, 0.8); /* Brillo azulado */
  transform: translateY(-1px); /* Pequeño movimiento sutil */
}

/* MODIFICACIÓN: Estilo para el botón de "Salir" (Logout) destacado */
#btnLogout {
    background-color: #e57373; /* Un rojo suave pero visible */
    color: white !important;
    border-radius: 20px; /* Completamente redondeado */
    padding: 10px 20px;
    font-weight: bold;
    margin: 4px 10px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

#btnLogout:hover {
    background-color: #d32f2f; /* Rojo más intenso al hacer hover */
    box-shadow: 0 0 12px rgba(229, 115, 115, 0.9);
    transform: none; 
}

/* Estilo para el enlace activo */
.topnav a.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.topnav .icon {
  display: none; /* Esconde el ícono de hamburguesa por defecto en escritorio */
}

.topnav .divSearch {
  padding: 8px 16px;
  float: left;
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.topnav .divSearch input {
  padding: 8px 12px;
  border-radius: 20px;
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: white;
  font-size: 14px;
  transition: all 0.3s ease;
}

.topnav .divSearch input::placeholder {
  color: rgba(255,255,255,0.7);
}

.topnav .divSearch input:focus {
  outline: none;
  background: rgba(255,255,255,0.2);
  border-color: #667eea;
}

.topnav .divSearch button {
  padding: 8px 16px;
  border-radius: 20px;
  border: none;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.topnav .divSearch button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* PROFESOR: AÑADIDO - Media Query 1 (Modo móvil: esconde enlaces, muestra ícono) */
@media screen and (max-width: 600px) {
  /* Esconde todos los enlaces (excepto el bloque de búsqueda) en móvil */
  .topnav a:not(:first-child) {display: none;}
  /* Muestra el ícono de hamburguesa */
  .topnav a.icon {
    float: right;
    display: block;
  }
}

/* PROFESOR: AÑADIDO - Media Query 2 (Menú desplegado al hacer click en el ícono) */
@media screen and (max-width: 600px) {
  .topnav.responsive {position: relative;}
  .topnav.responsive .icon {
    position: absolute;
    right: 0;
    top: 0;
  }
  /* Muestra y apila los enlaces, llenando el espacio */
  .topnav.responsive a {
    float: none;
    display: block;
    text-align: left;
  }
}
/* PROFESOR: AÑADIDO - FIN de estilos para el nuevo menú RESPONSIVO */


/* Continuación de tus estilos originales */
.btn {
  background: #fff;
  border: 1px solid #ccc;
  padding: 12px 24px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.btn.primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
}
.btn.primary i {
  margin-right: 8px;
  animation: rocketShake 2s infinite;
}
@keyframes rocketShake {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}
.btn.primary:active {
  transform: translateY(0);
}

/* Overlay panels (welcome & modal) */
.overlay {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  touch-action: none; /* para gestos en el fondo */
  z-index: 1000;
}
.overlay[aria-hidden="true"] {
  display: none;
}
.panel {
  background: #fff;
  padding: 30px;
  border-radius: 20px;
  width: min(540px, 96%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.4s ease-out;
  touch-action: pan-y; /* Permitir scroll vertical dentro del panel */
  -webkit-overflow-scrolling: touch; /* Scroll suave en iOS */
}

.panel-icon {
  font-size: 4rem;
  margin-bottom: 15px;
  color: #667eea;
}
.panel-icon i {
  animation: wave 1s ease-in-out;
}
@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(20deg); }
  75% { transform: rotate(-20deg); }
}

.panel h2 {
  margin-top: 0;
  color: #333;
  font-size: 1.6rem;
}

.panel p {
  color: #666;
  line-height: 1.6;
}

.panel label {
  display: block;
  margin: 16px 0;
  font-weight: 600;
  color: #555;
}

.panel label i {
  color: #667eea;
  margin-right: 5px;
}

.panel input[type="text"],
.panel select {
  width: 100%;
  padding: 12px;
  box-sizing: border-box;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.panel input[type="text"]:focus,
.panel select:focus {
  outline: none;
  border-color: #667eea;
}

.panel .actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}


/* MODIFICACIÓN: Estilo del Botón de Cerrar Modal (Sutil y Translucido) */
#modalClose {
    background: rgba(255, 255, 255, 0.9); /* Fondo blanco sutil */
    color: #333; /* Texto oscuro */
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 8px 15px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    z-index: 10; 
}

#modalClose:hover {
    background: rgba(240, 240, 240, 1); /* Un poco más sólido al pasar el ratón */
    color: #000;
}


/* Small responsiveness */
@media (max-width: 520px) {
  header h1 {
    font-size: 1rem;
  }
  .panel {
    padding: 12px;
  }
}

/* Splash screen styles */
.splash {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  z-index: 1300;
  transition: opacity 300ms ease, visibility 300ms;
  overflow-y: auto;
}
.splash[aria-hidden="true"] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.splash-inner {
  text-align: center;
  background: #fff;
  border-radius: 20px;
  padding: 40px 32px;
  max-width: 800px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.6s ease-out;
  max-height: 90vh;
  overflow-y: auto;
}
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hero Section */
.hero-section {
  margin-bottom: 30px;
}
.hero-emoji {
  font-size: 3rem;
  margin-bottom: 10px;
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.splash-logo {
  max-width: 280px;
  margin-bottom: 25px;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.15));
  animation: logoFadeIn 0.8s ease-out;
}
@keyframes logoFadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.splash-title {
  margin-bottom: 12px;
  font-size: 1.8rem;
  color: #333;
  line-height: 1.3;
  font-weight: bold;
}
.splash-title i {
  color: #667eea;
}
.splash-sub {
  color: #666;
  margin-bottom: 30px;
  font-size: 1.1rem;
  line-height: 1.6;
}

/* Feature Cards */
.feature-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}
.feature-card {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  padding: 24px;
  border-radius: 12px;
  transition: box-shadow 0.3s;
  cursor: default;
}
.feature-card:focus-visible {
  outline: 3px solid #667eea;
  outline-offset: 3px;
}
.feature-card:hover {
  transform: none;
  box-shadow: none;
}
.feature-card:nth-child(1) {
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}
.feature-card:nth-child(2) {
  background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
}
.feature-card:nth-child(3) {
  background: linear-gradient(135deg, #fbc2eb 0%, #a6c1ee 100%);
}
.card-icon {
  font-size: 3.5rem;
  margin-bottom: 15px;
  color: #333;
}
.card-icon i {
  display: inline-block;
  animation: iconPop 0.5s ease-out;
}
@keyframes iconPop {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}
.feature-card h3 {
  margin: 10px 0;
  color: #333;
  font-size: 1.15rem;
  line-height: 1.3;
}
.feature-card p {
  margin: 0;
  color: #555;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Steps Section */
.steps-section {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid #eee;
}
.steps-section h3 {
  color: #333;
  margin-bottom: 20px;
  font-size: 1.3rem;
}
.steps {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
}
.step {
  text-align: center;
  max-width: 180px;
}
.step-number {
  display: inline-block;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 50%;
  line-height: 50px;
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 10px;
}
.step p {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0;
}

/* Pulse animation for button */
.pulse {
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(102, 126, 234, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
  }
}

/* asegurar que el overlay esté por encima de otros elementos */
.overlay {
  z-index: 1200;
}

/* Estilos para el menú de árbol expandible de Actividades */
.activities-tree {
  margin-top: 20px;
}

.tree-item {
  margin-bottom: 12px;
  border: 2px solid #4db8e8;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(77, 184, 232, 0.1);
}

.tree-item:hover {
  box-shadow: 0 4px 12px rgba(77, 184, 232, 0.25);
  transform: translateY(-1px);
}

.tree-header {
  padding: 14px 16px;
  background: linear-gradient(135deg, #1e90ff 0%, #00bcd4 100%);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: white;
  transition: all 0.3s ease;
  user-select: none;
}

.tree-header:hover {
  background: linear-gradient(135deg, #4da6ff 0%, #33ccdd 100%);
  padding-left: 20px;
}

.tree-header i {
  transition: transform 0.3s ease;
  color: white;
  font-size: 14px;
}

.tree-item.open .tree-header i {
  transform: rotate(90deg);
}

.tree-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  padding: 0 16px;
  background: linear-gradient(to bottom, #f0f9ff 0%, #e0f7fa 100%);
}

.tree-item.open .tree-content {
  max-height: 2000px;
  padding: 16px;
  border-top: 2px solid #4db8e8;
}

.tree-content p {
  margin: 8px 0;
  line-height: 1.6;
  color: #333;
}

.tree-content h4 {
  margin-top: 12px;
  margin-bottom: 10px;
  color: #0277bd;
  font-size: 1.05rem;
  border-left: 4px solid #00bcd4;
  padding-left: 10px;
}

.tree-content ul {
  margin: 10px 0;
  padding-left: 20px;
}

.tree-content ul li {
  margin-bottom: 12px;
  line-height: 1.6;
  color: #444;
}

.tree-content em {
  color: #00838f;
  font-style: italic;
}

/* === ESTILOS PARA HISTORIA === */
.history-tree {
  margin-top: 20px;
}

.history-tree .tree-item.history-period {
  margin-bottom: 15px;
  border: 2px solid #daa520;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.history-tree .tree-item.history-period:hover {
  box-shadow: 0 4px 16px rgba(218, 165, 32, 0.3);
  transform: translateY(-2px);
}

/* Gradientes cálidos para cada período histórico */
.history-tree .tree-item:nth-child(1) .tree-header {
  background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%); /* Tierra/Marrón para pueblos originarios */
  color: white;
}

.history-tree .tree-item:nth-child(2) .tree-header {
  background: linear-gradient(135deg, #CD853F 0%, #DAA520 100%); /* Dorado/Tierra para colonización */
  color: white;
}

.history-tree .tree-item:nth-child(3) .tree-header {
  background: linear-gradient(135deg, #4682B4 0%, #5F9EA0 100%); /* Azul mar para balneario */
  color: white;
}

.history-tree .tree-item:nth-child(4) .tree-header {
  background: linear-gradient(135deg, #FF6B6B 0%, #FFA07A 100%); /* Coral vibrante para verticalización */
  color: white;
}

.history-tree .tree-item:nth-child(5) .tree-header {
  background: linear-gradient(135deg, #9370DB 0%, #BA55D3 100%); /* Púrpura para monumentos */
  color: white;
}

.history-tree .tree-item:nth-child(6) .tree-header {
  background: linear-gradient(135deg, #2F4F4F 0%, #696969 100%); /* Gris académico para referencia */
  color: white;
}

.history-tree .tree-header {
  cursor: pointer;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: bold;
  transition: all 0.3s ease;
}

.history-tree .tree-header:hover {
  opacity: 0.9;
  padding-left: 25px;
}

.history-tree .tree-header i {
  transition: transform 0.3s ease;
  font-size: 14px;
}

.history-tree .tree-item.open .tree-header i {
  transform: rotate(90deg);
}

.history-tree .tree-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
  padding: 0 20px;
  background: linear-gradient(to bottom, #fffdf7 0%, #fff9e6 100%);
}

.history-tree .tree-item.open .tree-content {
  max-height: 3000px;
  padding: 20px;
}

.history-tree .tree-content h4 {
  color: #8B4513;
  margin-top: 15px;
  margin-bottom: 10px;
  font-size: 15px;
  border-left: 4px solid #DAA520;
  padding-left: 10px;
}

.history-tree .tree-content p {
  margin-bottom: 12px;
  line-height: 1.7;
  color: #333;
  text-align: justify;
}

.history-tree .tree-content ul {
  margin: 15px 0;
  padding-left: 25px;
}

.history-tree .tree-content ul li {
  margin-bottom: 12px;
  line-height: 1.7;
  color: #444;
}

.history-tree .tree-content strong {
  color: #8B4513;
}

.history-tree .tree-content em {
  color: #666;
  font-style: italic;
}

.history-tree .tree-content table {
  margin-top: 15px;
  font-size: 14px;
}

.history-tree .tree-content table th {
  background-color: #DAA520;
  color: white;
  font-weight: bold;
}

.history-tree .tree-content table td {
  background-color: #fffdf7;
}

/* Efecto de rebote para marcadores */
.marker-bounce {
  animation: marker-bounce 0.7s ease;
  transform-origin: center bottom;
}
@keyframes marker-bounce {
  0% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-18px);
  }
  50% {
    transform: translateY(0);
  }
  70% {
    transform: translateY(-8px);
  }
  100% {
    transform: translateY(0);
  }
}

/* === ESTILOS PARA VOCABULARIO === */
.vocab-container {
  margin-top: 20px;
}

/* --- Vocabulario: Categorías y Flashcards --- */
.vocab-category {
  margin-bottom: 30px;
}

.vocab-category h3 {
  color: #2e7d32;
  font-size: 20px;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 3px solid #66bb6a;
}

.flashcards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

/* Flashcard con efecto de volteo 3D */
.flashcard {
  perspective: 1000px;
  height: 110px;
  cursor: pointer;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}

.flashcard-front > span,
.flashcard-back > span {
  display: block;
  width: 100%;
  padding: 0 30px;
}

/* Tarjeta frontal (español) con gradiente verde */
.flashcard-front {
  background: linear-gradient(135deg, #43a047 0%, #66bb6a 100%);
  color: white;
}

.flashcard-back {
  background: linear-gradient(135deg, #1e88e5 0%, #42a5f5 100%);
  color: white;
  transform: rotateY(180deg);
}

.flashcard:hover .flashcard-inner {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Animación suave al cargar */
.flashcard {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.flashcard:nth-child(1) { animation-delay: 0.05s; }
.flashcard:nth-child(2) { animation-delay: 0.1s; }
.flashcard:nth-child(3) { animation-delay: 0.15s; }
.flashcard:nth-child(4) { animation-delay: 0.2s; }
.flashcard:nth-child(5) { animation-delay: 0.25s; }
.flashcard:nth-child(6) { animation-delay: 0.3s; }
.flashcard:nth-child(7) { animation-delay: 0.35s; }
.flashcard:nth-child(8) { animation-delay: 0.4s; }
.flashcard:nth-child(9) { animation-delay: 0.45s; }

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

/* --- Test de Vocabulario --- */
.test-button {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
  color: white;
  border: none;
  padding: 12px 30px;
  font-size: 18px;
  font-weight: bold;
  border-radius: 25px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(238, 90, 111, 0.3);
  transition: all 0.3s ease;
  margin: 10px;
}

.test-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(238, 90, 111, 0.4);
}

.test-progress {
  text-align: center;
  font-size: 16px;
  color: #666;
  margin-bottom: 30px;
  font-weight: bold;
}

.test-question {
  text-align: center;
  margin: 40px 0;
}

.test-question h3 {
  color: #2e7d32;
  font-size: 22px;
  margin-bottom: 20px;
}

.test-word {
  font-size: 36px;
  font-weight: bold;
  color: #1e88e5;
  padding: 20px;
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border-radius: 15px;
  margin: 0 auto;
  max-width: 400px;
}

.test-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin: 30px 0;
  max-width: 600px;
  margin: 30px auto;
}

.test-option {
  background: white;
  border: 3px solid #e0e0e0;
  padding: 20px;
  font-size: 20px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #333;
}

.test-option:hover:not(:disabled) {
  border-color: #1e88e5;
  background: #e3f2fd;
  transform: scale(1.05);
}

.test-option.correct {
  background: linear-gradient(135deg, #43a047 0%, #66bb6a 100%);
  border-color: #2e7d32;
  color: white;
  animation: correctAnswer 0.5s ease;
}

.test-option.incorrect {
  background: linear-gradient(135deg, #e53935 0%, #ef5350 100%);
  border-color: #c62828;
  color: white;
  animation: shake 0.5s ease;
}

@keyframes correctAnswer {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

/* Resultados del test */
.test-results {
  text-align: center;
  padding: 30px;
}

.result-medal {
  font-size: 80px;
  margin: 20px 0;
  animation: bounce 2s infinite;
}

.result-level {
  font-size: 28px;
  font-weight: bold;
  color: #2e7d32;
  margin: 15px 0;
}

.result-score {
  font-size: 24px;
  color: #555;
  margin: 10px 0;
}

.result-percentage {
  font-size: 48px;
  font-weight: bold;
  background: linear-gradient(135deg, #43a047 0%, #66bb6a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 20px 0;
}

.result-message {
  font-size: 22px;
  color: #1e88e5;
  margin: 20px 0;
  font-weight: 600;
}

.new-record {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #ff6b00;
  padding: 15px 30px;
  border-radius: 25px;
  font-size: 20px;
  font-weight: bold;
  margin: 25px auto;
  max-width: 400px;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.result-actions {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}