:root {
    --bg-color: #f8fafc;
    --text-primary: #0f172a;
    --accent-x: #ef4444;
    --accent-o: #3b82f6;
    --cell-bg: #ffffff;
    --border-color: rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

header {
    text-align: center;
    width: 100%;
}

.back-btn {
    display: block;
    color: var(--text-primary);
    text-decoration: none;
    text-align: left;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    opacity: 0.7;
    transition: opacity 0.3s;
    font-weight: 500;
}

.back-btn:hover {
    opacity: 1;
    color: var(--accent-o);
}

h1 {
    font-weight: 800;
    letter-spacing: 2px;
}

h1 span {
    color: var(--accent-o);
    text-shadow: 0 0 10px var(--accent-o);
}

.status-board {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#statusText {
    font-size: 1.5rem;
    font-weight: 600;
}

#restartBtn {
    padding: 0.8rem 2rem;
    background: transparent;
    color: var(--text-primary);
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#restartBtn:hover {
    background: var(--text-primary);
    color: #ffffff;
}

.board {
    display: grid;
    grid-template-columns: repeat(3, 100px);
    grid-template-rows: repeat(3, 100px);
    gap: 10px;
}

.cell {
    width: 100px;
    height: 100px;
    background-color: var(--cell-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 4rem;
    font-weight: 800;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

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

.cell[data-player="X"] {
    color: var(--accent-x);
}

.cell[data-player="O"] {
    color: var(--accent-o);
}

@media (max-width: 500px) {
    .board {
        grid-template-columns: repeat(3, 80px);
        grid-template-rows: repeat(3, 80px);
    }
    .cell {
        width: 80px;
        height: 80px;
        font-size: 3rem;
    }
}
