/* Variables globales */
:root {
    /* Paleta de colores de Franciscanes Vilassar de Mar */
    --primary-color: #005CA9;      /* Azul franciscanes */
    --primary-light: #3D8BC9;
    --primary-dark: #004A87;
    --secondary-color: #F39200;    /* Naranja franciscanes */
    --secondary-light: #FFAE40;
    --secondary-dark: #D17A00;
    --accent-color: #8CC63F;       /* Verde franciscanes */
    --accent-light: #A6D65E;
    --accent-dark: #71A230;
    --nature-green: #8CC63F;       /* Verde naturaleza */
    --nature-light: #A6D65E;
    --nature-dark: #71A230;
    --water-blue: #005CA9;         /* Azul agua */
    --water-light: #3D8BC9;
    --water-dark: #004A87;
    --sunset-red: #E30613;         /* Rojo franciscanes */
    --sunset-light: #FF4D57;
    --sunset-dark: #C10510;
    --earth-brown: #8E6E53;        /* Marrón tierra */
    --earth-light: #A58D78;
    --earth-dark: #6D5440;
    --text-color: #333333;
    --light-text: #FFFFFF;
    --background-light: #F5F7FA;
    --background-dark: #E6E9ED;
    --shadow-color: rgba(0, 0, 0, 0.15);
    --glow-color: rgba(255, 255, 255, 0.7);
    
    /* Fuentes */
    --main-font: 'Montserrat', sans-serif;
    --title-font: 'Montserrat', sans-serif;
}

/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--main-font);
    color: var(--text-color);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #AED6F1 0%, #D6EAF8 50%, #E8F8F5 100%);
    position: relative;
}

/* Añadir elementos decorativos al fondo */
body::before, body::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

body::before {
    background: 
        radial-gradient(circle at 20% 30%, rgba(93, 173, 226, 0.2) 0%, transparent 25%),
        radial-gradient(circle at 80% 70%, rgba(88, 214, 141, 0.2) 0%, transparent 25%);
}

body::after {
    background-image: 
        radial-gradient(ellipse at 10% 10%, rgba(255, 255, 255, 0.5) 0%, transparent 20%),
        radial-gradient(ellipse at 30% 30%, rgba(255, 255, 255, 0.3) 0%, transparent 15%),
        radial-gradient(ellipse at 70% 40%, rgba(255, 255, 255, 0.4) 0%, transparent 25%),
        radial-gradient(ellipse at 90% 20%, rgba(255, 255, 255, 0.5) 0%, transparent 20%);
    animation: cloudMovement 60s linear infinite;
}

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

/* Contenedor principal del juego */
.game-container {
    width: 95%;
    max-width: 1200px;
    height: 95vh;
    max-height: 800px;
    background-color: rgba(255, 255, 255, 0.85);
    border-radius: 20px;
    box-shadow: 
        0 10px 30px var(--shadow-color),
        0 0 60px rgba(255, 255, 255, 0.6);
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(5px);
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.game-container:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 15px 40px var(--shadow-color),
        0 0 80px rgba(255, 255, 255, 0.7);
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.2),
        0 0 20px rgba(255, 255, 255, 0.4);
}

/* Animación para la categoría seleccionada aleatoriamente */
.category-card.selected {
    animation: pulse-selection 1s ease-in-out;
    box-shadow: 
        0 0 0 5px var(--accent-color),
        0 15px 30px rgba(0, 0, 0, 0.3),
        0 0 50px rgba(140, 198, 63, 0.6);
    transform: translateY(-15px) scale(1.1);
    z-index: 10;
}

@keyframes pulse-selection {
    0% {
        box-shadow: 
            0 0 0 0 rgba(140, 198, 63, 0.7),
            0 15px 30px rgba(0, 0, 0, 0.2);
        transform: translateY(-10px) scale(1);
    }
    50% {
        box-shadow: 
            0 0 0 20px rgba(140, 198, 63, 0),
            0 15px 30px rgba(0, 0, 0, 0.3);
        transform: translateY(-15px) scale(1.15);
    }
    100% {
        box-shadow: 
            0 0 0 5px var(--accent-color),
            0 15px 30px rgba(0, 0, 0, 0.3),
            0 0 50px rgba(140, 198, 63, 0.6);
        transform: translateY(-15px) scale(1.1);
    }
}

/* Pantallas del juego */
.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 2rem;
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55), opacity 0.8s ease;
    opacity: 0;
    transform: translateY(50px) scale(0.9);
    background-position: center;
    background-size: cover;
    overflow: hidden;
}

.screen.active {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.screen.exit {
    opacity: 0;
    transform: translateY(-50px) scale(1.1);
}

/* Añadir elementos flotantes a las pantallas */
.screen::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: 
        radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 15%),
        radial-gradient(circle at 90% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 15%);
    pointer-events: none;
    z-index: 1;
}

/* Títulos y texto */
.game-title {
    font-size: 4.5rem;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    text-align: center;
    text-shadow: 
        2px 2px 4px var(--shadow-color),
        0 0 20px var(--glow-color);
    position: relative;
    z-index: 1;
    letter-spacing: 2px;
    font-weight: 700;
    animation: floatTitle 6s ease-in-out infinite;
}

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

.game-title::after {
    content: '';
    position: absolute;
    width: 120%;
    height: 10px;
    background: linear-gradient(90deg, transparent, var(--primary-light), transparent);
    bottom: -15px;
    left: -10%;
    border-radius: 50%;
    filter: blur(5px);
}

.game-subtitle {
    font-size: 1.8rem;
    color: var(--secondary-dark);
    margin-bottom: 2rem;
    text-align: center;
    text-shadow: 1px 1px 2px var(--shadow-color);
    animation: colorPulse 5s infinite alternate;
}

@keyframes colorPulse {
    0% { color: var(--secondary-dark); }
    50% { color: var(--accent-dark); }
    100% { color: var(--primary-dark); }
}

.screen-title {
    font-size: 2.8rem;
    color: var(--primary-dark);
    margin-bottom: 2rem;
    text-align: center;
    text-shadow: 1px 1px 2px var(--shadow-color);
    position: relative;
}

.screen-title::before, .screen-title::after {
    content: '';
    position: absolute;
    height: 4px;
    width: 60px;
    background: var(--primary-light);
    border-radius: 2px;
    top: 50%;
    transform: translateY(-50%);
}

.screen-title::before {
    left: -80px;
}

.screen-title::after {
    right: -80px;
}

/* Botones */
.btn {
    padding: 0.9rem 1.8rem;
    border: none;
    border-radius: 50px;
    font-family: var(--main-font);
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 
        0 4px 8px var(--shadow-color),
        0 0 0 rgba(255, 255, 255, 0);
    margin: 0.8rem;
    position: relative;
    overflow: hidden;
    letter-spacing: 1px;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    z-index: -1;
}

.btn:hover::before {
    transform: translateX(100%);
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.btn:hover::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

.btn-primary {
    background: linear-gradient(to right, var(--primary-color), var(--primary-dark));
    color: var(--light-text);
    border: 2px solid transparent;
}

.btn-primary:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 
        0 10px 20px rgba(0, 0, 0, 0.1),
        0 0 15px rgba(93, 156, 236, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary {
    background: linear-gradient(to right, var(--secondary-color), var(--secondary-dark));
    color: var(--light-text);
    border: 2px solid transparent;
}

.btn-secondary:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 
        0 10px 20px rgba(0, 0, 0, 0.1),
        0 0 15px rgba(246, 187, 66, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-accent {
    background: linear-gradient(to right, var(--accent-color), var(--accent-dark));
    color: var(--light-text);
    border: 2px solid transparent;
}

.btn-accent:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 
        0 10px 20px rgba(0, 0, 0, 0.1),
        0 0 15px rgba(140, 198, 63, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 4px var(--shadow-color);
}

/* Pantalla de categorías */
#category-screen {
    background: linear-gradient(to bottom, #E6F2FF, #FFFFFF);
}

/* Botones de acción en la pantalla de categorías */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
    width: 100%;
    flex-wrap: wrap;
    padding: 0 1rem;
}

.action-buttons .btn {
    min-width: 180px;
    margin: 0.5rem;
    text-align: center;
}

.action-buttons .btn {
    min-width: 200px;
    margin: 0;
    padding: 1rem 1.5rem;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

/* Pantalla de inicio */
#start-screen {
    background: linear-gradient(to bottom, #E6F2FF, #FFFFFF);
    justify-content: space-around;
    position: relative;
    overflow: hidden;
}

/* Logo del colegio */
.logo-container {
    width: 200px;
    height: 200px;
    margin: 1rem 0;
    position: relative;
    z-index: 2;
}

.school-logo {
    content: '';
    width: 100%;
    height: 100%;
    position: relative;
    background: url("https://www.franciscanesvilassardemar.org/wp-content/uploads/2019/02/logo-vilassardemar.png");
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    animation: float 6s ease-in-out infinite, glow 4s ease-in-out infinite alternate;
}

#start-screen::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(93, 173, 226, 0.3) 0%, transparent 30%),
        radial-gradient(circle at 80% 70%, rgba(88, 214, 141, 0.3) 0%, transparent 30%),
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.7;
    z-index: 0;
}

/* Nubes flotantes */
#start-screen::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 100%;
    background-image: 
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 56 24' width='200' height='100'%3E%3Cpath fill='%23ffffff' fill-opacity='0.2' d='M42.4,24c-2.8,0-4.4-0.4-5.6-1.3c-0.8,0.5-1.8,0.8-2.8,0.8c-2.2,0-4-1.4-4.7-3.4c-0.5,0.2-1,0.3-1.5,0.3 c-2.2,0-4-1.8-4-4c0-0.6,0.1-1.1,0.3-1.6c-1.9-0.5-3.3-2.3-3.3-4.4c0-2.5,2-4.5,4.5-4.5c0.4,0,0.8,0.1,1.2,0.2C27.1,2.7,30.4,0,34.4,0 c4.4,0,8,3.6,8,8c0,0.4,0,0.8-0.1,1.2C44.9,10,46.9,12.4,47,15.3c0,0.1,0,0.1,0,0.2C47,20.4,45.1,24,42.4,24z'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 56 24' width='150' height='75'%3E%3Cpath fill='%23ffffff' fill-opacity='0.3' d='M42.4,24c-2.8,0-4.4-0.4-5.6-1.3c-0.8,0.5-1.8,0.8-2.8,0.8c-2.2,0-4-1.4-4.7-3.4c-0.5,0.2-1,0.3-1.5,0.3 c-2.2,0-4-1.8-4-4c0-0.6,0.1-1.1,0.3-1.6c-1.9-0.5-3.3-2.3-3.3-4.4c0-2.5,2-4.5,4.5-4.5c0.4,0,0.8,0.1,1.2,0.2C27.1,2.7,30.4,0,34.4,0 c4.4,0,8,3.6,8,8c0,0.4,0,0.8-0.1,1.2C44.9,10,46.9,12.4,47,15.3c0,0.1,0,0.1,0,0.2C47,20.4,45.1,24,42.4,24z'/%3E%3C/svg%3E");
    background-position: 0% 20%, 80% 60%;
    background-repeat: no-repeat;
    top: 0;
    left: -50%;
    z-index: 0;
    animation: cloudFloat 60s linear infinite;
}

@keyframes cloudFloat {
    0% { transform: translateX(0); }
    100% { transform: translateX(50%); }
}

.character-container {
    width: 300px;
    height: 300px;
    margin: 2rem 0;
    position: relative;
    z-index: 2;
}

.character {
    width: 100%;
    height: 100%;
    position: relative;
    animation: float 6s ease-in-out infinite, glow 4s ease-in-out infinite alternate;
}

/* Crear un personaje con CSS en lugar de una imagen */
.character::before {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle at 50% 40%, var(--primary-light), var(--primary-dark));
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 
        0 0 30px var(--primary-light),
        0 0 60px rgba(255, 255, 255, 0.3);
}

.character::after {
    content: '';
    position: absolute;
    width: 180px;
    height: 90px;
    background: radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.4), transparent 70%);
    border-radius: 50%;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-10deg);
    filter: blur(5px);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-15px) rotate(-5deg);
    }
    50% {
        transform: translateY(-25px) rotate(0deg);
    }
    75% {
        transform: translateY(-15px) rotate(5deg);
    }
}

@keyframes glow {
    0% {
        filter: drop-shadow(0 0 5px var(--primary-light));
    }
    100% {
        filter: drop-shadow(0 0 20px var(--primary-light));
    }
}

/* Pantalla de categorías */
#category-screen {
    background: linear-gradient(135deg, #E8F8F5 0%, #D6EAF8 100%);
}

.categories-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
    padding: 0 1rem;
    width: 100%;
    max-width: 800px;
    perspective: 1000px;
}

.category-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 1.8rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 
        0 5px 15px var(--shadow-color),
        0 0 0 2px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    z-index: 1;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
    transform: translateY(-100%);
    transition: transform 0.6s ease;
    z-index: -1;
}

.category-card:hover::before {
    transform: translateY(100%);
}

.category-card::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 5%;
    width: 90%;
    height: 10px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.2) 0%, transparent 80%);
    filter: blur(5px);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.category-card:hover {
    transform: translateY(-15px) rotateX(5deg) rotateY(-5deg);
    box-shadow: 
        0 20px 30px var(--shadow-color),
        0 0 0 5px rgba(255, 255, 255, 0.2);
}

.category-card:hover::after {
    opacity: 1;
}

.category-icon {
    width: 90px;
    height: 90px;
    margin-bottom: 1.5rem;
    position: relative;
    transition: transform 0.5s ease;
}

/* Iconos creados con CSS en lugar de imágenes */
.category-icon.naturaleza {
    background: radial-gradient(circle at center, var(--nature-light), var(--nature-dark));
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(140, 193, 82, 0.5);
}

.category-icon.naturaleza::before {
    content: '🌿';
    font-size: 40px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.category-icon.matematicas {
    background: radial-gradient(circle at center, var(--water-light), var(--water-dark));
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(79, 193, 233, 0.5);
}

.category-icon.matematicas::before {
    content: '🔢';
    font-size: 40px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.category-icon.geografia {
    background: radial-gradient(circle at center, var(--earth-light), var(--earth-dark));
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(216, 179, 144, 0.5);
}

.category-icon.geografia::before {
    content: '🌍';
    font-size: 40px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.category-icon.ingles {
    background: radial-gradient(circle at center, var(--primary-light), var(--primary-dark));
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(93, 156, 236, 0.5);
}

.category-icon.ingles::before {
    content: '🔤';
    font-size: 40px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.category-icon.historia {
    background: radial-gradient(circle at center, var(--sunset-light), var(--sunset-dark));
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(237, 85, 101, 0.5);
}

.category-icon.historia::before {
    content: '📜';
    font-size: 40px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.category-icon.arte {
    background: radial-gradient(circle at center, var(--accent-light), var(--accent-dark));
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(172, 146, 236, 0.5);
}

.category-icon.arte::before {
    content: '🎨';
    font-size: 40px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.category-card:hover .category-icon {
    transform: scale(1.1) rotate(5deg);
}

.category-card h3 {
    font-size: 1.3rem;
    color: var(--text-color);
    text-align: center;
    font-weight: 600;
    margin-top: 0.5rem;
    transition: color 0.3s ease;
    position: relative;
}

.category-card:hover h3 {
    color: var(--primary-dark);
}

.category-card h3::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease, left 0.3s ease;
}

.category-card:hover h3::after {
    width: 80%;
    left: 10%;
}

/* Pantalla de juego */
#game-screen {
    background: linear-gradient(to bottom, #D6EAF8, #AED6F1);
    position: relative;
    overflow: hidden;
}

/* Fondo animado para el juego */
#game-screen::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: 
        radial-gradient(circle at 30% 20%, rgba(93, 173, 226, 0.2) 0%, transparent 30%),
        radial-gradient(circle at 70% 80%, rgba(88, 214, 141, 0.2) 0%, transparent 30%),
        url("data:image/svg+xml,%3Csvg width='52' height='26' viewBox='0 0 52 26' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M10 10c0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6h2c0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4v2c-3.314 0-6-2.686-6-6 0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6zm25.464-1.95l8.486 8.486-1.414 1.414-8.486-8.486 1.414-1.414z' /%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: 0;
    opacity: 0.7;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 2rem;
    padding: 1.2rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    box-shadow: 
        0 4px 15px var(--shadow-color),
        0 0 30px rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-header:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 8px 20px var(--shadow-color),
        0 0 40px rgba(255, 255, 255, 0.4);
}

.category-indicator {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-dark);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
    position: relative;
    padding-left: 30px;
}

.category-indicator::before {
    content: '🌟';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    animation: spin 10s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

.score-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    position: relative;
}

.score, .question-counter {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-dark);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
    margin: 0.2rem 0;
    position: relative;
}

.score::before {
    content: '🌟';
    margin-right: 5px;
    animation: pulse 2s infinite alternate;
}

@keyframes pulse {
    0% { opacity: 0.7; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1.1); }
}

.question-container {
    width: 100%;
    max-width: 800px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 
        0 10px 25px var(--shadow-color),
        0 0 40px rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    position: relative;
    z-index: 1;
    transform-style: preserve-3d;
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.question-container:hover {
    transform: translateY(-5px) rotateX(2deg);
    box-shadow: 
        0 15px 35px var(--shadow-color),
        0 0 50px rgba(255, 255, 255, 0.4);
}

.question-container::before {
    content: '💡';
    position: absolute;
    top: -15px;
    left: 20px;
    font-size: 2rem;
    background: var(--primary-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 2;
    animation: bounce 2s infinite alternate;
}

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

#question-text {
    font-size: 1.9rem;
    color: var(--text-color);
    margin-bottom: 2.5rem;
    text-align: center;
    font-weight: 600;
    line-height: 1.4;
    position: relative;
    padding: 0 1rem;
}

#question-text::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 25%;
    width: 50%;
    height: 3px;
    background: linear-gradient(to right, transparent, var(--primary-light), transparent);
    border-radius: 3px;
}

.options-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    padding: 0 1rem;
}

.option-btn {
    padding: 1.2rem 1.5rem;
    background: white;
    border: 2px solid var(--primary-light);
    border-radius: 15px;
    font-family: var(--main-font);
    font-size: 1.15rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: left;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin: 0.3rem auto;
    width: 100%;
}

.option-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.option-btn:hover::before {
    transform: translateX(100%);
}

.option-btn:hover {
    background: linear-gradient(to right, var(--primary-light), var(--primary-color));
    color: var(--light-text);
    transform: translateY(-5px) scale(1.03);
    box-shadow: 
        0 10px 20px rgba(0, 0, 0, 0.15),
        0 0 15px rgba(93, 156, 236, 0.3);
    border-color: transparent;
}

.option-btn.correct {
    background: linear-gradient(to right, var(--nature-light), var(--nature-dark));
    color: white;
    border-color: transparent;
    box-shadow: 
        0 5px 15px rgba(140, 193, 82, 0.4),
        0 0 30px rgba(140, 193, 82, 0.2);
    transform: translateY(-5px);
    animation: correctPulse 1s infinite;
}

@keyframes correctPulse {
    0%, 100% { box-shadow: 0 5px 15px rgba(140, 193, 82, 0.4), 0 0 30px rgba(140, 193, 82, 0.2); }
    50% { box-shadow: 0 5px 15px rgba(140, 193, 82, 0.6), 0 0 40px rgba(140, 193, 82, 0.4); }
}

.option-btn.incorrect {
    background: linear-gradient(to right, var(--sunset-light), var(--sunset-dark));
    color: white;
    border-color: transparent;
    box-shadow: 
        0 5px 15px rgba(237, 85, 101, 0.4),
        0 0 30px rgba(237, 85, 101, 0.2);
    transform: translateY(-5px);
    animation: incorrectShake 0.5s;
}

@keyframes incorrectShake {
    0%, 100% { transform: translateX(0) translateY(-5px); }
    20%, 60% { transform: translateX(-5px) translateY(-5px); }
    40%, 80% { transform: translateX(5px) translateY(-5px); }
}

/* Pantalla de resultado */
#result-screen {
    background: linear-gradient(135deg, #E8F8F5 0%, #D6EAF8 100%);
    position: relative;
    overflow: hidden;
}

#result-screen::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(93, 173, 226, 0.2) 0%, transparent 30%),
        radial-gradient(circle at 80% 70%, rgba(88, 214, 141, 0.2) 0%, transparent 30%),
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.5;
    z-index: 0;
}

/* Confeti animado para la pantalla de resultados */
#result-screen::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: -50%;
    left: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, var(--primary-light) 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, var(--secondary-light) 1px, transparent 1px),
        radial-gradient(circle at 50% 50%, var(--accent-light) 1px, transparent 1px),
        radial-gradient(circle at 25% 75%, var(--nature-light) 1px, transparent 1px),
        radial-gradient(circle at 75% 25%, var(--sunset-light) 1px, transparent 1px),
        radial-gradient(circle at 10% 90%, var(--water-light) 1px, transparent 1px),
        radial-gradient(circle at 90% 10%, var(--earth-light) 1px, transparent 1px);
    background-size: 12px 12px, 15px 15px, 10px 10px, 20px 20px, 15px 15px, 18px 18px, 12px 12px;
    animation: confetiFall 10s linear infinite;
    opacity: 0.6;
    z-index: 0;
}

@keyframes confetiFall {
    0% { transform: translateY(-10%); }
    100% { transform: translateY(100%); }
}

.result-container {
    width: 100%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 
        0 10px 30px var(--shadow-color),
        0 0 50px rgba(255, 255, 255, 0.4);
    text-align: center;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transform-style: preserve-3d;
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.result-container:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 
        0 15px 40px var(--shadow-color),
        0 0 60px rgba(255, 255, 255, 0.5);
}

.final-score {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 2rem;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    display: inline-block;
}

.final-score::before, .final-score::after {
    content: '🌟';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    animation: starPulse 2s infinite alternate;
}

.final-score::before {
    left: -40px;
    animation-delay: 0s;
}

.final-score::after {
    right: -40px;
    animation-delay: 0.5s;
}

@keyframes starPulse {
    0% { transform: translateY(-50%) scale(0.8); opacity: 0.7; }
    100% { transform: translateY(-50%) scale(1.2); opacity: 1; }
}

.save-score {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.save-score:hover {
    transform: translateY(-3px);
}

.save-score h3 {
    font-size: 1.6rem;
    margin-bottom: 1.2rem;
    color: var(--primary-dark);
    position: relative;
    display: inline-block;
}

.save-score h3::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 25%;
    width: 50%;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--primary-light), transparent);
}

.input-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
}

.input-container label {
    margin-right: 1.2rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
}

#player-initials {
    padding: 0.8rem 0.5rem;
    font-size: 1.8rem;
    width: 120px;
    text-align: center;
    border: 3px solid var(--primary-light);
    border-radius: 10px;
    font-family: var(--main-font);
    text-transform: uppercase;
    font-weight: 700;
    color: var(--primary-dark);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

#player-initials:focus {
    outline: none;
    border-color: var(--primary-dark);
    box-shadow: 0 5px 20px rgba(93, 156, 236, 0.3);
    transform: scale(1.05);
}

.result-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Pantalla de puntuaciones */
#highscores-screen {
    background: linear-gradient(135deg, #D6EAF8 0%, #E8F8F5 100%);
    position: relative;
    overflow: hidden;
}

#highscores-screen::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: 
        radial-gradient(circle at 30% 20%, rgba(93, 173, 226, 0.2) 0%, transparent 30%),
        radial-gradient(circle at 70% 80%, rgba(88, 214, 141, 0.2) 0%, transparent 30%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.6;
    z-index: 0;
}

.highscores-container {
    width: 100%;
    max-width: 800px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 
        0 10px 30px var(--shadow-color),
        0 0 50px rgba(255, 255, 255, 0.4);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transform-style: preserve-3d;
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.highscores-container:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 
        0 15px 40px var(--shadow-color),
        0 0 60px rgba(255, 255, 255, 0.5);
}

#highscores-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

#highscores-table th, #highscores-table td {
    padding: 1.2rem;
    text-align: center;
    border-bottom: 1px solid var(--background-dark);
}

#highscores-table th {
    background: linear-gradient(to right, var(--primary-color), var(--primary-dark));
    color: var(--light-text);
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

#highscores-table th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, var(--primary-light), transparent);
}

#highscores-table tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.6);
}

#highscores-table tr:nth-child(odd) {
    background-color: rgba(255, 255, 255, 0.3);
}

#highscores-table tr:hover {
    background: linear-gradient(to right, rgba(255, 206, 84, 0.2), rgba(255, 206, 84, 0.1));
    transform: scale(1.01);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

#highscores-table tr:first-child {
    background: linear-gradient(to right, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1));
    position: relative;
}

#highscores-table tr:first-child::before {
    content: '🏆';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    animation: trophyBounce 2s infinite alternate;
}

@keyframes trophyBounce {
    0% { transform: translateY(-50%) scale(1); }
    100% { transform: translateY(-50%) scale(1.2); }
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

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

.feedback-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    max-width: 400px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 80px rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transform-style: preserve-3d;
    animation: pop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.feedback-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.8) 0%, transparent 60%);
    opacity: 0;
    animation: feedbackGlow 2s ease-in-out infinite;
}

@keyframes feedbackGlow {
    0%, 100% { opacity: 0; transform: scale(0.8); }
    50% { opacity: 0.5; transform: scale(1); }
}

@keyframes pop {
    0% {
        transform: scale(0.8) translateY(20px);
        opacity: 0;
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

#feedback-text {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--primary-dark), var(--accent-dark));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    display: inline-block;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

#feedback-text.correct {
    background: linear-gradient(to right, var(--nature-dark), var(--nature-light));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#feedback-text.incorrect {
    background: linear-gradient(to right, var(--sunset-dark), var(--sunset-light));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#feedback-text::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, transparent, var(--primary-light), transparent);
    border-radius: 3px;
}

/* Pantalla de carga */
.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.loading-animation {
    width: 120px;
    height: 120px;
    position: relative;
    margin-bottom: 2rem;
}

.loading-animation::before,
.loading-animation::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 8px solid transparent;
}

.loading-animation::before {
    border-top-color: var(--primary-light);
    border-right-color: var(--primary-light);
    animation: spin 2s linear infinite;
}

.loading-animation::after {
    border-bottom-color: var(--accent-light);
    border-left-color: var(--accent-light);
    animation: spin 1.5s linear reverse infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content h3 {
    color: white;
    font-size: 1.8rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    padding-bottom: 15px;
}

.loading-content h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 25%;
    width: 50%;
    height: 2px;
    background: linear-gradient(to right, transparent, white, transparent);
    animation: loadingBar 2s ease-in-out infinite;
}

@keyframes loadingBar {
    0%, 100% { width: 30%; left: 35%; }
    50% { width: 80%; left: 10%; }
}

/* Partículas flotantes en la pantalla de carga */
.loading-overlay::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 25% 25%, white 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, white 1px, transparent 1px),
        radial-gradient(circle at 50% 50%, white 1px, transparent 1px),
        radial-gradient(circle at 25% 75%, white 1px, transparent 1px),
        radial-gradient(circle at 75% 25%, white 1px, transparent 1px);
    background-size: 100px 100px, 120px 120px, 80px 80px, 150px 150px, 90px 90px;
    animation: floatingParticles 10s linear infinite;
    opacity: 0.3;
}

@keyframes floatingParticles {
    0% { background-position: 0 0, 0 0, 0 0, 0 0, 0 0; }
    100% { background-position: 100px 100px, -120px 120px, 80px -80px, -150px 150px, 90px -90px; }
}

/* Media queries para responsive */
@media (max-width: 1024px) {
    .game-container {
        width: 98%;
        height: 98vh;
        max-height: none;
    }
    
    .game-title {
        font-size: 3.5rem;
    }
    
    .category-card {
        padding: 1.2rem;
    }
    
    .category-icon {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 0;
        margin: 0;
    }
    
    .game-container {
        width: 100%;
        height: 100vh;
        border-radius: 0;
        max-height: none;
    }
    
    .game-title {
        font-size: 3rem;
        padding: 0 1rem;
        text-align: center;
    }
    
    .game-subtitle {
        font-size: 1.5rem;
        padding: 0 1rem;
        text-align: center;
    }
    
    .categories-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 1rem;
    }
    
    .options-container {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        padding: 0.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn {
        width: 80%;
        max-width: 300px;
    }
    
    .question-container {
        padding: 1rem;
    }
    
    #highscores-table {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 2.2rem;
        margin-bottom: 0.5rem;
    }
    
    .game-subtitle {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }
    
    .screen-title {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }
    
    .categories-container {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .category-card {
        padding: 0.8rem;
    }
    
    .category-icon {
        width: 60px;
        height: 60px;
    }
    
    .game-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.8rem;
    }
    
    .score-container {
        align-items: flex-start;
        margin-top: 0.5rem;
        width: 100%;
    }
    
    #question-text {
        font-size: 1.3rem;
        padding: 0.8rem;
    }
    
    .option-btn {
        font-size: 0.9rem;
        padding: 0.7rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }
    
    .result-container {
        padding: 1rem;
    }
    
    .final-score {
        font-size: 1.2rem;
    }
    
    .save-score h3 {
        font-size: 1.1rem;
    }
    
    .highscores-container {
        padding: 0.5rem;
    }
    
    #highscores-table {
        font-size: 0.8rem;
    }
    
    #highscores-table th, #highscores-table td {
        padding: 0.4rem 0.2rem;
    }
    
    .feedback-content {
        padding: 1rem;
    }
    
    #feedback-text {
        font-size: 1.5rem;
    }
}

/* Media query específica para dispositivos muy pequeños */
@media (max-width: 360px) {
    .game-title {
        font-size: 1.8rem;
    }
    
    .game-subtitle {
        font-size: 1rem;
    }
    
    .screen-title {
        font-size: 1.5rem;
    }
    
    #question-text {
        font-size: 1.1rem;
    }
    
    .option-btn {
        font-size: 0.8rem;
        padding: 0.6rem;
    }
    
    .btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.8rem;
    }
}
