body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
    font-family: 'Roboto', sans-serif;
    margin: 0;
}

.container {
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
    width: 90%;
    max-width: 500px;
}

header {
    background-color: #4CAF50;
    color: white;
    width: 100%;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.ai-controls {
    position: relative;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.ai-toggle {
    display: flex;
    align-items: center;
    font-size: 1em;
    margin-right: 10px;
}

.ai-toggle input {
    display: none;
}

.ai-toggle .slider {
    width: 40px;
    height: 20px;
    background-color: #ccc;
    border-radius: 20px;
    position: relative;
    margin-right: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.ai-toggle .slider:before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    background-color: white;
    border-radius: 50%;
    top: 1px;
    left: 1px;
    transition: transform 0.3s;
}

.ai-toggle input:checked + .slider {
    background-color: #4CAF50;
}

.ai-toggle input:checked + .slider:before {
    transform: translateX(20px);
}

#ai-difficulty {
    padding: 5px;
    font-size: 1em;
    border-radius: 5px;
    border: 1px solid #ccc;
    cursor: pointer;
}
#ai-difficulty:disabled {
    cursor: default;
}

main {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 300px;
}

.header {
    font-size: 2em;
    margin-bottom: 20px;
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 100;
}

.header button {
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 50%;
    width: 150px;
    height: 150px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.header button:hover {
    background-color: #45a049;
    transform: scale(1.1);
}

.header button i::before {
    content: "🏠";
    font-style: normal;
    font-size: 64px;
}

.cell {
    width: 100px;
    height: 100px;
    background-color: #ffffff;
    border: 2px solid #4A4A4A;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2em;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    user-select: none;
}

.cell:hover {
    background-color: #e0e0e0;
    transform: scale(1.05);
}

.winner {
    background-color: #4CAF50;
    color: white;
}

.winning-line {
    position: absolute;
    height: 10px;
    background-color: red;
    transform-origin: left center;
    display: none;
}

.status {
    margin-top: 20px;
    font-size: 1.2em;
    color: #333;
}

.restart-button {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 1.2em;
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
    border-radius: 5px;
}

.restart-button:hover {
    background-color: #45a049;
}

footer {
    background-color: #4CAF50;
    color: white;
    width: 100%;
    padding: 10px;
    text-align: center;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}