/* Go 9×9 — game-specific styles */

body {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

.game-container {
    text-align: center;
    max-width: 700px;
}

.game-area {
    background: var(--card-background);
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

h1 { color: var(--primary-color); margin: 0; }

.status {
    font-size: 1.15rem;
    margin-bottom: 12px;
    font-weight: bold;
    color: var(--text-color);
    min-height: 1.5em;
}

/* Online / AI chrome */
.online-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 12px;
}
.opponent-name { font-weight: 600; color: var(--text-muted); }

.ai-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.ai-info.hidden { display: none; }
.ai-info-label { font-weight: 600; color: var(--text-muted); }

.difficulty-btn {
    padding: 6px 14px;
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-pill, 999px);
    background: var(--card-background);
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}
.difficulty-btn.active,
.difficulty-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* ---- Board ---- */
.go-board-wrapper {
    display: inline-block;
    position: relative;
    margin: 0 auto;
}

.go-board {
    display: inline-grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 0;
    background:
        linear-gradient(to right, #8B6914 1px, transparent 1px),
        linear-gradient(to bottom, #8B6914 1px, transparent 1px),
        #dcb35c;
    background-size: 44px 44px;
    padding: 21px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    border: 3px solid #8B6914;
}

@media (prefers-color-scheme: dark) {
    .go-board {
        background:
            linear-gradient(to right, #6b5310 1px, transparent 1px),
            linear-gradient(to bottom, #6b5310 1px, transparent 1px),
            #a88a3a;
        background-size: 44px 44px;
        border-color: #6b5310;
    }
}

.go-cell {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    background: transparent;
    border: none;
    padding: 0;
    font-size: 0;
    min-height: 0;
    box-shadow: none;
}

.go-cell:hover { transform: none; box-shadow: none; }
.go-cell:focus-visible { z-index: 2; }

.go-cell::after {
    content: '';
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: block;
    transition: background-color 0.15s, box-shadow 0.15s;
}

.go-cell:hover::after { background: rgba(0,0,0,0.12); }

.go-cell.black::after {
    background: radial-gradient(circle at 35% 35%, #555, #111);
    box-shadow: 2px 2px 4px rgba(0,0,0,0.4);
}
.go-cell.black:hover::after {
    background: radial-gradient(circle at 35% 35%, #555, #111);
}

.go-cell.white::after {
    background: radial-gradient(circle at 35% 35%, #fff, #ccc);
    box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}
.go-cell.white:hover::after {
    background: radial-gradient(circle at 35% 35%, #fff, #ccc);
}

.go-cell.last-move::after {
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.7);
}

/* Star points (hoshi) */
.go-cell.star-point::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #8B6914;
    z-index: 0;
    pointer-events: none;
}
@media (prefers-color-scheme: dark) {
    .go-cell.star-point::before { background: #6b5310; }
}
.go-cell.black.star-point::before,
.go-cell.white.star-point::before { display: none; }

/* Ko marker */
.go-cell.ko-point::before {
    content: '✕';
    position: absolute;
    font-size: 0.8rem;
    color: var(--danger-color);
    z-index: 1;
    pointer-events: none;
    font-weight: bold;
}
.go-cell.black.ko-point::before,
.go-cell.white.ko-point::before { display: none; }

/* Keyboard focus cell */
.go-cell.focused {
    outline: 3px solid var(--focus-ring-color, #6d5efc);
    outline-offset: -3px;
    z-index: 2;
}

/* Column / row labels */
.col-labels, .row-labels {
    display: flex;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    pointer-events: none;
    user-select: none;
}
.col-labels {
    justify-content: space-around;
    padding: 0 21px;
    margin-bottom: 2px;
}
.col-labels span { width: 44px; text-align: center; }

.row-labels {
    position: absolute;
    left: -18px;
    top: 21px;
    flex-direction: column;
    align-items: center;
    gap: 0;
}
.row-labels span {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- Captured stones ---- */
.captured-display {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin: 12px 0 8px;
    flex-wrap: wrap;
}
.captured-group {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
}
.captured-stone {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
}
.captured-stone.black-stone {
    background: radial-gradient(circle at 35% 35%, #555, #111);
}
.captured-stone.white-stone {
    background: radial-gradient(circle at 35% 35%, #fff, #ccc);
    border: 1px solid #bbb;
}

/* ---- Score display ---- */
.score-display {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin: 8px 0;
    font-weight: 600;
    font-size: 1.05rem;
    flex-wrap: wrap;
}
.score-group { display: flex; align-items: center; gap: 6px; }

/* ---- Pass button ---- */
.pass-btn {
    padding: 10px 24px;
    font-size: 1rem;
    background-color: var(--warning-color);
    margin-top: 4px;
}
.pass-btn:hover { background-color: #e67e22; }

/* ---- Game buttons ---- */
.game-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 16px;
}
#exit-game-btn { padding: 10px 20px; font-size: 1rem; }

/* ---- Responsive ---- */
@media (max-width: 520px) {
    .game-container { padding: 8px; }
    .game-area { padding: 10px; }
    .go-board {
        background-size: 34px 34px;
        padding: 12px;
    }
    .go-cell { width: 34px; height: 34px; }
    .go-cell::after { width: 28px; height: 28px; }
    .col-labels { padding: 0 12px; }
    .col-labels span { width: 34px; }
    .row-labels { left: -14px; top: 12px; }
    .row-labels span { height: 34px; }
    .go-cell.star-point::before { width: 6px; height: 6px; }
}

@media (max-width: 380px) {
    .go-board {
        background-size: 28px 28px;
        padding: 13px;
    }
    .go-cell { width: 28px; height: 28px; }
    .go-cell::after { width: 22px; height: 22px; }
    .col-labels { padding: 0 13px; }
    .col-labels span { width: 28px; }
    .row-labels { left: -14px; top: 13px; }
    .row-labels span { height: 28px; }
    .go-cell.star-point::before { width: 5px; height: 5px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .go-cell::after { transition: none; }
}
