/* ===== Cờ thế: dùng bàn + quân của Cờ tướng, chỉ thêm khung đề bài và nút chọn mức ===== */
#the-app {
    flex: 1; min-height: 0; display: flex; flex-direction: column;
    --cell: clamp(30px, min(calc(var(--board-max) / 9.5), calc((100vh - 150px) / 10.6)), 72px);
}

.the-card {
    background: var(--cc-fill-1); border: 1px solid var(--cc-line); border-radius: var(--cc-r);
    padding: var(--cc-sp-4);
}
.the-sidebar > .the-card { width: 100%; box-sizing: border-box; }
.the-level { margin: 0; font-size: var(--cc-fs-sm); color: var(--cc-wood-hi); font-weight: 600; }
.the-title { margin: var(--cc-sp-1) 0 var(--cc-sp-2); font-size: var(--cc-fs-xl); line-height: var(--cc-lh-tight); color: var(--cc-text); }
.the-ref { margin: calc(var(--cc-sp-1) * -1) 0 var(--cc-sp-2); font-size: var(--cc-fs-xs); color: var(--cc-text-muted); font-style: italic; }
.the-task { margin: 0 0 var(--cc-sp-3); font-size: var(--cc-fs-sm); color: var(--cc-text-muted); line-height: 1.55; }
.the-actions { display: flex; flex-wrap: wrap; gap: var(--cc-sp-2); margin-top: var(--cc-sp-3); }
.the-actions button { flex: 1 1 auto; min-height: 44px; }
.the-points { margin: var(--cc-sp-3) 0 0; font-size: var(--cc-fs-xs); color: var(--cc-text-faint); }

/* Chọn mức: 4 quân cờ gỗ xếp 2×2, mức đang chọn sáng viền; dòng dưới là tiến độ của mức đó */
.the-tiers { display: grid; grid-template-columns: 1fr 1fr; gap: var(--cc-sp-2); padding: var(--cc-sp-3); }
.the-tier {
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 44px;
    padding: var(--cc-sp-2) var(--cc-sp-3); border-radius: var(--cc-r-sm); cursor: pointer; text-align: left;
    background: transparent; border: 1px solid var(--cc-line); color: var(--cc-text);
    font: inherit; transition: border-color var(--cc-dur) var(--cc-ease), background-color var(--cc-dur) var(--cc-ease);
}
.the-tier:hover { border-color: var(--cc-line-strong); }
.the-tier:focus-visible { outline: 3px solid var(--cc-info); outline-offset: 2px; }
.the-tier[aria-pressed="true"] { border-color: var(--cc-wood-hi); background: rgba(var(--cc-wood-rgb), .12); }
.the-tier-name { font-weight: 700; font-size: var(--cc-fs-sm); }
.the-tier[aria-pressed="true"] .the-tier-name { color: var(--cc-wood-hi); }
.the-tier-desc { font-size: var(--cc-fs-xs); color: var(--cc-text-muted); }
.the-tier-count { font-size: var(--cc-fs-xs); color: var(--cc-text-faint); font-variant-numeric: tabular-nums; }

/* Bản HTML dựng sẵn (trước khi JS chạy) */
.the-index { padding: var(--cc-sp-4); max-width: 420px; }
