:root {
    --bg-color: #eef2f6;
    --board-bg: #e3c08d;
    --board-line: #8b5a2b;
    --primary-color: #2c3e50;
    --accent-color: #3498db;
    --text-color: #1a1a1a;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --stone-black: #1a1a1a;
    --stone-white: #f5f5f5;
    --cell-size: 40px;
    --gap: 1px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.app-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
}

.game-header {
    text-align: center;
    width: 100%;
}

h1 {
    font-weight: 600;
    letter-spacing: 0.2rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.status-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    background: white;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    box-shadow: 0 4px 15px var(--shadow-light);
}

.mode-selection {
    display: flex;
    gap: 0.5rem;
    margin-right: 1rem;
}

.mode-btn {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.mode-btn.active {
    background: var(--primary-color);
    color: white;
}

.mode-btn:hover:not(.active) {
    background: rgba(44, 62, 80, 0.1);
}

.player-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.stone-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    box-shadow: inset 2px 2px 4px rgba(255, 255, 255, 0.3), 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.stone-icon.black {
    background: radial-gradient(circle at 30% 30%, #444, #000);
}

.stone-icon.white {
    background: radial-gradient(circle at 30% 30%, #fff, #ddd);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: #1a252f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.3);
}

.game-board {
    background-color: var(--board-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), inset 0 0 20px rgba(0, 0, 0, 0.1);
    display: grid;
    grid-template-columns: repeat(15, var(--cell-size));
    grid-template-rows: repeat(15, var(--cell-size));
    position: relative;
}

.cell {
    width: var(--cell-size);
    height: var(--cell-size);
    position: relative;
    cursor: pointer;
}

.cell::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--board-line);
    z-index: 1;
}

.cell::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    height: 100%;
    width: 1px;
    background-color: var(--board-line);
    z-index: 1;
}

/* Star points (Hoshi) */
.cell[data-row="3"][data-col="3"]::before,
.cell[data-row="3"][data-col="11"]::before,
.cell[data-row="11"][data-col="3"]::before,
.cell[data-row="11"][data-col="11"]::before,
.cell[data-row="7"][data-col="7"]::before {
    content: '';
    /* Override line content */
    width: 6px;
    height: 6px;
    background-color: var(--board-line);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

/* Re-add the lines for hoshi cells using a different technique to not conflict */
/* Actually, simpler to just add a separate dot element or rely on ::after for the dot if we don't need the vertical line? 
   Let's keep it simple: the lines are pseudoelements. The dot can be a child span if needed, but let's try to just style specific cells differently or add a class in JS.
   For now, simple CSS grid lines are easier. Let's use a background-image for the grid lines on the board itself? 
   No, individual cells give easier click handling. 
   Let's just use a small dot div inside the cell for the star point.
*/

.hoshi-dot {
    width: 8px;
    height: 8px;
    background-color: var(--board-line);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}


.stone {
    width: 80%;
    height: 80%;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 3;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
}

.stone.placed {
    transform: translate(-50%, -50%) scale(1);
}

.stone.black {
    background: radial-gradient(circle at 35% 35%, #555, #111);
}

.stone.white {
    background: radial-gradient(circle at 35% 35%, #fff, #ddd);
}

.last-move::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20%;
    height: 20%;
    background-color: rgba(255, 0, 0, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal.visible .modal-content {
    transform: translateY(0);
}

.modal h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.hidden {
    display: none;
    /* Fallback */
}