/* 바둑 게임 스타일 */
:root {
    --board-color: #dcb35c;
    --line-color: #333;
    --black-stone: #1a1a1a;
    --white-stone: #f5f5f5;
    --text-color: #333;
    --accent: #2d5a27;
    --danger: #c0392b;
    --bg-page: #f0e6d3;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    min-height: 100vh;
    touch-action: manipulation;
}

body {
    font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
    background: var(--bg-page);
    color: var(--text-color);
    min-height: 100vh;
    padding: 12px;
    -webkit-user-select: none;
    user-select: none;
}

.game-area {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    background: linear-gradient(145deg, #e8d5a3 0%, #d4b86a 100%);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    border: 2px solid #c4a84a;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(0,0,0,0.15);
}

.game-header h1 {
    font-size: clamp(1.2rem, 4vw, 1.6rem);
    color: var(--accent);
}

.game-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.status-bar {
    display: flex;
    justify-content: center;
    gap: 24px;
    font-size: 0.95rem;
}

.turn-info strong {
    color: var(--accent);
}

.board-container {
    width: 100%;
    display: flex;
    justify-content: center;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.game-canvas-wrapper {
    position: relative;
    display: inline-block;
    padding: 8px;
    background: var(--board-color);
    border-radius: 8px;
    box-shadow: inset 0 0 0 4px #c4a84a, 0 4px 12px rgba(0,0,0,0.2);
}

.game-canvas {
    display: block;
    max-width: 100%;
    height: auto;
    cursor: pointer;
    border-radius: 4px;
}

.canvas-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.game-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.control-btn {
    padding: 8px 14px;
    font-size: 0.9rem;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s, transform 0.1s;
}

.control-btn:hover {
    background: #234d1f;
}

.control-btn:active {
    transform: scale(0.98);
}

.control-btn.danger {
    background: var(--danger);
}

.control-btn.danger:hover {
    background: #a93226;
}

.control-btn.hidden {
    display: none !important;
}

/* 일시정지 오버레이 */
.pause-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.pause-overlay.hidden {
    display: none;
}

.pause-content {
    background: #fff;
    padding: 28px;
    border-radius: 16px;
    text-align: center;
    max-width: 90%;
}

.pause-content h2 {
    margin-bottom: 12px;
    color: var(--text-color);
}

.pause-content p {
    margin-bottom: 20px;
    color: #555;
}

.action-btn {
    padding: 10px 24px;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
}

.action-btn:hover {
    background: #234d1f;
}

/* 전체화면 모드 */
.game-area.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: none;
    width: 100%;
    height: 100%;
    border-radius: 0;
    padding: 12px;
    z-index: 9999;
    overflow: auto;
}

/* 댓글 영역 */
#comments-container {
    margin-top: 16px;
}

@media (max-width: 480px) {
    body { padding: 8px; }
    .game-area { padding: 10px; }
    .game-header h1 { font-size: 1.2rem; }
    .control-btn { padding: 6px 10px; font-size: 0.85rem; }
}
