::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.meta-box {
    min-width: 104px;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    background: #f8fafc;
    padding: 0.5rem 0.75rem;
}

.meta-label {
    color: #64748b;
    font-size: 0.75rem;
}

.meta-value {
    color: #0f172a;
    font-size: 1.25rem;
    line-height: 1.2;
    font-weight: 700;
}

.board-wrap {
    display: flex;
    justify-content: center;
}

.board {
    width: min(92vw, 420px);
    aspect-ratio: 4 / 5;
    background: #9c6f49;
    border-radius: 0.95rem;
    padding: 8px;
    position: relative;
    touch-action: manipulation;
    overflow: hidden;
}

.board-bg {
    position: absolute;
    inset: 8px;
    background:
        linear-gradient(to right, rgba(255, 255, 255, 0.18) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.18) 1px, transparent 1px),
        #7a5436;
    background-size: 25% 20%;
    border-radius: 0.75rem;
}

.goal-mark {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translate(-50%, -3px);
    color: #fef3c7;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    z-index: 5;
}

.hint-layer,
.piece-layer {
    position: absolute;
    inset: 8px;
}

.hint {
    position: absolute;
    border: 2px dashed rgba(191, 219, 254, 0.95);
    background: rgba(59, 130, 246, 0.25);
    border-radius: 0.6rem;
    cursor: pointer;
    z-index: 8;
}

.piece {
    position: absolute;
    border: 1px solid rgba(15, 23, 42, 0.2);
    border-radius: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    user-select: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.18);
    transition: transform 120ms ease, box-shadow 120ms ease;
    z-index: 10;
}

.piece:hover {
    transform: translateY(-1px);
}

.piece.selected {
    box-shadow: 0 0 0 3px rgba(219, 234, 254, 0.95), 0 6px 14px rgba(15, 23, 42, 0.24);
}

.piece.caocao { background: linear-gradient(145deg, #dc2626, #b91c1c); }
.piece.hengjiang { background: linear-gradient(145deg, #7c3aed, #6d28d9); }
.piece.shujiang { background: linear-gradient(145deg, #2563eb, #1d4ed8); }
.piece.bing { background: linear-gradient(145deg, #16a34a, #15803d); }

.piece-label {
    font-size: clamp(0.72rem, 2.2vw, 1rem);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.win-overlay {
    position: absolute;
    inset: 8px;
    border-radius: 0.75rem;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.win-panel {
    width: min(280px, calc(100% - 1.5rem));
    background: #fff;
    border-radius: 0.8rem;
    padding: 1rem;
    text-align: center;
}

.win-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
}

.win-desc {
    font-size: 0.9rem;
    color: #475569;
    margin: 0.35rem 0 0.85rem;
}

.hidden { display: none; }
