/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Serif SC', serif;
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 50%, #CD853F 100%);
    min-height: 100vh;
    color: #4A2C17;
    overflow-x: hidden;
}

.game-container {
    max-width: 98vw;
    margin: 0 auto;
    padding: 1vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 主体布局 */
.game-main {
    display: flex;
    gap: 2vh;
    flex: 1;
    align-items: stretch;
    justify-content: center;
    height: 95vh;
}

.board-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1vh;
    max-width: 70vh;
}

.settings-section {
    width: 32vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5vh;
}

/* 棋盘样式 */
.board-container {
    position: relative;
    background: linear-gradient(45deg, #DEB887, #F4A460);
    border: 3px solid #8B4513;
    border-radius: 1vh;
    padding: 1.5vh;
    box-shadow:
        0 2vh 4vh rgba(0,0,0,0.3),
        inset 0 0 1vh rgba(139,69,19,0.2);
    max-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#gameBoard {
    display: block;
    background: transparent;
    cursor: pointer;
}

.board-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.corner-decoration {
    position: absolute;
    font-size: 3vh;
    color: #8B4513;
    opacity: 0.7;
}

.corner-decoration.top-left { top: 1vh; left: 1vh; }
.corner-decoration.top-right { top: 1vh; right: 1vh; }
.corner-decoration.bottom-left { bottom: 1vh; left: 1vh; }
.corner-decoration.bottom-right { bottom: 1vh; right: 1vh; }

/* 游戏状态 */
.game-status {
    background: linear-gradient(135deg, #8B4513, #A0522D);
    border: 2px solid #654321;
    border-radius: 1vh;
    padding: 2vh;
    color: #F5DEB3;
    box-shadow: 0 2vh 4vh rgba(0,0,0,0.2);
    width: 100%;
    max-width: 60vh;
}

.current-player {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2vh;
    margin-bottom: 2vh;
    font-size: 2.5vh;
}

.player-indicator {
    width: 4vh;
    height: 4vh;
    border-radius: 50%;
    border: 2px solid #F5DEB3;
}

.player-indicator.black {
    background: radial-gradient(circle at 30% 30%, #444, #000);
}

.player-indicator.white {
    background: radial-gradient(circle at 30% 30%, #fff, #ddd);
}

.game-controls {
    display: flex;
    gap: 2vh;
    justify-content: center;
}

/* 设置面板 */
.settings-panel {
    background: linear-gradient(135deg, #DEB887, #F4A460);
    border: 3px solid #8B4513;
    border-radius: 1vh;
    padding: 2vh;
    box-shadow: 0 2vh 4vh rgba(0,0,0,0.3);
    height: fit-content;
    max-height: 75vh;
}

.settings-panel h3 {
    text-align: center;
    margin-bottom: 1.5vh;
    font-size: 2vh;
    color: #2F1B14;
    border-bottom: 2px solid #8B4513;
    padding-bottom: 0.5vh;
}

.setting-group {
    margin-bottom: 1.5vh;
}

.setting-group label {
    display: block;
    margin-bottom: 0.8vh;
    font-weight: bold;
    font-size: 1.8vh;
    color: #4A2C17;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 1vh;
}

.radio-wood {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 1vh;
    background: linear-gradient(135deg, #D2B48C, #DEB887);
    border: 2px solid #8B4513;
    border-radius: 0.5vh;
    transition: all 0.3s ease;
}

.radio-wood:hover {
    background: linear-gradient(135deg, #DEB887, #F4A460);
    transform: translateY(-2px);
}

.radio-wood input[type="radio"] {
    margin-right: 1vh;
    accent-color: #8B4513;
}

.radio-wood span {
    font-size: 1.8vh;
    color: #4A2C17;
}

.select-wood {
    width: 100%;
    padding: 1vh;
    border: 2px solid #8B4513;
    border-radius: 0.5vh;
    background: linear-gradient(135deg, #D2B48C, #DEB887);
    color: #4A2C17;
    font-size: 1.8vh;
    font-family: inherit;
    cursor: pointer;
}

/* 按钮样式 */
.btn-wood {
    padding: 1.5vh 3vh;
    border: 2px solid #654321;
    border-radius: 1vh;
    background: linear-gradient(135deg, #8B4513, #A0522D);
    color: #F5DEB3;
    font-size: 1.8vh;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1vh 2vh rgba(0,0,0,0.2);
}

.btn-wood:hover {
    background: linear-gradient(135deg, #A0522D, #CD853F);
    transform: translateY(-2px);
    box-shadow: 0 1.5vh 3vh rgba(0,0,0,0.3);
}

.btn-wood:active {
    transform: translateY(0);
    box-shadow: 0 0.5vh 1vh rgba(0,0,0,0.2);
}

.btn-primary {
    width: 100%;
    margin-top: 2vh;
    font-size: 2.2vh;
    font-weight: bold;
}

/* 游戏信息 */
.game-info {
    background: linear-gradient(135deg, #DEB887, #F4A460);
    border: 3px solid #8B4513;
    border-radius: 1vh;
    padding: 3vh;
    box-shadow: 0 4vh 8vh rgba(0,0,0,0.3);
}

.game-info h4 {
    margin-bottom: 2vh;
    font-size: 2vh;
    color: #2F1B14;
    border-bottom: 2px solid #8B4513;
    padding-bottom: 1vh;
}

.game-info ul {
    list-style: none;
    padding-left: 0;
}

.game-info li {
    margin-bottom: 1vh;
    font-size: 1.6vh;
    color: #4A2C17;
    padding-left: 2vh;
    position: relative;
}

.game-info li:before {
    content: "◆";
    position: absolute;
    left: 0;
    color: #8B4513;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #DEB887, #F4A460);
    border: 3px solid #8B4513;
    border-radius: 2vh;
    padding: 4vh;
    text-align: center;
    box-shadow: 0 4vh 8vh rgba(0,0,0,0.5);
    min-width: 40vh;
}

.modal-content h2 {
    font-size: 3vh;
    color: #2F1B14;
    margin-bottom: 3vh;
}

.modal-buttons {
    display: flex;
    gap: 2vh;
    justify-content: center;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .game-main {
        flex-direction: column;
        align-items: center;
    }

    .settings-section {
        width: 80vh;
        max-width: 90vw;
    }

    .board-section {
        width: 100%;
        max-width: 80vh;
    }
}

@media (max-width: 768px) {
    .game-container {
        padding: 1vh;
    }

    .game-header h1 {
        font-size: 3vh;
    }

    .settings-section {
        width: 70vh;
    }

    .board-container {
        padding: 1vh;
    }

    #gameBoard {
        width: 100%;
        height: auto;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.pulse {
    animation: pulse 0.3s ease-in-out;
}