/* Oathfall — Knights of Winterstead: the site's look (home page + database). Colours of the launcher (launcher\Theme.cs). */
:root {
  --night: #0a0d16;
  --bg: #0d1220;
  --panel: #131a2b;
  --panel-2: #182136;
  --panel-3: #1e2943;
  --line: #27324c;
  --line-2: #33415f;
  --text: #dfe7f5;
  --muted: #8f9cb8;
  --faint: #66728d;
  --ice: #84c4ff;
  --ice-deep: #224e9e;
  --frost: #d6e4f5;
  --gold: #f6c453;
  --gold-dark: #d68a1e;
  --blood: #c84a42;
  --green: #6fd28a;
  --violet: #b590ff;
  --win-title-1: #768cc4;
  --win-title-2: #4a609c;
  --win-bg: #f4f6fb;
  --win-text: #28304a;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "Cormorant SC", "Cormorant", Georgia, serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ice); text-decoration: none; }
a:hover { color: #b6dcff; text-decoration: underline; }
img.px { image-rendering: pixelated; }
button, input, select { font: inherit; color: inherit; }
::selection { background: rgba(132, 196, 255, .35); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 28px; border-radius: 8px; border: 1px solid transparent;
  font-weight: 700; letter-spacing: .02em; cursor: pointer; text-decoration: none !important;
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn-gold {
  color: #3e2406; background: linear-gradient(#ffd66e, var(--gold) 45%, var(--gold-dark));
  border-color: #784a0a; box-shadow: 0 0 0 1px rgba(255, 214, 110, .25), 0 8px 28px rgba(246, 196, 83, .25);
}
.btn-gold:hover { color: #3e2406; }
.btn-ice {
  color: #fff; background: linear-gradient(#68a8f5, var(--ice-deep));
  border-color: #cde6ff; box-shadow: 0 0 18px rgba(132, 196, 255, .25);
}
.btn-ice:hover { color: #fff; }
.btn-ghost { color: var(--text); background: rgba(255, 255, 255, .04); border-color: var(--line-2); min-height: 38px; padding: 0 14px; font-weight: 600; }
.btn-ghost:hover { color: var(--text); background: rgba(255, 255, 255, .08); }
.btn-lg { min-height: 60px; padding: 0 40px; font-size: 19px; }

.lang-switch { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.lang-switch button {
  background: transparent; border: 0; padding: 6px 12px; cursor: pointer; color: var(--muted); font-weight: 700; font-size: 13px;
}
.lang-switch button.on { background: var(--panel-3); color: var(--text); }

/* ---------- home ---------- */
.home {
  min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column;
  background: linear-gradient(0deg, var(--night) 0, rgba(10, 13, 22, 0) 30%),
              linear-gradient(90deg, var(--night) 0, var(--night) 30%, rgba(10, 13, 22, .7) 52%, rgba(10, 13, 22, .05) 80%),
              url("/assets/hero.webp") right top / auto 100% no-repeat, var(--night);
}
.home-top { display: flex; justify-content: flex-end; padding: 18px 24px; }
.home-main { flex: 1; display: flex; align-items: center; padding: 24px clamp(16px, 7vw, 120px); }
.home-card { max-width: 620px; }
.home-kicker { color: var(--ice); text-transform: uppercase; letter-spacing: .3em; font-size: 13px; font-weight: 700; }
.home h1 {
  font-family: var(--display); font-weight: 700; margin: 6px 0 0; line-height: .95;
  font-size: clamp(56px, 11vw, 120px); color: #eef3fb;
  text-shadow: 0 2px 0 #3a4560, 0 0 40px rgba(132, 196, 255, .35);
}
.home h2 { font-family: var(--display); font-weight: 600; font-size: clamp(22px, 3.4vw, 34px); margin: 4px 0 22px; color: var(--frost); }
.home p { color: #c3cde0; font-size: 17px; max-width: 520px; margin: 0 0 30px; }
.home-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.home-note {
  margin-top: 34px; display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px;
  padding: 8px 14px; border: 1px dashed var(--line-2); border-radius: 999px; background: rgba(10, 13, 22, .5);
}
.home-note::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.home-foot { padding: 16px 24px; color: var(--faint); font-size: 13px; text-align: center; }

/* ---------- database layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; background: rgba(13, 18, 32, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { max-width: 1240px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: baseline; gap: 8px; color: var(--text) !important; text-decoration: none !important; white-space: nowrap; }
.brand b { font-family: var(--display); font-size: 26px; letter-spacing: .02em; }
.brand span { color: var(--muted); font-size: 13px; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--muted); padding: 8px 12px; border-radius: 8px; font-weight: 600; text-decoration: none; }
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.nav a.on { color: var(--text); background: var(--panel-3); }
.search { position: relative; z-index: 15; flex: 1; max-width: 420px; margin-left: auto; }
.search input {
  width: 100%; height: 40px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel);
  padding: 0 12px 0 36px; outline: none;
}
.search input:focus { border-color: var(--ice); box-shadow: 0 0 0 3px rgba(132, 196, 255, .15); }
.search svg { position: absolute; left: 11px; top: 11px; width: 18px; height: 18px; color: var(--muted); }
.suggest {
  position: absolute; left: 0; right: 0; top: 46px; background: var(--panel); border: 1px solid var(--line-2);
  border-radius: 10px; box-shadow: var(--shadow); max-height: 70vh; overflow: auto; display: none;
}
.suggest.open { display: block; }
.suggest h6 { margin: 0; padding: 8px 12px 4px; color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.suggest a { display: flex; align-items: center; gap: 10px; padding: 6px 12px; color: var(--text); text-decoration: none; }
.suggest a:hover, .suggest a.sel { background: var(--panel-3); }
.suggest .id { margin-left: auto; color: var(--faint); font-size: 12px; }

main.page { max-width: 1240px; margin: 0 auto; padding: 22px 20px 60px; }
.crumbs { color: var(--faint); font-size: 13px; margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.footer { color: var(--faint); font-size: 12px; text-align: center; padding: 24px; border-top: 1px solid var(--line); }

h1.title { font-family: var(--display); font-size: 40px; line-height: 1.05; margin: 0; }
.sub { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px;
  font-weight: 700; border: 1px solid var(--line-2); color: var(--muted); background: rgba(255, 255, 255, .03); white-space: nowrap;
}
.chip.gold { color: var(--gold); border-color: rgba(246, 196, 83, .45); background: rgba(246, 196, 83, .08); }
.chip.ice { color: var(--ice); border-color: rgba(132, 196, 255, .45); background: rgba(132, 196, 255, .08); }
.chip.red { color: #ff8a80; border-color: rgba(200, 74, 66, .55); background: rgba(200, 74, 66, .1); }
.chip.green { color: var(--green); border-color: rgba(111, 210, 138, .45); background: rgba(111, 210, 138, .08); }
.chip.violet { color: var(--violet); border-color: rgba(181, 144, 255, .45); background: rgba(181, 144, 255, .08); }
.chip.dim { opacity: .75; }
button.chip { cursor: pointer; }
button.chip.on { color: var(--night); background: var(--ice); border-color: var(--ice); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.card > h3, .section > h3 {
  margin: 0; padding: 12px 16px; font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px;
}
.card > h3 .n, .section > h3 .n { color: var(--faint); font-weight: 600; letter-spacing: 0; text-transform: none; }
.card-body { padding: 14px 16px; }
.section { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 18px; overflow: hidden; }
.empty { color: var(--faint); padding: 14px 16px; font-size: 14px; }

/* ---------- db home ---------- */
.hero-db { text-align: center; padding: 34px 0 20px; }
.hero-db h1 { font-family: var(--display); font-size: clamp(36px, 6vw, 56px); margin: 0; }
.hero-db p { color: var(--muted); margin: 6px 0 22px; }
.hero-db .search { max-width: 640px; margin: 0 auto; }
.hero-db .search input { height: 52px; font-size: 17px; padding-left: 44px; border-radius: 12px; }
.hero-db .search svg { left: 15px; top: 16px; width: 20px; height: 20px; }
.hero-db .suggest { top: 58px; text-align: left; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 26px; }
.tile {
  display: block; padding: 22px; border-radius: 14px; background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); color: var(--text) !important; text-decoration: none !important; position: relative; overflow: hidden;
  transition: border-color .15s ease, transform .15s ease;
}
.tile:hover { border-color: var(--ice); transform: translateY(-2px); }
.tile b { display: block; font-family: var(--display); font-size: 28px; }
.tile span { color: var(--muted); font-size: 14px; }
.tile strong { display: block; font-size: 34px; line-height: 1.1; margin: 6px 0 2px; color: var(--ice); font-variant-numeric: tabular-nums; }
.quick { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* ---------- lists ---------- */
.list-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin-bottom: 14px; }
.list-head h1 { margin-right: auto; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.filters .grow { flex: 1; }
.filter-input { height: 36px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); padding: 0 12px; min-width: 220px; outline: none; }
.filter-input:focus { border-color: var(--ice); }
select.filter-input { min-width: 0; padding-right: 8px; }
label.check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; cursor: pointer; user-select: none; }

table.grid { width: 100%; border-collapse: collapse; }
table.grid th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint);
  padding: 10px 12px; border-bottom: 1px solid var(--line); font-weight: 700; white-space: nowrap;
}
table.grid th.sortable { cursor: pointer; }
table.grid th.sortable:hover { color: var(--text); }
table.grid td { padding: 7px 12px; border-bottom: 1px solid rgba(39, 50, 76, .6); vertical-align: middle; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid tbody tr:hover td { background: rgba(132, 196, 255, .04); }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
.dim-row td { opacity: .5; }
.ref { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.ref img.ic { width: 24px; height: 24px; flex: none; }
.ref .nm { font-weight: 600; }
.ref .alt { color: var(--faint); font-size: 12px; }
.icon-box { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.mob-thumb { width: 44px; height: 44px; object-fit: contain; flex: none; }
.pager { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pager button { min-width: 38px; height: 36px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; }
.pager button.on { background: var(--ice-deep); border-color: var(--ice); }
.pager button:disabled { opacity: .4; cursor: default; }
.count { color: var(--muted); font-size: 14px; }

/* ---------- entity pages ---------- */
.head { display: flex; gap: 18px; align-items: center; margin-bottom: 18px; }
.head .big-icon {
  width: 72px; height: 72px; flex: none; border-radius: 14px; background: radial-gradient(circle at 50% 35%, var(--panel-3), var(--panel));
  border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center;
}
.head .big-icon img { width: 48px; height: 48px; }
.head .alt-name { color: var(--muted); margin-top: 2px; }
.head .chips { margin-top: 8px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }

/* the item window as in the game */
.rowin { border-radius: 6px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid #1d2a4d; }
.rowin-title {
  background: linear-gradient(var(--win-title-1), var(--win-title-2)); color: #fff; font-weight: 700; font-size: 13px;
  padding: 5px 10px; text-shadow: 0 1px 0 rgba(0, 0, 0, .35); display: flex; justify-content: space-between; gap: 8px;
}
.rowin-body { background: var(--win-bg); color: var(--win-text); display: flex; gap: 14px; padding: 12px; min-height: 140px; }
.rowin-pic { flex: none; width: 92px; display: flex; align-items: flex-start; justify-content: center; }
.rowin-pic img { max-width: 92px; image-rendering: pixelated; }
.rowin-text { font: 13px/1.55 "Segoe UI", Tahoma, Arial, sans-serif; white-space: pre-wrap; word-break: break-word; min-width: 0; flex: 1; }
.rowin-text a { color: #0b4fc4; text-decoration: underline; }
.rowin-text .navi { color: #0b8a3a; }
.rowin-text .link { color: #0b4fc4; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats > div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 16px; border-bottom: 1px solid rgba(39, 50, 76, .6); }
.stats > div:nth-child(odd) { border-right: 1px solid rgba(39, 50, 76, .6); }
.stats dt { color: var(--muted); }
.stats dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.stats.one { grid-template-columns: 1fr; }
.stats.one > div { border-right: 0 !important; }
.stats.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stats.six > div { flex-direction: column; align-items: center; gap: 0; border-right: 1px solid rgba(39, 50, 76, .6); }
.stats.six > div:last-child { border-right: 0; }
.stats.six dd { font-size: 20px; }
.tags { padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 6px; border-top: 1px solid var(--line); }
.tags b { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; width: 100%; }

pre.script {
  margin: 0; padding: 14px 16px; background: var(--night); color: #c9d6ee; font: 13px/1.5 Consolas, "Cascadia Mono", monospace;
  overflow: auto; white-space: pre-wrap;
}
details.section summary {
  cursor: pointer; padding: 12px 16px; font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); list-style: none;
}
details.section summary::-webkit-details-marker { display: none; }
details.section summary::before { content: "▸ "; }
details.section[open] summary::before { content: "▾ "; }

.rate { font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.rate.low { color: var(--muted); }
.rate.hi { color: var(--green); }
.price { font-weight: 700; color: var(--gold); }
.note { color: var(--muted); font-size: 14px; padding: 12px 16px; }
.note b { color: var(--text); }

.mob-portrait {
  width: 180px; height: 180px; flex: none; border-radius: 16px; border: 1px solid var(--line-2);
  background: radial-gradient(circle at 50% 70%, #24345a 0, var(--panel) 70%); display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.mob-portrait img { max-width: 160px; max-height: 160px; image-rendering: pixelated; }
.mob-portrait.sm { width: 120px; height: 120px; }
.ele { font-weight: 700; }
.ele-Neutral { color: #c9cfdb; } .ele-Water { color: #6cb6ff; } .ele-Earth { color: #c9a26b; } .ele-Fire { color: #ff7b5c; }
.ele-Wind { color: #8fe3a0; } .ele-Poison { color: #b48cff; } .ele-Holy { color: #ffe08a; } .ele-Dark { color: #a78bfa; }
.ele-Ghost { color: #a5b4cb; } .ele-Undead { color: #9aa7a0; }

.minimap { position: relative; width: 100%; max-width: 512px; margin: 0 auto; aspect-ratio: 1; background: var(--night); border-radius: 8px; overflow: hidden; }
.minimap img { width: 100%; height: 100%; display: block; }
.minimap .dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; border: 2px solid #fff; cursor: default; }
.minimap .dot.npc { background: var(--gold-dark); }
.minimap .dot.shop { background: var(--green); }
.minimap .dot.warp { background: #e04f8f; }
.minimap .dot.mob { background: var(--blood); width: 8px; height: 8px; margin: -4px 0 0 -4px; border-width: 1px; }
.minimap .dot:hover { transform: scale(1.5); z-index: 2; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; padding: 10px 16px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; border: 2px solid #fff; }
.tip {
  position: fixed; z-index: 50; pointer-events: none; background: #05070d; border: 1px solid var(--line-2); color: var(--text);
  padding: 5px 9px; border-radius: 6px; font-size: 13px; box-shadow: var(--shadow); display: none; white-space: nowrap;
}

.loading { padding: 60px 0; text-align: center; color: var(--muted); }
.loading::before {
  content: ""; display: block; width: 34px; height: 34px; margin: 0 auto 12px; border-radius: 50%;
  border: 3px solid var(--line-2); border-top-color: var(--ice); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.notfound { text-align: center; padding: 60px 0; }
.notfound h1 { font-family: var(--display); font-size: 42px; margin: 0 0 8px; }

@media (max-width: 960px) {
  .cols { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr; }
  .stats.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats.six > div:nth-child(3) { border-right: 0; }
}
@media (max-width: 720px) {
  .topbar-in { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .brand span { display: none; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
  main.page { padding: 16px 16px 40px; }
  .stats { grid-template-columns: 1fr; }
  .stats > div { border-right: 0 !important; }
  .head { align-items: flex-start; }
  .mob-portrait { width: 110px; height: 110px; }
  .mob-portrait img { max-width: 100px; max-height: 100px; }
  h1.title { font-size: 30px; }
  table.grid .hide-sm { display: none; }
  .filter-input { min-width: 0; flex: 1; }
  .rowin-pic { display: none; }
}
