/* Tarot Tiên Rồng · giao diện web
   Màu chủ đạo: đêm chàm + vàng kim, điểm son đỏ. Mọi màu khai báo ở :root. */

:root {
  --bg: #090d18;
  --bg-2: #0e1526;
  --panel: #111a2e;
  --panel-2: #16213a;
  --line: rgba(212, 168, 75, .28);
  --line-strong: rgba(212, 168, 75, .6);
  --gold: #d4a84b;
  --gold-hi: #ecca7c;
  --cinnabar: #a8302a;
  --cinnabar-hi: #c4443a;
  --jade: #5f9a86;
  --ink: #efe6d2;
  --muted: #a69d8a;
  --dim: #6f6a5f;

  --f-title: "Playfair Display", Georgia, "Times New Roman", serif;
  --f-body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 14px;
  --card-r: 9px;
  --shadow: 0 18px 40px rgba(0, 0, 0, .45);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { overflow-x: hidden; scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--f-body);
  overflow-x: hidden;
}
/* nền: quầng vàng góc trên, quầng ngọc góc phải, sao lấm tấm */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60vmax 40vmax at 12% -8%, rgba(212, 168, 75, .16), transparent 60%),
    radial-gradient(50vmax 40vmax at 100% 30%, rgba(60, 120, 120, .12), transparent 60%),
    radial-gradient(40vmax 30vmax at 0% 100%, rgba(168, 48, 42, .10), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cg fill='%23d4a84b'%3E%3Ccircle cx='20' cy='30' r='.8' opacity='.5'/%3E%3Ccircle cx='140' cy='70' r='.6' opacity='.4'/%3E%3Ccircle cx='200' cy='180' r='1' opacity='.35'/%3E%3Ccircle cx='70' cy='200' r='.6' opacity='.45'/%3E%3Ccircle cx='110' cy='130' r='.5' opacity='.3'/%3E%3C/g%3E%3C/svg%3E"),
    var(--bg);
}

img { max-width: 100%; display: block; }
a { color: var(--gold-hi); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

h1, h2, h3 { font-family: var(--f-title); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: .005em; }
h2 { font-size: clamp(28px, 4.4vw, 42px); }
h3 { font-size: 22px; }
.kicker {
  margin: 0 0 10px; color: var(--gold); font-size: 12px; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase;
}
.sub { color: var(--muted); max-width: 60ch; margin: 12px auto 0; }
.fine { color: var(--dim); font-size: 13px; }
.sec-head { text-align: center; margin-bottom: 32px; }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: 999px;
  font-weight: 500; font-size: 15px; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: transform .2s var(--ease), background .2s, box-shadow .2s, color .2s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-gold { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #1a1408; box-shadow: 0 6px 20px rgba(212, 168, 75, .25); }
.btn-gold:hover { box-shadow: 0 8px 28px rgba(212, 168, 75, .4); }
.btn-ghost { border-color: var(--line-strong); color: var(--gold-hi); background: rgba(212, 168, 75, .04); }
.btn-ghost:hover { background: rgba(212, 168, 75, .12); }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 14px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- Thanh điều hướng ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(9, 13, 24, .78); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(212, 168, 75, .14);
}
.nav-in { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-family: var(--f-title); font-size: 20px; font-weight: 600; }
.brand-mark { width: 24px; height: 24px; color: var(--gold); }
.nav-links { display: none; gap: 26px; margin-left: auto; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 15px; }
.nav-links a:hover { color: var(--gold-hi); }
.nav .btn { margin-left: auto; }
@media (min-width: 720px) { .nav-links { display: flex; } .nav .btn { margin-left: 8px; } }

/* ---------- Hero ---------- */
.hero { padding: 40px 0 56px; overflow: hidden; overflow: clip; }
.hero-in { display: grid; gap: 40px; align-items: center; }
@media (min-width: 880px) { .hero { padding: 72px 0 88px; } .hero-in { grid-template-columns: 1.05fr 1fr; } }
.hero h1 { font-size: clamp(54px, 8.6vw, 96px); font-weight: 500; }
.hero h1 { margin-bottom: 0; line-height: 1.05; }
.hero-kicker { font-size: clamp(13px, 1.4vw, 16px); letter-spacing: .32em; margin-bottom: 6px; }
.hero-tagline { margin: 14px 0 0; font-family: var(--f-title); font-style: italic; font-weight: 500; font-size: clamp(20px, 2.1vw, 26px); line-height: 1.35; color: var(--gold-hi); }
@media (min-width: 880px) { .hero-tagline { white-space: nowrap; } }
.hero-rule { display: block; width: 72px; height: 2px; margin: 24px 0 20px; background: var(--gold); }
.lead { color: var(--muted); font-size: 17px; max-width: 46ch; margin: 18px 0 26px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero .fine { margin-top: 18px; }

.hero-art { position: relative; height: min(110vw, 520px); display: grid; place-items: center; }
.halo {
  position: absolute; width: min(92vw, 470px); aspect-ratio: 1; border-radius: 50%;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle, rgba(212, 168, 75, .18), transparent 62%),
    repeating-conic-gradient(from 0deg, rgba(212, 168, 75, .22) 0 .6deg, transparent .6deg 7.5deg);
  -webkit-mask: radial-gradient(circle, #000 0 69%, transparent 69.5% 71%, #000 71.5% 100%);
          mask: radial-gradient(circle, #000 0 69%, transparent 69.5% 71%, #000 71.5% 100%);
  animation: spin 120s linear infinite;
}
.hero-card { position: absolute; width: min(48vw, 236px); aspect-ratio: 2/3; border-radius: var(--card-r); overflow: hidden; box-shadow: var(--shadow); }
.hero-card svg { width: 100%; height: 100%; display: block; }
.hero-card.face { border: 1px solid var(--line-strong); animation: float 7s ease-in-out infinite; z-index: 2; }
.hero-card.face img { width: 100%; height: 100%; object-fit: cover; }
.hero-card.l { transform: translateX(-46%) rotate(-12deg) scale(.88); opacity: .9; }
.hero-card.r { transform: translateX(46%) rotate(12deg) scale(.88); opacity: .9; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 50% { transform: translateY(-10px); } }

/* ---------- Bàn xem bài ---------- */
.reader { padding: 40px 0 72px; scroll-margin-top: 64px; }
.seg {
  display: flex; width: max-content; max-width: 100%; margin: 0 auto 22px; padding: 4px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(17, 26, 46, .7);
}
.seg button { border: 0; background: none; padding: 9px 20px; border-radius: 999px; cursor: pointer; color: var(--muted); font-size: 15px; }
.seg button[aria-selected="true"] { background: var(--gold); color: #1a1408; font-weight: 500; }

.ask { max-width: 520px; margin: 0 auto 26px; }
.ask label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.ask label span { color: var(--dim); }
.ask input {
  width: 100%; min-height: 48px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--ink); font: inherit;
}
.ask input::placeholder { color: var(--dim); }
.ask input:focus { outline: none; border-color: var(--gold); }

.table {
  position: relative; padding: 28px 12px 24px; border-radius: 22px;
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(212, 168, 75, .1), transparent 60%),
    linear-gradient(180deg, rgba(22, 33, 58, .7), rgba(14, 21, 38, .7));
}
@media (min-width: 720px) { .table { padding: 36px 28px 30px; } }

.slots { display: flex; justify-content: center; gap: clamp(10px, 3vw, 36px); }
.slot { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.slot-label { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.slot-name { font-family: var(--f-title); font-size: 15px; text-align: center; min-height: 1.3em; max-width: 120px; line-height: 1.25; opacity: 0; transition: opacity .4s .5s; }
@media (min-width: 720px) { .slot-name { font-size: 17px; max-width: 190px; } }
.slot.revealed .slot-name { opacity: 1; }
.slot .tc { --w: clamp(88px, 26vw, 150px); }
.slots.one .tc { --w: clamp(130px, 40vw, 190px); }

.hint { text-align: center; color: var(--muted); min-height: 1.6em; margin: 18px 0 8px; font-size: 15px; }
.hint b { color: var(--gold-hi); font-weight: 500; }
.table-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }

/* ---------- Lá bài (lật) ---------- */
.tc {
  --w: 120px;
  position: relative; width: var(--w); aspect-ratio: 2/3; perspective: 1100px;
  border: 0; padding: 0; background: none; cursor: pointer; flex: none;
}
.tc-in { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .9s var(--ease); }
.tc.flipped .tc-in { transform: rotateY(180deg); }
.tc-face {
  position: absolute; inset: 0; border-radius: var(--card-r); overflow: hidden;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: var(--shadow);
}
.tc-face svg { width: 100%; height: 100%; display: block; }
.tc-front { transform: rotateY(180deg); background: var(--panel); border: 1px solid var(--line-strong); }
.tc-front img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease) .5s; }
.tc.rev .tc-front img { transform: rotate(180deg); }
.tc-front::after { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(236, 202, 124, .35); border-radius: 6px; pointer-events: none; }
.tc.empty .tc-in { border: 1.5px dashed var(--line); border-radius: var(--card-r); }
.tc.empty .tc-face { display: none; }
.tc.empty { cursor: default; }
.tc.ready:not(.flipped) .tc-back { animation: glow 2s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 2px rgba(236, 202, 124, .6), 0 0 28px rgba(212, 168, 75, .45); } }
.badge-rev {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  z-index: 3; font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; background: var(--cinnabar); color: #fff; opacity: 0; transition: opacity .3s .9s;
}
.tc.flipped.rev .badge-rev { opacity: 1; }

/* ---------- Bộ bài: xấp, xáo, quạt ---------- */
.deck-zone { position: relative; min-height: 172px; display: grid; place-items: center; margin-top: 6px; }
.stack { position: relative; width: 104px; aspect-ratio: 2/3; }
.stack .sc { position: absolute; inset: 0; border-radius: var(--card-r); overflow: hidden; box-shadow: 0 6px 16px rgba(0, 0, 0, .5); }
.stack .sc svg { width: 100%; height: 100%; display: block; }
.stack .sc:nth-child(1) { transform: translate(-4px, 4px); }
.stack .sc:nth-child(2) { transform: translate(-2px, 2px); }
.stack.shuffling .sc:nth-child(odd) { animation: riffleL .55s var(--ease) 3; }
.stack.shuffling .sc:nth-child(even) { animation: riffleR .55s var(--ease) 3; }
@keyframes riffleL { 40% { transform: translateX(-70px) rotate(-10deg); } }
@keyframes riffleR { 40% { transform: translateX(70px) rotate(10deg); } }

.fan-scroll {
  width: 100%; overflow-x: auto; overflow-y: hidden; padding: 28px 0 10px;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
  -webkit-mask: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
          mask: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.fan { position: relative; height: 134px; margin: 0 auto; }
.fan .fc {
  position: absolute; bottom: 0; width: 72px; aspect-ratio: 2/3; padding: 0; border: 0;
  border-radius: 7px; overflow: hidden; cursor: pointer; background: none;
  box-shadow: -3px 0 8px rgba(0, 0, 0, .45);
  transform: translateY(var(--y)) rotate(var(--r));
  transition: transform .25s var(--ease), opacity .3s;
  animation: dealIn .5s var(--ease) both; animation-delay: var(--d);
}
.fan .fc svg { width: 100%; height: 100%; display: block; pointer-events: none; }
.fan .fc::after { content: ""; position: absolute; inset: 0; border-radius: inherit; border-left: 1.5px solid rgba(236, 202, 124, .7); pointer-events: none; }
.fan .fc:hover, .fan .fc:focus-visible { transform: translateY(calc(var(--y) - 22px)) rotate(var(--r)); z-index: 5; }
.fan .fc.taken { opacity: 0; pointer-events: none; }
@keyframes dealIn { from { opacity: 0; transform: translateY(40px) rotate(0); } }
@media (min-width: 720px) { .fan { height: 162px; } .fan .fc { width: 90px; } }

.flyer { position: fixed; z-index: 60; pointer-events: none; border-radius: var(--card-r); overflow: hidden; transition: all .6s var(--ease); }
.flyer svg { width: 100%; height: 100%; display: block; }

/* ---------- Kết quả ---------- */
.result { margin-top: 30px; display: grid; gap: 18px; }
.result:empty { display: none; }
.read {
  display: grid; gap: 14px; padding: 22px 20px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line);
  animation: rise .6s var(--ease) both; animation-delay: var(--d, 0s);
}
@media (min-width: 720px) { .read { grid-template-columns: 120px 1fr; gap: 24px; padding: 26px 28px; } }
.read-img { width: 96px; aspect-ratio: 2/3; border-radius: 7px; overflow: hidden; border: 1px solid var(--line-strong); }
.read-img img { width: 100%; height: 100%; object-fit: cover; }
.read-img.rev img { transform: rotate(180deg); }
@media (min-width: 720px) { .read-img { width: 120px; } }
.read-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 4px; }
.pos { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.orient { font-size: 12px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--gold-hi); }
.orient.is-rev { background: var(--cinnabar); border-color: var(--cinnabar); color: #fff; }
.read h3 { font-size: 26px; }
.read .meta { color: var(--muted); font-size: 14px; margin: 2px 0 12px; }
.proverb { margin: 0 0 12px; padding: 2px 0 2px 14px; border-left: 2px solid var(--cinnabar-hi); font-family: var(--f-title); font-style: italic; font-size: 18px; color: var(--gold-hi); }
.read p { margin: 0 0 12px; }
.kw { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.kw span { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: rgba(212, 168, 75, .1); color: var(--ink); }
.link-btn { background: none; border: 0; padding: 0; color: var(--gold-hi); cursor: pointer; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }

.summary {
  padding: 24px 22px; border-radius: var(--radius); border: 1px solid rgba(236, 202, 124, .45);
  background: radial-gradient(ellipse at 0 0, rgba(168, 48, 42, .25), transparent 60%), var(--panel);
  animation: rise .6s var(--ease) both; animation-delay: var(--d, 0s);
}
.summary h3 { margin-bottom: 10px; }
.summary p { margin: 0 0 10px; }
.summary .q { color: var(--muted); font-style: italic; }
.summary ul { margin: 0 0 10px; padding-left: 20px; }
.summary li { margin-bottom: 6px; }
.summary .fine { margin: 6px 0 0; }
.res-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 6px; animation: rise .6s var(--ease) both; animation-delay: var(--d, 0s); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ---------- Thư viện ---------- */
.library { padding: 64px 0 72px; border-top: 1px solid rgba(212, 168, 75, .1); }
.lib-tools { display: flex; flex-direction: column; gap: 14px; margin-bottom: 26px; }
@media (min-width: 860px) { .lib-tools { flex-direction: row; align-items: center; justify-content: space-between; } }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips button {
  flex: none; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: transparent;
  color: var(--muted); cursor: pointer; font-size: 14px;
}
.chips button[aria-selected="true"] { background: rgba(212, 168, 75, .16); border-color: var(--gold); color: var(--gold-hi); }
.search { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); color: var(--ink); font: inherit; width: 100%; }
@media (min-width: 860px) { .search { width: 300px; } }
.search:focus { outline: none; border-color: var(--gold); }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 10px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 860px) { .grid { grid-template-columns: repeat(6, 1fr); gap: 22px 16px; } }
.gcard { display: flex; flex-direction: column; gap: 8px; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; }
.gcard .gimg { position: relative; aspect-ratio: 2/3; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); transition: transform .3s var(--ease), border-color .3s; }
.gcard img { width: 100%; height: 100%; object-fit: cover; }
.gcard:hover .gimg { transform: translateY(-4px); border-color: var(--gold); }
.gnum { position: absolute; top: 6px; left: 6px; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: rgba(9, 13, 24, .8); color: var(--gold-hi); border: 1px solid var(--line); }
.gcard .gt { font-family: var(--f-title); font-size: 15px; line-height: 1.25; color: var(--ink); }
.gcard .gs { font-size: 12px; color: var(--muted); margin-top: -6px; }
.empty { text-align: center; color: var(--muted); }

/* ---------- Đặt trước ---------- */
.preorder { padding: 40px 0 80px; }
.pre-in {
  display: grid; gap: 30px; align-items: center; padding: 36px 22px; border-radius: 26px;
  border: 1px solid var(--line);
  background: radial-gradient(ellipse at 100% 0, rgba(212, 168, 75, .14), transparent 55%), linear-gradient(135deg, #1a1530, #101829);
}
@media (min-width: 820px) { .pre-in { grid-template-columns: 1fr 1.1fr; padding: 48px 52px; } }
.pre-art { position: relative; height: 260px; display: flex; justify-content: center; align-items: center; }
.pre-card { position: absolute; width: 150px; aspect-ratio: 2/3; border-radius: var(--card-r); overflow: hidden; box-shadow: var(--shadow); border: 1px solid rgba(255, 255, 255, .15); }
.pre-card img { width: 100%; height: 100%; object-fit: cover; }
.pre-card:first-child { transform: translateX(-42px) rotate(-8deg); }
.pre-card:last-child { transform: translateX(42px) rotate(7deg); }
.pre-text p:not(.kicker) { color: var(--muted); margin: 14px 0 22px; max-width: 46ch; }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid rgba(212, 168, 75, .12); padding: 34px 0 calc(40px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 14px; }
.foot p { margin: 0 0 8px; max-width: 70ch; }
.foot-brand { margin-bottom: 12px !important; }

/* ---------- Modal chi tiết lá ---------- */
.modal {
  width: min(920px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0;
  border: 1px solid var(--line-strong); border-radius: 20px; background: var(--bg-2); color: var(--ink);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.modal::backdrop { background: rgba(4, 6, 12, .75); backdrop-filter: blur(4px); }
.modal[open] { animation: rise .35s var(--ease); }
.modal-x {
  position: sticky; top: 10px; float: right; margin: 10px 10px 0 0; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: 22px; line-height: 1;
}
.modal-in { display: grid; gap: 22px; padding: 22px 20px 26px; }
@media (min-width: 760px) { .modal-in { grid-template-columns: 300px 1fr; gap: 32px; padding: 32px; } }
.m-img { width: min(240px, 70%); margin: 0 auto; aspect-ratio: 2/3; border-radius: var(--card-r); overflow: hidden; border: 1px solid var(--line-strong); box-shadow: var(--shadow); }
@media (min-width: 760px) { .m-img { width: 100%; } }
.m-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.m-img.rev img { transform: rotate(180deg); }
.modal h3 { font-size: 30px; }
.modal .meta { color: var(--muted); font-size: 14px; margin: 4px 0 14px; }
.modal .story { color: var(--muted); font-size: 15px; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; }
.modal .story b { color: var(--ink); font-weight: 500; }
.m-tabs { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line); margin-bottom: 12px; }
.m-tabs button { border: 0; background: none; padding: 6px 16px; border-radius: 999px; cursor: pointer; color: var(--muted); font-size: 14px; }
.m-tabs button[aria-selected="true"] { background: var(--gold); color: #1a1408; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 80;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--panel-2); border: 1px solid var(--line-strong); color: var(--ink);
  padding: 10px 18px; border-radius: 999px; font-size: 14px; transition: .3s var(--ease); max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* gọn bàn khi đã lật xong */
.deck-zone:empty { min-height: 0; margin: 0; }
.hint:empty { min-height: 0; margin: 10px 0 0; }
.table-actions:empty { display: none; }

/* ---------- Lời giải ---------- */
.topic { font-size: 12px; color: var(--muted); }
.summary h4 { font-family: var(--f-title); font-size: 19px; font-weight: 600; margin: 18px 0 8px; }
.summary p { line-height: 1.7; }
.summary b { color: var(--gold-hi); font-weight: 500; }
.verdict { margin: 16px 0 6px; padding: 14px 16px; border-radius: 12px; border-left: 3px solid var(--gold); background: rgba(212, 168, 75, .08); }
.verdict p { margin: 0 0 6px; }
.verdict p:last-child { margin: 0; color: var(--muted); }
.verdict.v-no { border-left-color: var(--cinnabar-hi); background: rgba(168, 48, 42, .12); }
.verdict.v-maybe { border-left-color: var(--jade); background: rgba(95, 154, 134, .1); }
.reflect { margin: 18px 0 12px !important; padding: 14px 16px; border: 1px dashed var(--line-strong); border-radius: 12px; font-family: var(--f-title); font-size: 19px; font-style: italic; color: var(--ink); }
.reflect span { display: block; font-family: var(--f-body); font-style: normal; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 4px; }
.care { padding: 12px 14px; border-radius: 12px; background: rgba(95, 154, 134, .14); border: 1px solid rgba(95, 154, 134, .4); }

/* ---------- Ủng hộ ---------- */
.nav-cup { display: inline-grid; place-items: center; width: 40px; height: 40px; margin-left: auto; border-radius: 50%; border: 1px solid var(--line); color: var(--gold-hi); }
.nav-cup svg { width: 22px; height: 22px; }
.nav-cup + .btn { margin-left: 8px; }
@media (min-width: 720px) { .nav-cup { display: none; } }
.cup-ico { width: 1em; height: 1em; vertical-align: -0.12em; margin-right: .3em; color: var(--gold-hi); }
.btn-ico { width: 18px; height: 18px; }

.donate { padding: 24px 0 80px; }
.don-in {
  display: grid; gap: 30px; align-items: center; padding: 34px 22px; border-radius: 26px;
  border: 1px solid var(--line);
  background: radial-gradient(ellipse at 100% 0, rgba(212, 168, 75, .14), transparent 55%), radial-gradient(ellipse at 0 100%, rgba(168, 48, 42, .16), transparent 55%), var(--panel);
}
@media (min-width: 820px) { .don-in { grid-template-columns: 1fr 300px; gap: 56px; padding: 48px 56px; } }
.don-text h2 { font-size: clamp(28px, 4vw, 38px); }
.don-lead { color: var(--muted); margin: 14px 0 22px; max-width: 54ch; }
.don-sub { margin: 0 0 12px; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.roadmap { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 10px; }
.roadmap li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(9, 13, 24, .4); border: 1px solid rgba(212, 168, 75, .14); }
.roadmap svg { flex: none; width: 18px; height: 18px; margin-top: 3px; color: var(--gold); }
.don-text .fine { margin: 0; }

.qr-card { margin: 0 auto; width: min(300px, 100%); padding: 16px 16px 18px; border-radius: 22px; background: #f5ecda; color: #3a3024; text-align: center; box-shadow: var(--shadow); }
.qr-card img { width: 100%; height: auto; aspect-ratio: 1; border-radius: 12px; }
.qr-card figcaption { display: grid; gap: 4px; margin-top: 12px; font-size: 14px; }
.qr-hint { color: #8a7a62; font-size: 13px; }
.qr-bank b { letter-spacing: .04em; }
.qr-holder { font-size: 13px; letter-spacing: .04em; color: #6b5c4a; }
.qr-save { margin-top: 6px; color: #8c231d; font-size: 13px; text-underline-offset: 3px; }
.qr-save[hidden] { display: none; }

.don-mini {
  display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center;
  padding: 18px; border-radius: var(--radius); border: 1px dashed rgba(236, 202, 124, .5);
  background: rgba(212, 168, 75, .06); animation: rise .6s var(--ease) both; animation-delay: var(--d, 0s);
}
@media (min-width: 720px) { .don-mini { grid-template-columns: 120px 1fr; padding: 22px 26px; gap: 24px; } }
.don-mini .qr-img { width: 100%; height: auto; aspect-ratio: 1; border-radius: 10px; background: #f5ecda; padding: 6px; }
.don-mini h3 { font-size: 19px; margin-bottom: 4px; }
.don-mini p { margin: 0 0 12px; color: var(--muted); font-size: 15px; }

/* ---------- Blog ---------- */
.center { text-align: center; }
.home-blog { padding: 56px 0 40px; border-top: 1px solid rgba(212, 168, 75, .1); }
.posts { display: grid; gap: 18px; margin-bottom: 26px; }
@media (min-width: 700px) { .posts { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .posts { grid-template-columns: repeat(3, 1fr); } }
.post-card { display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink);
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); transition: transform .3s var(--ease), border-color .3s; }
.post-card:hover { transform: translateY(-4px); border-color: var(--gold); }
.post-cover { aspect-ratio: 16/10; overflow: hidden; background: var(--bg-2); }
.post-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.post-cover-empty { display: grid; place-items: center; color: var(--gold); }
.post-cover-empty svg { width: 56px; height: 56px; opacity: .6; }
.post-body { padding: 16px 18px 20px; }
.post-body h3 { font-size: 21px; margin: 4px 0 8px; }
.post-body p { margin: 0; color: var(--muted); font-size: 15px; }
.post-meta { font-size: 13px !important; color: var(--gold) !important; }
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.post-tags span { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: rgba(212, 168, 75, .1); color: var(--gold-hi); }

.blog-head { padding: 56px 0 8px; }
.blog-head h1 { font-size: clamp(34px, 6vw, 56px); }
.blog-list { padding: 8px 0 60px; }

.article { padding: 36px 0 70px; }
.article-wrap { max-width: 760px; }
.back-link { display: inline-block; margin-bottom: 22px; color: var(--muted); text-decoration: none; font-size: 14px; }
.back-link:hover { color: var(--gold-hi); }
.article h1 { font-size: clamp(32px, 5.4vw, 50px); margin-bottom: 12px; }
.article-lead { font-size: 19px; color: var(--muted); margin: 0; }
.article-cover { margin: 26px 0 8px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16/9; }
.article-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.prose { font-size: 17px; line-height: 1.8; margin-top: 26px; }
.prose h2 { font-size: 28px; margin: 38px 0 12px; }
.prose h3 { font-size: 22px; margin: 28px 0 10px; }
.prose p { margin: 0 0 18px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose strong { color: var(--gold-hi); font-weight: 600; }
.prose a { color: var(--gold-hi); text-underline-offset: 3px; }
.prose img { border-radius: 12px; margin: 20px auto; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 34px 0; }
.prose blockquote { margin: 26px 0; padding: 6px 0 6px 20px; border-left: 3px solid var(--cinnabar-hi); font-family: var(--f-title); font-style: italic; font-size: 21px; color: var(--gold-hi); }
.prose blockquote p { margin: 0; }
.prose code { background: var(--panel-2); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.table-wrap { overflow-x: auto; margin: 0 0 22px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { color: var(--gold); font-weight: 500; }
.article-cta { margin: 40px 0; padding: 26px 24px; border-radius: 20px; border: 1px solid rgba(236, 202, 124, .45);
  background: radial-gradient(ellipse at 0 0, rgba(168, 48, 42, .22), transparent 60%), var(--panel); }
.article-cta h2 { font-size: 26px; margin-bottom: 8px; }
.article-cta p { color: var(--muted); margin: 0 0 16px; }
.related h2 { font-size: 26px; margin: 10px 0 18px; }
.related .posts { grid-template-columns: 1fr; }
@media (min-width: 700px) { .related .posts { grid-template-columns: repeat(2, 1fr); } }
.nav-links a[aria-current="page"] { color: var(--gold-hi); }
.don-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Chân trang & trang tĩnh ---------- */
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 4px 0 14px; }
.foot-links a { color: var(--gold-hi); text-decoration: none; font-size: 14px; }
.foot-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.page-static .article-wrap { padding-top: 12px; }

/* ---------- Bảo vệ tranh lá bài ----------
   Không chuột phải "Lưu ảnh", không kéo ảnh ra ngoài, không nhấn giữ để lưu trên điện thoại.
   (Chỉ gây khó cho người dùng thông thường; không chặn được chụp màn hình.) */
img[src*="assets/cards/"] {
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* ---------- Góp ý ---------- */
.feedback { padding: 64px 0 80px; border-top: 1px solid rgba(212, 168, 75, .1); }
.fb-in { display: grid; gap: 26px; }
@media (min-width: 820px) { .fb-in { grid-template-columns: 1fr 1.25fr; gap: 56px; } }
.fb-text h2 { font-size: clamp(26px, 3.6vw, 34px); }
.fb-lead { color: var(--muted); margin: 14px 0 0; max-width: 46ch; }
.fb-form { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.fb-types { border: 0; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.fb-types legend { padding: 0; margin-bottom: 10px; font-size: 14px; color: var(--muted); }
.fb-types label { position: relative; }
.fb-types input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.fb-types span {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); font-size: 14px; transition: background .2s, color .2s, border-color .2s;
}
.fb-types input:checked + span { background: var(--gold); border-color: var(--gold); color: #1a1408; font-weight: 500; }
.fb-types input:focus-visible + span { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.fb-label { font-size: 14px; color: var(--muted); margin-top: 4px; }
.fb-opt { color: var(--dim); }
.fb-form textarea, .fb-form input[type=text] {
  width: 100%; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--ink); font: inherit; font-size: 16px;
}
.fb-form textarea { resize: vertical; min-height: 110px; }
.fb-form input[type=text] { min-height: 46px; }
.fb-form textarea::placeholder, .fb-form input::placeholder { color: var(--dim); }
.fb-form textarea:focus, .fb-form input[type=text]:focus { outline: none; border-color: var(--gold); }
.fb-attach { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); margin-top: 4px; cursor: pointer; }
.fb-attach input { width: 18px; height: 18px; accent-color: var(--gold); }
.fb-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 8px; }
.fb-row .fine { margin: 0; flex: 1 1 200px; }
.fb-form .btn[disabled] { opacity: .6; cursor: wait; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.fb-done { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 20px 0; }
.fb-done[hidden] { display: none; }
.fb-done svg { width: 46px; height: 46px; color: var(--gold); }
.fb-done p { margin: 0; color: var(--muted); }
.res-feedback { text-align: center; color: var(--muted); font-size: 14px; margin: 4px 0 0; animation: rise .6s var(--ease) both; animation-delay: var(--d, 0s); }
.fb-form[hidden] { display: none; }

/* Thư viện thu gọn: chỉ hiện 2 hàng, hàng thứ hai mờ dần */
.grid.collapsed .gcard:nth-child(n+7) { display: none; }
@media (min-width: 560px) { .grid.collapsed .gcard:nth-child(n+7) { display: flex; } .grid.collapsed .gcard:nth-child(n+9) { display: none; } }
@media (min-width: 860px) { .grid.collapsed .gcard:nth-child(n+9) { display: flex; } .grid.collapsed .gcard:nth-child(n+13) { display: none; } }
.grid.collapsed { -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent); mask-image: linear-gradient(180deg, #000 55%, transparent); }
.lib-more { display: flex; justify-content: center; margin-top: 18px; }
.lib-more[hidden] { display: none; }
.hero-tagline span { white-space: nowrap; }
@media (max-width: 879px) { .hero-tagline span { display: block; } }
