:root {
    --electric-blue: #00A6FF;
    --dark-blue: #005696;
    --black: #1A1A1A;
    --white: #F0F0F0;
}

body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--black);
    color: var(--white);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.5s ease-in-out;
}

/* Header */
header {
    background-color: var(--black);
    color: var(--electric-blue);
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--dark-blue);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header h1 {
    margin: 0;
    font-size: 2.5em;
    font-weight: bold;
    text-shadow: 0 0 10px var(--electric-blue);
    transition: transform 0.3s ease-in-out;
}

header h1:hover {
    transform: scale(1.05);
}

header nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

header nav ul li {
    margin-left: 20px;
}

.nav-link {
    color: var(--electric-blue);
    text-decoration: none;
    font-size: 1.2em;
    font-weight: 500;
    transition: color 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.nav-link:hover {
    color: var(--dark-blue);
    transform: scale(1.1);
}

/* Main Content */
main {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    flex-direction: column;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    max-width: 1200px;
    width: 100%;
}

.game-square {
    background-color: var(--dark-blue);
    border: 2px solid var(--electric-blue);
    border-radius: 15px;
    aspect-ratio: 1 / 1; /* Makes the squares responsive */
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease-in-out;
    position: relative;
    overflow: hidden;
}

.game-square:hover {
    transform: scale(1.08) rotate(2deg);
    box-shadow: 0 8px 30px rgba(0, 166, 255, 0.6);
}

.game-square:active {
    transform: scale(0.95);
}

.game-name {
    color: var(--white);
    font-size: 1.5em;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    transition: color 0.3s ease-in-out;
}

.game-square:hover .game-name {
    color: var(--electric-blue);
}

/* Footer */
footer {
    background-color: var(--black);
    color: var(--white);
    text-align: center;
    padding: 20px;
    border-top: 2px solid var(--dark-blue);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-content p {
    margin: 0 0 10px 0;
    font-size: 0.9em;
}

.footer-content nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
}

.footer-content nav ul li {
    margin: 0 15px;
}

.footer-link {
    color: var(--electric-blue);
    text-decoration: none;
    font-size: 1em;
    transition: color 0.3s ease-in-out, text-decoration 0.3s ease-in-out;
}

.footer-link:hover {
    color: var(--dark-blue);
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 992px) {
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .game-grid {
        grid-template-columns: 1fr;
    }

    header {
        flex-direction: column;
    }

    header nav ul {
        margin-top: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    header nav ul li {
        margin: 5px 10px;
    }
}

/* Media Queries para dispositivos móviles y tablets */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    .logo h1 {
        font-size: 1.8em;
    }

    .nav-link, .game-btn, .footer-link {
        font-size: 1em;
    }

    .game-container h2 {
        font-size: 2em;
    }

    .score-display {
        font-size: 1.2em;
    }

    /* Reducir el tamaño del canvas y los botones en móviles */
    #game-board {
        width: 300px;
        height: 300px;
    }
}

/* Estilos para la página de instrucciones */
.instructions-section {
    padding: 40px 20px;
    display: flex;
    justify-content: center;
}

.instructions-container {
    max-width: 800px;
    width: 100%;
    background-color: rgba(30, 30, 30, 0.8);
    color: #f0f0f0;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.instructions-container h1 {
    font-size: 2.5em;
    color: var(--electric-blue);
    margin-bottom: 20px;
    text-align: center;
}

.instructions-container h2 {
    font-size: 2em;
    color: var(--electric-blue);
    margin-top: 30px;
}

.instructions-container h3 {
    font-size: 1.5em;
    color: #fff;
    margin-top: 20px;
}

.instructions-container p {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 15px;
}

.rule-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.rule-item {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 8px;
}

ul {
    list-style-type: none;
    padding: 0;
}

ul li {
    font-size: 1.1em;
    line-height: 1.8;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
}

/* Estilos para el botón "Juega ahora" */
.play-now-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0 80px 0; /* Espacio arriba y abajo */
}

.play-now-btn {
    display: inline-block;
    padding: 15px 30px;
    font-size: 1.5em;
    font-weight: bold;
    text-decoration: none;
    color: var(--white);
    background-color: var(--electric-blue); /* Color de fondo vibrante */
    border: 2px solid var(--electric-blue);
    border-radius: 8px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.play-now-btn:hover {
    background-color: var(--dark-blue); /* Color de fondo más oscuro al pasar el ratón */
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
