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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    color: #2d3748;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden; /* Prevenir scroll horizontal */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 12px 0;
    margin-bottom: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 15px;
}

.header h1 {
    font-size: 22px;
    color: #2d3748;
    font-weight: 700;
    margin: 0;
    flex-shrink: 0;
}

.header h1 a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header h1 a:hover {
    color: #4299e1;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.user-info span {
    font-weight: 500;
    color: #4a5568;
    white-space: nowrap;
    font-size: 14px;
    display: none; /* Ocultar en móviles pequeños */
}

.user-photo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
    flex-shrink: 0;
}

.btn-logout {
    padding: 8px 16px;
    background: #e74c3c;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    cursor: pointer;
    min-height: 44px; /* Tamaño táctil mínimo */
    min-width: 44px;
    justify-content: center;
}

.btn-logout:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.btn-logout:active {
    transform: translateY(0);
}

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.login-box h1 {
    font-size: 36px;
    margin-bottom: 10px;
    color: #667eea;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
}

.login-content p {
    margin-bottom: 20px;
    color: #555;
}

.btn-google {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: #4285F4;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.3s;
    width: 100%;
    justify-content: center;
}

.btn-google:hover {
    background: #357ae8;
}

/* Main content */
.main-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.main-content h2 {
    color: #2d3748;
    margin-bottom: 20px;
    font-weight: 700;
}

.btn-back {
    display: inline-block;
    margin-bottom: 20px;
    color: #4299e1;
    text-decoration: none;
    font-weight: 500;
}

.btn-back:hover {
    text-decoration: underline;
}

/* Grids */
.tematicas-grid,
.juegos-grid,
.niveles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.tematica-card,
.juego-card,
.nivel-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tematica-card:hover,
.juego-card:hover,
.nivel-card:hover:not(.bloqueado) {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e0;
}

.tematica-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.tematica-card h3,
.juego-card h3,
.nivel-card h4 {
    color: #333;
    margin-bottom: 10px;
}

.tematica-card p,
.juego-card p,
.nivel-card p {
    color: #666;
    margin-bottom: 15px;
    font-size: 14px;
}

.nivel-info {
    display: flex;
    justify-content: space-around;
    margin: 15px 0;
    font-size: 14px;
    color: #555;
    flex-wrap: wrap;
    gap: 10px;
}

@media (max-width: 480px) {
    .nivel-info {
        font-size: 12px;
        margin: 12px 0;
    }
    
    .nivel-info span {
        flex: 1;
        text-align: center;
        min-width: 120px;
    }
}

.nivel-card.bloqueado {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Buttons */
.btn-primary {
    display: inline-block;
    padding: 12px 24px;
    background: #4299e1;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(66, 153, 225, 0.2);
    min-height: 44px; /* Tamaño táctil mínimo */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    background: #3182ce;
    box-shadow: 0 2px 6px rgba(66, 153, 225, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    padding: 12px 24px;
    background: #ffffff;
    color: #4a5568;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    min-height: 44px; /* Tamaño táctil mínimo */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-secondary:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.btn-disabled {
    padding: 12px 24px;
    background: #ccc;
    color: #666;
    border: none;
    border-radius: 5px;
    cursor: not-allowed;
}

/* Progreso */
.progreso-info {
    background: #f7fafc;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #e2e8f0;
}

@media (max-width: 768px) {
    .progreso-info {
        padding: 12px 15px;
        margin: 15px 0;
    }
    
    .progreso-info p {
        font-size: 14px;
        margin: 4px 0;
    }
}

.progreso-info p {
    margin: 5px 0;
    color: #2d3748;
    font-weight: 500;
}

/* Juego */
.game-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 15px;
    min-height: calc(100vh - 200px);
    padding-bottom: 40px;
}

.game-header {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    position: sticky;
    top: 60px;
    z-index: 50;
}

.btn-back-small {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    color: #4a5568;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-back-small:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    color: #2d3748;
}

.game-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.stat-item {
    background: #f7fafc;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
}

.stat-item:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stat-label {
    display: block;
    font-size: 12px;
    color: #718096;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: #2d3748;
}

.stat-value.tiempo-urgente {
    color: #ff6b6b;
    animation: pulse 1s infinite;
}

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

.progress-bar-container {
    margin-top: 20px;
    background: #e2e8f0;
    border-radius: 8px;
    height: 6px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #4299e1;
    border-radius: 8px;
    transition: width 0.5s ease;
}

.game-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 50px 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    min-height: 450px;
    position: relative;
    border: 1px solid #e2e8f0;
}

.pregunta-container {
    text-align: center;
    animation: fadeIn 0.5s ease;
}

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

.pregunta-texto {
    margin-bottom: 40px;
    padding: 35px;
    background: #f7fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    position: relative;
}

.pregunta-texto::before {
    content: '❓';
    position: absolute;
    top: -20px;
    left: 30px;
    font-size: 36px;
    background: #ffffff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid #e2e8f0;
}

.pregunta-texto h3 {
    font-size: 28px;
    color: #2d3748;
    line-height: 1.6;
    font-weight: 600;
    margin: 0;
    padding-top: 5px;
}

/* Estilos para el juego de banderas */
.bandera-display {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 200px;
}

.bandera-emoji {
    font-size: 120px;
    line-height: 1;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 2px solid #e2e8f0;
    animation: flagWave 2s ease-in-out infinite;
    display: inline-block;
    transition: transform 0.3s;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Android Emoji", "EmojiSymbols", "EmojiOne Mozilla", "Twemoji Mozilla", "Segoe UI Symbol", sans-serif;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    visibility: visible !important;
    opacity: 1 !important;
}

.bandera-imagen {
    width: 200px;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bandera-emoji-fallback {
    font-size: 120px;
    line-height: 1;
    display: inline-block;
}

.bandera-emoji:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

@keyframes flagWave {
    0%, 100% {
        transform: rotate(-2deg) scale(1);
    }
    50% {
        transform: rotate(2deg) scale(1.02);
    }
}

.opciones-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 700px;
    margin: 0 auto;
}

.opcion-btn {
    padding: 20px 24px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #2d3748;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.opcion-btn:hover:not(:disabled) {
    background: #f7fafc;
    border-color: #4299e1;
    color: #2c5282;
    box-shadow: 0 2px 6px rgba(66, 153, 225, 0.15);
    transform: translateY(-2px);
}

.opcion-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.opcion-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.opcion-btn.correcta {
    background: #f0fff4;
    color: #22543d;
    border-color: #48bb78;
    animation: correctAnswer 0.4s ease;
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.2);
}

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

.opcion-btn.incorrecta {
    background: #fff5f5;
    color: #742a2a;
    border-color: #f56565;
    animation: incorrectAnswer 0.4s ease;
    box-shadow: 0 2px 8px rgba(245, 101, 101, 0.2);
}

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

.feedback-correcto,
.feedback-incorrecto {
    margin-top: 25px;
    padding: 16px 24px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    animation: slideUpFeedback 0.5s ease;
    border: 2px solid;
}

.feedback-correcto {
    background: #f0fff4;
    color: #22543d;
    border-color: #48bb78;
}

.feedback-incorrecto {
    background: #fff5f5;
    color: #742a2a;
    border-color: #f56565;
}

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

.loading {
    text-align: center;
    padding: 60px 40px;
    font-size: 20px;
    color: #667eea;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.loading::before {
    content: '';
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.error {
    text-align: center;
    padding: 60px 40px;
    color: #dc3545;
    font-size: 18px;
    background: #fff5f5;
    border-radius: 15px;
    border: 2px solid #fed7d7;
}

/* Resultados */
.game-results {
    background: #ffffff;
    border-radius: 12px;
    padding: 50px 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-align: center;
    animation: slideUp 0.6s ease;
    border: 1px solid #e2e8f0;
}

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

.game-results h2 {
    color: #2d3748;
    margin-bottom: 40px;
    font-size: 36px;
    font-weight: 700;
    animation: bounce 1s ease;
}

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

.results-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    margin: 40px 0;
}

.result-item {
    background: #f7fafc;
    padding: 30px 20px;
    border-radius: 10px;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
}

.result-item:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.result-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.result-value {
    display: block;
    font-size: 48px;
    font-weight: 700;
    color: #2d3748;
    animation: countUp 1s ease;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.result-value.correct {
    color: #22543d;
}

.result-value.incorrect {
    color: #742a2a;
}

.results-actions {
    margin-top: 40px;
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.results-actions .btn-primary,
.results-actions .btn-secondary {
    padding: 15px 30px;
    font-size: 16px;
    border-radius: 8px;
    transition: all 0.2s;
}

.results-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.results-actions .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Historial de fallidas */
.juego-actions {
    margin: 20px 0;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .juego-actions {
        margin: 15px 0;
        flex-direction: column;
    }
    
    .juego-actions .btn-secondary {
        width: 100%;
    }
}

.estadisticas-box {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.estadisticas-box h3 {
    margin-bottom: 15px;
    color: #667eea;
}

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

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin: 20px 0;
}

.empty-state p {
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
}

.historial-list {
    margin-top: 20px;
}

.historial-item {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #dc3545;
}

.historial-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.historial-header h4 {
    color: #333;
    margin: 0;
    flex: 1;
    min-width: 200px;
}

.fecha-badge {
    background: #e9ecef;
    color: #666;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    white-space: nowrap;
}

.historial-details {
    display: grid;
    gap: 10px;
}

.detail-row {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row .label {
    font-weight: 600;
    color: #666;
    min-width: 150px;
}

.detail-row .value {
    color: #333;
    flex: 1;
}

.detail-row.incorrect .value {
    color: #dc3545;
    font-weight: 500;
}

.detail-row.correct .value {
    color: #28a745;
    font-weight: 500;
}

.nivel-actions {
    margin-top: 15px;
}

.modo-badge-repaso {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #fffaf0;
    color: #744210;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    margin: 15px 0;
    border: 2px solid #f6ad55;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.badge-icon {
    font-size: 18px;
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.badge-text {
    letter-spacing: 0.5px;
}

.juego-info {
    background: #e7f3ff;
    padding: 10px 15px;
    border-radius: 5px;
    margin: 15px 0;
    color: #333;
}

/* Footer */
.footer {
    background: #1a202c;
    color: #a0aec0;
    padding: 40px 20px 20px;
    margin-top: 60px;
    border-top: 1px solid #2d3748;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h4 {
    color: white;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
}

.footer-section p {
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #a0aec0;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
    display: inline-block;
    min-height: 44px;
    line-height: 44px;
}

.footer-section ul li a:hover {
    color: #4299e1;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 20px;
    border-top: 1px solid #2d3748;
    text-align: center;
    font-size: 13px;
    color: #718096;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header {
        padding: 10px 0;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .user-info span {
        display: none; /* Ocultar nombre en móviles */
    }
    
    .header .container {
        gap: 10px;
    }
    
    .user-photo {
        width: 32px;
        height: 32px;
    }
    
    .btn-logout {
        padding: 8px 12px;
        font-size: 12px;
        min-width: auto;
    }
    
    .main-content {
        padding: 20px 15px;
        border-radius: 12px;
    }
    
    .main-content h2 {
        font-size: 24px;
    }
    
    .opciones-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .opcion-btn {
        padding: 18px 20px;
        font-size: 16px;
        min-height: 56px; /* Tamaño táctil cómodo */
    }
    
    .game-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-top: 12px;
    }
    
    .stat-item {
        padding: 15px 10px;
    }
    
    .stat-label {
        font-size: 11px;
        margin-bottom: 8px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .tematicas-grid,
    .juegos-grid,
    .niveles-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .tematica-card,
    .juego-card,
    .nivel-card {
        padding: 20px;
    }
    
    .game-header {
        padding: 15px;
        top: 50px;
        border-radius: 10px;
    }
    
    .game-container {
        padding: 10px;
        min-height: calc(100vh - 150px);
    }
    
    .game-header {
        position: relative;
        top: 0;
        margin-bottom: 15px;
    }
    
    .game-content {
        padding: 30px 20px;
        min-height: auto;
    }
    
    .pregunta-texto {
        padding: 25px 20px;
        margin-bottom: 30px;
    }
    
    .pregunta-texto h3 {
        font-size: 22px;
    }
    
    .bandera-emoji {
        font-size: 80px;
        padding: 20px;
    }
    
    .bandera-imagen {
        width: 150px;
    }
    
    .game-results {
        padding: 30px 20px;
    }
    
    .game-results h2 {
        font-size: 28px;
    }
    
    .results-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .result-item {
        padding: 20px 15px;
    }
    
    .result-value {
        font-size: 36px;
    }
    
    .results-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .results-actions .btn-primary,
    .results-actions .btn-secondary {
        width: 100%;
        padding: 15px;
    }
    
    .historial-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 0;
    }
    
    .detail-row .label {
        min-width: auto;
        margin-bottom: 5px;
        font-size: 13px;
    }
    
    .btn-back {
        font-size: 14px;
        margin-bottom: 15px;
        padding: 8px 12px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
    
    .btn-back-small {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    .footer {
        padding: 30px 15px 15px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .footer-bottom {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 18px;
    }
    
    .main-content h2 {
        font-size: 20px;
    }
    
    .pregunta-texto h3 {
        font-size: 18px;
        line-height: 1.5;
    }
    
    .bandera-emoji {
        font-size: 60px;
        padding: 15px;
    }
    
    .bandera-imagen {
        width: 120px;
    }
    
    .bandera-display {
        min-height: 150px;
        margin-bottom: 20px;
    }
    
    .opcion-btn {
        padding: 16px 18px;
        font-size: 15px;
    }
    
    .game-stats {
        gap: 8px;
    }
    
    .stat-item {
        padding: 12px 8px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 14px 20px;
        font-size: 15px;
        width: 100%;
        text-align: center;
        min-height: 48px; /* Más grande en móviles pequeños */
    }
    
    .nivel-card .btn-primary,
    .nivel-card .btn-secondary {
        width: 100%;
        margin-top: 10px;
    }
    
    .nivel-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .nivel-actions .btn-primary,
    .nivel-actions .btn-secondary {
        width: 100%;
    }
    
    .tematica-icon {
        font-size: 40px;
    }
    
    .tematica-card h3,
    .juego-card h3,
    .nivel-card h4 {
        font-size: 18px;
    }
    
    .tematica-card p,
    .juego-card p,
    .nivel-card p {
        font-size: 13px;
    }
    
    .opcion-btn {
        min-height: 60px; /* Más grande en móviles pequeños para facilitar el toque */
    }
}

