/* Step On It: Trail Quest — wiki stylesheet.
   Original, self-contained (no external fonts, scripts or trackers).
   Palette follows the app's TrailTheme: dark ink, parchment text, coin gold,
   cyan step feedback. */

:root {
  --bg: #12141c;
  --bg-soft: #171a24;
  --panel: #1b1f2a;
  --panel-raised: #222736;
  --border: #2c3242;
  --frame: #3a4155;
  --text: #e8e4d8;
  --muted: #9aa0ae;
  --gold: #f0b23e;
  --gold-dim: #b3832a;
  --cyan: #4fd1c5;
  --green: #68d391;
  --red: #fc8181;
  --purple: #b794f4;
  --blue: #63b3ed;
  --ink: #0d0f15;
  --maxw: 68rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(1200px 500px at 70% -10%, rgba(79, 209, 197, 0.06), transparent 60%),
    radial-gradient(900px 420px at 10% -5%, rgba(240, 178, 62, 0.07), transparent 55%);
  color: var(--text);
  font: 1rem/1.65 system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--cyan); }

/* ---------- accessibility ---------- */

.skip-link {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--gold);
  color: #14110a;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  z-index: 100;
}
.skip-link:focus { left: 0.75rem; }

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

.site-header {
  border-bottom: 2px solid var(--gold-dim);
  background: linear-gradient(180deg, #1d2230, #171a24);
  position: sticky;
  top: 0;
  z-index: 10;
}

.masthead {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.9rem 1.25rem 0.6rem;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.masthead .title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin: 0;
  color: var(--gold);
  text-shadow: 0 1px 0 #000;
}
.masthead .title .boot { color: var(--cyan); }
.masthead .tagline { color: var(--muted); font-size: 0.9rem; }

.site-nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  font-size: 0.92rem;
}
.site-nav a {
  color: var(--text);
  text-decoration: none;
  padding: 0.15rem 0.1rem;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--cyan); border-bottom-color: var(--cyan); }
.site-nav a[aria-current="page"] { color: var(--gold); border-bottom-color: var(--gold); font-weight: 600; }

/* Comfortable touch targets on phones. */
@media (pointer: coarse) {
  .site-nav a { padding: 0.45rem 0.2rem; }
  .toc a, .site-footer a { display: inline-block; padding: 0.25rem 0; }
}

main { max-width: var(--maxw); margin: 0 auto; padding: 1.6rem 1.25rem 3rem; }

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  background: var(--bg-soft);
}
.site-footer .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1rem 1.25rem 1.4rem;
}

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

h1, h2, h3, h4 { line-height: 1.25; scroll-margin-top: 5rem; }
h1 {
  font-size: 1.9rem;
  margin: 0 0 0.4rem;
  color: var(--gold);
  letter-spacing: 0.02em;
}
h2 {
  font-size: 1.35rem;
  margin: 2.4rem 0 0.7rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
  color: #f3ead2;
}
h2:first-of-type { margin-top: 1.4rem; }
h3 { font-size: 1.08rem; margin: 1.6rem 0 0.5rem; color: var(--cyan); }
h4 { font-size: 1rem; margin: 1.2rem 0 0.4rem; color: var(--text); }

p { margin: 0.6rem 0; }
.lead { font-size: 1.08rem; color: #d9d3c3; }

ul, ol { padding-left: 1.4rem; }
li { margin: 0.25rem 0; }
li::marker { color: var(--gold); }

hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

code {
  font: 0.88em ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  background: var(--ink);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.08em 0.35em;
  color: var(--cyan);
}

pre {
  background: var(--ink);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.55;
}
pre code { border: 0; background: none; padding: 0; color: #cfe3ff; }

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

/* Scrollable wrapper added by the build: wide tables keep a readable
   minimum width and pan horizontally on phones instead of crushing. */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1rem 0 1.4rem;
}
.table-wrap table { margin: 0; }
.table-wrap:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.4rem;
  font-size: 0.92rem;
  background: var(--panel);
  border: 1px solid var(--frame);
  border-radius: 8px;
  overflow: hidden;
}
/* Wide tables (3+ columns, marked by the build) never shrink below a
   readable column width; they pan inside .table-wrap instead. */
table.wide { min-width: 34rem; }
caption {
  caption-side: top;
  text-align: left;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0 0 0.4rem;
}
th {
  background: var(--panel-raised);
  color: #f3ead2;
  text-align: left;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.55rem 0.7rem;
  border-bottom: 2px solid var(--gold-dim);
}
td {
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.015); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- callouts and chips ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--frame);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  margin: 1rem 0;
}
.panel.note { border-left-color: var(--cyan); }
.panel.warn { border-left-color: var(--red); }
.panel.proposal { border-left-color: var(--purple); }
.panel .panel-title { font-weight: 700; margin: 0 0 0.3rem; color: var(--gold); }
.panel.note .panel-title { color: var(--cyan); }
.panel.warn .panel-title { color: var(--red); }
.panel.proposal .panel-title { color: var(--purple); }

.chip {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.12rem 0.6rem;
  border: 1px solid var(--frame);
  color: var(--muted);
  background: var(--ink);
  white-space: nowrap;
}
.chip.done { color: var(--green); border-color: var(--green); }
.chip.wip { color: var(--gold); border-color: var(--gold); }
.chip.proposal { color: var(--purple); border-color: var(--purple); }
.chip.blocked { color: var(--red); border-color: var(--red); }
.chip.decided { color: var(--cyan); border-color: var(--cyan); }
.chip.info { color: var(--blue); border-color: var(--blue); }

.gold { color: var(--gold); }
.cyan { color: var(--cyan); }
.green { color: var(--green); }
.red { color: var(--red); }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }

/* ---------- hero cards ---------- */

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  margin: 1.2rem 0;
}
.hero-card {
  background: var(--panel);
  border: 1px solid var(--frame);
  border-top: 4px solid var(--frame);
  border-radius: 10px;
  padding: 1rem 1.1rem;
}
.hero-card.wanderer { border-top-color: var(--green); }
.hero-card.ranger { border-top-color: var(--gold); }
.hero-card.mage { border-top-color: var(--purple); }
.hero-card h3 { margin: 0 0 0.2rem; }
.hero-card .role { color: var(--muted); font-size: 0.88rem; margin-bottom: 0.5rem; }
.hero-card dl { margin: 0.4rem 0 0; display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.7rem; font-size: 0.9rem; }
.hero-card dt { color: var(--muted); }
.hero-card dd { margin: 0; }

/* ---------- stat grid on the home page ---------- */

.fact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.8rem;
  margin: 1.2rem 0;
}
.fact {
  background: var(--panel);
  border: 1px solid var(--frame);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
}
.fact .k { display: block; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.07em; }
.fact .v { display: block; font-size: 1.02rem; font-weight: 600; margin-top: 0.15rem; }

/* ---------- reset/keep split on the economy page ---------- */

.split-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin: 1rem 0;
}
.split-grid .panel { margin: 0; }

/* ---------- roadmap ---------- */

.phase {
  border: 1px solid var(--frame);
  border-radius: 10px;
  background: var(--panel);
  padding: 1rem 1.2rem;
  margin: 1rem 0;
}
.phase h3 { margin-top: 0; }
.phase .meta { color: var(--muted); font-size: 0.88rem; margin-bottom: 0.5rem; }

/* ---------- sprites ---------- */

.sprite {
  image-rendering: pixelated;
  display: block;
}

.foe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.7rem;
  margin: 1rem 0 1.4rem;
}
.foe-card {
  background: var(--panel);
  border: 1px solid var(--frame);
  border-radius: 8px;
  padding: 0.6rem 0.5rem 0.5rem;
  text-align: center;
}
.foe-card img.sprite { margin: 0 auto 0.45rem; }
.foe-card .foe-name { font-size: 0.82rem; line-height: 1.3; color: var(--text); }

.boss-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.9rem;
  margin: 1rem 0 1.4rem;
}
.boss-card {
  background: var(--panel);
  border: 1px solid var(--gold-dim);
  border-radius: 10px;
  padding: 0.8rem;
  text-align: center;
}
.boss-card img.sprite { margin: 0 auto 0.5rem; }
.boss-card .foe-name { color: var(--gold); font-weight: 700; font-size: 0.92rem; }
.boss-card .foe-sub { color: var(--muted); font-size: 0.8rem; margin-top: 0.15rem; }

.hero-card .portrait {
  float: right;
  margin: 0 0 0.4rem 0.9rem;
  background: var(--ink);
  border: 1px solid var(--frame);
  border-radius: 8px;
  padding: 0.3rem;
}

.attack-strip {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  align-items: flex-end;
  margin: 1rem 0;
}
.attack-strip figure { margin: 0; text-align: center; }
.attack-strip .frame {
  background: var(--ink);
  border: 1px solid var(--frame);
  border-radius: 8px;
  padding: 0.4rem;
  display: inline-block;
}
.attack-strip figcaption { font-size: 0.78rem; color: var(--muted); margin-top: 0.35rem; }

.sheet-figure { margin: 1.2rem 0 1.6rem; }
.sheet-figure img {
  width: 100%;
  image-rendering: pixelated;
  border: 1px solid var(--frame);
  border-radius: 10px;
  background: var(--ink);
}
.sheet-figure figcaption { font-size: 0.83rem; color: var(--muted); margin-top: 0.45rem; }

.art-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.2rem;
  margin: 1.2rem 0;
}

/* ---------- misc ---------- */

.toc {
  background: var(--panel);
  border: 1px solid var(--frame);
  border-radius: 8px;
  padding: 0.8rem 1.2rem;
  margin: 1.2rem 0;
  font-size: 0.95rem;
}
.toc::before { content: "On this page"; display: block; font-weight: 700; color: var(--gold); margin-bottom: 0.3rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.07em; }
.toc ul { margin: 0; padding-left: 1.1rem; }

.error-art { font-size: 3rem; text-align: center; margin: 2rem 0 0.5rem; }

img { max-width: 100%; }

@media (max-width: 30rem) {
  h1 { font-size: 1.5rem; }
  table { font-size: 0.85rem; }
  th, td { padding: 0.4rem 0.5rem; }
  /* The floated hero portrait stops competing with text on narrow screens. */
  .hero-card .portrait { float: none; display: block; margin: 0 auto 0.6rem; }
  .foe-grid { grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); }
  .boss-card img.sprite { width: 128px; height: 128px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
