/* =============================================================
   GEAS — Medieval Blacksmith Forge (pixel)
   No neon, no CRT, no cyberpunk. Parchment, wood, iron, ember.
   Step() timing only. 2px solid borders. No border-radius.
   ============================================================= */

@property --r-color {
  syntax: "<color>";
  inherits: true;
  initial-value: #8a8278;
}

:root {
  /* Warm medieval palette */
  --parchment: #e8d3a0;
  --parchment-bright: #f4e4b5;
  --parchment-dark: #c4a870;
  --parchment-worn: #9b825a;
  --ink: #1c0e06;
  --ink-brown: #3a2414;

  --wood-light: #8b5a2b;
  --wood: #6b4023;
  --wood-dark: #3d2414;
  --wood-deep: #2a1808;

  --stone: #2a241c;
  --stone-deep: #15110a;
  --stone-lift: #3a332a;

  --iron: #4a433c;
  --iron-dark: #1f1a14;
  --iron-light: #6b6158;
  --steel: #8a8278;

  --ember: #ff6600;
  --flame: #ffa040;
  --flame-bright: #ffd780;
  --forge-red: #b83d1e;
  --forge-deep: #6e1f0a;

  --gold: #c9a227;
  --gold-bright: #eac957;
  --gold-deep: #7a5e10;
  --brass: #8b6914;

  --blood: #7a1f1f;
  --blood-bright: #a83232;
  --copper: #b87333;
  --copper-bright: #e08948;

  /* Aliases */
  --bg: var(--stone);
  --bg-deep: var(--stone-deep);
  --bg-lift: var(--stone-lift);
  --fg: var(--parchment);
  --muted: rgba(232, 211, 160, 0.55);
  --faint: rgba(232, 211, 160, 0.14);
  --hairline: rgba(74, 67, 60, 0.7);

  /* Fonts */
  --medieval: "Jersey 15", "Jersey 20", "Pixelify Sans", sans-serif;
  --display: "Jersey 20", "Jersey 15", "Pixelify Sans", sans-serif;
  --script: "MedievalSharp", "Pixelify Sans", serif;
  --pixel: "Pixelify Sans", "Jersey 15", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--pixel);
  image-rendering: pixelated;
  -webkit-font-smoothing: none;
  font-smooth: never;
  min-height: 100vh;
  overflow-x: hidden;
}

body {
  background-color: #3a2e24;
  /* Warm brown pixel stone brick wall — 240x120 tile, large bricks, matches hero banner palette */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='120' viewBox='0 0 240 120' shape-rendering='crispEdges'><rect width='240' height='120' fill='%23150d08'/><g><rect x='0' y='0' width='116' height='56' fill='%235a4636'/><rect x='0' y='0' width='116' height='4' fill='%237a5e46'/><rect x='0' y='0' width='4' height='56' fill='%237a5e46'/><rect x='112' y='0' width='4' height='56' fill='%23382820'/><rect x='0' y='52' width='116' height='4' fill='%23382820'/></g><g><rect x='120' y='0' width='116' height='56' fill='%235e4a38'/><rect x='120' y='0' width='116' height='4' fill='%237a5e46'/><rect x='120' y='0' width='4' height='56' fill='%237a5e46'/><rect x='232' y='0' width='4' height='56' fill='%23382820'/><rect x='120' y='52' width='116' height='4' fill='%23382820'/></g><g><rect x='0' y='60' width='56' height='56' fill='%235a4636'/><rect x='0' y='60' width='56' height='4' fill='%237a5e46'/><rect x='52' y='60' width='4' height='56' fill='%23382820'/><rect x='0' y='112' width='56' height='4' fill='%23382820'/></g><g><rect x='60' y='60' width='116' height='56' fill='%235e4a38'/><rect x='60' y='60' width='116' height='4' fill='%237a5e46'/><rect x='60' y='60' width='4' height='56' fill='%237a5e46'/><rect x='172' y='60' width='4' height='56' fill='%23382820'/><rect x='60' y='112' width='116' height='4' fill='%23382820'/></g><g><rect x='180' y='60' width='60' height='56' fill='%235a4636'/><rect x='180' y='60' width='60' height='4' fill='%237a5e46'/><rect x='180' y='60' width='4' height='56' fill='%237a5e46'/><rect x='180' y='112' width='60' height='4' fill='%23382820'/></g></svg>");
  background-repeat: repeat;
  background-attachment: fixed;
  image-rendering: pixelated;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  /* soft vignette — keep bricks clearly visible */
  background: radial-gradient(
    ellipse at 50% 40%,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.3) 65%,
    rgba(0, 0, 0, 0.65) 100%
  );
}

/* FURNACE HEAT — full viewport warm pulse + side glow, always breathing.
   z-index 50 puts it OVER section content so the warm screen-blend tints everything;
   pointer-events: none keeps it non-blocking. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background:
    /* warm halo from bottom-center (main furnace) */
    radial-gradient(
      ellipse 90% 70% at 50% 115%,
      rgba(255, 102, 0, 0.55) 0%,
      rgba(255, 64, 0, 0.3) 25%,
      rgba(184, 61, 30, 0.14) 50%,
      transparent 75%
    ),
    /* amber top-down wash */
    radial-gradient(
      ellipse 120% 45% at 50% -10%,
      rgba(255, 140, 40, 0.18),
      transparent 65%
    ),
    /* side warmth — left torch */
    radial-gradient(
      ellipse 32% 80% at -8% 40%,
      rgba(255, 102, 0, 0.25),
      transparent 55%
    ),
    /* side warmth — right torch */
    radial-gradient(
      ellipse 32% 80% at 108% 40%,
      rgba(255, 102, 0, 0.25),
      transparent 55%
    );
  mix-blend-mode: screen;
  animation: furnace-breath 4.6s steps(22) infinite;
}
/* Irregular furnace breath — fire never pulses smoothly */
@keyframes furnace-breath {
  0%   { opacity: 0.55; }
  7%   { opacity: 0.98; }
  12%  { opacity: 0.68; }
  22%  { opacity: 1; }
  30%  { opacity: 0.78; }
  44%  { opacity: 1; }
  52%  { opacity: 0.72; }
  66%  { opacity: 0.98; }
  78%  { opacity: 0.68; }
  88%  { opacity: 0.96; }
  100% { opacity: 0.55; }
}

/* =============================================================
   EMBER FIELD — full-viewport rising sparks (always visible)
   ============================================================= */
.ember-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 51;
  overflow: hidden;
  mix-blend-mode: screen;
}
.ember {
  position: absolute;
  bottom: -20px;
  width: 4px;
  height: 4px;
  background: #ffaa44;
  box-shadow:
    0 0 4px 1px #ff7722,
    0 0 10px 3px rgba(255, 102, 0, 0.6),
    0 0 22px 6px rgba(255, 102, 0, 0.25);
  animation: ember-rise linear infinite;
  image-rendering: pixelated;
}
.ember--red {
  background: #ff4422;
  box-shadow:
    0 0 4px 1px #ff2200,
    0 0 10px 3px rgba(255, 60, 0, 0.55),
    0 0 20px 6px rgba(184, 20, 0, 0.25);
}
.ember--hot {
  background: #ffe090;
  box-shadow:
    0 0 4px 1px #ffcc60,
    0 0 10px 3px rgba(255, 180, 80, 0.6),
    0 0 20px 6px rgba(255, 140, 40, 0.3);
}
.ember--big { width: 6px; height: 6px; }

@keyframes ember-rise {
  0%   { transform: translate(0, 0) scale(1); opacity: 0; }
  8%   { opacity: 1; }
  50%  { transform: translate(14px, -48vh) scale(0.95); opacity: 0.9; }
  90%  { transform: translate(-10px, -96vh) scale(0.6); opacity: 0.5; }
  100% { transform: translate(0, -110vh) scale(0.3); opacity: 0; }
}

body > * {
  position: relative;
  z-index: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
}

img {
  image-rendering: pixelated;
}

hr {
  border: none;
  border-top: 2px solid var(--iron);
  margin: 12px 0;
}

/* =============================================================
   NAV — text-only floating (no chrome)
   ============================================================= */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--wood-dark);
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(0, 0, 0, 0) 0 78px,
      rgba(0, 0, 0, 0.45) 78px 82px
    );
  border-bottom: 4px solid var(--iron);
  box-shadow:
    0 2px 0 var(--iron-dark),
    0 6px 0 var(--wood-deep),
    0 8px 0 var(--iron-dark),
    0 14px 24px rgba(0, 0, 0, 0.6);
}
.nav.nav--bare {
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  padding: 18px 32px;
}
.nav.nav--bare .nav__brand {
  font-size: 28px;
  text-shadow: 2px 2px 0 var(--ink);
  filter: drop-shadow(0 0 2px rgba(234, 201, 87, 0.35));
}
.nav.nav--bare .nav__cta {
  all: unset;
  cursor: pointer;
  font-family: var(--medieval);
  font-size: 22px;
  letter-spacing: 1px;
  color: var(--parchment);
  padding: 6px 4px;
  text-shadow: 2px 2px 0 var(--ink);
  border-bottom: 2px solid transparent;
  transition: all 0.1s steps(2);
}
.nav.nav--bare .nav__cta:hover {
  color: var(--gold-bright);
  border-bottom-color: var(--gold);
}

/* separator dot + external nav links (X / GITHUB / SOLSCAN) */
.nav__sep {
  color: var(--parchment-worn);
  font-size: 22px;
  opacity: 0.5;
  padding: 0 2px;
  user-select: none;
}
.nav.nav--bare .nav__ext {
  color: var(--gold-bright);
  letter-spacing: 2px;
  font-size: 20px;
  text-shadow: 2px 2px 0 var(--ink);
}
.nav.nav--bare .nav__ext:hover {
  color: var(--ember);
  border-bottom-color: var(--ember);
}
.nav.nav--bare .nav__ext--buy {
  color: var(--forge-red);
  border-bottom: 2px solid var(--forge-red);
  text-shadow: 2px 2px 0 var(--ink);
  padding: 6px 10px;
}
.nav.nav--bare .nav__ext--buy:hover {
  color: var(--parchment-bright);
  background: var(--forge-red);
  border-bottom-color: var(--forge-red);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--display);
  font-size: 36px;
  color: var(--gold-bright);
  letter-spacing: 3px;
  text-shadow:
    2px 2px 0 var(--gold-deep),
    3px 3px 0 var(--ink);
}

.nav__logo {
  height: 52px;
  width: 52px;
  object-fit: cover;
  object-position: center 28%;
  image-rendering: pixelated;
  filter: drop-shadow(2px 2px 0 var(--ink));
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-family: var(--medieval);
  font-size: 22px;
  letter-spacing: 1px;
}

.nav__links a {
  color: var(--parchment);
  padding: 6px 4px;
  transition: all 0.1s steps(2);
  text-shadow: 2px 2px 0 var(--ink);
  border-bottom: 2px solid transparent;
}
.nav__links a:hover {
  color: var(--gold-bright);
  border-bottom-color: var(--gold);
}

.nav__cta {
  padding: 10px 20px;
  font-family: var(--medieval);
  font-size: 20px;
  letter-spacing: 1px;
  color: var(--parchment-bright);
  background: var(--forge-red);
  border: 3px solid var(--iron);
  box-shadow:
    inset 0 0 0 2px var(--forge-deep),
    3px 3px 0 var(--ink),
    4px 4px 0 var(--iron-dark);
  text-shadow: 2px 2px 0 var(--ink);
  transition: all 0.1s steps(2);
}

.nav__cta:hover {
  background: var(--ember);
  color: var(--ink);
  transform: translate(-1px, -1px);
  box-shadow:
    inset 0 0 0 2px var(--forge-deep),
    4px 4px 0 var(--ink),
    5px 5px 0 var(--iron-dark);
}

/* =============================================================
   HERO — the grand hall doorway
   ============================================================= */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 100px 32px 80px;
  border-bottom: 6px solid var(--iron);
  box-shadow: inset 0 -10px 0 var(--iron-dark);
}

/* Hero-scoped heat overlays removed — blur + screen blend was haze-ing
   the pixel art at the bottom of the banner. Furnace warmth comes from
   body::after now (full-viewport, no blur, doesn't touch the banner). */

@keyframes hero-heat-breath {
  0%, 100% { opacity: 0.7; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.1) translateY(-2%); }
}
@keyframes hero-heat-rise {
  0% { opacity: 0.5; transform: translateY(10%) scaleY(0.95); }
  50% { opacity: 0.95; transform: translateY(-4%) scaleY(1.08); }
  100% { opacity: 0.5; transform: translateY(10%) scaleY(0.95); }
}

.hero__bg {
  position: absolute;
  inset: 0;
  background-image: url("./public/banner.png");
  background-size: cover;
  background-position: center;
  image-rendering: pixelated;
  z-index: 0;
}

/* Warm amber darkening overlay with strong center vignette for text legibility */
.hero__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse 48% 60% at 50% 50%,
      rgba(10, 5, 2, 0.78) 0%,
      rgba(16, 8, 3, 0.55) 45%,
      rgba(28, 14, 6, 0.35) 100%
    );
  z-index: 1;
  pointer-events: none;
}
/* (top/bottom letterbox bands removed — they looked like cropping) */

.hero__content {
  position: relative;
  z-index: 3;
  text-align: center;
  max-width: 960px;
  /* dark parchment plate behind content so text pops off busy banner */
  padding: 48px 48px 40px;
}
.hero__content::before {
  content: "";
  position: absolute;
  inset: -20px -60px;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0.68) 0%,
    rgba(0, 0, 0, 0.45) 55%,
    transparent 85%
  );
  z-index: -1;
  pointer-events: none;
}

.hero__eyebrow {
  font-family: var(--medieval);
  font-size: clamp(20px, 2vw, 28px);
  letter-spacing: 2px;
  color: var(--gold-bright);
  margin-bottom: 28px;
  text-shadow: 2px 2px 0 var(--ink);
}

.hero__title {
  font-family: var(--display);
  font-size: clamp(72px, 13vw, 160px);
  line-height: 0.95;
  letter-spacing: 3px;
  color: var(--parchment-bright);
  margin-bottom: 32px;
  /* Thick black outline (stroke) + layered drop shadow for punch */
  -webkit-text-stroke: 2px var(--ink);
  text-shadow:
    0 0 8px rgba(0, 0, 0, 0.9),
    4px 4px 0 var(--forge-red),
    5px 5px 0 var(--ink),
    9px 9px 0 var(--ink-brown),
    13px 13px 0 var(--ink);
}

.hero__sub {
  font-family: var(--medieval);
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.4;
  color: var(--parchment-bright);
  margin-bottom: 48px;
  letter-spacing: 2px;
  text-shadow:
    0 0 6px rgba(0, 0, 0, 0.8),
    2px 2px 0 var(--ink),
    3px 3px 0 var(--ink-brown);
}

.hero__ctas {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 64px;
}

.hero__stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
  padding: 14px 22px;
  background: rgba(28, 14, 6, 0.82);
  border: 3px solid var(--gold);
  box-shadow:
    inset 0 0 0 2px var(--wood-dark),
    3px 3px 0 var(--ink),
    4px 4px 0 var(--iron-dark);
  min-width: 160px;
}
.stat__value {
  font-family: var(--medieval);
  font-size: clamp(28px, 3.6vw, 42px);
  color: var(--gold-bright);
  margin-bottom: 6px;
  text-shadow: 2px 2px 0 var(--ink);
  line-height: 1.1;
}
.stat__label {
  font-family: var(--medieval);
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--parchment-worn);
  text-shadow: 1px 1px 0 var(--ink);
}

/* =============================================================
   HERO MOUNTED WEAPONS — flanking showroom pieces
   ============================================================= */
.hero__weapon {
  position: absolute;
  top: 50%;
  width: clamp(180px, 24vw, 380px);
  height: auto;
  image-rendering: pixelated;
  z-index: 3;
  pointer-events: none;
  filter:
    drop-shadow(5px 5px 0 rgba(0, 0, 0, 0.75))
    drop-shadow(0 0 28px rgba(255, 102, 0, 0.22));
  animation: weapon-sway 5s steps(6) infinite;
}
.hero__weapon--left {
  left: clamp(8px, 3vw, 60px);
  --rot: -28deg;
  animation-delay: 0s;
}
.hero__weapon--right {
  right: clamp(8px, 3vw, 60px);
  --rot: 22deg;
  animation-delay: -2.5s;
  filter:
    drop-shadow(5px 5px 0 rgba(0, 0, 0, 0.75))
    drop-shadow(0 0 32px rgba(234, 201, 87, 0.28));
}
@keyframes weapon-sway {
  0%, 100% { transform: translateY(-50%) rotate(var(--rot, -28deg)); }
  50%      { transform: translateY(calc(-50% - 5px)) rotate(calc(var(--rot, -28deg) + 1.5deg)); }
}

@media (max-width: 1100px) {
  .hero__weapon {
    opacity: 0.32;
    width: clamp(130px, 20vw, 220px);
  }
}
@media (max-width: 700px) {
  .hero__weapon { display: none; }
}

/* =============================================================
   QUEST WEAPON IMAGES — fill the runestone plate
   ============================================================= */
.quest__weapon {
  width: 98px;
  height: 98px;
  object-fit: contain;
  image-rendering: pixelated;
  filter:
    drop-shadow(2px 2px 0 var(--ink))
    drop-shadow(0 0 10px rgba(255, 160, 64, 0.3));
  transition: transform 0.15s steps(3);
}
.quest:hover .quest__weapon {
  transform: rotate(-6deg) scale(1.06);
}

/* =============================================================
   SECTION EMBLEM — heraldic crest above title
   ============================================================= */
.section__emblem {
  display: block;
  width: clamp(110px, 12vw, 168px);
  height: auto;
  margin: 0 auto 12px;
  image-rendering: pixelated;
  filter:
    drop-shadow(3px 3px 0 var(--ink))
    drop-shadow(0 0 18px rgba(234, 201, 87, 0.25));
}

/* =============================================================
   FOOTER EMBLEM — guild shield next to brand
   ============================================================= */
.footer__emblem {
  width: 88px;
  height: auto;
  margin-bottom: 10px;
  image-rendering: pixelated;
  filter: drop-shadow(2px 2px 0 var(--ink));
}

/* =============================================================
   TORCHES — wooden stake + cloth + flame
   ============================================================= */
.torch {
  position: absolute;
  top: 160px;
  z-index: 4;
  width: 52px;
  height: 170px;
  pointer-events: none;
}
.torch--left { left: 48px; }
.torch--right { right: 48px; }

.torch__stick {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 72px;
  background: var(--wood);
  border: 2px solid var(--wood-deep);
  box-shadow: 2px 0 0 var(--wood-deep);
}
.torch__stick::before {
  content: "";
  position: absolute;
  top: 0;
  left: -6px;
  width: 22px;
  height: 14px;
  background: var(--ink-brown);
  border: 2px solid var(--wood-deep);
}
.torch__stick::after {
  content: "";
  position: absolute;
  top: 2px;
  left: -2px;
  width: 14px;
  height: 2px;
  background: var(--iron);
}

.torch__flame {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 84px;
  animation: flame-sway 0.7s steps(3) infinite;
}

.torch__pixel {
  position: absolute;
  animation: flame-flicker 0.36s steps(2) infinite;
}

.torch__pixel--1 {
  width: 10px; height: 10px;
  left: 15px; top: 72px;
  background: var(--forge-red);
}
.torch__pixel--2 {
  width: 20px; height: 14px;
  left: 10px; top: 54px;
  background: var(--ember);
  animation-delay: -0.08s;
}
.torch__pixel--3 {
  width: 28px; height: 20px;
  left: 6px; top: 26px;
  background: var(--flame);
  animation-delay: -0.14s;
}
.torch__pixel--4 {
  width: 14px; height: 14px;
  left: 13px; top: 10px;
  background: var(--flame-bright);
  animation-delay: -0.2s;
}
.torch__pixel--5 {
  width: 6px; height: 8px;
  left: 17px; top: 2px;
  background: var(--parchment-bright);
  animation-delay: -0.24s;
}

.torch__glow {
  position: absolute;
  top: -20px;
  left: -80px;
  width: 220px;
  height: 220px;
  background: radial-gradient(
    circle,
    rgba(255, 200, 80, 0.45) 0%,
    rgba(255, 102, 0, 0.28) 25%,
    rgba(184, 61, 30, 0.14) 55%,
    transparent 80%
  );
  box-shadow:
    0 0 0 20px rgba(255, 102, 0, 0.12),
    0 0 0 40px rgba(255, 102, 0, 0.06),
    0 0 0 70px rgba(255, 102, 0, 0.03);
  animation: flame-glow 0.6s steps(3) infinite;
  filter: blur(2px);
  mix-blend-mode: screen;
  pointer-events: none;
}

@keyframes flame-flicker {
  0%, 100% { opacity: 1; transform: translateY(0); }
  50% { opacity: 0.72; transform: translateY(-1px); }
}
@keyframes flame-sway {
  0%, 100% { transform: translateX(-50%) skewX(0deg); }
  33% { transform: translateX(-50%) skewX(-3deg); }
  66% { transform: translateX(-50%) skewX(3deg); }
}
@keyframes flame-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

/* =============================================================
   BUTTONS — iron-bound planks
   ============================================================= */
.btn {
  display: inline-block;
  padding: 16px 30px;
  font-family: var(--medieval);
  font-size: 26px;
  letter-spacing: 1px;
  border: 3px solid var(--iron);
  transition: all 0.1s steps(2);
  cursor: pointer;
  text-align: center;
  text-shadow: 2px 2px 0 var(--ink);
}
.btn--small {
  padding: 10px 18px;
  font-size: 20px;
}

/* Pixel-art hammer icon appended after button label */
.btn--hammer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn--hammer::after {
  content: "";
  display: inline-block;
  width: 22px;
  height: 22px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' shape-rendering='crispEdges'><g fill='%236b6158'><rect x='1' y='1' width='7' height='5'/></g><g fill='%238a8278'><rect x='1' y='1' width='7' height='1'/><rect x='1' y='1' width='1' height='5'/></g><g fill='%231f1a14'><rect x='7' y='1' width='1' height='5'/><rect x='1' y='5' width='7' height='1'/><rect x='0' y='0' width='9' height='1'/><rect x='0' y='0' width='1' height='7'/><rect x='8' y='6' width='1' height='1'/></g><g fill='%236b4023'><rect x='7' y='6' width='2' height='2'/><rect x='8' y='8' width='2' height='2'/><rect x='9' y='10' width='2' height='2'/><rect x='10' y='12' width='2' height='2'/><rect x='11' y='14' width='2' height='2'/></g><g fill='%238b5a2b'><rect x='7' y='6' width='1' height='1'/><rect x='8' y='8' width='1' height='1'/><rect x='9' y='10' width='1' height='1'/><rect x='10' y='12' width='1' height='1'/><rect x='11' y='14' width='1' height='1'/></g><g fill='%233d2414'><rect x='8' y='7' width='1' height='1'/><rect x='9' y='9' width='1' height='1'/><rect x='10' y='11' width='1' height='1'/><rect x='11' y='13' width='1' height='1'/><rect x='12' y='15' width='1' height='1'/></g></svg>");
  background-size: contain;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  filter: drop-shadow(1px 1px 0 rgba(0,0,0,0.6));
  transition: transform 0.08s steps(2);
}
.btn--hammer:hover::after {
  transform: rotate(-20deg) translateY(-1px);
}
.btn--large {
  padding: 20px 36px;
  font-size: 30px;
}
.btn--full {
  width: 100%;
}

.btn--primary {
  background: var(--forge-red);
  color: var(--parchment-bright);
  box-shadow:
    inset 0 0 0 2px var(--forge-deep),
    4px 4px 0 var(--ink),
    5px 5px 0 var(--iron-dark);
}
.btn--primary:hover {
  background: var(--ember);
  color: var(--ink);
  text-shadow: none;
  transform: translate(-2px, -2px);
  box-shadow:
    inset 0 0 0 2px var(--forge-red),
    6px 6px 0 var(--ink),
    7px 7px 0 var(--iron-dark);
}

.btn--ghost {
  background: var(--wood);
  color: var(--parchment);
  border-color: var(--iron);
  box-shadow:
    inset 0 0 0 2px var(--wood-deep),
    4px 4px 0 var(--ink),
    5px 5px 0 var(--iron-dark);
}
.btn--ghost:hover {
  background: var(--wood-light);
  color: var(--parchment-bright);
  transform: translate(-2px, -2px);
  box-shadow:
    inset 0 0 0 2px var(--wood-deep),
    6px 6px 0 var(--ink),
    7px 7px 0 var(--iron-dark);
}

@keyframes gild-flicker {
  0%, 100% { color: var(--gold-bright); }
  50% { color: var(--gold); }
}

/* =============================================================
   DIVIDER — iron chain with sigil
   ============================================================= */
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 28px 32px;
  max-width: 1400px;
  margin: 0 auto;
}
.divider__line {
  flex: 1;
  height: 6px;
  background: var(--iron);
  border-top: 2px solid var(--iron-light);
  border-bottom: 2px solid var(--iron-dark);
}
.divider__dots {
  font-family: var(--medieval);
  font-size: 28px;
  color: var(--gold-bright);
  letter-spacing: 10px;
  text-shadow: 2px 2px 0 var(--ink);
}

/* =============================================================
   LORE BAR — parchment scroll
   ============================================================= */
.lore {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 40px;
  background: var(--parchment);
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(107, 64, 35, 0) 0 14px,
      rgba(107, 64, 35, 0.04) 14px 16px
    );
  color: var(--ink);
  border: 4px solid var(--wood-dark);
  box-shadow:
    inset 0 0 0 2px var(--wood-light),
    inset 0 0 0 6px var(--parchment-dark),
    6px 6px 0 var(--ink),
    8px 8px 0 var(--iron-dark);
  position: relative;
}
.lore::before,
.lore::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 48px;
  background: var(--wood-dark);
  border: 2px solid var(--iron-dark);
}
.lore::before { left: -18px; }
.lore::after { right: -18px; }

.lore__text {
  font-family: var(--script);
  font-size: clamp(22px, 2.2vw, 30px);
  letter-spacing: 0.5px;
  color: var(--ink);
  line-height: 1.5;
  text-align: justify;
}
.lore__drop {
  float: left;
  font-family: "MedievalSharp", serif;
  font-size: 92px;
  line-height: 0.85;
  color: var(--blood);
  margin-right: 12px;
  padding-top: 2px;
  text-shadow: 3px 3px 0 var(--parchment-dark);
}

/* =============================================================
   SECTION BASE
   ============================================================= */
.section {
  padding: 72px 32px 96px;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}

.section__head {
  text-align: center;
  margin-bottom: 56px;
  position: relative;
  padding: 40px 0 20px;
}

.section__kanji {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -46%);
  font-family: "UnifrakturCook", "MedievalSharp", serif;
  font-weight: 700;
  font-size: clamp(200px, 26vw, 420px);
  line-height: 0.82;
  color: rgba(122, 31, 31, 0.18);
  letter-spacing: 8px;
  pointer-events: none;
  z-index: 0;
  user-select: none;
  text-shadow:
    3px 3px 0 rgba(15, 8, 3, 0.5),
    0 0 40px rgba(184, 61, 30, 0.14);
  white-space: nowrap;
}

.section__eyebrow,
.section__title,
.section__sub {
  position: relative;
  z-index: 1;
}

.section__eyebrow {
  font-family: var(--medieval);
  font-size: 20px;
  letter-spacing: 4px;
  color: var(--gold-bright);
  margin-bottom: 10px;
  text-shadow: 2px 2px 0 var(--ink);
}

.section__title {
  font-family: var(--display);
  font-size: clamp(58px, 7.5vw, 104px);
  letter-spacing: 3px;
  color: var(--parchment-bright);
  margin-bottom: 14px;
  line-height: 0.95;
  text-shadow:
    3px 3px 0 var(--forge-red),
    6px 6px 0 var(--ink-brown),
    9px 9px 0 var(--ink);
}

.section__sub {
  font-family: var(--script);
  font-size: clamp(22px, 2vw, 28px);
  letter-spacing: 1px;
  color: var(--parchment-worn);
  max-width: 760px;
  margin: 0 auto;
  text-shadow: 1px 1px 0 var(--ink);
}

/* =============================================================
   DISPLAY NOTICE — red iron plaque with warning
   ============================================================= */
.display-notice {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 0 auto 48px;
  max-width: 1100px;
  background: var(--blood);
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(0, 0, 0, 0) 0 10px,
      rgba(0, 0, 0, 0.2) 10px 12px
    );
  color: var(--parchment-bright);
  border: 4px solid var(--iron);
  box-shadow:
    inset 0 0 0 2px var(--blood-bright),
    inset 0 0 0 6px var(--iron-dark),
    6px 6px 0 var(--ink),
    9px 9px 0 var(--iron-dark);
  position: relative;
}
.display-notice::before,
.display-notice::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--iron-light);
  border: 2px solid var(--iron-dark);
  box-shadow: inset 1px 1px 0 var(--steel);
}
.display-notice::before { top: 10px; left: 10px; }
.display-notice::after { top: 10px; right: 10px; }

.display-notice__stamp {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 26px;
  font-size: 56px;
  font-family: var(--display);
  color: var(--gold-bright);
  background: rgba(0, 0, 0, 0.3);
  border-left: 2px solid var(--iron-dark);
  border-right: 2px solid var(--iron-dark);
  text-shadow: 2px 2px 0 var(--ink);
  animation: warn-flicker 1.4s steps(3) infinite;
}

.display-notice__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px 22px;
}
.display-notice__body strong {
  font-family: var(--display);
  font-size: clamp(28px, 3vw, 42px);
  letter-spacing: 4px;
  color: var(--gold-bright);
  text-shadow: 3px 3px 0 var(--ink);
  line-height: 1;
}
.display-notice__body span {
  font-family: var(--script);
  font-size: clamp(16px, 1.4vw, 20px);
  color: var(--parchment);
  letter-spacing: 0.5px;
  line-height: 1.3;
  font-style: italic;
  text-shadow: 1px 1px 0 var(--ink);
}

@keyframes warn-flicker {
  0%, 80%, 100% { color: var(--gold-bright); }
  85% { color: var(--ember); }
  90% { color: var(--flame-bright); }
  95% { color: var(--gold-bright); }
}

@media (max-width: 640px) {
  .display-notice { flex-direction: column; }
  .display-notice__stamp {
    padding: 8px;
    font-size: 36px;
    border-left: none;
    border-right: none;
    border-top: 2px solid var(--iron-dark);
    border-bottom: 2px solid var(--iron-dark);
  }
  .display-notice__body strong { font-size: 22px; letter-spacing: 2px; }
}

/* Mini variant — tiny pill so it doesn't scream at users */
.display-notice--mini {
  display: flex;
  width: fit-content;
  margin: 0 auto 18px;
  padding: 4px 10px;
  background: rgba(10, 6, 2, 0.45);
  border: 1px solid var(--iron);
  box-shadow: none;
  font-family: var(--medieval);
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--parchment-worn);
  text-shadow: 1px 1px 0 var(--ink);
  text-transform: uppercase;
  opacity: 0.7;
}
.display-notice--mini::before,
.display-notice--mini::after { display: none; }
.display-notice--mini span { display: inline; }

/* =============================================================
   ARMORY — display cases in a hall
   ============================================================= */
.armory__toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 32px;
  padding: 16px 20px;
  background: var(--wood-dark);
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(0, 0, 0, 0) 0 64px,
      rgba(0, 0, 0, 0.32) 64px 66px
    );
  border: 4px solid var(--iron);
  box-shadow:
    inset 0 0 0 2px var(--wood-deep),
    4px 4px 0 var(--ink),
    5px 5px 0 var(--iron-dark);
}

.armory__filters,
.armory__sort {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.armory__sort-label {
  font-family: var(--medieval);
  font-size: 20px;
  color: var(--parchment-worn);
  margin-right: 6px;
  letter-spacing: 1px;
  text-shadow: 1px 1px 0 var(--ink);
}

.filter,
.sort {
  font-family: var(--medieval);
  font-size: 20px;
  letter-spacing: 1px;
  padding: 6px 14px;
  border: 3px solid var(--iron);
  background: var(--stone);
  color: var(--parchment-worn);
  box-shadow: 2px 2px 0 var(--ink);
  text-shadow: 1px 1px 0 var(--ink);
  transition: all 0.1s steps(2);
}
.filter:hover,
.sort:hover {
  background: var(--wood);
  color: var(--gold-bright);
}
.filter.is-active,
.sort.is-active {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold-deep);
  text-shadow: none;
  box-shadow: inset 2px 2px 0 var(--gold-bright), 2px 2px 0 var(--ink);
}

.armory__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 26px;
}

/* --- CAPSULE CARD as framed display case --- */
.capsule {
  position: relative;
  padding: 54px 20px 20px;
  background: var(--parchment);
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(107, 64, 35, 0) 0 12px,
      rgba(107, 64, 35, 0.04) 12px 14px
    );
  color: var(--ink);
  display: flex;
  flex-direction: column;
  border: 4px solid var(--wood-dark);
  box-shadow:
    inset 0 0 0 2px var(--wood-light),
    inset 0 0 0 6px var(--parchment-dark),
    4px 4px 0 var(--ink),
    6px 6px 0 var(--iron-dark);
  transition: all 0.1s steps(2);
  cursor: pointer;
  --r-color: #8a8278;
}

/* Normalize sub-section heights so cards align across a row */
.capsule__name { min-height: 2.4em; display: flex; align-items: center; justify-content: center; }
.capsule__flavor { min-height: 2.2em; }
.capsule .btn--small { margin-top: auto; }
.capsule:hover {
  transform: translate(-3px, -3px);
  box-shadow:
    inset 0 0 0 2px var(--wood-light),
    inset 0 0 0 6px var(--parchment-dark),
    7px 7px 0 var(--ink),
    9px 9px 0 var(--iron-dark),
    0 0 0 4px var(--r-color);
  z-index: 5;
}

.capsule--common { --r-color: #8a8278; }
.capsule--uncommon { --r-color: #b87333; }
.capsule--epic { --r-color: #a83232; }
.capsule--legendary {
  --r-color: #c9a227;
  animation: gild-pulse 2.4s steps(3) infinite;
}
@keyframes gild-pulse {
  0%, 100% { --r-color: #c9a227; }
  50% { --r-color: #eac957; }
}

/* Iron rivets at corners */
.capsule::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 10px;
  width: 8px;
  height: 8px;
  background: var(--iron);
  box-shadow:
    calc(100% + 12px) 0 0 0 var(--iron),
    0 calc(100% + 12px) 0 0 var(--iron),
    calc(100% + 12px) calc(100% + 12px) 0 0 var(--iron);
  z-index: 3;
}

.capsule__banner {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  font-family: var(--medieval);
  font-size: 18px;
  letter-spacing: 2px;
  color: var(--parchment-bright);
  background: var(--r-color);
  border: 2px solid var(--iron-dark);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.15),
    2px 2px 0 var(--ink);
  text-shadow: 1px 1px 0 var(--ink);
  z-index: 2;
  white-space: nowrap;
}

.capsule__icon {
  width: 108px;
  height: 108px;
  margin: 8px auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--iron);
  background: var(--stone-deep);
  box-shadow:
    inset 0 0 0 2px var(--iron-dark),
    inset 2px 2px 0 var(--wood-dark),
    2px 2px 0 var(--ink);
  color: var(--r-color);
}

.rune {
  width: 72px;
  height: 72px;
  display: block;
  filter:
    drop-shadow(2px 2px 0 var(--ink))
    drop-shadow(0 0 4px var(--r-color));
}
.rune--lg {
  width: 86px;
  height: 86px;
}

.token-logo {
  width: 82px;
  height: 82px;
  object-fit: contain;
  display: block;
  image-rendering: auto;
  filter:
    drop-shadow(3px 3px 0 var(--ink))
    drop-shadow(0 0 10px var(--r-color));
}

.capsule__name {
  font-family: var(--medieval);
  font-size: 22px;
  color: var(--ink);
  margin-bottom: 4px;
  text-align: center;
  letter-spacing: 1px;
  line-height: 1.15;
  text-shadow: 1px 1px 0 var(--parchment-dark);
}

.capsule__flavor {
  font-family: var(--script);
  font-size: 20px;
  color: var(--ink-brown);
  font-style: italic;
  text-align: center;
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}

.capsule__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
  margin-bottom: 14px;
  padding: 12px;
  background: var(--parchment-bright);
  border: 2px solid var(--wood-dark);
  box-shadow: inset 0 0 0 1px var(--parchment-dark);
}
.capsule__stats > div {
  display: flex;
  justify-content: space-between;
  font-family: var(--medieval);
  font-size: 18px;
  letter-spacing: 1px;
  color: var(--ink);
}
.capsule__stats dt { color: var(--ink-brown); }
.capsule__stats dd { color: var(--ink); }

.val--good { color: var(--forge-red) !important; font-weight: bold; }
.val--bad { color: var(--blood); }
.val--common { color: #5a544e; }
.val--uncommon { color: var(--copper); }
.val--epic { color: var(--blood-bright); }
.val--legendary { color: var(--gold-deep); animation: gild-pulse-text 2.4s steps(3) infinite; }
@keyframes gild-pulse-text {
  0%, 100% { color: var(--gold-deep); }
  50% { color: var(--gold); }
}

.capsule__progress {
  position: relative;
  height: 22px;
  border: 2px solid var(--iron-dark);
  margin-bottom: 14px;
  background: var(--stone-deep);
  box-shadow: inset 2px 2px 0 var(--ink);
}
.capsule__bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--forge-red);
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(0, 0, 0, 0) 0 6px,
      rgba(0, 0, 0, 0.2) 6px 8px
    );
  image-rendering: pixelated;
  border-right: 2px solid var(--ember);
}
.capsule__bar-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--medieval);
  font-size: 14px;
  color: var(--parchment-bright);
  letter-spacing: 1px;
  text-shadow: 1px 1px 0 var(--ink);
}

/* --- TOOLTIP as unfurled parchment --- */
.tooltip {
  position: absolute;
  top: 0;
  left: calc(100% + 20px);
  width: 320px;
  padding: 18px;
  background: var(--parchment);
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(107, 64, 35, 0) 0 10px,
      rgba(107, 64, 35, 0.05) 10px 12px
    );
  color: var(--ink);
  border: 4px solid var(--wood-dark);
  box-shadow:
    inset 0 0 0 2px var(--wood-light),
    inset 0 0 0 6px var(--parchment-dark),
    6px 6px 0 var(--ink),
    8px 8px 0 var(--iron-dark);
  font-family: var(--medieval);
  font-size: 18px;
  letter-spacing: 0.5px;
  line-height: 1.5;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-12px);
  transition: all 0.1s steps(2);
  z-index: 50;
}
.capsule:hover .tooltip {
  opacity: 1;
  transform: translateX(0);
}
.tooltip hr {
  border: none;
  border-top: 2px dashed var(--wood);
  margin: 10px 0;
}
.tooltip__title {
  font-family: var(--medieval);
  font-size: 22px;
  color: var(--r-color);
  margin-bottom: 4px;
  letter-spacing: 1px;
  line-height: 1.2;
  text-shadow: 1px 1px 0 var(--parchment-dark);
}
.tooltip__rarity {
  color: var(--r-color);
  font-size: 18px;
}
.tooltip__type {
  color: var(--ink-brown);
  font-size: 18px;
}
.tooltip__stat { color: var(--ink-brown); }
.tooltip__stat b { color: var(--ink); font-weight: normal; }
.tooltip__stat em { color: var(--forge-red); font-style: normal; font-weight: bold; }
.tooltip__lore {
  color: var(--blood);
  font-family: var(--script);
  font-size: 20px;
  font-style: italic;
}
.tooltip__footer {
  color: var(--forge-red);
  font-size: 16px;
}

.armory__loadmore {
  margin-top: 40px;
  text-align: center;
}

/* =============================================================
   QUEST LOG — nailed parchment quests
   ============================================================= */
.quest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 26px;
}

.quest {
  position: relative;
  padding: 28px 22px 22px;
  background: var(--parchment);
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(107, 64, 35, 0) 0 80px,
      rgba(107, 64, 35, 0.04) 80px 82px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(107, 64, 35, 0) 0 28px,
      rgba(107, 64, 35, 0.05) 28px 30px
    );
  color: var(--ink);
  border: 4px solid var(--wood-dark);
  box-shadow:
    inset 0 0 0 2px var(--wood-light),
    inset 0 0 0 6px var(--parchment-dark),
    4px 4px 0 var(--ink),
    6px 6px 0 var(--iron-dark);
  transition: all 0.1s steps(2);
}
.quest:hover {
  transform: translate(-3px, -3px);
  box-shadow:
    inset 0 0 0 2px var(--wood-light),
    inset 0 0 0 6px var(--parchment-dark),
    7px 7px 0 var(--ink),
    9px 9px 0 var(--iron-dark);
}

/* Iron nail top-center */
.quest::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  background: var(--iron);
  border: 2px solid var(--iron-dark);
  box-shadow: 0 2px 0 var(--ink);
}

.quest__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--wood);
}
.quest__rank {
  font-family: var(--medieval);
  font-size: 22px;
  color: var(--blood);
  letter-spacing: 2px;
  text-shadow: 1px 1px 0 var(--parchment-dark);
}
.quest__xp {
  font-family: var(--medieval);
  font-size: 18px;
  color: var(--gold-deep);
  letter-spacing: 1px;
}

.quest__icon {
  width: 108px;
  height: 108px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--iron);
  background: var(--stone-deep);
  box-shadow:
    inset 0 0 0 2px var(--iron-dark),
    inset 2px 2px 0 var(--wood-dark),
    2px 2px 0 var(--ink);
  color: var(--ember);
}

.quest__title {
  font-family: var(--medieval);
  font-size: 28px;
  color: var(--ink);
  margin-bottom: 12px;
  letter-spacing: 1px;
  text-align: center;
  line-height: 1.05;
  text-shadow: 2px 2px 0 var(--parchment-dark);
}

.quest__body {
  font-family: var(--script);
  font-size: 22px;
  color: var(--ink-brown);
  margin-bottom: 18px;
  line-height: 1.4;
  letter-spacing: 0.5px;
  min-height: 88px;
  text-align: center;
  font-style: italic;
}

.quest__reward {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 20px;
  padding: 10px 14px;
  background: var(--parchment-bright);
  border: 2px solid var(--wood-dark);
  box-shadow: inset 0 0 0 1px var(--parchment-dark);
}
.quest__reward-label {
  font-family: var(--medieval);
  font-size: 14px;
  color: var(--ink-brown);
  letter-spacing: 2px;
}
.quest__reward-value {
  font-family: var(--medieval);
  font-size: 20px;
  color: var(--forge-red);
  letter-spacing: 1px;
}

/* =============================================================
   FORGE — smithing bench + live forge
   ============================================================= */
.forge-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: stretch;
}

.forge-panel {
  background: var(--wood-dark);
  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0) 0 28px,
      rgba(0, 0, 0, 0.28) 28px 30px
    );
  border: 4px solid var(--iron);
  box-shadow:
    inset 0 0 0 2px var(--wood-deep),
    4px 4px 0 var(--ink),
    6px 6px 0 var(--iron-dark);
}

.forge-panel__head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--iron-dark);
  border-bottom: 3px solid var(--iron);
  font-family: var(--medieval);
  font-size: 22px;
  color: var(--gold-bright);
  letter-spacing: 2px;
  text-shadow: 2px 2px 0 var(--ink);
}
.forge-panel__rivet {
  width: 10px;
  height: 10px;
  background: var(--iron-light);
  border: 1px solid var(--iron-dark);
  box-shadow: inset 1px 1px 0 var(--steel);
}

.forge-panel__body {
  padding: 24px;
}

.form-row {
  margin-bottom: 18px;
}
.form-row--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-row label {
  display: block;
  font-family: var(--medieval);
  font-size: 20px;
  color: var(--gold-bright);
  margin-bottom: 8px;
  letter-spacing: 1px;
  text-shadow: 1px 1px 0 var(--ink);
}

.select,
.input-wrap {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  background: var(--parchment);
  border: 3px solid var(--iron);
  font-family: var(--medieval);
  font-size: 18px;
  color: var(--ink);
  letter-spacing: 0.5px;
  box-shadow: inset 0 0 0 2px var(--parchment-dark);
  transition: border-color 0.1s steps(2);
}
.select:hover,
.input-wrap:hover {
  border-color: var(--gold);
}
.select span:first-child { flex: 1; }
.select .caret {
  color: var(--forge-red);
  font-size: 14px;
  margin-left: 12px;
}
.input-wrap input {
  flex: 1;
  background: none;
  border: none;
  font-family: var(--medieval);
  font-size: 18px;
  color: var(--ink);
  letter-spacing: 0.5px;
  outline: none;
}
.input-suffix {
  font-size: 18px;
  color: var(--blood);
  margin-left: 12px;
  letter-spacing: 1px;
  font-family: var(--medieval);
}

/* =============================================================
   MY CAPSULES section + tx toast
   ============================================================= */
.capsule--owned {
  --r-color: #c9a227;
}
.caps-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.caps-actions .btn { flex: 1; }

.caps-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 8px;
  font-family: var(--medieval);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--parchment-worn);
  background: var(--stone-deep);
  border: 1px solid var(--iron);
}
.caps-badge--listed {
  color: var(--gold-bright);
  border-color: var(--gold);
}

.my-caps-hint {
  margin-top: 20px;
  text-align: center;
  font-family: var(--script);
  font-size: 16px;
  color: var(--parchment-worn);
  font-style: italic;
}

.gx-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(24px);
  z-index: 200;
  max-width: 80vw;
  padding: 12px 20px;
  background: rgba(10, 6, 2, 0.95);
  border: 2px solid var(--iron);
  box-shadow: inset 0 0 0 2px var(--iron-dark), 3px 3px 0 var(--ink);
  font-family: var(--medieval);
  font-size: 15px;
  letter-spacing: 1px;
  color: var(--parchment-bright);
  text-shadow: 1px 1px 0 var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s steps(3);
}
.gx-toast--show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.gx-toast a {
  color: var(--gold-bright);
  text-decoration: underline dotted;
  margin-left: 8px;
}
.gx-toast--pending { border-color: var(--gold); color: var(--gold-bright); }
.gx-toast--ok      { border-color: #7cffa5; }
.gx-toast--err     { border-color: var(--blood-bright); color: var(--blood-bright); }

/* Forge submit status panel */
.forge-status {
  display: block;
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(10, 6, 2, 0.55);
  border: 2px solid transparent;
  font-family: "Pixelify Sans", monospace;
  font-size: 14px;
  line-height: 1.5;
  color: var(--parchment);
  letter-spacing: 0.3px;
  min-height: 0;
  transition: border-color 0.1s steps(2);
  word-break: break-all;
}
.forge-status:empty {
  display: none;
}
.forge-status .k {
  display: inline-block;
  width: 64px;
  color: var(--parchment-worn);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 12px;
}
.forge-status code {
  font-family: "Pixelify Sans", monospace;
  font-size: 13px;
  color: var(--gold-bright);
  background: var(--stone-deep);
  padding: 1px 6px;
  border: 1px solid var(--iron-dark);
  user-select: all;
}
.forge-status a {
  color: var(--gold-bright);
  text-decoration: underline dotted;
}
.forge-status--pending {
  border-color: var(--gold);
  color: var(--gold-bright);
}
.forge-status--ok {
  border-color: var(--primary, #7cffa5);
  color: var(--parchment-bright);
}
.forge-status--err {
  border-color: var(--blood-bright);
  color: var(--blood-bright);
}

.forge-summary {
  margin: 24px 0;
  padding: 16px;
  background: var(--parchment);
  border: 3px solid var(--gold);
  box-shadow:
    inset 0 0 0 2px var(--parchment-dark),
    3px 3px 0 var(--ink);
}
.forge-summary__row {
  display: flex;
  justify-content: space-between;
  font-family: var(--medieval);
  font-size: 18px;
  letter-spacing: 1px;
  color: var(--ink-brown);
  padding: 6px 0;
  border-bottom: 1px dashed var(--wood);
}
.forge-summary__row:last-child { border-bottom: none; }
.forge-summary__row--em { color: var(--ink); }
.forge-summary__row--em span:last-child { font-size: 22px; color: var(--forge-red); }

/* FORGE VISUAL */
.forge-visual {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--stone-deep);
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(255, 102, 0, 0) 0 20px,
      rgba(255, 102, 0, 0.02) 20px 24px
    );
  border: 4px solid var(--iron);
  padding: 32px;
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 2px var(--iron-dark),
    4px 4px 0 var(--ink),
    6px 6px 0 var(--iron-dark),
    0 0 36px rgba(184, 61, 30, 0.18);
  animation: forge-breath 3.6s steps(16) infinite;
}

/* Pulsing ember halo outside the frame — heat radiating outward */
.forge-visual::after {
  content: "";
  position: absolute;
  inset: -80px;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(
    ellipse 100% 75% at 50% 68%,
    rgba(255, 140, 40, 0.55) 0%,
    rgba(255, 80, 20, 0.32) 30%,
    rgba(184, 61, 30, 0.18) 55%,
    transparent 78%
  );
  animation: forge-halo 3.6s steps(12) infinite;
  filter: blur(4px);
}

@keyframes forge-breath {
  0%, 100% {
    box-shadow:
      inset 0 0 0 2px var(--iron-dark),
      4px 4px 0 var(--ink),
      6px 6px 0 var(--iron-dark),
      0 0 50px rgba(184, 61, 30, 0.35),
      0 0 100px rgba(255, 102, 0, 0.2),
      0 0 180px rgba(255, 140, 40, 0.12);
  }
  50% {
    box-shadow:
      inset 0 0 0 2px var(--iron-dark),
      4px 4px 0 var(--ink),
      6px 6px 0 var(--iron-dark),
      0 0 90px rgba(184, 61, 30, 0.6),
      0 0 180px rgba(255, 102, 0, 0.4),
      0 0 280px rgba(255, 140, 40, 0.22);
  }
}

@keyframes forge-halo {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.04); }
}

.forge-visual__scene {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 460px;
}

.forge-visual__3d {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.forge-visual__3d canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.forge-visual__anvil {
  position: relative;
  width: 60%;
  max-width: 260px;
  z-index: 2;
  animation: anvil-shake 0.8s steps(3) infinite;
  animation-delay: 0.4s;
}
.forge-visual__anvil img {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(4px 4px 0 var(--ink));
}

.forge-visual__hammer {
  position: absolute;
  top: 18%;
  left: 32%;
  width: 92px;
  height: 92px;
  z-index: 3;
  animation: hammer-strike 0.8s steps(2) infinite;
  transform-origin: bottom right;
}
.forge-visual__hammer svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(3px 3px 0 var(--ink));
}

.forge-visual__sparks {
  position: absolute;
  top: 70%;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 70px;
  z-index: 4;
  pointer-events: none;
}
.spark {
  position: absolute;
  font-family: var(--medieval);
  font-size: 20px;
  color: var(--flame);
  text-shadow: 1px 1px 0 var(--ink);
  animation: spark-fly 0.8s steps(4) infinite;
  opacity: 0;
}
.spark--1 { left: 40%; top: 50%; animation-delay: 0.4s; color: var(--ember); }
.spark--2 { left: 55%; top: 40%; animation-delay: 0.5s; color: var(--flame); }
.spark--3 { left: 30%; top: 30%; animation-delay: 0.45s; color: var(--forge-red); }
.spark--4 { left: 65%; top: 55%; animation-delay: 0.6s; color: var(--flame-bright); }
.spark--5 { left: 45%; top: 20%; animation-delay: 0.55s; color: var(--ember); }
.spark--6 { left: 50%; top: 60%; animation-delay: 0.5s; color: var(--parchment-bright); }

.forge-visual__glow {
  position: absolute;
  top: 72%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 60px;
  background: rgba(255, 102, 0, 0.25);
  box-shadow:
    0 0 0 16px rgba(255, 102, 0, 0.14),
    0 0 0 32px rgba(255, 102, 0, 0.06),
    0 0 0 50px rgba(255, 102, 0, 0.03);
  animation: flame-glow 0.8s steps(3) infinite;
  pointer-events: none;
  z-index: 1;
}

.forge-visual__caption {
  font-family: var(--medieval);
  font-size: 22px;
  color: var(--gold-bright);
  letter-spacing: 2px;
  text-align: center;
  text-shadow: 2px 2px 0 var(--ink);
}

@keyframes anvil-shake {
  0%, 45%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-2px, 2px); }
  55% { transform: translate(1px, 0); }
}
@keyframes hammer-strike {
  0%, 40% { transform: rotate(-48deg) translate(-10px, -40px); }
  50%, 100% { transform: rotate(18deg) translate(0, 0); }
}
@keyframes spark-fly {
  0% { opacity: 0; transform: translate(0, 0) scale(0.6); }
  40% { opacity: 1; transform: translate(0, -22px) scale(1); }
  100% { opacity: 0; transform: translate(0, -44px) scale(0.8); }
}

/* =============================================================
   LEDGER — carved stone tablets
   ============================================================= */
.ledger-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 26px;
  margin-bottom: 40px;
}

.ledger {
  background: var(--stone);
  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0) 0 20px,
      rgba(0, 0, 0, 0.2) 20px 22px
    );
  border: 4px solid var(--iron);
  box-shadow:
    inset 0 0 0 2px var(--iron-dark),
    4px 4px 0 var(--ink),
    6px 6px 0 var(--iron-dark);
}

.ledger__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--iron-dark);
  border-bottom: 3px solid var(--iron);
}
.ledger__sigil {
  font-family: var(--medieval);
  font-size: 28px;
  color: var(--gold-bright);
  text-shadow: 2px 2px 0 var(--ink);
}
.ledger__head h3 {
  font-family: var(--medieval);
  font-size: 24px;
  color: var(--parchment-bright);
  letter-spacing: 2px;
  flex: 1;
  margin: 0 12px;
  text-align: center;
  text-shadow: 2px 2px 0 var(--ink);
}
.ledger__period {
  font-family: var(--medieval);
  font-size: 16px;
  color: var(--gold-bright);
  padding: 4px 10px;
  border: 2px solid var(--gold);
  background: var(--ink-brown);
  letter-spacing: 1px;
}

.ledger__list {
  list-style: none;
  padding: 10px 0;
}
.ledger__list li {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 18px;
  font-family: var(--medieval);
  font-size: 20px;
  color: var(--parchment);
  border-bottom: 1px solid var(--iron-dark);
  transition: background 0.1s steps(2);
  text-shadow: 1px 1px 0 var(--ink);
}
.ledger__list li:last-child { border-bottom: none; }
.ledger__list li:hover {
  background: rgba(255, 102, 0, 0.1);
}
.ledger__list .rank {
  color: var(--gold-bright);
  letter-spacing: 1px;
}
.ledger__list .who {
  color: var(--parchment);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ledger__list .amt {
  color: var(--forge-red);
  letter-spacing: 1px;
}
.ledger__list li:first-child .rank {
  color: var(--gold-bright);
  font-size: 24px;
}
.ledger__list li:first-child .who {
  color: var(--gold-bright);
}

.ledger-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0;
  padding: 0;
  background: var(--wood-dark);
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(0, 0, 0, 0) 0 64px,
      rgba(0, 0, 0, 0.3) 64px 66px
    );
  border: 4px solid var(--iron);
  box-shadow:
    inset 0 0 0 2px var(--wood-deep),
    4px 4px 0 var(--ink),
    6px 6px 0 var(--iron-dark);
}
.ledger-totals__cell {
  text-align: center;
  padding: 20px 16px;
  border-right: 2px solid var(--iron);
}
.ledger-totals__cell:last-child { border-right: none; }
.ledger-totals__cell .label {
  display: block;
  font-family: var(--medieval);
  font-size: 16px;
  color: var(--parchment-worn);
  letter-spacing: 2px;
  margin-bottom: 10px;
  text-shadow: 1px 1px 0 var(--ink);
}
.ledger-totals__cell .value {
  display: block;
  font-family: var(--medieval);
  font-size: 32px;
  color: var(--gold-bright);
  letter-spacing: 1px;
  text-shadow: 2px 2px 0 var(--ink);
}

/* =============================================================
   CODEX — unfurled parchment scrolls
   ============================================================= */
.codex-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.codex-entry {
  background: var(--parchment);
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(107, 64, 35, 0) 0 10px,
      rgba(107, 64, 35, 0.04) 10px 12px
    );
  color: var(--ink);
  border: 4px solid var(--wood-dark);
  box-shadow:
    inset 0 0 0 2px var(--wood-light),
    inset 0 0 0 6px var(--parchment-dark),
    4px 4px 0 var(--ink),
    6px 6px 0 var(--iron-dark);
  transition: all 0.1s steps(2);
}
.codex-entry[open] {
  border-color: var(--gold-deep);
  box-shadow:
    inset 0 0 0 2px var(--gold),
    inset 0 0 0 6px var(--parchment-dark),
    4px 4px 0 var(--ink),
    6px 6px 0 var(--iron-dark);
}

.codex-entry summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 22px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  font-family: var(--medieval);
  font-size: 24px;
  color: var(--ink);
  letter-spacing: 0.5px;
  line-height: 1.3;
  transition: all 0.1s steps(2);
}
.codex-entry summary::-webkit-details-marker { display: none; }
.codex-entry summary:hover {
  background: rgba(139, 90, 43, 0.08);
}

.codex-entry__rune {
  color: var(--blood);
  font-size: 26px;
  text-shadow: 1px 1px 0 var(--parchment-dark);
}
.codex-entry__chev {
  color: var(--forge-red);
  font-size: 18px;
  transition: transform 0.1s steps(2);
}
.codex-entry[open] .codex-entry__chev {
  transform: rotate(180deg);
  color: var(--gold-deep);
}

.codex-entry__body {
  padding: 18px 22px;
  border-top: 2px dashed var(--wood);
  background: var(--parchment-bright);
}
.codex-entry__body p {
  font-family: var(--script);
  font-size: 22px;
  color: var(--ink-brown);
  letter-spacing: 0.5px;
  line-height: 1.5;
  margin-bottom: 10px;
}
.codex-entry__body p:last-child { margin-bottom: 0; }
.codex-entry__body ul {
  margin-top: 10px;
  padding-left: 24px;
}
.codex-entry__body li {
  font-family: var(--script);
  font-size: 20px;
  color: var(--ink-brown);
  letter-spacing: 0.5px;
  line-height: 1.6;
}
.codex-entry__body b { color: var(--ink); }
.codex-entry__body em {
  color: var(--forge-red);
  font-style: italic;
  font-weight: bold;
}

.codex-entry__body .equation {
  font-family: "Pixelify Sans", monospace;
  font-size: 19px;
  color: var(--parchment-bright);
  background: var(--stone-deep);
  border: 2px solid var(--iron);
  box-shadow: inset 0 0 0 2px var(--iron-dark), 2px 2px 0 var(--ink);
  padding: 12px 16px;
  margin: 10px 0 14px;
  letter-spacing: 0.5px;
  overflow-x: auto;
  white-space: pre;
}
.codex-entry__body code {
  font-family: "Pixelify Sans", monospace;
  background: var(--wood-dark);
  color: var(--parchment-bright);
  padding: 1px 6px;
  border: 1px solid var(--iron-dark);
  font-size: 16px;
}

/* =============================================================
   GRIMOIRE — monster manual bestiary for tokens
   ============================================================= */
.grimoire-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 24px;
}

.entry {
  position: relative;
  padding: 24px 22px;
  background: var(--parchment);
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(107, 64, 35, 0) 0 14px,
      rgba(107, 64, 35, 0.045) 14px 16px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(107, 64, 35, 0) 0 42px,
      rgba(107, 64, 35, 0.06) 42px 44px
    );
  color: var(--ink);
  border: 4px solid var(--wood-dark);
  box-shadow:
    inset 0 0 0 2px var(--wood-light),
    inset 0 0 0 6px var(--parchment-dark),
    4px 4px 0 var(--ink),
    6px 6px 0 var(--iron-dark);
}
.entry::before,
.entry::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--iron);
  border: 1px solid var(--iron-dark);
  box-shadow: inset 1px 1px 0 var(--steel);
}
.entry::before { top: 10px; left: 10px; }
.entry::after { top: 10px; right: 10px; }

.entry__head {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 2px dashed var(--wood);
}

.entry__sigil {
  width: 64px;
  height: 64px;
  display: block;
  object-fit: contain;
  border: 2px solid var(--iron);
  background: var(--parchment-bright);
  box-shadow: inset 0 0 0 1px var(--parchment-dark), 2px 2px 0 var(--ink);
  image-rendering: auto;
  padding: 4px;
}
.entry__sigil--wen {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 38px;
  color: var(--blood);
  text-shadow: 2px 2px 0 var(--parchment-dark);
  padding: 0;
}

.entry__title { min-width: 0; }

.entry__name {
  font-family: var(--display);
  font-size: 26px;
  letter-spacing: 1px;
  color: var(--ink);
  line-height: 1.1;
  text-shadow: 1px 1px 0 var(--parchment-dark);
}
.entry__name em {
  font-family: var(--script);
  font-style: italic;
  font-size: 20px;
  color: var(--blood);
}

.entry__class {
  font-family: var(--medieval);
  font-size: 16px;
  color: var(--ink-brown);
  letter-spacing: 1px;
  margin-top: 2px;
}

.entry__cr {
  font-family: var(--display);
  font-size: 22px;
  color: var(--parchment-bright);
  background: var(--blood);
  padding: 4px 12px;
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  text-shadow: 1px 1px 0 var(--ink);
  letter-spacing: 1px;
  white-space: nowrap;
}

.entry__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 14px;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: var(--parchment-bright);
  border: 2px solid var(--wood);
  box-shadow: inset 0 0 0 1px var(--parchment-dark);
}
.entry__meta > div {
  display: flex;
  justify-content: space-between;
  font-family: var(--medieval);
  font-size: 15px;
  color: var(--ink);
  letter-spacing: 0.5px;
}
.entry__meta dt { color: var(--ink-brown); }
.entry__meta dd { color: var(--ink); }
.entry__meta code {
  font-family: "Pixelify Sans", monospace;
  font-size: 14px;
  background: var(--wood-dark);
  color: var(--parchment-bright);
  padding: 1px 6px;
  border: 1px solid var(--iron-dark);
  letter-spacing: 0.5px;
}

.entry__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px 10px;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: var(--stone-deep);
  color: var(--parchment-bright);
  border: 2px solid var(--iron-dark);
  box-shadow: inset 0 0 0 2px var(--iron);
}
.entry__stats span {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--display);
  font-size: 16px;
  color: var(--parchment-worn);
  letter-spacing: 2px;
  text-shadow: 1px 1px 0 var(--ink);
}
.entry__stats b {
  color: var(--parchment-bright);
  font-size: 20px;
  font-weight: normal;
  margin-left: 2px;
}
.entry__stats em {
  font-style: normal;
  color: var(--gold-bright);
  font-size: 14px;
  letter-spacing: 0;
  margin-left: auto;
}

.entry__traits { margin-bottom: 14px; }
.entry__traits p {
  font-family: var(--script);
  font-size: 18px;
  color: var(--ink-brown);
  line-height: 1.4;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}
.entry__traits b {
  font-family: var(--display);
  font-size: 15px;
  color: var(--blood);
  letter-spacing: 1px;
  margin-right: 4px;
}

.entry__lore {
  font-family: var(--script);
  font-size: 18px;
  color: var(--ink-brown);
  line-height: 1.45;
  letter-spacing: 0.3px;
  font-style: italic;
  padding: 10px 14px;
  border-left: 3px solid var(--blood);
  background: rgba(184, 61, 30, 0.06);
}

.grimoire-note {
  margin-top: 40px;
  padding: 20px 26px;
  background: var(--parchment-bright);
  border: 4px solid var(--wood-dark);
  box-shadow:
    inset 0 0 0 2px var(--wood-light),
    inset 0 0 0 6px var(--parchment-dark),
    4px 4px 0 var(--ink);
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}
.grimoire-note p {
  font-family: var(--script);
  font-size: 20px;
  color: var(--ink-brown);
  line-height: 1.5;
  letter-spacing: 0.3px;
}
.grimoire-note b {
  font-family: var(--display);
  font-size: 17px;
  letter-spacing: 1px;
  color: var(--blood);
}
.grimoire-note code {
  font-family: "Pixelify Sans", monospace;
  background: var(--wood-dark);
  color: var(--parchment-bright);
  padding: 1px 6px;
  border: 1px solid var(--iron-dark);
  font-size: 15px;
}

@media (max-width: 640px) {
  .grimoire-grid { grid-template-columns: 1fr; }
  .entry__head { grid-template-columns: 56px 1fr auto; gap: 10px; }
  .entry__sigil { width: 56px; height: 56px; }
  .entry__name { font-size: 22px; }
  .entry__meta { grid-template-columns: 1fr; }
  .entry__stats span { font-size: 14px; }
}

/* =============================================================
   FOOTER — tavern stone wall
   ============================================================= */
.footer {
  position: relative;
  padding: 56px 32px 24px;
  border-top: 6px solid var(--iron);
  background: var(--wood-deep);
  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0) 0 36px,
      rgba(0, 0, 0, 0.35) 36px 38px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(0, 0, 0, 0) 0 72px,
      rgba(0, 0, 0, 0.2) 72px 74px
    );
  box-shadow: inset 0 6px 0 var(--iron-dark);
  overflow: hidden;
}

.footer__inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.3fr;
  gap: 40px;
  padding: 24px 0;
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer__logo {
  width: 180px;
  height: 180px;
  image-rendering: pixelated;
  align-self: flex-start;
  filter: drop-shadow(3px 3px 0 var(--ink));
}
.footer__brand h3 {
  font-family: var(--display);
  font-size: 48px;
  color: var(--gold-bright);
  letter-spacing: 3px;
  text-shadow:
    2px 2px 0 var(--gold-deep),
    4px 4px 0 var(--ink);
}
.footer__tag {
  font-family: var(--script);
  font-size: 22px;
  color: var(--parchment);
  letter-spacing: 0.5px;
  line-height: 1.3;
  font-style: italic;
  text-shadow: 1px 1px 0 var(--ink);
}

.footer__col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer__col h4 {
  font-family: var(--medieval);
  font-size: 22px;
  color: var(--forge-red);
  letter-spacing: 2px;
  margin-bottom: 8px;
  text-shadow: 2px 2px 0 var(--ink);
}
.footer__col a {
  font-family: var(--medieval);
  font-size: 20px;
  color: var(--parchment);
  letter-spacing: 1px;
  transition: color 0.1s steps(2);
  text-shadow: 1px 1px 0 var(--ink);
}
.footer__col a:hover {
  color: var(--gold-bright);
}
.footer__warn {
  font-family: var(--script);
  font-size: 20px;
  color: var(--parchment-worn);
  letter-spacing: 0.5px;
  line-height: 1.4;
  font-style: italic;
  text-shadow: 1px 1px 0 var(--ink);
}

/* Deployments block — plain-text on-chain identifiers (bot cross-verify) */
.deployments {
  max-width: 1400px;
  margin: 32px auto 8px;
  padding: 18px 24px;
  background: rgba(10, 6, 2, 0.55);
  border: 2px solid var(--iron);
  box-shadow: inset 0 0 0 2px var(--iron-dark), 3px 3px 0 var(--ink);
  display: grid;
  gap: 6px;
  font-family: var(--medieval);
  font-size: 16px;
  letter-spacing: 1px;
}
.deployments__row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 14px;
  align-items: baseline;
}
.deployments__k {
  color: var(--parchment-worn);
  text-shadow: 1px 1px 0 var(--ink);
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.deployments__v {
  color: var(--parchment);
  text-shadow: 1px 1px 0 var(--ink);
}
.deployments__addr {
  font-family: "Pixelify Sans", monospace;
  font-size: 14px;
  letter-spacing: 0.5px;
  color: var(--gold-bright);
  background: var(--stone-deep);
  padding: 4px 10px;
  border: 1px solid var(--iron-dark);
  word-break: break-all;
  overflow-wrap: anywhere;
  user-select: all;
}
.deployments__a {
  color: var(--gold-bright);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  text-shadow: 1px 1px 0 var(--ink);
  transition: color 0.1s steps(2);
}
.deployments__a:hover { color: var(--ember); }

@media (max-width: 640px) {
  .deployments__row { grid-template-columns: 1fr; gap: 2px; }
}

.footer__bar {
  max-width: 1400px;
  margin: 24px auto 0;
  padding: 16px 0 0;
  border-top: 2px solid var(--iron);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  font-family: var(--medieval);
  font-size: 16px;
  color: var(--parchment-worn);
  letter-spacing: 2px;
  text-shadow: 1px 1px 0 var(--ink);
}

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 1024px) {
  .forge-layout {
    grid-template-columns: 1fr;
  }
  .forge-visual {
    order: -1;
    min-height: 340px;
  }
  .codex-grid {
    grid-template-columns: 1fr;
  }
  .capsule:hover .tooltip {
    opacity: 0;
  }
}

@media (max-width: 768px) {
  .nav {
    padding: 12px 16px;
  }
  .nav__brand {
    font-size: 22px;
    letter-spacing: 1px;
    gap: 10px;
  }
  .nav__logo { height: 32px; }
  .nav__links {
    gap: 12px;
    font-size: 16px;
  }
  .nav__links a:not(.nav__cta) {
    display: none;
  }
  .nav__cta,
  .nav.nav--bare .nav__cta {
    display: none;
  }
  .hero {
    padding: 110px 16px 80px;
  }
  .hero__stats {
    gap: 18px;
  }
  .stat {
    min-width: 120px;
    padding: 10px 14px;
  }
  .torch {
    width: 40px;
    height: 120px;
    top: 110px;
  }
  .torch--left { left: 10px; }
  .torch--right { right: 10px; }
  .torch__stick { height: 50px; width: 8px; }
  .torch__flame { width: 30px; height: 60px; }
  .torch__pixel--1 { width: 7px; height: 7px; left: 12px; top: 52px; }
  .torch__pixel--2 { width: 14px; height: 10px; left: 8px; top: 38px; }
  .torch__pixel--3 { width: 20px; height: 14px; left: 5px; top: 18px; }
  .torch__pixel--4 { width: 10px; height: 10px; left: 10px; top: 6px; }
  .torch__pixel--5 { width: 4px; height: 6px; left: 13px; top: 0; }
  .torch__glow { width: 90px; height: 90px; left: -25px; }
  .section {
    padding: 48px 16px 72px;
  }
  .section__title {
    text-shadow:
      2px 2px 0 var(--forge-red),
      4px 4px 0 var(--ink-brown),
      6px 6px 0 var(--ink);
  }
  .armory__grid {
    grid-template-columns: 1fr;
  }
  .armory__toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .footer__inner {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
  .ledger-totals {
    grid-template-columns: 1fr 1fr;
  }
  .ledger-totals__cell {
    border-right: none;
    border-bottom: 2px solid var(--iron);
  }
}

@media (max-width: 480px) {
  .nav__brand span { display: none; }
  .footer__inner { grid-template-columns: 1fr; }
  .ledger-totals { grid-template-columns: 1fr; }
}
