/* Nước Cờ Hay: giao diện công khai.
   Ý tưởng: một tờ bản tin cờ in ấn của câu lạc bộ. Nền giấy đá, mực đen, đường kẻ đôi
   đánh dấu ranh giới mục, nhấn son mài đỏ dùng tiết chế. Tiêu đề serif, nội dung sans,
   bài đọc dài dùng serif để dễ đọc. Màu nút bấm lấy từ --accent (admin chỉnh trong Giao diện, xem theme.css). */

:root {
  --paper: #ebe9e2;
  --sheet: #f7f6f2;
  --ink: #1b1c1e;
  --ink-soft: #3d4046;
  --ink-mute: #64676d;
  --rule: #b9b6ac;
  --line: #d3d0c6;
  --lacquer: #a4262b;
  --link: #8c2024;
  --brass: #8f6f26;
  --slate: #2f5d7c;
  --board-light: #eee3cc;
  --board-dark: #9a7451;
  --footer: #1b1c1e;
  --footer-ink: #ecebe6;
  --footer-mute: #a4a59f;
  --on-accent: #ffffff;
  --r: 4px;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Be Vietnam Pro', Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #161514; --sheet: #1f1e1c; --ink: #ece9e1; --ink-soft: #cfccc3; --ink-mute: #9d9a91;
    --rule: #4a4843; --line: #2e2d2a; --lacquer: #e0685c; --link: #ef9a8c; --brass: #d2b06a;
    --slate: #8fb8d8; --footer: #0f0e0d; --footer-ink: #ecebe6; --footer-mute: #9d9a91;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #161514; --sheet: #1f1e1c; --ink: #ece9e1; --ink-soft: #cfccc3; --ink-mute: #9d9a91;
  --rule: #4a4843; --line: #2e2d2a; --lacquer: #e0685c; --link: #ef9a8c; --brass: #d2b06a;
  --slate: #8fb8d8; --footer: #0f0e0d; --footer-ink: #ecebe6; --footer-mute: #9d9a91;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
h4 { font-family: var(--sans); font-weight: 600; font-size: 16px; line-height: 1.35; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--lacquer); outline-offset: 2px; }
button { font: inherit; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--sheet); padding: 8px 12px; border-radius: var(--r); z-index: 10; }
.skip:focus { left: 8px; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.narrow { max-width: 760px; }
.center { text-align: center; }

/* ---------- Đầu trang: như tiêu đề báo, đường kẻ mực dày ---------- */
.site-header { background: var(--paper); border-bottom: 2px solid var(--ink); }
.head-row { display: flex; align-items: center; gap: 32px; height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); white-space: nowrap; text-decoration: none; }
.brand:hover { text-decoration: none; }
.logo-mark { width: 36px; height: 36px; flex: none; display: block; }
.logo-word { font-family: var(--sans); font-weight: 600; font-size: 24px; letter-spacing: -.01em; line-height: 1; }
.brand-light .logo-mark { outline: 1px solid var(--footer-mute); outline-offset: 0; border-radius: 6px; }
@media (max-width: 1180px) {
  .logo-mark { width: 32px; height: 32px; }
  .logo-word { font-size: 21px; }
}
.logo-num { font-family: var(--serif); font-weight: 700; color: var(--brass); }
.brand-light .logo-num { color: var(--brass); }
.site-header .brand { color: var(--ink); }
.brand-light { color: var(--footer-ink); }
.brand-light .logo-word { color: var(--footer-ink); }
.main-nav { display: flex; gap: 26px; font-size: 15px; font-weight: 500; overflow-x: auto; white-space: nowrap; }
.main-nav a { color: var(--ink-soft); padding: 8px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover { color: var(--ink); text-decoration: none; border-bottom-color: var(--rule); }
.main-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--lacquer); text-decoration: none; }
.site-search { margin-left: auto; display: flex; align-items: center; }
.site-search input {
  width: 220px; min-height: 40px; padding: 0 14px; border-radius: var(--r);
  border: 1px solid var(--ink); background: var(--sheet); color: var(--ink); font: inherit; font-size: 15px;
}
.site-search input::placeholder { color: var(--ink-mute); }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px; border-radius: var(--r);
  font-weight: 600; font-size: 15px;
  background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent);
  cursor: pointer;
}
.btn:hover { text-decoration: none; opacity: .9; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.text-link { font-weight: 600; color: var(--link); }
.text-link:hover { text-decoration: underline; }

/* ---------- Chữ và khối chung ---------- */
.sec { padding-top: 56px; }
.sec-hero { padding-top: 48px; padding-bottom: 48px; }
.sec-head { margin-bottom: 20px; }
.sec-head h2 { font-size: clamp(26px, 2.6vw, 32px); }
.sec-sub { font-family: var(--serif); font-size: 24px; font-weight: 600; margin: 40px 0 14px; line-height: 1.25; }
.lead-sm { font-size: 15px; color: var(--ink-mute); margin-top: 4px; }
.lead { font-size: 18px; line-height: 1.6; color: var(--ink-soft); margin-top: 16px; max-width: 60ch; }
.eyebrow, .eyebrow-sm { font-size: 13px; font-weight: 600; color: var(--lacquer); }
.tag { display: inline-block; font-size: 13px; font-weight: 600; color: var(--ink); border: 1px solid var(--ink); border-radius: var(--r); padding: 1px 8px; }
.muted { font-size: 14px; color: var(--ink-mute); margin-top: 6px; }
.muted-p { font-size: 15px; line-height: 1.55; color: var(--ink-soft); margin: 8px 0 12px; }
.muted-light { font-size: 14px; line-height: 1.6; color: var(--footer-mute); }
.card { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.card h3 { font-size: 20px; }

.grid { display: grid; gap: 20px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.bar { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: 12px; }
.bar > span { display: block; height: 100%; background: var(--accent); }

.thumb {
  flex: 0 0 200px; height: 130px; border-radius: var(--r); overflow: hidden;
  background: var(--line); color: var(--ink-soft); font-family: var(--serif); font-size: 17px; line-height: 1.2;
  display: flex; align-items: center; justify-content: center; padding: 12px; text-align: center;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Puzzle đầu trang ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 56px; align-items: center; }
h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(38px, 4.8vw, 56px); line-height: 1.06; letter-spacing: -.02em; margin: 12px 0 0; text-wrap: balance; }
.h1-sm { font-family: var(--serif); font-weight: 600; font-size: 38px; line-height: 1.12; margin: 12px 0 0; text-wrap: balance; }
.actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.hero .muted { margin-top: 24px; font-size: 14px; }
.solution { margin-top: 16px; font-size: 15px; }
.solution summary { cursor: pointer; font-weight: 600; color: var(--link); }
.solution p { margin-top: 8px; color: var(--ink-soft); }
.board-card { padding: 0; }

/* ---------- Bàn cờ: gỗ óc chó và kem, viền mực ---------- */
.board {
  position: relative; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr);
  width: 100%; aspect-ratio: 1 / 1; max-width: 560px; margin-inline: auto;
  border: 1px solid var(--ink); border-radius: 2px; overflow: hidden;
  user-select: none; -webkit-user-select: none;
  --lt: var(--board-light); --dk: var(--board-dark);
}
.board.board-live { cursor: pointer; }
.sq {
  position: relative; display: flex; align-items: center; justify-content: center;
  font-size: clamp(22px, 5.2vw, 52px); line-height: 1;
}
@supports (font-size: 1cqw) {
  .board { container-type: inline-size; }
  .sq { font-size: 10cqw; }
}
.sq.l { background: var(--lt); }
.sq.d { background: var(--dk); }
.sq.last.l, .sq.last.d { background-image: linear-gradient(rgba(143, 111, 38, .42), rgba(143, 111, 38, .42)); }
.sq.sel { background-image: linear-gradient(rgba(164, 38, 43, .42), rgba(164, 38, 43, .42)); }
.sq.chk { background: radial-gradient(ellipse at center, rgba(255, 0, 0, 1) 0%, rgba(231, 0, 0, 1) 25%, rgba(169, 0, 0, 0) 89%, rgba(158, 0, 0, 0) 100%); }
.sq.dot::after {
  content: ""; position: absolute; width: 28%; height: 28%; border-radius: 50%;
  background: rgba(27, 28, 30, .32); pointer-events: none;
}
.sq.cap { box-shadow: inset 0 0 0 .3em rgba(164, 38, 43, .5); }
.sq.src .p { opacity: .25; }
.p { position: relative; z-index: 1; }
.p.w { color: #fffdf7; text-shadow: -1px 0 #2a2a2a, 1px 0 #2a2a2a, 0 -1px #2a2a2a, 0 1px #2a2a2a; }
.p.b { color: #1c1c1c; text-shadow: 0 0 1px rgba(255, 255, 255, .35); }
.cr, .cf { position: absolute; font-size: clamp(9px, 1.5vw, 12px); font-weight: 700; line-height: 1; pointer-events: none; }
.cr { top: 3px; left: 4px; }
.cf { bottom: 2px; right: 4px; }
.sq.l .cr, .sq.l .cf { color: var(--dk); }
.sq.d .cr, .sq.d .cf { color: var(--lt); }
.board-ghost { position: fixed; z-index: 100; pointer-events: none; transform: translate(-50%, -50%); line-height: 1; }
.board-ghost .p.w { color: #fffdf7; text-shadow: -1px 0 #2a2a2a, 1px 0 #2a2a2a, 0 -1px #2a2a2a, 0 1px #2a2a2a; }
.board-ghost .p.b { color: #1c1c1c; }
.board-panel { display: grid; gap: 10px; margin: 14px auto 0; max-width: 560px; }
.board-status { font-weight: 600; font-size: 15px; margin: 0; }
.board-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.board-tools button { min-height: 36px; padding: 0 12px; border: 1px solid var(--ink); border-radius: var(--r); background: var(--sheet); color: var(--ink); cursor: pointer; }
.board-tools button:disabled { opacity: .5; cursor: default; }
.board-moves { font-size: 14px; line-height: 1.8; max-height: 140px; overflow-y: auto; color: var(--ink-soft); min-width: 0; }
.board-moves .mv-n { color: var(--ink-mute); }
.board-moves .mv-w, .board-moves .mv-b { color: var(--ink); font-weight: 600; }
.promo { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.promo[hidden] { display: none; }
.promo-label { font-size: 14px; font-weight: 600; margin-right: 4px; }
.promo-btn {
  width: 52px; height: 52px; border-radius: var(--r); border: 1px solid var(--ink);
  background: var(--sheet); cursor: pointer; display: grid; place-items: center;
}
.promo-btn .p { font-size: 34px; line-height: 1; }
.promo-btn:hover, .promo-btn:focus-visible { outline: 2px solid var(--lacquer); }
.board-wrap { max-width: 560px; margin: 24px auto; }
.board-mini { width: 100%; border-radius: 2px; overflow: hidden; }
.board-mini .sq { font-size: clamp(9px, 2.2vw, 16px); }
.thumb-board { padding: 0; background: transparent; }
.thumb-board .board-mini { border: 1px solid var(--ink); }

/* ---------- Tin nóng: danh sách đánh số theo thứ hạng ---------- */
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; margin-top: 24px; }
.feature { display: block; overflow: hidden; padding: 0; }
.feature .thumb { flex: none; width: 100%; height: 260px; border-radius: 0; }
.feature .tag, .feature h3, .feature .muted-p, .feature .muted { margin-left: 24px; margin-right: 24px; }
.feature .tag { margin-top: 20px; }
.feature h3 { font-size: 26px; margin-top: 10px; }
.feature .muted { margin-bottom: 20px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.mini { display: flex; gap: 14px; padding: 14px; align-items: flex-start; }
.mini .thumb { flex: 0 0 96px; height: 96px; }
.mini h3 { font-size: 17px; margin-top: 6px; }

.hot-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border-top: 2px solid var(--ink); }
.hot-list li { border-bottom: 1px solid var(--line); }
.hot-list a { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; }
.hot-list a:hover { text-decoration: none; }
.hot-list a:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.hot-list strong { display: block; font-family: var(--serif); font-weight: 600; font-size: 18px; line-height: 1.3; }
.hot-list .muted { display: block; font-size: 13px; margin-top: 4px; }
.hot-num { font-family: var(--serif); font-size: 28px; font-weight: 700; color: var(--lacquer); min-width: 30px; line-height: 1; }

/* ---------- Video ---------- */
.video { display: block; }
.video-thumb {
  position: relative; aspect-ratio: 16 / 9; background: var(--ink); border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
}
.play {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--paper); display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--ink);
}
.duration {
  position: absolute; right: 10px; bottom: 10px;
  background: rgba(0, 0, 0, .75); color: #fbf7ee; font-size: 12px; padding: 2px 7px; border-radius: 2px;
}
.video h3 { font-family: var(--sans); font-weight: 600; font-size: 17px; line-height: 1.35; margin-top: 12px; }

/* ---------- Sản phẩm liên kết ---------- */
.product { display: flex; gap: 14px; align-items: center; }
.product .thumb { flex: 0 0 96px; height: 96px; }
.product h3 { font-family: var(--sans); font-weight: 600; font-size: 16px; margin-top: 6px; }

/* ---------- Trang danh sách (tin, học): cột chính và cột phụ ---------- */
.sec-top { padding-top: 48px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.sec-top h1 { font-size: clamp(36px, 4vw, 48px); }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; padding-top: 32px; align-items: start; }
.side { display: flex; flex-direction: column; gap: 32px; }
.list { display: flex; flex-direction: column; margin-top: 8px; }
.item { display: flex; gap: 24px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.item h3 { font-size: 22px; line-height: 1.3; margin-top: 6px; }
.item:first-child { padding-top: 12px; }
.schedule { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; font-size: 15px; }
.schedule li { display: flex; flex-direction: column; padding: 12px 0; border-bottom: 1px solid var(--line); }
.schedule li:last-child { border-bottom: 0; }
.schedule .muted { margin-top: 2px; }
.card h3 + .muted { margin-top: 4px; }

/* ---------- Quảng cáo: chiều cao cố định để trang không nhảy ---------- */
.ad {
  border: 1px dashed var(--rule); border-radius: var(--r); color: var(--ink-mute); font-size: 13px;
  display: flex; align-items: center; justify-content: center; margin: 0 auto; max-width: 100%;
}
.ad-728 { width: 728px; height: 90px; }
.ad-300 { width: 300px; height: 250px; }
.sec .ad { margin-top: 0; }
.detail-ad { margin: 32px 0; display: flex; justify-content: center; }
/* Ô quảng cáo AdSense: đơn vị tự co theo khung; khung chỉ giữ chỗ tối thiểu, không cố định chiều cao */
.ad.ad-live { border: 0; display: block; width: 100%; height: auto; min-height: 90px; }
.ad.ad-live.ad-300 { max-width: 300px; min-height: 250px; }
.ad.ad-live.ad-728 { max-width: 728px; }

/* ---------- Bài học và tin tức: đọc liền mạch ---------- */
.article-layout { display: grid; grid-template-columns: 560px minmax(0, 1fr); gap: 56px; align-items: start; margin-top: 24px; }
.article-layout.one-col { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
.sticky { position: sticky; top: 24px; }
.crumbs { font-size: 14px; color: var(--ink-mute); padding-top: 28px; }
.crumbs a { color: var(--link); }
.prose p { font-family: var(--serif); font-size: 19px; line-height: 1.72; color: var(--ink); margin-top: 18px; max-width: 66ch; }
.prose p:first-child { margin-top: 0; }
.callout { background: var(--sheet); border-left: 3px solid var(--brass); padding: 20px 24px; margin: 28px 0; }
.callout p { font-size: 16px; line-height: 1.6; margin-top: 8px; color: var(--ink-soft); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 40px; padding-top: 24px; border-top: 2px solid var(--ink); flex-wrap: wrap; }
.narrow article { padding-top: 32px; }
.narrow .tag { margin-top: 8px; }
.center { padding-top: 80px; padding-bottom: 80px; }
.center .lead-sm { margin: 12px 0 24px; }
.related { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.related h2 { font-size: 26px; margin-bottom: 16px; }
.related .card { display: block; }
.related .card h3 { font-size: 18px; margin-top: 6px; }

.lesson-3col { display: grid; grid-template-columns: 220px minmax(0, 1fr) 300px; gap: 48px; align-items: start; margin-top: 24px; }
.lesson-3col.one-col { grid-template-columns: 220px minmax(0, 1fr); }
.lesson-toc { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.toc-list { display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--line); }
.toc-list a { padding: 8px 0 8px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--ink-mute); }
.toc-list a:hover { color: var(--ink); text-decoration: none; }
.toc-list a.toc-current { color: var(--ink); font-weight: 600; border-left-color: var(--lacquer); }
.lesson-main { min-width: 0; }
.lesson-side { position: sticky; top: 24px; }
.news-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; align-items: start; margin-top: 24px; }
.news-main { min-width: 0; max-width: 760px; display: flex; flex-direction: column; gap: 0; }
.news-side { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 24px; }
.side-link { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 15px; }
.side-link:last-child { border-bottom: 0; }

.news-cover { margin: 0; }
.news-cover img { width: 100%; height: auto; display: block; }
.news-img { aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: var(--line); max-width: 100%; }
.news-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-img-fallback { display: flex; align-items: center; justify-content: center; padding: 16px; text-align: center; color: var(--ink-soft); background: var(--line); }
.news-img-fallback span { font-family: var(--serif); font-size: 19px; line-height: 1.25; }

/* ---------- Trang chủ: bản tin, 12 cột ---------- */
.mag-mast { border-bottom: 1px solid var(--rule); }
.mag-mast-row { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px 24px; padding-block: 12px; }
.mag-date { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.mag-tag { margin: 0; font-family: var(--serif); font-style: italic; font-size: 16px; color: var(--ink-mute); }
.mag-legend { display: flex; flex-wrap: wrap; gap: 6px 24px; padding-block: 12px; font-size: 14px; font-weight: 500; color: var(--ink-soft); }
.mag-legend span { display: inline-flex; align-items: center; gap: 8px; }
.lg { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.lg-learn { background: var(--lacquer); }
.lg-news { background: var(--slate); }
.lg-puzzle { background: var(--brass); }
.lg-pro { background: var(--ink); }

.mag { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 40px; padding-block: 32px 40px; align-items: start; }
.mag > section { min-width: 0; }
.mag-full { grid-column: 1 / -1; }
.mag-main { grid-column: 1 / span 8; }
.mag-side { grid-column: 9 / span 4; }
.mag-half { grid-column: span 6; }
/* Mỗi mục cách nhau bằng đường kẻ đôi, như ranh giới giữa các mục trên báo */
.mag-item { margin-top: 40px; padding-top: 20px; border-top: 3px double var(--ink); }
.mag-item .sec-head { margin-bottom: 18px; }
.mag-item .sec-head h2 { font-size: clamp(26px, 2.6vw, 34px); }
.mag-item .sec-head .lead-sm { margin-top: 4px; }
.mag-full.mag-item { border-top-style: solid; border-top-width: 1px; }
.mag-side.mag-item { margin-top: 40px; }

/* Bài nổi bật và puzzle hôm nay: một bài lớn, bàn cờ bên cạnh */
.mag-cover { grid-column: 1 / -1; padding-top: 4px; }
.mag-cover .hero.hero-v2 { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.hero-news { display: flex; flex-direction: column; justify-content: space-between; gap: 14px; min-width: 0; padding-bottom: 8px; }
.hero-news:hover { text-decoration: none; }
.hero-news:hover h1 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.hero-news h1 { font-size: clamp(34px, 4.2vw, 52px); }
.hero-news .lead { font-size: 18px; }
.hero-news .eyebrow { color: var(--lacquer); }
.hero-today { display: flex; flex-direction: column; gap: 14px; padding: 24px; background: var(--sheet); border: 1px solid var(--ink); border-radius: var(--r); min-width: 0; }
.hero-today h2 { font-size: 26px; }
.hero-today .eyebrow { color: var(--brass); }
.hero-today .muted { color: var(--ink-mute); }
.hero-today .board-card { padding: 0; }
.hero-today .solution p { color: var(--ink-soft); }

/* Tin mới: một bài lớn đứng đầu, các bài còn lại xếp lưới hai cột */
.mag-news_featured .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.mag-news_featured .grid.cols-3 > a:first-child { grid-column: 1 / -1; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.mag-news_featured .grid.cols-3 > a:first-child h3 { font-size: 30px; line-height: 1.2; }
.mag-news_featured .news-card { background: transparent; border: 0; border-radius: 0; padding: 20px 0; border-bottom: 1px solid var(--line); box-shadow: none; display: flex; flex-direction: column; gap: 8px; }
.mag-news_featured .news-card h3 { font-size: 21px; line-height: 1.28; }
.mag-news_featured .news-card:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.news-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.news-card .thumb { width: 100%; height: 180px; border-radius: var(--r); margin: 0 0 6px; }
.news-card .eyebrow-sm { font-size: 13px; font-weight: 600; color: var(--lacquer); }
.news-card h3 { font-size: 20px; line-height: 1.3; }
.news-card .muted-p { color: var(--ink-soft); font-size: 15px; }

/* Ván của tuần: khối tối toàn chiều ngang, như một trang chuyên đề */
.mag-dark, .sec-dark { background: var(--footer); color: var(--footer-ink); border-radius: 0; padding: 40px; margin-top: 40px; }
.mag-dark.mag-item { border-top: 0; }
.mag-dark .card { background: transparent; border: 0; padding: 0; }
.mag-dark .board { border-color: var(--footer-ink); }
.mag-dark .board-status, .mag-dark .board-moves, .mag-dark .board-panel { color: var(--footer-ink); }
.mag-dark p, .mag-dark .muted, .mag-dark .muted-p, .mag-dark li { color: var(--footer-mute); }
.mag-dark h2, .mag-dark h3, .mag-dark strong { color: var(--footer-ink); }
.mag-dark .eyebrow { color: #e7a79e; }
.mag-dark .btn-ghost { color: var(--footer-ink); border-color: var(--footer-ink); }
.sec-dark .eyebrow { color: var(--brass); }
.sec-dark .lead, .sec-dark .muted { color: var(--footer-mute); }
.sec-dark .btn-ghost { color: var(--footer-ink); border-color: var(--footer-ink); }

/* Bảng xếp hạng kỳ thủ và danh sách trực tiếp */
.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border-top: 2px solid var(--ink); }
.rank-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 2px 12px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rank-row:last-child { border-bottom: 0; }
.rank-no { font-family: var(--serif); font-weight: 700; font-size: 18px; color: var(--lacquer); }
.rank-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.rank-rating { font-variant-numeric: tabular-nums; font-weight: 600; }
.rank-note { grid-column: 2 / -1; font-size: 13px; color: var(--ink-mute); }
.mag-side .rank-rating { color: var(--slate); }
.live-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.live-row { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.live-row a { color: var(--ink); }
.live-row a:hover strong { text-decoration: underline; }
.mag-side .schedule li { border-color: var(--line); }

/* Lộ trình học: bốn cấp độ, đánh số theo thứ tự học */
.level-card { display: block; color: inherit; text-decoration: none; padding: 20px 0; border-top: 1px solid var(--line); }
.level-card:hover { text-decoration: none; }
.level-card:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.level-topic { padding: 14px 0; border-top: 1px solid var(--line); }
.level-topic:first-child { border-top: 0; }
.topic-card { display: flex; flex-direction: column; gap: 8px; }
.topic-card h3 { margin: 6px 0 0; font-size: 20px; }
.topic-card .elo-list { margin: 8px 0 0; padding-left: 18px; font-size: 14px; }

/* Lộ trình học: biểu tượng nét mảnh; danh sách bài là một đường nối các nút theo thứ tự học */
.icon { width: 20px; height: 20px; flex: none; display: block; }
.inline-ico { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; margin-right: 6px; }
.level-ico { width: 36px; height: 36px; color: var(--brass); margin-bottom: 12px; }
.cat-head { display: flex; align-items: baseline; gap: 10px; }
.cat-head > span { min-width: 0; }
.cat-head .muted { font-family: var(--sans); font-size: 14px; font-weight: 400; white-space: nowrap; }
.cat-ico { color: var(--brass); width: 22px; height: 22px; align-self: center; }
.topic-head { display: flex; align-items: center; gap: 8px; }
.topic-ico { color: var(--slate); width: 18px; height: 18px; }
.level-dist { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.level-dist li { display: flex; justify-content: space-between; align-items: center; gap: 6px 12px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; font-size: 15px; min-width: 0; }
.dist-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.dist-ico { color: var(--brass); width: 18px; height: 18px; }
.level-dist strong { font-weight: 600; font-size: 14px; color: var(--ink-soft); }

.lesson-path { list-style: none; margin: 8px 0 0; padding: 0; max-width: 760px; }
.lesson-path .step { position: relative; padding: 0 0 18px 60px; }
.lesson-path .step:last-child { padding-bottom: 0; }
.lesson-path .step:not(:last-child)::before { content: ""; position: absolute; left: 17px; top: 42px; bottom: 0; width: 2px; background: var(--line); }
.step-node { position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); display: grid; place-items: center; font-family: var(--serif); font-size: 15px; font-weight: 700; color: var(--ink); }
.step-node .step-ico { width: 18px; height: 18px; color: var(--slate); }
.step-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 18px 14px 18px; background: var(--sheet); border: 1px solid var(--line); border-left: 4px solid var(--brass); border-radius: var(--r); color: var(--ink); text-decoration: none; min-width: 0; transition: border-color .15s, background-color .15s; }
.step-card:hover, .step-card:focus-visible { border-color: var(--ink-mute); border-left-color: var(--lacquer); background: var(--paper); text-decoration: none; }
.step-card:hover .step-title { text-decoration: underline; text-underline-offset: 3px; }
.step-title { font-size: 17px; font-weight: 600; line-height: 1.35; color: var(--ink); overflow-wrap: anywhere; }
.step-meta { display: inline-flex; align-items: center; align-self: flex-start; font-size: 13px; font-weight: 600; color: var(--ink-soft); background: var(--paper); border-radius: 999px; padding: 2px 10px 2px 8px; margin: 2px 0; }
.step-sum { font-size: 14px; line-height: 1.55; color: var(--ink-mute); }
@media (max-width: 600px) {
  .level-dist { grid-template-columns: 1fr 1fr; }
  .level-dist li { flex-direction: column; align-items: flex-start; }
  .lesson-path .step { padding-left: 46px; padding-bottom: 14px; }
  .lesson-path .step:not(:last-child)::before { left: 13px; top: 32px; }
  .step-node { width: 28px; height: 28px; font-size: 13px; }
  .step-node .step-ico { width: 15px; height: 15px; }
  .step-card { padding: 12px 14px; }
  .step-title { font-size: 16px; }
  .level-ico { width: 32px; height: 32px; }
}

/* Tin tức: lưới, danh sách ngang và trang chỉ mục */
.news-hub { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.news-lead, .news-index-lead { display: flex; flex-direction: column; gap: 12px; color: inherit; text-decoration: none; min-width: 0; }
.news-lead h3 { font-size: 30px; line-height: 1.18; }
.news-rail { display: flex; flex-direction: column; gap: 0; min-width: 0; border-top: 2px solid var(--ink); }
.news-rail-item { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; align-items: start; color: inherit; text-decoration: none; min-width: 0; padding: 16px 0; border-bottom: 1px solid var(--line); }
.news-rail-item .news-img { aspect-ratio: 4 / 3; }
.news-rail-item h4 { font-family: var(--serif); font-weight: 600; font-size: 17px; line-height: 1.3; margin-top: 4px; }
.news-index { display: flex; flex-direction: column; gap: 32px; }
.news-index-lead { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.news-index-lead h3 { font-size: 32px; line-height: 1.18; }
.news-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.news-tile { display: flex; flex-direction: column; gap: 8px; color: inherit; text-decoration: none; min-width: 0; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.news-tile h3 { font-size: 21px; line-height: 1.28; }
.news-lead:hover h3, .news-tile:hover h3, .news-rail-item:hover h4, .news-index-lead:hover h3 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.news-view { display: inline-flex; gap: 0; border: 1px solid var(--ink); border-radius: var(--r); margin-bottom: 24px; max-width: 100%; overflow: hidden; }
.news-view-opt { padding: 7px 16px; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; }
.news-view-opt.on { background: var(--ink); color: var(--paper); }
.news-rows { display: flex; flex-direction: column; gap: 0; border-top: 2px solid var(--ink); }
.news-row { display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 24px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; min-width: 0; }
.news-row:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.news-row .news-img { aspect-ratio: 16 / 10; }
.news-row-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.news-row h3 { font-size: 24px; line-height: 1.25; text-wrap: balance; }

/* Trang giải đấu */
.tourney-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.tourney-head .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 0; }
.tourney-tabs { display: flex; gap: 4px; margin-top: 28px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.tourney-tabs a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px; font-weight: 600; color: var(--ink-mute); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tourney-tabs a:hover { color: var(--ink); text-decoration: none; }
.tourney-tabs a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--lacquer); }
.tourney-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 40px; align-items: start; padding-top: 28px; padding-bottom: 24px; }
.tourney-table { padding: 0; overflow: hidden; }
.tourney-table .sec-sub { margin: 0; padding: 16px 0; border-bottom: 2px solid var(--ink); }
.tourney-table .table-box { border: 0; border-radius: 0; background: transparent; }
.tourney-side { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 24px; }
.tourney-side .sec-sub, .tourney-table .sec-sub { font-size: 20px; margin-top: 0; margin-bottom: 12px; }
.tourney-side .card { padding: 22px; }
.top-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.top-list li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.top-list li:last-child { border-bottom: 0; }
.event-list { display: flex; flex-direction: column; gap: 0; border-top: 2px solid var(--ink); }
.event-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 0; border-bottom: 1px solid var(--line); }
.event-card h3 { margin: 6px 0 4px; font-size: 19px; }
.event-card .muted-p { margin: 0; }
.schedule-note { margin-top: 12px; }

/* Hồ sơ kỳ thủ, bảng dữ liệu và biểu đồ Elo */
.stat { font-family: var(--serif); font-size: 32px; font-weight: 700; margin-top: 6px; line-height: 1.1; }
.profile-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 48px; align-items: start; padding-top: 40px; }
.profile-card { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 24px; }
.profile-card .profile-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.profile-main { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.profile-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.profile-stats .card { padding: 14px; }
.profile-stats .stat { font-size: 24px; line-height: 1.2; }
.profile-extras h3 { font-size: 21px; margin: 0 0 8px; }
.profile-extras .elo-list { margin: 0; padding-left: 18px; }
.profile-bio { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 24px; align-items: start; margin-bottom: 24px; }
.profile-bio img { width: 160px; height: 160px; object-fit: cover; border-radius: var(--r); max-width: 100%; }
.profile-bio p { margin: 0; line-height: 1.6; }
.awards { display: flex; flex-wrap: wrap; gap: 8px; }
.table-box { overflow-x: auto; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r); }
.data-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.data-table th, .data-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.data-table th { font-size: 13px; font-weight: 600; color: var(--ink-mute); background: var(--paper); }
.data-table tr:last-child td { border-bottom: 0; }
.elo-chart { width: 100%; height: auto; display: block; }
.elo-figure { margin: 0; }
.elo-list { margin: 10px 0 0; padding-left: 20px; font-size: 15px; }
.tab-bar { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; margin: 8px 0 20px; }
.tab-link { padding: 12px 16px; color: var(--ink-mute); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; text-decoration: none; }
.tab-link:hover { color: var(--ink); text-decoration: none; }
.tab-link.is-active { color: var(--ink); border-bottom-color: var(--lacquer); }
.tab-link.is-disabled { opacity: .55; cursor: not-allowed; }
.delta-up { color: #2f6b3a; font-weight: 600; }
.delta-down { color: var(--lacquer); font-weight: 600; }
.mono { font-variant-numeric: tabular-nums; }
.stat-row { margin-top: 0; }
.stat-row .card { padding: 18px 20px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 24px 0 16px; }
.hub-note { margin-top: 24px; }
.hub-note .sec-sub, .search-card .sec-sub, .topic-card .sec-sub { margin-top: 0; }
.search-card .toolbar { margin-top: 12px; }
.iconbox { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--r); background: var(--sheet); border: 1px solid var(--ink); color: var(--ink); font-size: 22px; }
.c24-hidden { display: none !important; }

/* ---------- Tìm kiếm ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.search-form { display: flex; gap: 10px; margin: 24px 0 8px; }
.search-form input, .search-input {
  flex: 1 1 260px; min-width: 0; min-height: 46px; padding: 0 14px; border-radius: var(--r);
  border: 1px solid var(--ink); background: var(--sheet); color: var(--ink); font: inherit; font-size: 16px;
}
.search-form.big input { font-size: 18px; }

/* ---------- Đăng ký bản tin ---------- */
.newsletter { background: var(--sheet); border-top: 3px double var(--ink); border-bottom: 1px solid var(--rule); margin-top: 64px; padding: 40px 0; }
.newsletter-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.newsletter h2 { font-size: 28px; }
.newsletter p { margin-top: 6px; color: var(--ink-mute); }
.newsletter-form { display: flex; gap: 10px; flex-wrap: wrap; }
.newsletter-form input { flex: 1 1 240px; min-height: 48px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--ink); background: var(--paper); color: var(--ink); font: inherit; min-width: 0; }
.newsletter-form .btn { min-height: 48px; }

/* ---------- Chân trang ---------- */
.site-footer { background: var(--footer); color: var(--footer-ink); margin-top: 72px; padding: 48px 0 40px; }
.site-footer a { color: var(--footer-ink); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "brand signup" "links links"; gap: 28px 48px; align-items: start; }
.footer-grid > div:first-child { grid-area: brand; }
.footer-grid > .footer-links { grid-area: links; }
.footer-grid > p { grid-area: signup; justify-self: end; max-width: 380px; text-align: right; }
.footer-grid p { margin-top: 10px; }
.footer-links { display: flex; flex-direction: row; flex-wrap: wrap; gap: 10px 32px; font-size: 15px; padding-top: 24px; border-top: 1px solid color-mix(in srgb, var(--footer-ink) 14%, transparent); }
.copy { font-size: 13px; color: var(--footer-mute); margin-top: 32px; }

/* Thanh điều hướng dưới cùng: chỉ trên điện thoại */
.bottom-nav { display: none; }

/* ---------- Điện thoại ---------- */
@media (max-width: 1100px) {
  .lesson-3col { grid-template-columns: 200px minmax(0, 1fr); }
  .lesson-side { grid-column: 1 / -1; position: static; }
  .head-row { gap: 26px; }
  .main-nav { gap: 18px; }
  .site-search input { width: 180px; }
}
@media (max-width: 900px) {
  .wrap { padding: 0 20px; }
  .head-row { height: auto; padding-block: 14px; flex-wrap: wrap; gap: 12px 20px; }
  .site-search { margin-left: 0; width: 100%; }
  .site-search input { width: 100%; }
  .main-nav { order: 3; width: 100%; }
  .footer-grid { grid-template-columns: 1fr; grid-template-areas: "brand" "signup" "links"; }
  .footer-grid > p { justify-self: start; text-align: left; }
  .hero, .article-layout, .two-col, .split, .news-layout, .news-hub, .tourney-layout, .profile-layout, .newsletter-grid, .news-index-lead, .news-tiles { grid-template-columns: 1fr; }
  .lesson-3col, .lesson-3col.one-col { grid-template-columns: 1fr; }
  .sticky, .lesson-toc, .lesson-side, .news-side, .tourney-side, .profile-card { position: static; }
  .cols-3, .cols-4, .cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-2 { grid-template-columns: 1fr; }
  h1 { font-size: 38px; }
  .h1-sm, .sec-top h1 { font-size: 30px; }
  .item { flex-direction: column; gap: 14px; }
  .thumb { flex: none; width: 100%; height: 180px; }
  .mini { flex-direction: row; }
  .ad-728 { width: 100%; height: 90px; }
  .board-card { max-width: 420px; margin: 0 auto; }
  .game-grid { grid-template-columns: 1fr; gap: 24px; }
  .game-grid .board-card { max-width: 480px; width: 100%; justify-self: center; }
  .stat-row, .grid.cols-3 { grid-template-columns: 1fr; }
  .news-row { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .news-row h3 { font-size: 21px; }
  .news-lead h3, .news-index-lead h3 { font-size: 26px; }
  .news-rail-item { grid-template-columns: 96px minmax(0, 1fr); }
  .mag { grid-template-columns: 1fr; gap: 0; padding-block: 16px 40px; }
  .mag-main, .mag-side, .mag-half, .mag-full, .mag-cover { grid-column: 1 / -1; }
  .mag-cover .hero.hero-v2 { grid-template-columns: 1fr; gap: 28px; }
  .mag-news_featured .grid.cols-3 { grid-template-columns: 1fr; }
  .mag-news_featured .grid.cols-3 > a:first-child h3 { font-size: 26px; }
  .mag-mast-row { flex-direction: column; }
  .mag-dark { padding: 24px; }
  body { padding-bottom: 72px; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--paper); border-top: 2px solid var(--ink);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
  }
  .bottom-nav a {
    display: flex; align-items: center; justify-content: center;
    min-height: 48px; font-size: 13px; font-weight: 600; color: var(--ink-soft); text-align: center;
  }
  .bottom-nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 3px 0 var(--lacquer); }
}
@media (max-width: 560px) {
  .cols-2, .cols-3, .cols-4, .cols-5 { grid-template-columns: 1fr; }
  .ad-300 { width: 100%; height: 250px; }
  .feature .thumb { height: 200px; }
  .profile-bio { grid-template-columns: 1fr; }
  .profile-bio img { width: 120px; height: 120px; }
  .newsletter-form .btn { width: 100%; }
  .hero-today { padding: 18px; }
  .sec-top { padding-top: 32px; }
}
@media (max-width: 480px) {
  .news-rail-item { grid-template-columns: 88px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Chống tràn ngang: ảnh và chữ dài không đẩy trang rộng hơn màn hình */
img { max-width: 100%; }
h1, h2, h3, h4, p, li, a, td, th, dt, dd, figcaption { overflow-wrap: anywhere; }

/* Lịch giải nổi bật: danh sách theo tháng và trang chi tiết giải */
.cal { padding: 24px 0 48px; }
.cal-head { border-bottom: 2px solid var(--ink); padding-bottom: 18px; }
.cal-eyebrow { font-size: 13px; font-weight: 600; color: var(--lacquer); margin: 0; }
.cal h1 { font-family: var(--serif); font-size: clamp(30px, 5vw, 46px); line-height: 1.1; font-weight: 600; margin: 6px 0 8px; }
.cal-lede { margin: 0; max-width: 62ch; color: #3d4046; }
.cal-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.cal-filters a { border: 1px solid var(--ink); border-radius: 4px; padding: 6px 12px; font-size: 14px; background: var(--sheet); color: var(--ink); }
.cal-filters a.on { background: var(--ink); color: var(--paper); }
.cal-block { margin-top: 28px; }
.cal-month { font-family: var(--serif); font-size: 24px; font-weight: 600; margin: 0 0 4px; border-top: 3px double var(--ink); padding-top: 14px; }
.cal-list { list-style: none; margin: 0; padding: 0; }
.cal-ev { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 16px; padding: 14px 0; border-bottom: 1px solid #d3d0c6; align-items: start; }
.cal-main { min-width: 0; }
.cal-date { font-weight: 600; color: var(--lacquer); font-size: 15px; }
.cal-ev h3 { font-family: var(--serif); font-size: 19px; line-height: 1.3; font-weight: 600; margin: 0 0 4px; }
.cal-meta { margin: 0; font-size: 14px; color: #3d4046; }
.cal-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.cal-tag { font-size: 12px; font-weight: 600; border: 1px solid var(--ink); border-radius: 4px; padding: 1px 7px; }
.cal-reg { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.cal-chip { font-size: 12px; font-weight: 600; border: 1px solid var(--ink); border-radius: 4px; padding: 2px 8px; white-space: nowrap; }
.cal-chip-open { background: #e4ece0; border-color: #2f6b3a; color: #1d4a25; }
.cal-chip-dim { background: #f1e6cf; border-color: var(--brass); }
.cal-btn { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 4px; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 14px; }
.cal-btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.cal-empty { padding: 20px 0; }
.cal-crumbs { font-size: 14px; margin-bottom: 12px; }
.cal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.cal-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 24px; margin: 20px 0 0; }
.cal-facts div { padding: 12px 0; border-bottom: 1px solid #d3d0c6; }
.cal-facts dt { font-size: 13px; font-weight: 600; color: #64676d; }
.cal-facts dd { margin: 2px 0 0; font-size: 15px; }
.cal-note { font-size: 13px; color: #64676d; margin-top: 20px; }
@media (max-width: 640px) {
  .cal-ev { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .cal-reg { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
}

/* Điều lệ giải trên trang chi tiết */
.cal-rules { margin-top: 28px; border-top: 2px solid var(--ink); padding-top: 14px; max-width: 70ch; }
.cal-sections { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 48px; align-items: start; }
.cal-sections .cal-rules { max-width: none; }
@media (min-width: 860px) { .cal-sections { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* Bảng năm: 12 tháng, giải trong nước và quốc tế */
.ysch-wrap { margin-top: 22px; overflow-x: auto; border-top: 2px solid var(--ink); }
.ysch { width: 100%; min-width: 1080px; border-collapse: collapse; table-layout: fixed; }
.ysch thead th { font-family: var(--serif); font-size: 17px; font-weight: 600; text-align: center; padding: 10px 4px; border-bottom: 2px solid var(--ink); }
.ysch td { vertical-align: top; min-width: 0; padding: 6px; border: 1px solid var(--line); }
.ysch-ev { border-bottom: 1px solid var(--line); }
.ysch-ev:last-child { border-bottom: 0; }
.ysch-ev a { display: block; padding: 8px 0; color: var(--ink); text-decoration: none; }
.ysch-ev a:hover .ysch-name { text-decoration: underline; }
.ysch-date { display: block; font-size: 13px; font-weight: 600; }
.ysch-name { display: block; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.ysch-place { display: block; margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--lacquer); }
.ysch-band th { font-family: var(--serif); font-size: 18px; font-weight: 600; text-align: center; padding: 14px 0; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); background: var(--sheet); }

/* Lịch theo tháng và theo năm */
.cal-views { display: flex; flex-wrap: wrap; gap: 0; margin-top: 18px; border: 1px solid var(--ink); border-radius: 4px; width: fit-content; max-width: 100%; overflow: hidden; }
.cal-views a { padding: 7px 14px; font-size: 14px; color: var(--ink); background: var(--sheet); text-decoration: none; }
.cal-views a + a { border-left: 1px solid var(--ink); }
.cal-views a.on { background: var(--ink); color: var(--paper); }
.cal-mbar { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.cal-mbar h2 { font-family: var(--serif); font-size: 26px; font-weight: 600; margin: 0; }
.cal-mbar-sub { font-family: var(--sans, inherit); font-size: 14px; font-weight: 400; color: var(--ink-soft); margin-left: 6px; }
.cal-mbar a { font-size: 14px; }
.cal-table-wrap { margin-top: 12px; }
.cal-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cal-table th { font-size: 12px; font-weight: 600; color: var(--ink-soft); text-align: left; padding: 0 6px 6px; border-bottom: 2px solid var(--ink); }
.cal-day { vertical-align: top; min-width: 0; height: 96px; padding: 6px; border: 1px solid var(--line); background: var(--sheet); overflow: hidden; }
.cal-day.is-out { background: transparent; border-color: transparent; }
.cal-day.is-today .cal-num { background: var(--ink); color: var(--paper); }
.cal-num { display: inline-block; min-width: 24px; padding: 0 4px; font-family: var(--serif); font-size: 15px; line-height: 22px; text-align: center; border-radius: 2px; }
.cal-day-ev { display: block; min-width: 0; margin-top: 4px; padding: 2px 5px; border-left: 3px solid var(--lacquer); background: var(--paper); color: var(--ink); font-size: 12px; line-height: 1.3; text-decoration: none; }
.cal-day-ev span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-day-ev:hover { text-decoration: underline; }
.cal-day-ev.is-on { background: var(--ink); border-left-color: var(--ink); color: var(--paper); }
.cal-pick { margin-top: 24px; scroll-margin-top: 16px; }
.cal-pick-empty { margin: 0; padding: 14px 0; font-size: 14px; color: var(--ink-soft); border-top: 1px solid var(--line); }
.cal-pick-body { border-top: 2px solid var(--ink); padding-top: 14px; }
.cal-pick-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.cal-pick-top .cal-eyebrow { margin: 0; }
.cal-close { font-size: 14px; white-space: nowrap; }
.cal-pick-body h3 { font-family: var(--serif); font-size: 24px; line-height: 1.25; font-weight: 600; margin: 6px 0 4px; overflow-wrap: anywhere; }
.cal-pick-contents { margin: 4px 0 0; font-size: 14px; color: var(--ink-soft); }
.cal-facts-compact { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.cal-agenda { list-style: none; margin: 0; padding: 0; }
.cal-agenda li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 4px 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cal-agenda .cal-date { grid-row: span 2; }
.cal-agenda a { font-family: var(--serif); font-size: 17px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.cal-agenda .cal-meta { grid-column: 2; }

@media (max-width: 640px) {
  .cal-table th { font-size: 11px; padding: 0 2px 6px; }
  .cal-day { height: 58px; padding: 4px 2px; }
  .cal-num { min-width: 20px; font-size: 13px; line-height: 20px; padding: 0 2px; }
  .cal-day-ev { margin-top: 3px; padding: 0; height: 7px; border-left: 0; background: var(--lacquer); font-size: 0; }
  .cal-day-ev span { display: none; }
  .cal-day-ev.is-on { background: var(--ink); }
  .cal-agenda li { grid-template-columns: minmax(0, 1fr); }
  .cal-agenda .cal-date, .cal-agenda .cal-meta { grid-column: 1; grid-row: auto; }
}
.cal-rules h2 { font-family: var(--serif); font-size: 22px; font-weight: 600; margin: 0 0 8px; }
.cal-rules p { margin: 0 0 12px; overflow-wrap: anywhere; }

/* Khối giải nổi bật trên trang chủ */
.cal-home { margin: 28px 0; border-top: 3px double var(--ink); padding-top: 16px; }
.cal-home-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.cal-home-head h2 { font-family: var(--serif); font-size: 26px; font-weight: 600; margin: 0 0 8px; }
.cal-home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.cal-home-card { border-top: 1px solid #d3d0c6; padding-top: 12px; min-width: 0; }
.cal-home-card h3 { font-family: var(--serif); font-size: 18px; line-height: 1.3; font-weight: 600; margin: 4px 0; }
.cal-home-card p { margin: 0 0 4px; font-size: 14px; }

/* Khai cuộc: bảng tra cứu, biên bản nước đi và bàn cờ */
.op-list { padding-top: 24px; padding-bottom: 48px; }
.op-search label { display: block; font-size: 14px; font-weight: 600; color: var(--ink-soft); margin-bottom: 8px; }
.op-search-row { display: flex; gap: 12px; flex-wrap: wrap; }
.op-search-row input { flex: 1 1 260px; min-width: 0; min-height: 40px; padding: 0 12px; font: inherit; font-size: 16px; color: var(--ink); background: var(--sheet); border: 1px solid var(--ink); border-radius: var(--r); }
.table-wrap { overflow-x: auto; min-width: 0; }
.op-table, .op-moves { width: 100%; border-collapse: collapse; font-size: 15px; color: var(--ink-soft); }
.op-table { min-width: 620px; }
.op-table .tag, .op-table code { white-space: nowrap; }
.op-table th, .op-table td, .op-moves th, .op-moves td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.op-table thead th, .op-moves thead th { font-size: 13px; font-weight: 600; color: var(--ink-mute); border-bottom: 1px solid var(--ink); }
.op-table a { font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--ink); }
.op-table code, .op-moves code { font-family: inherit; font-variant-numeric: tabular-nums; }
.op-idea { color: var(--ink-mute); }
.op-moves th[scope="row"] { width: 56px; color: var(--ink-mute); font-weight: 400; font-variant-numeric: tabular-nums; }
.op-moves td a { display: inline-block; min-width: 72px; padding: 4px 6px; color: var(--ink); font-variant-numeric: tabular-nums; border-radius: var(--r); }
.op-moves td a.on { box-shadow: inset 0 -3px 0 var(--brass); font-weight: 600; }
.op-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 40px; align-items: start; padding-top: 32px; padding-bottom: 48px; }
.op-board { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.op-steps { display: flex; gap: 12px; flex-wrap: wrap; }
.op-steps .is-off { opacity: .45; cursor: default; pointer-events: none; }
.op-main h2 { font-size: 22px; margin-top: 8px; }
.op-note { margin-top: 28px; }
.op-note h2 { font-size: 18px; }
.op-note p { color: var(--ink-soft); line-height: 1.6; margin-top: 6px; max-width: 60ch; }
@media (max-width: 900px) {
  .op-layout { grid-template-columns: minmax(0, 1fr); }
  .op-board { position: static; order: -1; }
}
