/* Giao diện kiểu bảng trong game NRO: nền gỗ tối ấm, bảng giấy kem viền nâu sắc nét, nút cam nổi khối, ô xem trước cảnh trời + cỏ. */
:root {
  --page: #23150c;
  --wood: #341f12;
  --wood2: #482c1a;
  --paper: #f9eed4;
  --paper2: #eedbb2;
  --slot: #e4cc9c;
  --ink: #351e0f;
  --muted: #7a5a3a;
  --frame: #5c3618;
  --frame-hi: #fff8e6;
  --orange: #f08a1c;
  --orange-dk: #a85409;
  --gold: #b86e00;
  --red: #c2351b;
  --green: #3a8a24;
  --blue: #2d6db3;
  --sky: linear-gradient(180deg, #6cc0f2 0%, #bce7ff 74%);
  --grass: linear-gradient(180deg, #67c23f 0 7px, #3f8d2a 7px 11px, #8a5a2e 11px 100%);
  --radius: 10px;
  /* các tên cũ JS còn dùng */
  --card: var(--paper);
  --line: rgba(90, 53, 23, .25);
  --text: var(--ink);
  --bg2: #fffaf0;
  --cyan: var(--blue);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  color: var(--paper);
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--page);
  background-image:
    radial-gradient(ellipse 75% 420px at 50% 0%, rgba(240, 138, 28, .13), transparent 72%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .08) 0 2px, transparent 2px 48px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 180px);
}
a { color: inherit; text-decoration: none; }
.pixel, canvas { image-rendering: pixelated; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.gold { color: var(--gold); font-weight: 700; }
.grad-text { color: var(--orange); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; }

/* Bảng giấy (hộp thoại trong game) */
.panel, .sec-box, .tpl, .cat, .card, .stat, .step, .modal-box, .plan, .acc-row, .feat-pick label, .table-wrap, .cur, .cur-bar, .cta, .auth .panel {
  background: linear-gradient(180deg, #fcf4e1 0%, #f3e2be 100%);
  color: var(--ink);
  border: 2px solid var(--frame);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 2px var(--frame-hi), 0 4px 10px rgba(0, 0, 0, .34);
}
.panel { padding: 20px; }
.panel .muted, .card .muted, .tpl .muted, .modal-box .muted { color: var(--muted); }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  background: rgba(52, 31, 18, .96);
  backdrop-filter: blur(8px);
  border-bottom: 3px solid var(--orange-dk);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .45);
}
.top-in { display: flex; align-items: center; gap: 18px; height: 62px; }
.logo { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.logo-ball { width: 32px; height: 32px; image-rendering: auto; filter: drop-shadow(0 2px 4px rgba(240, 138, 28, .45)); }
.logo-text { font-weight: 900; font-size: 21px; letter-spacing: .5px; color: #fff4da; text-shadow: 0 2px 0 rgba(0, 0, 0, .4); }
.logo-text b { color: var(--orange); font-weight: 900; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { padding: 7px 13px; border-radius: 7px; font-weight: 600; color: #ead5af; white-space: nowrap; transition: background .15s, color .15s; }
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.nav a.on { color: #fff; background: var(--wood2); box-shadow: inset 0 -3px 0 var(--orange); }
.me { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.bal { display: flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 7px; background: #1c1009; border: 1px solid var(--orange-dk); font-weight: 800; color: #ffc861; }
.bal img { width: 18px; height: 18px; }
.burger { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.burger span { display: block; width: 22px; height: 3px; background: #f3dfb8; margin: 4px 0; border-radius: 2px; }

/* ---------- nút kiểu game ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px; border-radius: 7px; cursor: pointer; font-weight: 800; white-space: nowrap;
  border: 2px solid var(--frame); background: var(--paper2); color: var(--ink);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .14), 0 2px 4px rgba(0, 0, 0, .3);
  transition: filter .15s, transform .1s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .14); }
.btn-main { background: linear-gradient(180deg, #f79d2d 0%, #e47a0e 100%); color: #fff; text-shadow: 0 1px 0 var(--orange-dk); border-color: var(--orange-dk); }
.btn-cool { background: linear-gradient(180deg, #3c84d1 0%, #275e9c 100%); color: #fff; border-color: #19406e; }
.btn-ghost { background: var(--paper2); }
.top .btn-ghost { background: var(--wood2); color: #f3dfb8; border-color: #1d110a; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-red { background: var(--red); color: #fff; border-color: #6d1a0b; }
.btn-green { background: var(--green); color: #fff; border-color: #1e4d12; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- hero: cảnh map game 2 cột gọn gàng, không che nhân vật ---------- */
.hero {
  position: relative;
  margin: 20px 0 10px;
  border: 3px solid var(--frame);
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, #56b2ee 0%, #9ad9ff 58%, #cbeeff 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 248, 230, .45), 0 10px 26px rgba(0, 0, 0, .48);
}
.hero .stage-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  image-rendering: pixelated;
  pointer-events: none;
}
.hero-in {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(320px, 470px) 1fr;
  align-items: end;
  gap: 20px;
  min-height: 410px;
  padding: 24px 28px 0;
}
.talk {
  position: relative;
  align-self: center;
  margin: 12px 0 28px;
  padding: 20px 22px;
  background: linear-gradient(180deg, rgba(253, 245, 226, .97) 0%, rgba(244, 227, 190, .97) 100%);
  box-shadow: inset 0 0 0 2px var(--frame-hi), 0 10px 24px rgba(30, 14, 4, .38);
}
.talk h1 { font-size: clamp(22px, 3vw, 31px); font-weight: 900; color: var(--ink); letter-spacing: -.3px; }
.talk p { margin: 0 0 16px; color: #56391e; font-size: 14.5px; }
.talk .who {
  display: inline-block;
  margin: -34px 0 8px -6px;
  padding: 3px 12px;
  background: linear-gradient(180deg, #f79d2d, #e0760c);
  color: #fff;
  border: 2px solid var(--orange-dk);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}
.hero-cta { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-stage {
  display: flex;
  align-items: flex-end;
  justify-content: space-evenly;
  gap: 2px;
  padding-bottom: 102px;
  min-height: 350px;
  pointer-events: none;
}
.hero-stage .hero-npc {
  width: 112px;
  height: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .35));
}
.hero-stage .hero-char {
  width: 148px;
  height: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .38));
}

/* ---------- section ---------- */
.sec { padding: 24px 0; }
.sec-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.sec-h h2 {
  font-size: 22px; font-weight: 900; color: #fff3d6; margin: 0;
  padding-left: 36px;
  background: url(/img/nro/icon/422?s=4) left center / 28px no-repeat;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
}
.sec-h h2 small { display: block; font-size: 13px; font-weight: 500; color: #ccb089; margin-top: 2px; text-shadow: none; }
main > .sec > .muted, #res > .muted { color: #ccb089; }

.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 12px; }
.cat { display: block; padding: 8px; transition: transform .16s, border-color .16s, box-shadow .16s; }
.cat:hover { transform: translateY(-3px); border-color: var(--orange); box-shadow: inset 0 0 0 2px #fff9ea, 0 8px 18px rgba(0, 0, 0, .4); }
.cat-prev {
  height: 100px; border-radius: 6px; overflow: hidden; display: grid; place-items: center;
  background: var(--grass) bottom / 100% 14px no-repeat, var(--sky);
  border: 1px solid rgba(90, 53, 23, .45);
  position: relative;
}
.cat-prev img.fit { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.cat-prev img.icon { width: 52px; height: 52px; object-fit: contain; }
.cat-prev canvas { width: 100%; height: 100%; object-fit: contain; }
.cat-prev .code-thumb { background: transparent; padding: 0; }
.cat-prev .code-thumb canvas { width: 72px; height: auto; }
.cat-prev .code-thumb .ctype, .cat-prev .code-thumb .cdemo { display: none; }
.cat b { display: block; margin-top: 7px; font-size: 15px; }
.cat span { color: var(--muted); font-size: 12px; }
.cat.svc { cursor: pointer; padding: 12px; }
.cat.svc.on { background: linear-gradient(180deg, #ffebc0 0%, #ffd98d 100%); border-color: var(--orange-dk); }

/* ---------- ô sản phẩm ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.card { position: relative; display: flex; flex-direction: column; overflow: hidden; transition: transform .16s, border-color .16s, box-shadow .16s; }
.card:hover { transform: translateY(-4px); border-color: var(--orange); box-shadow: inset 0 0 0 2px #fff9ea, 0 10px 22px rgba(0, 0, 0, .45); }
.thumb {
  position: relative; height: 176px; display: grid; place-items: center; overflow: hidden;
  margin: 7px 7px 0; border-radius: 6px; border: 1px solid rgba(90, 53, 23, .45);
  background: var(--grass) bottom / 100% 20px no-repeat, var(--sky);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .12);
}
.thumb img.fit { width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform .25s ease; }
.card:hover .thumb img.fit { transform: scale(1.04); }
.thumb img.icon { width: 64px; height: 64px; object-fit: contain; }
.thumb canvas { max-width: 100%; max-height: 100%; }
.thumb img.spine, .cat-prev img.spine { width: 100%; height: 100%; object-fit: contain; padding: 6px; background: radial-gradient(circle at center, #383850 0%, #202030 100%); }
.card-b { padding: 9px 11px 11px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-b h3 { font-size: 14.5px; font-weight: 700; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { display: flex; align-items: baseline; gap: 6px; margin-top: auto; padding-top: 4px; }
.price b { font-size: 17px; font-weight: 900; color: var(--red); }
.price s { color: var(--muted); font-size: 12px; }
.badges { position: absolute; left: 8px; top: 8px; display: flex; gap: 4px; z-index: 2; flex-wrap: wrap; max-width: calc(100% - 16px); }
.bd { font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, .35); background: var(--paper2); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.bd-vip { background: #ffcf3a; color: #5a3200; border-color: #8a5200; }
.bd-qua { background: var(--green); color: #fff; border-color: #1e4d12; }
.bd-hot { background: var(--red); color: #fff; border-color: #6d1a0b; }
.bd-combo { background: #fff; color: var(--ink); }
.bd-own { background: #d6f0c6; color: #1e4d12; border-color: #3d8b26; }
.bd-loi { background: var(--red); color: #fff; }
.game-chip {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .25px;
  padding: 1px 7px;
  border-radius: 4px;
  background: rgba(92, 54, 24, .13);
  color: var(--frame);
}
.sold { font-size: 11.5px; color: var(--muted); }
.card-meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }

/* ---------- bộ lọc ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 6px 12px; border-radius: 7px; background: var(--wood2); border: 1px solid #1d110a; color: #ecd6ae; font-weight: 600; font-size: 13px; cursor: pointer; transition: background .15s, color .15s; }
.chip:hover { color: #fff; background: #5a3822; }
.chip.on { background: var(--orange); color: #fff; border-color: var(--orange-dk); }
.chip .muted, .chip small { color: inherit; opacity: .75; }
.panel .chip, .viewer-bar .chip, .modal-box .chip { background: var(--paper2); color: var(--ink); border-color: rgba(90, 53, 23, .45); }
.panel .chip.on, .viewer-bar .chip.on { background: var(--orange); color: #fff; }
.input, select.input, textarea.input { background: var(--bg2); color: var(--ink); border: 2px solid var(--frame); border-radius: 7px; padding: 8px 12px; outline: none; min-width: 0; }
.input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(240, 138, 28, .2); }
.search { flex: 1; min-width: 200px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 22px 0; flex-wrap: wrap; color: #ecd6ae; }

/* ---------- chi tiết ---------- */
.detail { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; padding: 22px 0; }
.viewer {
  position: relative; border-radius: 12px; overflow: hidden; min-height: 380px;
  display: grid; place-items: center; border: 3px solid var(--frame);
  background: var(--grass) bottom / 100% 66px no-repeat, var(--sky);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .4);
}
.viewer canvas { max-width: 100%; }
.viewer canvas.spine-canvas { width: 100%; height: 390px; display: block; image-rendering: auto; }
.viewer img.big { width: 100%; max-height: 520px; object-fit: contain; padding: 10px; }
.viewer-bar { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; z-index: 4; }
.wm-overlay {
  position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='110'%3E%3Ctext x='50%25' y='55%25' text-anchor='middle' font-family='Arial Black,Arial' font-size='20' fill='white' fill-opacity='0.28' stroke='black' stroke-opacity='0.22' stroke-width='1' transform='rotate(-20 130 55)'%3Eshopresnro.online%3C/text%3E%3C/svg%3E");
  background-repeat: repeat;
}
.review-box { width: 100%; padding: 14px 14px 54px; display: grid; gap: 10px; align-self: start; }
.review-video { width: 100%; max-height: 360px; border-radius: 8px; background: #000; border: 2px solid var(--frame); display: block; }
.review-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.review-imgs img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 6px; border: 2px solid var(--frame); cursor: zoom-in; background: #1a120b; }
.bd-vid { background: #6b2fb5; color: #fff; border-color: #3d1470; }
.disc-pill {
  position: absolute; right: 7px; top: 7px; z-index: 2;
  background: linear-gradient(180deg, #e84325, #b5240d);
  color: #fff; font-size: 11px; font-weight: 900;
  padding: 2px 6px; border-radius: 5px;
  border: 1px solid #6d1406;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}
/* Cải trang Spine trên thẻ shop: thở nhẹ 60fps */
.thumb img.spine { animation: spineBreath 3.2s ease-in-out infinite; transform-origin: center bottom; }
@keyframes spineBreath { 0%, 100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(-3px) scaleY(1.022); } }
.panel h1 { font-size: 24px; font-weight: 900; }
.big-price { font-size: 30px; font-weight: 900; color: var(--red); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; font-size: 14px; margin: 12px 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.guide { margin: 10px 0 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); padding: 8px 12px; font-size: 14px; }
.guide summary { cursor: pointer; font-weight: 800; color: var(--gold); }
.guide h4 { margin: 10px 0 4px; font-size: 14px; }
.guide ul { margin: 0; padding-left: 18px; }
.guide li { margin: 3px 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 6px; padding: 14px; max-height: 520px; overflow: auto; width: 100%; align-self: start; background: var(--paper); }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--slot); border-radius: 4px; padding: 4px; }
.map-scroll { width: 100%; overflow: auto; max-height: 520px; }

/* ---------- thuê server & tool ---------- */
.tpl { display: grid; grid-template-columns: 240px 1fr; gap: 22px; padding: 20px; margin-bottom: 16px; align-items: start; }
.tpl > * { min-width: 0; }
.tpl-art {
  border-radius: 8px; min-height: 250px; display: grid; place-items: end center;
  padding-bottom: 18px; position: relative; overflow: hidden; border: 2px solid var(--frame);
  background: var(--grass) bottom / 100% 34px no-repeat, var(--sky);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .14);
}
.tpl-art canvas, .tpl-art img { max-width: 100%; height: auto; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .28)); }
.tpl-art .stage-tag { position: absolute; left: 8px; top: 8px; }
.stage-tag { padding: 1px 8px; border-radius: 4px; background: var(--orange); color: #fff; border: 2px solid var(--orange-dk); font-size: 12px; font-weight: 800; }
.feat { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 5px; margin: 10px 0 14px; padding: 0; list-style: none; }
.feat li { padding-left: 20px; position: relative; }
.feat li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 9px; height: 9px; background: var(--orange); border: 1px solid var(--orange-dk); transform: rotate(45deg); }
.plans { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.plan { cursor: pointer; padding: 8px 14px; min-width: 104px; transition: border-color .15s, background .15s; }
.plan b { display: block; font-size: 15px; }
.plan span { font-size: 13px; color: var(--red); font-weight: 800; }
.plan.on { background: linear-gradient(180deg, #ffebc0 0%, #ffd98d 100%); border-color: var(--orange-dk); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 6px 0 20px; }
.step { padding: 14px; }
.step i { font-style: normal; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 5px; background: var(--orange); color: #fff; border: 2px solid var(--orange-dk); font-weight: 900; margin-bottom: 6px; }
.step p { margin: 4px 0 0; }

.rent-box { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.acc { display: grid; gap: 6px; }
.acc-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; font-family: ui-monospace, Consolas, monospace; }
.acc-row .copy { cursor: pointer; color: var(--blue); font-family: "Be Vietnam Pro"; font-size: 13px; font-weight: 700; }
.ip { font-size: 26px; font-weight: 900; font-family: ui-monospace, Consolas, monospace; }
.count { font-size: 30px; font-weight: 900; font-variant-numeric: tabular-nums; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 5px; font-weight: 800; font-size: 13px; border: 1px solid currentColor; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st-running { color: var(--green); }
.st-starting, .st-creating { color: var(--gold); }
.st-expired, .st-stopped { color: var(--muted); }
.st-error { color: var(--red); }
.cmd { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; }
.cmd code { color: #7a2a00; background: var(--slot); padding: 1px 6px; border-radius: 4px; white-space: nowrap; }

/* ---------- bảng / admin ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid rgba(90, 53, 23, .2); vertical-align: middle; }
th { background: var(--paper2); font-size: 12px; text-transform: uppercase; color: var(--muted); }
td img.mini { width: 36px; height: 36px; object-fit: contain; border-radius: 4px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { padding: 14px; }
.stat b { display: block; font-size: 22px; font-weight: 900; }
.stat span { color: var(--muted); font-size: 13px; }

/* ---------- form ---------- */
.auth { max-width: 420px; margin: 40px auto; }
.field { display: grid; gap: 4px; margin-bottom: 12px; }
.field label { font-weight: 700; font-size: 14px; }
.hint { font-size: 13px; color: var(--muted); }
.qr { width: 100%; max-width: 300px; border-radius: 8px; background: #fff; padding: 8px; border: 2px solid var(--frame); }

/* ---------- tool ---------- */
.feat-pick { display: grid; gap: 6px; margin: 8px 0 12px; }
.feat-pick label { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; cursor: pointer; }
.feat-pick input { accent-color: var(--orange); width: 18px; height: 18px; }
.lkey { font-family: ui-monospace, Consolas, monospace; font-weight: 800; color: var(--red); font-size: 16px; }

/* ---------- toast + modal ---------- */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 120px); background: var(--paper); color: var(--ink); border: 2px solid var(--frame); padding: 10px 18px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0, 0, 0, .4); transition: transform .25s; z-index: 100; font-weight: 700; max-width: calc(100% - 32px); }
.toast.show { transform: translate(-50%, 0); }
.toast.err { border-color: var(--red); color: var(--red); }
.modal { position: fixed; inset: 0; background: rgba(20, 10, 4, .72); display: grid; place-items: center; z-index: 90; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { padding: 20px; width: 100%; max-width: 460px; max-height: 90vh; overflow: auto; }

.empty { text-align: center; padding: 40px 16px; color: #ccb089; }
.empty img { width: 56px; }
.loading { display: grid; place-items: center; padding: 50px; }
.loading img { width: 38px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Ô dịch vụ nổi bật trang chủ */
.cta-band { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; }
.cta { position: relative; overflow: hidden; padding: 0 0 16px; min-height: 186px; display: flex; flex-direction: column; gap: 8px; transition: transform .16s, border-color .16s; }
.cta:hover { transform: translateY(-3px); border-color: var(--orange); }
.cta h3 {
  margin: 0 0 4px; padding: 8px 14px;
  background: linear-gradient(180deg, #f59b2c 0%, #de770d 100%);
  color: #fff; font-size: 16px; font-weight: 900;
  border-bottom: 2px solid var(--orange-dk);
  text-shadow: 0 1px 0 var(--orange-dk);
}
.cta p { margin: 0 14px 6px; max-width: 68%; font-size: 14px; color: #54371d; }
.cta .btn { margin-left: 14px; margin-top: auto; }
.cta canvas, .cta .cta-img { position: absolute; right: 10px; bottom: 6px; width: 104px; height: auto; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .25)); }

/* Footer */
.foot {
  margin-top: 38px; padding: 22px 0;
  background: linear-gradient(180deg, #321d11 0%, #24140b 100%);
  border-top: 3px solid var(--orange-dk);
  color: #d9c19a;
}
.foot-in { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; }
.foot .muted { color: #b89b74; margin: 4px 0 0; font-size: 14px; }
.foot-balls {
  display: flex; gap: 6px; padding: 8px 14px; border-radius: 999px;
  background: rgba(0, 0, 0, .24); border: 1px solid rgba(240, 138, 28, .28);
}
.foot-balls img { width: 28px; height: 28px; image-rendering: auto; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .4)); }
.foot-npc-wrap {
  width: 84px; height: 84px; border-radius: 12px;
  background: var(--grass) bottom / 100% 14px no-repeat, var(--sky);
  border: 2px solid var(--orange-dk);
  display: grid; place-items: end center; overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .4);
}
.foot-npc { width: 76px; height: auto; }

/* Admin → Lọc res */
.cur-bar { position: sticky; top: 64px; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px; margin: 8px 0; }
.cur-bar input { width: 90px; }
.cur-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.cur { cursor: pointer; padding: 4px; font-size: 11px; display: flex; flex-direction: column; }
.cur canvas, .cur img { width: 100%; height: 110px; object-fit: contain; background: var(--sky); border-radius: 4px; }
.cur b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cur.on { background: #ffd68a; border-color: var(--red); }
.cur .bd { position: static; font-style: normal; }
.gift-note { padding: 10px 12px; margin-bottom: 10px; border-radius: 7px; background: #dff2cf; border: 2px solid var(--green); font-size: 14px; color: #1c4412; }

/* Chợ header NPC */
.shop-h { position: relative; }
.shop-npc {
  width: 78px; height: auto;
  background: var(--grass) bottom / 100% 12px no-repeat, var(--sky);
  border: 2px solid var(--frame);
  border-radius: 10px;
  padding: 2px 4px 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .35);
}

/* Chức năng code: NPC minh hoạ + nhãn loại */
.code-thumb { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 16px; background: var(--grass) bottom / 100% 18px no-repeat, var(--sky); color: var(--ink); position: relative; }
.code-thumb canvas { width: 96px; height: auto; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .25)); }
.ctype { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, .35); }
.code-thumb .ctype { position: absolute; left: 6px; bottom: 22px; }
.ctype-sv { background: #2f6fb5; color: #fff; }
.ctype-cl { background: #8a3fb5; color: #fff; }
.cdemo { position: absolute; right: 6px; bottom: 22px; font-size: 10px; font-weight: 800; background: var(--green); color: #fff; padding: 1px 6px; border-radius: 4px; }
.mech { margin: 0; padding-left: 18px; font-weight: 500; }
.mech li { margin-bottom: 3px; }
.icon-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 10px; width: 100%; height: 100%; align-content: center; }
.icon-grid img { width: 100%; height: 52px; object-fit: contain; background: rgba(255, 255, 255, .55); border: 1px solid rgba(90, 53, 23, .35); border-radius: 4px; padding: 3px; }
.big-icons { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }

/* Trang Dịch vụ */
.svc-hero { display: grid; grid-template-columns: 140px 1fr; gap: 18px; align-items: center; margin-bottom: 16px; }
.svc-hero canvas { width: 130px; height: auto; background: var(--grass) bottom / 100% 14px no-repeat, var(--sky); border: 2px solid var(--frame); border-radius: 8px; }
.svc-hero h2 { margin: 4px 0 8px; font-size: 22px; }
.svc-hero p { margin: 0 0 8px; }
.svc-hero .who, .dv-side .who { display: inline-block; padding: 2px 9px; background: var(--orange); color: #fff; border: 2px solid var(--orange-dk); border-radius: 5px; font-size: 12px; font-weight: 800; }
.dv-grid { display: grid; grid-template-columns: 1.45fr .85fr; gap: 18px; align-items: start; margin-top: 18px; }
.dv-npc-box { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.dv-npc-box canvas { width: 88px; height: auto; flex-shrink: 0; background: var(--grass) bottom / 100% 12px no-repeat, var(--sky); border: 2px solid var(--frame); border-radius: 8px; }
.dv-npc-box h3 { margin: 4px 0 0; font-size: 18px; }
.dv-steps { margin: 0; padding-left: 18px; display: grid; gap: 10px; font-size: 14px; color: #54371d; }
.dv-steps li b { color: var(--ink); }

/* Trang trí 7 viên ngọc rồng 2 lề màn hình siêu rộng – cách hẳn khỏi nội dung */
.side-deco { display: none; }
@media (min-width: 1460px) {
  .side-deco { display: block; position: fixed; inset: 64px 0 0; pointer-events: none; z-index: 0; }
  main, .foot, .top { position: relative; z-index: 1; }
  .ball {
    position: absolute; width: 34px; height: 34px;
    animation: bob 5.5s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(255, 168, 38, .45));
    opacity: .9;
  }
  .b1 { left: 26px; top: 8%; }
  .b2 { left: 56px; top: 24%; animation-delay: -1.1s; }
  .b3 { left: 24px; top: 41%; animation-delay: -2.2s; }
  .b4 { right: 26px; top: 9%; animation-delay: -1.6s; }
  .b5 { right: 56px; top: 26%; animation-delay: -2.7s; }
  .b6 { right: 24px; top: 43%; animation-delay: -.6s; }
  .b7 { left: 48px; top: 76%; animation-delay: -3.2s; width: 38px; height: 38px; }
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

.viewer p { color: var(--ink); background: rgba(255, 248, 232, .88); padding: 6px 10px; border-radius: 6px; display: inline-block; }
.fgroup { margin: 12px 0 4px; font-size: 14px; color: var(--orange-dk); }

.btn-guide { display: block; width: 100%; margin: 10px 0 14px; padding: 12px 14px; font-size: 16px; font-weight: 800; color: #3a2108; background: linear-gradient(180deg, #ffe08a, #f0b43c); border: 2px solid #b5761f; border-radius: 8px; cursor: pointer; animation: guidePulse 2.4s ease-in-out infinite; white-space: normal; text-align: center; line-height: 1.35; }
.btn-guide:hover { filter: brightness(1.06); }
@keyframes guidePulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(240, 180, 60, .55); } 50% { box-shadow: 0 0 0 7px rgba(240, 180, 60, 0); } }
.guide-ask { margin: -6px 0 14px; padding: 10px 12px; border: 1px dashed var(--gold); border-radius: 8px; background: var(--paper); font-size: 14px; }
.guide-ask span { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.guide-modal { max-height: 60vh; overflow: auto; margin-bottom: 14px; }
.guide-modal h4 { margin: 12px 0 4px; color: var(--gold); }

.excl { display: grid; gap: 6px; margin-top: 12px; padding: 12px; border: 2px dashed var(--blue); border-radius: 8px; background: #e6f0fb; }
.excl b { color: var(--blue); font-size: 16px; }
.excl span { font-size: 13px; color: var(--muted); }
.excl .btn { justify-self: start; }

/* Thông báo nổi đầu web + biểu đồ Admin */
.top-banner { background: linear-gradient(90deg, #5c2e0a, #b85e0b, #5c2e0a); color: #fff8e6; text-align: center; padding: 7px 14px; font-size: 13.5px; font-weight: 700; border-bottom: 2px solid var(--orange-dk); }
.chart-7d { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 150px; padding: 14px 10px 6px; background: rgba(90, 53, 23, .08); border-radius: 8px; margin-top: 10px; }
.chart-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.chart-bars { display: flex; gap: 3px; align-items: flex-end; height: 100px; width: 100%; justify-content: center; }
.chart-bar { width: 14px; border-radius: 4px 4px 0 0; min-height: 3px; transition: height .3s; }
.chart-bar.rev { background: linear-gradient(180deg, #f79d2d, #d96b08); }
.chart-bar.top { background: linear-gradient(180deg, #4cb830, #2c7a1a); }
.chart-col small { font-size: 11px; color: var(--muted); font-weight: 700; }

/* ---------- Banner Carousel 3 thẻ nổi bật ---------- */
.promo-sec { margin: 18px 0 6px; position: relative; }
.promo-stage { position: relative; height: 350px; overflow: hidden; border-radius: 14px; }
.promo-slide {
  position: absolute; top: 10px; left: 50%; width: min(690px, 92%); height: 326px;
  border-radius: 14px; overflow: hidden; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 18px 28px;
  background: #140b06; color: #fff; text-decoration: none;
  transition: transform .52s cubic-bezier(.22, 1, .36, 1), opacity .52s, filter .52s, box-shadow .52s;
  user-select: none;
}
.promo-slide img.promo-bg {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  image-rendering: auto; pointer-events: none; transition: transform .6s ease;
}
.promo-slide[data-pos="center"]:hover img.promo-bg { transform: scale(1.03); }
.promo-slide::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 75% 85% at 50% 50%, rgba(12, 7, 4, .74) 0%, rgba(12, 7, 4, .42) 62%, rgba(12, 7, 4, .18) 100%);
}
.promo-slide[data-pos="center"] {
  transform: translateX(-50%) scale(1); z-index: 3; opacity: 1; filter: none;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .65), 0 0 0 2px rgba(255, 190, 68, .72);
}
.promo-slide[data-pos="prev"] {
  transform: translateX(-114%) scale(.84); z-index: 2; opacity: .78;
  filter: brightness(.52) saturate(.88); cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
}
.promo-slide[data-pos="next"] {
  transform: translateX(14%) scale(.84); z-index: 2; opacity: .78;
  filter: brightness(.52) saturate(.88); cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
}
.promo-slide[data-pos="prev"]:hover, .promo-slide[data-pos="next"]:hover {
  opacity: .92; filter: brightness(.72);
}
.promo-content { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 540px; }
.promo-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 900; letter-spacing: .5px; text-transform: uppercase;
  background: linear-gradient(180deg, rgba(255, 196, 61, .95), rgba(224, 118, 12, .95));
  color: #2b1200; border: 1.5px solid #fff3c4; box-shadow: 0 3px 12px rgba(240, 138, 28, .45);
}
.promo-badge.zalo {
  background: linear-gradient(180deg, #1b9bff, #0068ff);
  color: #fff; border-color: #9bd4ff; box-shadow: 0 3px 14px rgba(0, 118, 255, .55);
}
.promo-title {
  margin: 0; font-size: clamp(20px, 2.7vw, 31px); font-weight: 900; line-height: 1.12;
  letter-spacing: .3px; text-transform: uppercase;
  background: linear-gradient(180deg, #fffdf4 15%, #ffd257 62%, #ff8b14 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .92));
}
.promo-sub {
  display: inline-block; padding: 3px 12px; border-radius: 6px;
  background: rgba(18, 36, 78, .82); border: 1px solid rgba(110, 185, 255, .45);
  color: #e8f4ff; font-size: 12px; font-weight: 800; letter-spacing: .4px;
}
.promo-list {
  display: flex; flex-direction: column; gap: 4px; margin: 2px 0 4px; width: 100%; max-width: 400px;
}
.promo-list span {
  background: rgba(14, 10, 8, .72); border: 1px solid rgba(255, 206, 115, .32);
  border-radius: 7px; padding: 4px 12px; font-size: 12.5px; font-weight: 600; color: #fff6e5;
  backdrop-filter: blur(4px);
}
.promo-cta {
  position: relative; overflow: hidden; margin-top: 2px;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 24px; border-radius: 999px; font-size: 14px; font-weight: 900;
  text-transform: uppercase; letter-spacing: .4px; color: #fff;
  background: linear-gradient(180deg, #ffb436 0%, #ef7b0c 55%, #bf4f00 100%);
  border: 2px solid #ffe8a3;
  box-shadow: 0 5px 18px rgba(240, 120, 12, .55), inset 0 1px 0 rgba(255, 255, 255, .6);
  text-shadow: 0 1px 2px rgba(90, 32, 0, .9);
  transition: transform .16s, filter .16s;
}
.promo-slide[data-pos="center"]:hover .promo-cta { transform: scale(1.05); filter: brightness(1.08); }
.promo-cta::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 45%; height: 100%;
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, .42), transparent);
  animation: promoShine 3.2s ease-in-out infinite;
}
@keyframes promoShine { 0%, 62% { left: -60%; } 100% { left: 130%; } }
.promo-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  background: rgba(34, 20, 11, .78); color: #ffe3a8; border: 1.5px solid rgba(255, 186, 66, .55);
  display: grid; place-items: center; font-size: 20px; font-weight: 900; line-height: 1;
  transition: background .15s, transform .15s;
}
.promo-nav:hover { background: var(--orange); color: #fff; transform: translateY(-50%) scale(1.08); }
.promo-nav.prev { left: 10px; }
.promo-nav.next { right: 10px; }
.promo-dots { display: flex; justify-content: center; gap: 7px; margin-top: 8px; }
.promo-dot {
  width: 9px; height: 9px; border-radius: 999px; border: 0; padding: 0; cursor: pointer;
  background: rgba(249, 238, 212, .3); transition: width .25s, background .25s;
}
.promo-dot.on { width: 26px; background: var(--orange); box-shadow: 0 0 8px rgba(240, 138, 28, .65); }

/* ---------- Nút liên hệ Zalo nổi (ẩn SĐT) ---------- */
.zalo-fab {
  position: fixed; right: 20px; bottom: 22px; z-index: 65;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 16px 9px 11px; border-radius: 999px;
  background: linear-gradient(135deg, #0091ff 0%, #0064e0 100%);
  color: #fff; font-weight: 800; font-size: 14px; letter-spacing: .2px;
  border: 2px solid rgba(255, 255, 255, .85);
  box-shadow: 0 8px 24px rgba(0, 104, 255, .48), 0 2px 6px rgba(0, 0, 0, .35);
  transition: transform .18s ease, box-shadow .18s ease;
  animation: zaloPulse 2.6s ease-in-out infinite;
}
.zalo-fab:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 12px 28px rgba(0, 118, 255, .62), 0 3px 10px rgba(0, 0, 0, .4);
}
.zalo-fab-ico {
  width: 32px; height: 32px; border-radius: 50%; background: #fff; color: #0068ff;
  display: grid; place-items: center; flex-shrink: 0; font-weight: 900; font-size: 12px;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .12);
}
.zalo-fab-txt { display: flex; flex-direction: column; line-height: 1.15; }
.zalo-fab-txt small { font-size: 10.5px; font-weight: 600; opacity: .9; }
@keyframes zaloPulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(0, 104, 255, .45), 0 0 0 0 rgba(0, 145, 255, .55); }
  55% { box-shadow: 0 8px 24px rgba(0, 104, 255, .45), 0 0 0 12px rgba(0, 145, 255, 0); }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .nav a { padding: 7px 8px; font-size: 14px; }
  .top-in { gap: 10px; }
  .hero-stage .hero-char { width: 126px; }
  .hero-stage .hero-npc { width: 96px; }
}
@media (max-width: 960px) {
  .detail, .rent-box, .tpl, .dv-grid { grid-template-columns: 1fr; }
  .hero-in { grid-template-columns: 1fr; padding: 20px 18px 0; min-height: auto; }
  .talk { margin: 14px 0 6px; }
  .hero-stage { min-height: 230px; padding-bottom: 72px; }
}
@media (max-width: 820px) {
  .burger { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 65px; flex-direction: column; background: var(--wood); padding: 8px 16px 14px; border-bottom: 3px solid var(--orange-dk); }
  .nav.open { display: flex; }
  .me .uname, .me .hide-sm { display: none; }
  .logo-text { font-size: 18px; }
  .me { margin-left: auto; }
  .shop-npc { width: 64px; }
}
@media (min-width: 821px) { .nav .only-sm { display: none; } }
@media (max-width: 600px) {
  .svc-hero { grid-template-columns: 1fr; }
  .svc-hero canvas { width: 100px; }
  .hero-stage .hero-npc { display: none; }
  .hero-stage .hero-char { width: 110px; }
}
@media (max-width: 520px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .thumb { height: 136px; }
  .price b { font-size: 15px; }
  .ip { font-size: 20px; }
  .cta p { max-width: 100%; }
  .cta canvas, .cta .cta-img { display: none; }
  .foot-npc-wrap { display: none; }
  .tpl { padding: 12px; gap: 12px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dt { margin-top: 6px; font-size: 13px; }
  .btn-guide { font-size: 15px; padding: 11px 10px; }
  .plans { display: grid; grid-template-columns: 1fr 1fr; }
  .plan { min-width: 0; }
  .promo-stage { height: 260px; }
  .promo-slide { height: 244px; width: 96%; padding: 12px 14px; }
  .promo-slide[data-pos="prev"], .promo-slide[data-pos="next"] { opacity: 0; pointer-events: none; }
  .promo-list span { font-size: 11px; padding: 3px 8px; }
  .promo-cta { font-size: 12px; padding: 7px 16px; }
  .zalo-fab { right: 12px; bottom: 14px; padding: 8px; }
  .zalo-fab-txt { display: none; }
}
