* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    /* Slate 900 to Slate 800 */
    min-height: 100vh;
    color: #f8fafc;
}

.container {
    text-align: center;
}

/* Menú Principal */
.menu {
    position: relative;
    z-index: 1000;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.menu-content {
    background-color: #1e293b;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    min-width: 500px;
    max-width: 600px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-content h1 {
    margin-bottom: 10px;
    color: #f8fafc;
    font-size: 2.5em;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.menu-subtitle {
    margin-bottom: 30px;
    color: #94a3b8;
    font-size: 1.1em;
}

.menu-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.menu-button {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #334155;
    /* Slate 700 */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.menu-button:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.menu-button:hover .menu-button-text h3,
.menu-button:hover .menu-button-text p {
    color: white;
}

.menu-button-icon {
    font-size: 3em;
    min-width: 60px;
    text-align: center;
}

.menu-button-text h3 {
    margin: 0 0 5px 0;
    color: #f8fafc;
    font-size: 1.5em;
    transition: color 0.3s;
}

.menu-button-text p {
    margin: 0;
    color: #94a3b8;
    font-size: 0.95em;
    transition: color 0.3s;
}

/* Modal de jugadores */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #1e293b;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    min-width: 350px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-content h2 {
    margin-bottom: 10px;
    color: #f8fafc;
    font-size: 2em;
}

.modal-content .subtitle {
    margin-bottom: 30px;
    color: #818cf8;
    font-size: 0.95em;
    font-weight: 500;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #94a3b8;
    font-weight: bold;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #334155;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
    background-color: #0f172a;
    color: #f8fafc;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.input-group select {
    cursor: pointer;
}

#startGame {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

#startGame:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Juego */
.hidden {
    display: none !important;
}

h1 {
    color: #333;
    margin-bottom: 20px;
    font-size: 2.5em;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 0 20px;
}

#currentPlayer {
    font-size: 1.5em;
    color: #555;
}

#resetGame {
    padding: 12px 24px;
    background-color: #ff6b6b;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

#resetGame:hover {
    background-color: #ff5252;
    transform: translateY(-2px);
}


/* Los estilos específicos de cada juego ahora están en sus carpetas correspondientes */

.parent {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 0;
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.div12 {
    grid-column: span 2 / span 2;
    grid-row: span 2 / span 2;
}

.div13 {
    grid-column: span 2 / span 2;
    grid-row: span 2 / span 2;
    grid-column-start: 1;
    grid-row-start: 3;
}

.div14 {
    grid-column: span 2 / span 2;
    grid-row: span 2 / span 2;
    grid-column-start: 8;
    grid-row-start: 1;
}

.div15 {
    grid-column: span 2 / span 2;
    grid-row: span 2 / span 2;
    grid-column-start: 1;
    grid-row-start: 5;
}

.div16 {
    grid-column: span 2 / span 2;
    grid-row: span 2 / span 2;
    grid-column-start: 8;
    grid-row-start: 3;
}

.div17 {
    grid-column: span 2 / span 2;
    grid-row: span 2 / span 2;
    grid-column-start: 8;
    grid-row-start: 5;
}

.div18 {
    grid-column: span 5 / span 5;
    grid-row: span 6 / span 6;
    grid-column-start: 3;
    grid-row-start: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .menu-content {
        min-width: 100%;
        max-width: 100%;
        padding: 20px 10px;
        text-align: center;
    }

    .menu-content h1 {
        font-size: 2em;
    }

    .menu-button {
        padding: 14px;
        gap: 12px;
    }

    .menu-button-icon {
        font-size: 2.2em;
        min-width: 50px;
    }

    .menu-button-text h3 {
        font-size: 1.05em;
    }

    .menu-button-text p {
        font-size: 0.8em;
    }

    .modal-content {
        min-width: 280px;
        padding: 25px 18px;
    }

    /* Ajuste de publicidad en mobile: Solo arriba y abajo */
    .parent {
        display: flex;
        flex-direction: column;
        width: 100%;
        min-height: 100vh;
    }

    /* Mostrar div12 arriba como banner y ocultar el resto de laterales */
    .div12 {
        display: block !important;
        width: 100%;
        order: 2;
        padding: 8px 0;
        text-align: center;
    }

    .div13,
    .div14,
    .div15,
    .div16,
    .div17,
    .side-ad-fixed {
        display: none !important;
    }

    .div18 {
        width: 100%;
        padding: 0;
        flex: 1;
    }
}

/* Optimización adicional para móviles pequeños */
@media (max-width: 480px) {
    .menu-content {
        padding: 16px 8px;
        text-align: center;
    }

    .menu-content h1 {
        font-size: 1.8em;
    }

    .menu-button {
        padding: 12px;
        gap: 10px;
    }

    .menu-button-icon {
        font-size: 2em;
        min-width: 45px;
    }

    .menu-button-text h3 {
        font-size: 1em;
    }

    .menu-button-text p {
        font-size: 0.75em;
    }

    .modal-content {
        min-width: 260px;
        padding: 20px 15px;
    }
}