/* Wiki TS Realm — cùng bảng màu "kính xanh đêm" với landing, mobile trước. */
:root {
  --night-950: #050d1c; --night-900: #071326; --night-800: #0b1d38; --night-700: #12294d;
  --glass: rgba(9, 27, 54, .74); --glass-2: rgba(18, 41, 77, .6);
  --cyan: #52e2f6; --cyan-2: #1fb6d8; --gold: #f5c95c; --gold-2: #e09a26; --rose: #f7abc7;
  --text: #ecf5ff; --muted: #a8bcd6; --line: rgba(120, 170, 230, .22);
  --radius: 14px; --gutter: 16px;
  --font-body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Baloo 2", "Be Vietnam Pro", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 15px/1.6 var(--font-body); color: var(--text); background: var(--night-900);
  background-image: radial-gradient(1000px 500px at 90% -10%, rgba(82, 226, 246, .10), transparent 60%), radial-gradient(800px 500px at -10% 30%, rgba(108, 58, 158, .16), transparent 60%), linear-gradient(180deg, var(--night-800), var(--night-950));
  background-attachment: fixed; min-height: 100vh; overflow-x: hidden; }
img { max-width: 100%; height: auto; }
a { color: var(--cyan); text-underline-offset: 3px; }
a:hover { color: var(--gold); }
h1, h2, h3 { line-height: 1.25; margin: 0; font-family: var(--font-display); font-weight: 600; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.15rem; color: var(--gold); margin-bottom: 10px; }
p { margin: 0 0 .7em; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--gold); color: #1d1300; padding: 8px 14px; border-radius: 10px; }
.skip:focus { left: 8px; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter); }
.muted, .dim { color: var(--muted); } .small { font-size: .85rem; } .warn { color: var(--rose); }
[hidden] { display: none !important; }

/* ---- thanh trên ---- */
.top { position: sticky; top: 0; z-index: 30; background: rgba(5, 13, 28, .92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top__in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); }
.brand__mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; font: 700 14px var(--font-display); color: #1d1300; background: linear-gradient(135deg, var(--cyan), var(--gold)); }
.brand__t { font: 600 1.15rem/1 var(--font-display); } .brand__t small { display: block; font: 500 .65rem/1.2 var(--font-body); color: var(--muted); }
.nav { display: flex; gap: 2px; order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { white-space: nowrap; text-decoration: none; color: var(--muted); padding: 7px 12px; border-radius: 999px; font-weight: 500; font-size: .92rem; }
.nav a:hover { color: var(--text); background: var(--glass-2); }
.nav a.on { color: #1d1300; background: var(--gold); }
.search { position: relative; }
.search--top { flex: 1 1 200px; min-width: 0; margin-left: auto; max-width: 380px; }
.search input { width: 100%; font: inherit; color: var(--text); background: rgba(5, 13, 28, .7); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.search input:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 3px rgba(82, 226, 246, .2); }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--night-800); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); max-height: 70vh; overflow-y: auto; z-index: 40; }
.suggest a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; text-decoration: none; color: var(--text); border-bottom: 1px solid rgba(120, 170, 230, .1); }
.suggest a:hover, .suggest a.act { background: var(--glass-2); }
.suggest .more { justify-content: center; color: var(--cyan); }
@media (min-width: 760px) { .nav { order: 0; width: auto; } .top__in { flex-wrap: nowrap; } }

.main { padding-top: 22px; padding-bottom: 50px; min-height: 60vh; }
.foot { border-top: 1px solid var(--line); padding: 18px 0 30px; color: var(--muted); font-size: .85rem; }

/* ---- thành phần ---- */
.panel { background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.chip.gold { color: #1d1300; background: var(--gold); border-color: var(--gold); }
.chip.el-Địa { background: #6b4a1f; } .chip.el-Thủy { background: #1c4f86; } .chip.el-Hỏa { background: #8b2f1c; } .chip.el-Phong { background: #1f6b4b; }
.chip.el-Tâm { background: #5a2f86; } .chip.el-Quang { background: #8a7a1c; } .chip.el-Ám { background: #2c2c40; }
a.chip:hover { border-color: var(--gold); color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.btn { font: 600 .9rem var(--font-body); display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; border-radius: 999px; padding: 8px 16px; border: 1.5px solid var(--cyan); color: var(--text); background: transparent; text-decoration: none; min-height: 40px; }
.btn:hover { background: rgba(82, 226, 246, .15); color: var(--text); }
.btn.primary { background: linear-gradient(135deg, var(--gold), var(--gold-2)); border-color: var(--gold); color: #1d1300; }
.btn.primary:hover { filter: brightness(1.08); color: #1d1300; background: linear-gradient(135deg, var(--gold), var(--gold-2)); }
.btn.sm { padding: 4px 12px; min-height: 30px; font-size: .8rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.check { display: inline-flex; align-items: center; gap: 5px; font-size: .85rem; color: var(--muted); }
select { font: inherit; color: var(--text); background: rgba(5, 13, 28, .85); border: 1.5px solid var(--line); border-radius: 10px; padding: 7px 10px; min-height: 38px; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { font: 600 .8rem var(--font-body); color: var(--muted); background: transparent; border: 0; padding: 6px 14px; cursor: pointer; }
.seg button.on { background: var(--cyan); color: #04202a; }

/* ---- trang chủ ---- */
.hero { text-align: center; padding: 14px 0 22px; }
.hero h1 { font-size: 2rem; } .hero p { color: var(--muted); max-width: 560px; margin: 8px auto 18px; }
.search--big { max-width: 560px; margin: 0 auto; } .search--big input { font-size: 1.05rem; padding: 14px 18px; border-radius: 16px; }
.cats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 22px; }
.cat { display: block; text-decoration: none; color: var(--text); background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.cat:hover { border-color: var(--gold); } .cat b { display: block; font: 600 1.15rem var(--font-display); color: var(--gold); }
.cat span { color: var(--muted); font-size: .85rem; } .cat em { font-style: normal; display: block; font: 600 1.5rem var(--font-display); }
@media (min-width: 760px) { .cats { grid-template-columns: repeat(4, 1fr); } }

/* ---- danh sách ---- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; align-items: center; }
.filters input[type=search] { flex: 1 1 200px; min-width: 0; font: inherit; color: var(--text); background: rgba(5, 13, 28, .7); border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 12px; min-height: 38px; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .list { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .list { grid-template-columns: 1fr 1fr 1fr; } }
.row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--glass); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--text); min-height: 56px; }
.row:hover { border-color: var(--gold); color: var(--text); }
.row .nm { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; } .row .sb { color: var(--muted); font-size: .8rem; }
.row > div { min-width: 0; }
.th { flex: none; width: 44px; height: 44px; border-radius: 10px; background: rgba(5, 13, 28, .6) center/contain no-repeat; border: 1px solid var(--line); object-fit: contain; }
.th--lg { width: 88px; height: 88px; border-radius: 16px; }
.pager { display: flex; justify-content: center; margin: 18px 0; gap: 10px; align-items: center; color: var(--muted); }
.empty { padding: 30px 10px; text-align: center; color: var(--muted); }
.group-t { display: flex; justify-content: space-between; align-items: baseline; margin: 20px 0 8px; }
.group-t h2 { margin: 0; }

/* ---- trang chi tiết ---- */
.crumb { font-size: .85rem; color: var(--muted); margin-bottom: 10px; } .crumb a { color: var(--muted); }
.head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.head h1 { overflow-wrap: anywhere; }
.head .chips { margin-top: 8px; }
.grid2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .grid2 { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--glass-2); border-radius: 10px; padding: 8px 10px; text-align: center; }
.stat small { display: block; color: var(--muted); font-size: .72rem; } .stat b { font: 600 1.15rem var(--font-display); }
.note { border-left: 3px solid var(--gold); background: rgba(245, 201, 92, .08); padding: 8px 12px; border-radius: 0 10px 10px 0; margin: 10px 0; }
.note b { color: var(--gold); }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.skills { display: grid; gap: 8px; }
.fb { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 4px; }
.fb .hint { color: var(--muted); font-size: .8rem; flex: 1 1 220px; }

/* ---- trình phát VFX ---- */
.spr-stage { position: relative; background: #000; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.spr-stage canvas { display: block; width: 100%; height: auto; }
.spr-hud { position: absolute; left: 8px; bottom: 6px; font-size: .75rem; color: rgba(255, 255, 255, .75); text-shadow: 0 1px 2px #000; pointer-events: none; }
.spr-ctrl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.member-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.member-chips .chip { cursor: pointer; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--night-700); color: var(--text); border: 1px solid var(--gold); padding: 10px 18px; border-radius: 12px; z-index: 60; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); max-width: calc(100vw - 32px); text-align: center; }
@media (prefers-reduced-motion: no-preference) { .row, .cat, .btn { transition: border-color .15s, background .15s, filter .15s; } }

/* ---- Hiệu ứng skill + khung Tái sinh (giống panel trong game) ---- */
.fx { margin: 0; padding-left: 1.1em; } .fx li { margin: 4px 0; }
.fx-unk { margin: 8px 0 0; color: var(--rose); font-size: .88rem; }
.rb-t { font-weight: 600; color: var(--cyan); margin: 6px 0 8px; }
.rb-pair { display: grid; grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr); gap: 4px; align-items: stretch; margin-bottom: 14px; }
.rb-arrow { align-self: center; text-align: center; font: 700 1.6rem var(--font-display); color: var(--gold); }
.rb-card { border: 2px solid #2f8fe8; border-radius: 10px; background: rgba(8, 28, 64, .85); padding: 8px; min-width: 0; box-shadow: inset 0 0 0 1px rgba(120, 190, 255, .25); }
.rb-after { border-color: #38c8a0; }
.rb-h { font-size: .72rem; font-weight: 700; text-align: center; color: #bfe0ff; background: rgba(47, 143, 232, .25); border-radius: 6px; padding: 2px 4px; margin-bottom: 6px; }
.rb-nm { display: flex; align-items: center; gap: 6px; text-decoration: none; color: var(--text); margin-bottom: 4px; }
.rb-nm b { font: 600 .95rem/1.2 var(--font-display); overflow-wrap: anywhere; }
.th--sm { width: 34px; height: 34px; flex: 0 0 auto; }
.rb-sks { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.rb-sk { display: flex; flex-direction: column; align-items: center; width: 46px; text-decoration: none; color: var(--muted); font-size: .58rem; line-height: 1.15; text-align: center; }
.rb-sk .th { width: 40px; height: 40px; } .rb-sk span { overflow-wrap: anywhere; }
.rb-hp { display: flex; justify-content: space-between; gap: 4px; font-size: .8rem; margin-bottom: 4px; color: var(--muted); }
.rb-hp b, .rb-st b { color: var(--text); } .rb-hp i, .rb-st i { font-style: normal; color: var(--gold); font-weight: 700; }
.rb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.rb-st { display: flex; justify-content: space-between; gap: 4px; background: rgba(18, 41, 77, .7); border-radius: 6px; padding: 3px 6px; font-size: .76rem; }
.rb-st span { color: var(--muted); }
@media (max-width: 420px) { .rb-pair { grid-template-columns: 1fr; } .rb-arrow { transform: rotate(90deg); height: 20px; line-height: 20px; } }
