body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(
        45deg,
        red, orange, yellow, green, blue, indigo, violet, red
    );
    color: #333;
    background-size: 100% 130%;
    background-repeat: no-repeat;
}

h1 {
    margin-top: 20px;
}

#game-container {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#message {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.2em;
    font-weight: bold;
    min-height: 20px; /* Space for message */
}

.board {
    display: grid;
    grid-template-columns: repeat(3, 100px);
    grid-template-rows: repeat(3, 100px);
    gap: 0;
    border: 3px solid #333;
    background-color: #333;
}

.cell {
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3em;
    font-weight: bold;
    cursor: pointer;
    background-color: #fff;
    transition: background-color 0.1s;
}

.cell:hover:empty {
    background-color: #e0e0e0;
}

.cell:nth-child(3n + 1) { border-left: none; }
.cell:nth-child(3n) { border-right: none; }
.cell:nth-child(1), .cell:nth-child(2), .cell:nth-child(3) { border-top: none; }
.cell:nth-child(7), .cell:nth-child(8), .cell:nth-child(9) { border-bottom: none; }

#reset-button {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 20px;
    font-size: 1em;
    cursor: pointer;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    transition: background-color 0.2s;
}

#reset-button:hover {
    background-color: #45a049;
}

.winning-cell {
    background-color: #ffd700 !important;
    animation: win-flash 0.5s infinite alternate;
}

@keyframes win-flash {
    from { opacity: 1; }
    to { opacity: 0.8; }
}