:root {
  color-scheme: dark;
  --ink: #f6f0dc;
  --muted: #c8cab7;
  --dim: #8f9a8f;
  --bg: #07100f;
  --panel: rgba(12, 22, 18, 0.86);
  --panel-strong: rgba(18, 31, 25, 0.94);
  --line: rgba(236, 220, 168, 0.22);
  --moss: #8fb85b;
  --moss-dark: #355a37;
  --amber: #f4bd58;
  --ember: #c9633d;
  --water: #4bb6b0;
  --shadow: rgba(0, 0, 0, 0.58);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--bg);
}

a {
  color: inherit;
}

.hero {
  min-height: 84vh;
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: space-between;
  padding: 22px clamp(18px, 4vw, 56px) 46px;
  background:
    linear-gradient(90deg, rgba(5, 9, 10, 0.84) 0%, rgba(5, 9, 10, 0.58) 42%, rgba(5, 9, 10, 0.30) 100%),
    linear-gradient(0deg, rgba(7, 16, 15, 1) 0%, rgba(7, 16, 15, 0.16) 34%),
    url("/assets/mossvale-hero.png") center / cover no-repeat;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0;
  font-size: 1.02rem;
  text-transform: uppercase;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  object-fit: cover;
}

nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

nav a {
  padding: 9px 12px;
  border: 1px solid rgba(246, 240, 220, 0.18);
  border-radius: 8px;
  background: rgba(7, 16, 15, 0.46);
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--muted);
}

.wiki-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 16px;
  padding: 22px;
  border: 1px solid rgba(143, 184, 91, 0.28);
  border-radius: 8px;
  background: rgba(12, 22, 18, 0.74);
}

.wiki-callout h3 {
  margin: 0;
}

.wiki-callout p:not(.tag) {
  margin: 8px 0 0;
  color: var(--muted);
}

.hero-copy {
  width: min(850px, 100%);
  margin: 14vh auto 0;
}

.eyebrow,
.tag {
  margin: 0 0 12px;
  color: var(--amber);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(4rem, 11vw, 8.6rem);
  line-height: 0.92;
  letter-spacing: 0;
  text-shadow: 0 10px 34px var(--shadow);
}

.lede {
  width: min(680px, 100%);
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1.06rem, 2vw, 1.35rem);
  line-height: 1.55;
  text-shadow: 0 3px 16px var(--shadow);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:focus-visible {
  outline: 3px solid rgba(244, 189, 88, 0.42);
  outline-offset: 3px;
}

.button.primary {
  color: #0b1110;
  background: var(--amber);
  box-shadow: 0 14px 32px rgba(244, 189, 88, 0.22);
}

.button.primary:hover {
  background: #ffd06e;
}

.button.secondary {
  color: var(--ink);
  border-color: rgba(246, 240, 220, 0.32);
  background: rgba(10, 22, 22, 0.68);
}

.button.secondary:hover {
  border-color: rgba(75, 182, 176, 0.65);
  background: rgba(20, 45, 43, 0.82);
}

.button.discord {
  color: var(--ink);
  border-color: rgba(106, 159, 216, 0.46);
  background: rgba(34, 49, 74, 0.72);
}

.button.discord:hover {
  border-color: rgba(106, 159, 216, 0.84);
  background: rgba(45, 65, 99, 0.88);
}

.button.full {
  width: 100%;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  width: min(820px, 100%);
  margin: 34px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(246, 240, 220, 0.10);
}

.quick-stats div {
  padding: 14px 15px;
  background: rgba(7, 16, 15, 0.58);
}

.quick-stats dt {
  color: var(--dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 800;
}

.quick-stats dd {
  margin: 5px 0 0;
  color: var(--ink);
  font-weight: 800;
}

.play-section,
.home-wiki-section {
  background:
    linear-gradient(180deg, #07100f 0%, #0b1714 48%, #101710 100%);
  padding: 58px clamp(18px, 4vw, 56px) 70px;
}

.home-wiki-section {
  padding-top: 42px;
}

.section-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  letter-spacing: 0;
}

.play-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.play-card {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

.play-card.recommended {
  background:
    linear-gradient(135deg, rgba(143, 184, 91, 0.18), transparent 42%),
    var(--panel-strong);
  border-color: rgba(244, 189, 88, 0.38);
}

h3 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: 0;
}

.play-card p:not(.tag) {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.release-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(75, 182, 176, 0.24);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(6, 20, 22, 0.72);
}

#release-title {
  color: var(--ink);
  font-weight: 800;
}

.wiki-page {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(7, 16, 15, 0.88), #07100f 52%),
    url("/assets/mossvale-hero.png") center top / 1600px auto no-repeat,
    #07100f;
}

.wiki-header {
  padding: 22px clamp(18px, 4vw, 56px) 38px;
}

.wiki-title {
  width: min(1120px, 100%);
  margin: 70px auto 0;
}

.wiki-title h1 {
  font-size: clamp(3.4rem, 8vw, 7rem);
}

.wiki-title .lede {
  max-width: 760px;
}

.wiki-main {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto 70px;
}

.embedded-wiki {
  width: min(1120px, 100%);
  margin-bottom: 0;
}

.wiki-heading {
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
}

.wiki-heading .eyebrow {
  margin-bottom: 0;
}

.wiki-controls {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: start;
  gap: 14px 24px;
  margin-bottom: 18px;
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(94px, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(246, 240, 220, 0.12);
}

.segment {
  min-height: 42px;
  border: 0;
  color: var(--muted);
  background: rgba(12, 22, 18, 0.94);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.segment.active {
  color: #07100f;
  background: var(--amber);
}

.gear-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  justify-content: flex-start;
  padding-top: 1px;
}

.filter-chip {
  min-height: 36px;
  border: 1px solid rgba(246, 240, 220, 0.16);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--muted);
  background:
    linear-gradient(180deg, rgba(246, 240, 220, 0.075), rgba(246, 240, 220, 0.02)),
    rgba(12, 22, 18, 0.82);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(246, 240, 220, 0.08);
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.filter-chip:hover {
  color: var(--ink);
  border-color: rgba(244, 189, 88, 0.48);
  background:
    linear-gradient(180deg, rgba(244, 189, 88, 0.12), rgba(246, 240, 220, 0.03)),
    rgba(16, 31, 24, 0.92);
  transform: translateY(-1px);
}

.filter-chip.active {
  color: #07100f;
  border-color: var(--amber);
  background:
    linear-gradient(180deg, #ffd96d, var(--amber));
  box-shadow:
    0 8px 24px rgba(244, 189, 88, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.wiki-meta {
  margin-bottom: 12px;
  color: var(--dim);
  font-size: 0.92rem;
}

.wiki-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.wiki-card {
  min-height: 260px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.wiki-card-top {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.wiki-icon {
  width: 58px;
  height: 58px;
  position: relative;
  display: block;
  overflow: hidden;
  contain: paint;
  border: 1px solid rgba(246, 240, 220, 0.16);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  background-repeat: no-repeat;
  image-rendering: pixelated;
}

.wiki-icon img {
  position: absolute;
  display: block;
  max-width: none;
  image-rendering: pixelated;
}

.wiki-icon-image img {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.wiki-icon-crop {
  background-color: rgba(0, 0, 0, 0.22);
}

.wiki-icon span {
  display: none;
}

.wiki-icon-fallback,
.wiki-icon.missing span {
  display: grid;
  place-items: center;
  color: rgba(246, 240, 220, 0.72);
  font-weight: 900;
  letter-spacing: 0;
}

.wiki-icon.missing img {
  display: none;
}

.wiki-rarity {
  margin: 0 0 5px;
  color: var(--amber);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.wiki-card h2 {
  margin: 0;
  font-size: 1.1rem;
}

.wiki-sub {
  margin: 6px 0 0;
  color: var(--dim);
  font-size: 0.9rem;
}

.wiki-stats {
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
  list-style: none;
}

.wiki-stats li {
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--ink);
  background: rgba(246, 240, 220, 0.08);
}

.wiki-card > p {
  color: var(--muted);
  line-height: 1.48;
}

.rarity-uncommon {
  border-color: rgba(143, 184, 91, 0.38);
}

.rarity-rare {
  border-color: rgba(75, 182, 176, 0.45);
}

.rarity-epic {
  border-color: rgba(161, 123, 220, 0.46);
}

.rarity-legendary,
.rarity-artifact {
  border-color: rgba(244, 189, 88, 0.50);
}

.set-card {
  background:
    linear-gradient(135deg, rgba(201, 99, 61, 0.12), transparent 45%),
    var(--panel);
}

.empty-state {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel);
}

@media (max-width: 760px) {
  .hero {
    min-height: 88vh;
    padding-bottom: 34px;
    background-position: 58% center;
  }

  .topbar {
    align-items: flex-start;
  }

  nav {
    gap: 6px;
  }

  nav a {
    padding: 8px 10px;
    font-size: 0.78rem;
  }

  .hero-copy {
    margin-top: 9vh;
  }

  .hero-actions,
  .section-heading,
  .release-strip,
  .wiki-callout {
    align-items: stretch;
    flex-direction: column;
  }

  .wiki-controls {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .button {
    width: 100%;
    white-space: normal;
    text-align: center;
  }

  .quick-stats,
  .play-grid {
    grid-template-columns: 1fr;
  }

  .wiki-main {
    width: min(100% - 28px, 1120px);
  }

  .segmented {
    width: 100%;
  }

  .gear-filter {
    justify-content: flex-start;
  }
}
