/* OpenGET stylesheet.
 *
 * Visual language borrowed from the Old School RuneScape interface — dark
 * stone chrome, parchment panels, gold headings, the game's own gp colours —
 * but drawn from scratch. Nothing here is copied from ge-tracker, whose
 * functionality we clone and whose design we deliberately do not.
 *
 * No webfonts, no external requests, no JavaScript. Everything renders from
 * this one file. */

:root {
  --stone-0:   #14120f;
  --stone-1:   #1e1b16;
  --stone-2:   #2b2620;
  --stone-3:   #3a332a;
  --edge:      #5d5343;
  --edge-lit:  #7a6d57;

  --parch-0:   #d8cca8;
  --parch-1:   #c9bb93;
  --ink:       #2f2716;

  --gold:      #ffb83f;
  --gold-dim:  #c8912f;
  --text:      #e6dcc4;
  --text-dim:  #a1957a;

  --good:      #57c14e;
  --bad:       #e0533f;
  --link:      #7fb4e8;
  --link-vis:  #a78fd0;

  --radius: 3px;
  --mono: ui-monospace, "DejaVu Sans Mono", "Liberation Mono", Menlo, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--stone-0);
  /* A faint diagonal weave so the flat background reads as stone rather than
     as a void, without shipping an image. */
  background-image:
    repeating-linear-gradient(45deg,
      rgba(255,255,255,0.012) 0 2px, transparent 2px 4px);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a:visited { color: var(--link-vis); }

/* ---------------------------------------------------------------- chrome */

.masthead {
  background: linear-gradient(var(--stone-2), var(--stone-1));
  border-bottom: 2px solid var(--edge);
  padding: 10px 16px 0;
}

.masthead-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 18px;
}

.brand {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gold);
  text-shadow: 0 2px 0 #000;
}
.brand a, .brand a:visited { color: inherit; }
.brand small {
  display: block;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  text-shadow: none;
}

.searchbox { margin-left: auto; display: flex; gap: 6px; }
.searchbox input {
  background: var(--stone-0);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  color: var(--text);
  padding: 5px 8px;
  font: inherit;
  min-width: 190px;
}
.searchbox input:focus { outline: 2px solid var(--gold-dim); outline-offset: -1px; }

nav.tabs {
  max-width: 1180px;
  margin: 8px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}
nav.tabs a {
  padding: 6px 12px;
  background: var(--stone-3);
  border: 1px solid var(--edge);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  color: var(--text-dim);
  font-size: 13px;
}
nav.tabs a:hover { background: var(--edge); color: var(--text); text-decoration: none; }
nav.tabs a[aria-current="page"] {
  background: var(--parch-0);
  color: var(--ink);
  font-weight: 600;
  border-color: var(--edge-lit);
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 16px 40px;
}

/* --------------------------------------------------------------- content */

h1 {
  margin: 0 0 2px;
  font-size: 26px;
  color: var(--gold);
  text-shadow: 0 2px 0 #000;
}
.subtitle { margin: 0 0 18px; color: var(--text-dim); max-width: 74ch; }

h2 {
  margin: 26px 0 10px;
  font-size: 19px;
  color: var(--gold-dim);
  border-bottom: 1px solid var(--stone-3);
  padding-bottom: 4px;
}
h3 { margin: 18px 0 8px; font-size: 15px; color: var(--text); }

p { max-width: 78ch; }
.muted { color: var(--text-dim); font-size: 13.5px; }

pre {
  background: var(--stone-1);
  border: 1px solid var(--stone-3);
  border-radius: var(--radius);
  padding: 10px 12px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
}

/* ---------------------------------------------------------------- tables */

.tablewrap { overflow-x: auto; margin: 12px 0 20px; }

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 640px;
  background: var(--parch-0);
  color: var(--ink);
  border: 2px solid var(--edge);
  border-radius: var(--radius);
  font-size: 13.5px;
}

thead th {
  background: var(--stone-2);
  color: var(--gold);
  text-align: left;
  padding: 7px 10px;
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--edge);
  white-space: nowrap;
  position: sticky;
  top: 0;
}
thead th a, thead th a:visited { color: inherit; }
thead th.r { text-align: right; }

tbody td { padding: 5px 10px; border-bottom: 1px solid rgba(0,0,0,0.10); }
tbody td.r { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); }
tbody tr:nth-child(even) { background: var(--parch-1); }
tbody tr:hover { background: #e4d9b8; }
tbody td a, tbody td a:visited { color: #2a4c86; }

td.good { color: #1d6b1a; font-weight: 600; }
td.bad  { color: #a3271a; font-weight: 600; }

/* ----------------------------------------------------------------- facts */

.facts {
  display: inline-block;
  vertical-align: top;
  background: var(--stone-1);
  border: 1px solid var(--stone-3);
  border-radius: var(--radius);
  padding: 4px 14px 10px;
  margin: 0 12px 12px 0;
  min-width: 260px;
}
.facts h3 { margin: 8px 0 6px; color: var(--gold-dim); font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }
.facts dl { margin: 0; display: grid; grid-template-columns: auto auto; gap: 2px 16px; }
.facts dt { color: var(--text-dim); font-size: 13px; }
.facts dd {
  margin: 0;
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.facts dd.good { color: var(--good); }
.facts dd.bad  { color: var(--bad); }

/* ----------------------------------------------------------------- links */

ul.linklist { list-style: none; padding: 0; margin: 8px 0 18px; }
ul.linklist li { padding: 3px 0; }
ul.linklist .muted { font-size: 13px; }

/* ---------------------------------------------------------------- charts */

.chartbox {
  margin: 16px 0;
  background: var(--stone-1);
  border: 1px solid var(--stone-3);
  border-radius: var(--radius);
  padding: 10px;
  overflow-x: auto;
}
.chartbox figcaption { color: var(--gold-dim); font-size: 13px; margin-bottom: 6px; }
svg.chart { display: block; color: var(--text-dim); max-width: 100%; }
svg.chart .grid { stroke: rgba(255,255,255,0.08); stroke-width: 1; }
svg.chart .ylab { fill: var(--text-dim); font-size: 10px; text-anchor: end; font-family: var(--mono); }
svg.chart .xlab { fill: var(--text-dim); font-size: 10px; text-anchor: middle; font-family: var(--mono); }
svg.chart .legend { fill: var(--text-dim); font-size: 11px; }
svg.chart .chart-empty { fill: var(--text-dim); font-size: 13px; text-anchor: middle; }

/* ----------------------------------------------------------------- forms */

.ogform {
  background: var(--stone-1);
  border: 1px solid var(--stone-3);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 12px 0 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.ogform p { flex-basis: 100%; margin: 0 0 4px; }
.field { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.field span { color: var(--text-dim); }
.field input, .field select {
  background: var(--stone-0);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  color: var(--text);
  padding: 5px 8px;
  font: inherit;
}
.field small { font-size: 11.5px; }

button {
  background: linear-gradient(var(--edge), var(--stone-3));
  border: 1px solid var(--edge-lit);
  border-radius: var(--radius);
  color: var(--gold);
  padding: 6px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button:hover { background: linear-gradient(var(--edge-lit), var(--edge)); }

/* ----------------------------------------------------------------- notes */

.notes {
  margin: 24px 0 0;
  border-left: 3px solid var(--gold-dim);
  padding: 2px 0 2px 14px;
}
.notes h3 { margin: 0 0 4px; color: var(--gold-dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.notes ul { margin: 0; padding-left: 18px; }
.notes li { color: var(--text-dim); font-size: 13px; margin-bottom: 4px; max-width: 84ch; }

.paging { display: flex; gap: 12px; align-items: center; margin: 10px 0 20px; font-size: 13.5px; }

/* ---------------------------------------------------------------- footer */

footer {
  border-top: 2px solid var(--edge);
  background: var(--stone-1);
  padding: 16px;
  font-size: 12.5px;
  color: var(--text-dim);
}
footer .inner { max-width: 1180px; margin: 0 auto; }
footer p { max-width: 90ch; margin: 4px 0; }
footer .retro { font-family: var(--mono); }

/* ------------------------------------------------------------ responsive */

@media (max-width: 720px) {
  body { font-size: 14px; }
  .masthead-inner { flex-direction: column; align-items: stretch; }
  .searchbox { margin-left: 0; }
  .searchbox input { min-width: 0; flex: 1; }
  .facts { display: block; margin-right: 0; min-width: 0; }
  h1 { font-size: 21px; }
  main { padding: 12px 10px 30px; }
}

/* The palette is already a dark theme, so a light-preference reader gets the
   parchment lifted rather than a second stylesheet that would drift. */
@media (prefers-color-scheme: light) {
  :root { --parch-0: #e2d7b6; --parch-1: #d4c7a0; }
}
