* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    text-align: center;
}

/* 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: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    min-width: 350px;
}

.modal-content h2 {
    margin-bottom: 10px;
    color: #333;
    font-size: 2em;
}

.modal-content .subtitle {
    margin-bottom: 30px;
    color: #667eea;
    font-size: 0.95em;
    font-weight: 500;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: bold;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    background-color: white;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #667eea;
}

.input-group select {
    cursor: pointer;
}

#startGame {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 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;
}

#gameContainer {
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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;
}

.button-group {
    display: flex;
    gap: 10px;
}

.play-again-btn {
    padding: 12px 24px;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.play-again-btn:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

#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);
}

/* Tablero */
#board {
    display: inline-grid;
    grid-template-columns: repeat(7, 70px);
    grid-template-rows: repeat(6, 70px);
    gap: 10px;
    background-color: #0066cc;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.cell {
    width: 70px;
    height: 70px;
    background-color: white;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.cell:hover:not(.filled) {
    background-color: #e0e0e0;
    transform: scale(1.05);
}

.cell.filled {
    cursor: default;
}

.cell.red {
    background-color: #ff4444;
    animation: drop 0.5s ease-out;
}

.cell.yellow {
    background-color: #ffcc00;
    animation: drop 0.5s ease-out;
}

@keyframes drop {
    0% {
        transform: translateY(-400px);
        opacity: 0;
    }
    60% {
        transform: translateY(10px);
    }
    80% {
        transform: translateY(-5px);
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Celda ganadora */
.cell.winning {
    animation: winningPulse 0.6s ease-in-out;
    box-shadow: 0 0 20px 5px rgba(255, 215, 0, 0.8), inset 0 0 20px rgba(255, 215, 0, 0.5);
    border: 3px solid gold;
    transform: scale(1.1);
    z-index: 10;
}

@keyframes winningPulse {
    0%, 100% {
        box-shadow: 0 0 20px 5px rgba(255, 215, 0, 0.8), inset 0 0 20px rgba(255, 215, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 30px 10px rgba(255, 215, 0, 1), inset 0 0 30px rgba(255, 215, 0, 0.7);
    }
}

/* Mensaje de ganador */
.message {
    margin-top: 30px;
    padding: 20px;
    background-color: #4caf50;
    color: white;
    border-radius: 10px;
    font-size: 1.5em;
    font-weight: bold;
    animation: fadeIn 0.5s;
}

.message.draw {
    background-color: #ff9800;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    #board {
        grid-template-columns: repeat(7, 50px);
        grid-template-rows: repeat(6, 50px);
        gap: 8px;
    }

    .cell {
        width: 50px;
        height: 50px;
    }

    .modal-content {
        min-width: 300px;
        padding: 30px;
    }
}
