body {
    background-color: #1a1a1a;
    color: white;
    font-family: 'Pretendard', sans-serif;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    height: auto;
}

#game-ui {
    width: 100vw;
    /* height: 100vh; */
    padding: 1rem;
    box-sizing: border-box;
    justify-content: center;
}

.game-container {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    max-width: 95vw;
}

.info-box-wrapper {
    display: flex;
    flex-direction: column; /* Stack info-boxes vertically by default */
    gap: 0.75rem; /* Matches score-panel's gap for consistency */
}

@media (max-width: 600px) {
    .game-container {
        flex-direction: column;
        align-items: center;
        width: 100%;
        width: 100vw;
    }
    .score-panel {
        width: 100%;
        min-height: auto;
    }
    .info-box-wrapper {
        flex-direction: row; /* Arrange info-boxes horizontally */
        gap: 0.5rem; /* Matches score-panel's old gap for consistency */
        width: 100%; /* Ensure it takes full width within score-panel */
    }
    /*
    .chess-board {
        width: min(95vw, 600px);
        height: min(95vw, 600px);
    }
    */
}

.score-panel {
    /* width: 160px; */
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 12px;
    /* min-height: 520px; */
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    transition: width 0.3s ease;
}
.info-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 5px;
    text-align: center;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}
.chess-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    border: 4px solid #333;
    width: min(85vw, 600px);
    height: min(85vw, 600px);
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}
.square {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
}
.square.light { background-color: #ebecd0; }
.square.dark { background-color: #779556; }
.square.highlight { background-color: rgba(255, 255, 0, 0.5) !important; }

.square.move-hint::after {
    content: '';
    width: 25%;
    height: 25%;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    pointer-events: none;
}

.square.capture-hint {
    background-color: rgba(255, 0, 0, 0.4) !important;
}
.square.capture-hint .piece {
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.8);
    border: 2px solid #ff4444;
}

.piece {
    width: 80%;
    height: 80%;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: min(5vw, 32px);
    user-select: none;
    transition: transform 0.1s;
    z-index: 10;
    border: 2px solid rgba(0,0,0,0.1);
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    pointer-events: none;
}
.piece.white { background-color: #ffffff; color: #333; }
.piece.black { background-color: #333333; color: #ffffff; border-color: #555; }

.mini-piece {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
    border: 1px solid rgba(0,0,0,0.2);
    cursor: pointer;
}

.lang-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4a5568;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    z-index: 200;
    font-weight: bold;
    transition: background 0.2s;
}
.lang-toggle:hover { background: #2d3748; }

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 150;
    padding: 1rem;
    box-sizing: border-box;
}
.btn {
    padding: 1rem 3rem;
    margin: 0.5rem;
    background: #4a5568;
    border-radius: 8px;
    font-size: 1.25rem;
    transition: all 0.2s;
    min-width: 220px;
    text-align: center;
}
.btn:hover { background: #2d3748; transform: translateY(-2px); }

#version-info {
    display: block;
}

.difficulty-btn {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.2s;
    background: rgba(255,255,255,0.1);
}
.difficulty-btn.active {
    background: #3182ce;
    color: white;
    box-shadow: 0 0 10px rgba(49, 130, 206, 0.5);
}

.message-box {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 128, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    z-index: 500;
    transition: opacity 0.3s;
    display: none;
}

@keyframes info-box-update {
    0% {
        transform: scale(1);
        background-color: rgba(0, 0, 0, 0.3);
    }
    40% {
        transform: scale(1.1);
        background-color: rgba(250, 240, 100, 0.5);
    }
    100% {
        transform: scale(1);
        background-color: rgba(0, 0, 0, 0.3);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.info-box-updated {
    animation: info-box-update 0.4s ease-in-out, shake 0.2s ease-in-out 2;
}

.promotion-btn {
    width: 80px;
    height: 80px;
    background-color: #4a5568;
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.promotion-btn:hover {
    transform: scale(1.1);
    background-color: #2d3748;
}

#version-info:hover {
    cursor: pointer;
    text-decoration: underline;
}

#version-info {
    letter-spacing: -0.025em; /* 자간 좁게 */
}


#patch-notes-content h3 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #4a5568;
}

#patch-notes-content ul {
    list-style-type: disc;
    padding-left: 1.5rem;
}

#patch-notes-content li {
    margin-bottom: 0.25rem;
}
