/* ttt-style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f8;
}

header {
    background-color: #3498db;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-button {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    transition: background-color 0.3s;
}

.back-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

main {
    max-width: 600px;
    margin: 2rem auto;
    padding: 1rem;
}

.game-container {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.game-info {
    margin-bottom: 1.5rem;
}

.game-info h2 {
    color: #3498db;
    margin-bottom: 0.5rem;
}

#status {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.score-board {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.score {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score span:first-child {
    font-weight: bold;
}

.score span:last-child {
    font-size: 1.5rem;
    margin-top: 0.3rem;
}

.board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 10px;
    margin: 0 auto 1.5rem;
    max-width: 300px;
}

.cell {
    background-color: #f0f0f0;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.cell:hover {
    background-color: #e4e4e4;
}

.cell.x {
    color: #e74c3c;
}

.cell.o {
    color: #3498db;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

#new-game-btn {
    background-color: #2ecc71;
}

#new-game-btn:hover {
    background-color: #27ae60;
}

.winning-cell {
    background-color: #d5f5e3;
}

@media (max-width: 400px) {
    .controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    header {
        flex-direction: column;
        text-align: center;
    }
    
    .back-button {
        margin-top: 0.5rem;
    }
}