/* Noise Floor Wiki — โทนเดียวกับ UI เกม (UiStyle: พื้นมืด เส้นบาง อำพัน) */
@font-face { font-family: "Kanit"; src: url("fonts/Kanit-Medium.ttf") format("truetype"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "Kanit"; src: url("fonts/Kanit-SemiBold.ttf") format("truetype"); font-weight: 600 800; font-display: swap; }
@font-face { font-family: "Oxanium"; src: url("fonts/Oxanium-Medium.ttf") format("truetype"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "Oxanium"; src: url("fonts/Oxanium-Bold.ttf") format("truetype"); font-weight: 600 800; font-display: swap; }

:root {
  --bg: #08090b;
  --bg2: #0d0f12;
  --panel: #111418;
  --panel2: #161a1f;
  --line: rgba(255, 255, 255, 0.08);
  --line2: rgba(255, 255, 255, 0.14);
  --text: #ebebe6;
  --muted: #949999;
  --accent: #edbd52;
  --accent2: #f5d58a;
  --danger: #eb5c4d;
  --good: #66b861;
  --r-common: #8c9499;
  --r-uncommon: #66b861;
  --r-rare: #4d94e6;
  --r-epic: #a866e0;
  --r-legendary: #fac733;
  --r-mythic: #ed4038;
  --r-quest: #e0a342;
  --head: "Oxanium", "Kanit", system-ui, sans-serif;
  --body: "Kanit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --side: 232px;
  --top: 60px;
  --rad: 8px;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.6 var(--body);
  background-image: radial-gradient(1200px 600px at 70% -10%, rgba(237, 189, 82, 0.06), transparent 60%);
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent2); text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--head); font-weight: 700; letter-spacing: 0.02em; line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: clamp(26px, 4vw, 38px); }
h2 { font-size: 19px; text-transform: uppercase; color: var(--accent); letter-spacing: 0.06em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; z-index: 99; background: var(--accent); color: #000; padding: 6px 10px; }

/* --- top bar --- */
.top {
  position: sticky; top: 0; z-index: 50; height: var(--top); display: flex; align-items: center; gap: 14px; padding: 0 18px;
  background: rgba(8, 9, 11, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--head); font-weight: 700; white-space: nowrap; }
.brand:hover { text-decoration: none; color: var(--text); }
.brand-ico { width: 36px; height: 36px; border-radius: 6px; }
.brand-t { letter-spacing: 0.14em; font-size: 17px; }
.brand-w { color: #000; background: var(--accent); font-size: 11px; padding: 2px 6px; border-radius: 3px; letter-spacing: 0.12em; }
.search { position: relative; flex: 1; max-width: 520px; margin-left: auto; }
.search input {
  width: 100%; height: 38px; border-radius: 6px; border: 1px solid var(--line2); background: var(--panel); color: var(--text);
  padding: 0 12px 0 36px; font: inherit; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23949999' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='M11 11l4 4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 11px 50%;
}
.search input:focus { border-color: var(--accent); }
.search-res {
  display: none; position: absolute; top: 44px; left: 0; right: 0; max-height: 70vh; overflow: auto; background: var(--panel);
  border: 1px solid var(--line2); border-radius: 8px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}
.search-res.open { display: block; }
.search-res a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; color: var(--text); border-bottom: 1px solid var(--line); }
.search-res a:hover, .search-res a.sel { background: var(--panel2); text-decoration: none; }
.search-res img, .search-res .noimg { width: 32px; height: 32px; object-fit: contain; flex: none; }
.search-res .sr-k { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.search-res .sr-a { color: var(--muted); font-size: 12px; display: block; line-height: 1.2; }
.search-res .empty { padding: 12px; color: var(--muted); }
.lang {
  font-family: var(--head); font-weight: 700; border: 1px solid var(--line2); color: var(--text); padding: 6px 12px; border-radius: 6px;
}
.lang:hover { border-color: var(--accent); text-decoration: none; }
.burger { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.burger span { display: block; width: 20px; height: 2px; background: var(--text); margin: 4px 0; }

/* --- layout --- */
.layout { display: flex; max-width: 1480px; margin: 0 auto; }
.side {
  position: sticky; top: var(--top); align-self: flex-start; width: var(--side); flex: none; height: calc(100vh - var(--top));
  overflow-y: auto; padding: 18px 10px 30px 18px; border-right: 1px solid var(--line);
}
.nav-group { margin-bottom: 18px; }
.nav-h { font: 700 11px var(--head); color: var(--muted); letter-spacing: 0.14em; text-transform: uppercase; padding: 0 10px 6px; }
.nav-a { display: block; padding: 7px 10px; color: var(--text); border-radius: 6px; }
.nav-a:hover { background: var(--panel); text-decoration: none; color: var(--accent2); }
.nav-a.on { background: rgba(237, 189, 82, 0.1); box-shadow: inset 0 0 0 1px rgba(237, 189, 82, 0.28); color: var(--accent); }
main { flex: 1; min-width: 0; padding: 22px 28px 60px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.crumbs .sep { margin: 0 8px; opacity: 0.5; }
.foot { border-top: 1px solid var(--line); padding: 22px; text-align: center; color: var(--muted); font-size: 13px; display: grid; gap: 4px; }
.foot-mark { width: 22px; height: 22px; vertical-align: middle; margin-right: 4px; opacity: 0.8; }

/* --- hero --- */
.hero {
  --c: var(--accent); position: relative; display: flex; align-items: center; gap: 24px; padding: 24px 26px; margin-bottom: 22px; overflow: hidden;
  background: linear-gradient(110deg, color-mix(in srgb, var(--c) 16%, var(--panel)) 0%, var(--panel) 55%); border: 1px solid var(--line);
  border-color: color-mix(in srgb, var(--c) 35%, var(--line)); border-radius: var(--rad);
}
.hero h1 { color: var(--text); }
.hero .lead { color: #c9cbc6; margin: 0; max-width: 820px; }
.hero-img { flex: none; }
.hero-img img { max-height: 200px; width: auto; }
.hero-char { order: 2; margin-left: auto; }
.hero-char img { max-height: 320px; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.6)); }
.hero-tags { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0 0; }
.hero-sw { margin-top: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); }

.home-hero { position: relative; border-radius: 12px; overflow: hidden; min-height: 300px; display: flex; align-items: flex-end; border: 1px solid var(--line); }
.home-bg { position: absolute; inset: 0; }
.home-bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.75; }
.home-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(8, 9, 11, 0.96) 10%, rgba(8, 9, 11, 0.2) 70%); }
.home-txt { position: relative; padding: 30px; max-width: 760px; }
.home-txt .lead { color: #d5d6d2; font-size: 16px; }
.counts { color: var(--accent); font-family: var(--head); font-weight: 600; letter-spacing: 0.04em; margin: 0; }
.cls-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0 6px; }
.cls-mini {
  --c: var(--accent); display: flex; flex-direction: column; align-items: center; padding: 10px 6px 12px; border-radius: var(--rad); color: var(--text);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 22%, transparent), var(--panel)); border: 1px solid color-mix(in srgb, var(--c) 30%, var(--line));
}
.cls-mini img { height: 150px; width: auto; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.6)); transition: transform 0.2s; }
.cls-mini:hover { text-decoration: none; border-color: var(--c); }
.cls-mini:hover img { transform: translateY(-4px) scale(1.03); }
.cls-mini span { font: 700 16px var(--head); letter-spacing: 0.08em; margin-top: 6px; }
.cls-mini small { color: var(--c); font-size: 12px; }

/* --- sections & generic --- */
.sec { margin: 26px 0; }
.sec .sec { margin: 18px 0 0; }
.sec .sec h2 { font-size: 15px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.two > .sec, .two > div > .sec:first-child { margin-top: 0; }
.badge {
  --c: var(--muted); display: inline-block; font: 600 11.5px var(--head); letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 8px;
  border-radius: 4px; color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 60%, transparent); background: color-mix(in srgb, var(--c) 12%, transparent);
  white-space: nowrap; vertical-align: middle;
}
a.badge:hover { text-decoration: none; }
.badge.gold, .badge.def { --c: var(--accent); }
.badge.var { --c: #6fb3e8; }
.badge.b-shop { --c: #66b861; }
.badge.b-craft { --c: #6fb3e8; }
.badge.b-drop { --c: #d28a5e; }
.note { border: 1px solid rgba(237, 189, 82, 0.28); background: rgba(237, 189, 82, 0.07); padding: 8px 12px; border-radius: 4px; color: #ddd; }
.flavor { font-style: italic; color: #c3c5c0; }
.flavor.done { color: var(--muted); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0; margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--rad); overflow: hidden; }
.kv dt, .kv dd { margin: 0; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--muted); font-size: 13.5px; }
.kv dd { font-family: var(--head); font-weight: 500; }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }
.bul { margin: 0; padding-left: 20px; }
.bul li { margin: 6px 0; }
.bul li::marker { color: var(--accent); }
details.more { margin: 22px 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--rad); padding: 4px 14px; }
details.more summary { cursor: pointer; font: 700 14px var(--head); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); padding: 8px 0; }
.dots i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--accent); margin-right: 3px; vertical-align: middle; }
.dots i.on { background: var(--accent); }
.noimg { display: inline-block; width: 40px; height: 40px; border-radius: 6px; background: repeating-linear-gradient(45deg, #1a1d22, #1a1d22 4px, #14171b 4px, #14171b 8px); }

/* --- toolbar / chips --- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 16px; }
.filter { height: 36px; min-width: 220px; flex: 1 1 220px; max-width: 340px; background: var(--panel); border: 1px solid var(--line2); color: var(--text); border-radius: 6px; padding: 0 12px; font: inherit; }
.filter:focus { outline: none; border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chipbtn { font: 500 13px var(--body); color: var(--text); background: var(--panel); border: 1px solid var(--line2); border-radius: 20px; padding: 4px 12px; cursor: pointer; }
.chipbtn:hover { border-color: var(--accent); }
.chipbtn.on { background: var(--accent); border-color: var(--accent); color: #111; }
.chipbtn.on .rtxt { color: #111; }
.sortsel { color: var(--muted); font-size: 13px; }
.sortsel select { background: var(--panel); color: var(--text); border: 1px solid var(--line2); border-radius: 6px; height: 34px; padding: 0 8px; font: inherit; }
[data-row].hide { display: none !important; }

/* --- tables --- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--rad); background: var(--panel); -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  position: sticky; top: 0; background: var(--panel2); text-align: left; font: 600 12px var(--head); text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line2); white-space: nowrap;
}
.tbl th[data-sort] { cursor: pointer; user-select: none; }
.tbl th[data-sort="num"] { text-align: right; }
.tbl th[data-sort]::after { content: " ⇅"; opacity: 0.35; }
.tbl th.asc::after { content: " ▲"; opacity: 1; color: var(--accent); }
.tbl th.desc::after { content: " ▼"; opacity: 1; color: var(--accent); }
.tbl td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl td.n { font-family: var(--head); text-align: right; white-space: nowrap; }
.tbl td.hi { color: var(--accent); font-weight: 700; }
.tbl td.big { font-size: 20px; color: var(--accent); text-align: center; }
.tbl td.desc { color: #cfd1cc; min-width: 260px; }
.tbl td.nm { min-width: 200px; }
.tbl td.nm > .ico, .tbl td.nm > .noimg { vertical-align: middle; margin-right: 10px; float: left; }
.tbl td.nm > span, .tbl td.nm > b { display: block; overflow: hidden; padding-top: 2px; }
.tbl .ico { width: 40px; height: 40px; object-fit: contain; flex: none; }
.tbl.compact td, .tbl.compact th { padding: 6px 10px; }
.tbl tr:target { background: rgba(237, 189, 82, 0.1); }
.rowlink { display: flex; align-items: center; gap: 10px; color: var(--text); }
.rowlink img { width: 48px; height: 48px; object-fit: contain; border-radius: 6px; background: linear-gradient(180deg, transparent 55%, color-mix(in srgb, var(--rc) 35%, transparent)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 55%, transparent); }
.rowlink:hover { text-decoration: none; color: var(--accent2); }
.gets { white-space: nowrap; }
.fx { margin: 0; padding: 0; list-style: none; font-size: 13.5px; }
.fx li::before { content: "▸ "; }
.fx .good { color: #8fd18a; }
.fx .bad { color: #f08a7e; }

/* rarity */
.r-common { --rc: var(--r-common); }
.r-uncommon { --rc: var(--r-uncommon); }
.r-rare { --rc: var(--r-rare); }
.r-epic { --rc: var(--r-epic); }
.r-legendary { --rc: var(--r-legendary); }
.r-mythic { --rc: var(--r-mythic); }
.r-quest { --rc: var(--r-quest); }
.rtxt { color: var(--rc); font-weight: 600; }
.badge.rb { --c: var(--rc); }

/* --- item tiles & chips --- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.tile {
  display: flex; flex-direction: column; align-items: center; text-align: center; color: var(--text); background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--rad); padding: 10px 8px; transition: transform 0.12s, border-color 0.12s;
}
.tile:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--rc); }
.tile-img { width: 96px; height: 96px; display: grid; place-items: center; border-radius: 6px; background: linear-gradient(180deg, transparent 40%, color-mix(in srgb, var(--rc) 30%, transparent)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 50%, transparent); margin-bottom: 8px; }
.tile-img img { width: 84px; height: 84px; object-fit: contain; }
.tile-name { font-weight: 500; line-height: 1.25; font-size: 14px; }
.tile-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.ichips { display: flex; flex-wrap: wrap; gap: 6px; }
.ichip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; background: var(--panel2); border: 1px solid color-mix(in srgb, var(--rc) 40%, var(--line));
  border-radius: 6px; color: var(--text); font-size: 13.5px; line-height: 1.2;
}
.ichip:hover { text-decoration: none; border-color: var(--rc); }
.ichip .ico { width: 28px; height: 28px; object-fit: contain; border-radius: 4px; background: color-mix(in srgb, var(--rc) 22%, transparent); }
.ichip .cnt { color: var(--accent); font-family: var(--head); font-weight: 600; }
.ihead { display: flex; gap: 22px; align-items: center; background: var(--panel); border: 1px solid color-mix(in srgb, var(--rc) 40%, var(--line)); border-radius: var(--rad); padding: 18px 22px; margin-bottom: 20px; }
.ihead-img { width: 168px; height: 168px; flex: none; display: grid; place-items: center; border-radius: 8px; background: radial-gradient(circle at 50% 70%, color-mix(in srgb, var(--rc) 35%, transparent), transparent 70%); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 45%, transparent); }
.ihead-img img { width: 150px; height: 150px; object-fit: contain; }
.srcs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.srcs > li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--rad); padding: 10px 12px; }
.srcs .ichips { margin-top: 8px; }
.srcs .tbl-wrap { border: 0; }
.used { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.used .ichips { margin-top: 6px; }

/* weapon bars */
.bars { background: var(--panel); border: 1px solid var(--line); border-radius: var(--rad); padding: 12px 14px; display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 120px 1fr 64px; gap: 10px; align-items: center; font-size: 13.5px; }
.bar-l { color: var(--muted); }
.bar-t { height: 8px; background: #1d2126; border-radius: 4px; overflow: hidden; }
.bar-t i { display: block; height: 100%; background: linear-gradient(90deg, #b8872c, var(--accent)); border-radius: 4px; }
.bar-v { font-family: var(--head); text-align: right; }

/* home categories */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.cat {
  display: grid; grid-template-columns: 72px 1fr; grid-template-rows: auto 1fr; column-gap: 14px; align-items: center; padding: 14px; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--rad); min-height: 96px; transition: border-color 0.15s, transform 0.15s;
}
.cat:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.cat-img { grid-row: 1 / 3; width: 72px; height: 72px; display: grid; place-items: center; overflow: hidden; border-radius: 6px; background: var(--panel2); }
.cat-img img { width: 64px; height: 64px; object-fit: contain; }
.cat-art .cat-img img { height: 72px; width: auto; object-fit: cover; object-position: top; }
.cat-map .cat-img img { width: 100%; height: 100%; object-fit: cover; }
.cat-t { font: 700 16px var(--head); letter-spacing: 0.04em; align-self: end; }
.cat-d { color: var(--muted); font-size: 13px; line-height: 1.35; align-self: start; }
.tips { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.tips li { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; color: #d2d4cf; font-size: 14px; }

/* --- classes --- */
.cls-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cls-card {
  --c: var(--accent); display: flex; flex-direction: column; color: var(--text); border-radius: 10px; overflow: hidden; border: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 26%, var(--panel)) 0%, var(--panel) 62%); transition: transform 0.15s, border-color 0.15s;
}
.cls-card:hover { text-decoration: none; border-color: var(--c); transform: translateY(-3px); }
.cls-art { height: 300px; display: grid; place-items: end center; padding-top: 12px; }
.cls-art img { max-height: 290px; width: auto; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55)); }
.cls-body { display: grid; gap: 6px; padding: 14px 16px 18px; border-top: 1px solid color-mix(in srgb, var(--c) 45%, transparent); position: relative; }
.cls-body b { font: 700 22px var(--head); letter-spacing: 0.1em; text-transform: uppercase; color: var(--c); }
.cls-body .badge { --c: inherit; justify-self: start; }
.cls-emb { position: absolute; right: 14px; top: -22px; width: 44px; height: 44px; border-radius: 8px; background: var(--panel2); border: 1px solid var(--c); display: grid; place-items: center; }
.cls-emb img { width: 32px; height: 32px; }
.cls-role { color: #cfd1cc; font-size: 14px; }
.cls-diff { color: var(--muted); font-size: 13px; }
.slot { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; overflow: hidden; }
.slot-h { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--panel2); border-bottom: 1px solid var(--line); font-family: var(--head); letter-spacing: 0.06em; text-transform: uppercase; }
.key { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border: 1px solid var(--accent); border-bottom-width: 3px; border-radius: 5px; color: var(--accent); font: 700 14px var(--head); }
.slot-opts { display: grid; grid-template-columns: 1fr 1fr; }
.slot-opts .skill + .skill { border-left: 1px solid var(--line); }
.skill { display: flex; gap: 14px; padding: 14px; }
.skill-ico { flex: none; width: 64px; height: 64px; border-radius: 10px; background: #1a1e23; border: 1px solid var(--line2); display: grid; place-items: center; }
.skill-ico img { width: 56px; height: 56px; }
.skill-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.skill-h b { font: 700 16px var(--head); }
.skill p { margin: 6px 0; color: #d0d2cd; font-size: 14px; }
.skill-meta { font-size: 13px; color: var(--muted); }
.skill-meta b { color: var(--text); font-family: var(--head); }
.tag { color: var(--accent); font-family: var(--head); font-size: 12px; letter-spacing: 0.05em; }
.skill-unlock { margin-top: 6px; font-size: 13px; color: #cfd1cc; background: rgba(255, 255, 255, 0.03); border-radius: 4px; padding: 4px 8px; }
.skill-unlock span { color: var(--accent); }
.skill.locked { opacity: 0.6; }

/* run level cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.rlcard {
  --c: #b8bdc2; position: relative; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 18%, var(--panel)) 0%, var(--panel) 45%); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--c) 70%, transparent); border-radius: 10px; padding: 12px 14px 14px; text-align: center;
}
.rlcard:target { box-shadow: 0 0 0 2px var(--accent); }
.rl-top { display: flex; justify-content: space-between; font: 600 11px var(--head); letter-spacing: 0.08em; text-transform: uppercase; }
.rl-rar { color: var(--c); }
.rl-cls { color: var(--muted); }
.rl-ico { margin: 10px auto 6px; width: 76px; height: 76px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--c) 28%, transparent), transparent 70%); }
.rl-ico img { width: 60px; height: 60px; }
.rl-name { font: 700 16px var(--head); margin-bottom: 8px; }
.rl-fx { list-style: none; margin: 0; padding: 0; text-align: left; font-size: 13.5px; display: grid; gap: 4px; }
.roman { display: inline-block; width: 26px; color: var(--c); font: 700 12px var(--head); }
.card-note { margin-top: 8px; font-size: 12px; color: var(--accent); }

/* chapters */
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.ch-card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; color: var(--text); }
a.ch-card:hover { text-decoration: none; border-color: var(--accent); }
.ch-card.off { opacity: 0.72; }
.ch-img { aspect-ratio: 16 / 9; display: block; overflow: hidden; background: #0c0e10; }
.ch-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
a.ch-card:hover .ch-img img { transform: scale(1.04); }
.soon { --c: #333; display: grid; place-items: center; width: 100%; height: 100%; font: 700 15px var(--head); letter-spacing: 0.2em; color: rgba(255, 255, 255, 0.55); background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 60%, #000), color-mix(in srgb, var(--c) 60%, #000) 12px, color-mix(in srgb, var(--c) 45%, #000) 12px, color-mix(in srgb, var(--c) 45%, #000) 24px); }
.ch-b { display: grid; gap: 2px; padding: 12px 14px 14px; }
.ch-b small { color: var(--accent); font: 600 12px var(--head); letter-spacing: 0.1em; text-transform: uppercase; }
.ch-b b { font: 700 19px var(--head); }
.ch-stat { font-size: 13px; color: #cfd1cc; margin-top: 4px; }
.maps { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-bottom: 8px; align-items: start; }
.maps figure { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.maps img { display: block; width: 100%; }
.maps figcaption { padding: 6px 10px; color: var(--muted); font-size: 12px; }
.chain { margin: 0; padding-left: 22px; display: grid; gap: 6px; }

/* enemies */
.ecards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.ecard {
  display: flex; flex-direction: column; align-items: center; padding: 12px 10px; color: var(--text); text-align: center;
  background: linear-gradient(180deg, rgba(192, 83, 63, 0.14), var(--panel) 70%); border: 1px solid var(--line); border-radius: 10px;
}
.ecard.boss { background: linear-gradient(180deg, rgba(168, 53, 43, 0.3), var(--panel) 70%); border-color: rgba(235, 92, 77, 0.35); }
.ecard:hover { text-decoration: none; border-color: var(--danger); }
.ecard img { height: 170px; width: auto; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.6)); }
.ecard b { font: 700 15px var(--head); margin-top: 8px; letter-spacing: 0.04em; }
.ecard small { color: var(--muted); font-size: 12px; }
.moves { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.move { background: var(--panel); border: 1px solid rgba(235, 92, 77, 0.3); border-radius: 8px; padding: 10px 14px; }
.move b { font: 700 16px var(--head); color: #f39a8e; }
.move p { margin: 4px 0 0; font-size: 14px; color: #d0d2cd; }

/* quests */
.qlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: q; }
.qrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; color: var(--text); }
.qrow:hover { text-decoration: none; border-color: var(--accent); }
.qrow .muted { margin-left: auto; }
.qn { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--accent); color: var(--accent); font: 700 13px var(--head); flex: none; }
.rewards { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.reward { font: 700 16px var(--head); color: var(--accent); background: rgba(237, 189, 82, 0.08); border: 1px solid rgba(237, 189, 82, 0.3); border-radius: 6px; padding: 4px 10px; }
.spoiler { position: relative; cursor: pointer; border-radius: 8px; }
.spoiler .spoiler-body { filter: blur(7px); transition: filter 0.2s; user-select: none; }
.spoiler-tag { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; font: 700 13px var(--head); letter-spacing: 0.08em; color: var(--accent); text-transform: uppercase; }
.spoiler.revealed { cursor: auto; }
.spoiler.revealed .spoiler-body { filter: none; user-select: auto; }
.spoiler.revealed .spoiler-tag { display: none; }

/* guide */
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.toc a { background: var(--panel); border: 1px solid var(--line2); border-radius: 20px; padding: 4px 12px; color: var(--text); font-size: 13.5px; }
.toc a:hover { border-color: var(--accent); text-decoration: none; }
.links { margin: 0; padding-left: 20px; }
.nf404 { text-align: center; padding: 80px 0; }
.nf404 h1 { font-size: 80px; color: var(--accent); }

/* --- responsive --- */
@media (max-width: 1100px) {
  .two { grid-template-columns: 1fr; }
  .slot-opts { grid-template-columns: 1fr; }
  .slot-opts .skill + .skill { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 860px) {
  :root { --top: 56px; }
  .burger { display: block; }
  .side {
    position: fixed; left: 0; top: var(--top); z-index: 40; height: calc(100vh - var(--top)); background: var(--bg2); transform: translateX(-100%);
    transition: transform 0.2s; box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5); width: 260px;
  }
  body.nav-open .side { transform: none; }
  main { padding: 16px 16px 50px; }
  .brand-t { display: none; }
  .top { gap: 10px; padding: 0 10px; }
  .hero { flex-direction: column; align-items: flex-start; padding: 18px; }
  .hero-char { order: 0; margin: 0 auto; }
  .hero-char img { max-height: 240px; }
  .cls-strip { grid-template-columns: repeat(2, 1fr); }
  .ihead { flex-direction: column; align-items: flex-start; }
  .maps { grid-template-columns: 1fr; }
  .bar { grid-template-columns: 96px 1fr 58px; }
  .home-txt { padding: 20px; }
  .filter { max-width: none; }
}
@media (max-width: 480px) {
  .tiles { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .tile-img { width: 76px; height: 76px; }
  .tile-img img { width: 66px; height: 66px; }
  .cats { grid-template-columns: 1fr; }
  .brand-w { display: none; }
  .lang { padding: 6px 8px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* home hero: แผนที่บทแรกเป็นพื้น + โลโก้เกม (พื้นมืดกลืนด้วย lighten) */
.home-bg img { opacity: 0.38; filter: saturate(0.8); object-position: 30% 40%; }
.home-logo { position: absolute; right: 2%; top: 0; bottom: 0; display: flex; align-items: center; width: min(46%, 560px); pointer-events: none; mix-blend-mode: lighten; }
.home-logo img { display: block; width: 100%; }
.home-txt { z-index: 1; }
@media (max-width: 860px) { .home-logo { position: relative; right: auto; width: 80%; margin: 0 auto -40px; } .home-hero { flex-direction: column; align-items: stretch; } }
