/* ==========================================================================
   Rules, card reference, tutorial and review pages
   ========================================================================== */

/* ---------------------------------------------------------------- rules --- */
.rules-page h2 { font-size: 24px; margin: 34px 0 10px; }
.rules-page ul { color: var(--text-2); line-height: 1.65; padding-left: 22px; margin: 0 0 12px; }
.rules-page li { margin-bottom: 6px; }
.rules-page li b { color: var(--text); }
.rule-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.rule-toc { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.rule-toc a { background: var(--panel); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 700; color: var(--text-2); }
.rule-toc a:hover { background: var(--panel-3); color: var(--text); }
.rule-sec { scroll-margin-top: 16px; }
.face-rule h3, .ref-text h3, .lesson-card h3, .lesson-top .lt-title { font-weight: 800; }
.rule-figure { display: flex; gap: 8px; margin: 6px 0 14px; }
.rule-card { display: inline-block; width: 64px; vertical-align: middle; line-height: 0; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
.rule-card svg, .rule-card img { width: 100%; height: auto; display: block; }
.rule-card.big { width: 86px; flex: none; }
.rule-card.sm { width: 40px; }
.face-rules { display: flex; flex-direction: column; gap: 12px; margin: 8px 0 14px; }
.face-rule { display: flex; gap: 16px; align-items: flex-start; background: var(--panel); border-radius: 8px; padding: 14px; }
.face-rule h3 { font-family: var(--font-head); font-size: 19px; margin-bottom: 4px; }
.face-rule p { margin: 0; }
.variant-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.variant-cards h3 { font-size: 16px; margin-bottom: 6px; }
.variant-cards p { font-size: 14px; margin: 0; }

/* ------------------------------------------------------------ reference --- */
.suit-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.suit-chip { background: #fbf8f1; border-radius: 999px; padding: 4px 12px; font-weight: 800; font-size: 14px; }
.ref-row { display: flex; gap: 18px; align-items: center; margin-bottom: 12px; }
.ref-cards { display: flex; gap: 6px; flex: none; }
.ref-cards .rule-card { width: 70px; }
.ref-text h3 { font-family: var(--font-head); font-size: 20px; margin-bottom: 4px; }
.ref-text p { margin: 0 0 8px; }
.ref-example { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13.5px; color: var(--text-2); font-weight: 600; }
.ref-arrow .ico { width: 18px; height: 18px; color: var(--gold); }
.ref-table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 8px; overflow: hidden; font-size: 14.5px; }
.ref-table th, .ref-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.ref-table th { color: var(--text-3); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }

/* -------------------------------------------------------------- tutorial --- */
.learn-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.lesson-card { position: relative; background: var(--panel); border-radius: 8px; padding: 18px 18px 16px 58px; cursor: pointer; border: 1px solid #ffffff08; transition: background .12s, transform .12s; text-align: left; color: inherit; font: inherit; }
.lesson-card:hover { background: var(--panel-3); transform: translateY(-2px); }
.lesson-card .lc-num { position: absolute; left: 14px; top: 16px; width: 32px; height: 32px; border-radius: 50%; background: var(--panel-3); color: var(--gold); font-weight: 800; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); }
.lesson-card.done .lc-num { background: var(--accent); color: #fff; }
.lesson-card h3 { font-family: var(--font-head); font-size: 18px; margin-bottom: 4px; }
.lesson-card p { font-size: 13.5px; margin: 0; }
.lesson-card .lc-meta { font-size: 12px; color: var(--text-3); margin-top: 8px; font-weight: 700; }
.lesson-card .lc-done { position: absolute; right: 12px; top: 12px; color: var(--accent-hi); }
.progress-bar { height: 8px; background: var(--panel-3); border-radius: 4px; overflow: hidden; min-width: 200px; }
.progress-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); }

.lesson-layout { display: flex; gap: 18px; height: 100%; padding: 12px 18px; }
.lesson-layout .table-col { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.lesson-panel { width: 380px; flex: none; background: var(--panel); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.lesson-top { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.lesson-top .lt-title { font-family: var(--font-head); font-size: 20px; font-weight: 700; }
.lesson-top .lt-step { font-size: 12.5px; color: var(--text-3); font-weight: 700; margin-top: 2px; }
.step-dots { display: flex; gap: 4px; margin-top: 8px; }
.step-dots i { flex: 1; height: 4px; border-radius: 2px; background: var(--panel-3); }
.step-dots i.done { background: var(--accent); }
.step-dots i.cur { background: var(--gold); }
.lesson-text { padding: 14px 16px; flex: 1; overflow-y: auto; font-size: 15px; line-height: 1.6; color: var(--text-2); }
.lesson-text b { color: var(--text); }
.lesson-text p { margin-bottom: 10px; }
.task-box { margin: 0 16px 12px; background: #26382a; border-left: 4px solid var(--accent); border-radius: 8px; padding: 10px 12px; font-weight: 700; font-size: 14px; color: var(--text); }
.task-box.fail { background: #3c2622; border-left-color: var(--red-soft); }
.task-box.win { background: #3a3424; border-left-color: var(--gold); }
.task-box .tb-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-3); margin-bottom: 2px; }
.lesson-foot { padding: 10px 16px 14px; display: flex; gap: 8px; border-top: 1px solid var(--line); background: var(--panel-2); }
.lesson-foot .btn { flex: 1; }

/* ---------------------------------------------------------------- review --- */
.review-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 14px; }
.acc-box { background: var(--panel-2); border-radius: 12px; padding: 12px; text-align: center; }
.acc-box .acc-name { font-size: 13px; font-weight: 700; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-box .acc-num { font-family: var(--font-mono); font-size: 28px; font-weight: 700; color: var(--text); }
.acc-box .acc-sub { font-size: 11.5px; color: var(--text-3); }
.grade-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 0 0 6px; }
.grade-table td { padding: 5px 14px; border-bottom: 1px solid #ffffff08; }
.grade-table td:nth-child(2), .grade-table td:nth-child(3) { text-align: center; font-family: var(--font-mono); font-weight: 700; }
.grade { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; border-radius: 6px; font-size: 11px; font-weight: 800; padding: 0 5px; color: #fff; }
.grade.best { background: #1f9e7e; }
.grade.excellent { background: #4aa36a; }
.grade.good { background: #6f8f5a; }
.grade.inaccuracy { background: #c9a227; color: #2b2002; }
.grade.mistake { background: #d97a2b; }
.grade.blunder { background: #c8402f; }
.grade.book { background: #5b6b7a; }
.review-tip { margin: 8px 14px; background: var(--panel-3); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; color: var(--text-2); display: flex; gap: 10px; }
.review-tip .ico { width: 20px; height: 20px; color: var(--gold); flex: none; margin-top: 1px; }
.review-tip b { color: var(--text); }
.coach { margin: 10px 14px; background: #26382a; border-radius: 12px; padding: 12px; font-size: 14px; color: var(--text); }
.coach .coach-h { display: flex; align-items: center; gap: 8px; font-weight: 800; margin-bottom: 4px; }
.coach .better { margin-top: 6px; font-size: 13px; color: var(--text-2); }

@media (max-width: 860px) {
  .lesson-layout { flex-direction: column; height: auto; padding: 8px 8px 24px; }
  .lesson-layout .table-col { height: min(70vh, 640px); flex: none; }
  .lesson-panel { width: 100%; }
  .ref-row { flex-direction: column; align-items: flex-start; }
  .face-rule { flex-direction: column; }
}
