:root {
    --cell-size: min(11vw, 65px);
    --primary-color: #f0f0f0;
    --board-color: #0057b3; /* Classic Connect Four blue */
    --accent-color: #28a745;
    --p1-color: #dc3545; /* Rood */
    --p2-color: #ffc107; /* Geel */
    --gap-size: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--primary-color);
    color: var(--board-color);
    margin: 0;
    padding: 1rem;
    box-sizing: border-box;
}

.game-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.game-title {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    margin-bottom: 0.5rem;
}

.score-board {
    font-size: clamp(1rem, 4vw, 1.2rem);
    font-weight: bold;
    margin-bottom: 1rem;
    color: #333; /* Zorg voor leesbaarheid van de score */
}
.score-board .p1-score { color: var(--p1-color); }
.score-board .p2-score { color: var(--p2-color); }


.game-status {
    font-size: clamp(1rem, 4vw, 1.2rem);
    margin-bottom: 1rem;
    min-height: 1.5em;
    color: #333;
    transition: transform 0.2s ease;
}

.status-update {
    animation: status-flash 0.5s ease;
}

@keyframes status-flash {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.game-board {
    display: grid;
    grid-template-columns: repeat(7, var(--cell-size));
    grid-template-rows: repeat(6, var(--cell-size));
    gap: var(--gap-size);
    background-color: var(--board-color);
    padding: var(--gap-size);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    cursor: pointer;
}

.cell {
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease;
}

/* Fiches van de spelers */
.cell.p1 {
    background-color: var(--p1-color);
    animation: drop 0.4s ease-out;
}
.cell.p2 {
    background-color: var(--p2-color);
    animation: drop 0.4s ease-out;
}

@keyframes drop {
    from {
        transform: translateY(-300%);
        opacity: 0.8;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.reset-button {
    margin-top: 1.5rem;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: bold;
    color: white;
    background-color: var(--accent-color);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.reset-button:hover {
    background-color: #218838;
    transform: translateY(-2px);
}

/* --- Winnaar Overlay --- */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.overlay-content {
    background-color: white;
    padding: 2rem 3rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.overlay.visible .overlay-content {
    transform: scale(1);
}

#winner-text {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
}
