/* Importar tipografía XuntaSans */
@font-face {
    font-family: 'XuntaSans';
    src: url('XuntaSans-Web/woff2/XuntaSans-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'XuntaSans';
    src: url('XuntaSans-Web/woff2/XuntaSans-Bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'XuntaSans';
    src: url('XuntaSans-Web/woff2/XuntaSans-Italic.woff2') format('woff2');
    font-weight: normal;
    font-style: italic;
}

@font-face {
    font-family: 'XuntaSans';
    src: url('XuntaSans-Web/woff2/XuntaSans-BoldItalic.woff2') format('woff2');
    font-weight: bold;
    font-style: italic;
}

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

body {
    font-family: 'XuntaSans', Arial, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

.pantalla {
    display: none;
    min-height: 100vh;
    position: relative;
}

.pantalla.activa {
    display: block;
}

/* Asegurar que solo una pantalla esté visible */
.pantalla:not(.activa) {
    display: none !important;
}

/* Logo de fondo difuminado en la portada */
.portada-logo-fondo {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    opacity: 0.08;
    pointer-events: none;
}

.portada-logo-fondo .logo-fondo {
    width: 600px;
    height: auto;
    filter: brightness(0.3) saturate(50%) hue-rotate(200deg);
}

/* Logo de Lua en la portada */
.logo-lua-portada {
    text-align: center;
    margin: -120px auto 20px auto;
    width: 100%;
    max-width: 300px;
    z-index: 2;
}

.logo-lua-portada p {
    color: #007bc4;
    font-size: 16px;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.logo-lua-portada-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    transition: all 0.3s ease;
    border: 2px solid #007bc4;
    box-shadow: 0 4px 15px rgba(0,123,196,0.3);
    padding: 8px;
    background: white;
}

.logo-lua-portada-img:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,123,196,0.4);
    border-color: #005a8b;
}


/* Pantalla de portada */
.portada-container {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: transparent;
    color: #007bc4;
    padding: 20px;
    z-index: 2;
    text-align: center;
    padding-top: 200px;
}

.btn-principal {
    position: relative;
    z-index: 2;
    background: #007bc4;
    color: #ffffff;
    border: 3px solid #002b4a;
    padding: 15px 40px;
    font-size: 24px;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    margin-bottom: 100px;
    overflow: hidden;
}

.btn-principal::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn-principal:hover::before {
    left: 100%;
}

.btn-principal:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.4);
}



/* Header común */
.header {
    background: #002b4a;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border-bottom: 3px solid #007bc4;
}


.logo-header {
    height: 45px;
    width: auto;
}

/* Logo de la Xunta más pequeño */
.logo-header[src*="marca-negativo"] {
    height: 40px;
    width: auto;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.2));
}

/* Logo de úlceras fora más grande */
.logo-header[src*="ulcerasfora"] {
    height: 50px;
    width: auto;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.2));
}

.header h1 {
    color: #ffffff;
    font-size: 28px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Contenedor común para botones y logo en portada */
.contenedor-portada {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 350px;
    margin: 0 auto;
    width: 100%;
    max-width: 450px;
    z-index: 2;
    text-align: center;
}

/* Botones de idioma en portada */
.botones-idioma {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
    margin-bottom: 30px;
}


/* Botón de ranking */
.btn-ranking {
    background: #007bc4;
    color: #ffffff;
    border: 3px solid #002b4a;
    padding: 20px 60px;
    font-size: 20px;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    width: 100%;
    max-width: 450px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.btn-ranking::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-ranking:hover::before {
    left: 100%;
}

.btn-ranking:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 35px rgba(0,0,0,0.4);
    background: #005a8b;
}

.btn-icon {
    font-size: 24px;
}

.btn-text {
    font-weight: bold;
}


.btn-idioma {
    background: #007bc4;
    color: #ffffff;
    border: 3px solid #002b4a;
    padding: 20px 60px;
    font-size: 20px;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    width: 100%;
    max-width: 450px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn-idioma::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-idioma:hover::before {
    left: 100%;
}

.btn-idioma:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 35px rgba(0,0,0,0.4);
    background: #005a8b;
}

/* Pantalla de datos del jugador */
.datos-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
    gap: 30px;
    padding: 20px;
    position: relative;
    z-index: 2;
}

/* Logo de fondo para la pantalla de datos */
#datosJugador .portada-logo-fondo {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    opacity: 0.08;
    pointer-events: none;
}

#datosJugador .portada-logo-fondo .logo-fondo {
    width: 600px;
    height: auto;
    filter: brightness(0.3) saturate(50%) hue-rotate(200deg);
}



.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 400px;
}

.input-group label {
    color: #007bc4;
    font-size: 18px;
    font-weight: bold;
}

.input-group input,
.input-group select {
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    background: rgba(255,255,255,0.9);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.select-dificultad {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23007bc4' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.input-group input:focus {
    outline: none;
    box-shadow: 0 4px 20px rgba(52, 152, 219, 0.5);
}


/* Botón de catálogo de apósitos */
.btn-catalogo {
    background: white;
    color: #007bc4;
    border: 2px solid #007bc4;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,123,196,0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 245px;
    min-width: 245px;
    max-width: 245px;
    height: 60px;
    text-align: center;
    overflow: hidden;
    margin: 5px;
}

.btn-catalogo::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn-catalogo:hover::before {
    left: 100%;
}

.btn-catalogo:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,123,196,0.4);
    background: #f8fafc;
    border-color: #005a8b;
}

.btn-catalogo-texto {
    font-size: 14px;
    line-height: 1.2;
    font-weight: bold;
}

/* Pantalla del juego */
.jugador-info {
    background: linear-gradient(135deg, #f8fafc 0%, #e3f2fd 100%);
    color: #007bc4;
    padding: 15px 20px;
    margin: 10px 20px;
    border: 2px solid #007bc4;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,123,196,0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.info-group {
    display: flex;
    gap: 5px;
    align-items: center;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 120px;
}

.info-item.puntuacion {
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px solid #007bc4;
    box-shadow: 0 2px 8px rgba(0,123,196,0.3);
    width: 120px;
    min-width: 120px;
    max-width: 120px;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.info-item.jugador {
    flex: 1;
    max-width: 300px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.info-item.temporizador {
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px solid #007bc4;
    box-shadow: 0 2px 8px rgba(0,123,196,0.3);
    width: 120px;
    min-width: 120px;
    max-width: 120px;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.info-label {
    font-size: 14px;
    font-weight: 600;
    color: #007bc4;
    margin-bottom: 4px;
}

.info-value {
    font-size: 18px;
    font-weight: bold;
    color: #007bc4;
}

.jugador-nombre {
    font-size: 18px;
    font-weight: bold;
    color: #007bc4;
    margin-bottom: 2px;
}

.jugador-procedencia {
    font-size: 14px;
    color: #223355;
    font-style: italic;
}

.tiempo-display {
    font-size: 18px;
    font-weight: bold;
    color: #007bc4;
    font-family: 'Courier New', monospace;
}

.insignias-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 15px;
    background: #f8fafc;
    border: 2px solid #002b4a;
    border-radius: 10px;
    margin: 8px 15px;
}

.insignia {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.insignia-imagen {
    width: 35px;
    height: 35px;
    object-fit: contain;
    filter: brightness(0.7);
    transition: all 0.3s ease;
}

.insignia.ganada {
    animation: ganarInsignia 0.5s ease-in-out;
    transform: scale(1.1);
}

.insignia.fallada {
    animation: fallarInsignia 0.5s ease-in-out;
    transform: scale(1.1);
    border-color: #d32f2f !important;
}

.insignia.ganada .insignia-imagen {
    filter: brightness(1);
}

/* Efecto de zoom para la insignia que se está jugando */
.insignia.jugando {
    transform: scale(1.3);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    z-index: 10;
    animation: pulsoJugando 1.5s ease-in-out infinite;
}

.insignia.jugando .insignia-imagen {
    filter: brightness(1);
}

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

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

@keyframes pulsoJugando {
    0% { transform: scale(1.3); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1.3); }
}

.juego-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
    padding: 20px;
    gap: 30px;
    z-index: 10;
    width: 100%;
    margin: 0;
    text-align: center;
}

/* Fondo sutil del juego */
.juego-fondo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70vw;
    height: 70vh;
    z-index: 1;
    opacity: 0.05;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fondo-imagen {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0.2) saturate(20%) hue-rotate(200deg);
}

.columna-izquierda {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.columna-derecha {
    flex: 2;
    background: #f8fafc;
    border: 2px solid #002b4a;
    border-radius: 15px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.ruleta-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

#ruleta {
    border-radius: 50%;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    background: white;
    margin: 15px 0;
}

/* Estilos para la categoría seleccionada debajo de la ruleta */
#categoriaSeleccionadaVisual {
    text-align: center;
    margin: 25px 0;
}

#categoriaSeleccionadaVisual span {
    line-height: 1.3;
}

/* Logo de Lua en la pantalla del ranking */

.btn-ruleta {
    background: #007bc4;
    color: #ffffff;
    border: 2px solid #002b4a;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-ruleta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.btn-ruleta:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.categorias-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding: 12px;
    background: #f8fafc;
    border: 2px solid #002b4a;
    border-radius: 10px;
}

.categoria-item {
    padding: 8px 12px;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #002b4a;
    background: #007bc4;
    font-size: 14px;
}

.categoria-item:hover {
    transform: translateX(5px);
}

/* Estados de las categorías */
.categoria-item.eliminada {
    /* Categoría ganada - tachada en verde */
    opacity: 0.7;
    text-decoration: line-through;
    color: #2e7d32 !important;
    background: #e8f5e8 !important;
    border-color: #2e7d32 !important;
}

.categoria-item.fallada {
    /* Categoría fallada - tachada en rojo */
    opacity: 0.7;
    text-decoration: line-through;
    color: #d32f2f !important;
    background: #ffebee !important;
    border-color: #d32f2f !important;
}

/* Categorías "Tratamiento de heridas" falladas en fucsia (solo en la lista) */
.categoria-item.fallada.tratamiento-heridas {
    color: #e91e63 !important;
    background: #fce4ec !important;
    border-color: #e91e63 !important;
}

/* Caja de preguntas rediseñada */
.pregunta-container {
    width: 100%;
    max-width: min(750px, 90vw);
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,123,196,0.2);
    margin: 0 auto;
    border: 3px solid #007bc4;
    position: relative;
    z-index: 20;
    overflow: hidden;
    min-height: 200px;
}

.pregunta-header {
    background: linear-gradient(135deg, #007bc4 0%, #005a8b 100%);
    color: white;
    padding: 20px 30px;
    text-align: center;
    border-bottom: 3px solid #002b4a;
}

.pregunta-header h3 {
    color: white !important;
    font-size: 22px;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.pregunta-contenido {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.pregunta-texto {
    color: #007bc4;
    font-size: 18px;
    line-height: 1.6;
    text-align: center;
    font-weight: 600;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.respuestas-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
    align-items: stretch;
}

.btn-respuesta {
    background: linear-gradient(135deg, #f8fafc 0%, #e3f2fd 100%);
    color: #007bc4;
    border: 2px solid #007bc4;
    padding: 18px 25px;
    font-size: 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: 600;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    width: 100%;
    max-width: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,123,196,0.1);
    position: relative;
    overflow: hidden;
}

.btn-respuesta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.btn-respuesta:hover::before {
    left: 100%;
}

.btn-respuesta:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,123,196,0.3);
    border-color: #005a8b;
}

.btn-respuesta.correcta {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%) !important;
    color: white !important;
    border-color: #2e7d32 !important;
    box-shadow: 0 6px 20px rgba(76,175,80,0.4);
}

.btn-respuesta.incorrecta {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%) !important;
    color: white !important;
    border-color: #c62828 !important;
    box-shadow: 0 6px 20px rgba(244,67,54,0.4);
}

.btn-respuesta.seleccionada {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%) !important;
    color: white !important;
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(255,152,0,0.4);
    border-color: #e65100 !important;
    font-weight: bold;
}

.btn-respuesta.seleccionada .contenido-opcion span {
    color: white !important;
    font-weight: bold;
}



/* Pantalla de ranking */
.ranking-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
    gap: 30px;
    padding: 20px;
}

/* Fondo de la portada en el ranking */
#ranking .portada-logo-fondo {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    opacity: 0.08;
    pointer-events: none;
}

#ranking .portada-logo-fondo .logo-fondo {
    width: 600px;
    height: auto;
    filter: brightness(0.3) saturate(50%) hue-rotate(200deg);
}

/* Logo de Lua en la pantalla de ranking */
.logo-lua-ranking {
    text-align: center;
    margin: 20px auto 20px auto;
    width: 100%;
    max-width: 300px;
    z-index: 2;
}

.logo-lua-ranking p {
    color: #007bc4;
    font-size: 16px;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.logo-lua-ranking-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    transition: all 0.3s ease;
    border: 2px solid #007bc4;
    box-shadow: 0 4px 15px rgba(0,123,196,0.3);
    padding: 8px;
    background: white;
}

.logo-lua-ranking-img:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,123,196,0.4);
    border-color: #005a8b;
}

.ranking-container h2 {
    color: #007bc4;
    font-size: 28px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 3px solid #007bc4;
    padding-bottom: 10px;
}

/* Pestañas del ranking */
.ranking-tabs {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    gap: 10px;
    flex-wrap: wrap;
}

.tab-button {
    position: relative;
    z-index: 2;
    background: #007bc4;
    color: #ffffff;
    border: 3px solid #002b4a;
    padding: 15px 40px;
    font-size: 24px;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 120px;
    justify-content: center;
    overflow: hidden;
}

.tab-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.tab-button:hover::before {
    left: 100%;
}

.tab-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.4);
}

.tab-button.active {
    background: linear-gradient(135deg, #002b4a, #004d7a);
    border-color: #002b4a;
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 43, 74, 0.4);
}

.tab-icon {
    font-size: 20px;
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.3));
}

.tab-text {
    font-family: 'XuntaSans', Arial, sans-serif;
    font-weight: bold;
}

/* Contenido de las pestañas */
.ranking-content {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.ranking-list {
    background: #f8fafc;
    border: 2px solid #002b4a;
    border-radius: 15px;
    padding: 20px;
    max-width: 800px;
    width: 100%;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: white;
    border: 1px solid #002b4a;
    border-radius: 10px;
    color: #007bc4;
    gap: 20px;
    justify-content: space-between;
    height: 80px;
    flex-direction: row;
}

.ranking-item:first-child {
    background: rgba(0, 123, 196, 0.8);
    border: 2px solid #002b4a;
    color: #ffffff;
}

/* Primera posición: texto blanco */
.ranking-item:first-child .ranking-puntuacion,
.ranking-item:first-child .ranking-info,
.ranking-item:first-child .ranking-tiempo {
    color: #ffffff !important;
}

/* Alineación perfecta para el primer puesto */
.ranking-item:first-child .ranking-info {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 100% !important;
}


.ranking-item:nth-child(2) {
    background: #f8fafc;
    border: 2px solid #007bc4;
}

.ranking-item:nth-child(3) {
    background: #f8fafc;
    border: 2px solid #007bc4;
}

.ranking-posicion {
    font-size: 24px;
    font-weight: bold;
    min-width: 50px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ranking-insignias {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    max-width: 200px;
}

.ranking-insignia {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

.ranking-info {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}



.ranking-puntuacion {
    font-size: 18px;
    font-weight: bold;
    min-width: 80px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}


.ranking-tiempo {
    font-size: 15px;
    font-weight: bold;
    min-width: 60px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-left: 20px;
    flex-shrink: 0;
}


/* Estilos institucionales de la Xunta */
.logo-header {
    height: 65px;
    width: auto;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}





#categoriaActual {
    font-weight: bold;
    font-size: 1.2em;
    margin-bottom: 10px;
    padding-bottom: 5px;
}

.ranking-logo {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 2;
}







/* Responsive */
@media (max-width: 768px) {
    .juego-container {
        min-height: calc(100vh - 150px);
        padding: 15px;
        gap: 20px;
    }
    
    .jugador-info {
        flex-direction: column;
        gap: 10px;
        padding: 12px 15px;
        margin: 8px 15px;
    }
    
    .info-item {
        min-width: auto;
        width: 100%;
    }
    
    .info-item.jugador {
        order: -1;
        margin-bottom: 10px;
    }
    
    .pregunta-container {
        max-width: min(95vw, 400px);
        min-height: 150px;
    }
    
    .pregunta-header {
        padding: 15px 20px;
    }
    
    .pregunta-header h3 {
        font-size: 18px;
    }
    
    .pregunta-contenido {
        padding: 20px 15px;
        gap: 20px;
    }
    
    .pregunta-texto {
        font-size: 16px;
    }
    
    .respuestas-container {
        grid-template-columns: 1fr;
    }
    
    .btn-respuesta {
        padding: 15px 20px;
        font-size: 15px;
    }
    
    .columna-izquierda {
        order: 2;
    }
    
    .columna-derecha {
        order: 1;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .logo-header {
        height: 36px;
    }
    
    .btn-principal {
        font-size: 20px;
        padding: 12px 30px;
    }
    
    .tab-button {
        font-size: 18px;
        padding: 12px 25px;
        min-width: 100px;
    }
    
    .tab-icon {
        font-size: 16px;
    }
    
    .btn-catalogo {
        padding: 8px 12px;
        font-size: 12px;
        width: 205px;
        min-width: 205px;
        max-width: 205px;
        height: 50px;
        margin: 3px;
    }
    
    .btn-catalogo-texto {
        font-size: 11px;
    }
    
    .info-item.puntuacion,
    .info-item.temporizador {
        width: 120px;
        min-width: 120px;
        max-width: 120px;
        height: 50px;
    }
    
    .btn-catalogo {
        width: 120px !important;
        min-width: 120px !important;
        max-width: 120px !important;
        height: 50px !important;
        margin: 3px;
    }
    
    .btn-confirmar {
        font-size: 16px;
        padding: 12px 20px;
        max-width: 250px;
    }
    
    .btn-idioma {
        font-size: 18px;
        padding: 15px 40px;
        min-width: 200px;
    }
    
    /* Ajustes de ruleta en móvil */
    .ruleta-container {
        gap: 25px;
    }
    
    #ruleta {
        margin: 10px 0;
    }
    
    #categoriaSeleccionadaVisual {
        margin: 20px 0 !important;
    }
    
    /* Logo de Lua en ranking para móvil */
    
    /* Estilos para el texto de categoría seleccionada */
    #categoriaSeleccionadaVisual span {
        line-height: 1.3;
        text-align: center;
    }


    
    /* Para la pantalla del ranking en móvil */
    #ranking {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
    }
    
    #ranking .ranking-container {
        flex: 1;
    }
    


}

@media (max-width: 480px) {
    .header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
        align-items: center;
    }
    
    /* Logo de la Xunta */
    .header img[src*="marca-negativo"] {
        order: 1;
        margin-right: 20px;
    }
    
    /* Logo de úlceras fora */
    .header img[src*="ulcerasfora"] {
        order: 2;
        margin-left: 20px;
    }
    
    .header h1 {
        font-size: 18px;
        order: 3; /* Título al final */
        margin-top: 10px;
    }
    
    .logo-header {
        height: 35px;
    }
    
    .ranking-item {
        flex-direction: row;
        gap: 20px;
        text-align: left;
        height: 80px;
        justify-content: space-between;
    }
    
    .ranking-posicion,
    .ranking-puntuacion {
        min-width: auto;
    }
    
    /* Ajustes para categorías en móvil */
    .categoria-item.fallada {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .categoria-item.fallada.tratamiento-heridas {
        color: #e91e63 !important;
        background: #fce4ec !important;
        border-color: #e91e63 !important;
    }
    
    .categoria-item.eliminada {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    /* Botones principales en móvil - mismo tamaño */
    .btn-principal,
    .btn-ranking {
        font-size: 18px;
        padding: 15px 30px;
        width: 100%;
        max-width: 280px;
        margin: 10px auto;
    }
} 

/* --- 1. Ajuste de la caja de preguntas en tablet --- */
@media (max-width: 1024px) {
    .pregunta-container {
        max-width: min(95vw, 800px);
        padding: 18px 6px;
        margin-left: auto;
        margin-right: auto;
        border: 3px solid #b3e0ff !important;
        min-height: 180px;
        height: auto;
        overflow: visible;
    }
    
    /* Logo de fondo intermedio en tablet */
    .portada-logo-fondo .logo-fondo {
        width: 500px;
    }
    
    #datosJugador .portada-logo-fondo .logo-fondo {
        width: 500px;
    }
    
    #ranking .portada-logo-fondo .logo-fondo {
        width: 500px;
    }
    
    /* Logo de Lua más pequeño en tablet */
    .logo-lua-portada {
        text-align: center;
        margin: -150px auto 20px auto;
        width: 100%;
        max-width: 250px;
        z-index: 2;
    }
    
    .logo-lua-portada p {
        color: #007bc4;
        font-size: 14px;
        margin-bottom: 6px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    }
    
    .logo-lua-portada-img {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        transition: all 0.3s ease;
        border: 2px solid #007bc4;
        box-shadow: 0 4px 15px rgba(0,123,196,0.3);
        padding: 6px;
        background: white;
    }
    
    .logo-lua-portada-img:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(0,123,196,0.4);
        border-color: #005a8b;
    }
    
    
    
    /* Logo de Lua para el ranking en tablet */
    .logo-lua-ranking {
        max-width: 280px;
        margin: 20px auto 20px auto;
    }
    
    .logo-lua-ranking-img {
        width: 75px;
        height: 75px;
    }
    
    
    /* Logo de Lua para el ranking en tablet */
}



/* --- 3. Botones de idioma más compactos en móvil --- */
@media (max-width: 480px) {
    .btn-idioma {
        width: 90vw !important;
        min-width: unset !important;
        max-width: 350px;
        font-size: 16px;
        padding: 12px 10px;
        margin: 0 auto 10px auto;
        display: block;
    }
    .botones-idioma {
        gap: 12px;
        margin: 0 !important;
    }
    
    /* Logo de Lua más pequeño en móvil */
    
} 

/* Logo de Úlceras Fora en blanco en la cabecera */
.cabecera-logo img {
    filter: brightness(0) invert(1) !important;
}

/* Estilos para resultado fuera del TOP 10 */
.resultado-fuera-ranking {
    background: linear-gradient(45deg, #ff6b35, #f39c12) !important;
    border: 2px solid #e67e22 !important;
    margin-bottom: 20px !important;
    position: relative !important;
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.3) !important;
}

.resultado-fuera-ranking .ranking-posicion,
.resultado-fuera-ranking .ranking-info,
.resultado-fuera-ranking .ranking-insignias,
.resultado-fuera-ranking .ranking-tiempo {
    color: #fff !important;
}

.resultado-fuera-ranking .ranking-posicion {
    font-size: 20px !important;
}

.resultado-fuera-ranking .ranking-info div:first-child {
    font-weight: bold !important;
}

.separador-top10 {
    text-align: center;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    margin: 20px 0;
    padding: 15px;
    border-top: 2px solid #e67e22;
    border-bottom: 2px solid #e67e22;
    background: rgba(230, 126, 34, 0.1);
    border-radius: 8px;
}

.texto-fuera-ranking {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 5px;
    font-style: italic;
}

/* Tiempo del primer jugador en blanco */
.ranking-tiempo-primero {
    color: #fff !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
} 


/* Estilos para la puntuación fija en la cabecera */
.puntuacion-fija {
    font-family: 'XuntaSans', sans-serif;
    background: white;
    border: 2px solid #007bc4;
    border-radius: 8px;
    padding: 8px 16px;
    box-shadow: 0 2px 8px rgba(0,123,196,0.3);
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 120px;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    position: relative;
}

.puntuacion-fija:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,123,196,0.4);
}

/* Estilos para el mensaje de resultado */
.mensaje-resultado {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 15px;
    font-size: 0.9em;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 10;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Estilos para imágenes en preguntas */
.imagen-pregunta {
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.imagen-pregunta img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border: 2px solid #007bc4;
    transition: transform 0.3s ease;
    cursor: pointer;
    display: block;
    margin: 0 auto;
}

.imagen-pregunta img:hover {
    transform: scale(1.1);
    z-index: 10;
    position: relative;
}

/* Estilos para botones de respuesta con imágenes */
.btn-respuesta .contenido-opcion {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

/* Estilos para el contador de respuestas múltiples */
.contador-respuestas {
    text-align: center;
    margin: 15px auto;
    padding: 15px;
    background: rgba(0, 123, 196, 0.15);
    border: 3px solid #007bc4;
    border-radius: 10px;
    color: #007bc4;
    font-weight: bold;
    font-size: 1.2em;
    box-shadow: 0 4px 15px rgba(0, 123, 196, 0.2);
    width: 100%;
    max-width: 400px;
    grid-column: 1 / -1; /* Ocupa ambas columnas del grid */
}

.btn-respuesta .contenido-opcion img {
    max-width: 100%;
    max-height: 60px;
    border-radius: 6px;
    object-fit: cover;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.btn-respuesta:hover .contenido-opcion img {
    transform: scale(1.1);
}

/* Estilos para botones de respuesta seleccionados */
.btn-respuesta.seleccionada {
    background: linear-gradient(45deg, #007bc4, #005a8b) !important;
    color: white !important;
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 123, 196, 0.4);
}

.btn-respuesta.seleccionada .contenido-opcion span {
    color: white !important;
}

.btn-respuesta.correcta {
    background: linear-gradient(45deg, #4caf50, #45a049) !important;
    color: white !important;
}

.btn-respuesta.incorrecta {
    background: linear-gradient(45deg, #f44336, #d32f2f) !important;
    color: white !important;
}

/* Estilos para botones de dificultad en el ranking */
.botones-dificultad-ranking button {
    padding: 10px 20px;
    background: #666;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    font-family: 'XuntaSans', sans-serif;
}

.botones-dificultad-ranking button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.botones-dificultad-ranking button.activo {
    background: #007bc4;
}

/* Responsive para la puntuación fija */
@media (max-width: 768px) {
    .jugador-info {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .jugador-info > div:first-child {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .puntuacion-fija {
        padding: 6px 12px;
        font-size: 0.9em;
    }
    
    .mensaje-resultado {
        margin-left: 8px !important;
        font-size: 0.8em !important;
        padding: 3px 6px !important;
        max-width: 120px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    .contador-respuestas {
        font-size: 0.9em !important;
        padding: 8px !important;
        margin: 10px 0 !important;
    }
    
    .botones-dificultad-ranking {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .botones-dificultad-ranking button {
        width: 100% !important;
        max-width: 200px !important;
    }
}

/* Responsive adicional para móviles */
@media (max-width: 768px) {
    /* Fondo responsive para móvil */
    .portada-logo-fondo .logo-fondo {
        width: 400px;
    }
    
    #datosJugador .portada-logo-fondo .logo-fondo {
        width: 400px;
    }
    
    #ranking .portada-logo-fondo .logo-fondo {
        width: 400px;
    }
    
    /* Título más pequeño en móvil */
    .header h1 {
        font-size: 14px !important;
    }
    
    /* Logo de Lua más pequeño en móvil */
    .logo-lua-portada {
        margin: -100px auto 30px auto;
    }
    
    .logo-lua-portada-img {
        width: 80px;
        height: 80px;
    }
    
    /* Logo de fondo más pequeño en móvil */
    .portada-logo-fondo {
        top: 35% !important;
    }
    
    .portada-logo-fondo .logo-fondo {
        width: 400px;
    }
    
    /* Logo de fondo para datos en móvil */
    #datosJugador .portada-logo-fondo {
        top: 35% !important;
    }
    
    #datosJugador .portada-logo-fondo .logo-fondo {
        width: 400px;
    }
    
    /* Área de datos más compacta en móvil */
    .datos-container {
        padding: 10px !important;
        margin: 10px !important;
    }
    
    .input-group {
        margin-bottom: 15px !important;
    }
    
    .input-group label {
        font-size: 14px !important;
    }
    
    .input-group input, .input-group select {
        font-size: 14px !important;
        padding: 8px !important;
    }
    
    
    /* Logo de Lua para portada en móvil */
    #portada .logo-lua-portada {
        margin: -100px auto 30px auto;
    }
    
    #portada .logo-lua-portada-img {
        width: 80px;
        height: 80px;
    }
    
    
    /* Fondo para ranking en móvil */
    #ranking .portada-logo-fondo {
        top: 35% !important;
    }
    
    #ranking .portada-logo-fondo .logo-fondo {
        width: 400px;
    }
    
    /* Logo de Lua para ranking en móvil */
    .logo-lua-ranking {
        margin: 20px auto 20px auto;
    }
    
    
    /* Pregunta container responsive */
    .pregunta-container {
        max-width: min(95vw, 400px);
        padding: 20px 15px;
        margin: 0 auto;
        min-height: 150px;
    }
    
    /* Imágenes más pequeñas en móvil */
    .imagen-pregunta img {
        max-height: 150px;
    }
    
    .btn-respuesta .contenido-opcion img {
        max-height: 50px;
    }
    
    /* Botones de respuesta responsive */
    .btn-respuesta {
        font-size: 14px;
        padding: 12px 15px;
    }
}

/* Pantallas muy pequeñas (móviles pequeños) */
@media (max-width: 480px) {
    .pregunta-container {
        max-width: 98vw;
        min-height: 120px;
        padding: 15px 10px;
    }
    
    .pregunta-header {
        padding: 12px 15px;
    }
    
    .pregunta-header h3 {
        font-size: 16px;
    }
    
    .pregunta-contenido {
        padding: 15px 10px;
        gap: 15px;
    }
    
    .btn-respuesta {
        padding: 10px 12px;
        font-size: 13px;
    }
} 