/* 장기 게임 스타일 */
:root {
    --board-light: #e8c88c;
    --board-dark: #c4a050;
    --palace-line: #5c4033;
    --piece-han: #2c5282;
    --piece-cho: #c53030;
    --text-color: #333;
    --accent: #2d5a27;
    --highlight: rgba(34, 197, 94, 0.4);
    --capture: rgba(239, 68, 68, 0.4);
}

* { 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: #f0e6d3;
    color: var(--text-color);
    padding: 12px;
    -webkit-user-select: none;
    user-select: none;
}

.game-area {
    max-width: 600px;
    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;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.95rem;
}

.status-value { color: var(--accent); font-weight: 600; }

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

.game-canvas-wrapper {
    position: relative;
    display: inline-block;
    padding: 8px;
    background: var(--board-dark);
    border-radius: 8px;
    box-shadow: inset 0 0 0 3px #8b6914, 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;
}

.control-btn:hover { background: #234d1f; }
.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;
}

.pause-content h2 { margin-bottom: 12px; }
.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;
}

.game-area.fullscreen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    max-width: none;
    width: 100%;
    height: 100%;
    border-radius: 0;
    z-index: 9999;
    overflow: auto;
}

#comments-container { margin-top: 16px; }

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