/* 镜像速判 */
.main {
    grid-template-columns: minmax(0, 1fr) 400px;
}
@media (max-width: 900px) {
    .main {
        grid-template-columns: 1fr;
    }
}
.main .extra-panel {
    grid-column: 1 / -1;
    margin-top: 0;
}

.hidden { display: none !important; }

/* ---- 速判区 ---- */
.mirror-zone {
    /* --fig-base 由 JS 按难度写入；--fig-scale 由断点整体缩放几何 */
    --fig-base: 132px;
    --fig-scale: 1;
    --fig: calc(var(--fig-base) * var(--fig-scale));
    --fig-card: calc(var(--fig) + 34px);
    --fig-fs: calc(var(--fig) * 0.28);
    border-radius: 14px;
    min-height: 400px;
    padding: 22px 18px;
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    transition: background .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.mirror-zone.idle {
    background: #f1f2f4;
    border: 2px dashed #d1d5db;
    color: #6b7280;
}
.mirror-zone.play {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
}
.mirror-zone.hit {
    background: linear-gradient(135deg, #ecfdf5 0%, #a7f3d0 150%);
    border-color: #34d399;
}
.mirror-zone.miss {
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 150%);
    border-color: #f87171;
}
.mirror-zone.over {
    background: linear-gradient(135deg, #eef2ff 0%, #ddd6fe 140%);
    border: 2px solid #a5b4fc;
}

/* ---- 顶部：倒计时 + 分数 ---- */
.z-top {
    width: 100%;
    max-width: 560px;
    display: flex;
    align-items: center;
    gap: 18px;
}
.z-time { flex: 1; }
.z-time .t-num {
    font-size: 30px;
    font-weight: 800;
    color: #4338ca;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    letter-spacing: 1px;
}
.t-track {
    margin-top: 6px;
    height: 7px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}
.t-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width .2s linear, background .3s ease;
}
.z-score {
    position: relative;
    min-width: 116px;
    text-align: right;
}
.z-score .s-label {
    font-size: 12px;
    color: #9ca3af;
}
.z-score .s-num {
    font-size: 40px;
    font-weight: 800;
    line-height: 1.1;
    color: #4338ca;
    font-variant-numeric: tabular-nums;
}
.z-score .s-streak {
    font-size: 12px;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
}
.z-score .s-delta {
    position: absolute;
    right: 0;
    top: 14px;
    font-size: 18px;
    font-weight: 800;
    opacity: 0;
}
.z-score .s-delta.up { color: #16a34a; }
.z-score .s-delta.down { color: #dc2626; }
.z-score .s-delta.anim { animation: deltaPop .7s ease; }
@keyframes deltaPop {
    0%   { opacity: 0; transform: translateY(6px); }
    25%  { opacity: 1; transform: translateY(-2px); }
    100% { opacity: 0; transform: translateY(-16px); }
}

/* ---- 图形对 ---- */
.pair-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
}
.fig-card {
    width: var(--fig-card);
    padding: 10px 8px 12px;
    background: #fff;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.fig-tag {
    font-size: 12px;
    color: #9ca3af;
    letter-spacing: 1px;
}
.fig {
    width: var(--fig);
    height: var(--fig);
    display: flex;
    align-items: center;
    justify-content: center;
}
.fig-canvas,
.fig-svg {
    display: block;
    width: 100%;
    height: 100%;
}
.fig-svg { overflow: visible; }
.pair-wrap .vs {
    font-size: var(--fig-fs);
    font-weight: 800;
    color: #cbd5e1;
    font-style: italic;
}

/* ---- 提示与判定按钮 ---- */
.mirror-zone .z-sub {
    font-size: 15px;
    line-height: 1.7;
    color: #4b5563;
    text-align: center;
    max-width: 520px;
    min-height: 26px;
}
.mirror-zone.idle .z-sub { color: #6b7280; }

.judge-bar {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 560px;
}
.judge-btn {
    flex: 1;
    padding: 12px 10px;
    border-radius: 10px;
    border: 2px solid transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: #fff;
    transition: transform .12s ease, box-shadow .2s ease, opacity .2s ease;
}
.judge-btn .j-main { font-size: 22px; font-weight: 800; letter-spacing: 2px; }
.judge-btn .j-sub { font-size: 12px; opacity: .9; }
.judge-btn .j-key {
    margin-top: 3px;
    font-size: 11px;
    background: rgba(255, 255, 255, .25);
    border-radius: 999px;
    padding: 1px 9px;
}
.judge-btn.same { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.judge-btn.mirror { background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%); }
.judge-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, .16); }
.judge-btn:active { transform: translateY(0); }
.judge-btn.picked { box-shadow: 0 0 0 3px rgba(255, 255, 255, .9); }
.judge-btn.correct { box-shadow: 0 0 0 3px #22c55e, 0 0 0 6px rgba(34, 197, 94, .3); }
.judge-btn.wrong { opacity: .45; }

/* ---- 开始按钮 ---- */
.zone-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.zone-btn {
    padding: 12px 34px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: #667eea;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .15);
    transition: background .2s ease, transform .15s ease, opacity .2s ease;
}
.zone-btn:hover { background: #5a6fd6; transform: translateY(-1px); }
.zone-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---- 结算 ---- */
.z-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}
.z-result .r-icon { font-size: 40px; }
.z-result .r-score {
    font-size: 66px;
    font-weight: 800;
    line-height: 1.05;
    color: #4338ca;
    font-variant-numeric: tabular-nums;
}
.z-result .r-txt { font-size: 18px; font-weight: 700; color: #374151; }
.z-result .r-stats { font-size: 13px; color: #4b5563; margin-bottom: 6px; }

/* ---- 头部计时徽标 ---- */
.progress-chip {
    background: #eef2ff;
    color: #4338ca;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.progress-chip.warn {
    background: #fef2f2;
    color: #dc2626;
}

/* ---- 设置面板 ---- */
.dur-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dur-options .radio-card { justify-content: center; padding: 9px 6px; }
.diff-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.diff-options .radio-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 8px 8px;
}
.diff-options .radio-card b { font-size: 14px; }
.diff-options .radio-card i {
    font-style: normal;
    font-size: 11px;
    color: #9ca3af;
    white-space: nowrap;
}
.diff-options .radio-card.active i { color: #6366f1; }

.grade-box {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
    padding: 12px 14px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    transition: border-color .25s ease;
}
.grade-box .grade-icon { font-size: 26px; }
.grade-box .grade-txt { font-size: 14px; font-weight: 700; color: #374151; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.stat {
    background: #f9fafb;
    border: 1px solid #eef0f4;
    border-radius: 8px;
    padding: 10px 6px;
    text-align: center;
}
.stat b {
    display: block;
    font-size: 19px;
    font-weight: 800;
    color: #4338ca;
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
}
.stat span {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: #6b7280;
}

.record-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin: 4px 0 8px;
}
.record-title .link-btn {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    font-size: 12px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px 12px;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.record-title .link-btn:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #ef4444;
}
.record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #4b5563;
    background: #fff;
    border: 1px solid #f1f3f7;
    border-radius: 8px;
    padding: 7px 10px;
    margin-bottom: 6px;
}
.record-item.best { background: #f0fdf4; border-color: #bbf7d0; }
.record-item .rec-date {
    display: block;
    font-style: normal;
    color: #9ca3af;
}
.record-item .rec-time {
    font-size: 15px;
    font-weight: 800;
    color: #f59e0b;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.mode-note {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.7;
    background: #f9fafb;
    border: 1px solid #eef0f4;
    border-radius: 8px;
    padding: 10px 12px;
}
.mode-note b { color: #374151; font-size: 14px; }
.mode-note strong { color: #4338ca; }

/* ---- 速判区下方状态栏 / 玩法介绍卡：美化 ---- */
.main > .panel > .status-bar {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 9px 14px 9px 20px;
    box-shadow: 0 2px 10px rgba(51, 65, 85, .06);
    position: relative;
    overflow: hidden;
    margin: 0 15px 10px;
}
.main > .panel > .status-bar::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    bottom: 7px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: linear-gradient(180deg, #667eea, #764ba2);
}
.main > .panel > .status-bar.status-success {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    color: #15803d;
    border-color: #bbf7d0;
}
.main > .panel > .status-bar.status-success::before {
    background: linear-gradient(180deg, #34d399, #059669);
}
.main > .panel > .status-bar.status-error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #b91c1c;
    border-color: #fecaca;
}
.main > .panel > .status-bar.status-error::before {
    background: linear-gradient(180deg, #f87171, #dc2626);
}

.mode-note {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 130%);
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 2px 10px rgba(67, 56, 202, .08);
    margin: 0 15px 6px;
}
.mode-note::before {
    content: '💡';
    margin-right: 4px;
}
.mode-note b {
    display: inline-block;
    color: #3730a3;
    background: rgba(99, 102, 241, .14);
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 700;
}

/* ---- 小屏适配：整体缩小图形几何与字号 ---- */
@media (max-width: 900px) {
    .mirror-zone {
        --fig-scale: .82;
        min-height: 340px;
        padding: 18px 12px;
    }
    .z-time .t-num { font-size: 26px; }
    .z-score .s-num { font-size: 34px; }
    .mirror-zone .z-sub { font-size: 14px; }
    .stat-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 600px) {
    .mirror-zone {
        --fig-scale: .6;
        min-height: 300px;
        padding: 16px 10px;
        gap: 12px;
    }
    .z-top { gap: 10px; }
    .z-time .t-num { font-size: 22px; }
    .z-score { min-width: 78px; }
    .z-score .s-num { font-size: 28px; }
    .z-score .s-delta { font-size: 15px; }
    .pair-wrap { gap: 8px; }
    .fig-card { padding: 8px 5px 9px; }
    .judge-btn { padding: 10px 6px; }
    .judge-btn .j-main { font-size: 18px; }
    .judge-btn .j-sub { font-size: 11px; }
    .z-result .r-score { font-size: 48px; }
    .zone-btn { padding: 11px 26px; font-size: 15px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .diff-options { grid-template-columns: 1fr; }
}
