:root {
  --bg: #0c1a17;
  --bg-soft: #12241f;
  --card: #16302a;
  --card-hover: #1d3e35;
  --border: #25463d;
  --text: #e8f2ee;
  --muted: #9bb5ac;
  --accent: #4ecb8d;
  --accent-2: #ffd166;
  --ocean: #3aa9d6;
  --danger: #ff6b6b;
  --radius: 12px;
  --maxw: 1080px;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }

h1, h2, h3 { line-height: 1.2; }
h1 { font-size: 2rem; margin: 0 0 .5rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }

/* Header / nav */
.site-header {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(6px);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1.25rem; gap: 1rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--text); font-size: 1.1rem; }
.brand:hover { text-decoration: none; }
.brand-icon { font-size: 1.4rem; }
.brand-text em { color: var(--accent); font-style: normal; }
.site-nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.site-nav a { color: var(--muted); font-weight: 600; }
.site-nav a:hover { color: var(--accent); text-decoration: none; }

main.container { padding-top: 2rem; padding-bottom: 3rem; }

/* Hero */
.hero { margin-bottom: 2rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 1.25rem; margin: 1rem 0; color: var(--muted); }
.hero-meta strong { color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: .2rem .7rem; font-size: .8rem; color: var(--muted); }

/* Stat grid */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin: 2rem 0; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; text-align: center; display: flex; flex-direction: column; gap: .25rem; }
.stat-card:hover { background: var(--card-hover); text-decoration: none; }
.stat-num { font-size: 2.2rem; font-weight: 800; color: var(--accent); }
.stat-label { color: var(--muted); font-size: .9rem; }

/* Card grid */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin: 2rem 0; }
.nav-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; color: var(--text); }
.nav-card:hover { background: var(--card-hover); text-decoration: none; transform: translateY(-2px); transition: .15s; }
.nav-card h3 { margin: 0 0 .4rem; }
.nav-card p { margin: 0; color: var(--muted); font-size: .92rem; }

/* Tables */
.area-block { margin: 2rem 0; }
.area-block h2 { display: flex; align-items: center; gap: .6rem; border-bottom: 2px solid var(--border); padding-bottom: .4rem; }
.count { background: var(--border); color: var(--text); font-size: .8rem; border-radius: 999px; padding: .1rem .6rem; font-weight: 600; }
.data-table { width: 100%; border-collapse: collapse; margin: .5rem 0 1rem; font-size: .92rem; }
.data-table th, .data-table td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table thead th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.data-table tbody tr:hover { background: var(--bg-soft); }
.data-table .num { text-align: center; font-variant-numeric: tabular-nums; }
th.num { text-align: center; }

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: .75rem 0; }
.tag { display: inline-block; background: var(--border); color: var(--text); border-radius: 6px; padding: .12rem .5rem; font-size: .78rem; font-weight: 600; }
a.tag:hover { text-decoration: none; filter: brightness(1.15); }
.tag-standard { background: #2a4d42; }
.tag-hostile { background: #6b2b2b; color: #ffd9d9; }
.tag-large { background: #2b4a6b; color: #d6ecff; }
.tag-crustacean { background: #6b522b; color: #ffeccb; }
.tag-special { background: #4a2b6b; color: #e9d6ff; }
.tag-boss { background: #7a1f1f; color: #ffe0e0; }
.tag-prehistoric { background: #3a5a2b; color: #e0ffd0; }
.tag-fishing { background: #2b5a6b; color: #d0f3ff; }
.priority-story-related { background: #2b4a6b; color: #d6ecff; }
.priority-time-sensitive { background: #6b2b2b; color: #ffd9d9; }
.priority-optional { background: #3a4a44; color: var(--muted); }
.loc-link { display: inline-block; margin: 0 .35rem .15rem 0; white-space: nowrap; font-size: .85rem; font-weight: 600; }
.loc-link:hover { text-decoration: none; filter: brightness(1.15); }
.rps-rock { background: #5a4632; color: #ffe8cf; }
.rps-paper { background: #2b4a6b; color: #d6ecff; }
.rps-scissors { background: #6b2b52; color: #ffd6ef; }

/* Tier list */
.tier-badge { display: inline-block; min-width: 1.4rem; text-align: center; border-radius: 6px; padding: .12rem .45rem; font-size: .8rem; font-weight: 800; color: #1a1a1a; }
.tier-s { background: #ff7676; }
.tier-a { background: #ffae5c; }
.tier-b { background: #ffe06a; }
.tier-c { background: #9ad36b; }
.tier-d { background: #7cc7e0; }
.tier-unranked { background: var(--border); color: var(--muted); }
.tier-list { margin: 1.5rem 0 2rem; }
.tier-list h2 { margin-bottom: .35rem; }
.tier-row { display: flex; align-items: center; gap: .9rem; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.tier-row .tier-badge { font-size: 1.05rem; min-width: 2.1rem; padding: .3rem .55rem; }
.tier-members { display: flex; flex-wrap: wrap; gap: .4rem; }
.tier-chip { display: inline-block; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px; padding: .2rem .7rem; font-size: .85rem; font-weight: 600; }
a.tier-chip:hover { text-decoration: none; filter: brightness(1.2); }

/* Entry detail */
.entry { max-width: 760px; }
.crumbs { margin-bottom: 1rem; font-size: .9rem; }
.facts { display: grid; gap: .75rem; margin: 1.5rem 0; }
.facts > div { display: grid; grid-template-columns: 140px 1fr; gap: 1rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }
.facts dt { color: var(--muted); font-weight: 600; margin: 0; }
.facts dd { margin: 0; }
.callout { background: var(--bg-soft); border-left: 3px solid var(--accent); padding: .75rem 1rem; border-radius: 0 8px 8px 0; color: var(--muted); }

/* Stat bars */
.stat-bars { display: grid; gap: .6rem; margin: 1.5rem 0; max-width: 480px; }
.stat-bar { display: grid; grid-template-columns: 80px 1fr 36px; align-items: center; gap: .6rem; }
.stat-bar-label { color: var(--muted); font-size: .85rem; }
.stat-bar-track { background: var(--bg-soft); border-radius: 999px; height: 10px; overflow: hidden; }
.stat-bar-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--ocean), var(--accent)); }
.stat-bar-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.stat-table { border-collapse: collapse; margin: 1.5rem 0; max-width: 360px; width: 100%; }
.stat-table th, .stat-table td { padding: .4rem .6rem; text-align: right; border-bottom: 1px solid var(--bg-soft); }
.stat-table th:first-child, .stat-table td.stat-name { text-align: left; }
.stat-table thead th { color: var(--muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.stat-table .stat-name { color: var(--muted); }
.stat-table .stat-start, .stat-table .stat-max { font-variant-numeric: tabular-nums; font-weight: 600; }
.stat-table .stat-max { color: var(--accent); }
.stat-note { color: var(--muted); font-size: .9rem; margin: -.4rem 0 1.5rem; }
.data-table .stat-start { color: var(--muted); font-variant-numeric: tabular-nums; }
.data-table .stat-arrow { color: var(--muted); opacity: .6; }
.data-table .stat-max { font-variant-numeric: tabular-nums; font-weight: 600; }
.skill-list li { margin: .3rem 0; }

/* Legend */
.legend { margin: 2.5rem 0; }
.legend-grid { display: grid; gap: .6rem; }
.legend-item { display: grid; grid-template-columns: 130px 1fr; gap: 1rem; align-items: baseline; }
.legend-item dt { margin: 0; }
.legend-item dd { margin: 0; color: var(--muted); font-size: .9rem; }

/* Chapters */
.chapter-list { display: grid; gap: .75rem; margin: 1.5rem 0; }
.chapter-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; color: var(--text); }
.chapter-card:hover { background: var(--card-hover); text-decoration: none; }
.chapter-card h3 { margin: 0 0 .3rem; color: var(--accent); }
.chapter-card .count { display: inline-block; margin-top: .5rem; }

/* Lists */
.entry-list { list-style: none; padding: 0; columns: 2; gap: 2rem; }
.entry-list li { margin: .3rem 0; break-inside: avoid; }

.prose { max-width: 70ch; }
.prose h2 { margin-top: 2rem; }
.prose code { background: var(--bg-soft); padding: .1rem .35rem; border-radius: 4px; }

.sources { margin-top: 2.5rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.sources ul { font-size: .85rem; color: var(--muted); word-break: break-all; }

.section-head { margin-bottom: 1rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); padding: 2rem 0; margin-top: 3rem; color: var(--muted); font-size: .9rem; }
.site-footer p { margin: .3rem 0; }

@media (max-width: 640px) {
  .facts > div { grid-template-columns: 1fr; gap: .25rem; }
  .entry-list { columns: 1; }
  .data-table { font-size: .82rem; }
}
