:root {
    --bg: #0b0b0d;
    --card-bg: #16161a;
    --blue: #3b82f6;
    --yellow: #facc15;
    --text: #a1a1aa;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    color: white;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

#particleCanvas {
    position: fixed;
    top: 0; left: 0;
    z-index: -1;
}

header {
    padding: 40px 20px;
    text-align: center;
}

#gameTitle {
    font-family: 'Press Start 2P', cursive;
    color: var(--blue);
    font-size: clamp(1.2rem, 4vw, 2.5rem);
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
    margin: 0;
}

.container {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 50px;
}

/* Grid Responsivo */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.hidden { display: none !important; }
.visible-flex { display: flex !important; }

/* Estilo de Tarjetas */
.game-card {
    background: var(--card-bg);
    border: 1px solid #27272a;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.game-card:hover {
    transform: translateY(-8px);
    border-color: var(--blue);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.card-img-container {
    width: 100%;
    aspect-ratio: 16 / 9; /* Esto hace que todas las fotos midan lo mismo */
    overflow: hidden;
    background: #000;
}

.card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Evita que la imagen se estire feo */
    transition: transform 0.5s ease;
}

.game-card:hover .card-img-container img {
    transform: scale(1.1);
}

.card-content {
    padding: 20px;
    text-align: center;
}

.card-content p {
    color: var(--text);
    font-size: 0.9rem;
    margin-bottom: 20px;
    height: 40px; /* Alinea los botones aunque el texto sea corto */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Botones */
.btn-play {
    width: 100%;
    background: var(--blue);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    cursor: pointer;
    transition: 0.3s;
}

.btn-play:hover {
    background: var(--yellow);
    color: #000;
    box-shadow: 0 0 15px var(--yellow);
}

/* Vista del Juego */
#gameView {
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.player-frame {
    width: 100%;
    max-width: 900px;
    aspect-ratio: 4 / 3; /* Proporción clásica de Flash */
    background: #000;
    border: 4px solid #27272a;
    border-radius: 15px;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
}

.btn-back {
    margin-top: 30px;
    background: transparent;
    color: white;
    border: 2px solid var(--blue);
    padding: 10px 25px;
    border-radius: 8px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    cursor: pointer;
    transition: 0.3s;
}

.btn-back:hover {
    background: var(--blue);
}

/* Ajustes para Móviles */
@media (max-width: 600px) {
    .menu-grid {
        grid-template-columns: 1fr;
    }
    
    .player-frame {
        aspect-ratio: 1 / 1; /* Más cuadrado en móviles */
    }

    #gameTitle {
        font-size: 1rem;
    }
}