﻿/* ══════════════════════════════════════
   game.css · 托格孜胡玛拉克
   ══════════════════════════════════════ */

:root {
    --bg-page: #D6EAF8;
    --bg-board: #90CAF9;
    --bg-panel: #DDEEFA;
    --bg-hole: #EBF5FC;
    --bg-hole-hover: #B3D9F4;
    --bg-white: #FFFFFF;
    --blue-dark: #0D47A1;
    --blue-mid: #1565C0;
    --blue-light: #42A5F5;
    --blue-pale: #BBDEFB;
    --text-primary: #0D47A1;
    --text-secondary: #5B8DB8;
    --text-white: #FFFFFF;
    --text-muted: #90A4AE;
    --tuzdyk-color: #E53935;
    --win-color: #2E7D32;
    --warn-color: #C62828;
    --timer-active: #2E7D32;
    --score-lead: #FFD700;
    --shadow-panel: 0 0 3px 2px rgba(245,245,245,0.4);
    --shadow-card: 0 4px 24px rgba(13,71,161,0.15);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --header-h: 60px;
    --footer-h: 44px;
    --max-w: 1200px;
    --side-w: 130px;
}

/* ── 重置 ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    background: var(--bg-page);
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    user-select: none;
}

/* ══════════════════════════════════════
   横屏提示
   ══════════════════════════════════════ */
#rotate-hint {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(13,71,161,0.92);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.rotate-inner {
    text-align: center;
    color: white;
}

.rotate-icon {
    font-size: 56px;
    margin-bottom: 16px;
    animation: rotateAnim 2s infinite ease-in-out;
}

@keyframes rotateAnim {
    0%,100% {
        transform: rotate(0deg);
    }

    50% {
        transform: rotate(90deg);
    }
}

.rotate-inner p {
    font-size: 16px;
    opacity: 0.9;
}

@media (max-width:600px) and (orientation:portrait) {
    #rotate-hint {
        display: flex;
    }
}

/* ══════════════════════════════════════
   Header
   ══════════════════════════════════════ */
#site-header {
    width: 100%;
    height: var(--header-h);
    background: var(--bg-page);
    box-shadow: 0 2px 8px rgba(13,71,161,0.12);
    display: flex;
    justify-content: center;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

.header-inner {
    width: 100%;
    max-width: var(--max-w);
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.site-logo {
    display: flex;
    flex-direction: column;
    min-width: 160px;
}

.logo-kaz {
    font-size: 16px;
    font-weight: 700;
    color: var(--blue-dark);
    direction: rtl;
    line-height: 1.2;
    text-align: left;
    font-family: KazNet;
    margin-top: 4px;
    padding-left: 5px;
}

.logo-zh {
    font-size: 15px;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--blue-dark);
}

.site-nav {
    flex: 1;
}

    .site-nav ul {
        list-style: none;
        display: flex;
        gap: 4px;
        height: var(--header-h);
        align-items: center;
    }

        .site-nav ul li a {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            height: var(--header-h);
            padding: 0 16px;
            color: var(--text-primary);
            text-decoration: none;
            font-size: 14px;
            font-weight: 500;
            border-bottom: 3px solid transparent;
            transition: background 0.15s;
        }

            .site-nav ul li a:hover {
                background: rgba(255,255,255,0.5);
            }

            .site-nav ul li a.nav-active {
                border-bottom-color: var(--blue-mid);
                color: var(--blue-mid);
            }

            .site-nav ul li a.nav-disabled {
                color: var(--text-muted);
                cursor: default;
                pointer-events: none;
            }

.badge-soon {
    font-size: 10px;
    background: var(--blue-pale);
    color: var(--blue-mid);
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 400;
}

.user-area {
    display: flex;
    gap: 8px;
    min-width: 160px;
    justify-content: flex-end;
}

.btn-user {
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--blue-light);
    background: transparent;
    color: var(--blue-mid);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}

    .btn-user:hover {
        background: var(--blue-pale);
    }

.btn-user-primary {
    background: var(--blue-mid);
    color: white;
    border-color: var(--blue-mid);
}

    .btn-user-primary:hover {
        background: var(--blue-dark);
    }

/* ── 开始对局遮罩 ── */
.start-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(3px);
    z-index: 20;
}

    .start-overlay.hidden {
        display: none;
    }

.start-card {
    text-align: center;
    padding: 32px 40px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.start-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
}

.start-sub {
    font-size: 14px;
    color: #888;
    margin: 6px 0 20px;
}

.btn-start {
    padding: 12px 36px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: #2563eb;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

    .btn-start:hover {
        background: #1d4ed8;
    }

/* 确保棋盘容器能作为遮罩的定位父级 */
#main-board {
    position: relative;
}

/* ══════════════════════════════════════
   Main
   ══════════════════════════════════════ */
#site-main {
    flex: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 20px 24px;
}

.main-inner {
    width: 100%;
    max-width: var(--max-w);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ── 操作栏 ── */
.controls-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    background: var(--bg-panel);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-panel);
}

.controls-left {
    display: flex;
    gap: 8px;
}

.controls-center {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

    .controls-center label {
        font-size: 13px;
    }

.controls-right {
    margin-left: auto;
    font-size: 13px;
}

#status-text {
    color: var(--blue-mid);
    font-weight: 500;
}

.btn-ctrl {
    padding: 7px 18px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--blue-light);
    background: var(--bg-white);
    color: var(--blue-mid);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

    .btn-ctrl:hover:not(:disabled) {
        background: var(--bg-hole-hover);
        border-color: var(--blue-mid);
    }

    .btn-ctrl:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }

    .btn-ctrl.btn-primary {
        background: var(--blue-mid);
        color: white;
        border-color: var(--blue-mid);
    }

        .btn-ctrl.btn-primary:hover {
            background: var(--blue-dark);
        }

select#selLevel {
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--blue-pale);
    background: var(--bg-white);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
}

/* ══════════════════════════════════════
   游戏布局：棋盘 + 右侧栏
   ══════════════════════════════════════ */
.game-layout {
    display: flex;
    align-items: stretch;
    gap: 12px;
}

/* ══════════════════════════════════════
   棋盘主体
   ══════════════════════════════════════ */
.board-wrap {
    flex: 1;
    min-width: 0;
    background: var(--bg-board);
    border-radius: var(--radius-lg);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    box-shadow: var(--shadow-card);
}

/* 玩家标签条 */
.player-strip {
    display: flex;
    justify-content: flex-end;
    padding: 2px 8px;
}

.player-strip-bot {
    justify-content: flex-start;
}

.player-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-white);
    direction: rtl;
}

    .player-name em {
        font-style: normal;
        font-size: 11px;
        font-weight: 400;
        opacity: 0.8;
        margin-right: 4px;
        direction: ltr;
    }

/* 棋坑行 */
.holes-section {
    width: 100%;
}

.holes-row {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 8px;
}

/* 单个棋坑 */
.otaw {
    background: var(--bg-hole);
    border: 1.5px solid rgba(255,255,255,0.6);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 5px 4px;
    min-height: 160px;
    position: relative;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}

.otaw-hover {
    cursor: pointer;
}

    .otaw-hover:hover {
        background: var(--bg-hole-hover);
        box-shadow: 0 0 0 2.5px rgba(255,255,255,0.85), 0 4px 12px rgba(33,150,243,0.3);
        transform: translateY(-3px);
    }

.otaw-current {
    background: #2196F3;
    box-shadow: 0 0 10px rgba(33,150,243,0.5) inset;
}

.otaw-tuzdyk {
    background: #FFEBEE;
    border-color: var(--tuzdyk-color);
    box-shadow: 0 0 0 1.5px var(--tuzdyk-color);
}

.otaw-disabled {
    cursor: default;
    opacity: 0.75;
}

    .otaw-disabled:hover {
        background: var(--bg-hole);
        transform: none;
        box-shadow: none;
    }

/* 棋坑编号 */
.otaw-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--blue-dark);
    line-height: 1;
    flex-shrink: 0;
    z-index: 2;
}

/* 棋子数量标签 */
.otaw-count {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    line-height: 1;
    flex-shrink: 0;
    z-index: 2;
}

/* 棋子区域 */
.otaw-stones-area {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* Tuzdyk棋坑：金色系 */
.otaw-tuzdyk {
    background: #FFFDE7;
    border-color: #FFD700;
    border-width: 2px;
    box-shadow: 0 0 0 2px #FFD700, 0 0 14px rgba(255,215,0,0.35);
    cursor: default;
}

    .otaw-tuzdyk:hover {
        background: #FFFDE7;
        transform: none;
        box-shadow: 0 0 0 2px #FFD700, 0 0 14px rgba(255,215,0,0.35);
    }

/* Tuzdyk徽章：金色 */
.tuzdyk-badge {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #F9A825;
    color: #4E2900;
    font-size: 8px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 3;
    letter-spacing: 0.3px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* Canvas覆盖层 */
#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    border-radius: var(--radius-lg);
}

/* ── Qazan（全宽，无计数器）── */
.qazan-section {
    width: 100%;
}

.qazan-box {
    width: 100%;
    height: 80px;
    background: var(--bg-hole);
    border: 1.5px solid rgba(255,255,255,0.6);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    padding: 6px 25px;
    overflow: hidden;
    box-shadow: var(--shadow-panel);
    position: relative; /* ← 新增，让标注绝对定位 */
}

/* qazan内部居中标注 */
.qazan-inner-label {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: 600;
    color: rgba(13,71,161,0.35); /* 半透明，不干扰棋子 */
    direction: rtl;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1; /* 棋子在z-index:0，标注在上方但半透明 */
    letter-spacing: 0.5px;
}

/* Qazan标注 */
.qazan-label {
    font-size: 11px;
    color: rgba(255,255,255,0.8);
    direction: rtl;
    text-align: center;
    font-weight: 600;
    margin-bottom: 2px;
}

.qazan-label-top {
    margin-bottom: 4px;
}

.qazan-label-bottom {
    margin-top: 4px;
}

.qazan-stones {
    display: flex;
    align-items: center;
    overflow: hidden;
    flex: 1;
    height: 100%;
}

/* qazan 右侧得分数字 */
.qazan-score {
    flex-shrink: 0;
    margin-left: 12px;
    min-width: 48px;
    text-align: right;
    font-size: 30px;
    font-weight: 700;
    color: var(--blue-dark);
    line-height: 1;
    letter-spacing: -1px;
    z-index: 2; /* 高于 inner-label */
    transition: color 0.4s, transform 0.2s;
}

    .qazan-score.leading {
        color: var(--score-lead);
        text-shadow: 0 0 12px rgba(255,215,0,0.4);
    }

    .qazan-score.bump {
        transform: scale(1.18);
    }

/* AI加载 */
#loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(144,202,249,0.6);
    border-radius: var(--radius-lg);
    z-index: 20;
    gap: 12px;
    color: var(--blue-dark);
    font-weight: 600;
    font-size: 14px;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 4px solid var(--blue-pale);
    border-top-color: var(--blue-mid);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ══════════════════════════════════════
   右侧信息栏
   ══════════════════════════════════════ */
.side-panel {
    width: var(--side-w);
    flex-shrink: 0;
    background: var(--bg-board);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 上下玩家区域 */
.side-player {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 10px;
    gap: 10px;
}

.side-player-top {
    justify-content: flex-end;
}

.side-player-bot {
    justify-content: flex-start;
}

/* 中间分隔线 */
.side-center-divider {
    height: 2px;
    background: rgba(255,255,255,0.35);
    margin: 0 8px;
    flex-shrink: 0;
    border-radius: 1px;
}

/* 区域内分隔线 */
.side-divider {
    width: 100%;
    height: 1px;
    background: rgba(255,255,255,0.2);
    border-radius: 1px;
    flex-shrink: 0;
}

/* ── 头像区域 ── */
.player-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.avatar-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: white;
    border: 2px solid rgba(255,255,255,0.45);
    flex-shrink: 0;
}

.avatar-ai {
    background: linear-gradient(135deg, #1565C0, #0D47A1);
}

.avatar-player {
    background: linear-gradient(135deg, #2E7D32, #1B5E20);
}
/* 电脑头像：下边距20px */
.side-player-top .player-avatar {
    margin-bottom: 20px;
}

/* 玩家头像：上边距20px */
.side-player-bot .player-avatar {
    margin-top: 20px;
}

.player-nickname {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-white);
    text-align: center;
}

.player-rank {
    font-size: 10px;
    color: rgba(255,255,255,0.65);
    direction: rtl;
    text-align: center;
}

/* ── 计时器 ── */
.timer-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.timer-label-text {
    font-size: 10px;
    color: rgba(255,255,255,0.6);
    letter-spacing: 0.3px;
    text-align: center;
}

/* 计时器基础样式 */
/* timer容器改为flex，让绿点和数字并排 */
.timer-display {
    font-size: 20px;
    font-weight: 700;
    color: rgba(255,255,255,0.6);
    background: transparent;
    border-radius: var(--radius-md);
    padding: 4px 8px;
    width: 100%;
    letter-spacing: 1px;
    line-height: 1.2;
    transition: color 0.3s, background 0.3s, box-shadow 0.3s, border 0.3s;
    /* ── 非激活：透明背景+半透明白色边框 ── */
    border: 1.5px solid rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

    /* 激活 */
    .timer-display.current {
        font-size: 22px;
        color: #2E7D32;
        background: var(--bg-hole);
        border: 1.5px solid #A5D6A7; /* 绿色边框 */
    }

    /* 警告 */
    .timer-display.warning {
        font-size: 22px;
        color: #EF9A9A;
        background: rgba(198,40,40,0.15);
        border: 1.5px solid rgba(239,154,154,0.4); /* 红色边框 */
        animation: timerPulse 0.8s infinite;
    }

/* ── 指示点：默认隐藏 ── */
.timer-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: transparent;
    flex-shrink: 0;
    transition: background 0.3s;
}

/* 激活时显示绿点并闪烁 */
.timer-display.current .timer-dot {
    background: #2E7D32;
    box-shadow: 0 0 6px rgba(46,125,50,0.6);
    animation: dotPulse 1.5s infinite;
}

/* 警告时显示红点 */
.timer-display.warning .timer-dot {
    background: #EF9A9A;
    animation: dotPulse 0.8s infinite;
}


@keyframes dotPulse {
    0%,100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.7);
    }
}

@keyframes timerPulse {
    0%,100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

@keyframes timerPulse {
    0%,100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* 当前回合指示点 */
.timer-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
    transition: background 0.3s;
    flex-shrink: 0;
}

    .timer-indicator.active {
        background: #A5D6A7;
        box-shadow: 0 0 6px rgba(165,214,167,0.7);
        animation: indicatorPulse 1.5s infinite;
    }

@keyframes indicatorPulse {
    0%,100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.75);
    }
}

/* ── 棋子计数器 ── */
.score-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    width: 100%;
}

.score-label {
    font-size: 10px;
    color: rgba(255,255,255,0.6);
    text-align: center;
    letter-spacing: 0.3px;
}

/* ── 修改：数字和/162一行显示 ── */
.score-number-row {
    display: flex;
    align-items: baseline;
    gap: 3px;
    justify-content: center;
}

/* 核心数字：最大最醒目 */
/* 主数字保持大字号 */
.score-number {
    font-size: 38px;
    font-weight: 700;
    color: #FFFFFF;
    line-height: 1;
    text-align: center;
    transition: color 0.4s, transform 0.2s;
    letter-spacing: -1px;
}

    .score-number.leading {
        color: var(--score-lead);
        text-shadow: 0 0 12px rgba(255,215,0,0.4);
    }

    .score-number.bump {
        transform: scale(1.18);
    }

.score-sub {
    font-size: 10px;
    color: rgba(255,255,255,0.4);
    text-align: center;
}

/* /162 小字，跟数字对齐底部 */
.score-total {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    font-weight: 400;
    line-height: 1;
}

/* 进度条 */
.score-bar-wrap {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    background: rgba(255,255,255,0.5);
    border-radius: 2px;
    transition: width 0.4s ease, background 0.4s;
}

    .score-bar-fill.leading {
        background: var(--score-lead);
    }

/* 进度条 */
.score-bar-wrap {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    background: rgba(255,255,255,0.5);
    border-radius: 2px;
    transition: width 0.4s ease, background 0.4s;
}

    /* 领先时进度条变金色 */
    .score-bar-fill.leading {
        background: var(--score-lead);
    }

/* ══════════════════════════════════════
   对局日志
   ══════════════════════════════════════ */
.log-section {
    background: var(--bg-panel);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-panel);
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
    border-bottom: 1px solid var(--blue-pale);
    user-select: none;
}

    .log-header:hover {
        background: rgba(255,255,255,0.3);
    }

.log-toggle-icon {
    font-size: 11px;
    color: var(--text-secondary);
    transition: transform 0.2s;
}

    .log-toggle-icon.collapsed {
        transform: rotate(180deg);
    }

.log-body {
    max-height: 220px;
    overflow-y: auto;
    padding: 8px 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--blue-pale) transparent;
}

.log-entry {
    padding: 7px 0;
    border-bottom: 1px dashed var(--blue-pale);
    font-size: 12px;
    color: var(--text-primary);
    line-height: 1.5;
}

    .log-entry:last-child {
        border-bottom: none;
    }

.log-round {
    font-weight: 700;
    color: var(--blue-mid);
    margin-right: 6px;
}

.log-capture {
    color: var(--tuzdyk-color);
    font-weight: 600;
}

.log-tuzdyk {
    color: var(--win-color);
    font-weight: 600;
}

.log-score {
    color: var(--text-secondary);
    font-size: 11px;
    margin-top: 2px;
}

/* ══════════════════════════════════════
   结果覆盖层
   ══════════════════════════════════════ */
#result-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13,71,161,0.55);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px 48px;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0,0,0,0.25);
    min-width: 300px;
}

.result-emoji {
    font-size: 52px;
    margin-bottom: 12px;
}

.result-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--blue-dark);
    margin-bottom: 8px;
}

.result-score {
    font-size: 32px;
    font-weight: 700;
    color: var(--blue-mid);
    margin-bottom: 28px;
    letter-spacing: 2px;
}

.result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* 复盘控制条 */
#review-bar {
    position: absolute;
    left: 0px;
    right: 0px;
    bottom: -10px;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(13,71,161,0.92);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(13,71,161,0.4);
}

.review-btn {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border: none;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
}

    .review-btn:hover {
        background: rgba(255,255,255,0.3);
    }

.review-exit {
    margin-left: 4px;
    background: rgba(255,255,255,0.1);
}

.review-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #fff;
    line-height: 1.3;
    overflow: hidden;
}

#review-step {
    font-size: 12px;
    font-weight: 700;
}

#review-desc {
    font-size: 11px;
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.review-line1 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.review-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 10px;
    color: #fff;
    line-height: 1.6;
}

.tag-best {
    background: #2E7D32;
}
/* 最佳 绿 */
.tag-good {
    background: #1565C0;
}
/* 良好 蓝 */
.tag-ok {
    background: #78909C;
}
/* 一般 灰 */
.tag-bad {
    background: #EF6C00;
}
/* 失误 橙 */
.tag-blunder {
    background: #C62828;
}
/* 漏着 红 */

/* ══════════════════════════════════════
   规则弹窗
   ══════════════════════════════════════ */
#rules-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13,71,161,0.55);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ══════════════════════════════════════
   登录提示弹窗（点击开始对局但未登录时）
   ══════════════════════════════════════ */
#login-required-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13,71,161,0.55);
    z-index: 210;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-required-card {
    background: white;
    border-radius: var(--radius-lg);
    width: 320px;
    padding: 28px 24px;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0,0,0,0.25);
}

.login-required-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--blue-dark);
}

.login-required-sub {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 8px 0 20px;
}

.login-required-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.rules-card {
    background: white;
    border-radius: var(--radius-lg);
    width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0,0,0,0.25);
}

.rules-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--blue-pale);
    font-weight: 700;
    color: var(--blue-dark);
    font-size: 15px;
}

.btn-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: 4px;
}

    .btn-close:hover {
        background: var(--blue-pale);
    }

.rules-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* ══════════════════════════════════════
   Footer
   ══════════════════════════════════════ */
#site-footer {
    width: 100%;
    height: var(--footer-h);
    background: var(--bg-page);
    border-top: 1px solid var(--blue-pale);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.footer-inner {
    width: 100%;
    max-width: var(--max-w);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

.footer-icp a,
.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 16px;
}

    .footer-icp a:hover,
    .footer-links a:hover {
        color: var(--blue-mid);
    }

/* ══════════════════════════════════════
   防崩溃
   ══════════════════════════════════════ */
@media (max-width: 960px) {
    .main-inner {
        min-width: 900px;
        overflow-x: auto;
    }
}

@media (max-width:600px) and (orientation:landscape) {
    :root {
        --header-h: 44px;
    }

    .otaw {
        min-height: 110px;
    }

    .qazan-box {
        height: 56px;
        padding: 4px 14px;
    }

    .qazan-score {
        font-size: 24px;
        min-width: 40px;
    }

    .side-panel {
        width: 110px;
    }

    .score-number {
        font-size: 28px;
    }

    .timer-display {
        font-size: 18px;
    }
}
