:root {
  --bg: #0a1518;
  --bg-deep: #060e10;
  --panel: #0d1a1f;
  --panel-raised: #132a30;
  --border: #d4dccb;
  --border-dim: #4e6b6c;
  --text: #f3ecd7;
  --text-dim: #bdb59c;
  --text-faint: #7c8a82;
  --gold: #e3c26f;
  --gold-bright: #f6dc96;
  --gold-deep: #8a6a2b;
  --link: #f6dc96;
  --radius: 14px;
  --max: 760px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg-deep);
  color: var(--text);
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

img.pixel {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

a {
  color: var(--link);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--gold);
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border-dim);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 18px;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.nav {
  display: flex;
  gap: 18px;
  font-weight: 700;
  font-size: 15px;
}

.nav a {
  color: var(--text-dim);
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current='page'] {
  color: var(--gold-bright);
}

/* Hero */
.hero {
  position: relative;
  background: var(--bg);
  border-bottom: 1px solid var(--border-dim);
  overflow: hidden;
}

.hero-art {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  opacity: 0.55;
}

.hero-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  background: linear-gradient(180deg, rgba(6, 14, 16, 0) 30%, rgba(6, 14, 16, 0.85) 100%);
}

.hero-icon {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  border: 2px solid var(--gold-deep);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

h1 {
  font-size: clamp(30px, 6vw, 46px);
  line-height: 1.15;
  margin: 14px 0 4px;
  font-weight: 800;
}

.tagline {
  margin: 0;
  color: var(--gold);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 13px;
}

/* Content */
main.wrap {
  padding-top: 32px;
  padding-bottom: 56px;
}

h2 {
  font-size: 24px;
  line-height: 1.3;
  margin: 36px 0 10px;
  font-weight: 800;
}

h3 {
  font-size: 18px;
  margin: 24px 0 6px;
  font-weight: 800;
  color: var(--gold-bright);
}

p,
ul {
  margin: 0 0 14px;
}

ul {
  padding-left: 22px;
}

li {
  margin-bottom: 6px;
}

.lede {
  font-size: 19px;
  color: var(--text);
}

.muted {
  color: var(--text-dim);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 18px 0;
}

.panel > :last-child {
  margin-bottom: 0;
}

.panel > h2:first-child,
.panel > h3:first-child {
  margin-top: 0;
}

/* Odds pages: an announced change, or odds not in effect yet */
.notice {
  border-color: var(--gold);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.card strong {
  display: block;
  color: var(--gold-bright);
  font-size: 17px;
  margin-bottom: 4px;
}

.card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 15px;
}

.beasts {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 24px 0 8px;
}

.beasts figure {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--border-dim);
  border-radius: 12px;
  padding: 6px 4px 4px;
  text-align: center;
}

.beasts img {
  width: 100%;
  max-width: 96px;
  aspect-ratio: 1;
  height: auto;
}

.beasts figcaption {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
}

.button {
  display: inline-block;
  background: var(--gold);
  color: #1a1408;
  font-weight: 800;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 10px;
}

.button:hover {
  background: var(--gold-bright);
  color: #1a1408;
}

.updated {
  color: var(--text-faint);
  font-size: 14px;
}

/* Tables (odds page) */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 16px;
  background: var(--panel);
  border: 1px solid var(--border-dim);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.4;
}

th,
td {
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(78, 107, 108, 0.45);
}

thead th {
  background: var(--bg);
  color: var(--gold-bright);
  font-weight: 800;
  font-size: 14px;
}

tbody th {
  font-weight: 700;
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

th.num,
td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

td.num {
  white-space: nowrap;
}

table.lineages td {
  padding-top: 4px;
  padding-bottom: 4px;
}

.toc ol {
  list-style: none;
  padding-left: 0;
  columns: 2;
  column-gap: 24px;
}

.toc li {
  margin-bottom: 4px;
  break-inside: avoid;
}

section[lang] {
  margin-top: 40px;
  padding-top: 8px;
  border-top: 1px solid var(--border-dim);
}

/* Korean breaks between words, not inside them. */
[lang='ko'] {
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-dim);
  background: var(--bg);
  color: var(--text-faint);
  font-size: 14px;
  padding: 22px 0 28px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: space-between;
}

.site-footer a {
  color: var(--text-dim);
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }
  .beasts {
    grid-template-columns: repeat(3, 1fr);
  }
  .nav {
    gap: 14px;
  }
  .hero-art {
    min-height: 300px;
  }
  table {
    font-size: 14px;
  }
  th,
  td {
    padding: 6px 8px;
  }
  .toc ol {
    columns: 1;
  }
}
