/* SUVARNA วิกิ (สุวรรณภูมิ ภาค 1 ขวัญอีสาน) — the game's own colours: dark forest green, parchment ink, gold. */
:root {
  --bg: #111913; --panel: #19241c; --panel-2: #213026; --line: #34463a;
  --ink: #f1e6c4; --dim: #aea58f; --accent: #ffe27a; --gold: #d9b27a; --link: #ffd98a;
  --main: #ffa94d; --warn: #e0533f; --good: #7ddc6a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); overflow-x: hidden;
  /* The Isan textile (img/site/texture.jpg) under a dark veil, so text keeps its contrast. */
  background: linear-gradient(rgba(12, 18, 14, .84), rgba(12, 18, 14, .88)), url(img/site/texture.jpg) repeat, var(--bg);
  background-size: auto, 384px 384px, auto;
  font: 16px/1.65 system-ui, -apple-system, "Sukhumvit Set", "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.8rem; line-height: 1.3; margin: .2em 0 .3em; }
h2 { font-size: 1.25rem; margin: 1.6em 0 .5em; color: var(--accent); border-bottom: 1px solid var(--line); padding-bottom: .2em; }
h2.group { color: var(--gold); border: 0; font-size: 1.1rem; text-transform: none; margin-top: 2em; }
h3 { font-size: 1.05rem; margin: 1.2em 0 .4em; }
p { margin: .5em 0; }
.dim, .none { color: var(--dim); }
.en { color: var(--dim); margin: 0; font-style: italic; }
.lead { font-size: 1.08rem; max-width: 60em; }

/* header */
.top {
  position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  padding: 10px 16px; background: rgba(17, 25, 19, .96); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px);
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.2rem; color: var(--accent); white-space: nowrap; letter-spacing: .08em; }
.brand img { width: 30px; height: 30px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); }
.brand small { letter-spacing: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.brand small { color: var(--dim); font-weight: 400; font-size: .85rem; }
.top nav { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: .95rem; }
.top nav a { color: var(--ink); white-space: nowrap; flex: none; }
.search { position: relative; flex: 1 1 220px; max-width: 360px; margin-left: auto; }
.search input, input.filter {
  width: 100%; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); font: inherit; font-size: .95rem;
}
input.filter { max-width: 360px; margin: 6px 0 10px; }
#hits {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; max-height: 70vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
#hits a { display: flex; justify-content: space-between; gap: 10px; padding: 7px 12px; color: var(--ink); border-bottom: 1px solid var(--line); }
#hits a:last-child { border-bottom: 0; }
#hits a:hover, #hits a.on { background: var(--panel-2); text-decoration: none; }
#hits small { color: var(--dim); white-space: nowrap; }
.play { white-space: nowrap; padding: 6px 14px; border-radius: 8px; background: #2f5a2a; color: #fff; font-weight: 600; }

main { max-width: 1120px; margin: 0 auto; padding: 16px 16px 48px; }
footer { text-align: center; color: var(--dim); font-size: .85rem; padding: 24px 16px 40px; border-top: 1px solid var(--line); }
.crumbs { font-size: .9rem; color: var(--dim); margin: 0 0 8px; }

/* entity pages */
.hero { display: flex; gap: 20px; align-items: flex-start; margin: 8px 0 12px; }
.hero > div { min-width: 0; }
.desc { color: var(--ink); opacity: .92; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 12px 0; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.facts dt { color: var(--dim); }
.facts dd { margin: 0; }
blockquote { margin: .6em 0; padding: .6em 1em; border-left: 3px solid var(--gold); background: var(--panel); border-radius: 0 8px 8px 0; font-style: italic; }
.quotes li { font-style: italic; color: var(--ink); }
.rewards { font-size: 1.02rem; }
kbd { display: inline-block; min-width: 1.8em; padding: 1px 7px; border: 1px solid var(--gold); border-bottom-width: 3px; border-radius: 6px; background: var(--panel-2); font: 600 .9rem/1.4 system-ui, sans-serif; text-align: center; }

/* icons and links to things */
.icon, .thumb, .portrait { image-rendering: pixelated; vertical-align: middle; }
.icon { display: inline-block; object-fit: contain; border-radius: 4px; background: rgba(0,0,0,.25); }
.icon.ph { display: inline-grid; place-items: center; background: #3a3a34; color: var(--dim); font-size: .8rem; }
.thumb { object-fit: contain; }
.thumb.ph { display: inline-grid; place-items: center; }
.portrait { object-fit: contain; }
.hero .icon, .hero .thumb, .hero .portrait { flex: none; }
.hero .portrait { max-height: 160px; }
.classart { width: 220px; max-width: 40vw; border-radius: 10px; border: 1px solid var(--line); flex: none; }
.ref { display: inline-flex; align-items: center; gap: 6px; }
.count { color: var(--dim); }
.lv { color: var(--dim); font-size: .88rem; }
.coin { color: var(--gold); font-size: .9em; }
.tag { display: inline-block; padding: 0 8px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); font-size: .8rem; color: var(--ink); line-height: 1.7; white-space: nowrap; }
.tag.boss { background: #5a1f1a; border-color: #b8352a; color: #ffd0c8; }
.tag.main { background: #4a2f12; border-color: var(--main); color: #ffd9a8; }
.tag.warn { border-color: var(--warn); color: #ffb0a4; }

/* tables */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 8px 0 14px; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th { text-align: left; font-weight: 600; color: var(--dim); background: var(--panel); position: sticky; top: 0; }
th, td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:nth-child(odd) { background: rgba(255,255,255,.015); }
tbody tr:hover { background: var(--panel); }
tr[hidden] { display: none; }
td:target, span:target { outline: 2px solid var(--accent); border-radius: 4px; }
/* A jump to a heading on the page (#id) lands below the sticky header, not under it: wiki.js sets --top to the
   header's height, which wraps to two rows on narrower screens; these are only the guesses before it runs. */
:root { --top: 72px; }
main [id] { scroll-margin-top: calc(var(--top) + 12px); }
/* ดันเจี้ยน: the menu of every dungeon, lowest level first, and the way back to it under each one. */
.cards.dungeon-menu { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin: 16px 0 24px; }
.cards.dungeon-menu .card { padding: 10px 12px; gap: 2px; }
.cards.dungeon-menu small { color: var(--gold); font-weight: 600; }
.cards.dungeon-menu b { font-size: 1rem; }
section:target > h2 { color: var(--accent); }
.back { margin: 14px 0 0; font-size: .92rem; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin: 12px 0; }
/* The home page's rows of six, and the four parts of the road map, fill the width in one line. */
.cards.six { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.cards.roadmap { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.card {
  display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink);
  background: linear-gradient(160deg, rgba(33, 48, 38, .92), rgba(25, 36, 28, .92)); box-shadow: 0 1px 0 rgba(255, 226, 122, .05) inset;
}
.card:hover { border-color: var(--gold); text-decoration: none; box-shadow: 0 0 0 1px rgba(217, 178, 122, .25), 0 6px 18px rgba(0, 0, 0, .35); }
main h1:not(.sr)::after { content: ""; display: block; width: 140px; height: 3px; margin-top: 6px; border-radius: 2px; background: linear-gradient(90deg, var(--gold), rgba(217, 178, 122, 0)); }
.card b { font-size: 1.05rem; }
.card span, .card small { color: var(--dim); font-size: .9rem; }
.card.stat b { font-size: 1.7rem; color: var(--accent); }
.card.person { align-items: center; text-align: center; }
.card.person .portrait { height: 72px; }
/* Class paintings are tall with the face near the top: a square crop held to the top keeps every face in. */
.card.class img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; object-position: 50% 8%; border-radius: 8px; }

/* road map */
.roadmap .part { position: relative; }
.roadmap .part small { color: var(--gold); font-size: .85rem; }
.roadmap .part b { font-size: 1.3rem; }
.roadmap .part em { font-style: normal; font-size: .82rem; color: var(--dim); margin-top: 4px; }
.roadmap .part.now { border-color: var(--gold); background: linear-gradient(160deg, #2a3a1f, var(--panel)); }
.roadmap .part.now em { color: var(--good); }
.roadmap .part .badge { width: 100%; max-height: 72px; object-fit: contain; margin: -4px 0 4px; filter: drop-shadow(0 3px 6px rgba(0,0,0,.5)); }
/* Parts still to come keep their plaque a little dimmer than the one being played. */
.roadmap .part:not(.now) .badge { filter: drop-shadow(0 3px 6px rgba(0,0,0,.5)) saturate(.75) brightness(.85); }
h2 .more { float: right; font-size: .9rem; font-weight: 400; }

/* home: the key art across the whole width, the logo on its darker left */
.welcome {
  position: relative; margin: -16px calc(50% - 50vw) 12px; padding: 64px max(16px, calc(50vw - 544px)) 56px;
  background: linear-gradient(90deg, rgba(10, 15, 11, .94) 0%, rgba(10, 15, 11, .74) 36%, rgba(10, 15, 11, .12) 72%, rgba(10, 15, 11, 0) 100%),
    linear-gradient(0deg, rgba(17, 25, 19, 1) 0%, rgba(17, 25, 19, 0) 22%), url(img/site/hero.webp) center / cover no-repeat;
  border-bottom: 1px solid rgba(217, 178, 122, .25);
}
.welcome .logo { display: block; width: min(600px, 92%); height: auto; margin: 0 0 6px -8px; filter: drop-shadow(0 8px 22px rgba(0, 0, 0, .65)); }
.welcome .tagline { text-shadow: 0 2px 8px rgba(0,0,0,.8); }
.welcome .part { text-shadow: 0 2px 8px rgba(0,0,0,.8); }
.welcome .lead { max-width: 34em; text-shadow: 0 2px 8px rgba(0,0,0,.85); }
.welcome h1 { font-size: 2.6rem; color: var(--accent); margin-bottom: 0; }
.welcome h1 { letter-spacing: .12em; }
.welcome .tagline { font-size: 1.05rem; color: var(--ink); margin: 0; letter-spacing: .04em; font-style: italic; }
.welcome .part { font-size: 1.2rem; color: var(--gold); margin: 0 0 .6em; letter-spacing: .02em; }
.welcome .part span { color: var(--dim); font-style: italic; margin-left: .4em; }
.button { display: inline-block; padding: 9px 20px; border-radius: 10px; background: #2f5a2a; color: #fff; font-weight: 600; margin: 4px 8px 4px 0; }
.button.ghost { background: transparent; border: 1px solid var(--gold); color: var(--gold); }

/* world map */
.worldmap { position: relative; max-width: 760px; margin: 12px auto 20px; }
.worldmap img { width: 100%; display: block; border-radius: 12px; border: 1px solid var(--line); }
/* A pin is a point: the dot is centred on it, the name sits on the side the game's map says. */
.pin { position: absolute; width: 0; height: 0; color: #fff; font-size: .82rem; white-space: nowrap; }
.pin i { position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2px solid #1a120a; box-shadow: 0 0 0 2px rgba(255,226,122,.35); }
.pin.capital i { left: -9px; top: -9px; width: 18px; height: 18px; background: #ff8a3d; }
.pin.dungeon i { background: #b98cff; border-radius: 3px; }
.pin span { position: absolute; background: rgba(17,25,19,.85); padding: 1px 6px; border-radius: 6px; }
.pin.right span { left: 12px; top: 0; transform: translateY(-50%); }
.pin.left span { right: 12px; top: 0; transform: translateY(-50%); }
.pin.above span { bottom: 11px; left: 0; transform: translateX(-50%); }
.pin.below span { top: 11px; left: 0; transform: translateX(-50%); }
.pin small { color: var(--dim); }
.pin:hover span { background: #2f5a2a; text-decoration: none; }

@media (max-width: 640px) {
  body { font-size: 15px; }
  h1 { font-size: 1.45rem; }
  .top { padding: 8px 12px; }
  .top nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; gap: 16px; padding-bottom: 4px; scrollbar-width: none; }
  .top nav::-webkit-scrollbar { display: none; }
  .search { order: 2; max-width: none; }
  .play { order: 1; margin-left: auto; }
  main { padding: 12px 12px 40px; }
  .hero { flex-direction: column; }
  .facts { grid-template-columns: 1fr; gap: 0 0; }
  .facts dd { margin-bottom: 8px; }
  .pin span { display: none; }
  .welcome { padding: 36px 16px 32px; background: linear-gradient(0deg, rgba(17, 25, 19, 1) 0%, rgba(10, 15, 11, .55) 45%, rgba(10, 15, 11, .75) 100%), url(img/site/hero-768.webp) center / cover no-repeat; }
  .welcome .logo { margin-left: -4px; }
  .cards.six:has(.stat) { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .cards.six .stat { padding: 10px 12px; }
  .cards.roadmap { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .cards.roadmap .part { padding: 10px 12px; }
  .cards.roadmap .part.now { grid-column: 1 / -1; }
  th, td { padding: 6px 8px; }
  :root { --top: 112px; }
  .cards.dungeon-menu { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

/* Pictures of the game in the guides (guide-*.webp): full width, a click opens the picture itself. */
.shot { margin: 12px 0 16px; max-width: 760px; }
.shot.wide { max-width: none; }
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.shots .shot { max-width: none; margin: 4px 0; }
.shot img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.shot figcaption { margin-top: 6px; color: var(--dim); font-size: .92rem; }
/* The numbered parts of the in-game screen, matching the gold numbers on its picture. */
ol.legend { padding-left: 0; list-style: none; counter-reset: part; }
ol.legend li { counter-increment: part; position: relative; padding: 4px 0 4px 38px; }
ol.legend li::before { content: counter(part); position: absolute; left: 0; top: 3px; width: 26px; height: 26px; border-radius: 50%; background: #f2c45c; color: #28180a; font-weight: 700; text-align: center; line-height: 26px; box-shadow: 0 0 0 2px #140e06; }

/* docs/PATCH_NOTES.md: the อัปเดต page and the latest note on the home page */
.patch { border: 1px solid rgba(217, 178, 122, .35); border-radius: 8px; padding: 10px 16px; margin: 0 0 14px; background: rgba(0, 0, 0, .18); }
.patch h2 { margin: 4px 0 8px; font-size: 1.15rem; color: var(--gold); }
.patch h2 small { color: var(--dim); font-weight: normal; font-size: .85rem; margin-left: 8px; }
.patch ul { margin: 0; padding-left: 20px; }
.patch li { margin: 3px 0; }
.patch-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin: 10px 0 4px; }
.patch-shots img { width: 100%; height: auto; display: block; border-radius: 6px; border: 1px solid rgba(217, 178, 122, .35); }

/* ตัวกล้า (Elite): the gold of the in-game name */
.tag.elite { color: #2a1a04; background: #f2c45c; border-color: #f2c45c; font-weight: 700; }
