:root {
  --pixel-void: #050407;
  --pixel-ink: #12080d;
  --pixel-stone: #241a16;
  --pixel-stone-lit: #4b3525;
  --pixel-red-dark: #4d0d18;
  --pixel-red: #9d2430;
  --pixel-red-hot: #e64c37;
  --pixel-gold-dark: #6c4b1c;
  --pixel-gold: #c89636;
  --pixel-gold-hot: #f2d177;
  --pixel-paper: #e6d3aa;
  --pixel-muted: #a88959;
  --pixel-blue: #1a3845;
  --pixel-line: rgba(242, 209, 119, 0.38);
  --pixel-shadow: rgba(0, 0, 0, 0.72);
  --pixel-font-ui: "Courier New", Courier, monospace;
}

.pixel-library-page,
.pixel-library-page * {
  box-sizing: border-box;
}

.pixel-library-page {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 20% 8%, rgba(230, 76, 55, 0.18), transparent 24rem),
    radial-gradient(circle at 82% 18%, rgba(200, 150, 54, 0.16), transparent 22rem),
    url("assets/pixel-shrine/void-grid-bg.png"),
    linear-gradient(180deg, #080506, #030204 68%, #080506);
  background-size: auto, auto, 256px 256px, auto;
  color: var(--pixel-paper);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.62;
}

.pixel-library-page a {
  color: inherit;
}

.pixel-library-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 64px;
}

.pixel-library-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 4px solid var(--pixel-gold);
  background:
    linear-gradient(180deg, rgba(18, 8, 13, 0.98), rgba(5, 4, 7, 0.96)),
    url("assets/pixel-shrine/cracked-stone-tile.png");
  box-shadow: 8px 8px 0 var(--pixel-shadow);
  image-rendering: pixelated;
}

.pixel-library-brand,
.pixel-library-nav nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pixel-library-brand {
  color: var(--pixel-gold-hot);
  font-family: var(--pixel-font-ui);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
}

.pixel-library-main {
  display: grid;
  gap: 28px;
  padding-top: 28px;
}

.pixel-library-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 18px;
  align-items: stretch;
}

.pixel-library-hero h1 {
  margin: 0;
  color: var(--pixel-gold-hot);
  font-size: 4.8rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 0.9;
  text-shadow: 4px 4px 0 #000;
}

.pixel-library-hero p {
  max-width: 720px;
  margin: 12px 0 0;
  font-size: 1.05rem;
}

.pixel-atlas-preview {
  display: block;
  width: 100%;
  min-width: 0;
  border: 4px solid var(--pixel-gold);
  background: #050407;
  box-shadow: 10px 10px 0 var(--pixel-shadow);
  image-rendering: pixelated;
}

.pixel-section-title {
  margin: 0 0 14px;
  color: var(--pixel-gold-hot);
  font-family: var(--pixel-font-ui);
  font-size: 1rem;
  text-transform: uppercase;
}

.pixel-asset-grid,
.pixel-component-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.pixel-asset-card {
  min-width: 0;
  padding: 14px;
  border: 3px solid var(--pixel-gold-dark);
  background:
    linear-gradient(180deg, rgba(18, 8, 13, 0.92), rgba(5, 4, 7, 0.94)),
    url("assets/pixel-shrine/cracked-stone-tile.png");
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.62);
}

.pixel-asset-card img {
  display: block;
  max-width: 100%;
  max-height: 150px;
  margin: 0 auto 12px;
  object-fit: contain;
  image-rendering: pixelated;
}

.pixel-asset-card h3 {
  margin: 0 0 4px;
  color: var(--pixel-paper);
  font-family: var(--pixel-font-ui);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.pixel-asset-card p,
.pixel-asset-card code {
  font-family: var(--pixel-font-ui);
  font-size: 0.78rem;
}

.pixel-asset-card p {
  margin: 0;
  color: var(--pixel-muted);
}

.pixel-asset-card code,
.pixel-class-tag {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 6px;
  border: 2px solid var(--pixel-gold-dark);
  background: #050407;
  color: var(--pixel-gold-hot);
}

.pixel-banner {
  position: relative;
  min-height: 154px;
  padding: 28px clamp(18px, 4vw, 42px);
  border: 4px solid var(--pixel-gold);
  background:
    linear-gradient(90deg, rgba(5, 4, 7, 0.38), rgba(5, 4, 7, 0.04)),
    url("assets/pixel-shrine/shrine-banner-red.png") center / 100% 100% no-repeat,
    var(--pixel-ink);
  box-shadow: 12px 12px 0 var(--pixel-shadow);
  color: var(--pixel-paper);
  image-rendering: pixelated;
}

.pixel-banner.gold {
  background:
    linear-gradient(90deg, rgba(5, 4, 7, 0.42), rgba(5, 4, 7, 0.08)),
    url("assets/pixel-shrine/shrine-banner-gold.png") center / 100% 100% no-repeat,
    var(--pixel-ink);
}

.pixel-banner h1,
.pixel-banner h2,
.pixel-banner h3 {
  margin: 0;
  color: var(--pixel-gold-hot);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 0.96;
  text-shadow: 3px 3px 0 #000;
}

.pixel-banner p {
  max-width: 720px;
  margin: 10px 0 0;
}

.pixel-panel,
.pixel-quest-card,
.pixel-source-frame,
.pixel-warning,
.pixel-terminal {
  position: relative;
  min-width: 0;
  box-shadow: 8px 8px 0 var(--pixel-shadow);
  image-rendering: pixelated;
}

.pixel-panel {
  padding: 18px;
  border: 4px solid var(--pixel-gold-dark);
  background:
    linear-gradient(180deg, rgba(18, 8, 13, 0.9), rgba(5, 4, 7, 0.94)),
    url("assets/pixel-shrine/void-grid-bg.png");
}

.pixel-panel h2,
.pixel-panel h3,
.pixel-quest-card h2,
.pixel-quest-card h3,
.pixel-source-frame h2,
.pixel-source-frame h3,
.pixel-warning h2,
.pixel-warning h3,
.pixel-terminal h2,
.pixel-terminal h3 {
  margin: 0 0 8px;
  color: var(--pixel-gold-hot);
  font-family: var(--pixel-font-ui);
  font-size: 1rem;
  text-transform: uppercase;
}

.pixel-panel p,
.pixel-quest-card p,
.pixel-source-frame p,
.pixel-warning p,
.pixel-terminal p {
  margin: 0;
}

.pixel-quest-card {
  padding: 28px;
  border: 4px solid var(--pixel-gold);
  background:
    linear-gradient(180deg, rgba(18, 8, 13, 0.86), rgba(5, 4, 7, 0.9)),
    url("assets/pixel-shrine/quest-panel-frame.png") center / 100% 100% no-repeat,
    var(--pixel-ink);
}

.pixel-source-frame {
  padding: 24px;
  border: 4px solid var(--pixel-paper-shadow, #9d7f4c);
  background:
    linear-gradient(180deg, rgba(230, 211, 170, 0.86), rgba(157, 127, 76, 0.78)),
    url("assets/pixel-shrine/source-card-frame.png") center / 100% 100% no-repeat,
    url("assets/pixel-shrine/manuscript-noise-tile.png");
  color: #21160f;
}

.pixel-source-frame h2,
.pixel-source-frame h3 {
  color: #4d0d18;
  text-shadow: none;
}

.pixel-warning {
  padding: 22px 24px;
  border: 4px solid var(--pixel-red-hot);
  background:
    linear-gradient(180deg, rgba(77, 13, 24, 0.9), rgba(5, 4, 7, 0.92)),
    url("assets/pixel-shrine/warning-plaque.png") center / 100% 100% no-repeat;
}

.pixel-terminal {
  padding: 24px;
  border: 4px solid #2d6777;
  background:
    linear-gradient(180deg, rgba(3, 11, 16, 0.84), rgba(5, 4, 7, 0.94)),
    url("assets/pixel-shrine/terminal-widget.png") center / 100% 100% no-repeat,
    var(--pixel-ink);
  color: #d5f7ff;
  font-family: var(--pixel-font-ui);
}

.pixel-terminal code,
.pixel-terminal span {
  color: var(--pixel-gold-hot);
}

.pixel-inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
  gap: 10px;
  padding: 14px;
  border: 4px solid var(--pixel-gold-dark);
  background:
    linear-gradient(180deg, rgba(5, 4, 7, 0.88), rgba(18, 8, 13, 0.88)),
    url("assets/pixel-shrine/cracked-stone-tile.png");
}

.pixel-slot {
  display: grid;
  aspect-ratio: 1;
  min-height: 68px;
  place-items: center;
  background:
    url("assets/pixel-shrine/inventory-slot.png") center / 100% 100% no-repeat,
    var(--pixel-ink);
  color: var(--pixel-gold-hot);
  font-family: var(--pixel-font-ui);
  font-size: 0.78rem;
  image-rendering: pixelated;
}

.pixel-icon {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}

.pixel-meter {
  position: relative;
  min-height: 52px;
  padding: 14px 18px;
  background:
    url("assets/pixel-shrine/meter-shell.png") center / 100% 100% no-repeat,
    var(--pixel-ink);
  image-rendering: pixelated;
}

.pixel-meter-track {
  position: relative;
  height: 18px;
  overflow: hidden;
}

.pixel-meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--value, 68%);
  background:
    url("assets/pixel-shrine/meter-fill-red.png") left center / auto 100% repeat-x,
    var(--pixel-red);
}

.pixel-nav-badge,
.pixel-kit-link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border: 0;
  background:
    url("assets/pixel-shrine/nav-badge.png") center / 100% 100% no-repeat,
    var(--pixel-red-dark);
  color: var(--pixel-gold-hot);
  font-family: var(--pixel-font-ui);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  image-rendering: pixelated;
}

.pixel-nav-badge:hover,
.pixel-nav-badge:focus-visible,
.pixel-kit-link:hover,
.pixel-kit-link:focus-visible {
  color: #fff7df;
  outline: 3px solid rgba(242, 209, 119, 0.36);
  outline-offset: 3px;
}

.pixel-divider {
  display: block;
  min-height: 48px;
  margin: 18px 0;
  background: url("assets/pixel-shrine/rune-divider.png") center / min(960px, 100%) 80px no-repeat;
  image-rendering: pixelated;
}

.pixel-artifact-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 4px solid var(--pixel-gold-dark);
  background:
    linear-gradient(90deg, rgba(77, 13, 24, 0.72), rgba(5, 4, 7, 0.9)),
    url("assets/pixel-shrine/cracked-stone-tile.png");
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.58);
}

.pixel-artifact-strip img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}

.pixel-artifact-strip span {
  color: var(--pixel-paper);
  font-family: var(--pixel-font-ui);
  font-size: 0.78rem;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  .pixel-library-nav,
  .pixel-library-hero {
    grid-template-columns: 1fr;
  }

  .pixel-library-nav {
    position: relative;
    align-items: flex-start;
  }

  .pixel-library-hero {
    display: grid;
  }

  .pixel-banner,
  .pixel-quest-card,
  .pixel-source-frame,
  .pixel-warning,
  .pixel-terminal {
    padding: 18px;
  }

  .pixel-library-hero h1 {
    font-size: 2.6rem;
  }
}
