/* ==========================================================================
   Khối Vuông — main.css
   Tokens → base → layout → components → pages → utilities
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  /* Light (thạch anh) */
  --bg: #eef1f2;
  --bg-2: #ffffff;
  --bg-3: #e2e6e8;
  --ink: #1b1f22;
  --ink-2: #4a5157;
  --ink-3: #7b8389;
  --line: #d3d9dc;
  --line-2: #bcc4c8;

  --grass: #4e8a31;      /* hành động chính */
  --grass-ink: #ffffff;
  --gold: #c9961a;       /* đã kiểm tra */
  --gold-bg: #fff6dc;
  --redstone: #c0392b;   /* lỗi, offline */
  --redstone-bg: #fde8e5;
  --lapis: #2f5fb3;      /* liên kết */
  --emerald: #2e9e5b;    /* online */
  --emerald-bg: #e3f6ea;

  /* viền vát kiểu nút trong game */
  --bevel-light: rgba(255,255,255,.75);
  --bevel-dark: rgba(0,0,0,.28);

  --radius: 6px;
  --measure: 68ch;
  --gutter: 16px;
  --wrap: 1180px;
}

:root[data-theme="dark"] {
  --bg: #262a2e;
  --bg-2: #2f3438;
  --bg-3: #3a4046;
  --ink: #eceff1;
  --ink-2: #b7bec4;
  --ink-3: #868e95;
  --line: #3f464c;
  --line-2: #4d555c;

  --grass: #6fb34a;
  --grass-ink: #10200a;
  --gold: #e9b949;
  --gold-bg: #3a3320;
  --redstone: #e0584a;
  --redstone-bg: #3d2522;
  --lapis: #7fa6ef;
  --emerald: #4fcf80;
  --emerald-bg: #1f3a2a;

  --bevel-light: rgba(255,255,255,.14);
  --bevel-dark: rgba(0,0,0,.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #262a2e; --bg-2: #2f3438; --bg-3: #3a4046;
    --ink: #eceff1; --ink-2: #b7bec4; --ink-3: #868e95;
    --line: #3f464c; --line-2: #4d555c;
    --grass: #6fb34a; --grass-ink: #10200a;
    --gold: #e9b949; --gold-bg: #3a3320;
    --redstone: #e0584a; --redstone-bg: #3d2522;
    --lapis: #7fa6ef; --emerald: #4fcf80; --emerald-bg: #1f3a2a;
    --bevel-light: rgba(255,255,255,.14); --bevel-dark: rgba(0,0,0,.45);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--lapis); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
img, video { max-width: 100%; height: auto; }
code, kbd, pre { font-family: var(--mono); font-size: .92em; }
code { background: var(--bg-3); padding: .1em .35em; border-radius: 4px; }
pre { background: var(--bg-3); padding: 14px 16px; border-radius: var(--radius); overflow: auto; }
pre code { background: none; padding: 0; }
kbd { border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: .05em .4em; background: var(--bg-2); }
hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip-link { position: absolute; left: 8px; top: -48px; background: var(--grass); color: var(--grass-ink); padding: 8px 12px; z-index: 100; }
.skip-link:focus { top: 8px; }

h1, h2, h3, h4 { line-height: 1.22; letter-spacing: -.012em; margin: 1.6em 0 .5em; font-weight: 800; }
h1 { font-size: clamp(1.7rem, 4.2vw, 2.4rem); margin-top: 0; }
h2 { font-size: clamp(1.3rem, 3vw, 1.6rem); padding-top: .4em; }
h3 { font-size: 1.15rem; font-weight: 700; }
p, ul, ol { margin: 0 0 1.1em; }
li { margin: .25em 0; }
li > ul, li > ol { margin-top: .25em; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.site-main { padding: 24px 0 56px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
@media (min-width: 1024px) {
  .layout.has-aside { grid-template-columns: minmax(0, 720px) 280px; justify-content: center; }
}
.prose { max-width: var(--measure); }
.prose > :first-child { margin-top: 0; }

/* ---------- Header ---------- */
.site-header {
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; }
.brand-mark { width: 28px; height: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.brand-mark span { background: var(--grass); }
.brand-mark span:nth-child(2) { background: var(--gold); }
.brand-mark span:nth-child(3) { background: var(--ink-3); }
.brand-mark span:nth-child(4) { background: var(--lapis); }
.brand small { display: block; font-weight: 500; font-size: .72rem; color: var(--ink-3); letter-spacing: 0; }

.nav { margin-left: auto; display: none; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.nav a { display: block; padding: 8px 10px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .92rem; border-radius: var(--radius); }
.nav a:hover, .nav .current-menu-item > a, .nav .current_page_item > a { color: var(--ink); background: var(--bg-3); }
@media (min-width: 900px) { .nav { display: block; } }

.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
@media (min-width: 900px) { .header-actions { margin-left: 0; } }
.icon-btn {
  appearance: none; border: 1px solid var(--line); background: var(--bg-2); color: var(--ink);
  width: 38px; height: 38px; border-radius: var(--radius); display: grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { background: var(--bg-3); }
.icon-btn svg { width: 20px; height: 20px; }
#theme-toggle .sun { display: none; }
:root[data-theme="dark"] #theme-toggle .sun { display: block; }
:root[data-theme="dark"] #theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) #theme-toggle .moon { display: none; }
}

/* Mobile drawer */
.drawer { display: none; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.drawer.open { display: block; }
.drawer ul { list-style: none; margin: 0; padding: 8px 0; }
.drawer a { display: block; padding: 12px var(--gutter); text-decoration: none; color: var(--ink); font-weight: 600; border-top: 1px solid var(--line); }
.drawer li:first-child a { border-top: 0; }
.drawer form { padding: 8px var(--gutter) 12px; }
@media (min-width: 900px) { .drawer, #menu-toggle { display: none !important; } }

/* Search */
.search-form { display: flex; gap: 6px; }
.search-form input[type="search"] {
  flex: 1; font: inherit; font-size: .95rem; padding: 9px 12px; border: 1px solid var(--line-2);
  border-radius: var(--radius); background: var(--bg-2); color: var(--ink); min-width: 0;
}
.search-form button { font: inherit; }

/* ---------- Buttons (viền vát kiểu nút trong game) ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 700; font-size: .95rem;
  padding: 10px 16px; border-radius: 4px; cursor: pointer; text-decoration: none;
  background: var(--grass); color: var(--grass-ink); border: 0;
  box-shadow: inset 2px 2px 0 var(--bevel-light), inset -2px -2px 0 var(--bevel-dark);
}
.btn:hover { filter: brightness(1.05); }
.btn:active { box-shadow: inset -2px -2px 0 var(--bevel-light), inset 2px 2px 0 var(--bevel-dark); }
.btn.secondary { background: var(--bg-3); color: var(--ink); }

/* ---------- Hộp Đã kiểm tra (điểm nhấn) ---------- */
.verified {
  display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; align-items: start;
  margin: 18px 0 26px; padding: 14px 16px; border-radius: 4px;
  background: var(--gold-bg); color: var(--ink);
  box-shadow: inset 2px 2px 0 var(--bevel-light), inset -2px -2px 0 var(--bevel-dark), 0 0 0 1px var(--gold);
}
.verified-icon { width: 34px; height: 34px; color: var(--gold); }
.verified-title { font-weight: 800; margin: 0 0 4px; }
.verified dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; font-size: .93rem; }
.verified dt { color: var(--ink-2); }
.verified dd { margin: 0; font-weight: 600; }
.verified .platform-chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--bg-2); border: 1px solid var(--line-2); }
.chip.java { border-color: #a0672a; color: #a0672a; }
.chip.bedrock { border-color: var(--ink-3); color: var(--ink-2); }
.verified.stale { background: var(--redstone-bg); box-shadow: inset 2px 2px 0 var(--bevel-light), inset -2px -2px 0 var(--bevel-dark), 0 0 0 1px var(--redstone); }
.verified.stale .verified-icon { color: var(--redstone); }
.verified-note { grid-column: 1 / -1; font-size: .88rem; color: var(--ink-2); margin: 0; }

/* ---------- Bài viết ---------- */
.entry-header { margin-bottom: 8px; }
.entry-meta { color: var(--ink-3); font-size: .9rem; display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; }
.entry-meta a { color: inherit; }
.cat-link { color: var(--grass); font-weight: 700; text-decoration: none; font-size: .9rem; }
.entry-content h2 { border-top: 1px solid var(--line); padding-top: 22px; }
.entry-content h2:first-of-type { border-top: 0; }
.entry-content figure { margin: 20px 0; }
.entry-content figcaption { font-size: .88rem; color: var(--ink-3); margin-top: 6px; }
.entry-content img { border-radius: var(--radius); }
.entry-content table { width: 100%; border-collapse: collapse; font-size: .94rem; margin: 18px 0; display: block; overflow-x: auto; }
.entry-content th, .entry-content td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.entry-content th { background: var(--bg-3); font-weight: 700; }
.entry-content blockquote { margin: 18px 0; padding: 12px 16px; border-left: 4px solid var(--gold); background: var(--bg-2); }
.wp-block-table figure { margin: 0; }

/* Callouts */
.callout { padding: 12px 16px; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); margin: 18px 0; }
.callout.warn { border-color: var(--gold); background: var(--gold-bg); }
.callout.danger { border-color: var(--redstone); background: var(--redstone-bg); }
.callout.ok { border-color: var(--emerald); background: var(--emerald-bg); }

/* TOC */
.toc { position: sticky; top: 76px; font-size: .9rem; }
.toc-title { font-weight: 800; margin: 0 0 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc li a { display: block; padding: 5px 12px; color: var(--ink-2); text-decoration: none; border-left: 2px solid transparent; margin-left: -2px; }
.toc li.lvl-3 a { padding-left: 24px; font-size: .86rem; }
.toc li a:hover { color: var(--ink); }
.toc li a.active { color: var(--ink); border-left-color: var(--grass); font-weight: 700; }
.toc-mobile { display: block; margin: 0 0 22px; }
.toc-mobile summary { cursor: pointer; font-weight: 700; padding: 10px 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); }
.toc-mobile[open] summary { border-radius: var(--radius) var(--radius) 0 0; }
.toc-mobile .toc { position: static; padding: 10px 14px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); background: var(--bg-2); }
@media (min-width: 1024px) { .toc-mobile { display: none; } }
.aside { display: none; }
@media (min-width: 1024px) { .aside { display: block; } }

/* Tác giả */
.author-box { display: grid; grid-template-columns: 56px 1fr; gap: 14px; margin: 36px 0 0; padding: 16px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); }
.author-box img { border-radius: 50%; width: 56px; height: 56px; }
.author-box .name { font-weight: 800; margin: 0 0 4px; }
.author-box p { margin: 0; font-size: .93rem; color: var(--ink-2); }

/* Bài liên quan */
.related { margin-top: 36px; }
.related h2 { font-size: 1.15rem; margin: 0 0 12px; }
.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.post-list li a { display: block; padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.post-list li a:hover { border-color: var(--line-2); }
.post-list .t { font-weight: 700; display: block; }
.post-list .m { font-size: .84rem; color: var(--ink-3); display: flex; gap: 10px; margin-top: 4px; flex-wrap: wrap; }

/* Lưới bài (archive, trang chủ) */
.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card a.thumb { display: block; aspect-ratio: 16/9; background: var(--bg-3); }
.card a.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.card-body h3 { margin: 0; font-size: 1.02rem; line-height: 1.3; }
.card-body h3 a { color: var(--ink); text-decoration: none; }
.card-body h3 a:hover { text-decoration: underline; }
.card-body p { margin: 0; font-size: .9rem; color: var(--ink-2); }
.card-meta { font-size: .82rem; color: var(--ink-3); display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }

/* Hub chuyên mục */
.hub-head { margin-bottom: 22px; }
.hub-head h1 { margin-bottom: 6px; }
.hub-head .desc { color: var(--ink-2); max-width: 70ch; margin: 0; }

/* Trang chủ */
.home-hero { padding: 28px 0 8px; }
.home-hero h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); max-width: 22ch; margin: 0 0 10px; }
.home-hero p { color: var(--ink-2); max-width: 60ch; font-size: 1.05rem; margin: 0 0 18px; }
.home-hero .search-form { max-width: 560px; }
.home-hero .search-form input { font-size: 1.05rem; padding: 12px 14px; }
.version-strip { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .9rem; color: var(--ink-2); margin: 18px 0 0; }
.version-strip strong { color: var(--ink); }
.home-section { margin-top: 36px; }
.home-section > h2 { margin: 0 0 12px; font-size: 1.3rem; display: flex; align-items: baseline; gap: 12px; }
.home-section > h2 a { font-size: .9rem; font-weight: 600; margin-left: auto; }
.hubs { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
@media (min-width: 768px) { .hubs { grid-template-columns: repeat(4, 1fr); } }
.hub { display: block; padding: 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.hub:hover { border-color: var(--grass); }
.hub b { display: block; font-size: 1rem; }
.hub span { display: block; font-size: .84rem; color: var(--ink-3); margin-top: 2px; }

/* Bình luận */
.comments { margin-top: 40px; }
.comments h2 { font-size: 1.2rem; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .comment { padding: 14px 0; border-top: 1px solid var(--line); }
.comment-list .children { list-style: none; margin: 0; padding-left: 22px; }
.comment-author { font-weight: 700; }
.comment-metadata { font-size: .84rem; color: var(--ink-3); }
.comment-content p { margin: 6px 0; }
.comment-form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form textarea {
  width: 100%; font: inherit; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg-2); color: var(--ink);
}
.comment-form p { margin-bottom: 12px; }
.comment-form .submit { font: inherit; }

/* Pagination */
.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 28px; }
.pagination .page-numbers { padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); background: var(--bg-2); }
.pagination .current { background: var(--grass); color: var(--grass-ink); border-color: var(--grass); }

/* Breadcrumb */
.crumbs { font-size: .86rem; color: var(--ink-3); margin: 0 0 12px; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs .sep { margin: 0 6px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); margin-top: 40px; padding: 28px 0 32px; font-size: .9rem; color: var(--ink-2); }
.site-footer .cols { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .site-footer .cols { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h3 { font-size: .95rem; margin: 0 0 8px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 4px 0; }
.site-footer a { color: var(--ink-2); }
.site-footer .legal { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); font-size: .82rem; color: var(--ink-3); }


/* ---------- Trình bày bài viết: nâng cấp ---------- */
.entry-header h1 { font-size: clamp(1.75rem, 4.4vw, 2.5rem); line-height: 1.18; max-width: 24ch; }
.entry-lead { font-size: 1.12rem; line-height: 1.6; color: var(--ink-2); margin: 0 0 1.2em; }
.entry-content > p:first-of-type { font-size: 1.08rem; }
.entry-content p { max-width: var(--measure); }
.entry-content li { padding-left: 2px; }
.entry-content ul { padding-left: 1.2em; }
.entry-content ul > li::marker { color: var(--grass); }
.entry-content ol { padding-left: 1.4em; }
.entry-content ol > li::marker { color: var(--gold); font-weight: 800; }
.entry-content li + li { margin-top: .35em; }
.entry-content strong { font-weight: 700; color: var(--ink); }
.entry-content h2 { font-size: clamp(1.35rem, 3.2vw, 1.7rem); margin-top: 2em; padding-top: 0; border-top: 0; position: relative; padding-left: 16px; }
.entry-content h2::before { content: ""; position: absolute; left: 0; top: .18em; width: 6px; height: .95em; background: var(--grass); border-radius: 2px; }
.entry-content h3 { font-size: 1.15rem; margin-top: 1.6em; color: var(--ink); }
.entry-content h2 + p, .entry-content h3 + p { margin-top: .4em; }

/* Bảng: khung, hàng xen kẽ, cuộn ngang gọn */
.entry-content .wp-block-table, .entry-content table { margin: 20px 0; }
.entry-content table { display: table; width: 100%; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; border-collapse: separate; border-spacing: 0; font-size: .93rem; }
.entry-content .wp-block-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.entry-content th { background: var(--bg-3); font-weight: 800; font-size: .86rem; letter-spacing: .01em; color: var(--ink-2); }
.entry-content th, .entry-content td { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.entry-content tr:last-child td { border-bottom: 0; }
.entry-content tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--bg-3) 45%, transparent); }
.entry-content td:first-child { font-weight: 600; }

/* Ảnh đại diện và ảnh trong bài */
.entry-thumb { margin: 0 0 24px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.entry-thumb img { display: block; width: 100%; height: auto; }
.entry-content figure.wp-block-image { margin: 24px 0; }
.entry-content figure.wp-block-image img { border-radius: 8px; border: 1px solid var(--line); }
.entry-content figcaption { text-align: center; }

/* Hộp tóm tắt đầu bài */
.tldr { margin: 0 0 22px; padding: 14px 16px 14px 18px; border-left: 4px solid var(--grass); background: var(--bg-2); border-radius: 0 var(--radius) var(--radius) 0; }
.tldr p { margin: 0; }
.tldr p + p { margin-top: 6px; }
.tldr .label { font-size: .8rem; font-weight: 800; color: var(--grass); letter-spacing: .02em; display: block; margin-bottom: 4px; }

/* Code */
.entry-content code { font-size: .9em; padding: .12em .4em; border: 1px solid var(--line); }
.entry-content pre { border: 1px solid var(--line); line-height: 1.5; }

/* FAQ: khối gọn */
.entry-content h2 + h3 { margin-top: 1em; }
.faq-item { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); margin: 10px 0; overflow: hidden; }
.faq-item summary { cursor: pointer; padding: 12px 16px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--ink-3); font-weight: 400; font-size: 1.3em; line-height: 1; }
.faq-item[open] summary::after { content: "–"; }
.faq-item .faq-a { padding: 0 16px 14px; color: var(--ink-2); }
.faq-item .faq-a p { margin: 0; }

/* Meta đầu bài: gọn, có icon chấm */
.entry-meta { font-size: .88rem; }
.entry-meta > span + span::before { content: "·"; margin-right: 14px; color: var(--line-2); }

/* Nút quay về đầu khi bài dài */
.to-top { position: fixed; right: 16px; bottom: 16px; width: 42px; height: 42px; border-radius: 50%; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--ink); display: none; place-items: center; z-index: 40; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.to-top.show { display: grid; }

/* ---------- Utilities ---------- */
.muted { color: var(--ink-3); }
.small { font-size: .88rem; }
.mt-0 { margin-top: 0; }
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); vertical-align: middle; margin-right: 6px; }
.status-dot.on { background: var(--emerald); box-shadow: 0 0 0 3px var(--emerald-bg); }
.status-dot.off { background: var(--redstone); box-shadow: 0 0 0 3px var(--redstone-bg); }

/* ---------- Khối tải game (1.0.6) ---------- */
.dl-quick { margin: 0 0 26px; padding: 18px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; box-shadow: inset 0 3px 0 var(--grass); }
.dl-quick-title { margin: 0 0 4px; font-weight: 800; font-size: 1.08rem; color: var(--ink); }
.dl-quick-sub { margin: 0 0 14px; color: var(--ink-2); font-size: .92rem; }
.dl-quick-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.dl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 18px 0 22px; }
.dl-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 16px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; }
.dl-card.featured { border-color: var(--grass); box-shadow: 0 0 0 1px var(--grass); }
.dl-head { display: flex; align-items: center; gap: 12px; }
.dl-icon { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 6px; background: var(--bg-3); color: var(--ink); box-shadow: inset 2px 2px 0 var(--bevel-light), inset -2px -2px 0 var(--bevel-dark); }
.dl-icon svg { width: 24px; height: 24px; }
.dl-name { margin: 0; font-weight: 800; font-size: 1.02rem; line-height: 1.25; color: var(--ink); }
.dl-store { margin: 2px 0 0; font-size: .85rem; color: var(--ink-3); }
.dl-price { display: inline-block; align-self: flex-start; padding: 3px 10px; border-radius: 999px; background: var(--gold-bg); color: var(--ink); font-weight: 700; font-size: .85rem; font-variant-numeric: tabular-nums; }
.dl-note { margin: 0; color: var(--ink-2); font-size: .9rem; line-height: 1.55; flex: 1; }
.entry-content a.btn-dl, a.btn-dl {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; padding: 12px 16px;
  font-weight: 800; font-size: 1rem; line-height: 1.2; text-align: center; text-decoration: none;
  color: var(--grass-ink); background: var(--grass); border-radius: 5px;
  box-shadow: inset 3px 3px 0 var(--bevel-light), inset -3px -4px 0 var(--bevel-dark), 0 3px 0 rgba(0,0,0,.18);
  transition: transform .08s ease, filter .12s ease;
}
a.btn-dl svg { width: 20px; height: 20px; flex: none; }
a.btn-dl:hover { filter: brightness(1.07); text-decoration: none; }
a.btn-dl:active { transform: translateY(2px); box-shadow: inset -3px -3px 0 var(--bevel-light), inset 3px 3px 0 var(--bevel-dark); }
a.btn-dl:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.entry-content a.btn-dl.lapis, a.btn-dl.lapis { background: var(--lapis); color: #fff; }
.entry-content a.btn-dl.gold, a.btn-dl.gold { background: var(--gold); color: #1b1f22; }
.entry-content a.btn-dl.ghost, a.btn-dl.ghost { background: var(--bg-3); color: var(--ink); box-shadow: inset 2px 2px 0 var(--bevel-light), inset -2px -3px 0 var(--bevel-dark); }
.dl-small { display: block; font-weight: 600; font-size: .78rem; opacity: .85; }
.dl-store-hint { margin: 0; padding: 10px 12px; border-radius: 5px; background: var(--bg-3); color: var(--ink-2); font-size: .88rem; text-align: center; }
.dl-safe { margin: 0 0 22px; font-size: .85rem; color: var(--ink-3); }
@media (max-width: 720px) {
  .dl-quick-row { grid-template-columns: 1fr; }
  .dl-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { a.btn-dl { transition: none; } a.btn-dl:active { transform: none; } }

/* ---------- Hình chế tạo kiểu giao diện game (1.0.8) ---------- */
.mc-craft, .mc-plan { margin: 18px 0 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.mc-panel { display: inline-flex; align-items: center; gap: 14px; padding: 14px; background: #c6c6c6; border-radius: 4px;
  box-shadow: inset 3px 3px 0 #fff, inset -3px -3px 0 #555, 0 0 0 2px #1b1b1b; max-width: 100%; }
.mc-grid { display: grid; grid-template-columns: repeat(3, var(--slot, 52px)); gap: 2px; }
.mc-slot { position: relative; width: var(--slot, 52px); height: var(--slot, 52px); display: grid; place-items: center; background: #8b8b8b;
  box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #fff; }
.mc-slot svg { width: 78%; height: 78%; image-rendering: pixelated; }
.mc-slot.mc-result { --slot: 68px; }
.mc-count { position: absolute; right: 4px; bottom: 1px; font: 800 15px/1 var(--font); color: #fff; text-shadow: 2px 2px 0 #3f3f3f; }
.mc-arrow svg { width: 36px; height: 26px; display: block; }
.mc-craft figcaption, .mc-plan figcaption { font-size: .9rem; color: var(--ink-2); text-align: left; margin: 0; }
.mc-recipe { font-weight: 700; color: var(--ink); }
.mc-note { color: var(--ink-3); }
.mc-plan-grid { display: grid; grid-template-columns: repeat(var(--cols), var(--cell, 40px)); gap: 2px; padding: 10px; background: #5d8a3a;
  border-radius: 4px; box-shadow: 0 0 0 2px #1b1b1b; max-width: 100%; }
.mc-cell { width: var(--cell, 40px); height: var(--cell, 40px); display: grid; place-items: center; background: rgba(0,0,0,.12); }
.mc-cell svg { width: 100%; height: 100%; }
.mc-cell.air { background: #b9d98f; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.mc-cell.path { background: repeating-linear-gradient(45deg, #9a8a6a 0 6px, #87775a 6px 12px); }
.mc-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.mc-leg { display: inline-flex; align-items: center; gap: 8px; }
.mc-leg .mc-cell { --cell: 26px; border-radius: 2px; }
.mc-plan figcaption p { margin: 8px 0 0; }
.mc-row { display: flex; flex-wrap: wrap; gap: 8px 28px; }
@media (max-width: 520px) {
  .mc-panel { gap: 8px; padding: 10px; }
  .mc-grid, .mc-slot { --slot: 42px; }
  .mc-slot.mc-result { --slot: 54px; }
  .mc-arrow svg { width: 26px; height: 19px; }
  .mc-plan-grid, .mc-cell { --cell: 34px; }
  .mc-leg .mc-cell { --cell: 24px; }
}
