/* ==========================================================================
   Gridforged — codex-plate storybook theme.
   The art is illustrated bestiary plates: bold flat color, big silhouette,
   minimal interior detail. The site echoes that — thick outlined cards,
   parchment-cream surfaces on a deep indigo page, vivid tribe accents.
   ========================================================================== */

:root {
  /* Page */
  --bg: #161028;
  --bg-2: #1f1638;
  --bg-deep: #0c0820;
  --ink: #1b1430;             /* card border / heavy outline */
  --ink-soft: rgba(27, 20, 48, 0.55);

  /* Parchment / paper surfaces */
  --paper: #f5e7c8;
  --paper-2: #ecdcb1;
  --paper-deep: #d6c190;
  --paper-line: rgba(60, 38, 18, 0.18);

  /* Text */
  --text: #f8eccf;            /* on dark */
  --text-mid: #d9c9a3;
  --text-soft: #b3a684;
  --text-on-paper: #2a1c0c;
  --text-on-paper-soft: #5a4326;

  /* Accents — vivid storybook palette */
  --ember: #ff6e36;           /* burn / dragon */
  --ember-deep: #c0431a;
  --ember-glow: rgba(255, 110, 54, 0.45);
  --gold: #f5c25b;            /* sentinel / consecrate */
  --gold-deep: #b07a18;
  --leaf: #7eb55c;            /* beast / venom */
  --leaf-deep: #2f5520;
  --rime: #5cc4d8;            /* mech / freeze / arc */
  --rime-deep: #1d6072;
  --bruise: #b07ae6;          /* undead / dread */
  --bruise-deep: #4d2580;
  --bone: #c9bfa8;            /* neutral */
  --bone-deep: #645b46;

  /* Tribe theming knobs (overridden per tribe section) */
  --tribe: var(--ember);
  --tribe-deep: var(--ember-deep);

  /* Layout */
  --max-w: 1240px;
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;

  /* Strokes — codex-plate look */
  --stroke: 3px;
  --stroke-thick: 4px;

  /* Type stacks */
  --display: "Cinzel Decorative", "Cinzel", "Trajan Pro", Georgia, serif;
  --serif: "Spectral", "IM Fell English", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Shadows */
  --shadow-card: 0 6px 0 var(--ink), 0 14px 30px -10px rgba(0, 0, 0, 0.55);
  --shadow-soft: 0 14px 30px -10px rgba(0, 0, 0, 0.45);
}

/* ------ Reset / base ------ */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 70% -10%, rgba(255, 110, 54, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(176, 122, 230, 0.08), transparent 60%),
    radial-gradient(1100px 700px at 110% 80%, rgba(92, 196, 216, 0.06), transparent 60%);
  color: var(--text);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }

a { color: var(--gold); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--ember); }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; padding: 10px 14px;
  background: var(--gold); color: var(--text-on-paper); font-weight: 700; z-index: 1000;
}
.skip-link:focus { left: 16px; top: 16px; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ------ Type ------ */

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin: 0 0 0.5em;
  color: var(--text);
}
h1.display { font-size: clamp(2.6rem, 6vw, 4.6rem); letter-spacing: 0.01em; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); }
h3 { font-size: 1.3rem; letter-spacing: 0.02em; }
h4 { font-size: 1rem; font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.18em; color: var(--text-mid); }

p { margin: 0 0 1em; color: var(--text-mid); }

.eyebrow {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.78rem;
  color: var(--gold);
  margin: 0 0 14px;
  font-weight: 600;
}

.accent { color: var(--ember); }
.lede { font-size: clamp(1.05rem, 1.4vw, 1.22rem); color: var(--text-mid); max-width: 60ch; }
.section-sub { color: var(--text-soft); max-width: 62ch; margin-left: auto; margin-right: auto; }

/* ------ Header / nav ------ */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(12, 8, 32, 0.85);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  border-bottom: var(--stroke) solid var(--ink);
  box-shadow: 0 6px 0 rgba(0,0,0,0.25);
}

.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; gap: 24px;
}

.brand {
  display: flex; align-items: center; gap: 12px;
  color: var(--text); font-family: var(--display); font-weight: 700;
}
.brand-logo {
  height: 44px; width: auto; display: block;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.5)) drop-shadow(0 0 12px rgba(255, 110, 54, 0.18));
}
.footer-brand .brand-logo { height: 56px; }
@media (max-width: 760px) {
  .brand-logo { height: 36px; }
  .footer-brand .brand-logo { height: 44px; }
}

.nav-links { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.nav-links a {
  color: var(--text-mid); font-family: var(--sans);
  font-weight: 600; font-size: 0.92rem; letter-spacing: 0.06em;
  text-transform: uppercase;
}
.nav-links a:hover, .nav-links a.is-active { color: var(--text); }
.nav-links a.is-active { border-bottom: 2px solid var(--ember); padding-bottom: 2px; }

.nav-cta {
  padding: 10px 18px;
  border: var(--stroke) solid var(--ink);
  background: var(--gold);
  color: var(--text-on-paper) !important;
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.nav-cta:hover {
  background: var(--ember); color: var(--text-on-paper) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--ink);
}

/* Codex sub-nav (codex hub + codex pages) */
.codex-subnav {
  background: var(--bg-deep);
  border-bottom: var(--stroke) solid var(--ink);
}
.codex-subnav .container {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
  padding-top: 10px; padding-bottom: 10px;
}
.codex-subnav a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  font-family: var(--sans); font-weight: 600; font-size: 0.86rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-mid); border: 2px solid transparent;
}
.codex-subnav a:hover { color: var(--text); }
.codex-subnav a.is-active {
  color: var(--text-on-paper);
  background: var(--gold);
  border-color: var(--ink);
  box-shadow: 0 3px 0 var(--ink);
}

@media (max-width: 760px) {
  .nav-links { gap: 12px; }
  .nav-links a:not(.nav-cta) { font-size: 0.82rem; }
}

/* ------ Buttons ------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 26px; border-radius: 999px;
  font-family: var(--sans); font-weight: 700; font-size: 0.95rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  border: var(--stroke) solid var(--ink); cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
}
.btn-primary {
  background: var(--ember); color: #fff;
  box-shadow: 0 5px 0 var(--ink), 0 14px 24px -10px var(--ember-glow);
  text-shadow: 0 2px 0 var(--ember-deep);
}
.btn-primary:hover {
  transform: translateY(-2px);
  background: var(--gold); color: var(--text-on-paper);
  text-shadow: none;
  box-shadow: 0 7px 0 var(--ink), 0 18px 28px -10px var(--ember-glow);
}
.btn-ghost {
  background: transparent; color: var(--text);
  border-color: var(--text-mid);
  box-shadow: 0 4px 0 var(--ink-soft);
}
.btn-ghost:hover {
  background: var(--text); color: var(--text-on-paper);
  border-color: var(--ink);
  box-shadow: 0 6px 0 var(--ink);
}

/* ------ Hero ------ */

.hero {
  position: relative;
  min-height: clamp(560px, 88vh, 880px);
  display: flex; align-items: center;
  overflow: hidden; isolation: isolate;
}
.hero-bg {
  position: absolute; inset: 0; z-index: -3;
  background-image: url("../assets/art/hero-bg.png");
  background-size: cover;
  background-position: center 30%;
  filter: saturate(115%) contrast(105%) brightness(0.7);
  transform: scale(1.06);
  will-change: transform;
}
.hero-vignette {
  position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(255, 110, 54, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 70%, rgba(176, 122, 230, 0.18) 0%, transparent 50%),
    linear-gradient(180deg, rgba(12, 8, 32, 0.55) 0%, rgba(12, 8, 32, 0.42) 40%, rgba(12, 8, 32, 0.95) 100%);
}
.hero-scrim {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 180px; z-index: -1;
  background: linear-gradient(180deg, transparent, var(--bg) 90%);
}
.hero-inner { padding: 110px 24px 130px; max-width: 1080px; }
.hero h1 { margin-top: 0.2em; }
.hero h1 .accent { color: var(--gold); text-shadow: 0 4px 0 var(--ink), 0 0 30px rgba(245, 194, 91, 0.45); }
.hero .display { text-shadow: 0 4px 0 var(--ink), 0 12px 30px rgba(0,0,0,0.5); }
.hero .lede { margin-top: 18px; }

.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }

.store-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  margin-top: 36px;
}
.store-row-label {
  width: 100%; font-size: 0.78rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-soft); margin-bottom: -4px;
}
.store-badge {
  display: inline-flex; transition: transform .15s ease, filter .15s ease;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.45));
}
.store-badge:hover { transform: translateY(-2px); filter: drop-shadow(0 10px 18px rgba(0,0,0,0.55)) brightness(1.1); }
.store-badge img { height: 56px; width: auto; }

/* ------ Section base ------ */

.section { padding: clamp(72px, 10vw, 130px) 0; position: relative; }
.section-head { text-align: center; max-width: 780px; margin: 0 auto clamp(40px, 5vw, 64px); }
.section-head .section-sub { margin: 12px auto 0; }

/* ------ Pillars (was Features) ------ */

.pillars { background: var(--bg-deep); border-top: var(--stroke) solid var(--ink); border-bottom: var(--stroke) solid var(--ink); }
.pillar-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.pillar-card {
  background: var(--paper);
  color: var(--text-on-paper);
  border: var(--stroke-thick) solid var(--ink);
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform .2s ease;
}
.pillar-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 0% 0%, rgba(255, 110, 54, 0.10), transparent 55%);
}
.pillar-card:hover { transform: translateY(-4px); }
.pillar-icon {
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper-2);
  border: 3px solid var(--ink);
  margin-bottom: 16px;
  box-shadow: inset 0 -3px 0 var(--paper-line);
  overflow: hidden;
}
.pillar-icon img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 50%;
  image-rendering: -webkit-optimize-contrast;
}
.pillar-card h3 { color: var(--text-on-paper); margin-bottom: 8px; }
.pillar-card p { color: var(--text-on-paper-soft); font-size: 0.97rem; line-height: 1.55; margin: 0; }

/* ------ Mode card (single now: Standard) ------ */

.modes { background: var(--bg); }
.mode-grid {
  display: grid; gap: 28px;
  grid-template-columns: 1fr;
  max-width: 880px; margin: 0 auto;
}
.mode-card {
  background: var(--paper);
  color: var(--text-on-paper);
  border: var(--stroke-thick) solid var(--ink);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.mode-art { aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-deep); }
.mode-art img { width: 100%; height: 100%; object-fit: cover; }
.mode-body { padding: 28px 30px 32px; }
.mode-body h3 { color: var(--text-on-paper); font-size: 1.7rem; margin: 6px 0 12px; }
.mode-body p { color: var(--text-on-paper-soft); }
.mode-bullets { list-style: none; margin: 18px 0 0; padding: 18px 0 0; border-top: 2px solid var(--paper-line); }
.mode-bullets li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 8px 0; font-size: 0.95rem;
}
.mode-bullets li + li { border-top: 1px dashed var(--paper-line); }
.mode-bullets span { color: var(--text-on-paper-soft); letter-spacing: 0.04em; font-family: var(--sans); }
.mode-bullets strong { color: var(--text-on-paper); font-weight: 700; }

/* ------ Tribe row (landing page) ------ */

.tribes-strip { background: var(--bg-2); border-top: var(--stroke) solid var(--ink); border-bottom: var(--stroke) solid var(--ink); }

.tribe-row {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.tribe-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 26px 14px;
  background: var(--paper);
  color: var(--text-on-paper);
  border: var(--stroke-thick) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: transform .15s ease;
  text-decoration: none;
}
.tribe-card:hover { transform: translateY(-3px); }
.tribe-card[data-tribe="Sentinel"] { background: linear-gradient(180deg, #fcf0d2, #f1d999); }
.tribe-card[data-tribe="Beast"]    { background: linear-gradient(180deg, #e6f1cf, #b9d59a); }
.tribe-card[data-tribe="Dragon"]   { background: linear-gradient(180deg, #f8d3bd, #e89070); }
.tribe-card[data-tribe="Mech"]     { background: linear-gradient(180deg, #d4ebef, #93cad2); }
.tribe-card[data-tribe="Undead"]   { background: linear-gradient(180deg, #ddc9ee, #b59ad6); }
.tribe-card[data-tribe="Neutral"]  { background: linear-gradient(180deg, #ece4ce, #c8b994); }
.tribe-card img {
  width: 72px; height: 72px; object-fit: contain;
  filter: drop-shadow(0 6px 0 rgba(27, 20, 48, 0.35));
}
.tribe-card .tribe-name {
  font-family: var(--display); letter-spacing: 0.18em; font-size: 0.95rem;
  text-transform: uppercase; color: var(--text-on-paper);
}
.tribe-card .tribe-count {
  font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.18em;
  color: var(--text-on-paper-soft);
}

/* ------ Codex hub ------ */

.codex-hero {
  padding: clamp(60px, 10vw, 110px) 0 clamp(40px, 6vw, 70px);
  border-bottom: var(--stroke) solid var(--ink);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(245, 194, 91, 0.12) 0%, transparent 60%),
    var(--bg-deep);
  text-align: center;
}
.codex-hero h1 { margin-bottom: 14px; }

.codex-hub {
  display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.codex-tile {
  background: var(--paper);
  color: var(--text-on-paper);
  border: var(--stroke-thick) solid var(--ink);
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: var(--shadow-card);
  transition: transform .15s ease;
  text-decoration: none;
  position: relative; overflow: hidden;
}
.codex-tile:hover { transform: translateY(-4px); }
.codex-tile::after {
  content: "→"; position: absolute; right: 22px; top: 22px;
  font-family: var(--sans); font-size: 1.4rem; color: var(--ember-deep);
  transition: transform .15s ease;
}
.codex-tile:hover::after { transform: translateX(4px); }
.codex-tile h3 { color: var(--text-on-paper); margin: 0; }
.codex-tile p { margin: 0; color: var(--text-on-paper-soft); font-size: 0.95rem; }
.codex-tile .codex-tile-stat {
  font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.18em;
  font-size: 0.74rem; color: var(--gold-deep); font-weight: 700;
}

/* ------ Codex shared layout: filters + grid ------ */

.codex-page { padding: 40px 0 80px; }

.filters {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin: 0 0 24px;
  padding: 14px 18px;
  background: var(--bg-deep);
  border: var(--stroke) solid var(--ink);
  border-radius: var(--radius);
}
.filters .filter-label {
  font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.18em;
  font-size: 0.74rem; color: var(--text-soft); font-weight: 700;
  margin-right: 6px;
}
.filter-chip {
  padding: 7px 14px; border-radius: 999px;
  border: 2px solid var(--text-soft);
  background: transparent;
  color: var(--text-mid);
  font-family: var(--sans); font-weight: 600; font-size: 0.82rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  cursor: pointer; transition: all .15s ease;
}
.filter-chip:hover { color: var(--text); border-color: var(--text); }
.filter-chip.is-active {
  background: var(--gold); color: var(--text-on-paper);
  border-color: var(--ink);
  box-shadow: 0 3px 0 var(--ink);
}
.filter-search {
  flex: 1 1 240px;
  padding: 10px 14px;
  border: 2px solid var(--text-soft);
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans); font-size: 0.92rem;
  border-radius: 999px;
}
.filter-search:focus { outline: none; border-color: var(--gold); }
.filter-count {
  font-family: var(--sans); font-size: 0.82rem; color: var(--text-soft);
  margin-left: auto;
}

.card-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* Generic codex-plate card (unit, boss) */

.plate {
  background: var(--paper);
  color: var(--text-on-paper);
  border: var(--stroke-thick) solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: transform .15s ease, box-shadow .15s ease;
  text-decoration: none;
  position: relative;
}
.plate:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 0 var(--ink), 0 18px 30px -10px rgba(0,0,0,0.45);
}
.plate-art {
  aspect-ratio: 1 / 1;
  background: var(--paper-2);
  border-bottom: 3px solid var(--ink);
  position: relative;
  overflow: hidden;
}
.plate-art img {
  width: 100%; height: 100%; object-fit: cover;
  image-rendering: -webkit-optimize-contrast;
}
.plate-art .plate-tier {
  position: absolute; top: 8px; left: 8px;
  background: var(--ink);
  color: var(--gold);
  font-family: var(--sans); font-weight: 700;
  font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
}
.plate-art .plate-tribe {
  position: absolute; top: 8px; right: 8px;
  background: var(--paper);
  color: var(--text-on-paper);
  border: 2px solid var(--ink);
  font-family: var(--sans); font-weight: 700;
  font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px;
}
.plate-body { padding: 14px 14px 16px; }
.plate-name {
  font-family: var(--display); font-weight: 700;
  font-size: 1.05rem; line-height: 1.2;
  color: var(--text-on-paper);
  margin: 0 0 4px;
}
.plate-sub {
  font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-on-paper-soft);
  margin: 0 0 10px;
}
.plate-stats {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 4px; padding-top: 10px;
  border-top: 2px dashed var(--paper-line);
  font-family: var(--sans);
}
.plate-stat {
  display: flex; flex-direction: column; align-items: center;
  font-size: 0.78rem;
}
.plate-stat-label {
  font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-on-paper-soft); font-weight: 700;
}
.plate-stat-value { font-weight: 700; color: var(--text-on-paper); }

.tribe-tag-Sentinel { color: var(--gold-deep); }
.tribe-tag-Dragon   { color: var(--ember-deep); }
.tribe-tag-Beast    { color: var(--leaf-deep); }
.tribe-tag-Mech     { color: var(--rime-deep); }
.tribe-tag-Undead   { color: var(--bruise-deep); }
.tribe-tag-Neutral  { color: var(--bone-deep); }

/* Tribe-tinted plate borders/shadows */
.plate[data-tribe="Sentinel"]  { background: linear-gradient(180deg, #fcf0d2, #f1d999); }
.plate[data-tribe="Beast"]     { background: linear-gradient(180deg, #e6f1cf, #cce0a6); }
.plate[data-tribe="Dragon"]    { background: linear-gradient(180deg, #f8d3bd, #ec9978); }
.plate[data-tribe="Mech"]      { background: linear-gradient(180deg, #d4ebef, #a8d3da); }
.plate[data-tribe="Undead"]    { background: linear-gradient(180deg, #ddc9ee, #c1a8e0); }
.plate[data-tribe="Neutral"]   { background: linear-gradient(180deg, #ece4ce, #d4c5a0); }

/* ------ Rune card ------ */

.rune-card {
  background: var(--paper);
  color: var(--text-on-paper);
  border: var(--stroke-thick) solid var(--ink);
  border-radius: var(--radius);
  padding: 22px 18px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  box-shadow: var(--shadow-card);
  transition: transform .15s ease;
  position: relative;
}
.rune-card:hover { transform: translateY(-4px); }
.rune-card-icon {
  width: 88px; height: 88px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--paper-2), var(--paper-deep));
  border: 3px solid var(--ink);
  filter: drop-shadow(0 4px 0 var(--ink));
  margin-top: 4px;
  overflow: hidden;
}
.rune-card-icon img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 50%;
  image-rendering: -webkit-optimize-contrast;
}
.rune-card-name {
  font-family: var(--display); font-weight: 700; font-size: 1.1rem;
  margin: 0; color: var(--text-on-paper);
}
.rune-card-tiers {
  display: flex; gap: 4px; justify-content: center;
  font-family: var(--sans); font-size: 0.7rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-on-paper-soft);
}
.rune-tier-pill {
  padding: 2px 7px;
  background: var(--paper-2);
  border: 2px solid var(--ink);
  border-radius: 999px; font-weight: 700;
}
.rune-card-desc {
  font-size: 0.92rem; color: var(--text-on-paper-soft); line-height: 1.45;
  margin: 0;
}
.rune-card-tags {
  display: flex; gap: 4px; justify-content: center; flex-wrap: wrap;
  margin-top: 4px;
}
.rune-tag {
  font-family: var(--sans); font-size: 0.68rem; letter-spacing: 0.14em;
  text-transform: uppercase; font-weight: 700;
  background: var(--ink); color: var(--gold);
  padding: 3px 8px; border-radius: 999px;
}
.rune-tag.tribe-Sentinel { background: var(--gold-deep); color: #fff; }
.rune-tag.tribe-Dragon   { background: var(--ember-deep); color: #fff; }
.rune-tag.tribe-Beast    { background: var(--leaf-deep); color: #fff; }
.rune-tag.tribe-Mech     { background: var(--rime-deep); color: #fff; }
.rune-tag.tribe-Undead   { background: var(--bruise-deep); color: #fff; }
.rune-tag.kw { background: var(--ember); color: #fff; }

/* ------ Keyword card ------ */

.keyword-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.keyword-card {
  background: var(--paper);
  color: var(--text-on-paper);
  border: var(--stroke-thick) solid var(--ink);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
}
.keyword-card-name {
  font-family: var(--display); font-weight: 700; font-size: 1.1rem;
  margin: 0 0 8px; color: var(--text-on-paper);
  display: flex; align-items: center; gap: 10px;
}
.keyword-card-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--ember); border: 2px solid var(--ink);
  flex-shrink: 0;
}
.keyword-card-dot.kw-burn { background: var(--ember); }
.keyword-card-dot.kw-freeze { background: var(--rime); }
.keyword-card-dot.kw-venom, .keyword-card-dot.kw-bloodletting, .keyword-card-dot.kw-rabid, .keyword-card-dot.kw-bloodlust { background: var(--leaf); }
.keyword-card-dot.kw-stun, .keyword-card-dot.kw-haywire, .keyword-card-dot.kw-blind { background: var(--gold); }
.keyword-card-dot.kw-shield, .keyword-card-dot.kw-everlasting, .keyword-card-dot.kw-consecrate, .keyword-card-dot.kw-relentless { background: var(--gold); }
.keyword-card-dot.kw-dread, .keyword-card-dot.kw-macabre { background: var(--bruise); }
.keyword-card-dot.kw-overclock, .keyword-card-dot.kw-supercharge, .keyword-card-dot.kw-haywire { background: var(--rime); }
.keyword-card-dot.kw-feral, .keyword-card-dot.kw-kindled { background: var(--ember); }
.keyword-card-dot.kw-fleeting, .keyword-card-dot.kw-lucid { background: var(--bruise); }
.keyword-card-dot.kw-evasion, .keyword-card-dot.kw-spread, .keyword-card-dot.kw-threat, .keyword-card-dot.kw-maim, .keyword-card-dot.kw-hatch { background: var(--bone); }
.keyword-card-text {
  font-size: 0.94rem; color: var(--text-on-paper-soft); line-height: 1.55; margin: 0;
}

/* ------ Boss card ------ */

.boss-card {
  background: linear-gradient(180deg, #2c1830, #16091c);
  color: var(--text);
  border: var(--stroke-thick) solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform .15s ease;
}
.boss-card:hover { transform: translateY(-4px); }
.boss-art {
  aspect-ratio: 1 / 1;
  background: #110820;
  border-bottom: 3px solid var(--ink);
  overflow: hidden;
}
.boss-art img { width: 100%; height: 100%; object-fit: cover; }
.boss-body { padding: 16px 18px 18px; }
.boss-name {
  font-family: var(--display); font-weight: 700; font-size: 1.1rem;
  margin: 0 0 4px; color: var(--gold);
}
.boss-sub {
  font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--bruise);
  margin: 0 0 10px;
}
.boss-stats {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px;
  padding-top: 10px; border-top: 1px dashed rgba(245, 194, 91, 0.25);
  font-family: var(--sans); font-size: 0.78rem;
}
.boss-stats .plate-stat-label { color: rgba(245, 194, 91, 0.65); }
.boss-stats .plate-stat-value { color: var(--text); }
.boss-minion {
  margin-top: 10px;
  font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.06em;
  color: var(--text-soft);
}
.boss-minion strong { color: var(--bruise); }

/* ------ CTA section ------ */

.cta {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 110, 54, 0.18) 0%, transparent 55%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  border-top: var(--stroke) solid var(--ink);
  text-align: center;
}
.cta-inner { max-width: 820px; margin: 0 auto; }
.cta .section-sub { margin: 12px auto 32px; }
.store-row-large { justify-content: center; }
.store-row-large .store-badge img { height: 64px; }
.cta-note { margin-top: 22px; font-size: 0.82rem; color: var(--text-soft); letter-spacing: 0.04em; }

/* ------ Footer ------ */

.site-footer {
  border-top: var(--stroke) solid var(--ink);
  background: var(--bg-deep);
  padding: 38px 0 50px;
}
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
.footer-nav a { color: var(--text-soft); font-size: 0.92rem; font-family: var(--sans); }
.footer-nav a:hover { color: var(--text); }
.footer-fineprint { color: var(--text-soft); font-size: 0.78rem; margin: 0; letter-spacing: 0.04em; }

/* ------ Reveal animation ------ */

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .55s ease, transform .55s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ------ Detail page (unit) ------ */

.detail-page {
  padding: 40px 0 80px;
}
.detail-back {
  font-family: var(--sans); font-size: 0.82rem; text-transform: uppercase;
  letter-spacing: 0.18em; color: var(--text-soft);
  display: inline-block; margin-bottom: 22px;
}
.detail-back:hover { color: var(--gold); }

.detail-grid {
  display: grid; gap: 32px;
  grid-template-columns: minmax(280px, 1fr) 2fr;
  align-items: start;
}
@media (max-width: 760px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-art {
  margin: 0;
  background: var(--paper);
  border: var(--stroke-thick) solid var(--ink);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  align-self: start;
  line-height: 0;
}
.detail-art img { width: 100%; height: auto; display: block; }

.detail-body {
  display: flex; flex-direction: column; gap: 18px;
}
.detail-name { font-family: var(--display); font-size: clamp(1.8rem, 3vw, 2.4rem); margin: 0; }
.detail-meta {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.detail-pill {
  font-family: var(--sans); font-size: 0.74rem; letter-spacing: 0.14em;
  text-transform: uppercase; font-weight: 700;
  padding: 5px 12px; border-radius: 999px;
  background: var(--paper); color: var(--text-on-paper);
  border: 2px solid var(--ink);
}
.detail-pill.tier { background: var(--gold); color: var(--text-on-paper); }
.detail-pill.tribe-Sentinel { background: var(--gold); }
.detail-pill.tribe-Dragon { background: var(--ember); color: #fff; }
.detail-pill.tribe-Beast { background: var(--leaf); color: #fff; }
.detail-pill.tribe-Mech { background: var(--rime); color: #fff; }
.detail-pill.tribe-Undead { background: var(--bruise); color: #fff; }
.detail-pill.tribe-Neutral { background: var(--bone); color: var(--text-on-paper); }

.detail-stats {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 0;
  background: var(--paper);
  border: var(--stroke-thick) solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  color: var(--text-on-paper);
}
@media (max-width: 580px) { .detail-stats { grid-template-columns: repeat(2, 1fr); } }
.detail-stat {
  padding: 14px 10px; text-align: center;
  border-right: 2px solid var(--paper-line);
}
.detail-stat:last-child { border-right: none; }
.detail-stat-label {
  font-family: var(--sans); font-size: 0.7rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text-on-paper-soft); font-weight: 700;
}
.detail-stat-value { font-family: var(--display); font-size: 1.7rem; font-weight: 700; }
.stat-delta {
  display: block;
  margin-top: 4px;
  font-family: var(--sans); font-size: 0.7rem; letter-spacing: 0.06em;
  font-weight: 700;
}
.stat-delta-up   { color: var(--leaf-deep); }
.stat-delta-down { color: var(--ember-deep); }

/* Tier extrapolator (unit detail) */
.tier-extrapolator {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  background: var(--paper);
  border: var(--stroke-thick) solid var(--ink);
  border-radius: var(--radius);
  padding: 10px 14px;
  box-shadow: var(--shadow-card);
}
.tier-extrapolator-label {
  font-family: var(--sans); font-size: 0.74rem; letter-spacing: 0.16em;
  text-transform: uppercase; font-weight: 700;
  color: var(--text-on-paper-soft);
  margin-right: 4px;
}
.tier-step {
  font-family: var(--sans); font-weight: 700;
  font-size: 0.84rem; letter-spacing: 0.06em;
  padding: 6px 12px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--paper-2);
  color: var(--text-on-paper);
  cursor: pointer;
  transition: background .12s ease, color .12s ease, transform .12s ease;
}
.tier-step:hover { transform: translateY(-1px); background: var(--gold); }
.tier-step.is-active {
  background: var(--ember); color: #fff;
  box-shadow: 0 3px 0 var(--ink);
}
.tier-step.is-base::after {
  content: "★";
  margin-left: 4px;
  color: var(--gold-deep);
  font-size: 0.7rem;
}
.tier-step.is-base.is-active::after { color: var(--gold); }
.tier-extrapolator-note {
  font-family: var(--sans); font-size: 0.74rem; color: var(--text-on-paper-soft);
  margin-left: auto; font-style: italic;
}

/* Boss detail */
.boss-detail-art {
  background: linear-gradient(180deg, #2c1830, #16091c);
}
.boss-detail-art img { filter: drop-shadow(0 6px 18px rgba(0,0,0,0.4)); }
.boss-ability-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 12px;
}
.boss-ability-list li { color: var(--text-on-paper-soft); }
.boss-ability-list strong { color: var(--text-on-paper); font-family: var(--sans); letter-spacing: 0.06em; }
.boss-minion-card {
  display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center;
}
.boss-minion-card img {
  width: 96px; height: 96px; object-fit: cover;
  border: 2px solid var(--ink); border-radius: var(--radius-sm);
  background: var(--paper-2);
}

/* Make boss cards in the roster behave as full-tile links */
.boss-card-link { text-decoration: none; display: flex; flex-direction: column; }
.boss-card-link h3, .boss-card-link p, .boss-card-link strong { text-decoration: none; }

.detail-section {
  background: var(--paper);
  color: var(--text-on-paper);
  border: var(--stroke-thick) solid var(--ink);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow-card);
}
.detail-section h3 {
  font-family: var(--display); font-size: 1.2rem; color: var(--text-on-paper);
  margin: 0 0 6px;
}
.detail-section p { color: var(--text-on-paper-soft); margin: 0; white-space: pre-line; }

/* ------ Inline 'Loading...' ------ */
.loading {
  text-align: center; padding: 80px 0;
  color: var(--text-soft); font-family: var(--sans); letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ============================================================
   Landing redesign — tribe spotlights, board demo, ftu, bosses,
   loop strip, hover tooltip layer.
   ============================================================ */

/* --- Tribe spotlights --- */
.section-tribes {
  background: var(--bg-deep);
  border-top: var(--stroke) solid var(--ink);
  border-bottom: var(--stroke) solid var(--ink);
}
.tribe-spotlights {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.spotlight {
  background: var(--paper);
  color: var(--text-on-paper);
  border: var(--stroke-thick) solid var(--ink);
  border-radius: var(--radius-lg);
  padding: 22px 22px 18px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--shadow-card);
  position: relative; overflow: hidden;
  transition: transform .18s ease;
}
.spotlight:hover { transform: translateY(-4px); }
.spotlight[data-tribe="Sentinel"] { background: linear-gradient(180deg, #fcf0d2, #f1d999); }
.spotlight[data-tribe="Beast"]    { background: linear-gradient(180deg, #e6f1cf, #b9d59a); }
.spotlight[data-tribe="Dragon"]   { background: linear-gradient(180deg, #f8d3bd, #e89070); }
.spotlight[data-tribe="Mech"]     { background: linear-gradient(180deg, #d4ebef, #93cad2); }
.spotlight[data-tribe="Undead"]   { background: linear-gradient(180deg, #ddc9ee, #b59ad6); }
.spotlight-head { display: flex; align-items: center; gap: 14px; }
.spotlight-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(27, 20, 48, 0.12);
  border: 3px solid var(--ink);
  display: grid; place-items: center;
  flex-shrink: 0;
  box-shadow: inset 0 -3px 0 var(--paper-line);
}
.spotlight-icon img { width: 46px; height: 46px; filter: drop-shadow(0 2px 0 rgba(0,0,0,0.25)); }
.spotlight-title h3 {
  font-family: var(--display); font-size: 1.6rem;
  margin: 0; color: var(--text-on-paper); letter-spacing: 0.04em;
}
.spotlight-count {
  font-family: var(--sans); font-size: 0.74rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text-on-paper-soft);
  margin: 2px 0 0;
}
.spotlight-blurb {
  margin: 0; font-size: 0.97rem; color: var(--text-on-paper-soft); line-height: 1.5;
}
.spotlight-keywords { display: flex; flex-wrap: wrap; gap: 6px; }
.kw-chip {
  font-family: var(--sans); font-size: 0.7rem; letter-spacing: 0.14em;
  text-transform: uppercase; font-weight: 700;
  padding: 4px 9px; border-radius: 999px;
  background: rgba(27, 20, 48, 0.85); color: var(--gold);
  border: 2px solid var(--ink);
  cursor: help;
  transition: background .15s ease, color .15s ease, transform .12s ease;
}
.kw-chip:hover, .kw-chip:focus-visible {
  background: var(--gold); color: var(--text-on-paper);
  outline: none;
  transform: translateY(-1px);
}
.spotlight-units { display: flex; gap: 8px; }
.spotlight-unit {
  flex: 1 1 0; min-width: 0;
  background: rgba(255, 255, 255, 0.55);
  border: 2px solid var(--ink); border-radius: var(--radius-sm);
  padding: 8px 6px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-decoration: none; color: var(--text-on-paper);
  transition: transform .12s ease, background .12s ease;
}
.spotlight-unit:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.75); }
.spotlight-unit-art {
  width: 100%; aspect-ratio: 1 / 1;
  background: rgba(27, 20, 48, 0.08);
  border-radius: var(--radius-sm); overflow: hidden;
  display: grid; place-items: center;
}
.spotlight-unit-art img { width: 100%; height: 100%; object-fit: cover; }
.spotlight-unit-name {
  font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.04em;
  font-weight: 700; text-align: center; line-height: 1.15;
}
.spotlight-link {
  align-self: flex-start;
  font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.16em;
  text-transform: uppercase; font-weight: 700;
  color: var(--text-on-paper);
  border-bottom: 2px solid var(--ink);
  padding: 2px 0;
}

/* --- Runes section + board demo --- */
.section-runes {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(245, 194, 91, 0.10) 0%, transparent 55%),
    var(--bg-2);
  border-bottom: var(--stroke) solid var(--ink);
}
.board-instructions {
  text-align: center; max-width: 60ch; margin: 0 auto 24px;
  color: var(--text-soft); font-size: 0.95rem;
}
.board-demo {
  margin: 0 auto;
  max-width: 880px;
  background: var(--paper);
  border: var(--stroke-thick) solid var(--ink);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  color: var(--text-on-paper);
  display: flex; flex-direction: column; gap: 18px;
}
/* One unified 10×6 grid (corner + top track + left track + play grid).
   fr units make every cell square. */
.boardgrid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 10), 1fr);
  grid-template-rows: repeat(var(--rows, 6), 1fr);
  gap: 4px;
  aspect-ratio: 10 / 6;
  position: relative;
}
.cell {
  border-radius: var(--radius-sm);
  background: rgba(60, 38, 18, 0.10);
  border: 2px solid rgba(27, 20, 48, 0.15);
  transition: background .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.cell-corner {
  background: transparent;
  border-color: transparent;
}
.cell-main { background: rgba(60, 38, 18, 0.10); }
.cell-left { background: rgba(176, 122, 230, 0.20); border-color: rgba(176, 122, 230, 0.45); }
.cell-top  { background: rgba(92, 196, 216, 0.20); border-color: rgba(92, 196, 216, 0.45); }
.cell.is-projecting {
  background: rgba(245, 194, 91, 0.48);
  box-shadow: inset 0 0 0 2px var(--gold-deep);
  border-color: var(--gold-deep);
}
.board-token {
  position: relative;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 0 var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
  z-index: 2;
}
.board-token:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); z-index: 3; }
.board-token.is-active,
.board-token.is-affected {
  outline: 3px solid var(--ember);
  outline-offset: 2px;
  z-index: 4;
}
.board-unit {
  display: block;
  background: var(--paper);
  color: var(--text-on-paper);
}
.board-unit-art {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.board-unit-runes {
  position: absolute; top: 4px; right: 4px;
  display: flex; flex-direction: column; gap: 3px;
  z-index: 2;
}
.unit-rune-badge {
  display: block;
  width: 22px; height: 22px;
  border: 2px solid var(--ink); border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--paper-2), var(--paper-deep));
  overflow: hidden;
  box-shadow: 0 2px 0 var(--ink), 0 0 0 2px rgba(245, 194, 91, 0.55);
}
.unit-rune-badge img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.board-unit-name {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 3px 6px;
  font-family: var(--sans); font-size: 0.62rem; letter-spacing: 0.06em;
  text-transform: uppercase; font-weight: 700;
  background: linear-gradient(180deg, transparent, rgba(27, 20, 48, 0.92));
  color: var(--gold);
  text-align: center;
  z-index: 1;
}
.tribe-bg-Sentinel { background: linear-gradient(180deg, #fcf0d2, #f1d999); }
.tribe-bg-Beast    { background: linear-gradient(180deg, #e6f1cf, #cce0a6); }
.tribe-bg-Dragon   { background: linear-gradient(180deg, #f8d3bd, #ec9978); }
.tribe-bg-Mech     { background: linear-gradient(180deg, #d4ebef, #a8d3da); }
.tribe-bg-Undead   { background: linear-gradient(180deg, #ddc9ee, #c1a8e0); }
.tribe-bg-Neutral  { background: linear-gradient(180deg, #ece4ce, #d4c5a0); }

.board-rune {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #fff7df, #efd396);
  color: var(--text-on-paper);
  padding: 6px;
  gap: 4px;
}
.board-rune-icon {
  width: 60%; aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: radial-gradient(circle at 30% 30%, var(--paper-2), var(--paper-deep));
  overflow: hidden;
  display: grid; place-items: center;
}
.board-rune-icon img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.board-rune-name {
  font-family: var(--sans); font-size: 0.62rem; letter-spacing: 0.08em;
  text-transform: uppercase; font-weight: 700; text-align: center;
  line-height: 1.05;
}

.board-legend {
  list-style: none; margin: 16px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: center;
  font-family: var(--sans); font-size: 0.82rem;
  color: var(--text-on-paper-soft);
}
.board-legend strong { color: var(--text-on-paper); }
.legend-swatch {
  display: inline-block; width: 12px; height: 12px; border-radius: 3px;
  border: 2px solid var(--ink); margin-right: 6px; vertical-align: middle;
}
.swatch-row { background: rgba(176, 122, 230, 0.55); }
.swatch-col { background: rgba(92, 196, 216, 0.55); }
.swatch-unit { background: var(--paper-2); }

.rune-explainer {
  margin-top: 36px;
  display: flex; flex-direction: column; align-items: center; gap: 24px;
}
.rune-explainer-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  width: 100%;
}
.rune-explainer-list li {
  background: rgba(245, 231, 200, 0.08);
  border: 2px solid rgba(245, 231, 200, 0.25);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.rune-explainer-list h4 {
  margin: 0 0 6px; color: var(--gold);
  font-family: var(--sans); text-transform: uppercase;
  letter-spacing: 0.16em; font-size: 0.82rem;
}
.rune-explainer-list p {
  margin: 0; color: var(--text-mid); font-size: 0.92rem; line-height: 1.5;
}

/* --- Featured units grid --- */
.section-units { background: var(--bg); }
.ftu-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.ftu-card {
  background: var(--paper);
  color: var(--text-on-paper);
  border: var(--stroke-thick) solid var(--ink);
  border-radius: var(--radius);
  padding: 12px;
  text-decoration: none;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--shadow-card);
  transition: transform .15s ease, box-shadow .15s ease;
  position: relative; cursor: pointer;
}
.ftu-card:hover { transform: translateY(-4px); box-shadow: 0 10px 0 var(--ink), 0 18px 30px -10px rgba(0,0,0,0.45); }
.ftu-card[data-tribe="Sentinel"] { background: linear-gradient(180deg, #fcf0d2, #f1d999); }
.ftu-card[data-tribe="Beast"]    { background: linear-gradient(180deg, #e6f1cf, #cce0a6); }
.ftu-card[data-tribe="Dragon"]   { background: linear-gradient(180deg, #f8d3bd, #ec9978); }
.ftu-card[data-tribe="Mech"]     { background: linear-gradient(180deg, #d4ebef, #a8d3da); }
.ftu-card[data-tribe="Undead"]   { background: linear-gradient(180deg, #ddc9ee, #c1a8e0); }
.ftu-art {
  aspect-ratio: 1 / 1;
  background: rgba(27, 20, 48, 0.08);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.ftu-art img { width: 100%; height: 100%; object-fit: cover; }
.ftu-meta {
  display: flex; gap: 6px; align-items: center;
  font-family: var(--sans); font-size: 0.66rem; letter-spacing: 0.14em;
  text-transform: uppercase; font-weight: 700;
}
.ftu-tribe {
  padding: 3px 8px; border-radius: 999px;
  background: var(--ink); color: var(--gold);
}
.ftu-tier { color: var(--text-on-paper-soft); }
.ftu-name { margin: 0; font-family: var(--display); font-size: 1.05rem; line-height: 1.15; color: var(--text-on-paper); }
.ftu-ability { margin: 0; font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.06em; color: var(--text-on-paper-soft); }
.section-foot { text-align: center; margin-top: 28px; }

/* --- Boss roster --- */
.section-bosses {
  background: linear-gradient(180deg, var(--bg-deep), var(--bg-2));
  border-top: var(--stroke) solid var(--ink);
}
.boss-tile-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.boss-tile {
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #2c1830, #16091c);
  color: var(--text);
  border: var(--stroke-thick) solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  box-shadow: var(--shadow-card);
  transition: transform .15s ease;
}
.boss-tile:hover { transform: translateY(-4px); }
.boss-tile-art {
  aspect-ratio: 1 / 1;
  background: #110820;
  border-bottom: 3px solid var(--ink);
  overflow: hidden;
}
.boss-tile-art img { width: 100%; height: 100%; object-fit: cover; }
.boss-tile-body { padding: 14px 16px 16px; }
.boss-tile-body h4 {
  font-family: var(--display); font-size: 1.2rem;
  color: var(--gold); margin: 0 0 8px;
}
.boss-tile-stats {
  list-style: none; margin: 0 0 8px; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  font-family: var(--sans); font-size: 0.74rem;
}
.boss-tile-stats li { display: flex; flex-direction: column; align-items: center; }
.boss-tile-stats span {
  font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(245, 194, 91, 0.65); font-weight: 700;
}
.boss-tile-stats strong { color: var(--text); font-weight: 700; }
.boss-tile-minion {
  margin: 0; font-family: var(--sans); font-size: 0.78rem;
  color: var(--text-soft);
}
.boss-tile-minion strong { color: var(--bruise); }

/* --- Loop strip --- */
.section-loop {
  background: var(--bg);
  border-top: var(--stroke) solid var(--ink);
}
.loop-row {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.loop-row li {
  background: var(--paper);
  color: var(--text-on-paper);
  border: var(--stroke-thick) solid var(--ink);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  box-shadow: var(--shadow-card);
}
.loop-num {
  position: absolute; top: -18px; left: 14px;
  width: 36px; height: 36px;
  background: var(--ember); color: #fff;
  border: 3px solid var(--ink);
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 1rem;
}
.loop-row h4 { margin: 8px 0 6px; font-family: var(--display); font-size: 1.05rem; color: var(--text-on-paper); }
.loop-row p { margin: 0; font-size: 0.9rem; color: var(--text-on-paper-soft); line-height: 1.5; }

/* --- Floating tooltip layer --- */
.gf-tooltip {
  position: fixed;
  pointer-events: none;
  z-index: 200;
  max-width: 320px;
  background: rgba(12, 8, 32, 0.97);
  color: var(--text);
  border: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-family: var(--sans); font-size: 0.86rem;
  box-shadow: 0 12px 30px -8px rgba(0,0,0,0.6);
  opacity: 0; transform: translateY(4px);
  transition: opacity .12s ease, transform .12s ease;
}
.gf-tooltip.is-visible { opacity: 1; transform: none; }
.gf-tooltip .tip-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  font-family: var(--display); font-size: 1.05rem; color: var(--gold);
  margin-bottom: 6px;
}
.gf-tooltip .tip-tribe {
  font-family: var(--sans); font-size: 0.7rem; letter-spacing: 0.14em;
  text-transform: uppercase; font-weight: 700;
  color: var(--text-mid);
}
.gf-tooltip .tip-stats {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px;
  font-size: 0.74rem; color: var(--text-mid);
  border-top: 1px dashed rgba(245, 194, 91, 0.25);
  border-bottom: 1px dashed rgba(245, 194, 91, 0.25);
  padding: 6px 0; margin: 6px 0;
}
.gf-tooltip .tip-stats span { display: flex; flex-direction: column; align-items: center; }
.gf-tooltip .tip-stats b {
  font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--gold); font-weight: 700;
}
.gf-tooltip .tip-ability { margin-top: 4px; }
.gf-tooltip .tip-ability-name {
  font-family: var(--sans); font-weight: 700; color: var(--ember);
  letter-spacing: 0.06em; margin-bottom: 4px;
}
.gf-tooltip .tip-ability-desc { color: var(--text); line-height: 1.45; }
.gf-tooltip .tip-rune-desc { color: var(--text); line-height: 1.45; margin: 4px 0; }
.gf-tooltip .tip-foot {
  margin-top: 6px; font-size: 0.7rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-soft);
}

@media (max-width: 760px) {
  .board-demo { padding: 12px; }
  .board-rune-name, .board-unit-name { font-size: 0.55rem; }
  .gf-tooltip { max-width: 260px; font-size: 0.78rem; }
}
