/* ==========================================================================
   Dirt.smp — core stylesheet
   Beta identity: Regolith.smp
   Palette derived directly from the brand artboard.
   ========================================================================== */

/* --- 1. Tokens ----------------------------------------------------------- */

:root {
  /* Brand — sampled from the logo */
  --grass:        #66A344;
  --grass-side:   #5B923E;
  --grass-lit:    #8BC95F;
  --dirt:         #875A3A;
  --dirt-shadow:  #6D492F;
  --tan:          #BD8A6B;
  --soil-ink:     #3F2315;

  /* Surfaces — dark earth */
  --bg:           #14100B;
  --bg-alt:       #1A140D;
  --panel:        #221A11;
  --panel-lit:    #2C2116;
  --line:         #3A2B1C;
  --line-soft:    #2B2015;

  /* Type */
  --text:         #EDE2D2;
  --text-dim:     #B09B82;
  /* Lightened from #7C6B57, which measured 3.35-3.7:1 on these surfaces —
     below the 4.5:1 AA minimum for body-size text. #988773 clears 4.5 on
     every surface it is used on, panel-lit included (4.53:1). */
  --text-faint:   #988773;

  /* Signals */
  --torch:        #F2A63B;
  --blood:        #C0492F;
  --blood-lit:    #DD664C;   /* text-safe red: 4.55:1 on --panel-lit */
  --lapis:        #4A7BC8;

  /* Fonts */
  --font-display: "Minecraft", "Pixelify Sans", "Courier New", monospace;
  /* Symbols and emoji exist in neither pixel face. */
  --font-symbol:  "Apple Symbols", "Segoe UI Symbol", "Noto Sans Symbols 2", sans-serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Rhythm */
  --shell:        1180px;
  --gutter:       clamp(1.25rem, 4vw, 2.5rem);
  --section-y:    clamp(4rem, 9vw, 7.5rem);
  --radius:       4px;

  /* Elevation — hard-edged, like a block casting a shadow */
  --lift:         0 4px 0 rgba(0, 0, 0, .35);
  --lift-lg:      0 10px 30px rgba(0, 0, 0, .5);
}

/* --- 1b. Brand face ------------------------------------------------------ */

/*
 * "Minecraft" by Craftron Gaming — a fan-made recreation, self-hosted so the
 * brand face does not depend on a third-party CDN.
 *
 * It ships ASCII only, in a single weight. Three consequences, handled here:
 *
 *  1. `font-weight: 400 700` declares this face as covering the whole range,
 *     so the browser never synthesises a bold. Faux-bolding a pixel font
 *     smears the grid and looks broken.
 *
 *  2. `size-adjust` brings its cap height down to match Pixelify Sans, which
 *     stays in the stack as the fallback for everything Minecraft lacks —
 *     em dashes, ellipses, middle dots, accents. Matching caps means a heading
 *     that mixes the two does not visibly change size mid-word.
 *
 *  3. Decorative symbols and emoji get their own stacks further down; neither
 *     pixel font contains them.
 */
/*
 * Inter and Pixelify Sans, self-hosted.
 *
 * These used to come from fonts.googleapis.com. That cost two extra origins on
 * the critical path AND a serialised round trip — the browser cannot even learn
 * the font file URLs until Google's CSS has come back. Measured on a warm
 * connection the font requests did not start until 35ms after the CSS request;
 * cold, with two DNS lookups and two TLS handshakes, it is far worse. Serving
 * them from this origin removes the whole chain, and removes a third party from
 * every page view.
 *
 * Both are the variable-weight builds, so ONE file per subset covers 400-700 —
 * Google was already serving it that way; the four separate @font-face blocks
 * per weight in its CSS all pointed at the same file.
 *
 * The unicode-range values are Google's own, kept verbatim. They are what makes
 * the -ext files free: a page of English text never fetches them, and a nation
 * named "Tídhavn" pulls the 8KB Pixelify ext file only when it is rendered.
 *
 * See assets/fonts/LICENSE.txt. Both are OFL 1.1.
 */
/* Subset: Latin-1 plus the punctuation the site actually uses, keeping the
   full 100-900 weight axis. 48KB to 35KB. Deliberately generous rather than a
   tight per-glyph subset — player names, nation names and handbook text are all
   user-supplied, so characters nobody anticipated will turn up. */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-ext.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Pixelify Sans";
  src: url("../fonts/pixelify-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Pixelify Sans";
  src: url("../fonts/pixelify-latin-ext.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Minecraft";
  src: url("../fonts/minecraft.woff2") format("woff2"),
       url("../fonts/minecraft.woff") format("woff");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  size-adjust: 87%;
}

/* --- 2. Reset ------------------------------------------------------------ */

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

html {
  font-synthesis-weight: none;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; height: auto; }
a   { color: var(--grass-lit); text-decoration-color: rgba(139, 201, 95, .35); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 .5em;
  letter-spacing: .01em;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 1em; padding-left: 1.25rem; }
li + li { margin-top: .4rem; }

:focus-visible {
  outline: 3px solid var(--grass-lit);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--grass); color: #0E0B07; }

/* --- 3. Layout primitives ------------------------------------------------ */

.shell {
  width: min(100% - (var(--gutter) * 2), var(--shell));
  margin-inline: auto;
}

.shell--narrow { --shell: 780px; }

.section { padding-block: var(--section-y); position: relative; }
.section--alt { background: var(--bg-alt); }

.section--alt::before,
.section--alt::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: var(--line-soft);
}
.section--alt::before { top: 0; }
.section--alt::after  { bottom: 0; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 200;
  background: var(--grass);
  color: #0E0B07;
  padding: .75rem 1.25rem;
  font-weight: 700;
  border-radius: var(--radius);
  transition: top .2s;
}
.skip-link:focus { top: 1rem; }

/* --- 4. Section headers -------------------------------------------------- */

.eyebrow {
  font-family: var(--font-display);
  font-size: .8rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--grass);
  margin: 0 0 .9rem;
  display: flex;
  align-items: center;
  gap: .7rem;
}

.eyebrow::before {
  content: "";
  width: 10px; height: 10px;
  background: var(--grass);
  flex: none;
  box-shadow: 0 0 12px rgba(102, 163, 68, .8);
}

.section-head { max-width: 62ch; margin-bottom: clamp(2.25rem, 5vw, 3.5rem); }
.section-head h2 { font-size: clamp(1.9rem, 4.4vw, 2.9rem); }
.section-head > p {
  color: var(--text-dim);
  font-size: 1.075rem;
  margin-bottom: 0;
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}
.section-head--center .eyebrow { justify-content: center; }

/* --- 5. Buttons ---------------------------------------------------------- */

.btn {
  --btn-bg: var(--grass);
  --btn-fg: #0E0B07;
  --btn-edge: var(--grass-side);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: .95rem 1.7rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 4px 0 var(--btn-edge);
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--btn-edge);
  filter: brightness(1.06);
}

.btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--btn-edge);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-edge: transparent;
  border: 2px solid var(--line);
  box-shadow: none;
}
.btn--ghost:hover {
  border-color: var(--grass);
  color: var(--grass-lit);
  box-shadow: none;
  filter: none;
}

.btn--torch { --btn-bg: var(--torch); --btn-edge: #C1811F; }
.btn--sm    { padding: .65rem 1.15rem; font-size: .875rem; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: .9rem;
  align-items: center;
}

/* --- 6. Header ----------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(20, 16, 11, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
  transition: border-color .25s, background .25s;
}

.site-header.is-stuck {
  border-bottom-color: var(--line);
  background: rgba(20, 16, 11, .95);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 4.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
  color: var(--text);
  margin-right: auto;
  flex: none;
}

.brand img {
  width: 38px;
  height: 38px;
  image-rendering: pixelated;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .6));
}

.brand__name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .01em;
}

.brand__beta {
  display: block;
  font-family: var(--font-display);
  font-size: .6rem;
  letter-spacing: .2em;
  color: var(--torch);
  text-transform: uppercase;
  margin-top: .18rem;
}

.nav { display: flex; align-items: center; gap: .35rem; }

.nav a {
  font-family: var(--font-display);
  font-size: .95rem;
  color: var(--text-dim);
  text-decoration: none;
  padding: .5rem .8rem;
  border-radius: var(--radius);
  transition: color .15s, background .15s;
  white-space: nowrap;
}

.nav a:hover { color: var(--text); background: var(--panel); }

/*
 * `.nav a` (0,1,1) outranks `.btn` (0,1,0), so the Apply button in the header
 * was inheriting --text-dim and rendering tan-on-green at 1.14:1 — effectively
 * illegible, on the site's primary call to action. Restore the button's own
 * colour at matching specificity.
 */
.nav a.btn        { color: var(--btn-fg); }
.nav a.btn:hover  { color: var(--btn-fg); background: var(--btn-bg); }

.nav a[aria-current="page"] {
  color: var(--grass-lit);
  background: rgba(102, 163, 68, .1);
}

/*
 * Same trap one level deeper. On apply.html the Apply button is ALSO the
 * current page, so `.nav a[aria-current]` (0,2,1) beat `.nav a.btn` (0,2,0)
 * and painted --grass-lit on the green button: grass on grass. The current-page
 * treatment is meaningless on a button that already reads as the destination,
 * so the button's own colours win outright here.
 */
.nav a.btn[aria-current="page"] {
  color: var(--btn-fg);
  background: var(--btn-bg);
}

.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  width: 2.75rem;
  height: 2.75rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex: none;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  transition: transform .2s, opacity .2s;
}
.nav-toggle span::before { transform: translateY(-6px); }
.nav-toggle span::after  { transform: translateY(4px); }

.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after  { transform: translateY(-2px) rotate(-45deg); }

@media (max-width: 900px) {
  /*
   * The collapsed mobile nav exists only when the script that opens it does.
   *
   * Everything that makes it a drawer is gated on .js-nav, which main.js puts
   * on <html> once initNav() has wired the button. Without it a phone would get
   * a hidden nav and a hamburger that does nothing — every page in the header
   * unreachable, with a control sitting there implying otherwise. Ungated, the
   * nav is a wrapped row of links on its own line: plainer than intended, and
   * navigable, which is the part that matters.
   *
   * The toggle is hidden rather than shown-but-inert for the same reason. A
   * button that cannot work should not be on screen.
   */
  .js-nav .nav-toggle { display: inline-flex; }

  /*
   * The no-script shape: a wrapped row of links on its own line under the logo,
   * not a tall stacked column squeezed in beside it. The header is a flex row,
   * so the nav needs to be told to take a full line of its own — otherwise the
   * fallback reads as a layout accident rather than a simple header, which
   * makes people distrust the rest of the page.
   */
  .site-header__inner { flex-wrap: wrap; }

  .nav {
    flex-basis: 100%;
    flex-wrap: wrap;
    gap: .35rem .9rem;
    padding-bottom: .9rem;
  }

  .js-nav .nav {
    flex-basis: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--line);
    padding: .75rem var(--gutter) 1.5rem;
    max-height: calc(100vh - 4.5rem);
    overflow-y: auto;
    position: fixed;
    inset: 4.5rem 0 auto 0;
    transform: translateY(-120%);
    visibility: hidden;
    transition: transform .28s ease, visibility .28s;
  }

  .js-nav .nav.is-open { transform: translateY(0); visibility: visible; }

  /* Drawer styling only. A divider under every link and a pushed-down button
     are right in a full-height panel and wrong in a wrapped row. */
  .js-nav .nav a {
    padding: .9rem .5rem;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--line-soft);
    border-radius: 0;
  }
  .js-nav .nav .btn { margin-top: 1rem; }
}

/* --- 7. Hero ------------------------------------------------------------- */

.hero {
  position: relative;
  padding-block: clamp(3.5rem, 9vw, 7rem) clamp(4rem, 8vw, 6rem);
  overflow: hidden;
  isolation: isolate;
}

/* Soft torchlight bloom behind the cube */
.hero::before {
  content: "";
  position: absolute;
  z-index: -2;
  top: -25%;
  right: -5%;
  width: 780px;
  height: 780px;
  max-width: 110vw;
  background: radial-gradient(circle, rgba(102, 163, 68, .22) 0%, rgba(102, 163, 68, 0) 62%);
  pointer-events: none;
}

/* Faint block grid — reads as terrain, never competes with text */
.hero::after {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0;
  background-image:
    linear-gradient(to right,  rgba(120, 96, 66, .11) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(120, 96, 66, .11) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000 30%, transparent 78%);
  pointer-events: none;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(2rem, 6vw, 4.5rem);
  align-items: center;
}

/* Grid items default to min-width:auto, which lets wide children (the server
   bar, tables, long headings) push a track past the viewport. Pin them to zero
   everywhere we use grid for layout. */
.hero__grid > *,
.codex-layout > *,
.card-grid > *,
.nation-grid > *,
.form-grid > *,
.footer-grid > *,
.stat-strip > *,
.steps > * { min-width: 0; }

@media (max-width: 880px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__art  { order: -1; max-width: 320px; margin-inline: auto; }
}

/*
 * On a phone the block stays first — it is the brand — but smaller.
 *
 * Measured at 390×844, a common phone size: at 320px wide the illustration
 * took the top 40% of the screen and pushed the Apply button to 898px, just
 * below the fold, with the server address two screens down. The whole point
 * of this page is that button. At this size it lands on the first screen.
 */
@media (max-width: 560px) {
  .hero       { padding-block-start: 1.75rem; }
  .hero__art  { max-width: 170px; }
}
/* Short phones (360×740 and the like) need the last fifty pixels too. */
@media (max-width: 560px) and (max-height: 780px) {
  .hero__art  { max-width: 118px; }
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-display);
  font-size: .75rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--torch);
  background: rgba(242, 166, 59, .1);
  border: 1px solid rgba(242, 166, 59, .35);
  border-radius: 100px;
  padding: .45rem 1rem;
  margin-bottom: 1.5rem;
}

.hero__badge::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--torch);
  box-shadow: 0 0 10px var(--torch);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .35; }
}

.hero h1 {
  font-size: clamp(2.6rem, 7.5vw, 4.75rem);
  margin-bottom: 1.1rem;
  text-shadow: 0 6px 0 rgba(0, 0, 0, .3);
}

.hero h1 .accent { color: var(--grass); }

.hero__lede {
  font-size: clamp(1.075rem, 2.1vw, 1.28rem);
  color: var(--text-dim);
  max-width: 54ch;
  margin-bottom: 2rem;
}

.hero__art img {
  width: 100%;
  image-rendering: pixelated;
  filter: drop-shadow(0 26px 40px rgba(0, 0, 0, .6));
  animation: bob 7s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}

/* --- 8. Server status / IP panel ---------------------------------------- */

.server-bar {
  margin-top: 2.5rem;
  display: grid;
  /* Two columns, so four cells land as a tidy 2x2 block rather than 3 + 1. */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--lift);
  max-width: 540px;
}

/* With Bedrock switched off there are three cells — let the last one span so
   the grid never shows a hole. */
.server-bar__cell:nth-child(3):last-child { grid-column: 1 / -1; }

@media (max-width: 430px) {
  .server-bar { grid-template-columns: 1fr; }
}

.server-bar__cell {
  background: var(--panel);
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  min-width: 0;
}

.server-bar__label {
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
}

.server-bar__value {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
}

.server-bar__value span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.copy-ip {
  background: none;
  border: 0;
  color: var(--text-faint);
  cursor: pointer;
  padding: .25rem;
  border-radius: 3px;
  flex: none;
  display: inline-flex;
  transition: color .15s, background .15s;
}
.copy-ip:hover { color: var(--grass-lit); background: rgba(102, 163, 68, .12); }
.copy-ip.is-copied { color: var(--grass-lit); }

.status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text-faint);
  flex: none;
  transition: background .3s, box-shadow .3s;
}
.status-dot[data-state="online"]  { background: var(--grass-lit); box-shadow: 0 0 10px rgba(139, 201, 95, .85); }
.status-dot[data-state="offline"] { background: var(--blood);     box-shadow: 0 0 10px rgba(192, 73, 47, .7); }

/* --- 9. Cards ------------------------------------------------------------ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.9rem;
  position: relative;
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent-bar, var(--grass));
  opacity: .55;
  transition: opacity .2s;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--line);
  background: var(--panel-lit);
}
.card:hover::before { opacity: 1; }

.card__icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: rgba(102, 163, 68, .12);
  color: var(--grass-lit);
  margin-bottom: 1.15rem;
}
.card__icon svg { width: 24px; height: 24px; }

.card h3 { font-size: 1.3rem; margin-bottom: .55rem; }
.card p  { color: var(--text-dim); font-size: .96rem; margin-bottom: 0; }

/* Accent variants, used to colour-code the pillars */
.card--war   { --accent-bar: var(--blood);  }
.card--war   .card__icon { background: rgba(192, 73, 47, .13);  color: #E3775C; }
.card--boss  { --accent-bar: var(--torch);  }
.card--boss  .card__icon { background: rgba(242, 166, 59, .13); color: var(--torch); }
.card--lapis { --accent-bar: var(--lapis);  }
.card--lapis .card__icon { background: rgba(74, 123, 200, .14); color: #7FA6E0; }
.card--dirt  { --accent-bar: var(--tan);    }
.card--dirt  .card__icon { background: rgba(189, 138, 107, .14); color: var(--tan); }

/* --- 10. Steps ----------------------------------------------------------- */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1.25rem;
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
}

.steps li {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.75rem;
  position: relative;
  margin: 0;
}

.steps li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-display);
  font-size: 2.1rem;
  color: var(--grass);
  opacity: .32;
  display: block;
  line-height: 1;
  margin-bottom: .9rem;
}

.steps h3 { font-size: 1.15rem; margin-bottom: .4rem; }
.steps p  { color: var(--text-dim); font-size: .94rem; margin-bottom: 0; }

/* --- 11. News ------------------------------------------------------------ */

.news-list { display: grid; gap: 1rem; }

.news-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.35rem;
  align-items: start;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--grass);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  transition: background .2s, border-color .2s;
}
.news-item:hover { background: var(--panel-lit); }

.news-item[data-tag="war"]     { border-left-color: var(--blood); }
.news-item[data-tag="boss"]    { border-left-color: var(--torch); }
.news-item[data-tag="update"]  { border-left-color: var(--lapis); }

.news-item__date {
  font-family: var(--font-display);
  font-size: .8rem;
  color: var(--text-faint);
  letter-spacing: .06em;
  white-space: nowrap;
  padding-top: .25rem;
}

.news-item h3 { font-size: 1.1rem; margin-bottom: .3rem; }
.news-item p  { color: var(--text-dim); font-size: .94rem; margin: 0; }

.tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: .65rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: .2rem .55rem;
  border-radius: 2px;
  background: rgba(102, 163, 68, .16);
  color: var(--grass-lit);
  vertical-align: middle;
  margin-left: .6rem;
}
.tag--war    { background: rgba(192, 73, 47, .18);  color: #E3775C; }
.tag--boss   { background: rgba(242, 166, 59, .16); color: var(--torch); }
.tag--update { background: rgba(74, 123, 200, .18); color: #7FA6E0; }
/* Announcements add two more categories. Both colours were solved against
   their own tint composited over the panel, not against the panel alone —
   4.51:1 and 4.73:1. */
.tag--event  { background: rgba(139, 92, 196, .18); color: #A87CE1; }
.tag--world  { background: rgba(63, 169, 150, .16); color: #3FA996; }

@media (max-width: 560px) {
  .news-item { grid-template-columns: 1fr; gap: .5rem; }
  .news-item__date { padding-top: 0; }
}

/* --- 12. Stat strip ------------------------------------------------------ */

.stat-strip {
  display: grid;
  /* Four fixed stats, so lay them out explicitly. auto-fit dropped to three
     columns at mid widths and orphaned the fourth in a half-empty row. */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border-block: 1px solid var(--line-soft);
}

@media (max-width: 780px) {
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/*
 * The strip after main.js has removed the stats it has nothing honest to say
 * about. Removing them is deliberate — "0 whitelisted players" is a worse
 * advert than no number — but the grid still laid out four columns, so the
 * gap showed through as an empty brown tile. Size the grid to what is left.
 */
@media (min-width: 781px) {
  .stat-strip:has(> .stat:nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-strip:has(> .stat:nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Two across on a phone: an odd one out takes the whole row instead of half of one. */
@media (max-width: 780px) {
  .stat-strip > .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.stat-strip > .stat:only-child { grid-column: 1 / -1; }
/* Nothing left to show: no strip, rather than two empty borders. */
.stat-strip:not(:has(> .stat)) { display: none; }

.stat {
  background: var(--bg);
  padding: 2rem 1.25rem;
  text-align: center;
}

.stat__num {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  color: var(--grass);
  line-height: 1;
  display: block;
}

.stat__label {
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: .6rem;
  display: block;
}

/* --- 13. Nations directory ---------------------------------------------- */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: 2rem;
  align-items: center;
}

.filter-bar__search {
  flex: 1 1 220px;
  min-width: 0;
}

.chip {
  font-family: var(--font-display);
  font-size: .85rem;
  padding: .5rem 1rem;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 100px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all .15s;
}
.chip:hover { border-color: var(--line); color: var(--text); }
.chip[aria-pressed="true"] {
  background: var(--grass);
  border-color: var(--grass);
  color: #0E0B07;
}

.nation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr));
  gap: 1.25rem;
}

.nation {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s, border-color .2s;
}
.nation:hover { transform: translateY(-4px); border-color: var(--line); }

.nation__banner {
  height: 96px;
  position: relative;
  background: linear-gradient(135deg, var(--crest, var(--grass)) 0%, rgba(0, 0, 0, .55) 130%);
  display: flex;
  align-items: flex-end;
  padding: .9rem 1.35rem;
}

.nation__banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right,  rgba(0, 0, 0, .14) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, .14) 1px, transparent 1px);
  background-size: 16px 16px;
  pointer-events: none;
}

.nation__sigil {
  font-family: var(--font-symbol);
  font-size: 1.9rem;
  color: #fff;
  text-shadow: 0 3px 0 rgba(0, 0, 0, .4);
  position: relative;
  z-index: 1;
  line-height: 1;
}

.nation__body { padding: 1.35rem; flex: 1; display: flex; flex-direction: column; }
.nation__body h2 { font-size: 1.25rem; margin-bottom: .2rem; }

.nation__leader {
  font-size: .85rem;
  color: var(--text-faint);
  margin-bottom: .9rem;
}

.nation__desc {
  font-size: .93rem;
  color: var(--text-dim);
  margin-bottom: 1.15rem;
  flex: 1;
}

.nation__meta {
  display: flex;
  gap: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
  font-size: .82rem;
}

.nation__meta div  { display: flex; flex-direction: column; gap: .1rem; }
.nation__meta dt   { color: var(--text-faint); text-transform: uppercase; letter-spacing: .1em; font-size: .68rem; }
.nation__meta dd   { margin: 0; font-family: var(--font-display); color: var(--text); font-size: 1rem; }

.status-pill {
  font-size: .68rem;
  font-family: var(--font-display);
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .25rem .6rem;
  border-radius: 100px;
  margin-left: auto;
  align-self: flex-start;
}
.status-pill[data-status="at war"]   { background: rgba(192, 73, 47, .18);  color: #E4785D; }
.status-pill[data-status="peace"]    { background: rgba(102, 163, 68, .16); color: var(--grass-lit); }
.status-pill[data-status="alliance"] { background: rgba(74, 123, 200, .18); color: #7FA6E0; }
/* Each pill is measured against its own translucent tint composited over the
   card, not against the card alone. "fallen" was 3.62:1 that way — the tan tint
   lifts the background more than --text-faint was picked for. */
.status-pill[data-status="fallen"]   { background: rgba(124, 107, 87, .22); color: #AA9985; }

.nation__head { display: flex; align-items: flex-start; gap: .75rem; }

/* --- 14. Codex / lore ---------------------------------------------------- */

.codex-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

@media (max-width: 860px) {
  .codex-layout { grid-template-columns: 1fr; }
  .codex-nav { position: static !important; }
}

.codex-nav {
  position: sticky;
  top: 6rem;
  border-left: 2px solid var(--line-soft);
  padding-left: 1rem;
}

.codex-nav a {
  display: block;
  padding: .45rem 0;
  font-size: .93rem;
  color: var(--text-faint);
  text-decoration: none;
  transition: color .15s;
}
.codex-nav a:hover,
.codex-nav a.is-active { color: var(--grass-lit); }

.codex-entry { margin-bottom: clamp(3rem, 6vw, 4.5rem); }
.codex-entry:last-child { margin-bottom: 0; }
.codex-entry h2 { font-size: clamp(1.6rem, 3.6vw, 2.15rem); }
.codex-entry > p { color: var(--text-dim); }

.callout {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--torch);
  border-radius: var(--radius);
  padding: 1.35rem 1.6rem;
  margin: 1.75rem 0;
}

.callout strong { color: var(--torch); font-family: var(--font-display); }
.callout p:last-child { margin-bottom: 0; }
.callout--danger { border-left-color: var(--blood); }
.callout--danger strong { color: #E3775C; }

.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.75rem 0;
  font-size: .93rem;
}

.spec-table th,
.spec-table td {
  text-align: left;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}

.spec-table th {
  font-family: var(--font-display);
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--grass);
  background: var(--panel);
}

.spec-table td { color: var(--text-dim); }
.spec-table td:first-child { color: var(--text); font-weight: 600; white-space: nowrap; }
.spec-table tbody tr:hover td { background: rgba(255, 255, 255, .018); }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* --- 15. Rules ----------------------------------------------------------- */

.rule-group { margin-bottom: 3rem; }

.rule {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.15rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line-soft);
  align-items: start;
}
.rule:last-child { border-bottom: 0; }

.rule__num {
  font-family: var(--font-display);
  color: var(--grass);
  opacity: .5;
  font-size: 1rem;
  padding-top: .1rem;
  white-space: nowrap;
}

.rule h3 { font-size: 1.08rem; margin-bottom: .3rem; }
.rule p  { color: var(--text-dim); font-size: .94rem; margin: 0; }

/* --- 15b. The Ten Commandments ------------------------------------------- */

.commandments {
  list-style: none;
  counter-reset: commandment;
  padding: 0;
  margin: 0 0 2.5rem;
}

.commandment {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--grass);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  margin: 0 0 1rem;
  transition: background .2s, border-color .2s;
}

.commandment:hover { background: var(--panel-lit); border-color: var(--line); }

/* Zero-tolerance rules are marked in blood red rather than grass. */
.commandment--severe { border-left-color: var(--blood); }

.commandment__mark {
  font-size: 1.5rem;
  line-height: 1.35;
  width: 2.6rem;
  text-align: center;
  flex: none;
  /* Emoji should never inherit the pixel display face. */
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.commandment__body { min-width: 0; }

.commandment__body h2 {
  font-size: 1.2rem;
  margin: 0 0 .45rem;
  display: flex;
  align-items: baseline;
  gap: .6rem;
}

/* The numeral is generated, so the markup stays clean and the order is
   guaranteed to match the list. */
.commandment__body h2::before {
  counter-increment: commandment;
  content: counter(commandment, decimal-leading-zero);
  font-size: .95rem;
  color: var(--grass);
  opacity: .55;
  flex: none;
}

.commandment--severe .commandment__body h2::before { color: var(--blood); opacity: .75; }

.commandment__body p {
  color: var(--text-dim);
  font-size: .95rem;
  margin: 0;
}

.commandment__body strong { color: var(--text); }

.commandment code {
  background: var(--bg-alt);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  padding: .08rem .4rem;
  font-size: .9em;
  color: var(--grass-lit);
}

@media (max-width: 540px) {
  .commandment { grid-template-columns: 1fr; gap: .6rem; padding: 1.25rem; }
  .commandment__mark { text-align: left; width: auto; }
}

/* --- 16. Forms ----------------------------------------------------------- */

.form { display: grid; gap: 1.4rem; }

.field { display: grid; gap: .45rem; }

.field > label {
  font-family: var(--font-display);
  font-size: .95rem;
  color: var(--text);
}

.field__hint {
  font-size: .84rem;
  color: var(--text-faint);
  margin: 0;
}

/* --blood (#C0492F) is 3.17:1 on the form panel. Lightened to clear 4.5:1
   while staying unmistakably the same red. The token itself is unchanged —
   elsewhere it is only ever a border or a dot, where contrast does not apply. */
.req { color: var(--blood-lit); margin-left: .2rem; }

/*
 * Every text-like input type, listed explicitly.
 *
 * This used to name four, and the site uses more. An input[type="url"] was
 * therefore unstyled — meaning the browser default, which on a dark site is a
 * white box sitting among dark ones. It is an easy omission to make and a
 * strange one to look at, so the list now covers every type that renders as a
 * text field, including ones not used yet.
 *
 * Deliberately a list rather than input:not([type=checkbox])… — the negation
 * form has much higher specificity, which would quietly beat the :focus and
 * :focus-visible rules below and cost the focus ring.
 */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="month"],
input[type="week"],
select,
textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .8rem 1rem;
  transition: border-color .15s, box-shadow .15s;
}

textarea { resize: vertical; min-height: 8rem; line-height: 1.6; }

input::placeholder, textarea::placeholder { color: var(--text-faint); }

/*
 * Focus.
 *
 * The old rule was `input:focus { outline: none; ... }`. Specificity (0,1,1)
 * beat the site-wide `:focus-visible` (0,1,0), so KEYBOARD users lost the 3px
 * grass outline and got only the soft glow below — which measures 1.29:1
 * against the field. WCAG 2.2 SC 2.4.11 wants 3:1. Worse, checkboxes and radios
 * are not in the styled-control list above, so they got the `outline: none` and
 * nothing in its place: the required "I have read the Ten Commandments" box had
 * no visible focus state whatsoever.
 *
 * So: the glow is the POINTER treatment, and the outline is suppressed only
 * when :focus-visible does not match. Keyboard focus gets the real ring
 * (9.23:1) on every control, checkboxes included.
 */
input:focus, select:focus, textarea:focus {
  border-color: var(--grass);
  box-shadow: 0 0 0 3px rgba(102, 163, 68, .18);
}

input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  outline: none;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--grass-lit);
  outline-offset: 2px;
  box-shadow: none;
}

input[aria-invalid="true"],
textarea[aria-invalid="true"],
select[aria-invalid="true"] { border-color: var(--blood); }

/*
 * A colour input is a swatch, not a text box, so it keeps the browser's own
 * control and only gets sized and framed to sit properly beside the others.
 */
input[type="color"] {
  width: 3.25rem;
  height: 2.6rem;
  padding: .25rem;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

/*
 * Date and time pickers draw their own calendar icon, and it is black by
 * default — invisible on this background. Inverting it is the only hook
 * browsers give for this.
 */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: .6;
  cursor: pointer;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B09B82' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .9rem center;
  background-size: 18px;
  padding-right: 2.6rem;
}

.checkbox {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .75rem;
  align-items: start;
  font-size: .94rem;
  color: var(--text-dim);
  cursor: pointer;
}

.checkbox input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--grass);
  margin-top: .2rem;
  cursor: pointer;
}

.field__error {
  font-size: .84rem;
  color: #E3775C;
  margin: 0;
  min-height: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 1.4rem;
}

.field--narrow { max-width: 22rem; }

.form-note {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  font-size: .92rem;
  color: var(--text-dim);
}

.form-status {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  font-size: .95rem;
  border: 1px solid;
}
.form-status[data-kind="ok"]   { background: rgba(102, 163, 68, .1); border-color: rgba(102, 163, 68, .4); color: var(--grass-lit); }
.form-status[data-kind="err"]  { background: rgba(192, 73, 47, .1);  border-color: rgba(192, 73, 47, .4);  color: #E3775C; }

/* Honeypot — off-screen, never display:none (bots skip hidden fields) */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- 17. FAQ ------------------------------------------------------------- */

.faq { border-top: 1px solid var(--line-soft); }

.faq details {
  border-bottom: 1px solid var(--line-soft);
}

.faq summary {
  font-family: var(--font-display);
  font-size: 1.08rem;
  padding: 1.25rem 2.5rem 1.25rem 0;
  cursor: pointer;
  list-style: none;
  position: relative;
  transition: color .15s;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--grass-lit); }

.faq summary::after {
  content: "+";
  position: absolute;
  right: .35rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  color: var(--grass);
  line-height: 1;
  transition: transform .2s;
}

.faq details[open] summary::after { content: "\2212"; }

.faq details > div {
  padding-bottom: 1.35rem;
  color: var(--text-dim);
  font-size: .96rem;
  max-width: 68ch;
}

/* --- 18. CTA band -------------------------------------------------------- */

.cta-band {
  position: relative;
  text-align: center;
  padding-block: clamp(3.5rem, 8vw, 5.5rem);
  background:
    linear-gradient(rgba(20, 16, 11, .9), rgba(20, 16, 11, .95)),
    var(--dirt-shadow);
  border-block: 1px solid var(--line);
  overflow: hidden;
}

.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 55% 75% at 50% 100%, rgba(102, 163, 68, .2), transparent 70%);
  pointer-events: none;
}

.cta-band > * { position: relative; }
.cta-band h2  { font-size: clamp(1.8rem, 4.5vw, 2.7rem); }
.cta-band p   { color: var(--text-dim); max-width: 52ch; margin-inline: auto; margin-bottom: 2rem; }
.cta-band .btn-row { justify-content: center; }

/* --- 19. Footer ---------------------------------------------------------- */

.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--line-soft);
  padding-block: 3.5rem 2rem;
  font-size: .92rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(auto-fit, minmax(140px, 1fr));
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.footer-brand p {
  color: var(--text-faint);
  max-width: 34ch;
  margin-top: 1rem;
  font-size: .9rem;
}

/* Rendered as <h2> for a clean heading outline; styled small on purpose. */
.footer-col h2 {
  font-size: .8rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 1rem;
}

.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin: 0 0 .25rem; }

/*
 * Footer links are standalone navigation, not words inside a sentence, so
 * WCAG 2.2's 24x24 minimum target size applies to them with no exemption —
 * and at the footer's type size they were coming out 18px tall, which is a
 * genuinely fiddly tap on a phone. inline-block plus vertical padding takes
 * the hit area past 24px without changing how the list looks; the li margin
 * above is reduced by the same amount so the spacing is unchanged.
 */
.footer-col a {
  display: inline-block;
  padding-block: .2rem;
  min-height: 24px;
  color: var(--text-dim);
  text-decoration: none;
  transition: color .15s;
}
.footer-col a:hover { color: var(--grass-lit); }

/* The lone link in the footer bottom row is standalone navigation too, so it
   gets the same 24px floor as the footer columns above. */
.footer-bottom a {
  display: inline-block;
  padding-block: .2rem;
  min-height: 24px;
}

.footer-bottom {
  border-top: 1px solid var(--line-soft);
  padding-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  color: var(--text-faint);
  font-size: .85rem;
}

.disclaimer { max-width: 62ch; }

/* --- 20. Page header (interior pages) ------------------------------------ */

.page-head {
  padding-block: clamp(3rem, 7vw, 5rem) clamp(2.5rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--line-soft);
  position: relative;
  overflow: hidden;
}

.page-head::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right,  rgba(120, 96, 66, .1) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(120, 96, 66, .1) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, #000, transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent);
  pointer-events: none;
}

.page-head > * { position: relative; }
.page-head h1 { font-size: clamp(2.1rem, 5.5vw, 3.4rem); margin-bottom: .65rem; }
.page-head p  { color: var(--text-dim); font-size: 1.075rem; max-width: 62ch; margin: 0; }

/* --- 21. Utilities ------------------------------------------------------- */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.muted    { color: var(--text-dim); }
.center   { text-align: center; }
.mt-2     { margin-top: 2rem; }
.loading  { color: var(--text-faint); font-style: italic; }

/* Reveal-on-scroll — opt-in, degrades to visible without JS */
/*
 * Scroll reveal, with a failsafe.
 *
 * .reveal starts invisible and main.js adds .is-visible as each block scrolls
 * into view. That is fine while the script runs and catastrophic when it does
 * not: the homepage alone has thirteen of these, so a script that fails to
 * load, gets blocked, or throws leaves a page that is blank below the header.
 *
 * The animation below is the net. It does nothing for two seconds and then
 * reveals the element outright. main.js puts .js-reveal on <html> the moment
 * its observer starts, which cancels it — so in the normal case it never fires,
 * and in every abnormal case the content arrives a beat late rather than never.
 *
 * A duration of 0s is deliberate: this is a fallback, not a second animation,
 * and it should not compete with the transition above when both are live.
 */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
  animation: reveal-failsafe 0s linear 2s forwards;
}

@keyframes reveal-failsafe {
  to { opacity: 1; transform: none; }
}

/* The observer is running, so the net is not needed. */
.js-reveal .reveal { animation: none; }

.reveal.is-visible { opacity: 1; transform: none; animation: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .hero__art img { animation: none; }
}

/* --- 22. Print ----------------------------------------------------------- */

@media print {
  .site-header, .site-footer, .cta-band, .btn-row, .hero__art { display: none; }
  body { background: #fff; color: #000; }
}

/* --- 18b. Join the community --------------------------------------------- */

.join-band {
  background: var(--bg-alt);
  border-block: 1px solid var(--line-soft);
}

.join-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.join-grid > * { min-width: 0; }

@media (max-width: 820px) {
  .join-grid { grid-template-columns: 1fr; }
  .join-art  { display: none; }
}

.join-grid h2 { font-size: clamp(1.7rem, 4vw, 2.5rem); margin-bottom: 1rem; }
.join-grid > div > p { max-width: 56ch; font-size: 1.05rem; }

.join-list {
  list-style: none;
  padding: 0;
  margin: 1.75rem 0 2rem;
  display: grid;
  gap: .7rem;
}

.join-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .75rem;
  align-items: start;
  color: var(--text-dim);
  font-size: .98rem;
  margin: 0;
}

/* A small grass-block tick, drawn rather than an image. */
.join-list li::before {
  content: "";
  width: 10px;
  height: 10px;
  margin-top: .48rem;
  background: var(--grass);
  box-shadow: 0 0 10px rgba(102, 163, 68, .55);
  flex: none;
}

.btn--discord-cta {
  --btn-bg: #5865F2;
  --btn-edge: #4450C8;
  --btn-fg: #fff;
}

.join-art img {
  width: 100%;
  max-width: 220px;
  margin-inline: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .5));
}

/* --- 18c. Compact community band ------------------------------------------
   The homepage runs the full two-column pitch. Interior pages get this: same
   message, one row, so it reads as a footer note rather than a second hero.
   -------------------------------------------------------------------------- */

.join-strip {
  background: var(--bg-alt);
  border-block: 1px solid var(--line-soft);
  padding-block: clamp(2rem, 4vw, 2.75rem);
}

.join-strip__inner {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 4vw, 2.5rem);
  flex-wrap: wrap;
}

.join-strip__text { flex: 1 1 22rem; min-width: 0; }

.join-strip h2 {
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  margin: 0 0 .35rem;
}

.join-strip p {
  color: var(--text-dim);
  font-size: .98rem;
  margin: 0;
  max-width: 60ch;
}

.join-strip__action {
  display: flex;
  align-items: center;
  gap: .9rem;
  flex-wrap: wrap;
  flex: none;
}

@media (max-width: 640px) {
  .join-strip__action { width: 100%; }
}


/* --- 17. Announcements ------------------------------------------------------
   The public feed at /announcements. Each card is the site half of a record
   that also exists as a Discord embed, so the two deliberately carry the same
   accent colour — someone who saw it in Discord should recognise it here.
   ---------------------------------------------------------------------------- */

.announce-list {
  display: grid;
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.announce {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.6rem 1.4rem;
  overflow: hidden;
  min-width: 0;
}

/* The accent bar, keyed to the same three colours the Discord embed uses. */
.announce::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--grass);
}
.announce[data-colour="torch"]::before { background: var(--torch); }
.announce[data-colour="blood"]::before { background: var(--blood); }

.announce__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: .6rem;
}

.announce__head time {
  color: var(--text-faint);
  font-size: .82rem;
  margin-left: auto;
}

.announce__pin {
  font-family: var(--font-display);
  font-size: .64rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--grass-lit);
  background: rgba(102, 163, 68, .14);
  border-radius: 100px;
  padding: .22rem .55rem;
}

.announce h2 {
  font-size: 1.5rem;
  margin: 0 0 .9rem;
}
.announce h2 a {
  color: inherit;
  text-decoration: none;
}
.announce h2 a:hover { color: var(--grass-lit); }

.announce__image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  margin: 0 0 1.1rem;
}

.announce__body p  { margin: 0 0 .85rem; }
.announce__body ul { margin: 0 0 .85rem; }
.announce__body a  { color: var(--grass-lit); }
.announce__body code {
  background: var(--bg-alt);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: .1rem .35rem;
  font-size: .9em;
}

.announce__links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1.1rem 0 0;
}

.announce__by {
  margin: 1rem 0 0;
  color: var(--text-faint);
  font-size: .8rem;
}

/* An anchored announcement gets a moment of emphasis, so a link from Discord
   lands somewhere obvious rather than just scrolling. */
.announce:target {
  border-color: var(--grass);
  box-shadow: 0 0 0 3px rgba(102, 163, 68, .18);
}

@media (max-width: 600px) {
  .announce { padding: 1.25rem 1.1rem 1.1rem; }
  .announce h2 { font-size: 1.25rem; }
  .announce__head time { margin-left: 0; width: 100%; }
}


/* --- Announcements: the empty state ----------------------------------------
   Reached from the main navigation, so it is seen before anything has ever
   been posted. Centred and generous rather than a dim line in a wide panel.
   ---------------------------------------------------------------------------- */

.announce-empty {
  max-width: 34rem;
  margin: 3rem auto 0;
  padding: 3rem 1.75rem;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.announce-empty__mark {
  font-size: 2.5rem;
  line-height: 1;
  margin: 0 0 1rem;
  opacity: .55;          /* decorative, and aria-hidden in the markup */
}

.announce-empty h2 {
  font-size: 1.6rem;
  margin: 0 0 .85rem;
}

.announce-empty p {
  color: var(--text-dim);
  margin: 0 0 1rem;
}

.announce-empty .btn-row {
  justify-content: center;
  margin: 1.75rem 0 0;
}

.announce-empty__aside {
  margin: 1.75rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line-soft);
  font-size: .9rem;
}
.announce-empty__aside a { color: var(--grass-lit); }

@media (max-width: 560px) {
  .announce-empty { padding: 2.25rem 1.25rem; margin-top: 2rem; }
  .announce-empty h2 { font-size: 1.35rem; }
}


/* The community figures come from a five-minute cache, so the page says how
   old they are rather than implying they are live. */
.stat-asof {
  /* Sits outside .shell, like the full-bleed strip above it, so it needs its
     own gutter — without one it ran into the left edge of a phone screen. */
  margin: .6rem 0 0;
  padding-inline: var(--gutter);
  text-align: center;
  font-size: .78rem;
  color: var(--text-faint);
  font-style: italic;
}
.stat-asof:empty { display: none; }


/* --- Print -----------------------------------------------------------------
   Staff reference the Ten Commandments during disputes, and a printed copy is
   genuinely used. Strip the chrome, drop to ink on paper, and make links show
   where they go — a printed page cannot be clicked.
   ---------------------------------------------------------------------------- */

@media print {
  :root {
    --bg: #fff; --bg-alt: #fff; --panel: #fff; --panel-lit: #fff;
    --text: #000; --text-dim: #333; --text-faint: #555;
    --line: #bbb; --line-soft: #ddd;
  }

  body { background: #fff; color: #000; font-size: 11pt; }

  .site-header, .site-footer, .nav, .nav-toggle, .cta-band,
  .btn-row, .hero__art, .skip-link, .stat-strip, .stat-asof { display: none !important; }

  main { padding: 0 !important; }
  .shell { width: 100% !important; max-width: none !important; padding: 0 !important; }

  /*
   * Things a reader needs whole on one page: a commandment, a callout, a table
   * row. Not a whole codex entry — those run longer than half a page, and
   * keeping one together pushed every entry onto a fresh sheet, which printed
   * the codex on nine mostly empty pages.
   */
  .commandment, .announce, .callout, tr { break-inside: avoid; page-break-inside: avoid; }

  /* Search, the section menu and the Discord invite do nothing on paper. */
  .search-form, .codex-nav, .join-strip, .page-head::before { display: none !important; }
  .page-head { padding-block: 0 1rem; overflow: visible; }
  .codex-layout { display: block !important; }
  .codex-entry { margin: 0 0 1.75rem; padding: 0; }
  .section { padding-block: 1rem; }

  /* The callout labels are torch and blood on a dark page; on white they fade. */
  .callout { border-left: 3px solid #000; padding: .6rem .9rem; }
  .callout strong, .callout--danger strong { color: #000; }
  .eyebrow, th { color: #333 !important; }

  h1, h2, h3 { break-after: avoid; page-break-after: avoid; color: #000; }

  a { color: #000; text-decoration: underline; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; color: #555; }
  a[href^="#"]::after, a[href^="/"]::after { content: ""; }

  .panel, .callout { border: 1px solid #bbb; background: #fff; }
}


/* --- Public guides ---------------------------------------------------------
   The handbook's best writing, surfaced where search engines and Bedrock
   players can actually reach it. Long-form prose, so the measure is set for
   reading rather than for scanning.
   ---------------------------------------------------------------------------- */

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  color: var(--text-faint);
  margin-bottom: 1.5rem;
}
.crumbs a { color: var(--text-dim); text-decoration: none; }
.crumbs a:hover { color: var(--grass-lit); }
.crumbs [aria-current] { color: var(--text); }

.guide-body {
  max-width: 42rem;
  margin-top: 1.5rem;
}
.guide-body h2 {
  font-size: 1.45rem;
  margin: 2.25rem 0 .75rem;
}
.guide-body h3 { font-size: 1.1rem; margin: 1.75rem 0 .5rem; }
.guide-body p, .guide-body ul, .guide-body ol { margin: 0 0 1rem; }
.guide-body li + li { margin-top: .35rem; }
.guide-body a { color: var(--grass-lit); }
.guide-body code {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: .88em;
  background: var(--bg-alt);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: .1em .38em;
}

.guide-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.guide-card {
  display: block;
  padding: 1.25rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s;
  min-width: 0;
}
.guide-card:hover { border-color: var(--grass); }
.guide-card h2 { font-size: 1.1rem; margin: 0 0 .4rem; }
.guide-card p  { margin: 0; color: var(--text-dim); font-size: .88rem; }

.guide-group { margin: 2.5rem 0; }
.guide-group h2 { font-size: 1.3rem; margin: 0 0 .3rem; }
.guide-group h2 a { color: inherit; text-decoration: none; }
.guide-group h2 a:hover { color: var(--grass-lit); }

.guide-index {
  list-style: none;
  padding: 0;
  margin: .9rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr));
  gap: .2rem .9rem;
}
.guide-index a {
  display: inline-block;
  padding-block: .25rem;
  min-height: 24px;
  color: var(--text-dim);
  text-decoration: none;
}
.guide-index a:hover { color: var(--grass-lit); }

.guide-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin: 3rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.guide-nav__link {
  flex: 1 1 14rem;
  min-width: 0;
  padding: .9rem 1.1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
}
.guide-nav__link:hover { border-color: var(--grass); }
.guide-nav__link--next { text-align: right; }
.guide-nav__link span {
  display: block;
  font-size: .75rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .1em;
}
.guide-nav__link strong { display: block; margin-top: .2rem; }

.guide-cta {
  margin-top: 3rem;
  padding: 1.75rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--grass);
  border-radius: var(--radius);
}
.guide-cta h2 { margin: 0 0 .5rem; font-size: 1.25rem; }
.guide-cta p  { margin: 0 0 1rem; color: var(--text-dim); max-width: 40rem; }

@media (max-width: 560px) {
  .guide-nav__link--next { text-align: left; }
  .guide-cta { padding: 1.25rem; }
}


/* --- How to join -----------------------------------------------------------
   The page people are sent when they ask. The three facts they need are the
   biggest thing on it, because that is what someone is scanning for.
   ---------------------------------------------------------------------------- */

.join-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.join-card {
  padding: 1.25rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
}
.join-label,
.join-card h3 {
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 .5rem;
}
.join-card p { margin: 0; }
.join-label { margin: 0 0 .5rem !important; }

.join-value { margin: 0 0 .5rem !important; }
.join-value code {
  font-size: 1.2rem;
  font-family: var(--font-display);
  color: var(--grass-lit);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .4rem .7rem;
  display: inline-block;
  word-break: break-all;
}

.join-card--link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s;
}
.join-card--link:hover { border-color: var(--grass); }
.join-card--link h3 {
  font-size: 1.05rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  font-family: var(--font-display);
}
.join-card--link p { color: var(--text-dim); font-size: .9rem; }

.join-steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 1.5rem 0 2.5rem;
  max-width: 44rem;
}
.join-steps li {
  counter-increment: step;
  position: relative;
  padding-left: 3rem;
  margin-bottom: 1.5rem;
}
/* The number is the structure here — these really are sequential, and the
   order carries information the reader needs. */
.join-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -.1rem;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: .95rem;
  color: var(--bg);
  background: var(--grass);
  border-radius: 50%;
}
.join-steps h3 { margin: 0 0 .3rem; font-size: 1.1rem; }
.join-steps p  { margin: 0; color: var(--text-dim); }

@media (max-width: 480px) {
  .join-steps li { padding-left: 2.5rem; }
  .join-steps li::before { width: 1.7rem; height: 1.7rem; font-size: .82rem; }
}


.news-item__more {
  display: inline-block;
  margin-top: .4rem;
  padding-block: .2rem;
  min-height: 24px;
  font-size: .85rem;
  color: var(--grass-lit);
  text-decoration: none;
}
.news-item__more:hover { text-decoration: underline; }


/* Shown only once there is enough observed time for the figure to mean
   something — see uptime_percent() in api/server-status.php. */
.server-bar__uptime {
  display: block;
  margin-top: .3rem;
  font-size: .76rem;
  color: var(--text-faint);
}


/* --- A single nation -------------------------------------------------------- */

.nation-head {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
  margin: .5rem 0 1.5rem;
}
.nation-head h1 { margin: 0 0 .25rem; }
.nation-head .lede { margin: 0; }

.crest-dot--lg {
  width: 3.5rem;
  height: 3.5rem;
  font-size: 1.5rem;
  flex: 0 0 auto;
}

.nation-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(10rem, 100%), 1fr));
  gap: 1rem;
  margin: 0 0 2rem;
  padding: 1.25rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.nation-facts div { min-width: 0; }
.nation-facts dt {
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: .2rem;
}
.nation-facts dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.nation-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1.5rem 0 0; }
.nation-tags .tag { margin-left: 0; }

/* The registry cards now link out, so the heading has to carry a link style. */
.nation__head h2 a { color: inherit; text-decoration: none; }
.nation__head h2 a:hover { color: var(--grass-lit); }

@media (max-width: 560px) {
  .nation-head { flex-direction: column; gap: .75rem; }
}

/* ==========================================================================
   Changelog
   A two-column entry: the date in a narrow rail on the left, the changes on the
   right. The rail collapses above the text on narrow screens rather than
   squeezing — a date is short enough that a column for it stops earning its
   keep well before the content does.
   ========================================================================== */

.changelog-month {
  margin-top: 3rem;
}

.changelog-month__label {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 1.5rem;
}

.changelog-entry {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 0 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.changelog-entry:last-child {
  border-bottom: 0;
}

.changelog-entry__when time {
  font-family: var(--font-display);
  font-size: .8rem;
  color: var(--text-faint);
  letter-spacing: .04em;
  /* Aligns the date with the first line of the heading beside it. */
  display: block;
  padding-top: .3rem;
}

.changelog-entry__what h3 {
  font-size: 1.05rem;
  margin: 0 0 .5rem;
}

.changelog-entry__what h3 a {
  color: var(--text);
  text-decoration: none;
}

.changelog-entry__what h3 a:hover,
.changelog-entry__what h3 a:focus-visible {
  color: var(--grass-lit);
  text-decoration: underline;
}

.changelog-entry__note {
  color: var(--text-dim);
  margin-bottom: .75rem;
}

.changelog-entry__note p {
  margin: 0 0 .5rem;
}

.changelog-changes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .5rem;
}

.changelog-changes li {
  display: grid;
  /* The label column is sized to the longest label ("Removed") so the change
     text starts at the same x on every row. A flex row with a gap would ragged
     it, which makes a scannable list much less scannable. */
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: .75rem;
  align-items: baseline;
}

.change-kind {
  font-family: var(--font-display);
  font-size: .62rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: center;
  padding: .28rem .3rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-dim);
}

/* Colour carries meaning here, so it is never the only carrier: the word is
   always present and says the same thing. */
.change-kind[data-kind="added"]   { color: var(--grass-lit); border-color: #3F5C2E; }
.change-kind[data-kind="fixed"]   { color: var(--lapis);     border-color: #2F4470; }
.change-kind[data-kind="removed"] { color: var(--blood-lit); border-color: #6A2E22; }
.change-kind[data-kind="changed"] { color: var(--torch);     border-color: #6B4A1D; }

.change-text {
  color: var(--text);
}

.changelog-foot {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line-soft);
}

@media (max-width: 40rem) {
  .changelog-entry {
    grid-template-columns: minmax(0, 1fr);
    gap: .4rem;
  }

  .changelog-entry__when time {
    padding-top: 0;
  }

  .changelog-changes li {
    grid-template-columns: minmax(0, 1fr);
    gap: .15rem;
  }

  .change-kind {
    justify-self: start;
    padding-inline: .5rem;
  }
}

/* ==========================================================================
   Search
   ========================================================================== */

.search-form {
  display: flex;
  gap: .5rem;
  margin: 1.5rem 0 2rem;
}

.search-form input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
}

.search-form--lg input[type="search"] {
  font-size: 1.05rem;
  padding-block: .8rem;
}

/* The inline form that sits at the top of the long reference pages. */
.search-inline {
  margin: 0 0 2.5rem;
  max-width: 34rem;
}

.search-note {
  color: var(--text-dim);
  border-left: 2px solid var(--torch);
  padding-left: .85rem;
  margin-bottom: 1.5rem;
}

.search-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.75rem;
}

.search-result__where {
  font-family: var(--font-display);
  font-size: .62rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 .3rem;
}

.search-result h2 {
  font-size: 1.05rem;
  margin: 0 0 .4rem;
}

.search-result h2 a {
  color: var(--grass-lit);
  text-decoration: none;
}

.search-result h2 a:hover,
.search-result h2 a:focus-visible {
  text-decoration: underline;
}

.search-result__snippet {
  color: var(--text-dim);
  margin: 0 0 .3rem;
}

/* The match itself. Underlined as well as tinted: on a dark ground a colour
   shift alone is easy to miss, and this is the one word the reader came for. */
.search-result__snippet mark {
  background: none;
  color: var(--torch);
  text-decoration: underline;
  text-underline-offset: .15em;
  font-weight: 600;
}

.search-result__url {
  font-size: .78rem;
  color: var(--text-faint);
  margin: 0;
  word-break: break-word;
}

/* ==========================================================================
   Community — "the world right now"
   ========================================================================== */

.world-now {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 2rem;
}

.world-now__item {
  background: var(--panel);
  padding: 1.25rem 1.35rem;
}

.world-now__label {
  font-family: var(--font-display);
  font-size: .6rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 .5rem;
}

.world-now__value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1.1;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: .5rem;
  /* Figures that change on refresh must not shift the row they sit in. */
  font-variant-numeric: tabular-nums;
}

.world-now__note {
  color: var(--text-dim);
  font-size: .82rem;
  margin: .4rem 0 0;
}

/* The roll of nations: compact, one line each, ordered as the registry is. */
.nation-roll {
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
  display: grid;
  gap: .5rem;
}

.nation-roll li {
  display: flex;
  flex-wrap: wrap;          /* the label drops below rather than crushing the name */
  align-items: center;
  gap: .25rem .75rem;
  padding: .6rem .85rem;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

.nation-roll a {
  display: flex;
  align-items: center;
  gap: .75rem;
  /*
   * A floor under the name's share of the row. Without it a long label beside
   * it ("carrying the line since September 2026") squeezed a three-word name
   * into one word per line on a phone.
   */
  flex: 1 1 12rem;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.nation-roll a:hover .nation-roll__name,
.nation-roll a:focus-visible .nation-roll__name {
  color: var(--grass-lit);
  text-decoration: underline;
}

.nation-roll__sigil {
  font-family: var(--font-symbol);
  width: 1.9rem;
  height: 1.9rem;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--crest, var(--grass)) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--crest, var(--grass)) 55%, transparent);
}

.nation-roll__name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* The merged announcements-and-changelog timeline. */
.activity {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: .1rem;
}

.activity__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem .75rem;
  padding: .75rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.activity__item:last-child {
  border-bottom: 0;
}

.activity__item time {
  font-family: var(--font-display);
  font-size: .75rem;
  color: var(--text-faint);
  flex: 0 0 4.5rem;
}

.activity__kind {
  font-family: var(--font-display);
  font-size: .58rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-faint);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .2rem .45rem;
}

.activity__item > a {
  color: var(--text);
  font-weight: 600;
}

@media (max-width: 34rem) {
  .activity__item time {
    flex-basis: auto;
  }
}

/* The 404's search box. Centred like everything else on that page, and capped
   so it does not stretch to the full width of a wide screen. */
.lost__search {
  margin: 1.75rem auto;
  max-width: 26rem;
}

/* ==========================================================================
   Character pages
   ========================================================================== */

.character-blurb {
  margin: 2rem 0;
  font-size: 1.05rem;
}

.character-blurb p {
  margin: 0 0 1rem;
}

.character-blurb blockquote {
  margin: 1.25rem 0;
  padding-left: 1rem;
  border-left: 2px solid var(--line);
  color: var(--text-dim);
}

.character-foot {
  padding-top: 1.25rem;
  border-top: 1px solid var(--line-soft);
  margin-bottom: 2rem;
}

/* ---------------------------------------------------------------------------
   Character pages: skin, bio, logbook
   --------------------------------------------------------------------------- */

/*
 * The skin sits beside the blurb on a wide screen and above it on a narrow
 * one. Grid rather than float so the blurb cannot wrap raggedly around the
 * image at the awkward widths in between.
 */
.character-top--skin {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: clamp(1.25rem, 4vw, 2.25rem);
  align-items: start;
}

.character-skin {
  width: 128px;
  height: auto;
  max-width: 100%;
  /* Minecraft skins are pixel art; smoothing them is the one thing not to do. */
  image-rendering: pixelated;
  align-self: start;
}

.character-top--skin .character-blurb {
  margin-top: 0;
}

@media (max-width: 560px) {
  .character-top--skin {
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
  }
}

.character-bio {
  margin: 2rem 0;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line-soft);
  color: var(--text-dim);
}

.character-bio p { margin: 0 0 1rem; }
.character-bio h2,
.character-bio h3 { color: var(--text); }

.logbook {
  margin: 2.5rem 0;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line-soft);
}

.logbook > h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: .04em;
  color: var(--text-dim);
  margin: 0 0 1.5rem;
}

.logbook-entry {
  margin: 0 0 2rem;
  padding-left: 1rem;
  border-left: 2px solid var(--line);
}

.logbook-entry:last-child { margin-bottom: 0; }

.logbook-entry h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem .75rem;
  margin: 0 0 .5rem;
  font-size: 1rem;
}

.logbook-entry h3 time { font-weight: 400; }
.logbook-entry p { margin: 0 0 .75rem; }
.logbook-entry > :last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------------------
   Wiki
   --------------------------------------------------------------------------- */

.wiki-index {
  list-style: none;
  margin: 2rem 0;
  padding: 0;
}

.wiki-index li {
  padding: .9rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.wiki-index li:last-child { border-bottom: 0; }

.wiki-index a {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: .02em;
}

/* The one-line summary sits under the title rather than beside it, so a long
   one wraps into its own block instead of shoving the link around. */
.wiki-index span {
  display: block;
  margin-top: .25rem;
  font-size: .92rem;
}

.wiki-body {
  margin: 2rem 0;
  font-size: 1.05rem;
}

.wiki-body p { margin: 0 0 1.1rem; }

.wiki-body h2,
.wiki-body h3 {
  font-family: var(--font-display);
  letter-spacing: .02em;
  margin: 2rem 0 .75rem;
}

.wiki-body h2 { font-size: 1.25rem; }
.wiki-body h3 { font-size: 1.05rem; }

.wiki-body ul,
.wiki-body ol { margin: 0 0 1.1rem; padding-left: 1.25rem; }
.wiki-body li { margin-bottom: .4rem; }

.wiki-body blockquote {
  margin: 1.25rem 0;
  padding-left: 1rem;
  border-left: 2px solid var(--line);
  color: var(--text-dim);
}

/* Long words and pasted URLs must not push the column sideways. */
.wiki-body { overflow-wrap: break-word; }

.wiki-body pre {
  overflow-x: auto;
  padding: .85rem 1rem;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

.wiki-foot {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line-soft);
}

/*
 * A character's face in a roll of names, where the diamond sigil would
 * otherwise be. Sized to match it so a list of players with skins and players
 * without does not sit on two different baselines.
 */
.nation-roll__face {
  /* The same box as the ◆ sigil, so a mixed list keeps one left edge for names. */
  width: 1.9rem;
  height: 1.9rem;
  background: var(--panel-lit);   /* never an empty gap while the skin loads */
  flex: 0 0 auto;
  image-rendering: pixelated;
  border-radius: 2px;
}

/* ---------------------------------------------------------------------------
   The record: /fallen, memorials, and house lines
   --------------------------------------------------------------------------- */

.fallen-empty {
  margin: 2rem 0;
  padding: 1.5rem 1.25rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.fallen-empty p { margin: 0 0 .5rem; }
.fallen-empty p:last-child { margin: 0; }

.fallen-list {
  list-style: none;
  margin: 2rem 0;
  padding: 0;
}

.fallen-list li { border-bottom: 1px solid var(--line-soft); }
.fallen-list li:last-child { border-bottom: 0; }

.fallen-list a {
  display: grid;
  gap: .2rem;
  padding: 1rem 0;
  color: inherit;
  text-decoration: none;
}

.fallen-list a:hover .fallen-list__name,
.fallen-list a:focus-visible .fallen-list__name { color: var(--blood-lit); }

.fallen-list__name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: .02em;
  color: var(--text);
}

.fallen-list__name::before {
  content: "† ";
  color: var(--blood-lit);
}

.fallen-list__meta { font-size: .9rem; color: var(--text-dim); }
.fallen-list__how  { font-size: .92rem; font-style: italic; color: var(--text-faint); }

.fallen-houses__head {
  margin: 2.5rem 0 .75rem;
  font-size: 1rem;
  color: var(--text-dim);
}

.fallen-houses {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  margin: 0 0 2rem;
}

.fallen-name::before {
  content: "† ";
  color: var(--blood-lit);
}

.fallen-meta { margin: -.25rem 0 1.25rem; color: var(--text-dim); }

.fallen-how {
  margin: 0 0 1.5rem;
  font-size: 1.1rem;
  font-style: italic;
  color: var(--text-dim);
}

.fallen-epitaph {
  margin: 1.5rem 0;
  padding: 1.1rem 1.25rem;
  border-left: 2px solid var(--blood);
  background: var(--panel);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 1.05rem;
  overflow-wrap: break-word;
}
.fallen-epitaph > :first-child { margin-top: 0; }
.fallen-epitaph > :last-child  { margin-bottom: 0; }

.fallen-heir { margin: 1.5rem 0; }

.fallen-retired {
  margin: 2.5rem 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-soft);
}
.fallen-retired > h2 { margin: 0 0 .25rem; font-size: 1.1rem; }

/* A house, first to last. The dead marked the way genealogies mark them. */
.house-line {
  list-style: none;
  margin: 2rem 0;
  padding: 0;
  border-left: 2px solid var(--line);
}

.house-line li {
  position: relative;
  display: grid;
  gap: .15rem;
  padding: .75rem 0 .75rem 1.25rem;
}

.house-line li::before {
  position: absolute;
  left: -.45rem;
  top: .85rem;
  width: .8rem;
  text-align: center;
  line-height: 1;
  background: var(--bg);
}

.house-line .is-fallen::before { content: "†"; color: var(--blood-lit); }
.house-line .is-living::before { content: "●"; color: var(--grass-lit); font-size: .7rem; top: 1.05rem; }

.house-line a { font-family: var(--font-display); letter-spacing: .02em; }
.house-line__how { font-size: .9rem; font-style: italic; color: var(--text-faint); }

.character-lineage { margin: -.5rem 0 1.5rem; }

/* ---------------------------------------------------------------------------
   The chronicle
   --------------------------------------------------------------------------- */

.chronicle-month { margin: 2.25rem 0 0; }

.chronicle-month > h2 {
  margin: 0 0 .75rem;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: .04em;
  color: var(--text-dim);
}

.chronicle {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--line);
}

.chronicle__item {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
  gap: .25rem;
  margin-left: -.85rem;
  padding: .55rem 0;
}

.chronicle__glyph {
  width: 1.6rem;
  text-align: center;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text-dim);
}

.chronicle__item[data-kind="death"] .chronicle__glyph   { color: var(--blood-lit); }
.chronicle__item[data-kind="nation"] .chronicle__glyph  { color: var(--torch); }
.chronicle__item[data-kind="arrival"] .chronicle__glyph { color: var(--grass-lit); }

.chronicle__item time {
  display: inline-block;
  min-width: 3.4rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-faint);
  font-size: .9rem;
}

.chronicle__detail {
  display: block;
  font-size: .9rem;
  color: var(--text-dim);
}

/* The apply page, signed out: joining the Discord is a step, not a footnote. */
.apply-join {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .75rem;
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
}

/* ---------------------------------------------------------------------------
   /status
   --------------------------------------------------------------------------- */
.status-now::before {
  content: "";
  display: inline-block;
  width: .55em; height: .55em;
  margin-right: .45em;
  border-radius: 50%;
  vertical-align: .12em;
  background: var(--text-faint);
}
.status-now--online::before  { background: var(--grass-lit); box-shadow: 0 0 .6em var(--grass); }
.status-now--offline::before { background: var(--blood-lit); }

.status-issues {
  margin: 1.5rem 0;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--torch);
  border-radius: var(--radius);
  background: var(--panel);
}
.status-issues h2 { margin: 0 0 .4rem; font-size: 1rem; }
.status-issues ul { margin: 0; padding-left: 1.1rem; }

.status-figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1px;
  margin: 1rem 0 .6rem;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}
.status-figures > div { background: var(--bg); padding: 1rem; }
.status-figures dt { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); }
.status-figures dd { margin: .3rem 0 0; font-family: var(--font-display); font-size: 1.9rem; color: var(--grass); font-variant-numeric: tabular-nums; }

.status-outages { list-style: none; margin: 1rem 0 .5rem; padding: 0; }
.status-outages li {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem 1rem;
  padding: .6rem 0; border-bottom: 1px solid var(--line-soft);
  font-variant-numeric: tabular-nums;
}
.status-outages time { color: var(--text-dim); }
