/* 中国象棋样式 - 手机/电脑自适应 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #3e2723 0%, #5d4037 50%, #3e2723 100%);
    min-height: 100vh;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

#game-container {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 10px;
    max-width: 760px;
    margin: 0 auto;
}

/* 顶栏 */
#topbar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 4px;
    color: #f5e6c8;
    flex-shrink: 0;
}

#topbar h1 {
    font-size: 22px;
    letter-spacing: 2px;
}

.difficulty {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.difficulty select {
    background: rgba(255, 255, 255, 0.15);
    color: #f5e6c8;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 5px 8px;
    font-size: 14px;
    -webkit-appearance: none;
    appearance: none;
}

.difficulty select option {
    background: #5d4037;
    color: #f5e6c8;
}

/* 棋盘 */
#board-wrap {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 0;
    width: 100%;
}

#board {
    display: block;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    max-width: 100%;
    max-height: 100%;
    touch-action: manipulation;
}

/* 状态栏 */
#status {
    color: #f5e6c8;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 20px;
    margin: 8px 0;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    flex-shrink: 0;
}

/* 按钮 */
#controls {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
    padding-bottom: 6px;
}

.btn {
    padding: 12px 32px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    background: #8d6e63;
    color: white;
    transition: all 0.2s;
    touch-action: manipulation;
}

.btn:active {
    transform: scale(0.95);
    opacity: 0.85;
}

.btn.hidden { display: none; }

/* 弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal.hidden { display: none; }

.modal-content {
    background: #fdf6e3;
    padding: 30px 40px;
    border-radius: 16px;
    text-align: center;
    max-width: 85%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.modal-content h2 {
    color: #4e342e;
    margin-bottom: 12px;
    font-size: 24px;
}
.modal-content p {
    color: #6d4c41;
    margin-bottom: 18px;
    font-size: 15px;
}
.modal-content .btn {
    background: #c0392b;
}

/* 电脑大屏 */
@media (min-width: 700px) {
    #game-container {
        padding: 16px 20px;
    }
    #topbar h1 { font-size: 28px; }
    .difficulty { font-size: 16px; }
    .difficulty select { font-size: 16px; padding: 6px 12px; }
    #status { font-size: 18px; }
    .btn { padding: 14px 44px; font-size: 18px; }
}

/* 小屏手机 */
@media (max-width: 380px) {
    #topbar h1 { font-size: 18px; }
    .difficulty select { padding: 4px 6px; font-size: 13px; }
    #status { font-size: 14px; padding: 8px 12px; }
    .btn { padding: 10px 24px; font-size: 14px; }
}
