body {
    font-family: Arial, sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, color 0.3s;
}

.light {
    background-color: #f4f4f4;
    color: #000;
}

.dark {
    background-color: #1e1e1e;
    color: #fff;
}

.board {
    display: grid;
    grid-template-columns: repeat(3, 100px);
    grid-template-rows: repeat(3, 100px);
    gap: 0;
    position: relative; /* important! */
    width: 300px;
    height: 300px;
    margin: 20px auto;
}

#win-line {
    position: absolute;
    height: 4px;
    background: linear-gradient(to right, #ff4d4d, #ff0000);
    box-shadow: 0 0 10px red;
    transform-origin: left center;
    transform: scaleX(0);
    transition: transform 0.4s ease;
    z-index: 2;
}


.cell {
    width: 100px;
    height: 100px;
    background-color: #fff;
    border: 2px solid #444;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    cursor: pointer;
    transition: background 0.3s;
}

body.light button {
    background-color: #e0e0e0;
    color: #222;
}

body.light button:hover {
    background-color: #ccc;
}

body.dark button {
    background-color: #333;
    color: #eee;
    border: 1px solid #555;
}

body.dark button:hover {
    background-color: #444;
    color: #fff;
}

body.dark .cell {
    background-color: #333;
    border-color: #aaa;
    color: #fff;
}

.cell:hover {
    background-color: #ddd;
}

button {
    padding: 10px 20px;
    font-size: 1em;
    margin: 10px 5px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

#scoreboard {
    margin-top: 15px;
    font-size: 1.1em;
    display: flex;
    justify-content: space-around;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

#scoreboard p {
    margin: 5px;
}

.hidden {
    display: none;
}

.screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 50px;
}

#start-screen button {
    padding: 12px 20px;
    font-size: 1.1em;
    cursor: pointer;
}

.game-container {
    text-align: center;
    position: relative;
}


.button-group {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}