:root {
    --bg-color: #f8fafc;
    --board-color: #dcb35c;
    --board-border: #b88d3e;
    --black-stone: radial-gradient(circle at 35% 35%, #444, #000);
    --white-stone: radial-gradient(circle at 35% 35%, #fff, #ddd);
}

/* 터치 시 발생하는 파란색 하이라이트 및 외곽선 제거 */
* {
    -webkit-tap-highlight-color: transparent;
    outline: none;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Pretendard', sans-serif;
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    user-select: none;
    touch-action: manipulation;
}

/* 상단 모드 전환 탭 */
.tabs {
    width: 90%;
    max-width: 400px;
    background: white;
    padding: 5px;
    border-radius: 16px;
    display: flex;
    gap: 4px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: #94a3b8;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
}

.tab-btn.active {
    background: #1e293b;
    color: white;
}

/* 플레이어 상태 바 */
.status-container {
    width: 90%;
    max-width: 400px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.player-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    opacity: 0.25;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-info.active {
    opacity: 1;
    transform: scale(1.08);
}

.avatar {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.avatar.black { background: #1e293b; color: white; }
.avatar.white { background: white; color: #6366f1; border-color: #f1f5f9; }

.player-name { font-size: 11px; font-weight: 800; color: #475569; }

/* 바둑판 레이아웃 */
.board-wrapper {
    position: relative;
    background: var(--board-color);
    border: 10px solid var(--board-border);
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

#board {
    position: relative;
    width: 320px;
    height: 320px;
}

.grid-line {
    position: absolute;
    background: rgba(0,0,0,0.22);
}

.dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* 돌 스타일 */
.stone {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.stone.black {
    background: var(--black-stone);
    box-shadow: 2px 3px 5px rgba(0,0,0,0.35);
}

.stone.white {
    background: var(--white-stone);
    box-shadow: 1px 2px 4px rgba(0,0,0,0.12);
}

.last-move-marker {
    width: 6px;
    height: 6px;
    background: #f43f5e;
    border-radius: 50%;
}

/* 하단 컨트롤 버튼 */
.controls {
    width: 90%;
    max-width: 400px;
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

.btn {
    flex: 1;
    padding: 16px;
    border-radius: 18px;
    border: none;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 16px;
    transition: opacity 0.2s;
}

.btn:active { opacity: 0.7; }
.btn-undo { background: white; color: #64748b; border: 1px solid #e2e8f0; }
.btn-reset { background: #1e293b; color: white; }

/* 결과 모달 */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(6px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 32px;
    text-align: center;
    width: 100%;
    max-width: 300px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

.modal-icon { font-size: 48px; margin-bottom: 16px; }
.modal-title { font-size: 26px; font-weight: 900; margin-bottom: 8px; color: #1e293b; }
.modal-msg { font-size: 16px; color: #64748b; margin-bottom: 24px; font-weight: 600; }