:root {
    --board-bg: #2c3e50;
    --player1-color: #e67e22;
    --player2-color: #9b59b6;
    --winning-color: #2ecc71; /* Grün für Gewinn-Blinken */
    --slot-width: 70px;
    --slot-height: 70px;
    --slot-margin-v: 5px;
    --slot-margin-h: 5px;
}

body {
    font-family: sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
    color: #333;
    margin-top: 20px;
}

h1 { color: var(--board-bg); }

#game-info {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

#status-text { font-size: 1.2em; margin-right: 20px; }

#reset-button {
    padding: 10px 20px;
    font-size: 1em;
    border: none;
    border-radius: 5px;
    background-color: var(--board-bg);
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}
#reset-button:hover { 
    background-color: #34495e;
}

#game-info label {
    margin-left: 15px;
    font-size: 1em;
    color: #333;
}
#difficulty-select {
    margin-left: 8px;
    padding: 8px;
    font-size: 0.9em;
    border-radius: 5px;
    border: 1px solid #ccc;
    background-color: white;
}

#rules-button {
    margin-left: 10px;
    width: 38px;
    height: 38px;
    font-size: 1.2em;
    font-weight: bold;
    border-radius: 50%;
    border: 2px solid var(--board-bg);
    background-color: white;
    color: var(--board-bg);
    cursor: pointer;
    transition: all 0.3s;
}
#rules-button:hover {
    background-color: var(--board-bg);
    color: white;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px 30px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
}

#game-board {
    position: relative;
}

.piece-container {
    display: flex;
    flex-direction: row;
    padding: 10px;
    border-radius: 10px;
}

#board-overlay-svg {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.column {
    display: flex;
    flex-direction: column-reverse;
    margin: 0 var(--slot-margin-h);
}

.slot {
    width: var(--slot-width);
    height: var(--slot-height);
    margin: var(--slot-margin-v) 0;
    position: relative;
}

.slot .piece {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transform: translateY(-500px);
    animation: drop 0.4s ease-out forwards;
}
@keyframes drop { to { transform: translateY(0); } }

.piece.player1 { background-color: var(--player1-color); }
.piece.player2 { background-color: var(--player2-color); }

.piece.winning {
    animation: blink-animation 1s infinite;
}

@keyframes blink-animation {
    0% {
        box-shadow: 0 0 5px 2px rgba(255, 255, 255, 0.7);
    }
    50% {
        box-shadow: 0 0 20px 10px var(--winning-color);
        transform: scale(1.05);
    }
    100% {
        box-shadow: 0 0 5px 2px rgba(255, 255, 255, 0.7);
    }
}

#game-board.player-win {
    animation: playerWinAnimation 2s ease-in-out forwards;
}

#game-board.player-lose {
    animation: playerLoseAnimation 1.5s ease-in-out forwards;
}

@keyframes playerWinAnimation {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(255, 215, 0, 0);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 0 30px 10px rgba(255, 215, 0, 0.7);
    }
    100% {
        transform: scale(1.02);
        box-shadow: 0 0 20px 5px rgba(255, 215, 0, 0.5);
    }
}

/* GEÄNDERT: Grauton-Filter entfernt */
@keyframes playerLoseAnimation {
    0% {
        transform: translateX(0);
    }
    20% {
        transform: translateX(-5px) rotate(-1deg);
    }
    40% {
        transform: translateX(5px) rotate(1deg);
    }
    60% {
        transform: translateX(-3px) rotate(-0.5deg);
    }
    80% {
        transform: translateX(3px) rotate(0.5deg);
    }
    100% {
        transform: translateX(0);
    }
}
