body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f0f0f0;
    color: #333;
    margin-top: 20px;
}

h1 {
    color: #1a1a1a;
}

.controls {
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.controls label {
    font-weight: bold;
}

.controls select, .controls button {
    padding: 8px 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    background-color: #fff;
    transition: background-color 0.2s;
}

.controls button:hover {
    background-color: #e0e0e0;
}

.game-info {
    display: flex;
    justify-content: space-around;
    width: 90%;
    max-width: 480px; /* Match board width */
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: bold;
}

.score {
    flex: 1;
    text-align: center;
}

#turn-indicator {
    flex: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}


#board-container {
    position: relative; /* Needed for overlay */
    width: 480px; /* 8 cells * 60px */
    height: 480px; /* 8 cells * 60px */
}

#board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    width: 100%;
    height: 100%;
    background-color: #008000; /* Green board */
    border: 5px solid #8B4513; /* Brown border */
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    border-radius: 5px;
}

.cell {
    width: 60px; /* Adjust as needed */
    height: 60px; /* Adjust as needed */
    border: 1px solid #006400; /* Darker green lines */
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative; /* For disc positioning */
    cursor: pointer;
    transition: background-color 0.3s;
}

.cell.valid-move::after { /* Style for valid move hints */
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    pointer-events: none; /* Allow clicks through the hint */
}

.cell:hover {
    background-color: #32CD32; /* Lighter green on hover */
}

.disc {
    width: 85%;
    height: 85%;
    border-radius: 50%;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.4), 0 2px 3px rgba(0,0,0,0.3);
    transform-origin: center;
    position: absolute; /* Needed for smooth placement/flipping */
}

.disc.black {
    background: radial-gradient(circle at 30% 30%, #555, #000);
    border: 1px solid #444;
}

.disc.white {
     background: radial-gradient(circle at 30% 30%, #fff, #ccc);
     border: 1px solid #bbb;
}

/* Animation for placing a new disc */
.disc.new {
    animation: placeDisc 0.3s ease-out forwards;
}

@keyframes placeDisc {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* Animation for flipping a disc */
.disc.flipping {
    animation: flipDisc 0.6s ease-in-out forwards;
}

@keyframes flipDisc {
    0% { transform: scaleY(1); }
    50% { transform: scaleY(0.1); } /* Almost flat */
    /* Color change happens instantly after 50% via JS */
    100% { transform: scaleY(1); }
}


/* Message Overlay */
#message-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s ease;
}

#message-overlay.hidden {
    opacity: 0;
    pointer-events: none; /* Disable interaction when hidden */
}


#message-box {
    background-color: #fff;
    padding: 30px 40px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transform: scale(1);
    transition: transform 0.3s ease;
}

#message-overlay.hidden #message-box {
     transform: scale(0.8);
}


#message-text {
    font-size: 1.4em;
    margin-bottom: 20px;
    color: #333;
}

#close-message {
    padding: 10px 25px;
    font-size: 1.1em;
    cursor: pointer;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    transition: background-color 0.2s;
}

#close-message:hover {
    background-color: #0056b3;
}