.main {
    grid-template-columns: minmax(0, 1fr) 400px;
}

.main .extra-panel {
    grid-column: 1 / -1;
    margin-top: 0;
}

/* ---- 玩法说明 ---- */
.play-legend {
    background: #f9fafb;
    border: 1px solid #eef0f4;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.9;
    color: #6b7280;
}

.play-legend ol {
    margin: 0 0 0 16px;
}

.play-legend strong {
    color: #374151;
}

/* ---- 棋盘（黑色） ---- */
.board-wrap {
    border-radius: 12px;
    background: #000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

.stage-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
    width: 100%;
    padding: 16px;
    background: #000;
    border-radius: 12px;
}

.stage-board.locked {
    opacity: 0.55;
    pointer-events: none;
    user-select: none;
}

.cell {
    aspect-ratio: 1;
    background: transparent;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    color: transparent;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: transform 0.1s, background 0.15s, opacity 0.3s;
    user-select: none;
    position: relative;
}

.cell.mini {
    font-size: 20px;
}

.cell.n {
    background: #fff;
    color: #1f2937;
}

.cell.n:hover {
    background: #eef2ff;
    color: #4338ca;
}

.cell.block {
    background: #fff;
}

.cell.block:hover {
    background: #d1d5db;
}

.cell.done {
    background: transparent;
    cursor: default;
}

.cell.fail {
    background: #dc2626;
    animation: shake 0.45s ease;
}

.cell.boom {
    animation: boom 0.45s ease;
}

@keyframes boom {
    0%   { transform: scale(1.18); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-7px); }
    40%      { transform: translateX(6px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(3px); }
}

/* ---- 局面提示 ---- */
.stage-hint {
    text-align: center;
    font-size: 14px;
    color: #6b7280;
    margin-top: 12px;
    min-height: 20px;
}

.stage-hint b {
    color: #4338ca;
}

/* ---- 顶部数据卡 ---- */
.mini-hero {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.mini-hero .big-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: #fff;
    padding: 12px 14px;
    text-align: center;
}

.mini-hero .big-card.pass-card {
    background: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%);
}

.mini-hero .big-card.best-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    color: #374151;
}

.mini-hero .card-label {
    font-size: 12px;
    opacity: 0.9;
}

.mini-hero .card-val {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
}

/* ---- 本局记录 ---- */
.record-title {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin: 16px 0 6px;
}

.record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #f3f4f6;
    font-size: 13px;
    color: #4b5563;
}

.record-item:last-child {
    border-bottom: none;
}

.record-item .tick {
    font-weight: 600;
}

.record-item.ok .tick   { color: #16a34a; }
.record-item.fail .tick { color: #ef4444; }

/* ---- 挑战失败居中提示 ---- */
.status-bar.fail-center {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
    height: auto;
    padding: 12px 15px;
}

.status-bar.fail-center span:first-child {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.status-bar.fail-center .cry-emoji {
    font-size: 44px;
    line-height: 1;
}

.status-bar.fail-center .fail-tip {
    font-size: 14px;
    font-weight: 600;
}

@media (max-width: 900px) {
    .main {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stage-board {
        gap: 6px;
        padding: 10px;
    }
}