/* ============ 五子棋 · 人机对战 v2 ============ */
.gm-hero {
    margin-top: 28px;
    padding: 26px 28px 30px;
    border-radius: 18px;
    background: linear-gradient(160deg, #fdf6e9 0%, #f9ead0 55%, #f3dcba 100%);
    border: 1px solid #ecd9b6;
    box-shadow: 0 10px 30px rgba(176, 118, 44, 0.14);
}

[data-theme="dark"] .gm-hero {
    background: linear-gradient(160deg, #26201a 0%, #2d2417 55%, #332818 100%);
    border-color: #4a3a26;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* ---- 头部 ---- */
.gm-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.gm-brand { display: flex; align-items: center; gap: 14px; }
.gm-logo {
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    border-radius: 14px;
    background: radial-gradient(circle at 32% 28%, #4d3a26, #26190f);
    box-shadow: 0 6px 14px rgba(70, 45, 16, 0.35), inset 0 0 0 2px rgba(255,255,255,0.08);
    color: #fff;
}
.gm-title { font-size: 22px; font-weight: 800; color: #4a3015; letter-spacing: .5px; }
[data-theme="dark"] .gm-title { color: #f3dfb8; }
.gm-sub { font-size: 13px; color: #9a7b4f; margin-top: 2px; }
[data-theme="dark"] .gm-sub { color: #a98d60; }

.gm-status {
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    background: #fff;
    color: #8a6a3a;
    border: 1px solid #e5cfae;
    box-shadow: 0 2px 8px rgba(140, 100, 40, 0.12);
    transition: all .25s ease;
}
.gm-status.on-turn { color: #b4452c; border-color: #eeb7a8; }
.gm-status.ai-turn { color: #2c74b4; border-color: #a8cfe8; background: #eef6fd; }
.gm-status.win { color: #1d8a4e; border-color: #a8e0c2; background: #eefaf3; }
.gm-status.lose { color: #a03535; border-color: #e8b4b4; background: #fdf0f0; }
[data-theme="dark"] .gm-status { background: #1f1a13; border-color: #4a3a26; color: #d9c08f; }
[data-theme="dark"] .gm-status.on-turn { color: #ff9c82; border-color: #7a4a38; }
[data-theme="dark"] .gm-status.ai-turn { color: #8ec9ff; border-color: #31587d; background: #16222e; }
[data-theme="dark"] .gm-status.win { color: #6fe0a5; border-color: #1e5c3b; background: #12251b; }
[data-theme="dark"] .gm-status.lose { color: #ff8b8b; border-color: #6e3030; background: #2b1616; }

/* ---- 主体布局 ---- */
.gm-main {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}
@media (max-width: 860px) {
    .gm-main { grid-template-columns: 1fr; }
    .gm-side { order: -1; }
}

/* ---- 棋盘 ---- */
.gm-board-wrap {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 26px rgba(88, 56, 20, 0.28), inset 0 0 0 1px rgba(255,255,255,0.1);
    background: #e8b96a;
}
.gm-board-wrap canvas { display: block; width: 100%; height: auto; touch-action: none; }

.gm-thinking {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(43, 30, 12, 0.35);
    border-radius: 14px;
    backdrop-filter: blur(2px);
    z-index: 5;
}
.gm-thinking[hidden] { display: none; }
.gm-thinking span {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #fff;
    animation: gmBounce 1s infinite ease-in-out;
}
.gm-thinking span:nth-child(2) { animation-delay: .15s; }
.gm-thinking span:nth-child(3) { animation-delay: .3s; }
@keyframes gmBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: .55; }
    30% { transform: translateY(-14px); opacity: 1; }
}

/* ---- 侧栏 ---- */
.gm-side { display: flex; flex-direction: column; gap: 14px; }
.gm-panel {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid #ecd9b6;
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 4px 14px rgba(140, 100, 40, 0.08);
}
[data-theme="dark"] .gm-panel {
    background: rgba(31, 26, 18, 0.7);
    border-color: #4a3a26;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.gm-panel-title {
    font-size: 12px;
    font-weight: 700;
    color: #9a7b4f;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
}
[data-theme="dark"] .gm-panel-title { color: #a98d60; }

/* segmented 控件 */
.gm-seg {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 6px;
    padding: 4px;
    background: #f3e4c6;
    border-radius: 11px;
}
[data-theme="dark"] .gm-seg { background: #211b12; }
.gm-seg button {
    border: 0;
    background: transparent;
    padding: 9px 6px;
    font-size: 13px;
    font-weight: 700;
    color: #8a6a3a;
    border-radius: 8px;
    cursor: pointer;
    transition: all .2s ease;
    white-space: nowrap;
}
.gm-seg button:hover { color: #4a3015; }
.gm-seg button.active {
    background: #fff;
    color: #b4452c;
    box-shadow: 0 2px 8px rgba(140, 100, 40, 0.18);
}
[data-theme="dark"] .gm-seg button { color: #c9ae7d; }
[data-theme="dark"] .gm-seg button.active { background: #3a2c18; color: #ffb08f; }

/* 操作按钮 */
.gm-actions { display: flex; flex-direction: column; gap: 8px; }
.gm-btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gm-btn {
    border: 1px solid #e0c69c;
    background: #fff;
    color: #6b5227;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all .2s ease;
}
.gm-btn:hover { border-color: #c8a468; background: #fdf6e9; transform: translateY(-1px); }
.gm-btn:active { transform: translateY(0); }
.gm-btn.primary {
    background: linear-gradient(135deg, #e8a33d, #d17c26);
    color: #fff;
    border: 0;
    box-shadow: 0 5px 14px rgba(209, 124, 38, 0.35);
}
.gm-btn.primary:hover { background: linear-gradient(135deg, #f0b04e, #dd8730); }
.gm-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.gm-btn.sound-btn.active { background: #eef6fd; color: #2c74b4; border-color: #a8cfe8; }
[data-theme="dark"] .gm-btn.sound-btn.active { background: #16222e; color: #8ec9ff; border-color: #31587d; }
.gm-btn.sound-btn.off { opacity: .5; text-decoration: line-through; }
[data-theme="dark"] .gm-btn { background: #241d12; border-color: #4a3a26; color: #dcc394; }
[data-theme="dark"] .gm-btn:hover { background: #31271a; }

/* 战绩 */
.gm-record-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.gm-record-item {
    text-align: center;
    padding: 10px 4px;
    background: #faf3e2;
    border-radius: 10px;
}
[data-theme="dark"] .gm-record-item { background: #1d1810; }
.gm-record-item b {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: #b4452c;
}
.gm-record-item span { font-size: 12px; color: #9a7b4f; }
[data-theme="dark"] .gm-record-item span { color: #a98d60; }

.gm-hint {
    background: rgba(255, 255, 255, 0.5);
    border: 1px dashed #d9bc8e;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 12.5px;
    line-height: 1.7;
    color: #8a6a3a;
}
[data-theme="dark"] .gm-hint {
    background: rgba(31, 26, 18, 0.5);
    border-color: #4a3a26;
    color: #b8a077;
}
.gm-hint p { margin: 0; }
.gm-hint p + p { margin-top: 4px; }

/* ---- 信息区（复用 tool-detail 骨架，略微强调） ---- */
.gm-info { margin-top: 30px; }
