/* Trang chu Nhan Gia Online. Font tieu de UTM Cafeta lay tu client (Assets/Font). */
@font-face {
  font-family: "Cafeta";
  src: url("assets/fonts/utm-cafeta.ttf") format("truetype");
  font-display: swap;
  /* bo U+2013/2014: font nay ve dau gach dai thanh bang thong bao UTM */
  unicode-range: U+0000-2012, U+2015-FFFF;
}

:root {
  --ink: #140f1c;
  --ink-2: #21172a;
  --ink-3: #2f2138;
  --night-text: #f6ead2;
  --night-mute: #c9b79a;
  --paper: #f3e5c6;
  --paper-2: #e9d4a6;
  --paper-3: #dcc08a;
  --brown: #3b2414;
  --brown-2: #5d3b22;
  --brown-mute: #6f4f33;
  --gold: #e7b24a;
  --gold-hi: #ffdd85;
  --gold-lo: #94631f;
  --red: #c42a1f;
  --red-hi: #c93421;
  --red-lo: #7a120d;
  --jade: #5fd38d;
  --f-brush: "Pattaya", "Cafeta", serif;
  --f-display: "Cafeta", "Roboto", system-ui, sans-serif;
  --f-body: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --rail: 0px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 16px/1.6 var(--f-body);
  color: var(--brown);
  background: var(--ink);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
::selection { background: var(--gold); color: var(--ink); }
:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 3px; border-radius: 4px; }
.paper :focus-visible, .scroll-card :focus-visible { outline-color: var(--red); }
html { scrollbar-color: var(--gold-lo) var(--ink); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: var(--gold-lo); border: 2px solid var(--ink); border-radius: 6px; }

.wrap { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }
.skip {
  position: fixed; left: 16px; top: -60px; z-index: 100; padding: 10px 16px;
  background: var(--gold); color: var(--ink); font-weight: 700; border-radius: 6px; text-decoration: none;
}
.skip:focus { top: 16px; }

svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- nut ---------- */
.btn {
  --b1: var(--red-hi); --b2: var(--red); --b3: var(--red-lo);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 26px;
  font: 400 21px/1 var(--f-display); letter-spacing: .01em; color: #fff8e6; text-decoration: none;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .45);
  background: linear-gradient(180deg, var(--b1) 0%, var(--b2) 55%, var(--b3) 100%);
  border: 2px solid var(--gold);
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 236, 190, .55), inset 0 -3px 0 rgba(0, 0, 0, .25), 0 6px 14px -6px rgba(0, 0, 0, .7);
  cursor: pointer;
  transition: transform .2s var(--ease), filter .2s, box-shadow .2s;
}
.btn:hover { filter: brightness(1.1) saturate(1.05); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); filter: brightness(.95); }
.btn[disabled] { filter: grayscale(.6) brightness(.8); cursor: progress; transform: none; }
.btn--wood { --b1: #6c4426; --b2: #4a2c17; --b3: #2b180c; }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: 18px; }
.btn--block { width: 100%; min-height: 54px; font-size: 24px; }

/* ---------- tieu de khu ---------- */
.title {
  display: flex; align-items: center; justify-content: center; gap: clamp(12px, 2vw, 22px);
  margin: 0 0 clamp(28px, 4vw, 44px);
  font: 400 clamp(36px, 5.4vw, 60px)/1.15 var(--f-brush);
  color: #8e1c12;
  text-shadow: 0 2px 0 rgba(255, 244, 214, .9);
  text-align: center; text-wrap: balance;
}
.title::before, .title::after {
  content: ""; flex: 0 1 140px; height: 14px;
  background:
    radial-gradient(circle at 50% 50%, var(--gold) 0 3.5px, transparent 4.5px) right center / 14px 14px no-repeat,
    linear-gradient(var(--gold-lo), var(--gold-lo)) left 50% / calc(100% - 18px) 2px no-repeat;
}
.title::before { transform: scaleX(-1); }
.title--light { color: var(--gold-hi); text-shadow: 0 3px 0 #5a2c0c, 0 8px 20px rgba(0, 0, 0, .6); }

/* ---------- khung go vien vang cua game (PopupBgAtlas popup-grande) ---------- */
.framed { --fs: .5; position: relative; }
/* noi dung anh chi hien trong mep trong cua vien (khong lot qua cho khuyet tren vien) */
.framed > .media-in, .framed > .banner__track > .banner__slide { clip-path: inset(calc(52px * var(--fs)) calc(50px * var(--fs)) calc(56px * var(--fs)) calc(48px * var(--fs)) round 6px); }
.framed::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  border-style: solid; border-color: transparent;
  border-width: calc(230px * var(--fs)) calc(70px * var(--fs)) calc(240px * var(--fs)) calc(66px * var(--fs));
  border-image: url("assets/img/frame-rim.png") 230 70 240 66;
}

/* ---------- thanh doc ben trai ---------- */
.rail { display: none; }
@media (min-width: 1180px) {
  :root { --rail: 104px; }
  .rail {
    position: fixed; z-index: 40; left: 16px; top: 50%; transform: translateY(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    width: 88px; padding: 12px 0 14px;
    background: linear-gradient(180deg, rgba(36, 22, 18, .94), rgba(20, 12, 16, .94));
    border: 2px solid var(--gold-lo); border-radius: 44px;
    box-shadow: 0 0 0 3px rgba(20, 15, 28, .5), 0 18px 40px -16px rgba(0, 0, 0, .8);
  }
  .rail__brand img { width: 56px; height: 56px; border-radius: 50%; }
  .rail ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
  .rail a:not(.rail__brand) {
    position: relative; display: block; width: 80px; padding: 8px 4px;
    font: 400 16px/1.1 var(--f-display); color: var(--night-mute); text-align: center; text-decoration: none;
    border-radius: 8px; transition: color .2s, background-color .2s;
  }
  .rail a:not(.rail__brand):hover { color: var(--gold-hi); }
  .rail a.is-on { color: var(--ink); background: var(--gold); font-weight: 700; }
}

/* ---------- thanh tren ---------- */
.top {
  position: fixed; z-index: 50; inset: 0 0 auto 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 68px; padding: 0 var(--gutter) 0 calc(var(--gutter) + var(--rail));
  transition: background-color .3s, box-shadow .3s;
}
.top.is-solid { background: rgba(20, 15, 28, .96); box-shadow: 0 1px 0 rgba(231, 178, 74, .35), 0 10px 30px -18px #000; }
.top__logo img { height: 52px; width: auto; opacity: 0; transform: translateY(-6px); transition: opacity .3s, transform .3s var(--ease); }
.top.is-solid .top__logo img { opacity: 1; transform: none; }
.top__logo { pointer-events: none; }
.top.is-solid .top__logo { pointer-events: auto; }
.top__actions { display: flex; align-items: center; gap: 10px; }
.top__menu {
  display: none; width: 44px; height: 44px; padding: 10px;
  background: rgba(20, 15, 28, .7); border: 1px solid var(--gold-lo); border-radius: 8px; color: var(--gold-hi); cursor: pointer;
}
.drawer {
  position: fixed; z-index: 49; inset: 68px 0 auto 0;
  background: rgba(20, 15, 28, .98); border-bottom: 1px solid var(--gold-lo);
}
.drawer nav { display: grid; padding: 8px var(--gutter) 16px; }
.drawer a { padding: 14px 4px; color: var(--night-text); text-decoration: none; font: 400 22px/1 var(--f-display); border-bottom: 1px solid rgba(231, 178, 74, .15); }

/* ---------- hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: clamp(640px, 100svh, 1100px);
  display: grid; grid-template-rows: 1fr auto; padding: 96px var(--gutter) 28px calc(var(--gutter) + var(--rail));
  color: var(--night-text); background: var(--ink);
}
.hero__art {
  position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%;
  object-fit: cover; object-position: 62% 40%;
  animation: hero-in 1.6s var(--ease) both;
}
.hero__shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(20, 12, 20, .78) 0%, rgba(20, 12, 20, .45) 30%, rgba(20, 12, 20, 0) 55%),
    linear-gradient(0deg, var(--ink) 0%, rgba(20, 15, 28, .82) 14%, rgba(20, 15, 28, 0) 42%);
}
.hero__head { align-self: center; max-width: 660px; margin-top: -4vh; }
.hero__logo { margin: 0; }
.hero__logo img {
  width: clamp(260px, 34vw, 500px); height: auto;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .6));
  animation: logo-in 1s .25s var(--ease) both;
}
.hero__tag {
  margin: 4px 0 0 clamp(8px, 1.4vw, 22px);
  font: 400 clamp(24px, 2.5vw, 34px)/1.25 var(--f-brush); color: var(--gold-hi);
  text-shadow: 0 2px 0 #4a1d06, 0 6px 16px rgba(0, 0, 0, .7);
  animation: rise .9s .55s var(--ease) both;
}

.dock {
  justify-self: center; width: min(1040px, 100%);
  display: grid; grid-template-columns: minmax(0, 3fr) 1fr 1fr; gap: 12px; align-items: stretch;
  --fs: .3; padding: 24px 26px 22px 26px;
  background: linear-gradient(180deg, rgba(42, 24, 18, .94), rgba(20, 12, 16, .96));
  border-radius: 14px;
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .9);
  animation: rise 1s .7s var(--ease) both;
}
.dock__dl { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dl {
  display: flex; align-items: center; gap: 10px; height: 100%; min-height: 34px; padding: 4px 12px;
  color: var(--night-mute); background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(231, 178, 74, .28); border-radius: 6px; cursor: default; text-decoration: none;
}
.dl.is-ready { cursor: pointer; background: rgba(231, 178, 74, .1); transition: transform .2s var(--ease), border-color .2s, background .2s; }
.dl.is-ready:hover { transform: translateY(-1px); border-color: var(--gold); background: rgba(231, 178, 74, .18); }
.dl.is-ready:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.dl svg { width: 18px; height: 18px; flex: none; color: var(--gold); }
.dl span { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; width: 100%; }
.dl b { font: 400 17px/1 var(--f-display); color: var(--night-text); }
.dl small { font-size: 12px; color: var(--gold); white-space: nowrap; }
.tile {
  --b1: var(--red-hi); --b2: var(--red); --b3: var(--red-lo);
  display: grid; place-items: center; align-content: center; gap: 6px; padding: 12px 8px; min-height: 112px;
  font: 400 22px/1.05 var(--f-display); color: #fff8e6; text-align: center; text-decoration: none;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .45);
  background: linear-gradient(180deg, var(--b1), var(--b2) 55%, var(--b3));
  border: 2px solid var(--gold); border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 236, 190, .5), inset 0 -4px 0 rgba(0, 0, 0, .25);
  transition: transform .2s var(--ease), filter .2s;
}
.tile svg { width: 30px; height: 30px; color: var(--gold-hi); }
.tile--red svg { fill: var(--gold-hi); stroke: none; }
.tile--wood { --b1: #6c4426; --b2: #4a2c17; --b3: #2b180c; }
.tile:hover { transform: translateY(-2px); filter: brightness(1.12); }

@keyframes hero-in { from { opacity: 0; transform: scale(1.08); } to { opacity: 1; transform: none; } }
@keyframes logo-in { from { opacity: 0; transform: translateY(-18px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(95, 211, 141, .05); } }

/* ---------- dang ky ---------- */
.join {
  position: relative; isolation: isolate; overflow: hidden;
  padding: clamp(64px, 9vw, 112px) 0 clamp(64px, 8vw, 104px) var(--rail);
  color: var(--night-text); background: var(--ink);
}
.join__bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, var(--ink) 0%, rgba(20, 15, 28, .7) 22%, rgba(20, 15, 28, .78) 70%, var(--ink-2) 100%),
    url("assets/img/konoha-hall.webp") center 35% / cover no-repeat;
}
.join__grid { display: grid; grid-template-columns: 1fr minmax(320px, 440px); gap: clamp(32px, 6vw, 88px); align-items: center; }
.join__intro { position: relative; }
.join .title { justify-content: flex-start; text-align: left; margin-bottom: 16px; }
.join .title::before { display: none; }
.join__lead { margin: 0 0 32px; max-width: 46ch; font-size: 18px; color: var(--night-mute); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: s; max-width: 460px; }
.steps li {
  counter-increment: s; position: relative; display: grid; gap: 2px;
  padding: 14px 18px 14px 74px; min-height: 68px;
  background: rgba(20, 12, 16, .62); border: 1px solid rgba(231, 178, 74, .35); border-radius: 10px;
}
.steps li::before {
  content: counter(s); position: absolute; left: 14px; top: 50%; translate: 0 -50%;
  display: grid; place-items: center; width: 44px; height: 44px;
  font: 400 26px/1 var(--f-display); color: var(--ink);
  background: radial-gradient(circle at 35% 30%, var(--gold-hi), var(--gold) 55%, var(--gold-lo));
  border-radius: 50%; box-shadow: 0 0 0 3px rgba(20, 12, 16, .9), 0 0 0 4px var(--gold-lo);
}
.steps b { font: 400 21px/1.2 var(--f-display); color: var(--gold-hi); }
.steps span { font-size: 15px; color: var(--night-mute); }
.join__npc {
  position: absolute; right: -10px; bottom: -36px; width: clamp(150px, 18vw, 230px); height: auto;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .55));
  -webkit-mask: linear-gradient(#000 72%, transparent 98%); mask: linear-gradient(#000 72%, transparent 98%);
}

.scroll-card {
  position: relative;
  padding: calc(78px * var(--fs) + 18px) calc(71px * var(--fs) + 18px) calc(63px * var(--fs) + 20px) calc(64px * var(--fs) + 18px);
  color: var(--brown); border-radius: 18px;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35 0 0 0 0 .22 0 0 0 0 .1 0 0 0 .09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    radial-gradient(120% 90% at 50% 0%, #fbf0d6 0%, var(--paper) 55%, var(--paper-2) 100%);
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .9);
}
.scroll-card h3 { margin: 0 0 18px; font: 400 36px/1.15 var(--f-brush); color: #8e1c12; text-align: center; text-shadow: 0 2px 0 rgba(255, 244, 214, .9); }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span:first-child { font: 400 18px/1.2 var(--f-display); color: var(--brown); }
.field em { font-style: normal; font-weight: 400; color: var(--brown-mute); }
.field small { font-size: 13px; color: var(--brown-mute); }
.field input {
  width: 100%; height: 46px; padding: 0 14px;
  background: #fffaf0; border: 1px solid #b89565; border-radius: 6px; color: var(--brown);
  box-shadow: inset 0 2px 3px rgba(93, 59, 34, .12);
  transition: border-color .2s, box-shadow .2s;
  caret-color: var(--red);
}
.field input:hover { border-color: var(--brown-2); }
.field input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(196, 42, 31, .2); }
.field input[aria-invalid="true"] { border-color: var(--red); background: #fff1ea; }
.pw { position: relative; display: block; }
.pw input { padding-right: 48px; }
.pw__eye {
  position: absolute; right: 4px; top: 50%; translate: 0 -50%; width: 40px; height: 40px; padding: 10px;
  background: none; border: 0; border-radius: 6px; color: var(--brown-mute); cursor: pointer;
}
.pw__eye:hover, .pw__eye[aria-pressed="true"] { color: var(--red); }
.scroll-card .btn--block { margin-top: 6px; }
.reg__msg { min-height: 24px; margin: 14px 0 0; font-weight: 500; font-size: 15px; text-align: center; }
.reg__msg.is-ok { color: #1f6b3a; }
.reg__msg.is-err { color: var(--red); }

/* ---------- nen giay ---------- */
.paper {
  position: relative; isolation: isolate;
  padding: clamp(64px, 8vw, 104px) 0 clamp(64px, 8vw, 104px) var(--rail);
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='n'><feTurbulence baseFrequency='.7' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .4 0 0 0 0 .26 0 0 0 0 .12 0 0 0 .1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    radial-gradient(90% 60% at 50% 0%, #f8ecd2 0%, transparent 70%),
    var(--paper);
}
/* phu dieu tuong da Hokage (PopupMenuCharacterAtlas) + song seigaiha nhu nen popup trong game */
.paper::before {
  content: ""; position: absolute; z-index: -1; right: max(0px, calc(50% - 760px)); top: 18px;
  width: min(520px, 44vw); aspect-ratio: 560 / 364;
  background: url("assets/img/hokage-relief.png") center / contain no-repeat;
  mix-blend-mode: multiply; opacity: .32; filter: sepia(.6);
}
.paper::after {
  content: ""; position: absolute; z-index: -1; left: 0; right: 0; bottom: 0; height: 240px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='40'><defs><g id='w'><circle r='38' fill='%23f3e5c6'/><g fill='none' stroke='%23c79f5f' stroke-width='2'><circle r='37'/><circle r='29'/><circle r='21'/><circle r='13'/><circle r='5'/></g></g></defs><use href='%23w' x='0' y='0'/><use href='%23w' x='80' y='0'/><use href='%23w' x='40' y='20'/><use href='%23w' x='0' y='40'/><use href='%23w' x='80' y='40'/></svg>") 0 0 / 80px 40px;
  -webkit-mask: linear-gradient(transparent, #000 85%); mask: linear-gradient(transparent, #000 85%);
  opacity: .5;
}

/* ---------- tin tuc ---------- */
.news__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(16px, 2.4vw, 28px); }
.banner {
  --fs: .4; position: relative; overflow: hidden; aspect-ratio: 16 / 10; border-radius: 14px;
  box-shadow: 0 20px 40px -24px rgba(59, 36, 20, .9);
}
.banner__track { display: flex; height: 100%; transition: transform .7s var(--ease); }
.banner__slide { position: relative; flex: 0 0 100%; height: 100%; color: #fff8e6; text-decoration: none; }
.banner__slide img { width: 100%; height: 100%; object-fit: cover; }
.banner__slide span {
  position: absolute; inset: auto 0 0 0; padding: 48px 40px 52px;
  font: 400 clamp(22px, 2.4vw, 30px)/1.15 var(--f-display);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .6);
  background: linear-gradient(0deg, rgba(20, 12, 16, .92), rgba(20, 12, 16, 0));
}
.banner__dots { position: absolute; z-index: 4; left: 40px; bottom: 30px; display: flex; gap: 8px; }
.banner__dots button {
  width: 28px; height: 6px; padding: 0; border: 0; border-radius: 3px; cursor: pointer;
  background: rgba(255, 248, 230, .4); transition: background-color .2s;
}
.banner__dots button[aria-selected="true"] { background: var(--gold-hi); }

.board {
  position: relative; display: flex; flex-direction: column; min-height: 100%;
  padding: calc(78px * var(--fs) + 6px) calc(71px * var(--fs) + 4px) calc(63px * var(--fs) + 6px) calc(64px * var(--fs) + 4px); border-radius: 16px;
  background: linear-gradient(180deg, #fff7df, #f6e8c6);
  box-shadow: 0 20px 40px -26px rgba(59, 36, 20, .9);
}
.board__tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px 10px 0; border-bottom: 2px solid var(--paper-3); }
.board__tabs button {
  position: relative; padding: 10px 12px 12px; background: none; border: 0; cursor: pointer;
  font: 400 19px/1 var(--f-display); color: var(--brown-mute);
  transition: color .2s;
}
.board__tabs button:hover { color: var(--brown); }
.board__tabs button[aria-selected="true"] { color: var(--red); }
.board__tabs button[aria-selected="true"]::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -2px; height: 3px; background: var(--red); border-radius: 2px;
}
.board__list { list-style: none; margin: 0; padding: 6px 0; }
.board__list li + li { border-top: 1px dashed rgba(111, 79, 51, .3); }
.row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; width: 100%;
  padding: 13px 18px; background: none; border: 0; text-align: left; cursor: pointer; color: var(--brown);
  transition: background-color .2s, color .2s;
}
.row:hover { background: rgba(231, 178, 74, .16); color: var(--red-lo); }
.row__cat {
  font: 400 14px/1 var(--f-display); padding: 5px 8px 4px; border-radius: 4px;
  color: #fff8e6; background: var(--brown-2); white-space: nowrap;
}
.row__cat[data-cat="su-kien"] { background: var(--red); }
.row__cat[data-cat="tinh-nang"] { background: #2f6b5b; }
.row__cat[data-cat="huong-dan"] { background: #7a5419; }
.row__title { font: 400 18px/1.3 var(--f-display); }
.row__date { font-size: 13px; color: var(--brown-mute); font-variant-numeric: tabular-nums; }
.reader { padding: 18px 22px 22px; outline: none; }
.reader__back {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px 6px 4px; margin-bottom: 8px;
  background: none; border: 0; cursor: pointer; font-weight: 500; font-size: 14px; color: var(--red);
}
.reader__back svg { width: 18px; height: 18px; }
.reader h3 { margin: 0 0 6px; font: 400 30px/1.2 var(--f-brush); color: var(--red-lo); text-wrap: balance; }
.reader time { display: block; margin-bottom: 14px; font-size: 13px; color: var(--brown-mute); }
.reader p { margin: 0 0 12px; max-width: 65ch; }

.links { list-style: none; margin: clamp(28px, 4vw, 44px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(12px, 2vw, 22px); }
.plaque {
  position: relative; display: flex; align-items: flex-end; height: 132px; margin-top: 44px; padding: 0 16px 16px;
  text-decoration: none; overflow: visible;
  background: linear-gradient(180deg, #8f2a1c 0%, #6b1a10 60%, #4a0f08 100%);
  border: 2px solid var(--gold); border-radius: 10px;
  box-shadow: inset 0 0 0 3px rgba(74, 15, 8, .9), inset 0 0 0 4px rgba(255, 221, 133, .35), 0 14px 26px -16px rgba(59, 36, 20, .9);
  transition: transform .25s var(--ease), filter .25s;
}
.plaque img {
  position: absolute; right: 4px; bottom: 4px; width: auto; height: 168px;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .45));
  transition: transform .35s var(--ease);
}
.plaque span { position: relative; max-width: 60%; font: 400 22px/1.05 var(--f-display); color: var(--gold-hi); text-shadow: 0 2px 0 #3a0a04; }
.plaque:hover { transform: translateY(-3px); filter: brightness(1.08); }
.plaque:hover img { transform: translateY(-6px) rotate(-2deg); }

/* ---------- nhan gia ---------- */
.ninja { overflow: hidden; }
.ninja__bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, var(--paper) 0%, rgba(243, 229, 198, .55) 30%, rgba(243, 229, 198, .2) 60%, var(--paper) 100%),
    url("assets/img/map-24.webp") center 70% / cover no-repeat;
}
.ninja__grid { display: grid; grid-template-columns: 112px minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(16px, 3vw, 40px); align-items: center; }
.picker { display: grid; gap: 14px; justify-items: center; }
.pick {
  position: relative; width: 88px; height: 88px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: none; transition: transform .25s var(--ease), filter .25s;
  filter: grayscale(.55) brightness(.92);
}
.pick img { width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 6px 14px -6px rgba(59, 36, 20, .9); }
.pick i {
  position: absolute; right: -6px; bottom: -4px; width: 36px; height: 36px; border-radius: 50%;
  background: center / 150% no-repeat var(--ink); box-shadow: 0 0 0 2px var(--gold);
}
.pick:hover { filter: none; transform: scale(1.05); }
.pick[aria-selected="true"] { filter: none; transform: scale(1.12); }
.pick[aria-selected="true"] img { box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--red), 0 10px 20px -8px rgba(122, 18, 13, .8); }

.stage { --don: var(--gold); position: relative; aspect-ratio: 1 / 1; max-height: 560px; width: 100%; }
.stage__seal {
  position: absolute; left: 50%; top: 42%; width: 74%; aspect-ratio: 204 / 164; translate: -50% -50%;
  background: center / contain no-repeat; opacity: .26; pointer-events: none;
}
.stage[data-don="phong"] .stage__seal { background-image: url("assets/img/seal-phong.png"); }
.stage[data-don="loi"] .stage__seal { background-image: url("assets/img/seal-loi.png"); }
.stage[data-don="thuy"] .stage__seal { background-image: url("assets/img/seal-thuy.png"); }
.stage[data-don="hoa"] .stage__seal { background-image: url("assets/img/seal-hoa.png"); }
.stage[data-don="tho"] .stage__seal { background-image: url("assets/img/seal-tho.png"); }
.stage.is-cast .stage__seal { animation: cast .9s var(--ease); }
@keyframes cast { 30% { opacity: .75; transform: scale(1.08); filter: brightness(1.3); } }
.stage__base { position: absolute; left: 50%; bottom: 7%; width: 64%; height: auto; translate: -50% 0; filter: drop-shadow(0 14px 16px rgba(59, 36, 20, .45)); }
.stage[data-don="phong"] { --don: #2fbf96; }
.stage[data-don="loi"] { --don: #7663ff; }
.stage[data-don="thuy"] { --don: #2f8fe8; }
.stage[data-don="hoa"] { --don: #ef4a2a; }
.stage[data-don="tho"] { --don: #d79a1c; }
.stage__spine { position: absolute; inset: 0; z-index: 1; }
.stage__spine .spine-player { background: transparent !important; }
.stage__note { position: absolute; inset: auto 0 6% 0; text-align: center; font-size: 14px; color: var(--brown-mute); }

.dossier { min-height: 420px; }
.dossier__name { display: flex; align-items: center; gap: 14px; margin: 0 0 4px; }
.dossier__name img { height: 50px; width: auto; }
.dossier__name .don { width: 64px; height: 64px; flex: none; }
.dossier__role { display: inline-block; margin: 6px 0 14px; padding: 5px 12px; font: 400 17px/1.1 var(--f-display); color: #fff8e6; background: var(--red); border-radius: 4px; }
.dossier__desc { margin: 0 0 22px; max-width: 46ch; font-size: 16px; }
.skills { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.skill {
  display: grid; justify-items: center; gap: 6px; width: 100%; padding: 6px 2px; background: none; border: 0; cursor: pointer;
  font: 400 15px/1.2 var(--f-display); color: var(--brown); text-align: center;
}
.skill img {
  width: 68px; height: 68px; border-radius: 50%;
  transition: transform .25s var(--ease), box-shadow .25s;
  box-shadow: 0 6px 12px -6px rgba(59, 36, 20, .9);
}
.skill:hover img { transform: translateY(-3px) scale(1.04); }
.skill[aria-pressed="true"] img { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--red), 0 10px 18px -8px rgba(122, 18, 13, .8); }
.skill[aria-pressed="true"] { color: var(--red-lo); }
.skill__desc {
  min-height: 74px; margin: 0; padding: 12px 16px;
  font-size: 15px; background: rgba(255, 250, 236, .7); border: 1px solid var(--paper-3); border-radius: 8px;
}
.skill__desc b { display: block; margin-bottom: 2px; font: 400 24px/1.2 var(--f-brush); color: #8e1c12; }

/* ---------- tinh nang ---------- */
.feats {
  position: relative; isolation: isolate; overflow: hidden;
  padding: clamp(64px, 8vw, 104px) 0 clamp(64px, 8vw, 104px) var(--rail);
  color: var(--night-text);
  background:
    radial-gradient(70% 60% at 50% 100%, rgba(196, 42, 31, .35), transparent 70%),
    linear-gradient(180deg, #2a0f0b 0%, #1a0b10 50%, var(--ink) 100%);
}
.fan { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; height: clamp(440px, 46vw, 560px); }
.fan__item {
  position: relative; flex: 1 1 0; min-width: 0; overflow: hidden; border-radius: 10px; cursor: pointer;
  border: 2px solid var(--gold-lo); background: var(--ink-2);
  transition: flex-grow .7s var(--ease), border-color .3s;
}
.fan__item[aria-expanded="true"] { flex-grow: 3.2; border-color: var(--gold); cursor: default; }
.fan__item > button { position: absolute; inset: 0; z-index: 2; width: 100%; padding: 0; background: none; border: 0; cursor: pointer; }
.fan__item[aria-expanded="true"] > button { display: none; }
.fan__item img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; transition: transform .9s var(--ease), filter .5s; filter: brightness(.6) saturate(.85); }
.fan__item:hover img, .fan__item[aria-expanded="true"] img { filter: none; }
.fan__item[aria-expanded="true"] img { transform: scale(1.03); }
.fan__label {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 64px 14px 18px;
  font: 400 22px/1.05 var(--f-display); color: var(--gold-hi); text-align: center;
  text-shadow: 0 2px 0 #3a0a04;
  background: linear-gradient(0deg, rgba(20, 8, 10, .95), rgba(20, 8, 10, 0));
  transition: opacity .3s;
}
.fan__item[aria-expanded="true"] .fan__label { opacity: 0; }
.fan__body {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 90px clamp(18px, 2.4vw, 30px) clamp(18px, 2.4vw, 28px);
  background: linear-gradient(0deg, rgba(20, 8, 10, .97) 0%, rgba(20, 8, 10, .9) 55%, rgba(20, 8, 10, 0));
  opacity: 0; transform: translateY(16px); pointer-events: none;
  transition: opacity .35s, transform .5s var(--ease);
}
.fan__item[aria-expanded="true"] .fan__body { opacity: 1; transform: none; transition-delay: .25s; pointer-events: auto; }
.fan__body h3 { margin: 0 0 8px; font: 400 clamp(30px, 3.2vw, 42px)/1.15 var(--f-brush); color: var(--gold-hi); text-shadow: 0 2px 0 #3a0a04; }
.fan__body p { margin: 0 0 10px; max-width: 52ch; color: var(--night-text); font-size: 15px; }
.fan__body ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.fan__body li { position: relative; padding-left: 20px; font-size: 14px; color: var(--night-mute); }
.fan__body li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 8px; height: 8px; background: var(--gold); transform: rotate(45deg); }
.fan__body li b { color: var(--night-text); font-weight: 500; }

/* ---------- the gioi ---------- */
.gallery { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 14px; }
.gallery__view {
  --fs: .42; position: relative; margin: 0; overflow: hidden; aspect-ratio: 2 / 1; border-radius: 14px;
  box-shadow: 0 24px 40px -24px rgba(59, 36, 20, .9);
}
.gallery__view img { width: 100%; height: 100%; object-fit: cover; transition: opacity .4s; }
.gallery__view img.is-fading { opacity: .2; }
.gallery__view figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  padding: 40px 44px 40px; color: #fff8e6; z-index: 4;
  background: linear-gradient(0deg, rgba(20, 12, 16, .85), rgba(20, 12, 16, 0));
}
.gallery__view figcaption b { font: 400 34px/1.1 var(--f-brush); text-shadow: 0 2px 0 rgba(0, 0, 0, .6); }
.gallery__view figcaption span { font-size: 13px; color: var(--night-mute); }
.gallery__nav {
  position: absolute; top: 50%; translate: 0 -50%; width: 48px; height: 48px; padding: 12px;
  background: rgba(20, 12, 16, .7); border: 1px solid var(--gold); border-radius: 50%; color: var(--gold-hi); cursor: pointer;
  transition: background-color .2s;
}
.gallery__nav:hover { background: var(--red); }
.gallery__nav { z-index: 4; }
.gallery__nav--prev { left: 40px; }
.gallery__nav--next { right: 40px; }
.gallery__thumbs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-rows: repeat(6, minmax(0, 1fr)); height: 0; min-height: 100%; }
.gallery__thumbs button {
  position: relative; display: block; width: 100%; height: 100%; padding: 0; overflow: hidden; cursor: pointer;
  border: 2px solid transparent; border-radius: 8px; background: var(--ink-2);
  transition: border-color .2s;
}
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.7); transition: filter .2s; }
.gallery__thumbs span {
  position: absolute; left: 8px; bottom: 6px; right: 8px; font: 400 15px/1.1 var(--f-display); color: #fff8e6; text-align: left;
  text-shadow: 0 1px 0 #000, 0 0 6px rgba(0, 0, 0, .8);
}
.gallery__thumbs button:hover img, .gallery__thumbs button[aria-current="true"] img { filter: none; }
.gallery__thumbs button[aria-current="true"] { border-color: var(--red); }

/* ---------- chan trang ---------- */
.foot { padding: 48px 0 calc(40px + env(safe-area-inset-bottom)) var(--rail); color: var(--night-mute); background: #0e0a13; border-top: 1px solid rgba(231, 178, 74, .3); }
.foot__grid { display: grid; grid-template-columns: auto 1fr; gap: 12px 40px; align-items: center; }
.foot__logo { width: 180px; height: auto; grid-row: span 2; }
.foot__nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot__nav a { color: var(--night-text); text-decoration: none; font: 400 19px/1.2 var(--f-display); }
.foot__nav a:hover { color: var(--gold-hi); text-decoration: underline; text-underline-offset: 4px; }
.foot__note { margin: 0; max-width: 80ch; font-size: 13px; }

.mbar { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .dock { grid-template-columns: 1fr 1fr; }
  .tile { min-height: 76px; grid-auto-flow: column; gap: 10px; }
  .tile br { display: none; }
  .ninja__grid { grid-template-columns: 1fr; }
  .picker { grid-auto-flow: column; justify-content: center; }
  .stage { max-width: 520px; margin-inline: auto; }
  .dossier { min-height: 0; }
  .links { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .top { height: 60px; }
  .top__logo img { height: 44px; }
  .top__actions .btn { display: none; }
  .top__menu { display: block; }
  .drawer { inset: 60px 0 auto 0; }
  html { scroll-padding-top: 64px; }
  .hero { padding-top: 84px; padding-bottom: 20px; min-height: clamp(600px, 100svh, 960px); }
  .hero__art { object-position: 70% 30%; }
  .hero__shade {
    background:
      linear-gradient(180deg, rgba(20, 12, 20, .55) 0%, rgba(20, 12, 20, 0) 30%),
      linear-gradient(0deg, var(--ink) 0%, rgba(20, 15, 28, .92) 34%, rgba(20, 15, 28, 0) 62%);
  }
  .hero__head { align-self: start; margin-top: 0; }
  .dock { grid-template-columns: 1fr; padding: 22px 22px 20px; gap: 10px; }
  .dock__dl { grid-template-columns: repeat(3, 1fr); }
  .dl { flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px 4px; text-align: center; }
  .dl span { flex-direction: column; align-items: center; gap: 0; }
  .dock .tile--wood { display: none; }
  .dock .tile--red { min-height: 56px; display: flex; justify-content: center; gap: 10px; font-size: 24px; }
  .dock .tile--red svg { width: 24px; height: 24px; }
  .join__grid { grid-template-columns: 1fr; }
  .join__npc { display: none; }
  .news__grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .gallery__thumbs { grid-template-columns: repeat(3, 1fr); grid-template-rows: none; grid-auto-rows: 64px; height: auto; min-height: 0; }
  .fan { flex-direction: column; height: auto; }
  .fan__item { flex: none; height: 84px; transition: border-color .3s; }
  .fan__item[aria-expanded="true"] { height: 440px; }
  .fan__item img { object-position: center 25%; }
  .fan__label { padding: 0 16px; top: 0; display: flex; align-items: center; justify-content: flex-start; background: linear-gradient(90deg, rgba(20, 8, 10, .9), rgba(20, 8, 10, .2)); }
  .foot__grid { grid-template-columns: 1fr; }
  .foot__logo { grid-row: auto; width: 150px; }
  .foot { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .mbar {
    position: fixed; z-index: 45; left: 0; right: 0; bottom: 0;
    display: grid; grid-template-columns: 1fr 2fr; gap: 10px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(14, 10, 19, .97); border-top: 1px solid var(--gold-lo);
    transform: translateY(110%); transition: transform .35s var(--ease);
  }
  .mbar.is-on { transform: none; }
}
@media (max-width: 560px) {
  .links { grid-template-columns: 1fr 1fr; gap: 12px; }
  .plaque { height: 104px; margin-top: 36px; padding: 0 10px 12px; }
  .plaque img { height: 112px; right: -2px; }
  .plaque span { font-size: 18px; max-width: 54%; }
  .board__tabs button { font-size: 17px; padding: 10px 8px 12px; }
  .row { grid-template-columns: 1fr auto; padding: 12px 14px; }
  .row__cat { display: none; }
  .pick { width: 58px; height: 58px; }
  .pick i { width: 26px; height: 26px; right: -6px; }
  .picker { gap: 10px; }
  .skills { grid-template-columns: repeat(2, 1fr); }
  .title::before, .title::after { flex-basis: 36px; }
  .gallery__view { aspect-ratio: 16 / 10; }
  .banner, .gallery__view { --fs: .3; }
  .scroll-card, .board { --fs: .34; }
  .board__tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .board__tabs button { flex: none; }
  .gallery__view figcaption b { font-size: 24px; }
  .gallery__nav { width: 40px; height: 40px; padding: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* khong cho boi den / keo anh tren trang cong khai (o nhap van chon duoc) */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, select, [contenteditable] { -webkit-user-select: text; user-select: text; }
img { -webkit-user-drag: none; }

/* Account actions share the existing parchment surface. */
.account-nav { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 24px; border-bottom: 1px solid #b89565; }
.account-nav button { flex: 1; min-height: 44px; padding: 8px 4px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--brown-mute); font-size: 14px; cursor: pointer; }
.account-nav button:hover { color: var(--red-lo); background: #e9d4a6; }
.account-nav button[aria-current="true"] { border-bottom-color: var(--red); color: var(--red-lo); font-weight: 700; }
.account-help { margin: 0 0 20px; font-size: 14px; line-height: 1.6; }
.dock__downloads { min-width: 0; }
.dock__downloads h2 { margin: 0 0 6px; font: 400 26px/1.2 var(--f-display); color: var(--gold-hi); }
.dock__downloads > p { margin: 0 0 16px; color: var(--night-mute); font-size: 14px; }
.dock__dl { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.dl { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 10px; padding: 14px 12px; min-height: 100px; text-align: left; }
.dl svg { width: 24px; height: 24px; }
.dl span { flex-direction: column; align-items: flex-start; gap: 8px; }
.dl b { font-size: 21px; }
.dl small { white-space: normal; line-height: 1.4; }
@media (max-width: 1100px) and (min-width: 641px) { .dock__downloads { grid-column: 1 / -1; } }
@media (max-width: 640px) { .dock__dl { gap: 6px; } .dl { padding: 12px 8px; } .dl b { font-size: 19px; } }
