:root {
    --background: #f4f5f7;
    --cell-bg: #ffffff;
    --cell-bg-hover: #eef1ff;
    --cell-border: #e2e4ea;
    --cell-border-hover: #c7cdfa;
    --x-color: #4361ee;
    --o-color: #e85d75;
    --win-bg: #d7f7dc;
    --win-border: #4caf7d;
    --text-color: #2b2d3a;
    --ai-thinking-color: #8a8d99;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
    font-family: "Segoe UI", system-ui, sans-serif;
    color: var(--text-color);
}

.card {
    background: var(--background);
    padding: 28px;
    text-align: center;
}

h1 {
    margin: 0 0 18px;
    font-size: 22px;
}

.mode-bar {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 18px;
}

.mode-bar select,
.mode-bar button {
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 2px solid var(--cell-border);
    background: var(--cell-bg);
    color: var(--text-color);
    cursor: pointer;
}

.mode-bar button {
    background: var(--x-color);
    border-color: var(--x-color);
    color: white;
    font-weight: 600;
}

.status {
    font-size: 18px;
    font-weight: 600;
    min-height: 24px;
    margin-bottom: 18px;
}

.status.ai-thinking {
    font-style: italic;
    color: var(--ai-thinking-color);
    font-weight: 500;
}

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

.cell {
    width: 90px;
    height: 90px;
    font-size: 32px;
    font-weight: 700;
    background: var(--cell-bg);
    border: 2px solid var(--cell-border);
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cell:hover:not(:disabled) {
    background: var(--cell-bg-hover);
    border-color: var(--cell-border-hover);
}

.cell:disabled {
    cursor: default;
}

.cell.x {
    color: var(--x-color);
}

.cell.o {
    color: var(--o-color);
}

.cell.win {
    background: var(--win-bg);
    border-color: var(--win-border);
}
