/* Castellar's site (RELEASE_PLAN RL4): one stylesheet, no build step.
   Colours are the game's UiTokens (godot/scripts/UiTokens.gd): the navy
   page, gold buttons and the parchment of its modals. Fonts are the game's
   own, self-hosted so the site makes no third-party requests: Pixelify Sans
   and Barlow, both SIL Open Font License 1.1 (fonts/OFL.txt). */

@font-face {
  font-family: "Pixelify Sans";
  src: url("fonts/PixelifySans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("fonts/Barlow-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("fonts/Barlow-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg-page: #0e1326;
  --bg-bar: #121831;
  --bg-panel: #141b36;
  --line-panel: #232d52;
  --text: #e8ecf7;
  --text-soft: #c9d0e6;
  --text-dim: #a9b2cf;
  --text-mute: #7d86a6;
  --blue-text: #8cc4f5;
  --red-text: #ff9c94;
  --gold: #f0c24b;
  --gold-edge: #9a6a14;
  --gold-ink: #2a1a00;
  --parchment: #efe2bf;
  --parchment-deep: #e2d0a2;
  --parchment-ink: #3a2c1e;
  --parchment-caption: #6b5634;
  --parchment-rule: #c9b688;
  --parchment-red: #9a3a2e;
  --wood: #4a3220;
  --wood-dark: #2b1d12;
  --line-header: #1a2140;
  --line-chip: #2a3558;
  --bg-band: #0b1020;
  --pixel: "Pixelify Sans", "Courier New", monospace;
  --sans: "Barlow", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background:
    radial-gradient(ellipse at 50% -10%, #1d2650 0%, rgba(14, 19, 38, 0) 60%),
    var(--bg-page);
  color: var(--text);
  font: 500 17px/1.55 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--blue-text); }
a:hover { color: var(--text); }

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

h1, h2, h3 {
  font-family: var(--pixel);
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 0.5em;
}

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

main { flex: 1; }

/* Top bar: the small crest and the name, on every page */
.bar {
  background: var(--bg-bar);
  border-bottom: 1px solid var(--line-panel);
}
.bar .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
}
.bar a.home {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--pixel);
  font-size: 22px;
}
.bar a.home img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

/* SITE_PLAN SP2: the landing page's header, hero and the three steps,
   to claude-design-mockups/Castellar Promo Site.dc.html (2a, 2b). */
html { scroll-padding-top: 88px; }

.wide-only { }
.narrow-only { display: none; }

/* Buttons: gold (the game's primary) and navy (secondary) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--line-chip);
  border-radius: 10px;
  font: 400 22px var(--pixel);
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(2px); }
.btn-gold {
  background: var(--gold);
  border-color: var(--gold-edge);
  box-shadow: 0 4px 0 var(--gold-edge);
  color: var(--gold-ink);
}
.btn-gold:hover, .btn-gold:focus-visible { background: #ffd66a; color: var(--gold-ink); }
.btn-gold:active { box-shadow: 0 2px 0 var(--gold-edge); }
.btn-navy {
  background: var(--bg-panel);
  color: var(--text);
}
.btn-navy:hover, .btn-navy:focus-visible { border-color: var(--news-hover-line); color: #fff; }
.btn-big { height: 60px; padding: 0 30px; font-size: 24px; }
.btn-small { height: 44px; padding: 0 22px; font-size: 19px; border-radius: 8px; box-shadow: 0 3px 0 var(--gold-edge); }

/* Header: crest and name, the section links with News, and Play now */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 16, 32, 0.92);
  border-bottom: 2px solid var(--line-header);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font: 600 26px var(--pixel);
}
.brand img { width: 48px; height: 48px; }
.brand:hover { color: #fff; }
.site-nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  font-weight: 700;
  font-size: 17px;
}
.site-nav a { color: var(--text-dim); text-decoration: none; }
.site-nav a:hover, .site-nav a:focus-visible { color: #fff; }

/* Hero: the board behind, faded into the page, the crest and the pitch */
.hero {
  position: relative;
  overflow: hidden;
  padding: 36px 0 40px;
}
.hero-board {
  position: absolute;
  left: 50%;
  top: 0;
  width: 100%;
  max-width: 1440px;
  transform: translateX(-50%);
  image-rendering: pixelated;
  filter: brightness(0.62) saturate(0.85);
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 52%, transparent 88%);
  mask-image: linear-gradient(180deg, #000 0, #000 52%, transparent 88%);
}
.hero::before {
  /* the shade that keeps the text readable over the board (SR8) */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 600px;
  background: radial-gradient(ellipse 40% 62% at 50% 52%,
    rgba(14, 19, 38, 0.94) 0%, rgba(14, 19, 38, 0.86) 50%, rgba(14, 19, 38, 0.2) 100%);
}
.hero-body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 800px;
  text-align: center;
}
.hero-crest { width: 190px; height: auto; }
.badge {
  padding: 4px 10px;
  border: 2px solid #6a5420;
  border-radius: 6px;
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0;
  font-weight: 600;
  font-size: 52px;
  line-height: 1.08;
  text-wrap: balance;
}
.hero-text {
  margin: 0;
  font-size: 20px;
  line-height: 1.5;
  color: var(--text-soft);
  text-wrap: pretty;
}
.hero-actions {
  display: flex;
  gap: 14px;
  margin-top: 4px;
}
.hero-other { margin: -8px 0 0; font-size: 16px; font-weight: 700; }
.hero-other a { color: var(--blue-text); }
.hero-other a:hover { color: #fff; }
.hero-other[hidden] { display: none; }
.hero-line {
  margin: 0;
  font-size: 16px;
  color: var(--text-dim);
}
/* WEB_PLAN Decision 1: only touch screens see the note; desktops never do. */
.touch-note {
  display: none;
  margin: -10px 0 0;
  color: var(--text-mute);
  font-size: 15px;
}
@media (hover: none) and (pointer: coarse) {
  .touch-note { display: block; }
}

/* Section headings on the game's teal ribbon */
.ribbon {
  display: flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  height: 84px;
  margin: 0 auto;
  padding: 0 96px;
  border-style: solid;
  border-width: 0;
  border-image: url("img/ribbon.webp") 0 128 fill / 0 84px round;
  image-rendering: pixelated;
  color: #f4eed0;
  font-size: 34px;
  font-weight: 700;
  text-shadow: 0 3px 0 #1c3040;
  white-space: nowrap;
}
.ribbon > span:first-child { margin-top: -6px; }
.ribbon > span + span { margin-top: -6px; white-space: pre; }

/* The three steps, each on the game's parchment */
.steps-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding-bottom: 56px;
}
.steps {
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.parchment-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 34px 44px 60px;
  border-style: solid;
  border-image: url("img/parchment.webp") 64 192 128 192 fill / 32px 96px 64px 96px round;
  image-rendering: pixelated;
  color: #33240f;
  filter: drop-shadow(0 8px 0 rgba(0, 0, 0, 0.25));
}
.parchment-card h3 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0;
  font-size: 30px;
  font-weight: 600;
  color: #33240f;
}
.parchment-card p {
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
  color: #4a3820;
  text-wrap: pretty;
}
.step-n { font-size: 18px; font-weight: 400; color: #9c3324; }
.step-n-blue { color: #1d4f8a; }
.steps-close {
  margin: 0;
  font: 400 22px var(--pixel);
  color: #f4eed0;
}

@media (max-width: 1100px) {
  .site-header .wrap { gap: 20px; }
  .site-nav { gap: 18px; }
  .parchment-card { padding: 30px 32px 56px; }
}

/* SR9, Decision 5: phones. The header keeps the crest, the name, News and
   Play; the hero has no board. */
@media (max-width: 699px) {
  html { scroll-padding-top: 72px; }
  .wide-only { display: none; }
  .narrow-only { display: revert; }
  .site-header .wrap { gap: 10px; height: 60px; }
  .brand { flex: 1; font-size: 21px; gap: 10px; }
  .brand img { width: 38px; height: 38px; }
  .site-nav { flex: 0 0 auto; }
  .site-nav a { display: none; }
  .btn-small { padding: 0 14px; font-size: 17px; }
  .hero { padding: 36px 0 28px; }
  .hero-board, .hero::before { display: none; }
  .hero-body { gap: 16px; }
  .hero-crest { width: 150px; }
  .badge { font-size: 13px; padding: 3px 9px; }
  .hero h1 { font-size: 36px; line-height: 1.1; }
  .hero-text { font-size: 18px; }
  .hero-actions { flex-direction: column; align-self: stretch; gap: 10px; }
  .hero-actions .btn { height: 56px; font-size: 22px; }
  .hero-actions .btn-navy { height: 52px; font-size: 20px; }
  .hero-line { font-size: 15px; }
  .ribbon {
    height: 64px;
    padding: 0 72px;
    border-image-width: 0 64px;
    font-size: 23px;
    text-shadow: 0 2px 0 #1c3040;
  }
  .ribbon > span:first-child { margin-top: -4px; }
  .steps-section { gap: 16px; padding-bottom: 40px; }
  .steps { grid-template-columns: 1fr; }
  .parchment-card { padding: 28px 36px 52px; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.25)); }
  .parchment-card h3 { font-size: 26px; gap: 10px; }
  .parchment-card p { font-size: 17px; line-height: 1.45; }
  .step-n { font-size: 16px; }
}

/* SITE_PLAN SP4: the four features and the gallery */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.features {
  background: var(--bg-band);
  border-top: 2px solid var(--line-header);
  border-bottom: 2px solid var(--line-header);
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  padding-top: 44px;
  padding-bottom: 44px;
}
.feature { display: flex; flex-direction: column; gap: 10px; }
.feature-head { display: flex; align-items: center; gap: 12px; }
.portraits { display: flex; gap: 4px; }
.portrait {
  width: 52px;
  height: 52px;
  padding: 2px;
  border: 2px solid;
  border-radius: 8px;
  object-fit: cover;
  image-rendering: pixelated;
}
.portrait-blue { background: #1d3a66; border-color: #5aa6ec; }
.portrait-red { background: #5a1f1a; border-color: #e0625a; }
.portrait-gold { background: #3a2c10; border-color: var(--gold); }
.feature-tag, .shot-tag {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}
.feature h3 { margin: 0; font-size: 24px; line-height: 1.15; }
.feature p { margin: 0; font-size: 16px; line-height: 1.5; color: var(--text-dim); text-wrap: pretty; }

.shots-section { padding: 64px 0 72px; }
.shots-section .ribbon { margin-bottom: 32px; }
.gallery {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 20px;
  align-items: start;
}
.shot-stage {
  margin: 0;
  padding: 8px;
  background: var(--bg-panel);
  border: 2px solid var(--line-chip);
  border-radius: 14px;
}
.shot-stage img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: var(--bg-page);
  border-radius: 8px;
}
.shot-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.shot-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 18px;
  background: var(--bg-bar);
  border: 2px solid #212a4a;
  border-radius: 12px;
}
.shot-item:hover { border-color: var(--news-hover-line); }
.shot-item.is-on { background: #1a2244; border-color: var(--gold); }
.shot {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.shot img {
  flex: none;
  width: 64px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  opacity: 0.6;
}
.shot-item.is-on .shot img, .gallery:not(.is-live) .shot img { opacity: 1; }
.shot-label { display: flex; flex-direction: column; gap: 2px; }
.shot-tag { font-size: 13px; letter-spacing: 0.1em; }
.tag-blue { color: #5aa6ec; }
.tag-dim { color: var(--text-dim); }
.shot-title { font: 400 22px/1.15 var(--pixel); }
.shot-text { margin: 0; font-size: 17px; line-height: 1.5; color: #c3cae0; text-wrap: pretty; }
/* With site.js only the chosen row's text shows (SR3: without it, all do). */
.gallery.is-live .shot-item:not(.is-on) .shot-text { display: none; }
.shot-caption { display: none; }

@media (max-width: 1100px) {
  .features-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery { grid-template-columns: 1fr; }
}

@media (max-width: 699px) {
  .features-grid { gap: 22px 16px; padding-top: 32px; padding-bottom: 32px; }
  .feature { gap: 6px; }
  .feature-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .portrait { width: 44px; height: 44px; }
  .feature-tag { font-size: 12px; }
  .feature h3 { font-size: 20px; }
  .feature p { font-size: 14px; }
  .shots-section { padding: 48px 0 52px; }
  .shots-section .ribbon { margin-bottom: 20px; }
  .gallery { gap: 14px; }
  .shot-stage { padding: 4px; border-radius: 12px; }
  /* 2b: tag chips that scroll sideways, the chosen text under them */
  .gallery.is-live .shot-list {
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    margin: 0 -16px;
    padding: 2px 16px 6px;
    scrollbar-width: none;
  }
  .gallery.is-live .shot-item { flex: none; padding: 0; border-radius: 10px; }
  .gallery.is-live .shot { height: 44px; padding: 0 14px; }
  .gallery.is-live .shot img,
  .gallery.is-live .shot-title,
  .gallery.is-live .shot-text { display: none; }
  .gallery.is-live .shot-tag { font-size: 13px; white-space: nowrap; }
  .gallery.is-live .shot-caption { display: flex; flex-direction: column; gap: 6px; }
  .gallery.is-live .shot-caption .shot-title { display: block; font-size: 24px; }
  .gallery.is-live .shot-caption .shot-text { display: block; }
}

/* SITE_PLAN SP5: downloads with their first launch, the FAQ */
.btn-blue {
  background: #1d4f8a;
  border-color: #5aa6ec;
  box-shadow: 0 3px 0 #163a66;
  color: #fff;
}
.btn-blue:hover, .btn-blue:focus-visible { background: #2560a3; color: #fff; }

.downloads {
  padding: 64px 0 72px;
  background: var(--bg-band);
  border-top: 2px solid var(--line-header);
  border-bottom: 2px solid var(--line-header);
}
.dl-intro {
  margin: 20px auto 28px;
  max-width: 62em;
  text-align: center;
  font-size: 18px;
  color: var(--text-dim);
}
.version { color: var(--gold); font-family: var(--pixel); }
.dl-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.dl-card {
  display: flex;
  flex-direction: column;
  padding: 24px 22px 22px;
  background: var(--bg-panel);
  border: 2px solid var(--line-chip);
  border-radius: 12px;
}
.dl-head { display: flex; flex-direction: column; gap: 6px; }
.dl-head h3 { margin: 0; font-size: 30px; }
.dl-spec {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 16px;
  color: var(--text-dim);
}
.dl-fmt {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.dl-head .btn { height: 48px; margin-top: 16px; font-size: 19px; border-radius: 8px; }
.dl-launch {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 2px solid #212a4a;
}
.dl-launch summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}
.dl-launch summary::-webkit-details-marker { display: none; }
/* Without site.js a plain <details> (+ / –); with it (SP8) the row opens
   the First launch drawer and the steps stay out of the card. */
.dl-launch summary::after { content: "+"; font: 400 20px var(--pixel); letter-spacing: 0; }
.dl-launch[open] summary::after { content: "\2013"; }
.has-drawer .dl-launch > .dl-steps { display: none; }
.has-drawer .dl-launch summary::after,
.has-drawer .dl-launch[open] summary::after { content: "\203A"; font-size: 24px; }
.has-drawer .dl-launch summary:hover { color: #ffd66a; }

/* The First launch drawer (SP8): News's drawer, with these contents */
.install-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 24px 28px;
}
.install-started {
  margin: 0;
  padding: 10px 14px;
  border: 2px solid #2f6b4a;
  border-radius: 8px;
  background: rgba(127, 224, 160, 0.1);
  color: #a8ecbf;
  font-weight: 700;
}
.install-what {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}
.install-body .dl-steps ol { margin: 0; gap: 12px; }
.install-body .dl-steps li { font-size: 17px; line-height: 1.5; color: var(--text-soft); }
.install-body .dl-steps strong, .install-body .dl-steps code { color: var(--text); }
.install-body .dl-note { margin-top: 12px; font-size: 15px; }
.install-unsigned { margin: 0; font-size: 15px; line-height: 1.45; color: var(--text-mute); }
.install-again { align-self: flex-start; height: 44px; padding: 0 20px; font-size: 18px; border-radius: 8px; }
.dl-steps ol {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dl-steps li {
  counter-increment: step;
  position: relative;
  padding-left: 30px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-dim);
  text-wrap: pretty;
}
.dl-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  font-family: var(--pixel);
  color: var(--text-mute);
}
.dl-steps strong { color: var(--text-soft); }
.dl-steps code {
  font-size: 0.92em;
  color: var(--text-soft);
  overflow-wrap: anywhere;
}
.dl-note { margin: 8px 0 0; font-size: 14px; line-height: 1.4; color: var(--text-mute); }
.dl-unsigned {
  margin: 28px auto 0;
  text-align: center;
  font-size: 16px;
  color: var(--text-mute);
}

.faq {
  padding: 64px 0 72px;
  background: var(--bg-band);
}
.faq-grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 48px;
}
.faq-intro h2 { margin: 0 0 12px; font-size: 40px; font-weight: 600; }
.faq-intro p { margin: 0; font-size: 18px; line-height: 1.5; color: var(--text-dim); }
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  background: var(--bg-panel);
  border: 2px solid var(--line-chip);
  border-radius: 10px;
}
.faq-item[open] { border-color: var(--news-hover-line); }
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  list-style: none;
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font: 400 24px var(--pixel);
  color: var(--gold);
}
.faq-item[open] summary::after { content: "\2013"; }
.faq-item p {
  margin: 0;
  padding: 0 20px 18px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--text-dim);
  text-wrap: pretty;
}

@media (max-width: 1100px) {
  .dl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .faq-grid { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 699px) {
  .downloads { padding: 36px 0; }
  .dl-intro { margin: 16px 0; font-size: 16px; }
  .dl-grid { grid-template-columns: 1fr; gap: 10px; }
  /* 2b: one row per platform with Get, First launch folds under it */
  .dl-card { padding: 0; }
  .dl-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 12px;
    row-gap: 2px;
    padding: 12px 12px 12px 16px;
  }
  .dl-head h3 { font-size: 22px; grid-column: 1; }
  .dl-spec { grid-column: 1; flex-direction: row; flex-wrap: wrap; gap: 0 4px; font-size: 14px; color: var(--text-mute); }
  .dl-fmt { font-size: 14px; font-weight: 500; letter-spacing: 0; text-transform: none; }
  .dl-fmt::before { content: "· "; }
  .dl-head .btn { grid-column: 2; grid-row: 1 / span 2; height: 44px; margin: 0; padding: 0 16px; font-size: 17px; }
  .dl-launch { margin: 0; padding: 0; }
  .dl-launch summary {
    min-height: 40px;
    padding: 0 16px;
    font-size: 14px;
    letter-spacing: 0.08em;
  }
  .dl-launch .dl-steps ol { margin: 0; padding: 0 16px; }
  .dl-launch .dl-note { padding: 0 16px; }
  .install-body { padding: 18px 16px 24px; }
  .dl-launch[open] { padding-bottom: 14px; }
  .dl-unsigned { margin-top: 16px; font-size: 14px; line-height: 1.45; }
  .faq { padding: 36px 0; }
  .faq-grid { gap: 14px; }
  .faq-intro h2 { font-size: 32px; margin: 0; }
  .faq-intro p { display: none; }
  .faq-item summary { min-height: 52px; padding: 10px 16px; font-size: 17px; }
  .faq-item summary::after { font-size: 22px; }
  .faq-item p { padding: 0 16px 14px; font-size: 16px; }
}

/* Parchment: the notes on the landing page and the legal pages */
.parchment {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 70%),
    linear-gradient(var(--parchment), var(--parchment-deep));
  color: var(--parchment-ink);
  border: 6px solid var(--wood);
  outline: 2px solid var(--wood-dark);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 0 40px rgba(107, 86, 52, 0.25);
  padding: 24px 28px;
  margin: 36px 0;
}
.parchment h2, .parchment h3 { color: var(--parchment-ink); }
.parchment h2 { font-size: 28px; }
.parchment h3 {
  font-size: 21px;
  margin-top: 1.2em;
  padding-top: 0.8em;
  border-top: 1px solid var(--parchment-rule);
}
.parchment h2 + h3, .parchment .lead + h3 { border-top: 0; padding-top: 0; }
.parchment a { color: #1d4f73; }
.parchment a:hover { color: var(--parchment-red); }
.parchment .lead, .parchment .caption { color: var(--parchment-caption); }
.parchment code {
  background: rgba(58, 44, 30, 0.08);
  border: 1px solid var(--parchment-rule);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}
.parchment ol, .parchment ul { padding-left: 1.3em; }
.parchment li { margin: 0.25em 0; }
/* Legal pages: one parchment sheet */
.legal { max-width: 820px; }
.legal .parchment { margin-top: 28px; }
.legal table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.6em 0 1em;
  font-size: 16px;
}
.legal th, .legal td {
  text-align: left;
  vertical-align: top;
  padding: 8px 10px;
  border-bottom: 1px solid var(--parchment-rule);
}
.legal th { font-family: var(--pixel); font-weight: 400; }

/* Footer */
footer {
  margin-top: 28px;
  border-top: 2px solid var(--line-header);
  background: var(--bg-bar);
  color: var(--text-mute);
  font-size: 15px;
}
footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  padding-top: 16px;
  padding-bottom: 16px;
}
.landing footer { margin-top: 0; }
footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
footer a { color: var(--text-dim); }

/* Phones and narrow windows (the legal pages) */
@media (max-width: 420px) {
  body { font-size: 16px; }
  .parchment { padding: 18px 16px; border-width: 4px; }
}

/* News (NEWS_PLAN NW2, NR5, NR6, NR12): the top-right button and the
   drawer, drawn by news.js from /news.json. Colours are the mockup's
   News page ("Castellar News & Credits"). Without JavaScript both stay
   hidden. */
:root {
  --news-btn-bg: rgba(20, 27, 54, 0.95);
  --news-btn-line: #232d52;
  --news-hover-line: #5a6a9a;
  --news-panel: #0e1326;
  --news-head: #121831;
  --news-edge: #212a4a;
  --news-item: #141b36;
  --news-item-line: #232d52;
  --news-tab-on: #1c2240;
  --news-chip-line: #2a3558;
  --news-count-off: #6f7897;
  --news-date: #8a93b0;
  --news-body: #c9d0e6;
  --news-bullet: #5a6a9a;
  --news-update: #8cc4f5;
  --news-update-bg: rgba(140, 196, 245, 0.14);
  --news-news: #7fe0a0;
  --news-news-bg: rgba(127, 224, 160, 0.14);
  --news-added: #7fe0a0;
  --news-changed: #8cc4f5;
  --news-fixed: #f5b24a;
  --news-scrim: rgba(5, 8, 18, 0.62);
}

.news-button[hidden], .news-badge[hidden], .news-drawer[hidden],
.news-drawer [hidden] { display: none !important; }

.news-button {
  /* SITE_PLAN SP2: in the header's links, not the page corner. */
  position: relative;
  padding: 0;
  background: none;
  border: 0;
  color: var(--text-dim);
  font: 700 17px var(--sans);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.news-button:hover, .news-button:focus-visible { color: #fff; }
.news-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: var(--gold);
  color: var(--gold-ink);
  font: 700 13px var(--sans);
}
@media (max-width: 699px) {
  /* 2b: a small boxed button beside Play, the count on its corner */
  .news-button {
    width: 52px;
    height: 44px;
    justify-content: center;
    background: var(--bg-panel);
    border: 2px solid var(--line-chip);
    border-radius: 10px;
    color: var(--text-soft);
    font: 400 14px var(--pixel);
  }
  .news-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border: 2px solid var(--bg-page);
    font-size: 12px;
  }
}

html.news-lock { overflow: hidden; }

.news-drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  font-size: 15px;
}
.news-scrim {
  position: absolute;
  inset: 0;
  background: var(--news-scrim);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.news-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  background: var(--news-panel);
  border-left: 2px solid var(--news-edge);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.5);
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.news-panel:focus { outline: none; }
.news-drawer.is-open .news-scrim { opacity: 1; }
.news-drawer.is-open .news-panel { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .news-scrim, .news-panel { transition: none; }
}
@media (max-width: 599px) {
  .news-panel { width: 100%; border-left: 0; }
}

.news-drawer button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.news-drawer button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.news-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 12px 20px;
  background: var(--news-head);
  border-bottom: 2px solid var(--news-edge);
}
.news-head h2 { margin: 0; font-size: 28px; }
.news-close {
  width: 44px;
  height: 44px;
  background: var(--news-item);
  border: 2px solid var(--news-chip-line);
  border-radius: 10px;
  font-size: 20px !important;
  line-height: 1;
}
.news-close:hover { border-color: var(--news-hover-line); }

.news-listview, .news-postview {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.news-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Filters: All, Updates, News, each with its unread count */
.news-tabs {
  flex: none;
  display: flex;
  gap: 8px;
  padding: 14px 16px 4px;
}
.news-tab {
  flex: 1 1 auto;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 10px 0 14px;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 10px;
  color: var(--text-dim) !important;
}
.news-tab > span:first-child { font: 400 20px var(--pixel); }
.news-tab:hover { border-color: var(--news-item-line); }
.news-tab[aria-pressed="true"] {
  background: var(--news-tab-on);
  border-color: var(--gold);
  color: #fff !important;
}
.news-count {
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  font: 700 15px var(--sans);
  color: var(--news-count-off);
}
.news-count.has-unread { background: var(--gold); color: var(--gold-ink); }

.news-listhead {
  flex: none;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 16px 10px 20px;
}
.news-listtitle { font: 400 28px/1 var(--pixel); }
.news-unread { font-weight: 700; font-size: 17px; color: var(--gold); }
.news-unread.all-read { color: var(--text-mute); }
.news-markall {
  margin-left: auto;
  align-self: center;
  height: 40px;
  padding: 0 14px;
  background: transparent;
  border: 2px solid var(--news-hover-line);
  border-radius: 10px;
  font: 400 18px var(--pixel) !important;
}
.news-markall:hover { border-color: #8a9ac8; }
.news-markall[aria-disabled="true"] { opacity: 0.45; cursor: default; }
.news-markall[aria-disabled="true"]:hover { border-color: var(--news-hover-line); }

.news-status {
  margin: 8px 20px;
  color: var(--text-dim);
}
.news-status:empty { display: none; }
.news-retry {
  margin: 4px 20px 16px;
  height: 44px;
  padding: 0 18px;
  background: var(--gold);
  border: 2px solid var(--gold-edge);
  border-radius: 9px;
  box-shadow: 0 3px 0 var(--gold-edge);
  color: var(--gold-ink) !important;
  font: 400 20px var(--pixel) !important;
}

/* The list */
.news-list {
  list-style: none;
  margin: 0;
  padding: 2px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.news-item {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px 15px 36px;
  text-align: left;
  background: transparent;
  border: 2px solid var(--news-item-line);
  border-radius: 12px;
}
.news-item.is-unread { background: var(--news-item); }
.news-item:hover { border-color: var(--news-hover-line); }
.news-item.is-unread::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 21px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
}
.news-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}
.news-kind {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.news-kind.update { color: var(--news-update); }
.news-kind.news { color: var(--news-news); }
.news-date { font-size: 16px; color: var(--text-mute); }
.news-item-title {
  font: 400 22px/1.2 var(--pixel);
  color: var(--text-dim);
  overflow-wrap: anywhere;
}
.news-item.is-unread .news-item-title { color: #fff; }
.news-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* The open post */
.news-backbar {
  flex: none;
  padding: 12px 16px;
  border-bottom: 2px solid var(--news-edge);
}
.news-back {
  height: 44px;
  padding: 0 16px;
  background: var(--news-item);
  border: 2px solid var(--news-chip-line);
  border-radius: 10px;
  font: 400 20px var(--pixel) !important;
}
.news-back:hover { border-color: var(--news-hover-line); }
.news-hero {
  position: relative;
  height: 220px;
  overflow: hidden;
  background: #1f2a4d;
}
.news-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}
.news-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(14, 19, 38, 0) 40%, var(--news-panel));
}
.news-post-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 22px 32px;
}
.news-post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.news-chip {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 6px;
}
.news-chip.update { background: var(--news-update-bg); color: var(--news-update); }
.news-chip.news { background: var(--news-news-bg); color: var(--news-news); }
.news-post-meta .news-date { color: var(--news-date); }
.news-mark {
  margin-left: auto;
  height: 42px;
  padding: 0 16px;
  background: var(--gold);
  border: 2px solid var(--gold-edge);
  border-radius: 9px;
  box-shadow: 0 3px 0 var(--gold-edge);
  color: var(--gold-ink) !important;
  font: 400 19px var(--pixel) !important;
}
.news-mark:hover { background: #f7d06a; }
.news-mark[aria-pressed="true"] {
  background: transparent;
  border-color: var(--news-chip-line);
  box-shadow: none;
  color: var(--text-dim) !important;
}
.news-mark[aria-pressed="true"]:hover { border-color: var(--news-hover-line); }
.news-post h3.news-title {
  font: 400 32px/1.15 var(--pixel);
  color: var(--text);
  margin: 0;
  overflow-wrap: anywhere;
}
.news-body {
  color: var(--news-body);
  font-size: 17px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.news-body > :first-child { margin-top: 0; }
.news-body p { margin: 0 0 0.8em; }
.news-body ul, .news-body ol { margin: 0 0 0.8em; padding-left: 1.4em; }
.news-body ul { list-style: none; padding-left: 0; }
.news-body ul > li { position: relative; padding-left: 1.2em; }
.news-body ul > li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--news-bullet);
}
.news-body li { margin: 0.35em 0; }
.news-body li > ul, .news-body li > ol { margin: 0.3em 0 0; }
.news-body h3 {
  font: 700 15px var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 1.4em 0 0.5em;
}
.news-body > h3:first-child { margin-top: 0.2em; }
.news-body h3.added { color: var(--news-added); }
.news-body h3.changed { color: var(--news-changed); }
.news-body h3.fixed { color: var(--news-fixed); }
.news-body b, .news-body strong { color: var(--text); font-weight: 700; }
.news-body img {
  /* Inline images fill the column, as in the game (NW4): small pixel art
     scales up crisp. */
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  margin: 0.4em 0 1em;
  border: 2px solid var(--line-panel);
  border-radius: 8px;
}
.news-body a { color: var(--blue-text); }
.news-body a:hover { color: var(--text); }

@media (max-width: 420px) {
  .news-tabs { gap: 6px; padding: 12px 12px 4px; }
  .news-tab { padding: 0 6px 0 10px; }
  .news-tab > span:first-child { font-size: 18px; }
  .news-listhead { padding: 12px 12px 8px 16px; gap: 10px; }
  .news-listtitle { font-size: 24px; }
  .news-unread { font-size: 15px; }
  .news-markall { font-size: 16px !important; padding: 0 10px; }
  .news-list { padding: 2px 12px 16px; }
  .news-hero { height: 160px; }
  .news-post-inner { padding: 16px 16px 28px; }
  .news-post h3.news-title { font-size: 26px; }
  .news-body { font-size: 16px; }
}
