:root {
  --bg: #f4f2ec;
  --surface: #ffffff;
  --surface-2: #faf9f5;
  --ink: #15201b;
  --muted: #5e6a64;
  --line: #e2ded4;
  --brand: #14805a;
  --brand-ink: #0d5c40;
  --brand-soft: #e3f3ec;
  --copper: #d4733d;
  --copper-soft: #fbeadf;
  --danger: #d62828;
  --danger-soft: #fde8e8;
  --shadow: 0 1px 2px rgba(21, 32, 27, .06), 0 8px 24px rgba(21, 32, 27, .06);
  --shadow-lg: 0 24px 60px rgba(21, 32, 27, .18);
  --radius: 18px;
  --radius-sm: 10px;
  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1210;
    --surface: #141b18;
    --surface-2: #18211d;
    --ink: #edf2ef;
    --muted: #9aa8a1;
    --line: #25302b;
    --brand: #35c487;
    --brand-ink: #7fe0b4;
    --brand-soft: #143326;
    --copper: #ee8c55;
    --copper-soft: #3a2316;
    --danger: #ff4d4d;
    --danger-soft: #3b1515;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    --shadow-lg: 0 24px 60px rgba(0,0,0,.5);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 18px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-head); font-weight: 700; font-size: 19px; letter-spacing: -.02em; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand) 0 50%, var(--copper) 50% 100%);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.18);
}
.nav-links { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.nav-links a, .nav-links button.linklike {
  text-decoration: none; padding: 8px 14px; border-radius: 999px; color: var(--muted);
  font-weight: 500; font-size: 15px; background: none; border: 0;
}
.nav-links a:hover, .nav-links button.linklike:hover, .nav-links a.active { color: var(--ink); background: var(--surface); }
.menu-btn { display: none; margin-left: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; width: 42px; height: 42px; color: var(--ink); }

/* The big red notice in the menu */
.redist {
  background: var(--danger);
  color: #fff;
  text-align: center;
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: .02em;
  font-size: clamp(15px, 2.4vw, 22px);
  padding: 10px 16px;
  line-height: 1.2;
  text-transform: uppercase;
}
.mobile-menu { display: none; border-top: 1px solid var(--line); padding: 10px 20px 18px; }
.mobile-menu a, .mobile-menu button { display: block; width: 100%; text-align: left; padding: 12px 4px; background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 16px; }
.mobile-menu .redist-menu {
  color: var(--danger); font-family: var(--font-head); font-weight: 800; font-size: 24px; line-height: 1.15;
  text-transform: uppercase; padding: 16px 4px 4px; border: 0;
}
.mobile-menu.open { display: block; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 11px 20px; font-weight: 600; font-size: 15px;
  text-decoration: none; transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 35%, transparent); }
.btn-primary:hover { background: var(--brand-ink); }
@media (prefers-color-scheme: dark) { .btn-primary { color: #06140e; } .btn-primary:hover { background: #5fd8a2; } }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-copper { background: var(--copper); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- hero ---------- */
.hero { padding: 64px 0 36px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--brand-ink); background: var(--brand-soft); padding: 6px 12px; border-radius: 999px; }
.hero h1 { font-family: var(--font-head); font-size: clamp(36px, 5.6vw, 64px); line-height: 1.02; letter-spacing: -.035em; margin: 18px 0 16px; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 540px; margin: 0 0 26px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-art { position: relative; aspect-ratio: 1 / 1; max-width: 420px; justify-self: end; width: 100%; }
.hero-art .tile {
  position: absolute; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-lg);
  border: 4px solid var(--surface);
}
.hero-art .tile img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.hero-art .t1 { width: 58%; height: 58%; left: 0; top: 6%; transform: rotate(-6deg); }
.hero-art .t2 { width: 46%; height: 46%; right: 0; top: 0; transform: rotate(5deg); }
.hero-art .t3 { width: 50%; height: 50%; right: 8%; bottom: 0; transform: rotate(-3deg); }

/* ---------- how it works ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 10px 0 56px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.step-num { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; background: var(--copper-soft); color: var(--copper); margin-bottom: 12px; }
.step h3 { margin: 0 0 6px; font-family: var(--font-head); font-size: 18px; letter-spacing: -.01em; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- catalog ---------- */
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.section-head h2 { font-family: var(--font-head); font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -.025em; margin: 0; }
.section-head p { margin: 4px 0 0; color: var(--muted); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--muted); padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; }
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.search { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 9px 16px; font-size: 14px; min-width: 200px; outline: none; }
.search:focus { border-color: var(--brand); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; padding-bottom: 72px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-art { position: relative; aspect-ratio: 16 / 10; display: grid; place-items: center; cursor: pointer; overflow: hidden; }
.card-art img.icon { width: 96px; height: 96px; border-radius: 18px; image-rendering: pixelated; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.card-art img.cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.card-art .glyph { width: 92px; height: 92px; color: #fff; filter: drop-shadow(0 8px 18px rgba(0,0,0,.25)); }
.badge { position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,.92); color: #15201b; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.badge.owned { left: auto; right: 12px; background: var(--brand); color: #fff; }
.badge.soon { left: auto; right: 12px; background: #15201b; color: #fff; }
.card-body { padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-body h3 { margin: 0; font-family: var(--font-head); font-size: 20px; letter-spacing: -.015em; }
.card-body p { margin: 0; color: var(--muted); font-size: 14.5px; flex: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.price { font-family: var(--font-head); font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.price small { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.card-actions { display: flex; gap: 6px; }

/* art backgrounds per category */
.bg-gameplay { background: radial-gradient(120% 120% at 20% 10%, #2bb07a 0%, #0f5f43 70%); }
.bg-atmosphere { background: radial-gradient(120% 120% at 20% 10%, #e3955f 0%, #7a3a17 75%); }
.bg-building { background: radial-gradient(120% 120% at 20% 10%, #c9a26a 0%, #6a4a22 75%); }
.bg-survival { background: radial-gradient(120% 120% at 20% 10%, #4fa6d8 0%, #163f6b 75%); }
.bg-mobs { background: radial-gradient(120% 120% at 20% 10%, #8b7be0 0%, #3a2d7a 75%); }
.bg-visuals { background: radial-gradient(120% 120% at 20% 10%, #f2b3c8 0%, #5a2e7a 75%); }

/* ---------- banner / notices ---------- */
.notice { background: var(--copper-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--copper) 40%, transparent); border-radius: var(--radius-sm); padding: 12px 16px; font-size: 14px; margin: 18px 0 0; }
.notice strong { color: var(--copper); }

/* ---------- FAQ ---------- */
.faq { padding-top: 8px; padding-bottom: 72px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; margin-bottom: 10px; }
.faq summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; color: var(--muted); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--muted); margin: 10px 0 0; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 44px; color: var(--muted); font-size: 14px; }
.foot-grid > div:first-child { max-width: 620px; }
.foot-grid { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.foot-redist { color: var(--danger); font-family: var(--font-head); font-weight: 800; font-size: 18px; text-transform: uppercase; margin: 0 0 6px; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(8, 12, 10, .55); z-index: 60; display: grid; place-items: center; padding: 16px; animation: fade .15s ease; }
.modal { background: var(--surface); border-radius: 22px; width: min(720px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: var(--shadow-lg); animation: pop .18s ease; }
.modal-sm { width: min(440px, 100%); }
.modal-art { aspect-ratio: 21 / 8; display: grid; place-items: center; position: relative; overflow: hidden; }
.modal-body { padding: 24px 26px 26px; }
.modal-body h2 { font-family: var(--font-head); font-size: 28px; letter-spacing: -.025em; margin: 0 0 4px; }
.modal-body .meta { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.modal-body ul { padding-left: 0; list-style: none; margin: 16px 0; display: grid; gap: 8px; }
.modal-body li { display: flex; gap: 10px; align-items: flex-start; }
.modal-body li::before { content: ""; flex: 0 0 18px; height: 18px; margin-top: 3px; border-radius: 5px; background: var(--brand-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2314805a' stroke-width='3'%3E%3Cpath d='M5 10l3 3 7-7'/%3E%3C/svg%3E") center/12px no-repeat; }
.modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.close-x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); color: #15201b; font-size: 20px; line-height: 1; z-index: 2; }
.field { display: grid; gap: 6px; margin: 16px 0; }
.field label { font-size: 14px; font-weight: 600; }
.field input { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 12px; padding: 12px 14px; font-size: 16px; outline: none; }
.field input:focus { border-color: var(--brand); }
.small { font-size: 13px; color: var(--muted); }
.redist-inline { color: var(--danger); font-weight: 800; font-family: var(--font-head); text-transform: uppercase; font-size: 17px; line-height: 1.2; margin: 14px 0 0; }

.install-steps { counter-reset: s; display: grid; gap: 12px; margin: 18px 0; padding: 0; list-style: none; }
.install-steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; }
.install-steps li::before { content: counter(s); flex: 0 0 28px; height: 28px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.spinner { width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-size: 14px; z-index: 80; box-shadow: var(--shadow-lg); max-width: calc(100% - 32px); animation: pop .18s ease; }

/* ---------- library / success ---------- */
.page-head { padding: 48px 0 24px; }
.page-head h1 { font-family: var(--font-head); font-size: clamp(30px, 4.4vw, 46px); letter-spacing: -.03em; margin: 0 0 6px; }
.page-head p { color: var(--muted); margin: 0; }
.lib-list { display: grid; gap: 12px; padding-bottom: 72px; }
.lib-row { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.lib-row .thumb { width: 64px; height: 64px; border-radius: 14px; flex: 0 0 64px; display: grid; place-items: center; overflow: hidden; }
.lib-row .thumb img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.lib-row .thumb svg { width: 36px; height: 36px; color: #fff; }
.lib-row .info { flex: 1; min-width: 0; }
.lib-row h3 { margin: 0; font-family: var(--font-head); font-size: 18px; }
.lib-row p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.empty { text-align: center; padding: 60px 20px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.center-card { max-width: 560px; margin: 60px auto 90px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 34px; text-align: center; box-shadow: var(--shadow); }
.center-card h1 { font-family: var(--font-head); letter-spacing: -.03em; margin: 12px 0 8px; }
.big-check { width: 64px; height: 64px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin: 0 auto; }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { max-width: 300px; justify-self: center; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .nav-links { display: none; }
  .menu-btn { display: grid; place-items: center; }
  .hero { padding: 36px 0 24px; }
  .search { min-width: 0; width: 100%; }
  .toolbar { width: 100%; }
  .lib-row { flex-wrap: wrap; }
  .lib-row .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
