/* 中国象棋 - 木纹棋盘与圆盘棋子（参考实体棋） */
.xq-main {
    position: relative;
    z-index: 1;
    max-width: 540px;
    margin: 0 auto 30px;
    padding: 0 12px 24px;
}

.xq-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 14px;
}

.xq-toolbar label {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
}

.xq-select {
    background: rgba(26, 26, 46, 0.9);
    border: 1px solid rgba(212, 175, 55, 0.45);
    color: #fff;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 14px;
}

.xq-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 8px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.xq-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.45);
}

.xq-btn-secondary {
    background: rgba(255, 255, 255, 0.12);
}

/* 音量控制 */
.xq-vol-wrap {
    position: relative;
}

.xq-btn-vol {
    min-width: 42px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.14);
}

.xq-btn-vol.is-muted {
    background: rgba(255, 107, 107, 0.35);
}

.xq-vol-popup {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 200px;
    padding: 12px 14px;
    background: linear-gradient(180deg, #1a2d4a 0%, #0f1a2e 100%);
    border: 1px solid rgba(212, 175, 55, 0.45);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    z-index: 100;
}

.xq-vol-popup[hidden] {
    display: none !important;
}

.xq-vol-label {
    display: block;
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    margin-bottom: 6px;
}

.xq-vol-range {
    width: 100%;
    margin: 0 0 10px;
    accent-color: #d4af37;
    cursor: pointer;
}

.xq-vol-speech {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}

.xq-vol-speech input {
    width: 16px;
    height: 16px;
    accent-color: #d4af37;
}

.xq-status-wrap {
    text-align: center;
    margin-bottom: 10px;
}

.xq-status {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.xq-status.is-win {
    border-color: rgba(0, 168, 107, 0.6);
    color: #7dffb8;
}

.xq-status.is-lose {
    border-color: rgba(255, 107, 107, 0.6);
    color: #ffb4b4;
}

.xq-turn {
    text-align: center;
    color: var(--chinese-gold, #d4af37);
    font-size: 15px;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

/* 外框：深色木匣 */
.xq-board-wrap {
    position: relative;
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    padding: 14px;
    border-radius: 8px;
    background: linear-gradient(160deg, #2a1810 0%, #1a0f0a 100%);
    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.55),
        inset 0 0 0 2px #6b4423,
        inset 0 0 0 5px #3d2414;
}

/* 棋盘盘面 */
.xq-board-surface {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 10;
    border-radius: 4px;
    overflow: hidden;
    background:
        linear-gradient(105deg, rgba(255, 255, 255, 0.04) 0%, transparent 40%, rgba(0, 0, 0, 0.12) 100%),
        repeating-linear-gradient(
            92deg,
            transparent,
            transparent 3px,
            rgba(0, 0, 0, 0.03) 3px,
            rgba(0, 0, 0, 0.03) 5px
        ),
        linear-gradient(180deg, #5c3824 0%, #6b4228 18%, #5a3520 42%, #4f2e1c 70%, #452818 100%);
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.35);
}

.xq-grid-svg {
    position: absolute;
    inset: 5.5% 7% 5.5% 7%;
    width: calc(100% - 14%);
    height: calc(100% - 11%);
    pointer-events: none;
    z-index: 1;
}

.xq-grid-svg line,
.xq-grid-svg path,
.xq-grid-svg rect {
    stroke: #d4b87a;
    stroke-width: 1.2;
    fill: none;
}

.xq-grid-svg .xq-river-text {
    fill: #d4b87a;
    stroke: none;
    font-family: "Ma Shan Zheng", "KaiTi", "STKaiti", "SimSun", serif;
    font-size: 22px;
    letter-spacing: 4px;
    opacity: 0.92;
}

.xq-grid-svg .xq-mark {
    fill: #d4b87a;
    stroke: none;
    opacity: 0.55;
}

/* 交叉点点击层 */
.xq-points {
    position: absolute;
    inset: 5.5% 7% 5.5% 7%;
    z-index: 2;
}

.xq-point {
    position: absolute;
    width: 13%;
    height: 11.5%;
    transform: translate(-50%, -50%);
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    z-index: 2;
}

.xq-point.is-selected::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 78%;
    height: 78%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(255, 215, 0, 0.28);
    box-shadow: 0 0 12px rgba(255, 200, 50, 0.5);
    pointer-events: none;
}

.xq-point.is-target::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 14px;
    height: 14px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(212, 184, 122, 0.95);
    box-shadow: 0 0 6px rgba(212, 184, 122, 0.8);
    pointer-events: none;
    z-index: 1;
}

/* 圆盘棋子 */
.xq-piece {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(34px, 10.5vw, 46px);
    height: clamp(34px, 10.5vw, 46px);
    border-radius: 50%;
    font-family: "Ma Shan Zheng", "KaiTi", "STKaiti", "SimKai", serif;
    font-size: clamp(20px, 6.2vw, 28px);
    font-weight: 400;
    line-height: 1;
    pointer-events: none;
    z-index: 3;
    background:
        radial-gradient(circle at 32% 28%, #fff8e8 0%, #e8d4b0 35%, #c9a66e 70%, #a8844a 100%);
    border: 3px solid #8b6914;
    box-shadow:
        3px 5px 10px rgba(0, 0, 0, 0.45),
        inset 0 2px 4px rgba(255, 255, 255, 0.55),
        inset 0 -3px 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.xq-point:hover .xq-piece,
.xq-point.is-selected .xq-piece {
    transform: translate(-50%, calc(-50% - 3px));
    box-shadow:
        4px 8px 14px rgba(0, 0, 0, 0.5),
        inset 0 2px 4px rgba(255, 255, 255, 0.55),
        inset 0 -3px 6px rgba(0, 0, 0, 0.15);
}

/* 内圈篆刻框 */
.xq-piece::before {
    content: '';
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    border: 1px solid rgba(90, 60, 20, 0.35);
    pointer-events: none;
}

/* 红方（玩家）— 朱红字 + 暖色木盘 */
.xq-piece.xq-red {
    color: #c8161d;
    border-color: #a31616;
    background:
        radial-gradient(circle at 32% 28%, #fff5f0 0%, #f0d0c8 35%, #e0a898 72%, #c87868 100%);
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
    -webkit-text-fill-color: #b91c1c;
}

.xq-piece.xq-red::before {
    border-color: rgba(160, 22, 22, 0.45);
}

/* 黑方（电脑）— 墨黑字 + 冷色木盘 */
.xq-piece.xq-black {
    color: #0d0d0d;
    border-color: #2a2a2a;
    background:
        radial-gradient(circle at 32% 28%, #f2ebe0 0%, #d8cfc0 38%, #b8a898 75%, #8a7a68 100%);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
    -webkit-text-fill-color: #1a1a1a;
}

.xq-piece.xq-black::before {
    border-color: rgba(30, 30, 30, 0.4);
}

.xq-hint {
    text-align: center;
    margin-top: 14px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.6;
    padding: 0 8px;
}

@media (max-width: 768px) {
    .game-header {
        padding: 36px 12px 12px;
    }

    .chinese-title {
        font-size: 2.2em;
        letter-spacing: 4px;
    }

    .game-subtitle {
        font-size: 1.1em;
    }

    .xq-main {
        padding: 0 8px 20px;
    }

    .xq-board-wrap {
        padding: 10px;
    }

    .xq-toolbar {
        gap: 8px;
    }

    .xq-btn {
        padding: 7px 14px;
        font-size: 13px;
    }
}

@media (max-width: 380px) {
    .xq-piece {
        width: 32px;
        height: 32px;
        font-size: 19px;
        border-width: 2px;
    }
}
