:root {
  color-scheme: dark;
  --ink: #090c0a;
  --surface: #121813;
  --surface-2: #192119;
  --line: #394338;
  --paper: #ded8c5;
  --muted: #9da696;
  --acid: #afc67b;
  --red: #b42318;
  --red-hot: #ef3425;
  --shadow: 0 18px 55px rgba(0, 0, 0, .48);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--paper);
  background:
    linear-gradient(rgba(5, 9, 6, .67), rgba(5, 8, 6, .82)),
    url("assets/background.png") center center / cover fixed no-repeat;
  font-family: "Segoe UI", Arial, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,.012) 3px 4px);
  z-index: 10;
}

.noise {
  position: fixed;
  inset: 0;
  opacity: .12;
  pointer-events: none;
  background-image:
    repeating-radial-gradient(circle at 17% 32%, transparent 0 2px, rgba(255,255,255,.08) 3px 4px),
    repeating-linear-gradient(115deg, transparent 0 17px, rgba(0,0,0,.32) 18px 19px);
  mix-blend-mode: overlay;
}

.site-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: flex-end;
  padding: clamp(1.5rem, 4vw, 3.8rem) max(1.25rem, calc((100vw - 1320px) / 2));
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(8,11,9,.95), rgba(19,27,20,.85));
}

.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 34%;
  height: 5px;
  background: var(--red);
  transform: skewX(-24deg);
}

.brand { display: flex; align-items: center; gap: 1rem; }
.brand-icon { width: 84px; height: 84px; object-fit: contain; filter: drop-shadow(0 8px 18px #000); }
.eyebrow { margin: 0 0 .2rem; color: var(--acid); text-transform: uppercase; letter-spacing: .21em; font-size: .72rem; font-weight: 800; }
h1, h2, h3 { margin: 0; text-transform: uppercase; letter-spacing: .035em; }
h1 { font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif; font-size: clamp(2.6rem, 7vw, 5.8rem); line-height: .84; font-weight: 500; text-shadow: 3px 3px 0 #000, -1px -1px 0 rgba(255,255,255,.08); }
.header-copy { max-width: 35rem; margin: 0; color: var(--muted); line-height: 1.7; }
.header-side { display: grid; justify-items: end; gap: 1.1rem; }
.header-stats { display: flex; gap: .65rem; }
.stat { min-width: 118px; padding: .7rem 1rem; border: 1px solid #586250; border-top: 3px solid var(--red); background: rgba(8, 12, 9, .78); text-align: right; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.stat strong { display: block; font-family: Impact, Haettenschweiler, sans-serif; font-size: 2rem; line-height: 1; color: var(--paper); font-weight: 500; }
.stat span { display: block; margin-top: .22rem; color: var(--acid); font-size: .65rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }

main { width: min(1320px, calc(100% - 2.5rem)); margin: 0 auto; min-height: 65vh; }
.catalog-view { padding: 2rem 0 4rem; }
.filter-bar { display: grid; grid-template-columns: auto minmax(220px, 360px) 1fr; gap: 1rem; align-items: center; margin-bottom: 2rem; padding: 1rem; border: 1px solid var(--line); background: rgba(17, 23, 18, .88); box-shadow: var(--shadow); }
.filter-bar label { color: var(--acid); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; font-size: .76rem; }
.select-wrap { position: relative; }
.select-wrap::after { content: "▼"; position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); color: var(--red-hot); pointer-events: none; }
select { width: 100%; appearance: none; border: 1px solid #596451; border-radius: 0; background: #090d0a; color: var(--paper); padding: .85rem 2.6rem .85rem 1rem; font: inherit; font-weight: 700; text-transform: uppercase; }
select:focus-visible, button:focus-visible, .campaign-card:focus-visible { outline: 3px solid var(--acid); outline-offset: 3px; }
.result-count { justify-self: end; margin: 0; color: var(--muted); }

.campaign-grid { display: grid; gap: 2rem; }
.campaign-group { position: relative; padding: 1.25rem; border: 1px solid var(--line); background: rgba(11, 15, 12, .78); box-shadow: var(--shadow); }
.campaign-group::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: #596b4e; }
.official-group { border-color: #64332e; background: linear-gradient(135deg, rgba(48,14,11,.82), rgba(11,15,12,.86) 42%); }
.official-group::before { background: var(--red-hot); box-shadow: 0 0 24px rgba(239,52,37,.35); }
.community-group { background: linear-gradient(135deg, rgba(31,42,29,.82), rgba(11,15,12,.86) 42%); }
.group-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; padding: .2rem .25rem 1rem; margin-bottom: 1.15rem; border-bottom: 1px solid #414a3e; }
.group-heading span { display: block; margin-bottom: .2rem; color: var(--acid); font-size: .66rem; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; }
.official-group .group-heading span { color: #ff7d72; }
.group-heading h2 { font-family: Impact, Haettenschweiler, sans-serif; font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 500; }
.group-heading > strong { font-family: Impact, Haettenschweiler, sans-serif; color: #75836d; font-size: 2.5rem; font-weight: 500; }
.official-group .group-heading > strong { color: var(--red-hot); }
.campaign-grid-inner { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1.25rem; }
.campaign-card { position: relative; overflow: hidden; min-height: 365px; padding: 0; border: 1px solid #343e34; background: var(--surface); color: inherit; text-align: left; cursor: pointer; box-shadow: 0 14px 30px rgba(0,0,0,.32); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.campaign-card:hover { transform: translateY(-5px); border-color: #77866c; box-shadow: 0 22px 45px rgba(0,0,0,.5); }
.campaign-image { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; display: block; filter: saturate(.78) contrast(1.08); background: #080b09; }
.campaign-image.placeholder { display: grid; place-items: center; color: #677062; font-family: Impact, sans-serif; font-size: 4rem; background: linear-gradient(135deg, #171e18, #080b09); }
.card-body { padding: 1.15rem; }
.card-topline { display: flex; justify-content: space-between; gap: .75rem; align-items: flex-start; margin-bottom: .7rem; }
.campaign-card h2 { font-family: Impact, Haettenschweiler, sans-serif; font-weight: 500; font-size: 1.65rem; line-height: 1; }
.tagline { margin: .5rem 0 1rem; color: var(--muted); line-height: 1.45; min-height: 2.8em; }
.meta { display: flex; justify-content: space-between; gap: .5rem; color: #c5c9bd; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.badge { display: inline-flex; align-items: center; white-space: nowrap; padding: .3rem .52rem; border: 1px solid #66775e; color: #dce9ca; background: rgba(75,99,61,.28); font-size: .66rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.badge.official { border-color: #bd392f; background: rgba(130,20,15,.42); color: #fff; }

.empty-state { text-align: center; padding: 6rem 1rem; border: 1px dashed var(--line); color: var(--muted); }
.empty-state span { display: block; color: var(--red-hot); font-family: Impact, sans-serif; font-size: 5rem; }
.empty-state h2 { color: var(--paper); font-family: Impact, sans-serif; font-size: 2rem; }

.detail-view { padding: 2rem 0 5rem; }
.back-button, .copy-button { border: 1px solid #687263; background: #151c16; color: var(--paper); padding: .75rem 1rem; font: inherit; font-weight: 800; cursor: pointer; text-transform: uppercase; letter-spacing: .06em; }
.back-button:hover, .copy-button:hover { background: var(--red); border-color: var(--red-hot); }
.detail-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); min-height: 430px; margin-top: 1.5rem; border: 1px solid var(--line); background: #0e130f; box-shadow: var(--shadow); }
.detail-hero-image { width: 100%; height: 100%; min-height: 430px; object-fit: cover; filter: saturate(.72) contrast(1.1); }
.detail-copy { padding: clamp(1.5rem, 4vw, 3.5rem); align-self: center; }
.detail-copy h2 { font-family: Impact, Haettenschweiler, sans-serif; font-size: clamp(2.8rem, 6vw, 5rem); line-height: .92; font-weight: 500; }
.detail-copy .tagline { color: var(--red-hot); font-weight: 700; }
.description { color: #c4c9be; line-height: 1.75; white-space: pre-line; }
.mode-heading { margin: 3.2rem 0 1rem; font-family: Impact, sans-serif; font-size: 2.2rem; font-weight: 500; }
.chapter-list { display: grid; gap: .75rem; }
.chapter { display: grid; grid-template-columns: 76px minmax(180px, .8fr) minmax(240px, 1.2fr) auto; gap: 1rem; align-items: center; padding: 1rem; border-left: 4px solid var(--red); background: linear-gradient(90deg, #192019, #101510); box-shadow: 0 8px 20px rgba(0,0,0,.2); }
.chapter-number { font-family: Impact, Haettenschweiler, sans-serif; font-size: 2.8rem; line-height: 1; color: var(--red-hot); transform: rotate(-3deg); text-shadow: 2px 2px 0 #000; }
.chapter-name { font-family: "Arial Narrow", "Segoe UI", sans-serif; font-size: 1.2rem; font-weight: 900; text-transform: uppercase; }
.server-command { padding: .7rem .8rem; border: 1px solid #424d40; background: #080b09; color: var(--acid); font-family: Consolas, monospace; overflow-wrap: anywhere; }
.gallery-heading { margin-top: 3rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.gallery figure { margin: 0; border: 1px solid var(--line); background: #0d110e; }
.gallery img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.gallery figcaption { padding: .65rem .8rem; color: var(--muted); }

footer { border-top: 1px solid var(--line); color: #747e71; padding: 1.5rem max(1.25rem, calc((100vw - 1320px) / 2)); font-size: .8rem; }
.toast { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 20; max-width: 320px; padding: .9rem 1.1rem; color: white; background: #284024; border-left: 4px solid var(--acid); box-shadow: var(--shadow); transform: translateY(140%); transition: transform .22s ease; }
.toast.show { transform: translateY(0); }

@media (max-width: 850px) {
  .site-header { display: block; }
  .header-copy { margin-top: 1.5rem; }
  .header-side { justify-items: start; }
  .stat { text-align: left; }
  .filter-bar { grid-template-columns: 1fr; }
  .result-count { justify-self: start; }
  .detail-hero { grid-template-columns: 1fr; }
  .detail-hero-image { min-height: 260px; max-height: 430px; }
  .chapter { grid-template-columns: 56px 1fr; }
  .server-command { grid-column: 1 / -1; }
  .copy-button { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
