/* Sunset Isle guide: the look of the game's "new" skin (dark panels, brass lines, parchment text), set in
   Barlow (SIL OFL, fonts/OFL.txt), a highway-sign grotesk like Expressway. */
@font-face { font-family: "Barlow"; src: url("fonts/Barlow-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/Barlow-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/Barlow-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/Barlow-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --bg: #0b0907;
  --panel: rgba(20, 15, 11, 0.94);
  --panel-2: #1a140e;
  --row: #1f1810;
  --row-hover: #2a2016;
  --line: rgba(201, 160, 84, 0.78);
  --rule: rgba(201, 160, 84, 0.22);
  --text: #eedeb8;
  --muted: #a3977c;
  --dim: #7a705e;
  --brass: #c9a054;
  --gold: #e9bd65;
  --green: #96ce8c;
  --warn: #d08a6a;
  --tier-1: #a2e13e; --tier-2: #5aa8ff; --tier-3: #d68aff; --tier-4: #ff9a2e; --tier-5: #ff4a3d;
  --tier-6: #4fe3d6; --tier-7: #ff5cdb;
  --radius: 6px;
  --head: Barlow, "Segoe UI", system-ui, sans-serif;
  --body: Barlow, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 88px; }
body {
  margin: 0; min-height: 100vh; color: var(--text); font: 15px/1.55 var(--body);
  background: var(--bg) radial-gradient(1200px 600px at 50% -200px, #2b1f12 0%, rgba(11, 9, 7, 0) 70%) no-repeat;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { font-family: var(--head); font-weight: 600; color: var(--gold); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 30px; } h2 { font-size: 21px; margin-top: 1.6em; } h3 { font-size: 17px; color: var(--text); margin-top: 1.2em; }
p { margin: 0 0 1em; }
small, .muted { color: var(--muted); }

/* ---- top bar ---- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(11, 9, 7, .92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule); }
.top-in { max-width: 1160px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 18px; align-items: center; }
.brand { display: flex; flex-direction: column; line-height: 1.1; white-space: nowrap; color: var(--text); }
.brand b { font: 20px var(--head); color: var(--gold); }
.brand span { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav a { color: var(--muted); padding: 8px 9px; border-radius: var(--radius); white-space: nowrap; font-weight: 700; font-size: 14px; }
.nav a:hover { color: var(--text); background: var(--row); text-decoration: none; }
.nav a.on { color: var(--text); box-shadow: inset 0 -2px 0 var(--brass); border-radius: 0; }

/* ---- search ---- */
.search { position: relative; width: 280px; flex-shrink: 0; }
.search input { width: 100%; padding: 9px 12px 9px 34px; font: 15px var(--body); color: var(--text);
  background: var(--panel-2); border: 1px solid var(--rule); border-radius: var(--radius); }
.search input:focus { outline: none; border-color: var(--brass); }
.search::before { content: ""; position: absolute; left: 12px; top: 50%; width: 11px; height: 11px; margin-top: -8px;
  border: 2px solid var(--muted); border-radius: 50%; }
.search::after { content: ""; position: absolute; left: 23px; top: 50%; width: 6px; height: 2px; margin-top: 3px;
  background: var(--muted); transform: rotate(45deg); }
.search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); }
kbd { font: 12px var(--body); color: var(--muted); border: 1px solid var(--rule); border-radius: 4px; padding: 1px 6px; }
.results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); max-height: min(70vh, 520px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 16px 40px rgba(0,0,0,.6); }
.results[hidden] { display: none; }
.results .group { padding: 8px 12px 4px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--brass); }
.results a { display: flex; gap: 10px; align-items: center; padding: 6px 12px; color: var(--text); }
.results a.sel, .results a:hover { background: var(--row-hover); text-decoration: none; }
.results .none { padding: 14px 12px; color: var(--muted); }
.results .meta { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }

/* ---- page ---- */
main { max-width: 1160px; margin: 0 auto; padding: 24px 16px 64px; }
.crumbs { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.panel + .panel { margin-top: 16px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
/* A grid item is at least as wide as its longest unbreakable line unless told otherwise. */
.cols > * { min-width: 0; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }

/* ---- home ---- */
.hero { text-align: center; padding: 36px 0 28px; }
.hero h1 { font-size: 40px; }
.hero p { color: var(--muted); max-width: 560px; margin: 0 auto 22px; }
.hero .search { width: min(560px, 100%); margin: 0 auto; }
.hero .search input { padding: 13px 14px 13px 38px; font-size: 17px; }
.card { display: block; padding: 16px; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); color: var(--text); }
.card:hover { border-color: var(--brass); background: var(--row); text-decoration: none; }
.card b { display: block; font: 18px var(--head); color: var(--gold); margin-bottom: 4px; }
.card span { color: var(--muted); font-size: 14px; }

/* ---- item / monster ---- */
.icon { width: 32px; height: 32px; flex-shrink: 0; border-radius: 4px; background: #000 center/contain no-repeat; box-shadow: 0 0 0 1px var(--rule); }
.icon.big { width: 64px; height: 64px; image-rendering: auto; }
.icon.none { background: var(--row); }
.head { display: flex; gap: 16px; align-items: center; }
.head h1 { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { font-size: 13px; padding: 2px 9px; border-radius: 99px; background: var(--row); color: var(--muted); border: 1px solid var(--rule); }
.chip.boss { color: var(--gold); border-color: var(--brass); }
.desc { margin: 14px 0 0; color: var(--text); }
.t1 { color: var(--tier-1); } .t2 { color: var(--tier-2); } .t3 { color: var(--tier-3); } .t4 { color: var(--tier-4); }
.t5 { color: var(--tier-5); } .t6 { color: var(--tier-6); } .t7 { color: var(--tier-7); }
.stats { display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; margin: 0; }
.stats dt { color: var(--muted); } .stats dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.sub { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--brass); margin: 18px 0 6px; }
.sub:first-child { margin-top: 0; }
.rows { display: flex; flex-direction: column; gap: 2px; }
.r { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 8px;
  border-radius: 4px; background: var(--row); color: var(--text); }
.r.noicon { grid-template-columns: minmax(0, 1fr) auto; }
a.r:hover { background: var(--row-hover); text-decoration: none; }
.r .main { min-width: 0; }
.r .main b { font-weight: 700; }
.r .where { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r .amt { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.r .amt.boss, b.boss { color: var(--gold); }
.coin { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #e9bd65; box-shadow: inset -2px -2px 0 #b8862f; margin-left: 4px; vertical-align: -1px; }
.empty { color: var(--muted); padding: 6px 0; }

/* ---- lists ---- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters input, .filters select { font: 14px var(--body); color: var(--text); background: var(--panel-2); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 7px 10px; }
.filters input[type=search] { flex: 1; min-width: 200px; }
.filters input[type=number] { width: 84px; }
.filters label { color: var(--muted); font-size: 14px; display: flex; gap: 6px; align-items: center; }
.count { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--brass); font-weight: 700;
  padding: 6px 8px; border-bottom: 1px solid var(--rule); cursor: pointer; user-select: none; white-space: nowrap; }
table.list th.num, table.list td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.list td { padding: 6px 8px; border-bottom: 1px solid rgba(201, 160, 84, .08); vertical-align: middle; }
table.list tr:hover td { background: var(--row); }
table.list td .with-icon { display: flex; align-items: center; gap: 10px; }
.more { display: block; width: 100%; margin-top: 12px; padding: 10px; font: 700 14px var(--body); color: var(--text); background: var(--row);
  border: 1px solid var(--rule); border-radius: var(--radius); cursor: pointer; }
.more:hover { border-color: var(--brass); }
/* An author display rule beats the hidden attribute's own. */
[hidden] { display: none !important; }
.band { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.band button { font: 700 14px var(--body); color: var(--muted); background: var(--row); border: 1px solid var(--rule); border-radius: 99px;
  padding: 5px 12px; cursor: pointer; }
.band button.on, .band button:hover { color: var(--text); border-color: var(--brass); }

/* ---- articles ---- */
.article { max-width: 760px; }
.article li { margin-bottom: .4em; }
.note { border-left: 3px solid var(--brass); background: var(--row); padding: 10px 14px; border-radius: 0 var(--radius) var(--radius) 0; margin: 0 0 1em; }

/* ---- mazes ---- */
.steps { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 16px; margin: 0 0 4px; }
.steps dt { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--brass); padding-top: 2px; white-space: nowrap; }
.steps dd { margin: 0; }
.times { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 4px; }
.times span { font-size: 13px; font-variant-numeric: tabular-nums; padding: 1px 7px; border-radius: 4px; background: var(--row); border: 1px solid var(--rule); }
.small { font-size: 13px; }
.tag { font-size: 12px; padding: 1px 7px; border-radius: 99px; color: var(--gold); border: 1px solid var(--brass); }
.step-n { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 10px; border-radius: 50%;
  font-size: 13px; color: var(--bg); background: var(--brass); vertical-align: 3px; }
h2 small { font-size: 14px; font-weight: 500; color: var(--muted); }
.toc { margin: 0; padding-left: 22px; }
.toc li { margin: 3px 0; color: var(--muted); }
.toc li.on, .toc li.on a { color: var(--text); font-weight: 700; }
.toc small { display: block; color: var(--muted); font-weight: 400; }
a.chip:hover { color: var(--text); border-color: var(--brass); text-decoration: none; }
.toc button { font: inherit; color: var(--gold); background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.toc button:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---- quests ---- */
.todo { margin: 0 0 10px; padding-left: 20px; }
.todo li { margin-bottom: .3em; }
.story summary { cursor: pointer; color: var(--gold); font: 600 17px var(--head); }
.story p { margin: 12px 0 0; color: var(--muted); }
.minis { display: inline-flex; gap: 3px; vertical-align: middle; }
.icon.mini { width: 22px; height: 22px; }

footer { max-width: 1160px; margin: 0 auto; padding: 0 16px 32px; color: var(--dim); font-size: 13px; }

@media (max-width: 1080px) {
  .top-in { flex-wrap: wrap; gap: 8px 14px; }
  .search { order: 3; width: 100%; }
  .nav { order: 2; flex-basis: 100%; }
}
@media (max-width: 900px) {
  /* minmax(0, ...): a plain 1fr grows to its longest unbreakable line and runs off a phone's screen */
  .cols { grid-template-columns: minmax(0, 1fr); }
  .top-in { flex-wrap: wrap; gap: 8px 14px; }
  .search { order: 3; width: 100%; }
  .nav { order: 2; flex-basis: 100%; }
}
@media (max-width: 520px) {
  .hero h1 { font-size: 30px; }
  h1 { font-size: 25px; }
  .panel { padding: 14px; }
  table.list .hide-s { display: none; }
}
