:root {
  --sky: #dcecf7;
  --card: #ffffff;
  --ink: #1e2a36;
  --muted: #4a5a6b;
  --slate: #44596e;
  --slate-deep: #364a5e;
  --orange: #f5b01f;
  --orange-deep: #d98100;
  --green: #52c234;
  --red: #d6302b;
  --radius: 14px;
  --edge: 3px solid var(--ink);
  --shadow-hard: 0 4px 0 var(--ink);
  --head: "Lilita One", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  --body: "Nunito", "Segoe UI", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--sky);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--slate-deep); text-underline-offset: 3px; }
a:hover { color: var(--orange-deep); }
a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--orange-deep);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3 {
  font-family: var(--head);
  font-weight: 400;
  line-height: 1.2;
  margin: 0;
  letter-spacing: .01em;
}

.shell {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--card);
  padding: 8px 16px;
  border-radius: var(--radius);
  z-index: 10;
}
.skip:focus { left: 16px; }

/* Header: the game's slate HUD bar */
.topbar {
  background: var(--slate);
  border-bottom: 4px solid var(--ink);
}
.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--card);
  text-decoration: none;
  font-family: var(--head);
  font-size: 22px;
}
.brand:hover { color: var(--card); }
.brand .gf-site-icon { border-radius: 8px; }
.topnav { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.topnav a {
  color: var(--card);
  text-decoration: none;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: var(--radius);
}
.topnav a:hover { background: var(--orange); color: var(--ink); }
.topnav a:focus-visible { outline-color: var(--card); }

/* Home hero */
.hero { padding: 32px 0 48px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  grid-template-areas: "copy shot" "ad ad" "manifest manifest";
  gap: 32px 48px;
  align-items: center;
}
.hero-copy { grid-area: copy; }
.eyebrow {
  display: inline-block;
  margin: 0 0 16px;
  padding: 4px 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  background: var(--green);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
}
.hero h1 { font-size: 48px; margin-bottom: 24px; }
.lede { font-size: 18px; margin: 0 0 24px; max-width: 34em; }
.fan-note {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}
.fan-note strong {
  display: inline-block;
  margin-right: 8px;
  padding: 4px 8px;
  font-family: var(--head);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--card);
  background: var(--red);
  border: 2px solid var(--ink);
  border-radius: 8px;
}
.hero-shot { grid-area: shot; margin: 0; }
.hero-shot img {
  width: 100%;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
}
.hero-shot figcaption { margin-top: 12px; font-size: 14px; color: var(--muted); }

.manifest {
  grid-area: manifest;
  background: var(--slate);
  color: var(--card);
  border: var(--edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  padding: 24px;
}
.manifest h2 {
  font-size: 22px;
  color: var(--orange);
  margin-bottom: 16px;
}
.manifest dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.manifest-row {
  padding: 16px;
  background: var(--slate-deep);
  border-radius: var(--radius);
}
.manifest dt { font-family: var(--head); font-size: 18px; color: var(--card); margin-bottom: 8px; }
.manifest dd { margin: 0; }
.manifest a { color: var(--card); font-weight: 700; }
.manifest a:hover { color: var(--orange); }
.manifest a:focus-visible { outline-color: var(--card); }

/* Home guides: quest cards (the one game motif) */
.tagboard {
  background: var(--sky);
  padding: 64px 0;
}
.tagboard h2 { font-size: 36px; margin-bottom: 12px; }
.section-intro { margin: 0 0 32px; color: var(--muted); max-width: 70ch; font-size: 18px; }
.tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.tag a {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  column-gap: 16px;
  row-gap: 4px;
  height: 100%;
  padding: 16px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  border: var(--edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  transition: transform .15s ease;
}
.tag a:hover { transform: translateY(-2px); }
.tag a:hover .tag-title { color: var(--orange-deep); }
.tag-no {
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  font-family: var(--head);
  font-size: 28px;
  color: var(--ink);
  background: var(--orange);
  border: var(--edge);
  border-bottom: 6px solid var(--orange-deep);
  border-radius: var(--radius);
}
.tag-title { font-family: var(--head); font-size: 22px; line-height: 1.2; align-self: end; }
.tag-blurb { color: var(--muted); }

/* Long-form text */
.prose { max-width: 70ch; font-size: 18px; }
.home-prose { padding: 16px 0; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 36px; margin: 64px 0 16px; }
.prose h3 { font-size: 22px; margin: 48px 0 12px; color: var(--slate); }
.prose p, .prose ul, .prose ol { margin: 0 0 16px; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--orange-deep); font-weight: 700; }
.prose strong { font-weight: 700; }
.prose table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 24px 0 32px;
  font-size: 16px;
  background: var(--card);
  border: var(--edge);
  border-radius: var(--radius);
}
.prose th, .prose td {
  text-align: left;
  vertical-align: top;
  padding: 12px 16px;
  border-bottom: 1px solid var(--sky);
  overflow-wrap: break-word;
}
.prose th {
  background: var(--slate);
  color: var(--card);
  font-size: 14px;
  font-weight: 700;
  border-bottom: var(--edge);
}
.prose thead th:first-child { border-top-left-radius: 10px; }
.prose thead th:last-child { border-top-right-radius: 10px; }
.prose tr:last-child td { border-bottom: 0; }
.prose figure { margin: 32px 0; }
.prose figure img {
  width: 100%;
  border: var(--edge);
  border-radius: var(--radius);
}
.prose figcaption { margin-top: 8px; font-size: 14px; color: var(--muted); }
.prose blockquote {
  margin: 24px 0;
  padding: 16px 24px;
  background: var(--card);
  border: var(--edge);
  border-left: 8px solid var(--orange-deep);
  border-radius: var(--radius);
  font-size: 16px;
}
.prose blockquote p:last-child { margin-bottom: 0; }

/* Guide and legal pages */
.guide, .legal { padding-top: 32px; padding-bottom: 64px; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.crumbs a { color: var(--slate-deep); font-weight: 700; }
.guide h1, .legal h1 { font-size: 48px; max-width: 22em; margin-bottom: 16px; }
.stamp {
  display: inline-block;
  margin: 0 0 24px;
  padding: 4px 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
}
.answer {
  max-width: 70ch;
  margin: 0 0 24px;
  padding: 24px;
  background: var(--slate);
  color: var(--card);
  border: var(--edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  font-size: 18px;
}
.answer p { margin: 0; }
.answer .answer-label {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 12px;
  font-family: var(--head);
  font-size: 14px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--orange);
  border: 2px solid var(--ink);
  border-radius: 8px;
}
.legal .prose, .lost-links {
  background: var(--card);
  border: var(--edge);
  border-radius: var(--radius);
  padding: 32px;
}

/* FAQ */
.faq { max-width: 70ch; padding: 48px 0 16px; }
.faq h2 { font-size: 36px; margin-bottom: 16px; }
.faq details {
  margin-bottom: 12px;
  background: var(--card);
  border: var(--edge);
  border-radius: var(--radius);
}
.faq summary {
  cursor: pointer;
  list-style: none;
  position: relative;
  padding: 16px 64px 16px 16px;
  font-weight: 700;
  font-size: 18px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 12px;
  top: 12px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--head);
  font-size: 24px;
  line-height: 1;
  color: var(--ink);
  background: var(--orange);
  border: 2px solid var(--ink);
  border-radius: 8px;
}
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0; padding: 0 16px 16px; color: var(--muted); font-size: 18px; }

/* Sources and next links */
.sources { max-width: 70ch; padding-top: 48px; }
.sources h2 { font-size: 22px; margin-bottom: 12px; }
.sources ol { margin: 0; padding-left: 24px; font-size: 14px; color: var(--muted); }
.sources li { margin-bottom: 8px; }
.next {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 760px;
  margin-top: 48px;
}
.next-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 24px;
  background: var(--orange);
  color: var(--ink);
  text-decoration: none;
  border: var(--edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  transition: transform .15s ease;
}
.next-card:hover { color: var(--ink); transform: translateY(2px); }
.next-title { font-family: var(--head); font-size: 18px; }
.next-blurb { font-size: 14px; }

/* Ad slot: one Adsterra Native Banner per page, in the first screen right after the answer */
.ad-slot { max-width: 70ch; margin: 0 0 48px; font-size: 18px; }
.hero .ad-slot { grid-area: ad; max-width: none; margin: 0; }
.hero-grid:has(> .ad-slot[hidden]) { grid-template-areas: "copy shot" "manifest manifest"; }
.ad-slot[hidden] { display: none; }
.ad-slot-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.ad-slot-box { min-height: 440px; }
.ad-slot-preview {
  display: grid;
  place-items: center;
  background: var(--card);
  border: 2px dashed var(--muted);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 14px;
}
@media (min-width: 768px) {
  .ad-slot-box { min-height: 280px; }
}

/* Banner slots: built by script.js from AD_CONFIG */
.ad-banner { max-width: 70ch; margin: 32px 0; }
.ad-banner[hidden] { display: none; }
.ad-banner-box { max-width: 100%; margin: 0 auto; }
.ad-banner-box iframe { display: block; }
.ad-banner--sticky {
  position: sticky;
  top: 0;
  z-index: 20;
  max-width: none;
  margin: 0;
  background: var(--sky);
  border-bottom: 2px solid var(--ink);
}
.ad-sticky-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 2px 4px;
}
.ad-banner--sticky .ad-slot-label { margin: 0; }
.ad-banner--sticky .ad-banner-box { flex: none; margin: 0; }
.ad-sticky-close {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  font-family: var(--head);
  font-size: 22px;
  line-height: 1;
  color: var(--ink);
  background: var(--orange);
  border: 2px solid var(--ink);
  border-radius: 8px;
  cursor: pointer;
}
.ad-sticky-close:hover { background: var(--orange-deep); }
.ad-sticky-close:focus-visible { outline: 3px solid var(--orange-deep); outline-offset: 2px; }
.ad-banner--sticky:not([hidden]) ~ .hero,
.ad-banner--sticky:not([hidden]) ~ .guide { padding-top: 16px; }
.ad-banner--side {
  position: fixed;
  top: 140px;
  left: 12px;
  z-index: 10;
  width: 160px;
  max-width: none;
  margin: 0;
}
@media (max-width: 1439px) {
  .ad-banner--side { display: none; }
}

/* 404 */
.lost-links { list-style: none; max-width: 70ch; font-size: 18px; }
.lost-links li { margin-bottom: 8px; }

/* Footer */
.foot {
  background: var(--ink);
  color: var(--card);
  border-top: 4px solid var(--orange);
  padding: 48px 0 24px;
  margin-top: 64px;
}
.foot-row {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.foot-id { max-width: 34em; }
.foot-brand { font-family: var(--head); font-size: 22px; color: var(--card); margin: 0 0 8px; }
.foot-note { margin: 0; font-size: 14px; color: var(--sky); }
.foot-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; align-content: flex-start; }
.foot-nav a { color: var(--card); font-size: 14px; }
.foot-nav a:hover { color: var(--orange); }
.foot-copy { margin-top: 32px; font-size: 12px; color: var(--sky); }

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "copy" "ad" "shot" "manifest";
    gap: 24px;
  }
  .manifest dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-grid:has(> .ad-slot[hidden]) { grid-template-areas: "copy" "shot" "manifest"; }
}

@media (max-width: 640px) {
  .shell { padding: 0 16px; }
  .topbar-row { min-height: 0; padding-top: 12px; padding-bottom: 12px; }
  .topnav a { padding: 8px; }
  .hero { padding: 24px 0 48px; }
  .guide { padding-top: 24px; }
  .hero h1, .guide h1, .legal h1 { font-size: 32px; }
  .manifest { padding: 16px; }
  .manifest dl, .tags, .next { grid-template-columns: minmax(0, 1fr); }
  .tagboard { padding: 48px 0; }
  .tagboard h2, .prose h2, .faq h2 { font-size: 28px; }
  .tag a { grid-template-columns: 48px minmax(0, 1fr); }
  .tag-no { width: 48px; height: 48px; font-size: 22px; }
  .prose, .answer, .faq details p { font-size: 16px; }
  .ad-slot { font-size: 16px; }
  .stamp { margin-bottom: 16px; }
  .ad-sticky-row { gap: 4px; }
  .ad-banner--sticky .ad-slot-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .ad-banner--sticky:not([hidden]) ~ .hero,
  .ad-banner--sticky:not([hidden]) ~ .guide { padding-top: 12px; }
  .prose h2 { margin-top: 48px; }
  .prose table { font-size: 14px; }
  .prose th, .prose td { padding: 8px; }
  .legal .prose, .lost-links { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .tag a, .next-card { transition: none; }
  .tag a:hover, .next-card:hover { transform: none; }
}
