/* CSS COMPLETO - Trivial con nueva cabecera horizontal */

/* Reset y layout principal */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: #181818;
  color: #fff;
  font-family: 'Segoe UI', Arial, sans-serif;
  min-height: 100vh;
}

.main-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Header con título y botones */
.header-central {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 30px 0 20px 0;
}

h1 {
  margin: 0 0 15px 0;
  letter-spacing: 2px;
  font-size: 2em;
  text-shadow: 1px 2px 8px #0008;
  text-align: center;
}

.botonera-header {
  display: flex;
  gap: 2em;
  justify-content: center;
  align-items: center;
}

.btn {
  padding: 10px 20px;
  font-size: 1.1em;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary {
  background-color: #4A90E2;
  color: white;
}

.btn-primary:hover {
  background-color: #3A70C2;
}

.btn-secondary {
  background-color: #f0ad4e;
  color: #222;
}

.btn-secondary:hover {
  background-color: #ec971f;
}

.btn:disabled {
  background: #888;
  color: #fff;
  cursor: not-allowed;
}

#imagenPregunta {
  display: block;       /* Para que margin auto funcione */
  margin: 10px auto 0;  /* Centra horizontalmente y añade margen arriba */
  max-width: 100%;
  max-height: 150px;
}

/* ==== NUEVA CABECERA HORIZONTAL ==== */
.game-header {
  display: flex;
  align-items: flex-start;
  padding: 20px 16px 12px 16px;
  background: #2a2a2a;
  box-shadow: 0 2px 8px #0003;
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1200px;
  box-sizing: border-box;
  border-radius: 12px;
  margin-bottom: 20px;
}

.dice-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-right: 24px;
  background: #333;
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 2px 8px #0004;
}

.dice {
  width: 50px;
  height: 50px;
  background: #fff;
  border: 3px solid #4A90E2;
  border-radius: 12px;
  font-size: 2rem;
  color: #4A90E2;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px #4A90E222;
  font-weight: bold;
}

.roll-btn {
  background: #4A90E2;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
  box-shadow: 0 1px 4px #4A90E222;
}

.roll-btn:hover {
  background: #3A70C2;
}

.roll-btn:disabled {
  background: #666;
  cursor: not-allowed;
}

.players-scroll {
  display: flex;
  overflow-x: auto;
  gap: 16px;
  padding-bottom: 8px;
  flex: 1;
}

.player-card {
  display: flex;
  align-items: center;
  background: #333;
  border-radius: 14px;
  box-shadow: 0 2px 8px #0003;
  padding: 8px 16px 8px 8px;
  min-width: 130px;
  max-width: 200px;
  border: 2px solid transparent;
  transition: box-shadow 0.2s, border 0.2s, transform 0.2s;
  margin-right: 0;
}

.player-card.active {
  border: 2.5px solid #4A90E2;
  box-shadow: 0 4px 16px #4A90E233;
  transform: scale(1.05);
}

.player-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 12px;
  border: 2px solid #555;
  background: #f0f0f0;
}

.player-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.player-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 4px;
  color: #fff;
}

.quesito {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2.5px solid #555;
  margin-top: 2px;
  box-shadow: 0 1px 4px #0003;
}

/* Colores de quesitos */
.quesito-blue { background: #4A90E2; border-color: #3A70C2; }
.quesito-red { background: #e74c3c; border-color: #c0392b; }
.quesito-green { background: #27ae60; border-color: #1e8449; }
.quesito-yellow { background: #f1c40f; border-color: #b7950b; }
.quesito-pink { background: #e056fd; border-color: #be2edd; }

/* Scrollbar bonito para horizontal */
.players-scroll::-webkit-scrollbar {
  height: 6px;
}
.players-scroll::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 4px;
}
.players-scroll::-webkit-scrollbar-track {
  background: transparent;
}

/* Mensajes centrados */
.mensajes-centro {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 10px 0;
  min-height: 60px;
}

#resultadoDado {
  font-size: 2em;
  font-weight: bold;
  color: #4A90E2;
}

#mensajeMovimiento {
  color: #f0ad4e;
  font-weight: bold;
  text-align: center;
  margin-top: 10px;
}

/* ==== ZONA DE JUEGO ==== */
.zona-juego {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  width: 100%;
}

.tablero-panel {
  display: flex;
  justify-content: center;
  align-items: center;
}

.tablero-container {
  position: relative;
  width: 90vw;
  max-width: 600px;
  aspect-ratio: 1/1;
  background: #111;
  border-radius: 50%;
  box-shadow: 0 0 40px #000a;
  overflow: hidden;
}

.tablero-img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  user-select: none;
  pointer-events: none;
}

.casilla {
  position: absolute;
  width: 5%;
  aspect-ratio: 1/1;
  border-radius: 50%;
  background: transparent;
  border: 2px solid rgba(255,255,255,0.5);
  box-shadow: 0 0 8px 2px rgba(255,255,0,0.2);
  cursor: pointer;
  transition: background 0.2s, border 0.2s, box-shadow 0.2s, transform 0.1s, opacity 0.2s;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.1em;
  color: #222;
  opacity: 0;
}

.casilla:hover, .casilla:focus {
  background: rgba(0,255,255,0.5);
  border: 2.5px solid #fff;
  box-shadow: 0 0 16px 4px #0ffb;
  opacity: 1;
  transform: scale(1.12);
  outline: none;
}

.casilla.activa {
  background: rgba(0,255,0,0.7);
  border: 2.5px solid #fff;
  box-shadow: 0 0 20px 6px #0f0b;
  opacity: 1;
  transform: scale(1.15);
}

.ficha-jugador {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  position: absolute;
  border: 2px solid #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.8em;
  color: white;
  font-weight: bold;
  z-index: 10;
  box-shadow: 1px 1px 3px rgba(0,0,0,0.5);
  transition: transform 0.3s ease-in-out;
  background-color: #007bff;
}

#ficha-jugador-1 { background-color: #007bff; }
#ficha-jugador-2 { background-color: #dc3545; }
#ficha-jugador-3 { background-color: #e056fd; }
#ficha-jugador-4 { background-color: #27ae60; }
#ficha-jugador-5 { background-color: #f1c40f; }

/* ==== MODALES ==== */
#modalPregunta, #modalPartida {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.65);
  z-index: 110;
  align-items: center;
  justify-content: center;
}

#modalPregunta.active, #modalPartida.active {
  display: flex;
}

.modal-content {
  background: #fff;
  color: #222;
  padding: 32px 28px 24px 28px;
  border-radius: 18px;
  min-width: 320px;
  max-width: 90vw;
  box-shadow: 0 8px 32px #000a;
  position: relative;
  text-align: center;
}

#modalPregunta .pregunta-icon {
  max-width: 120px;
  margin-bottom: 20px;
}

#textoPregunta {
  font-size: 1.2em;
  margin-bottom: 20px;
}

#opcionesRespuesta {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-top: 20px;
}

.btn-opcion {
  margin: 8px 0;
  background: #eee;
  color: #333;
  padding: 12px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
  transition: background-color 0.2s;
}

.btn-opcion:hover {
  background-color: #ddd;
}

#feedbackRespuesta {
  margin-top: 20px;
  text-align: center;
  font-weight: bold;
}

#btnCerrar {
  background: #4A90E2;
  color: #fff;
  padding: 10px 22px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  margin-top: 24px;
  transition: background-color 0.2s;
}

#btnCerrar:hover {
  background-color: #3A70C2;
}

/* Drag and drop */
#drag-drop-area {
  border: 2px dashed #aaa;
  padding: 20px;
  text-align: center;
  margin-bottom: 18px;
  cursor: pointer;
  border-radius: 8px;
  background-color: #f9f9f9;
  transition: all 0.3s ease;
}

#drag-drop-area:hover {
  border-color: #1976d2;
  background-color: #e3f2fd;
}

#drag-drop-area.highlight {
  border-color: #1976d2;
  background-color: #e3f2fd;
  transform: scale(1.02);
}

#modalPartida #drag-drop-area {
  border: 2.5px dashed #1976d2;
  background: #e3f2fd;
  color: #0d47a1;
  font-size: 1.1em;
  font-weight: bold;
  margin-bottom: 16px;
  border-radius: 12px;
  padding: 28px 10px;
  transition: background 0.2s, border-color 0.2s;
  box-shadow: 0 2px 12px #1976d255;
}

#modalPartida #drag-drop-area.highlight,
#modalPartida #drag-drop-area:hover {
  background: #bbdefb;
  border-color: #0d47a1;
  color: #0d47a1;
}

/* ==== LEYENDAS (ABAJO) ==== */
#leyendas {
  margin-top: auto;
  padding: 20px 0;
  width: 100%;
}

#leyendas-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  max-width: 600px;
  margin: 0 auto;
}

/* ==== RESPONSIVE ==== */
@media (max-width: 768px) {
  .game-header {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 8px 8px 8px;
  }

  .dice-container {
    flex-direction: row;
    margin-right: 0;
    margin-bottom: 12px;
    justify-content: flex-start;
    padding: 8px 12px;
  }

  .dice {
    width: 40px;
    height: 40px;
    font-size: 1.6rem;
    margin-right: 12px;
    margin-bottom: 0;
  }

  .roll-btn {
    font-size: 0.8rem;
    padding: 5px 10px;
  }

  .players-scroll {
    gap: 10px;
    padding-bottom: 4px;
  }

  .player-card {
    min-width: 110px;
    max-width: 160px;
    padding: 6px 10px 6px 6px;
  }

  .player-avatar {
    width: 32px;
    height: 32px;
    margin-right: 8px;
  }

  .player-name {
    font-size: 0.9rem;
  }

  .quesito {
    width: 18px;
    height: 18px;
  }

  .botonera-header {
    gap: 1em;
  }

  .btn {
    padding: 8px 16px;
    font-size: 1em;
  }
}

@media (max-width: 600px) {
  h1 { 
    font-size: 1.5em; 
    margin-bottom: 10px;
  }
  
  .tablero-container { 
    max-width: 95vw; 
  }

  .game-header {
    margin-bottom: 10px;
  }

  .botonera-header {
    flex-direction: column;
    gap: 0.5em;
  }
}

/* Ocultar elementos obsoletos */
.jugadores-panel,
.jugador {
  display: none !important;
}

       /* Navegación de imágenes */
        .footer1 {
            display: flex;
            justify-content: center;
            align-items: center;
            margin: 20px 0;
            padding: 20px;
        }

        .navigation-images {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 20px;
        }

        .volver, .mostro-imagen {
            width: 100px;
            height: auto;
            transition: transform 0.3s ease;
        }

        .volver:hover, .mostro-imagen:hover {
            transform: scale(1.1);
        }
		
		
		/* Estilos generales para todos los modales (si no los tienes ya, si los tienes, solo verifica que sean compatibles) */
.modal {
  display: none; /* Oculto por defecto */
  position: fixed; /* Fijo en la pantalla */
  z-index: 1000; /* Por encima de todo lo demás */
  left: 0;
  top: 0;
  width: 100%; /* Cubre toda la pantalla */
  height: 100%;
  overflow: auto; /* Habilita scroll si el contenido es demasiado grande */
  background-color: rgba(0,0,0,0.8); /* Fondo oscuro semitransparente */
  justify-content: center; /* Centrar contenido */
  align-items: center; /* Centrar contenido */
}

.modal.active {
  display: flex; /* Muestra el modal */
}

/* Estilos específicos para el contenido del modal de imagen */
.modal-content-imagen {
  background-color: #fefefe; /* Fondo claro para el contenido */
  margin: auto; /* Centrar vertical y horizontalmente */
  padding: 20px;
  border: 1px solid #888;
  width: 80%; /* Ancho del modal */
  max-width: 800px; /* Ancho máximo para pantallas grandes */
  box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
  animation-name: animatetop;
  animation-duration: 0.4s;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  max-height: 90vh; /* Para que no ocupe más del 90% del alto de la vista */
}

.modal-content-imagen img {
  max-width: 100%;
  max-height: 75vh; /* Ajusta la altura máxima para dejar espacio para el botón de cerrar */
  display: block; /* Elimina espacio extra debajo de la imagen */
  object-fit: contain; /* Asegura que la imagen se ajuste sin distorsión */
}

/* Botón de cerrar */
.close-button {
  color: #aaa;
  position: absolute;
  top: 10px;
  right: 25px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-button:hover,
.close-button:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

/* Animación de entrada (opcional) */
@keyframes animatetop {
  from {top: -300px; opacity: 0}
  to {top: 0; opacity: 1}
}

/* Media queries para pantallas más pequeñas (opcional, pero recomendado) */
@media (max-width: 768px) {
  .modal-content-imagen {
    width: 95%;
  }
}

#modalImagen.modal.active {
  display: flex !important;
  z-index: 2000 !important;
}

#modalImagen {
  z-index: 2000 !important;
}

.grupo-jugadores {
  margin-bottom: 24px;
  text-align: center;
}

.btn-jugador {
  background: #e3eafc;
  color: #1976d2;
  border: 2px solid #1976d2;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.3em;
  margin: 0 10px;
  margin-top: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, border 0.2s, color 0.2s;
  box-shadow: 0 2px 8px #1976d233;
  outline: none;
}

.btn-jugador.active, .btn-jugador:focus {
  background: #1976d2;
  color: #fff;
  border: 2.5px solid #0d47a1;
  box-shadow: 0 4px 16px #1976d255;
  transform: scale(1.12);
 
}

.grupo-mazo, .grupo-excel {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.grupo-botones {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 18px;
}

.grupo-excel label {
  display: block;
  margin-bottom: 12px;
  font-weight: 500;
  color: #1976d2;
}

#modalPartida .modal-content {
  border-radius: 18px;
  box-shadow: 0 8px 32px #1976d2aa;
  background: #f4f8ff;
  color: #222;
}

#modalPartida .descarga-plantilla {
  margin-top: 18px;
  margin-bottom: 0;
  text-align: center;
}

/* ESTILOS PARA EL INFORME */
.modal-informe {
display: flex;
  flex-direction: column;
  max-height: 90vh; /* Limita la altura del modal */
}

.informe-header {
flex-shrink: 0; /* No se encoge */
  position: sticky;
  top: 0;
  background: white;
  z-index: 10;
  border-bottom: 1px solid #ddd;
}

.informe-header h2 {
  margin: 0;
  color: #2c3e50;
  font-size: 1.5em;
}

.btn-cerrar-informe {
  background: none;
  border: none;
  font-size: 24px;
  color: #6c757d;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.btn-cerrar-informe:hover {
  color: red;
}

.contenido-informe {
flex: 1;
  overflow-y: auto;
  padding: 20px;
  max-height: calc(90vh - 200px); /* Deja espacio para header y footer */
}

.informe-jugador {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  border-left: 5px solid #4A90E2;
}

.informe-jugador.ganador {
  border-left-color: #28a745;
  background: #d4edda;
}

.informe-jugador h3 {
  margin: 0 0 15px 0;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 10px;
}

.corona-ganador {
  font-size: 1.2em;
}

.estadisticas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 15px;
}

.estadistica-item {
  background: white;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  text-align: center;
}

.estadistica-valor {
  font-size: 1.5em;
  font-weight: bold;
  color: #4A90E2;
  display: block;
}

.estadistica-label {
  font-size: 0.9em;
  color: #6c757d;
  margin-top: 4px;
}

.preguntas-falladas {
  margin-top: 15px;
}

.preguntas-falladas h4 {
  color: #dc3545;
  margin-bottom: 10px;
}

.pregunta-fallada {
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
}

.pregunta-fallada strong {
  color: #c53030;
}

.respuesta-correcta {
  color: #38a169;
  font-weight: bold;
}

.categorias-rendimiento {
  margin-top: 15px;
}

.categoria-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: white;
  border-radius: 6px;
  margin-bottom: 6px;
  border: 1px solid #e9ecef;
}

.categoria-color {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  margin-right: 8px;
}

.categoria-nombre {
  flex: 1;
}

.categoria-stats {
  font-weight: bold;
  color: #4A90E2;
}

.informe-acciones {
flex-shrink: 0; /* No se encoge */
  position: sticky;
  bottom: 0;
  background: white;
  padding: 15px 20px;
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: center;
  gap: 15px;
  z-index: 10;
}

.resumen-partida {
  background: #e3f2fd;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  border: 1px solid #bbdefb;
}

.resumen-partida h3 {
  color: #1565c0;
  margin: 0 0 15px 0;
}

.tiempo-partida {
  font-size: 1.1em;
  font-weight: bold;
  color: #1976d2;
}



@media (max-width: 768px) {
  .modal-informe {
    max-width: 95vw;
    margin: 10px;
  }
  
  .estadisticas-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .informe-acciones {
    flex-direction: column;
  }
}

/* Estilos para el pie de página del informe */
.informe-footer {
margin-top: 20px;
  text-align: center;
}

.informe-footer .footer-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Reglas específicas para impresión */
@media print {
    /* Ocultar la cabecera principal con botones */
    .header-central,
    .botonera-header {
        display: none !important;
    }

    /* Ocultar la nueva cabecera de juego (dado + jugadores) */
    .game-header {
        display: none !important;
    }

    /* Ocultar el tablero de juego */
    .tablero-container {
        display: none !important;
    }

    /* Ocultar el botón de cerrar y las acciones del informe que no son imprimir */
    .btn-cerrar-informe,
    .informe-acciones { /* Si el botón de imprimir está dentro de informe-acciones, tendrás que ajustar esto */
        display: none !important;
    }
    /* Si tienes un botón específico de imprimir que quieres mantener, asegúrate de que no tenga estas clases */


    /* Asegurar que solo se imprima el contenido del informe y ajustarlo */
    body > *:not(#modalInforme) { /* Oculta todo lo que no sea el modal de informe */
        display: none !important;
    }
    #modalInforme {
        display: block !important; /* Asegura que el modal de informe sea visible */
        position: relative !important; /* Para que fluya con el documento */
        z-index: auto !important; /* Resetea el z-index */
        background-color: #fff; /* Fondo blanco para la impresión */
        color: #000; /* Texto negro para la impresión */
        width: 100% !important; /* Ocupa todo el ancho */
        max-width: none !important; /* Sin límite de ancho */
        box-shadow: none !important; /* Elimina sombras */
        border-radius: 0 !important; /* Sin bordes redondeados */
        margin: 0 !important; /* Sin márgenes */
        padding: 20px !important; /* Ajusta el padding si es necesario */
        top: auto !important; /* Elimina posición fija */
        left: auto !important; /* Elimina posición fija */
        transform: none !important; /* Anula cualquier transformación (como el centrado) */
        min-height: 100vh; /* Asegura que ocupe al menos una página completa */
    }

    .modal-content {
        background-color: #fff;
        border: none;
        box-shadow: none;
        width: 100%; /* Asegura que el contenido interno ocupe todo el ancho disponible */
    }

    /* Estilos para el pie de página del informe que se repite en cada página */
    .informe-footer {
        position: fixed; /* Fija el pie de página en cada página impresa */
        bottom: 0;
        left: 0;
        width: 100%;
        text-align: center;
        margin: 0;
        padding: 10px 0;
        border-top: 1px solid #ccc;
        background-color: #fff; /* Fondo blanco para asegurar visibilidad en impresión */
        /* Aseguramos que la imagen del pie de página sea visible */
        opacity: 1 !important;
        display: block !important;
    }

    .informe-footer .footer-image {
width: 100%;
  max-width: 100vw;
  display: block;
  margin: 0 auto;
    }
}


.informe-header {
  position: relative;
  padding: 20px 40px 10px 40px;
  text-align: center;
}

.botones-tipo-informe {
  display: inline-flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 10px;
  width: 100%;
}

.botones-tipo-informe button {
  margin-right: 10px;
}

.btn-cerrar-informe {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 28px;
  border: none;
  background: transparent;
  cursor: pointer;
}

/* Ajustes para el informe final */
.avatar-informe {
  width: 40px !important;
  height: 40px !important;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #ddd;
}

.jugador-info-informe {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nombre-jugador-informe {
  font-weight: bold;
  font-size: 14px;
}

/* Si también quieres ajustar otras imágenes del informe */
.resumen-partida img {
  max-width: 50px;
  max-height: 50px;
  object-fit: contain;
}


/* ESTILOS ADICIONALES PARA INFORMES MEJORADOS */

.botones-tipo-informe {
  display: flex;
  gap: 8px;
}

.btn-tipo {
  padding: 6px 12px;
  font-size: 0.9em;
  border-radius: 6px;
  border: 1px solid #ddd;
  background: #f8f9fa;
  color: #495057;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-tipo.active {
  background: #4A90E2;
  color: white;
  border-color: #4A90E2;
}

.btn-tipo:hover {
  background: #e9ecef;
}

.btn-tipo.active:hover {
  background: #3A70C2;
}

/* Informe Docente */
.informe-docente {
  color: #333;
}

.resumen-general {
  background: #e8f4fd;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  border-left: 4px solid #4A90E2;
}

.ganador-info {
  font-size: 1.2em;
  color: #28a745;
  margin-bottom: 10px;
}

.info-partida {
  display: flex;
  gap: 20px;
  font-size: 0.95em;
  color: #666;
}

.jugador-resumen {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid #e9ecef;
  transition: box-shadow 0.2s;
}

.jugador-resumen:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.jugador-resumen.ganador {
  border-left: 4px solid #28a745;
  background: #d4edda;
}

.jugador-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.jugador-header h5 {
  margin: 0;
  flex: 1;
  color: #2c3e50;
}

.btn-ver-individual {
  background: #4A90E2;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8em;
  cursor: pointer;
}

.btn-ver-individual:hover {
  background: #3A70C2;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.stat-item {
  text-align: center;
  background: white;
  padding: 8px 4px;
  border-radius: 6px;
  border: 1px solid #e9ecef;
}

.stat-valor {
  display: block;
  font-size: 1.2em;
  font-weight: bold;
  color: #4A90E2;
}

.stat-label {
  font-size: 0.8em;
  color: #666;
  margin-top: 2px;
}

.quesitos-ganados {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.quesito-mini {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid #ddd;
}

/* Estadísticas por categoría */
.estadisticas-categorias {
  background: #fff3cd;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  border-left: 4px solid #ffc107;
}

.categorias-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.categoria-stat {
  background: white;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.categoria-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.categoria-color {
  width: 16px;
  height: 16px;
  border-radius: 3px;
}

.categoria-nombre {
  font-weight: bold;
  color: #2c3e50;
}

.categoria-numeros {
  display: flex;
  justify-content: space-between;
  font-size: 0.9em;
}

.aciertos {
  color: #28a745;
}

.fallos {
  color: #dc3545;
}

.porcentaje {
  font-weight: bold;
  color: #4A90E2;
}

/* Preguntas más falladas */
.preguntas-mas-falladas {
  background: #f8d7da;
  padding: 20px;
  border-radius: 12px;
  border-left: 4px solid #dc3545;
}

.sin-fallos {
  text-align: center;
  color: #28a745;
  font-style: italic;
}

.pregunta-fallada-item {
  display: flex;
  gap: 12px;
  background: white;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid #f5c6cb;
}

.pregunta-numero {
  background: #dc3545;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9em;
  flex-shrink: 0;
}

.pregunta-contenido {
  flex: 1;
}

.pregunta-texto {
  font-weight: bold;
  margin-bottom: 6px;
  color: #2c3e50;
}

.pregunta-info {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 0.9em;
}

.categoria {
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8em;
}

.respuesta-correcta {
  color: #28a745;
  font-weight: bold;
}

.fallos-count {
  color: #dc3545;
  font-weight: bold;
}

/* Informe Alumno */
.informe-alumno {
  color: #333;
}

.cabecera-alumno {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, #4A90E2, #3A70C2);
  color: white;
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 24px;
}

.avatar-grande {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid white;
  object-fit: cover;
}

.info-alumno h3 {
  margin: 0 0 8px 0;
  font-size: 1.4em;
}

.mensaje-ganador {
  background: rgba(255,255,255,0.2);
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: bold;
}

.estadisticas-personales {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 24px;
}

.stats-grid-alumno {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.stat-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  border: 2px solid #e9ecef;
  transition: transform 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-card.correctas {
  border-color: #28a745;
  background: #d4edda;
}

.stat-card.incorrectas {
  border-color: #dc3545;
  background: #f8d7da;
}

.stat-card.porcentaje {
  border-color: #4A90E2;
  background: #e8f4fd;
}

.stat-numero {
  font-size: 2em;
  font-weight: bold;
  color: #2c3e50;
}

.stat-texto {
  font-size: 0.9em;
  color: #666;
  margin-top: 4px;
}

.quesitos-conseguidos {
  background: #fff3cd;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 24px;
}

.progreso-quesitos {
  margin-bottom: 16px;
}

.progreso-texto {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
  color: #2c3e50;
}

.barra-progreso {
  width: 100%;
  height: 20px;
  background: #e9ecef;
  border-radius: 10px;
  overflow: hidden;
}

.progreso-fill {
  height: 100%;
  background: linear-gradient(90deg, #28a745, #20c997);
  transition: width 0.3s ease;
}

.quesitos-detalle {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}

.quesito-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: white;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.quesito-item.conseguido {
  background: #d4edda;
  border-color: #28a745;
}

.quesito-item.pendiente {
  background: #f8f9fa;
  border-color: #dee2e6;
  opacity: 0.7;
}

.quesito-color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid #ddd;
}

.estado {
  margin-left: auto;
}

.rendimiento-categorias {
  background: #e8f4fd;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 24px;
}

.rendimiento-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rendimiento-item {
  background: white;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.rendimiento-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.rendimiento-barra {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.barra-fondo {
  flex: 1;
  height: 12px;
  background: #e9ecef;
  border-radius: 6px;
  overflow: hidden;
}

.barra-progreso {
  height: 100%;
  background: linear-gradient(90deg, #4A90E2, #3A70C2);
  transition: width 0.3s ease;
}

.porcentaje-texto {
  font-weight: bold;
  color: #4A90E2;
  min-width: 40px;
}

.rendimiento-numeros {
  font-size: 0.9em;
  color: #666;
}

.preguntas-falladas-alumno {
  background: #f8d7da;
  padding: 20px;
  border-radius: 12px;
}

.ayuda-texto {
  color: #721c24;
  font-style: italic;
  margin-bottom: 16px;
}

.pregunta-fallada-detalle {
  display: flex;
  gap: 12px;
  background: white;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 12px;
  border: 1px solid #f5c6cb;
}

.respuestas-comparacion {
  display: flex;
  gap: 16px;
  margin: 8px 0;
  font-size: 0.9em;
}

.tu-respuesta {
  color: #dc3545;
}

.categoria-pregunta {
  margin-top: 8px;
}

/* Responsive para informes */
@media (max-width: 768px) {
  .cabecera-alumno {
    flex-direction: column;
    text-align: center;
  }
  
  .stats-grid-alumno {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .categorias-grid {
    grid-template-columns: 1fr;
  }
  
  .respuestas-comparacion {
    flex-direction: column;
    gap: 4px;
  }
  
  .botones-tipo-informe {
    order: -1;
    margin-bottom: 10px;
  }
  
  .informe-header {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Selector de alumno */
.selector-alumno {
  text-align: center;
  padding: 40px 20px;
}

.lista-alumnos {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 500px;
  margin: 0 auto;
}

.alumno-selector {
  display: flex;
  align-items: center;
  gap: 16px;
  background: white;
  padding: 16px;
  border-radius: 12px;
  border: 2px solid #e9ecef;
  cursor: pointer;
  transition: all 0.2s;
}

.alumno-selector:hover {
  border-color: #4A90E2;
  box-shadow: 0 2px 8px rgba(74, 144, 226, 0.2);
  transform: translateY(-1px);
}

.avatar-selector {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ddd;
}

.info-selector {
  flex: 1;
  text-align: left;
}

.info-selector h4 {
  margin: 0 0 4px 0;
  color: #2c3e50;
}

.stats-rapidas {
  display: flex;
  gap: 12px;
  font-size: 0.9em;
  color: #666;
}

.flecha {
  font-size: 1.5em;
  color: #4A90E2;
}


/* Clases para el informe Docente/Alumno */
.solo-docente {
    /* Por defecto visible si no está oculto por JS */
    display: block;
}

.oculto-alumno {
    /* Esta clase oculta los elementos para la vista de alumno */
    display: none !important;
}

/* Estilos para los botones de tipo de informe (Docente/Alumno) */
.botones-tipo-informe {
    display: flex;
    gap: 10px;
    margin-bottom: 20px; /* Espacio debajo de los botones */
    margin-top: 10px; /* Espacio encima de los botones */
}

.btn-tipo {
    padding: 8px 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f0f0f0;
    color: #333;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
}

.btn-tipo.active {
    background-color: #4A90E2; /* Color activo */
    color: white;
    border-color: #4A90E2;
}

.btn-tipo:hover:not(.active) {
    background-color: #e0e0e0;
}

#contenidoInforme, .contenido-informe {
  max-height: 70vh; /* o un valor alto para que quepa */
  overflow-y: auto; /* permite scroll vertical si el contenido es grande */
  padding: 10px;
  box-sizing: border-box;
}

.tabla-resultados {
  width: 100%; /* Asegura que la tabla ocupe todo el ancho disponible */
  border-collapse: collapse; /* Elimina el espacio entre celdas */
  margin-top: 20px; /* Espacio superior */
  margin-bottom: 20px; /* Espacio inferior */
}

.tabla-resultados th,
.tabla-resultados td {
  border: 1px solid #ddd; /* Borde para las celdas */
  padding: 8px; /* Espaciado interno */
  text-align: center; /* ¡Esto centra el contenido! */
  vertical-align: middle; /* Centra verticalmente también */
}

.tabla-resultados th {
  background-color: #f2f2f2; /* Fondo para las cabeceras */
  font-weight: bold;
}

/* Estilos para las filas impares (opcional, para mejor legibilidad) */
.tabla-resultados tbody tr:nth-child(odd) {
  background-color: #f9f9f9;
}

/* Estilo para el nombre del jugador si quieres que sea negrita y no se centre */
.tabla-resultados td:first-child {
  text-align: left; /* Alinea el nombre del jugador a la izquierda */
  font-weight: bold;
}