:root {
  --ink: #1c1712;
  --ink-2: #2b231b;
  --paper: #f6efe1;
  --paper-2: #efe4cd;
  --line: #d8c7a3;
  --gold: #c99a3b;
  --gold-2: #f2cf7a;
  --red: #a8261c;
  --red-2: #c9382a;
  --muted: #7a6a55;
  --ok: #2f7d4a;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(40, 25, 5, .18);
  --serif: "Noto Serif", Georgia, serif;
  --sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font: 15px/1.65 var(--sans); color: var(--ink);
  background: var(--paper) url("../img/paper.svg");
}
img { max-width: 100%; display: block; }

/* vet sang vang chay theo gan an tren nen giay (inc/veins.php), lech nhip */
.bg-veins { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
/* vet sang: --h la vi tri dau sang tren gan (0..1000); 5 lop cung bam dau, lop dai = duoi mo dan */
@property --h { syntax: "<number>"; inherits: true; initial-value: 0; }
.vs { animation: vein-h var(--d) cubic-bezier(.42,0,.58,1) var(--dl) infinite; }
.vs path { stroke-dasharray: var(--l) 3000; stroke-dashoffset: calc(var(--l) - var(--h)); }
.vs .vs-t1 { stroke: rgba(201,149,46,.16); }
.vs .vs-t2 { stroke: rgba(222,174,79,.30); }
.vs .vs-t3 { stroke: rgba(242,205,120,.62); }
.vs .vs-glow { stroke: rgba(255,205,110,.26); }
.vs .vs-head { stroke: #fff7dc; }
/* chay het gan + duoi tat dan trong ~65% thoi gian, con lai nghi -> moi gan sang mot luc khac nhau */
@keyframes vein-h { 0% { --h: 0; } 65%, 100% { --h: 1760; } }
@media (prefers-reduced-motion: reduce) { .vn-shine { display: none; } }
a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-2); }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.25; margin: 0 0 .6em; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.center { text-align: center; }
.muted { color: var(--muted); }
.inline { display: inline; margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px; border: 0; cursor: pointer;
  font: 600 15px var(--sans); letter-spacing: .2px; transition: .2s; white-space: nowrap;
}
.btn.sm { padding: 7px 14px; font-size: 14px; }
.btn.lg { padding: 15px 30px; font-size: 17px; }
.btn.block { width: 100%; }
.btn-gold { color: #3a2508; background: linear-gradient(180deg, var(--gold-2), var(--gold)); box-shadow: 0 4px 0 #8c6420, 0 8px 20px rgba(201,154,59,.35); }
.btn-gold:hover { color: #3a2508; filter: brightness(1.07); transform: translateY(-1px); }
.btn-red { color: #fff; background: linear-gradient(180deg, var(--red-2), var(--red)); box-shadow: 0 4px 0 #6d140d; }
.btn-red:hover { color: #fff; filter: brightness(1.1); transform: translateY(-1px); }
.btn-ghost { color: #f3e6c8; background: rgba(255,255,255,.08); border: 1px solid rgba(242,207,122,.35); }
.btn-ghost:hover { color: #fff; background: rgba(242,207,122,.18); }
.btn-line { color: var(--ink); background: transparent; border: 1px solid var(--line); }
.btn-line:hover { color: var(--red); border-color: var(--gold); }

/* ---------- Top bar ---------- */
.demo-bar { background: #3a2508; color: var(--gold-2); text-align: center; font-size: 13px; padding: 6px 12px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: min(86vh, 760px); display: flex; align-items: stretch;
  background: #1a0f08 url("../img/hero-main.jpg") 50% 22% / cover no-repeat; overflow: hidden;
}
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 45%; background: linear-gradient(transparent, var(--paper)); }
.hero-in { position: relative; z-index: 2; padding-bottom: 64px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 20px; }
/* video rong 3D (neu co): tron sang de nen den bien mat */
/* vi tri + co do JS dat theo hang nut (dragon-orbit.js) */
.hero-video { position: absolute; z-index: 3; left: 50%; top: 50%; width: 520px; height: auto; mix-blend-mode: screen; pointer-events: none; opacity: 0; transition: opacity .8s; }
.hero-video.ready { opacity: 1; }
.hero.has-video .orbit { display: none; }
@media (max-width: 760px) { .hero-video { display: none; } .hero.has-video .orbit { display: block; } }
.hero-cta { width: 100%; position: relative; z-index: 4; }
/* rong bay vong quanh hang nut: 2 lop canvas, lop sau nam duoi nut, lop truoc nam tren nut */
.orbit { position: absolute; left: -90px; right: -90px; top: -40px; bottom: -60px; width: calc(100% + 180px); height: calc(100% + 100px); pointer-events: none; }
.orbit-back { z-index: 0; }
.orbit-front { z-index: 2; }
.hero-cta .plaque-row { position: relative; z-index: 1; }

/* ---------- Bang vang kham ngoc: Dang ky / Tai game / Dang nhap ---------- */
@font-face {
  font-family: "LacLongQuan"; font-weight: 700; font-display: swap;
  src: url("../fonts/uvn_laclongquanbold.ttf") format("truetype");
}
.plaque-row { display: flex; align-items: flex-end; justify-content: center; gap: 18px; padding-top: 70px; }
.plaque { position: relative; display: block; container-type: inline-size; text-decoration: none; transition: transform .25s; }
.plaque-big { width: 440px; }
.plaque-small { width: 280px; margin-bottom: 10px; }
.plaque svg {
  position: relative; z-index: 1; display: block; width: 100%; height: auto; overflow: visible;
  filter: drop-shadow(0 6px 8px rgba(60,30,0,.45)); transition: filter .25s;
}
/* chu nam giua mat bang (mat bang o y 21..69 cua khung -10..90 => tam o 55% chieu cao) */
.plaque .pq-label {
  position: absolute; z-index: 2; left: 0; right: 0; top: 0; height: 100%; padding-top: 8cqw;
  display: flex; align-items: center; justify-content: center;
  font: 700 8.6cqw/1 "LacLongQuan", var(--serif); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
  color: #4a2004; text-shadow: 0 1px 0 rgba(255,246,214,.85), 0 -1px 0 rgba(70,35,3,.4);
}
.plaque-small .pq-label { font-size: 8cqw; color: #5a2a06; }
.plaque-big svg { animation: pq-pulse 2.6s ease-in-out infinite; }
.plaque:hover { transform: translateY(-3px); }
.plaque:hover svg, .plaque:focus-visible svg { filter: drop-shadow(0 6px 8px rgba(60,30,0,.45)) drop-shadow(0 0 12px rgba(255,214,110,.95)); animation: none; }
.plaque:hover .pq-label { color: #8f1b0e; }
@keyframes pq-pulse {
  0%, 100% { filter: drop-shadow(0 6px 8px rgba(60,30,0,.45)) drop-shadow(0 0 0 rgba(255,214,110,0)); }
  50%      { filter: drop-shadow(0 6px 8px rgba(60,30,0,.45)) drop-shadow(0 0 10px rgba(255,214,110,.75)); }
}
/* song long chau ngoc: 2 rong nho nup sau mep tren, cung nhin vao vien ngoc o giua */
.pq-dragon {
  position: absolute; z-index: 0; bottom: 60%; width: 25%; height: auto; pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(60,30,0,.5));
  animation: pq-bob 3.2s ease-in-out infinite;
}
.pq-dragon-r { left: 53%; transform-origin: 50% 100%; }
.pq-dragon-l { right: 53%; transform-origin: 50% 100%; transform: scaleX(-1); animation-name: pq-bob-flip; }
@keyframes pq-bob { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-4deg) translateY(-2px); } }
@keyframes pq-bob-flip { 0%, 100% { transform: scaleX(-1) rotate(0); } 50% { transform: scaleX(-1) rotate(-4deg) translateY(-2px); } }
.plaque:hover .pq-dragon { filter: drop-shadow(0 2px 3px rgba(60,30,0,.5)) drop-shadow(0 0 8px rgba(255,214,110,.9)); }
@media (prefers-reduced-motion: reduce) { .plaque-big svg, .pq-dragon { animation: none; } }
/* dom lua bay khap banner */
.hero-embers { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.hero-embers i {
  position: absolute; bottom: -12px; left: var(--x); width: var(--s); height: var(--s); border-radius: 50%;
  background: #ffd36b; box-shadow: 0 0 8px 3px rgba(255,170,50,.75);
  animation: ember-rise var(--d) linear infinite; animation-delay: calc(var(--w) * -1);
}
@keyframes ember-rise {
  0%   { transform: translate(0, 0) scale(1); opacity: 0; }
  10%  { opacity: .95; }
  60%  { transform: translate(28px, -45vh) scale(.8); }
  100% { transform: translate(-12px, -85vh) scale(.4); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .hero-embers i { animation: none; } .hero-embers { display: none; } }
/* man chua du rong cho 3 bang 1 hang: Tai Game mot hang rieng, 2 bang nho xuong duoi */
@media (max-width: 1080px) {
  .plaque-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; padding-top: 56px; }
  .pq-dl { grid-column: 1 / -1; grid-row: 1; justify-self: center; width: min(420px, 94%); }
  .plaque-small { width: 100%; max-width: 280px; margin: 0; }
  .pq-left { justify-self: end; } .pq-right { justify-self: start; }
}
/* ---------- Menu o thoi duoi banner (do son / dong) ---------- */
.lozenge-nav {
  position: relative; z-index: 3; margin-top: -30px;
  display: flex; justify-content: center; gap: 18px; flex-wrap: wrap;
}
.lozenge {
  --c1: #d8452a; --c2: #9b1d12; --c3: #5c0b06;
  position: relative; width: 150px; height: 150px; display: grid; place-items: center; text-decoration: none;
  transition: transform .25s;
}
.lz-bronze { --c1: #c49a5c; --c2: #8c6431; --c3: #4e3416; }
/* hinh thoi: o vuong xoay 45 do, vien vang + vien toi ngoai */
.lozenge::before {
  content: ""; position: absolute; inset: 15%; transform: rotate(45deg); border-radius: 4px;
  background:
    repeating-radial-gradient(circle at 0 100%, transparent 0 9px, rgba(255,215,140,.16) 10px 11px),
    radial-gradient(circle at 50% 35%, var(--c1), var(--c2) 60%, var(--c3));
  border: 2px solid #e8bd62;
  box-shadow: 0 0 0 3px var(--c3), 0 10px 22px rgba(40,15,0,.45), inset 0 0 18px rgba(0,0,0,.35);
  transition: box-shadow .25s, filter .25s;
}
.lozenge::after {
  content: ""; position: absolute; inset: 22%; transform: rotate(45deg); pointer-events: none;
  border: 1px solid rgba(255,228,160,.6);
}
.lozenge span {
  position: relative; z-index: 1; text-align: center; line-height: 1.15;
  font: 700 19px/1.15 "LacLongQuan", var(--serif); color: #fff3d2;
  text-shadow: 0 2px 0 rgba(0,0,0,.45), 0 0 10px rgba(255,190,80,.35);
}
/* rong vang nho bam o dinh tren cua o thoi */
.lz-dragon {
  position: absolute; z-index: 2; top: -4px; left: 50%; width: 46px; height: auto; transform: translateX(-50%) scaleX(-1);
  filter: drop-shadow(0 2px 2px rgba(40,15,0,.6)); pointer-events: none; transition: transform .3s;
}
.lz-bronze .lz-dragon { transform: translateX(-50%); }
.lozenge:hover { transform: translateY(-5px); }
.lozenge:hover::before { box-shadow: 0 0 0 3px var(--c3), 0 14px 28px rgba(40,15,0,.5), 0 0 22px rgba(255,200,90,.75), inset 0 0 18px rgba(0,0,0,.3); filter: brightness(1.08); }
.lozenge:hover .lz-dragon { transform: translateX(-50%) scaleX(-1) translateY(-4px) rotate(-6deg); }
.lz-bronze:hover .lz-dragon { transform: translateX(-50%) translateY(-4px) rotate(-6deg); }
@media (max-width: 560px) {
  .lozenge-nav { gap: 4px 8px; margin-top: 10px; }
  .lozenge { width: 46%; max-width: 150px; height: auto; aspect-ratio: 1; }
  .lozenge span { font-size: 16px; }
}
/* ---------- Bang may chu: son mai do den, vien vang co anh sang chay quanh ---------- */
.server-card {
  --b: 2px; position: fixed; left: 10px; top: 50%; z-index: 40; transform: translateY(-50%);
  isolation: isolate; width: 176px; padding: 28px 14px 16px; text-align: center; color: #f3e6c8;
  border-radius: 18px 18px 12px 12px;
  background: radial-gradient(120% 70% at 50% 0%, rgba(168,38,28,.55), transparent 60%), linear-gradient(170deg, #2a1610, #120a07 75%);
  box-shadow: 0 18px 40px rgba(30,10,0,.55), inset 0 0 0 1px rgba(255,220,150,.12);
}
/* vien vang xoay (conic) */
.server-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; padding: var(--b); border-radius: inherit;
  background: conic-gradient(from var(--srv-a, 0deg), #7a4510, #f6d58a, #b9782a, #fff2c2, #7a4510 50%, #f6d58a, #b9782a, #7a4510);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: srv-spin 6s linear infinite;
}
@property --srv-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes srv-spin { to { --srv-a: 360deg; } }
/* vien trong mo + goc hoa van */
.server-card::after {
  content: ""; position: absolute; inset: 8px; z-index: -1; pointer-events: none; border-radius: 12px 12px 8px 8px;
  border: 1px solid rgba(232,189,98,.35);
  background:
    radial-gradient(circle at 0 0, transparent 9px, rgba(232,189,98,.55) 10px 11px, transparent 12px) top left / 22px 22px no-repeat,
    radial-gradient(circle at 100% 0, transparent 9px, rgba(232,189,98,.55) 10px 11px, transparent 12px) top right / 22px 22px no-repeat,
    radial-gradient(circle at 0 100%, transparent 9px, rgba(232,189,98,.55) 10px 11px, transparent 12px) bottom left / 22px 22px no-repeat,
    radial-gradient(circle at 100% 100%, transparent 9px, rgba(232,189,98,.55) 10px 11px, transparent 12px) bottom right / 22px 22px no-repeat;
}
/* chop vong cung tren dinh co ngoc */
.srv-crest {
  position: absolute; left: 50%; top: -18px; width: 86px; height: 34px; transform: translateX(-50%);
  background: url("../img/divider.svg") center / 220% auto no-repeat;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.6));
}
.srv-kicker { margin: 0; font-size: 11px; letter-spacing: .4em; text-transform: uppercase; color: #c9a86a; }
.srv-name {
  margin: 4px 0 10px; font: 700 27px/1.1 "LacLongQuan", var(--serif); letter-spacing: .03em;
  background: linear-gradient(180deg, #fff3c8 10%, #f2c45a 55%, #b9782a); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,.5));
}
.srv-status { margin: 0 0 8px; display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; font-size: 12.5px; color: #d9f2df; border-radius: 999px; background: rgba(60,207,110,.12); border: 1px solid rgba(60,207,110,.35); }
.srv-dot { width: 8px; height: 8px; border-radius: 50%; background: #3ccf6e; box-shadow: 0 0 0 0 rgba(60,207,110,.7); animation: srv-ping 1.8s ease-out infinite; }
@keyframes srv-ping { 70% { box-shadow: 0 0 0 8px rgba(60,207,110,0); } 100% { box-shadow: 0 0 0 0 rgba(60,207,110,0); } }
.srv-invite { margin: 0; padding: 10px 0; font: italic 600 13px/1.4 var(--serif); color: #e8cf96; border-top: 1px solid rgba(232,189,98,.25); border-bottom: 1px solid rgba(232,189,98,.25); }
.srv-foot { margin: 10px 0 0; font-size: 11.5px; line-height: 1.5; color: #a8916a; }
@media (max-width: 1340px) { .server-card { width: 150px; padding: 26px 10px 14px; } .srv-name { font-size: 23px; } }
@media (max-width: 960px) { .server-card { display: none; } }
/* bang May chu noi chi hien o trang chu (cac trang con co cot menu ben trai) */
body:not(.home) .server-card { display: none; }
@media (prefers-reduced-motion: reduce) { .server-card::before, .srv-dot { animation: none; } }

/* ---------- Page head ---------- */
.page-head { background: linear-gradient(rgba(20,15,10,.62), rgba(20,15,10,.78)), url("../img/hero-main.jpg") 70% 16% / cover #1a0f08; color: #fff; padding: 104px 0 40px; text-align: center; }
.page-head h1 { color: var(--gold-2); font-size: clamp(26px, 4vw, 38px); text-shadow: 0 2px 10px rgba(0,0,0,.6); margin: 0; }
.crumb { margin: 8px 0 0; color: #d7c7a5; font-size: 14px; }
.crumb a { color: #f3e6c8; }

/* ---------- Sections ---------- */
main { min-height: 50vh; }
.section { padding: 56px 0; }
.section-title { text-align: center; margin-bottom: 30px; }
/* tieu de muc: chu khac co phong, 2 dau rong vang chau vao giua */
.section-title h2 {
  display: inline-flex; align-items: center; gap: 14px; margin: 0;
  font: 700 clamp(26px, 3.4vw, 40px)/1.15 "LacLongQuan", var(--serif); text-transform: uppercase; letter-spacing: .04em;
  background: linear-gradient(180deg, #8a1c10, #4a1a06 70%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.section-title h2::before, .section-title h2::after {
  content: ""; flex: none; width: clamp(44px, 5vw, 64px); aspect-ratio: 320 / 347;
  background: url("../img/dragon-head.webp") center / contain no-repeat;
  filter: drop-shadow(0 2px 3px rgba(60,30,0,.45));
}
.section-title h2::before { transform: scaleX(-1); }
.section-title p { color: var(--muted); margin: 6px 0 0; }
/* hoa van phan cach duoi tieu de muc */
.section-title::after { content: ""; display: block; width: min(360px, 80%); height: 28px; margin: 12px auto 0; background: url("../img/divider.svg") center / contain no-repeat; }
.panel { background: #fffaf0; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; }
.panel + .panel { margin-top: 22px; }
.panel h3 { font-size: 19px; }
section.panel { margin-top: 36px; margin-bottom: 36px; }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: stretch; }
/* khung dat canh nhau trong luoi: bo khoang cach xep chong de dinh/day bang nhau */
.grid-2 > .panel + .panel, .grid-side > .panel + .panel { margin-top: 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-side { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
.grid-2 > *, .grid-3 > *, .grid-side > * { min-width: 0; }
.grid-article { grid-template-columns: 1fr 300px; align-items: start; }


/* ---------- News ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 2px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tabs button, .tabs a { background: none; border: 0; padding: 9px 14px; font: 600 14px var(--sans); color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs .on { color: var(--red); border-color: var(--red); }
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li { display: flex; gap: 10px; align-items: baseline; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.news-list a { color: var(--ink); flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-list a:hover { color: var(--red); }
.news-list time { color: var(--muted); font-size: 13px; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 4px; background: var(--red); color: #fff; }
.tag.t2 { background: #b07418; }
.tag.t3 { background: #2f6d7d; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: #fffaf0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.card .thumb { aspect-ratio: 16/9; background: #2b231b center / cover; }
.card .body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.card h3 { font-size: 17px; margin: 0; }
.card h3 a { color: var(--ink); }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.article { max-width: 860px; margin: 36px auto; }
.article .meta { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.article .content img { border-radius: 8px; margin: 12px auto; }
.article .content .ql-align-center { text-align: center; } .article .content .ql-align-right { text-align: right; } .article .content .ql-align-justify { text-align: justify; }
.article .content blockquote { margin: 14px 0; padding: 10px 16px; border-left: 4px solid var(--gold); background: var(--paper-2); border-radius: 0 8px 8px 0; }
.article .content h2, .article .content h3, .article .content h4 { color: var(--red); }
.article .content .ql-font-serif { font-family: Georgia, "Times New Roman", serif; }
.article .content .ql-font-mono { font-family: Consolas, "Courier New", monospace; }
.article .content .ql-font-llq { font-family: "LacLongQuan", serif; }
.article .content .ql-indent-1 { padding-left: 3em; } .article .content .ql-indent-2 { padding-left: 6em; } .article .content .ql-indent-3 { padding-left: 9em; } .article .content .ql-indent-4 { padding-left: 12em; }
.article .content hr { border: 0; height: 2px; margin: 22px 0; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.article .content pre { background: #1e1712; color: #f2e6cc; padding: 12px 16px; border-radius: 8px; overflow-x: auto; font: 13.5px/1.6 Consolas, monospace; white-space: pre-wrap; }
.article .content table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.article .content td, .article .content th { border: 1px solid var(--line); padding: 8px 10px; }
.article .content tr:first-child td { background: var(--paper-2); font-weight: 600; }
.article .content iframe.ql-video { display: block; width: 100%; aspect-ratio: 16/9; height: auto; border: 0; border-radius: 8px; margin: 14px auto; }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 26px; }
.pager a, .pager span { min-width: 38px; padding: 7px 10px; border-radius: 6px; border: 1px solid var(--line); text-align: center; color: var(--ink); background: #fffaf0; }
.pager .on { background: var(--red); border-color: var(--red); color: #fff; }

/* ---------- Ranking ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; color: #f3e6c8; background: var(--ink-2); padding: 10px 12px; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table tr:nth-child(even) td { background: rgba(239,228,205,.45); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .exp { color: var(--muted); font-size: 13px; }
.rank { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 700; background: var(--paper-2); color: var(--muted); }
.rank.r1 { background: linear-gradient(#ffe08a, #d4a12c); color: #4a2f00; }
.rank.r2 { background: linear-gradient(#f1f1f1, #a9a9a9); color: #333; }
.rank.r3 { background: linear-gradient(#f0c08f, #b9763b); color: #3d1f00; }
.table-wrap { overflow-x: auto; }


/* ---------- Forms ---------- */
.form-box { max-width: 520px; margin: 40px auto; }
.form-box.wide { max-width: 760px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff;
  font: 15px var(--sans); color: var(--ink); transition: .15s;
}
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,154,59,.2); }
textarea.input { min-height: 260px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 13.5px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.captcha { display: flex; gap: 10px; align-items: center; }
.captcha b { background: var(--ink); color: var(--gold-2); padding: 10px 14px; border-radius: 8px; font-family: var(--serif); letter-spacing: 2px; white-space: nowrap; }
.form-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; font-size: 14px; flex-wrap: wrap; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.alert { margin: 20px 0 0; padding: 12px 16px; border-radius: 8px; border: 1px solid; font-size: 14.5px; }
.alert-ok { background: #e8f5ec; border-color: #9fd3b1; color: #1f5a33; }
.alert-err { background: #fbe9e7; border-color: #eab0a9; color: #7d1d14; }
.alert-warn { background: #fff4dc; border-color: #ebce8c; color: #6b4b06; }

/* thong bao nho giua man hinh: truot tu duoi len, giu ~3s roi mo dan */
.toasts { position: fixed; left: 50%; bottom: 48px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 22px; border-radius: 999px; font-size: 15px; font-weight: 600; color: #f6e6c0;
  background: linear-gradient(180deg, rgba(48,30,18,.96), rgba(26,15,9,.96)); border: 1px solid rgba(214,168,82,.6);
  box-shadow: 0 10px 30px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,230,170,.15);
  opacity: 0; animation: toast-life 3.8s cubic-bezier(.2,.8,.2,1) forwards; }
.toast i { font-size: 18px; }
.toast-err { animation-duration: 6s; }
.toast-ok i { color: #7fd39b; } .toast-err i { color: #ff8f7d; } .toast-warn i { color: #f2cf7a; }
@keyframes toast-life {
  0% { opacity: 0; transform: translateY(40px) scale(.96); }
  10% { opacity: 1; transform: translateY(0) scale(1); }
  78% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-14px); visibility: hidden; }
}
@media (max-width: 960px) { .toasts { bottom: 96px; } }
@keyframes toast-fade { 0%, 80% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .toast { animation-name: toast-fade; } }
.errors { margin: 0 0 16px; padding: 12px 16px 12px 32px; background: #fbe9e7; border: 1px solid #eab0a9; border-radius: 8px; color: #7d1d14; font-size: 14px; }

/* ---------- Account ---------- */
.side-menu { display: flex; flex-direction: column; gap: 4px; }
.side-menu a { padding: 10px 14px; border-radius: 8px; color: var(--ink); font-weight: 500; }
.side-menu a i { width: 22px; color: var(--gold); }
.side-menu a.on, .side-menu a:hover { background: var(--ink-2); color: var(--gold-2); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.stat { padding: 16px; border-radius: 10px; background: linear-gradient(160deg, #2b231b, #1c1712); color: #e9dcc0; }
.stat small { color: #bfae8b; }
.stat b { display: block; font-size: 24px; color: var(--gold-2); font-family: var(--serif); }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.ok { background: #e1f3e7; color: var(--ok); }
.badge.wait { background: #fff1d1; color: #8a5b00; }
.badge.fail { background: #fbe0dc; color: var(--red); }

/* ---------- Download ---------- */
/* nut tai kieu huy hieu: nen den, vien vang, chu "Tai ngay tren" + ten lon */
.dl-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.dl-badge {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 10px;
  color: #fff; text-decoration: none; overflow: hidden;
  background: linear-gradient(180deg, #3a3a3a, #0d0d0d);
  box-shadow: 0 0 0 1px #e8bd62, 0 0 0 3px #1a1208, 0 8px 18px rgba(30,15,0,.35), inset 0 1px 0 rgba(255,255,255,.18);
  transition: transform .2s, box-shadow .2s;
}
.dl-badge::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255,226,150,.28), transparent); transition: left .6s;
}
.dl-badge i { font-size: 30px; width: 34px; text-align: center; color: #f2cf7a; }
.dl-badge span { flex: 1; min-width: 0; line-height: 1.15; }
.dl-badge small { display: block; font-size: 12px; color: #d6c7a4; }
.dl-badge b { display: block; font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-badge em { font-style: normal; font-size: 12px; color: #1a1208; background: linear-gradient(#ffe39a, #d9a640); padding: 2px 8px; border-radius: 999px; font-weight: 700; }
.dl-badge:hover { color: #fff; transform: translateY(-3px); box-shadow: 0 0 0 1px #ffd77e, 0 0 0 3px #1a1208, 0 12px 24px rgba(30,15,0,.45), 0 0 16px rgba(255,200,90,.55); }
.dl-badge:hover::after { left: 120%; }
.req { width: 100%; border-collapse: collapse; font-size: 14px; }
.req th, .req td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.req th { background: var(--paper-2); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 18px 50px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: #fff; font-weight: 700; }

/* ---------- Quick bar ---------- */

/* ---------- Footer ---------- */
.footer { margin-top: 40px; background: #16110c; color: #cdbd9c; font-size: 14px; }
.footer-in { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 26px; padding: 40px 0 26px; }
.footer h4 { color: var(--gold-2); font-size: 16px; }
.footer a { display: block; color: #e2d3b2; margin-bottom: 6px; }
.footer a:hover { color: var(--gold-2); }
.footer p { margin: 0 0 8px; }
.footer .muted { color: #8f7f63; }
.footer-logo { height: 150px; width: auto; margin: -10px 0 6px; }
.copy { text-align: center; border-top: 1px solid #2c241a; padding: 14px; color: #8f7f63; font-size: 13px; }

/* ---------- Admin ---------- */
.admin-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.actions { display: flex; gap: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid-2, .grid-article, .grid-side, .grid-3, .cards { grid-template-columns: 1fr; }
  .footer-in { grid-template-columns: 1fr 1fr; }
  .hero { min-height: 72vh; background-image: url("../img/m-bg.jpg"); background-position: center 20%; }
  .hero-in { align-items: stretch; }
  body { padding-bottom: 58px; }
}
@media (max-width: 560px) {
  .stats, .row-2, .footer-in { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .panel { padding: 18px; }
  .section { padding: 40px 0; }
  .table th, .table td { padding: 8px; white-space: nowrap; }
}

/* ---------- Tinh nang nhan vat ---------- */
.char-card + .char-card, .char-card + .panel { margin-top: 18px; }
.char-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.char-head h3 { margin: 0 0 4px; font: 700 22px/1.2 "LacLongQuan", var(--serif); color: var(--red); }
.char-head p { margin: 0; font-size: 14px; }
.char-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.char-actions form { margin: 0; }
.char-btn {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px;
  border-radius: 10px; border: 1px solid var(--line); background: linear-gradient(#fffaf0, #f3e7cc); cursor: pointer;
  font: 600 14px var(--sans); color: var(--ink); transition: .2s;
}
.char-btn i { font-size: 22px; color: var(--gold); }
.char-btn:hover:not(:disabled) { border-color: var(--gold); box-shadow: 0 6px 16px rgba(120,80,20,.18); transform: translateY(-2px); }
.char-btn.danger i { color: var(--red); }
.char-btn.danger:hover:not(:disabled) { border-color: var(--red); }
.char-btn:disabled { opacity: .5; cursor: not-allowed; }
.char-help { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.8; }
@media (max-width: 760px) { .char-actions { grid-template-columns: 1fr 1fr; } }

/* ---------- Nap point bang chuyen khoan ---------- */
.pay-box { display: grid; grid-template-columns: 300px 1fr; gap: 26px; align-items: start; }
.pay-qr { text-align: center; }
.pay-qr img { width: 100%; height: auto; border-radius: 12px; background: #fff; border: 1px solid var(--line); box-shadow: 0 8px 20px rgba(80,50,10,.15); }
.pay-qr p { margin: 8px 0 0; font-size: 13px; }
.pay-amounts { display: flex; flex-wrap: wrap; gap: 8px; }
.pay-amounts button { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font: 600 14px var(--sans); color: var(--ink); transition: .15s; }
.pay-amounts button:hover { border-color: var(--gold); }
.pay-amounts button.on { background: linear-gradient(var(--gold-2), var(--gold)); border-color: #8c6420; color: #3a2508; }
.pay-rows { display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; margin: 16px 0 0; font-size: 15px; }
.pay-rows dt { color: var(--muted); }
.pay-rows dd { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pay-code { font: 700 20px var(--serif); color: var(--red); letter-spacing: .06em; padding: 2px 10px; border: 1px dashed var(--red); border-radius: 6px; background: #fff3ee; }
.gold { color: #a6731c; }
.copy { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 3px 8px; cursor: pointer; color: var(--muted); }
.copy:hover { color: var(--red); border-color: var(--gold); }
.pay-box + .panel { margin-top: 22px; }
@media (max-width: 760px) { .pay-box { grid-template-columns: 1fr; } .pay-qr { max-width: 280px; margin: 0 auto; } .pay-rows { grid-template-columns: 1fr; gap: 2px; } .pay-rows dd { margin-bottom: 8px; } }

/* ---------- Hieu nang khi cuon (main.js gan html.is-scrolling / .anim-off) ---------- */
/* lop gan sang co dinh: tach lop rieng de cuon trang khong phai ve lai */
.bg-veins { contain: strict; will-change: transform; }
/* dang cuon: tam dung cac hieu ung phai ve lai tung khung hinh (vet sang, vien xoay, nhip sang nut) */
html.is-scrolling .vs,
html.is-scrolling .server-card::before,
html.is-scrolling .sect-frame::before, html.is-scrolling .sect-frame::after,
html.is-scrolling .plaque-big svg { animation-play-state: paused; }
/* vung nam ngoai man hinh: dung het hieu ung ben trong */
.anim-off *, .anim-off *::before, .anim-off *::after { animation-play-state: paused !important; }
/* Lenis (cuon muot bang chuot) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* the may chu: trang thai + nhieu may chu (sua trong /quan-tri/may-chu) */
.srv-item + .srv-item { margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(232,189,98,.25); }
.srv-note { margin: -2px 0 8px; font-size: 11.5px; color: #c9b48e; }
.srv-status.st-new { color: #ffe3b0; background: rgba(214,60,40,.18); border-color: rgba(255,120,80,.5); }
.srv-status.st-new .srv-dot { background: #ff6a3d; animation-name: srv-ping-new; }
.srv-status.st-soon { color: #f6e2b0; background: rgba(232,189,98,.14); border-color: rgba(232,189,98,.45); }
.srv-status.st-soon .srv-dot { background: #f2c45a; animation: none; }
.srv-status.st-maint { color: #ffd9b8; background: rgba(230,130,40,.14); border-color: rgba(230,130,40,.45); }
.srv-status.st-maint .srv-dot { background: #e8892a; animation: none; }
.srv-status.st-closed { color: #cfc6b8; background: rgba(160,150,140,.12); border-color: rgba(160,150,140,.35); }
.srv-status.st-closed .srv-dot { background: #8a8278; animation: none; }
@keyframes srv-ping-new { 70% { box-shadow: 0 0 0 8px rgba(255,106,61,0); } 0% { box-shadow: 0 0 0 0 rgba(255,106,61,.7); } 100% { box-shadow: 0 0 0 0 rgba(255,106,61,0); } }
/* nhieu may chu: ten nho lai cho vua the */
.srv-many .srv-name { font-size: 20px; margin: 2px 0 6px; }
.srv-many .srv-status { margin-bottom: 4px; font-size: 11.5px; padding: 3px 10px; }
.srv-many .srv-kicker { margin-bottom: 8px; }
.srv-many .srv-invite { margin-top: 10px; }

/* khung Fanpage trang chu: dau trang Facebook + loi ich + nut */
.fb-head { display: block; width: 100%; height: 130px; border: 0; border-radius: 8px; background: #fff; margin-top: 12px; }
.fb-perks { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.fb-perks li { display: flex; gap: 12px; align-items: center; font-size: 14.5px; color: var(--muted); }
.fb-perks b { color: var(--ink); font-weight: 600; }
.fb-perks i { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #8c6420; background: #f5e9cf; border: 1px solid #e6d3a8; }
.fb-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.btn-fb { background: #1877f2; color: #fff; border-color: #1877f2; }
.btn-fb:hover { background: #0f63d1; color: #fff; }

/* nut tron chat Messenger goc phai duoi (mo m.me/<fanpage>) */
.msg-fab {
  position: fixed; right: 26px; bottom: 26px; z-index: 45; width: 60px; height: 60px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-size: 30px;
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, transparent 0), linear-gradient(45deg, #0099ff 0%, #a033ff 60%, #ff5280 90%, #ff7061 100%);
  box-shadow: 0 8px 22px rgba(80,40,160,.35), 0 0 0 3px rgba(255,255,255,.9);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), box-shadow .3s;
}
.msg-fab:hover { color: #fff; transform: translateY(-3px) scale(1.06); box-shadow: 0 12px 28px rgba(80,40,160,.45), 0 0 0 3px #fff; }
/* song lan toa nhe moi vai giay de khach de thay */
.msg-fab::before, .msg-fab::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; z-index: -1; pointer-events: none;
  background: linear-gradient(45deg, #0099ff, #a033ff, #ff5280); animation: msg-wave 3.2s ease-out infinite;
}
.msg-fab::after { animation-delay: 1.1s; }
@keyframes msg-wave { 0% { transform: scale(1); opacity: .45; } 70%, 100% { transform: scale(1.75); opacity: 0; } }
.msg-tip {
  position: absolute; right: calc(100% + 12px); top: 50%; transform: translate(6px, -50%); white-space: nowrap;
  padding: 7px 12px; border-radius: 8px; font: 600 13.5px/1 var(--sans); color: #fff; background: rgba(30,20,12,.92);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.msg-tip::after { content: ""; position: absolute; left: 100%; top: 50%; margin-top: -5px; border: 5px solid transparent; border-left-color: rgba(30,20,12,.92); }
.msg-fab:hover .msg-tip, .msg-fab:focus-visible .msg-tip { opacity: 1; transform: translate(0, -50%); }
html.is-scrolling .msg-fab::before, html.is-scrolling .msg-fab::after { animation-play-state: paused; }
@media (max-width: 960px) { .msg-fab { right: 14px; bottom: 72px; width: 52px; height: 52px; font-size: 26px; } .msg-tip { display: none; } }
@media (prefers-reduced-motion: reduce) { .msg-fab::before, .msg-fab::after { animation: none; opacity: 0; } }

/* ---------- Chat ho tro ngay tren web (assets/js/chat.js) ---------- */
.msg-fab { border: 0; cursor: pointer; font-size: 26px; background: linear-gradient(145deg, #e2452c, #a8261c 60%, #6d1209); box-shadow: 0 8px 22px rgba(120,30,10,.4), 0 0 0 3px #f2cf7a; }
.msg-fab:hover { box-shadow: 0 12px 28px rgba(120,30,10,.5), 0 0 0 3px #ffe3a0; }
.msg-fab::before, .msg-fab::after { background: radial-gradient(circle, rgba(242,207,122,.9), rgba(226,69,44,.6)); }
.msg-fab.open::before, .msg-fab.open::after { animation: none; opacity: 0; }
.msg-fab.open .msg-tip { display: none; }
.chat-badge { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center;
  font: 700 12px/1 var(--sans); color: #fff; background: #ff3b30; border: 2px solid #fff; }
.chat-box {
  position: fixed; right: 26px; bottom: 100px; z-index: 46; width: 360px; height: min(540px, calc(100vh - 140px));
  display: flex; flex-direction: column; overflow: hidden; border-radius: 18px; background: #fffaf0;
  box-shadow: 0 24px 60px rgba(40,20,5,.35), 0 0 0 1px rgba(201,154,59,.45);
  transform-origin: 100% 100%; animation: chat-in .32s cubic-bezier(.2,.9,.3,1.2);
}
.chat-box[hidden] { display: none; }
@keyframes chat-in { from { opacity: 0; transform: translateY(16px) scale(.94); } to { opacity: 1; transform: none; } }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; color: #f6e6c0; background: radial-gradient(120% 140% at 0 0, #6b1a10, #1e140d 70%); border-bottom: 1px solid rgba(242,207,122,.35); }
.chat-head img { width: 40px; height: 40px; flex: none; }
.chat-head div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-head b { font: 700 16px/1.2 var(--serif); color: #f2cf7a; }
.chat-head span { font-size: 12.5px; color: #d8c49c; display: flex; align-items: center; gap: 6px; }
.chat-head span i { width: 8px; height: 8px; border-radius: 50%; background: #e8a33a; }
.chat-head span.on i { background: #3ccf6e; box-shadow: 0 0 0 3px rgba(60,207,110,.25); }
.chat-x { border: 0; background: none; color: #f2cf7a; font-size: 20px; cursor: pointer; padding: 4px 6px; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: #f8f1e2 url("../img/paper.svg"); overscroll-behavior: contain; }
.cm { display: flex; flex-direction: column; max-width: 82%; }
.cm p { margin: 0; padding: 9px 12px; border-radius: 14px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.cm small { font-size: 11px; color: var(--muted); margin: 3px 6px 0; }
.cm-a { align-self: flex-start; }
.cm-a p { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; color: var(--ink); }
.cm-u { align-self: flex-end; align-items: flex-end; }
.cm-u p { background: linear-gradient(145deg, #c23a22, #8f1b0e); color: #fff; border-bottom-right-radius: 4px; }
.cm-u.pending p { opacity: .6; }
.chat-who { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 0; background: #fffaf0; border-top: 1px solid var(--line); }
.chat-who .input { padding: 8px 10px; font-size: 13.5px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; background: #fffaf0; border-top: 1px solid var(--line); }
.chat-who:not([hidden]) + .chat-form { border-top: 0; }
.chat-form textarea { flex: 1; resize: none; max-height: 110px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font: 14.5px/1.4 var(--sans); background: #fff; color: var(--ink); }
.chat-form textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,154,59,.2); }
.chat-send { flex: none; width: 42px; height: 42px; border: 0; border-radius: 50%; color: #fff; cursor: pointer; background: linear-gradient(145deg, #e2452c, #a8261c); font-size: 16px; }
.chat-send:disabled { opacity: .5; cursor: default; }
.chat-alt { display: block; padding: 8px 12px 10px; font-size: 12.5px; text-align: center; color: var(--muted); background: #fffaf0; }
.chat-alt:hover { color: #0a7cff; }
.chat-err { align-self: center; font-size: 12.5px; color: #a8261c; background: #fbe9e7; padding: 4px 10px; border-radius: 8px; }
@media (max-width: 960px) {
  .chat-box { right: 8px; left: 8px; bottom: 64px; width: auto; height: min(560px, calc(100dvh - 150px)); }
  .msg-fab.open { display: none; }
}
.chat-who[hidden], .chat-badge[hidden] { display: none; }

/* nut tron Messenger (bat trong /quan-tri/giao-dien), nam tren nut chat ho tro */
.fb-fab {
  position: fixed; right: 32px; bottom: 100px; z-index: 45; width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-size: 24px;
  background: linear-gradient(45deg, #0099ff, #a033ff 60%, #ff5280 90%, #ff7061);
  box-shadow: 0 6px 18px rgba(80,40,160,.35), 0 0 0 3px #fff;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.fb-fab:hover { color: #fff; transform: translateY(-3px) scale(1.06); }
.fb-fab:hover .msg-tip { opacity: 1; transform: translate(0, -50%); }
body:has(.chat-box:not([hidden])) .fb-fab { display: none; }
@media (max-width: 960px) { .fb-fab { right: 16px; bottom: 134px; width: 44px; height: 44px; font-size: 22px; } }
