/* style.css */

/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Orbitron', sans-serif; /* Fuente futurista/informática */
    background: linear-gradient(135deg, #4b0082, #8a2be2, #9370db); /* Gradiente morado épico */
    color: #fff;
    overflow-x: hidden;
    position: relative;
}

/* Hero Header */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    text-align: center;
    perspective: 1000px; /* Para efectos 3D */
}

.hero-content {
    z-index: 2;
    animation: fadeIn 2s ease-in-out, rotateIn 3s ease-out;
    transform-style: preserve-3d;
}

.hero h1 {
    font-size: 6rem;
    text-shadow: 0 0 20px #ff00ff, 0 0 30px #ff00ff; /* Neón morado */
    letter-spacing: 0.2em;
    animation: glow 2s infinite alternate, flicker 0.5s infinite alternate;
}

.hero .tagline {
    font-size: 1.5rem;
    margin-top: 1rem;
    text-shadow: 0 0 10px #ff00ff;
    animation: pulse 2s infinite;
}

/* Fondo de circuitos animado con múltiples capas */
.circuit-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"%3E%3Cpath d="M0 50 L20 30 L40 50 L60 30 L80 50 L100 30" stroke="%23ff00ff" stroke-width="2" fill="none" /%3E%3Cpath d="M0 70 L20 90 L40 70 L60 90 L80 70 L100 90" stroke="%23ff00ff" stroke-width="2" fill="none" /%3E%3C/svg%3E') repeat; /* Patrón de circuitos simple */
    opacity: 0.2;
    animation: circuitMove 20s linear infinite, opacityPulse 5s infinite alternate;
}

.circuit-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"%3E%3Cpath d="M10 10 L30 50 L50 10 L70 50 L90 10" stroke="%238a2be2" stroke-width="1" fill="none" /%3E%3C/svg%3E') repeat;
    opacity: 0.1;
    animation: circuitMoveReverse 15s linear infinite;
}

/* Partículas animadas (efecto de estrellas o bits flotantes) */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.particles::before {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    background: #ff00ff;
    box-shadow: 0 0 10px #ff00ff;
    animation: particleFall 5s linear infinite;
    left: 10%;
    top: -10px;
}

.particles::after {
    content: '';
    position: absolute;
    width: 3px;
    height: 3px;
    background: #8a2be2;
    box-shadow: 0 0 15px #8a2be2;
    animation: particleFall 7s linear infinite 1s;
    left: 30%;
    top: -20px;
}

/* Más partículas para densidad */
.particles > div:nth-child(1) {
    position: absolute;
    width: 1px;
    height: 1px;
    background: #9370db;
    box-shadow: 0 0 5px #9370db;
    animation: particleFall 4s linear infinite 0.5s;
    left: 50%;
    top: -5px;
}

.particles > div:nth-child(2) {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #ff00ff;
    box-shadow: 0 0 20px #ff00ff;
    animation: particleFall 6s linear infinite 2s;
    left: 70%;
    top: -30px;
}

.particles > div:nth-child(3) {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #4b0082;
    box-shadow: 0 0 10px #4b0082;
    animation: particleFall 8s linear infinite 3s;
    left: 90%;
    top: -15px;
}

/* Secciones con parallax */
.section {
    padding: 100px 0;
    position: relative;
    background-attachment: fixed; /* Efecto parallax básico */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.about-section {
    background: rgba(0, 0, 0, 0.5); /* Fondo semi-transparente para contraste */
    box-shadow: 0 0 50px rgba(255, 0, 255, 0.5);
    animation: sectionFadeIn 1.5s ease-out;
}

.about-section h2,
.games-section h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 0 0 15px #ff00ff;
}

.about-section p {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Animaciones para títulos y textos */
.animated-title {
    opacity: 0;
    animation: slideInLeft 1s forwards, glow 2s infinite alternate;
    animation-delay: 0.5s;
}

.animated-text {
    opacity: 0;
    animation: slideInRight 1s forwards 1s;
}

/* Sección de Juegos */
.games-section {
    background: linear-gradient(135deg, #8a2be2, #4b0082); /* Inverso para variedad */
    animation: sectionFadeIn 1.5s ease-out 0.5s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.games-section h2 {
    text-align: center;
    margin-bottom: 3rem;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.game-card {
    position: relative;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: #fff;
    animation: cardPulse 2s infinite alternate;
}

.game-card:hover {
    transform: scale(1.1) rotateY(10deg); /* Efecto 3D */
    box-shadow: 0 0 30px #ff00ff, 0 0 50px #ff00ff;
    animation: none; /* Detener pulso en hover */
}

.game-title {
    font-size: 2rem;
    z-index: 2;
    text-shadow: 0 0 10px #ff00ff;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,0,255,0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s;
    animation: overlaySpin 5s linear infinite;
}

.game-card:hover .game-overlay {
    opacity: 1;
}

/* Footer con animación fade in */
footer {
    text-align: center;
    padding: 20px;
    background: #4b0082;
    font-size: 0.9rem;
    animation: fadeIn 2s ease-in-out;
}

/* Animaciones avanzadas */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes glow {
    from { text-shadow: 0 0 10px #ff00ff; }
    to { text-shadow: 0 0 30px #ff00ff, 0 0 50px #ff00ff; }
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

@keyframes circuitMove {
    from { background-position: 0 0; }
    to { background-position: 200px 200px; }
}

@keyframes circuitMoveReverse {
    from { background-position: 0 0; }
    to { background-position: -150px -150px; }
}

@keyframes opacityPulse {
    from { opacity: 0.2; }
    to { opacity: 0.4; }
}

@keyframes particleFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

@keyframes rotateIn {
    from { transform: rotateY(-90deg); opacity: 0; }
    to { transform: rotateY(0); opacity: 1; }
}

@keyframes sectionFadeIn {
    from { opacity: 0; transform: translateY(100px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-100px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes cardPulse {
    from { box-shadow: 0 0 10px #ff00ff; }
    to { box-shadow: 0 0 20px #ff00ff; }
}

@keyframes overlaySpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Google Fonts para fuente informática */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');

/* Añadir más partículas dinámicamente si se necesita, pero con CSS puro limitamos a pseudo-elementos */

/* Media Queries para Responsividad */

/* Para pantallas medianas (tablets, max 1024px) */
@media (max-width: 1024px) {
    .hero h1 {
        font-size: 4rem;
    }

    .hero .tagline {
        font-size: 1.2rem;
    }

    .about-section h2,
    .games-section h2 {
        font-size: 2.5rem;
    }

    .about-section p {
        font-size: 1rem;
    }

    .game-card {
        height: 180px;
    }

    .game-title {
        font-size: 1.8rem;
    }

    .section {
        padding: 80px 0;
    }
}

/* Para pantallas pequeñas (móviles, max 768px) */
@media (max-width: 768px) {
    .hero {
        height: 80vh; /* Reducir altura para móviles */
    }

    .hero h1 {
        font-size: 3rem;
        letter-spacing: 0.1em;
    }

    .hero .tagline {
        font-size: 1rem;
        margin-top: 0.5rem;
    }

    .section {
        padding: 60px 0;
    }

    .container {
        padding: 0 15px;
    }

    .about-section h2,
    .games-section h2 {
        font-size: 2rem;
        text-align: center;
    }

    .about-section p {
        font-size: 0.9rem;
        text-align: justify;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.5rem;
    }

    .game-card {
        height: 150px;
    }

    .game-title {
        font-size: 1.5rem;
    }

    footer {
        font-size: 0.8rem;
        padding: 15px;
    }

    /* Optimizar animaciones para móviles: reducir intensidad para mejor rendimiento */
    .hero h1 {
        animation-duration: 3s; /* Animaciones más lentas */
    }

    .particles::before, .particles::after, .particles > div {
        animation-duration: 10s; /* Partículas más lentas */
    }

    .game-card:hover {
        transform: scale(1.05) rotateY(5deg); /* Efecto 3D menos pronunciado */
    }
}

/* Para pantallas muy pequeñas (móviles pequeños, max 480px) */
@media (max-width: 480px) {
    .hero {
        height: 60vh;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero .tagline {
        font-size: 0.9rem;
    }

    .games-grid {
        grid-template-columns: 1fr; /* Una columna en móviles muy pequeños */
        gap: 1rem;
    }

    .game-card {
        height: 120px;
    }

    .game-title {
        font-size: 1.3rem;
    }

    /* Desactivar parallax en móviles para evitar problemas de scroll */
    .section {
        background-attachment: scroll;
    }
}