:root {
    --board-bg: #e0c096; /* Цвет деревянной доски */
    --grid-line: #8b5a2b;
    --stone-black: #2c3e50;
    --stone-white: #f0f2f5;
    --stone-shadow: rgba(0,0,0,0.3);
}

/* Контейнер доски */
#board-container {
    position: relative;
    width: 100%;
    max-width: 85vh; 
    aspect-ratio: 1 / 1;
}

@media (max-width: 900px) {
    #board-container { max-width: 100%; }
}

#board {
    width: 100%;
    height: 100%;
    display: grid;
    /* Фиксированный размер 15x15 */
    grid-template-columns: repeat(15, 1fr);
    grid-template-rows: repeat(15, 1fr);
    gap: 1px; /* Тонкие линии */
    background-color: var(--grid-line);
    border: 4px solid var(--grid-line);
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.cell {
    background-color: var(--board-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    position: relative;
}

/* Эффект наведения (полупрозрачный камень) */
.cell:hover:not(.taken)::after {
    content: '';
    width: 70%;
    height: 70%;
    background-color: rgba(0,0,0,0.1);
    border-radius: 50%;
    display: block;
}

/* Камни (X - Черный, O - Белый) */
.cell.x::before,
.cell.o::before {
    content: '';
    width: 80%;
    height: 80%;
    border-radius: 50%;
    display: block;
    box-shadow: 1px 2px 3px var(--stone-shadow);
    animation: dropIn 0.2s ease-out;
}

/* Черный камень (Игрок 1) */
.cell.x::before {
    background: radial-gradient(circle at 30% 30%, #555, #000);
}

/* Белый камень (Игрок 2 / ПК) */
.cell.o::before {
    background: radial-gradient(circle at 30% 30%, #fff, #ccc);
}

/* Анимация появления */
@keyframes dropIn {
    from { transform: scale(1.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Курсор для занятых */
.cell.taken { cursor: default; }

/* Линия победы */
.winning-line {
    position: absolute;
    background-color: #e74c3c; /* Ярко-красная линия */
    height: 4px;
    border-radius: 2px;
    transform-origin: left center;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    width: 0;
    transition: width 0.4s ease-out;
}

/* Последний ход (подсветка) */
.cell.last-move::after {
    content: '';
    position: absolute;
    width: 20%;
    height: 20%;
    background-color: rgba(255,0,0,0.5); /* Красная точка */
    border-radius: 50%;
    z-index: 2;
}