/* ========================================
   ESTILOS EXCLUSIVOS PARA LA PÁGINA DE JUEGOS
   ======================================== */

/* Hero de Juegos */
.games-hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8rem 5% 4rem;
    position: relative;
    z-index: 1;
    gap: 4rem;
}

.games-hero-content {
    flex: 1;
    animation: fadeInLeft 1s ease-out;
}

.games-stats-mini {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.mini-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: rgba(26, 31, 58, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    border: 1px solid rgba(0, 255, 136, 0.3);
    transition: transform 0.3s;
}

.mini-stat:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.3);
}

.mini-stat-icon {
    font-size: 1.5rem;
}

.mini-stat-text {
    color: var(--text-light);
    font-weight: 500;
}

/* Visual de Juegos */
.games-visual {
    flex: 1;
    position: relative;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInRight 1s ease-out;
}

.game-icon {
    font-size: 10rem;
    animation: float-up-down 3s ease-in-out infinite;
    filter: drop-shadow(0 0 30px var(--primary-green));
}

.game-particles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.game-particle {
    position: absolute;
    font-size: 3rem;
    animation: orbit 20s linear infinite;
    filter: drop-shadow(0 0 10px var(--primary-green));
}

.game-particle:nth-child(1) {
    animation-delay: 0s;
    animation-duration: 15s;
}

.game-particle:nth-child(2) {
    animation-delay: -3s;
    animation-duration: 18s;
}

.game-particle:nth-child(3) {
    animation-delay: -6s;
    animation-duration: 20s;
}

.game-particle:nth-child(4) {
    animation-delay: -9s;
    animation-duration: 22s;
}

.game-particle:nth-child(5) {
    animation-delay: -12s;
    animation-duration: 17s;
}

@keyframes orbit {
    0% {
        transform: rotate(0deg) translateX(150px) rotate(0deg);
    }
    100% {
        transform: rotate(360deg) translateX(150px) rotate(-360deg);
    }
}

/* Descripción de Sección */
.section-description {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem;
    font-size: 1.2rem;
    color: var(--text-gray);
    line-height: 1.8;
}

/* Panel de Logros */
.achievements-panel {
    margin-top: 3rem;
    padding: 2rem;
    background: rgba(26, 31, 58, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 2px solid rgba(0, 255, 136, 0.2);
}

.achievements-panel h3 {
    color: var(--primary-green);
    font-size: 1.8rem;
    margin-bottom: 2rem;
    text-align: center;
}

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

.achievement-item {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    transition: all 0.3s;
}

.achievement-item.locked {
    opacity: 0.5;
    filter: grayscale(1);
}

.achievement-item.unlocked {
    background: rgba(0, 255, 136, 0.1);
    border-color: var(--primary-green);
    animation: unlockPulse 0.6s ease;
}

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

.achievement-badge {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.achievement-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-light);
    margin-bottom: 0.3rem;
}

.achievement-requirement {
    font-size: 0.9rem;
    color: var(--text-gray);
}

/* Sección de Consejos */
.tips-section {
    padding: 6rem 5%;
    position: relative;
    z-index: 1;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.tip-card {
    padding: 2rem;
    background: rgba(26, 31, 58, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 2px solid rgba(0, 255, 136, 0.2);
    text-align: center;
    transition: all 0.3s;
    animation: fadeInUp 1s ease-out;
}

.tip-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 255, 136, 0.3);
    border-color: var(--primary-green);
}

.tip-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

.tip-card h3 {
    color: var(--primary-green);
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
}

.tip-card p {
    color: var(--text-gray);
    line-height: 1.6;
}

/* Footer Link */
.footer-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--primary-green);
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.3s;
}

.footer-link:hover {
    transform: translateX(10px);
    text-decoration: underline;
}

/* ========================================
   RESPONSIVE DESIGN - TABLETS
   Breakpoint: 1024px (tablets en horizontal)
   ======================================== */
@media (max-width: 1024px) {
    /* Navegación */
    .navbar {
        padding: 1rem 3%;
    }
    
    .nav-links {
        gap: 1.5rem;
        font-size: 0.95rem;
    }
    
    /* Hero de juegos */
    .games-hero {
        padding: 7rem 3% 3rem;  /* Aumentado para tablets */
        gap: 2rem;
    }
    
    .glitch {
        font-size: 3rem;
    }
    
    .games-stats-mini {
        gap: 1.5rem;
    }
    
    .games-visual {
        height: 350px;
    }
    
    .game-icon {
        font-size: 8rem;
    }
    
    /* Juegos */
    .quiz-section,
    .tree-game-section {
        padding: 5rem 3%;
    }
    
    /* Quiz */
    .quiz-container {
        padding: 2.5rem;
    }
    
    .quiz-options {
        gap: 1rem;
    }
    
    /* Árbol */
    .tree-game-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Logros */
    .achievements-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Consejos */
    .tips-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   RESPONSIVE DESIGN - TABLETS VERTICAL
   Breakpoint: 768px (tablets en vertical)
   ======================================== */
@media (max-width: 768px) {
    /* Navegación */
    .navbar {
        padding: 1rem 3%;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .logo {
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
    }
    
    .nav-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
        font-size: 0.9rem;
    }
    
    /* Hero de juegos - Layout vertical */
    .games-hero {
        flex-direction: column;
        text-align: center;
        padding: 6rem 5% 3rem;  /* Aumentado de 5rem a 6rem */
        min-height: auto;
    }
    
    .games-hero-content {
        animation: fadeInUp 1s ease-out;
    }
    
    .glitch {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .games-visual {
        height: 300px;
        width: 100%;
        margin-top: 2rem;
    }
    
    .game-icon {
        font-size: 6rem;
    }
    
    .game-particle {
        font-size: 2rem;
    }
    
    @keyframes orbit {
        0% {
            transform: rotate(0deg) translateX(80px) rotate(0deg);
        }
        100% {
            transform: rotate(360deg) translateX(80px) rotate(-360deg);
        }
    }
    
    .games-stats-mini {
        justify-content: center;
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    .mini-stat {
        padding: 0.8rem 1.2rem;
        flex: 1 1 auto;
        min-width: 140px;
    }
    
    /* Secciones */
    .quiz-section,
    .tree-game-section,
    .tips-section {
        padding: 4rem 5%;
    }
    
    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    .section-description {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    /* Quiz */
    .quiz-container {
        padding: 2rem 1.5rem;
    }
    
    .quiz-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .quiz-progress {
        margin-left: 0;
        width: 100%;
    }
    
    .quiz-question {
        font-size: 1.2rem;
    }
    
    .quiz-options {
        gap: 1rem;
    }
    
    .quiz-option {
        padding: 1rem;
    }
    
    .option-letter {
        font-size: 1rem;
        min-width: 30px;
        height: 30px;
    }
    
    .option-text {
        font-size: 0.95rem;
    }
    
    /* Juego de árboles */
    .tree-game-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .tree-game-area {
        min-height: 400px;
        padding: 2rem 1rem;
    }
    
    .plant-tree-btn {
        padding: 1.2rem 2rem;
        font-size: 1.1rem;
    }
    
    .tree-forest {
        min-height: 180px;
    }
    
    /* Logros */
    .achievements-panel {
        padding: 1.5rem;
    }
    
    .achievements-panel h3 {
        font-size: 1.5rem;
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .achievement-item {
        padding: 1.2rem;
    }
    
    /* Consejos */
    .tips-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .tip-card {
        padding: 1.5rem;
    }
    
    /* Footer */
    .footer {
        padding: 3rem 5% 2rem;
    }
}

/* ========================================
   RESPONSIVE DESIGN - MÓVILES
   Breakpoint: 480px (teléfonos móviles)
   ======================================== */
@media (max-width: 480px) {
    /* Navegación compacta */
    .navbar {
        padding: 0.8rem 4%;
    }
    
    .logo {
        font-size: 1.3rem;
    }
    
    .nav-links {
        gap: 0.5rem;
        font-size: 0.75rem;
    }
    
    .nav-links li a {
        padding: 0.4rem 0.6rem;
    }
    
    /* Hero extra compacto */
    .games-hero {
        padding: 5rem 4% 2rem;  /* Aumentado de 4rem a 5rem */
    }
    
    .glitch {
        font-size: 1.8rem;
        line-height: 1.1;
    }
    
    .subtitle {
        font-size: 0.95rem;
        margin: 1rem 0;
    }
    
    .games-visual {
        height: 250px;
    }
    
    .game-icon {
        font-size: 5rem;
    }
    
    .game-particle {
        font-size: 1.5rem;
    }
    
    @keyframes orbit {
        0% {
            transform: rotate(0deg) translateX(60px) rotate(0deg);
        }
        100% {
            transform: rotate(360deg) translateX(60px) rotate(-360deg);
        }
    }
    
    .games-stats-mini {
        gap: 0.8rem;
    }
    
    .mini-stat {
        padding: 0.6rem 1rem;
        min-width: 120px;
    }
    
    .mini-stat-icon {
        font-size: 1.2rem;
    }
    
    .mini-stat-text {
        font-size: 0.85rem;
    }
    
    /* Secciones extra compactas */
    .quiz-section,
    .tree-game-section,
    .tips-section {
        padding: 3rem 4%;
    }
    
    .section-title {
        font-size: 1.6rem;
        margin-bottom: 1.5rem;
    }
    
    .section-description {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
    
    /* Quiz móvil */
    .quiz-container {
        padding: 1.5rem 1rem;
        border-radius: 20px;
    }
    
    .quiz-score {
        font-size: 0.9rem;
    }
    
    .quiz-question {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .quiz-options {
        gap: 0.8rem;
    }
    
    .quiz-option {
        padding: 0.8rem;
        border-radius: 12px;
    }
    
    .option-letter {
        font-size: 0.9rem;
        min-width: 28px;
        height: 28px;
    }
    
    .option-text {
        font-size: 0.85rem;
    }
    
    .quiz-feedback {
        font-size: 0.9rem;
        padding: 0.8rem;
    }
    
    .quiz-next-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    /* Juego de árboles móvil */
    .tree-game-stats {
        gap: 0.8rem;
    }
    
    .tree-stat {
        padding: 1rem;
    }
    
    .tree-stat-icon {
        font-size: 2rem;
    }
    
    .tree-stat-number {
        font-size: 1.5rem;
    }
    
    .tree-stat-label {
        font-size: 0.75rem;
    }
    
    .tree-game-area {
        min-height: 350px;
        padding: 1.5rem 0.8rem;
    }
    
    .plant-tree-btn {
        padding: 1rem 1.8rem;
        font-size: 1rem;
    }
    
    .btn-icon {
        font-size: 1.5rem;
    }
    
    .tree-forest {
        min-height: 150px;
    }
    
    .tree {
        font-size: 2rem;
    }
    
    .achievement-popup {
        padding: 1.5rem;
        max-width: 280px;
    }
    
    .achievement-icon {
        font-size: 3rem;
    }
    
    .achievement-text {
        font-size: 1.2rem;
    }
    
    .tree-game-info {
        padding: 1rem;
        font-size: 0.85rem;
    }
    
    /* Logros móvil */
    .achievements-panel {
        padding: 1.2rem;
    }
    
    .achievements-panel h3 {
        font-size: 1.3rem;
        margin-bottom: 1.5rem;
    }
    
    .achievements-grid {
        gap: 1rem;
    }
    
    .achievement-item {
        padding: 1rem;
    }
    
    .achievement-badge {
        font-size: 2.5rem;
    }
    
    .achievement-name {
        font-size: 0.95rem;
    }
    
    .achievement-requirement {
        font-size: 0.8rem;
    }
    
    /* Consejos móvil */
    .tips-grid {
        gap: 1.2rem;
    }
    
    .tip-card {
        padding: 1.2rem;
    }
    
    .tip-icon {
        font-size: 3rem;
        margin-bottom: 0.8rem;
    }
    
    .tip-card h3 {
        font-size: 1.1rem;
        margin-bottom: 0.6rem;
    }
    
    .tip-card p {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    /* Footer móvil */
    .footer {
        padding: 2rem 4% 1.5rem;
    }
    
    .footer-content p {
        font-size: 0.9rem;
    }
    
    .footer-small {
        font-size: 0.75rem;
    }
    
    .footer-link {
        font-size: 0.9rem;
    }
}

/* Ajustes para mejorar la experiencia en la página de juegos */
.quiz-section,
.tree-game-section {
    scroll-margin-top: 100px;
}

/* Animación especial para el botón de plantar en la página de juegos */
.plant-tree-btn {
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
}

/* Mejoras visuales para el quiz en página independiente */
.quiz-container {
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

/* Efecto de entrada para las tarjetas de consejos */
.tip-card:nth-child(1) { animation-delay: 0.1s; }
.tip-card:nth-child(2) { animation-delay: 0.2s; }
.tip-card:nth-child(3) { animation-delay: 0.3s; }
.tip-card:nth-child(4) { animation-delay: 0.4s; }

/* ========================================
   MEJORAS PARA DISPOSITIVOS TÁCTILES
   ======================================== */

/* Aumentar área de toque en elementos interactivos */
@media (hover: none) and (pointer: coarse) {
    /* Botones más grandes para dedos */
    a, button {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Desactivar efectos hover en táctiles */
    .games-cta-feature:hover,
    .tip-card:hover,
    .achievement-item:hover {
        transform: none;
    }
    
    /* Activar efectos al hacer tap */
    .games-cta-feature:active,
    .tip-card:active {
        transform: scale(0.98);
    }
    
    /* Mejorar botones táctiles */
    .plant-tree-btn,
    .quiz-option,
    .quiz-next-btn {
        padding: 1.2rem 2rem;
    }
    
    /* Opciones del quiz más fáciles de tocar */
    .quiz-option {
        min-height: 60px;
    }
}

/* ========================================
   OPTIMIZACIONES DE RENDIMIENTO
   ======================================== */

/* Usar aceleración GPU para animaciones suaves */
.game-icon,
.game-particle,
.floating-game-icons,
.tip-card,
.achievement-item,
.tree {
    will-change: transform;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* ========================================
   MEJORAS DE ACCESIBILIDAD
   ======================================== */

/* Mejores contornos de foco para navegación por teclado */
.quiz-option:focus-visible,
.plant-tree-btn:focus-visible,
button:focus-visible {
    outline: 3px solid var(--primary-green);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Reducir movimiento para usuarios con preferencias de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========================================
   MODO LANDSCAPE EN MÓVILES
   ======================================== */
@media (max-height: 500px) and (orientation: landscape) {
    /* Hero más compacto en landscape */
    .games-hero {
        min-height: auto;
        padding: 3rem 5% 2rem;
    }
    
    .games-visual {
        height: 200px;
    }
    
    .game-icon {
        font-size: 4rem;
    }
    
    /* Navegación más compacta */
    .navbar {
        padding: 0.5rem 3%;
    }
    
    /* Juegos más compactos */
    .quiz-section,
    .tree-game-section,
    .tips-section {
        padding: 2rem 5%;
    }
    
    .quiz-container {
        padding: 1.5rem;
    }
    
    .tree-game-area {
        min-height: 300px;
    }
}

/* ========================================
   IMPRESIÓN
   ======================================== */
@media print {
    /* Ocultar elementos no necesarios */
    .navbar,
    .games-visual,
    .plant-tree-btn,
    .quiz-options,
    .footer-wave,
    .game-particles {
        display: none !important;
    }
    
    /* Ajustar colores para impresión */
    body {
        background: white;
        color: black;
    }
    
    /* Evitar saltos de página */
    .tip-card,
    .achievement-item,
    .quiz-container {
        page-break-inside: avoid;
    }
}
