body {
    font-family: 'Arial', sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #333;
}

.game-container {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    width: 100%;
    text-align: center;
}

h1 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

#gameInfo {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
}

#message {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    min-height: 1.5rem;
}

.hidden {
    display: none;
}

#board {
    display: grid;
    grid-template-columns: repeat(var(--cols, 8), 1fr);
    gap: 8px;
    background-color: #3498db;
    padding: 15px;
    border-radius: 10px;
    margin: 0 auto 1.5rem;
    width: fit-content;
}

.cell {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.2);
}

.cell:not(.taken):hover {
    background-color: #e6e6e6;
}

.cell.taken {
    cursor: default;
}

/* Colores de jugadores */
.cell.red {
    background-color: #e74c3c;
    transition: opacity 0.3s ease;
}

.cell.yellow {
    background-color: #f1c40f;
    transition: opacity 0.3s ease;
}

.cell.purple {
    background-color: #a569bd;
    transition: opacity 0.3s ease;
}

.cell.green {
    background-color: #2ecc71;
    transition: opacity 0.3s ease;
}

@keyframes drop {
    from {
        transform: translateY(-600px);
    }
    to {
        transform: translateY(0);
    }
}

.controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background-color: #3498db;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    min-width: 120px;
}

button:hover {
    background-color: #2980b9;
}

#resetButton {
    background-color: #e74c3c;
}

#resetButton:hover {
    background-color: #c0392b;
}

.instructions {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    text-align: left;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.instructions h2 {
    margin-top: 0;
    color: #2c3e50;
}

.instructions ol {
    padding-left: 1.2rem;
    margin-bottom: 0;
}

#playerColor {
    font-weight: bold;
}

.player-count-selector {
    margin: 10px 0;
}

.player-count-selector select {
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.board-size-selector {
    margin: 10px 0;
}

.board-size-selector select {
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

/* Estilos para el modal de ayuda */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.modal-content {
    background: white;
    padding: 2em;
    border-radius: 10px;
    width: 80%;
    max-width: 600px;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 0.5em;
    right: 1em;
    font-size: 1.5em;
    cursor: pointer;
}

.btn-info {
    margin-top: 1em;
    padding: 0.5em 1em;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* Leyenda de colores */
.color-legend {
    margin-top: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 5px 0;
}

.color-dot {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.color-dot.red {
    background-color: #e74c3c;
}

.color-dot.yellow {
    background-color: #f1c40f;
}

.color-dot.purple {
    background-color: #a569bd;
}

.color-dot.green {
    background-color: #2ecc71;
}

/* Estilos responsivos */
@media (max-width: 768px) {
    .game-container {
        padding: 1rem;
    }
    
    #board {
        grid-template-columns: repeat(var(--cols, 8), 35px);
        padding: 10px;
        gap: 6px;
    }
    
    .cell {
        width: 35px;
        height: 35px;
    }
    
    button {
        padding: 8px 16px;
        min-width: 100px;
    }
    
    .player-count-selector,
    .board-size-selector {
        font-size: 0.9rem;
    }
    
    .player-count-selector select,
    .board-size-selector select {
        padding: 4px;
    }
}

@media (max-width: 480px) {
    #board {
        grid-template-columns: repeat(var(--cols, 8), 30px);
    }
    
    .cell {
        width: 30px;
        height: 30px;
    }
    
    .modal-content {
        padding: 1em;
        width: 90%;
    }
}

/* Clase para ocultar elementos */
.hidden {
    display: none !important;
}