/* SF Infinity — site stylesheet.
   Rules for editing are in docs/STYLE.md.

   The colours, fonts, corner radius and logo height below are only the
   fallback. The live values come from /theme.css, which the site generates
   from Staff > Theme and loads after this file. Every rule here reads a custom
   property, never a literal colour, so a theme change reaches every component.
   The only literals are neutral black/white scrims and glass, which every
   preset needs and no preset should recolour.

   No web fonts (the CSP declares no font-src), no inline styles (style-src has
   no 'unsafe-inline'), no icon fonts. Icons are inline SVG coloured by
   currentColor.

   The look: deep violet-black surfaces, gold hairlines, one violet accent for
   action and one gold accent for detail. Elevation is drawn with layered
   gradients and inset highlights rather than flat borders, and type carries
   the hierarchy. Everything degrades to one column and plain blocks when the
   extra weight is not supported. */

:root {
  --bg: #f4f0fa; --bg-2: #fdfbff; --bg-3: #e8e0f4; --rule: #d3c6e4;
  --ink: #1c1226; --text: #3b3049; --muted: #6c607c; --link: #8a5a05;
  --accent: #9c56c0; --accent-2: #8a5c08; --accent-hover: #8f4bb4; --on-accent: #ffffff;
  --header: #171022; --header-ink: #f6f1fc; --footer: #171022;
  --good: #256b3c; --bad: #9b2d20; --warn: #7a550f;
  --accent-soft: rgba(156, 86, 192, .22);
  --shade: rgba(24, 12, 36, .16);

  /* Derived from the tokens above, so they follow any preset. */
  --hair: color-mix(in srgb, var(--rule) 62%, transparent);
  --hair-strong: color-mix(in srgb, var(--rule) 90%, transparent);
  --sheen: color-mix(in srgb, #fff 8%, transparent);
  --sheen-soft: color-mix(in srgb, #fff 4%, transparent);
  --accent-glow: color-mix(in srgb, var(--accent) 34%, transparent);
  --gold-glow: color-mix(in srgb, var(--accent-2) 28%, transparent);
  --panel-sheen: linear-gradient(180deg, var(--sheen-soft) 0%, transparent 45%);
  --lift: 0 24px 50px -32px rgba(20, 8, 32, .55);

  --display: Bahnschrift, "DIN Alternate", "Roboto Condensed", "Arial Narrow", "Segoe UI", system-ui, sans-serif;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 8px;
  --radius-btn: 6px;
  --logo-h: 40px;
  --hero-h: 78vh;
  --wrap: 78rem;
  --discord: #5865f2;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0815; --bg-2: #190f22; --bg-3: #241634; --rule: #3a2749;
    --ink: #f4effa; --text: #d5cade; --muted: #9d90ae; --link: #f0b21f;
    --accent: #c04df0; --accent-2: #f0b21f; --accent-hover: #d071f5; --on-accent: #150420;
    --header: #090410; --header-ink: #f4effa; --footer: #090410;
    --good: #5fd08a; --bad: #f2705f; --warn: #e8a22c;
    --accent-soft: rgba(192, 77, 240, .16);
    --shade: rgba(0, 0, 0, .45);
    --lift: 0 30px 60px -30px rgba(0, 0, 0, .9);
    color-scheme: dark;
  }
}

/* Written twice on purpose: a media query and a plain selector cannot share a rule. */
:root[data-theme="dark"] {
  --bg: #0f0815; --bg-2: #190f22; --bg-3: #241634; --rule: #3a2749;
  --ink: #f4effa; --text: #d5cade; --muted: #9d90ae; --link: #f0b21f;
  --accent: #c04df0; --accent-2: #f0b21f; --accent-hover: #d071f5; --on-accent: #150420;
  --header: #090410; --header-ink: #f4effa; --footer: #090410;
  --good: #5fd08a; --bad: #f2705f; --warn: #e8a22c;
  --accent-soft: rgba(192, 77, 240, .16);
  --shade: rgba(0, 0, 0, .45);
  --lift: 0 30px 60px -30px rgba(0, 0, 0, .9);
  color-scheme: dark;
}

/* ── Base ─────────────────────────────────────────────────────────────────── */

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

html { background: var(--bg); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font: 1rem/1.62 var(--sans);
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 640px at 82% -12%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 62%),
    radial-gradient(1000px 560px at 4% 106%, color-mix(in srgb, var(--accent-2) 8%, transparent), transparent 58%);
  background-repeat: no-repeat;
}
#main-wrap { flex: 1 0 auto; }

img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 38%, transparent); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
* { scrollbar-color: color-mix(in srgb, var(--accent) 45%, transparent) transparent; scrollbar-width: thin; }

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; z-index: 100; background: var(--bg); color: var(--ink); padding: .4rem .7rem; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-inline: clamp(1rem, 3vw, 2rem); }

/* ── Type ─────────────────────────────────────────────────────────────────── */

h1, h2, h3, h4 { color: var(--ink); line-height: 1.12; margin: 0 0 .65rem; }
h1, h2, .display, .eyebrow, .btn, .nav-main, .brand-name, .aside-title, .tabs, th, legend, .step-n {
  font-family: var(--display);
}
h1 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); font-weight: 700; letter-spacing: .012em; text-transform: uppercase; }
h2 { font-size: clamp(1.35rem, 2.3vw, 1.8rem); font-weight: 700; letter-spacing: .014em; margin-top: 2.2rem; }
h3 { font-size: 1.12rem; font-weight: 600; margin-top: 1.6rem; }
h4 { font-size: .98rem; font-weight: 600; }
main > h2:first-child, .panel > h2:first-child { margin-top: 0; }
.display { text-transform: uppercase; letter-spacing: .02em; }

p { margin: 0 0 1rem; }
ul, ol { padding-left: 1.3rem; margin: 0 0 1.1rem; }
li { margin: .3rem 0; }
strong { color: var(--ink); }
hr { border: 0; border-top: 1px solid var(--hair); margin: 1.8rem 0; }
code, pre { font-family: var(--mono); font-size: .88em; }
code { background: var(--bg-3); color: var(--ink); padding: .1em .38em; border-radius: 4px; overflow-wrap: anywhere; }
pre { background: var(--bg-3); border: 1px solid var(--hair); border-radius: var(--radius); padding: 1rem 1.15rem; overflow-x: auto; }
pre code { background: none; padding: 0; }

.note { color: var(--muted); font-size: .93rem; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--muted); max-width: 46rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  margin: 0 0 .7rem;
  color: var(--accent-2);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: ""; width: 1.6rem; height: 2px; flex: none;
  background: linear-gradient(90deg, var(--accent-2), transparent);
}
.empty { padding: 2.5rem 0; color: var(--muted); text-align: center; }

/* ── Announcement strip ───────────────────────────────────────────────────── */

.announce {
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 65%, var(--accent-2)));
  color: var(--on-accent); font-size: .9rem; font-weight: 600; text-align: center;
  letter-spacing: .02em;
}
.announce .wrap { padding-block: .5rem; }
.announce a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: .45rem; }
.announce a:hover { text-decoration: underline; }
.announce .ico { width: 16px; height: 16px; fill: currentColor; }
.announce-bad { background: var(--bad); color: #fff; }
.announce-good { background: var(--good); color: #fff; }

/* ── Utility strip ────────────────────────────────────────────────────────── */

.util {
  background: color-mix(in srgb, var(--header) 78%, #000);
  color: var(--header-ink);
  font-size: .84rem;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.util-bar { display: flex; align-items: center; gap: 1rem; min-height: 2.5rem; }
.util a, .util button { color: inherit; }
.util-status { display: inline-flex; align-items: center; gap: .45rem; text-decoration: none; opacity: .82; white-space: nowrap; letter-spacing: .02em; }
.util-status:hover { opacity: 1; }
.dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.is-up .dot { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 26%, transparent); }
.is-down .dot { background: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 26%, transparent); }
.util-social { display: flex; gap: .1rem; margin-left: .25rem; }
.util-social a { display: inline-flex; padding: .32rem; border-radius: 5px; opacity: .7; transition: opacity .15s, background-color .15s; }
.util-social a:hover { opacity: 1; background: rgba(255, 255, 255, .09); }
.util-social .ico { width: 16px; height: 16px; fill: currentColor; }
.util-account { margin-left: auto; display: flex; align-items: center; gap: .25rem; }
.util-account form { margin: 0; display: inline; }
.util-link, .util-btn {
  display: inline-flex; align-items: center; gap: .38rem;
  padding: .3rem .62rem;
  background: none; border: 0; border-radius: 5px;
  font: 600 .84rem/1.2 var(--sans);
  text-decoration: none; cursor: pointer; opacity: .82;
  max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: opacity .15s, background-color .15s;
}
.util-link:hover, .util-btn:hover, .util-link.is-current { opacity: 1; background: rgba(255, 255, 255, .09); }
.util-link .ico { width: 15px; height: 15px; fill: currentColor; flex: none; }
.util-link-strong { background: var(--accent); color: var(--on-accent) !important; opacity: 1; box-shadow: 0 6px 16px -8px var(--accent-glow); }
.util-link-strong:hover { background: var(--accent-hover); }

/* Language picker: EN | PH, a two-segment switch in the utility strip. */
.lang-pick { display: inline-flex; align-items: center; margin-right: .4rem; border: 1px solid rgba(255, 255, 255, .16); border-radius: 5px; overflow: hidden; }
.lang-opt {
  display: inline-flex; align-items: center; padding: .24rem .52rem;
  font: 700 .74rem/1.2 var(--sans); letter-spacing: .08em;
  text-decoration: none; opacity: .65;
  transition: opacity .15s, background-color .15s;
}
.lang-opt + .lang-opt { border-left: 1px solid rgba(255, 255, 255, .16); }
.lang-opt:hover { opacity: 1; background: rgba(255, 255, 255, .09); }
.lang-opt.is-current { opacity: 1; background: var(--accent); color: var(--on-accent) !important; }

.theme-toggle svg { fill: currentColor; }
.theme-toggle .i-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
}
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="light"] .theme-toggle .i-moon { display: block; }
:root[data-theme="light"] .theme-toggle .i-sun { display: none; }
[data-theme-locked] .theme-toggle { display: none; }

/* ── Main header ──────────────────────────────────────────────────────────── */

.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  color: var(--header-ink);
  background:
    radial-gradient(60rem 14rem at 15% 130%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    var(--header);
  box-shadow: 0 20px 44px -30px rgba(0, 0, 0, .95);
}
.site-head::after {
  content: ""; display: block; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent) 18%, var(--accent-2) 55%, transparent 92%);
  opacity: .75;
}
.head-bar { display: flex; align-items: center; gap: 1.75rem; min-height: 4.5rem; }

.brand { display: inline-flex; align-items: center; gap: .7rem; color: inherit; text-decoration: none; flex: none; }
.brand-logo { height: var(--logo-h); width: auto; max-width: 16rem; object-fit: contain; display: block; }
.brand-mark {
  width: 2.3rem; height: 2.3rem; display: grid; place-items: center;
  background: linear-gradient(160deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000));
  color: var(--on-accent);
  clip-path: polygon(0 0, 100% 0, 100% 70%, 70% 100%, 0 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}
.brand-mark .ico { width: 20px; height: 20px; fill: currentColor; }
.brand-mark-img { height: var(--logo-h); width: auto; display: block; flex: none; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .55)); }
.head-bar .brand-mark-img { margin-block: -.4rem; height: calc(var(--logo-h) * 1.3); }
.brand-name { font-size: 1.18rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; }

.nav-main { display: flex; align-items: stretch; gap: .1rem; flex: 1; min-width: 0; align-self: stretch; }
.nav-main a {
  position: relative;
  display: flex; align-items: center;
  padding: 0 .9rem;
  color: inherit; opacity: .74;
  font-size: .95rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap;
  transition: opacity .18s, color .18s;
}
.nav-main a::after {
  content: ""; position: absolute; left: .9rem; right: .9rem; bottom: .8rem; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0); transform-origin: left center; transition: transform .24s ease;
}
.nav-main a:hover { opacity: 1; }
.nav-main a:hover::after { transform: scaleX(1); }
.nav-main a[aria-current] { opacity: 1; color: #fff; }
.nav-main a[aria-current]::after { transform: scaleX(1); }
.nav-cta-mobile { display: none !important; }

.btn-cta { flex: none; }
.nav-toggle {
  display: none; margin-left: auto;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .18); border-radius: var(--radius-btn);
  color: inherit; padding: .45rem; cursor: pointer;
}
.nav-toggle .ico { width: 22px; height: 22px; fill: currentColor; display: block; }
.nav-toggle .i-close { display: none; }
.site-head.is-open .nav-toggle .i-open { display: none; }
.site-head.is-open .nav-toggle .i-close { display: block; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .68rem 1.25rem;
  border: 1px solid transparent; border-radius: var(--radius-btn);
  font-size: .96rem; font-weight: 700; letter-spacing: .1em; line-height: 1.1;
  text-transform: uppercase; text-align: center; text-decoration: none;
  cursor: pointer;
  transition: background-color .16s, border-color .16s, color .16s, transform .16s, box-shadow .16s;
}
.btn .ico, .btn svg { width: 17px; height: 17px; fill: currentColor; flex: none; }
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn small { font-family: var(--sans); font-weight: 600; text-transform: none; letter-spacing: 0; opacity: .78; }

.btn-accent {
  background: linear-gradient(180deg, color-mix(in srgb, #fff 14%, var(--accent)), var(--accent));
  color: var(--on-accent);
  box-shadow: 0 16px 30px -18px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.btn-accent:hover {
  background: linear-gradient(180deg, color-mix(in srgb, #fff 20%, var(--accent-hover)), var(--accent-hover));
  color: var(--on-accent);
  transform: translateY(-1px);
  box-shadow: 0 20px 38px -18px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, .34);
}
.btn-dark {
  background: linear-gradient(180deg, color-mix(in srgb, #fff 4%, var(--bg-2)), var(--bg-2));
  color: var(--ink); border-color: var(--hair-strong);
  box-shadow: inset 0 1px 0 var(--sheen-soft);
}
.btn-dark:hover { border-color: var(--accent); color: var(--ink); }
.btn-ghost {
  background: rgba(255, 255, 255, .07); color: #fff; border-color: rgba(255, 255, 255, .32);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover { background: rgba(255, 255, 255, .14); border-color: #fff; color: #fff; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); color: #fff; }
.btn-discord { background: var(--discord); color: #fff; }
.btn-discord:hover { filter: brightness(1.1); color: #fff; }
.btn-small { padding: .36rem .8rem; font-size: .78rem; }
.btn-lg { padding: .95rem 1.7rem; font-size: 1.04rem; }
.btn-block { width: 100%; }
.btn-accent.btn-lg, .btn-cta { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%); }

.buttons { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.4rem 0 1.6rem; align-items: center; }
.buttons-tight { margin: .8rem 0; }
.buttons form { margin: 0; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: clamp(30rem, var(--hero-h), 58rem);
  color: #fff;
  background: var(--header);
  overflow: hidden;
  isolation: isolate;
}
.hero-track { position: absolute; inset: 0; }
.hero-slide {
  position: absolute; inset: 0;
  display: flex; align-items: center;
  opacity: 0; visibility: hidden;
  transition: opacity .9s ease, visibility 0s linear .9s;
}
.hero-slide.is-active { opacity: 1; visibility: visible; transition: opacity .9s ease; }
.hero-static { display: flex; align-items: center; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 65% center; z-index: -2; }
.hero-slide.is-active .hero-bg { animation: hero-drift 18s ease-out both; }
@keyframes hero-drift { from { transform: scale(1.07); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .hero-slide, .hero-slide.is-active { transition: none; }
  .hero-slide.is-active .hero-bg { animation: none; }
}
.hero-scrim {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(96deg, color-mix(in srgb, var(--header) 94%, transparent) 0%, color-mix(in srgb, var(--header) 62%, transparent) 42%, rgba(0, 0, 0, .1) 78%),
    linear-gradient(0deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 55%, transparent) 4%, transparent 20%),
    radial-gradient(70% 90% at 20% 50%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
}
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent-2) 55%, transparent), transparent);
}
.hero-logo {
  display: block;
  height: clamp(4.25rem, 8vw, 7rem);
  width: auto;
  margin: 0 0 1.4rem;
  filter: drop-shadow(0 10px 26px rgba(0, 0, 0, .6)) drop-shadow(0 0 22px color-mix(in srgb, var(--accent) 22%, transparent));
}
.hero-copy { position: relative; padding-block: clamp(3.5rem, 8vw, 6rem) clamp(6rem, 12vw, 9rem); max-width: 54rem; }
.hero-copy h1, .hero-copy h2 {
  color: #fff;
  font-size: clamp(2.6rem, 6.2vw, 5rem);
  font-weight: 800;
  line-height: .94;
  letter-spacing: -.005em;
  text-transform: uppercase;
  max-width: 16ch;
  margin: 0 0 1.15rem;
  text-shadow: 0 2px 40px rgba(0, 0, 0, .45), 0 1px 0 rgba(0, 0, 0, .3);
}
.hero-copy .eyebrow { color: var(--accent-2); }
.hero-sub { max-width: 40rem; font-size: clamp(1.04rem, 1.5vw, 1.24rem); color: rgba(255, 255, 255, .84); margin-bottom: .6rem; line-height: 1.6; }
.hero-dots { position: absolute; left: 0; right: 0; bottom: 5.5rem; display: flex; gap: .45rem; }
.hero-dot {
  width: 2.6rem; height: 3px; padding: 0; border: 0; cursor: pointer; border-radius: 2px;
  background: rgba(255, 255, 255, .28);
  transition: background-color .2s, width .2s;
}
.hero-dot:hover { background: rgba(255, 255, 255, .6); }
.hero-dot.is-active { width: 3.6rem; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }

/* ── Quick links ──────────────────────────────────────────────────────────── */

.quick {
  position: relative; z-index: 5;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem;
  margin-top: -4rem;
}
.quick-card {
  display: flex; align-items: center; gap: .95rem;
  padding: 1.15rem 1.2rem;
  background: color-mix(in srgb, var(--bg-2) 86%, transparent);
  border: 1px solid var(--hair);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--lift), inset 0 1px 0 var(--sheen);
  backdrop-filter: blur(16px) saturate(130%);
  color: var(--text); text-decoration: none;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.quick-card:hover {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--hair));
  transform: translateY(-3px);
  box-shadow: 0 30px 54px -30px var(--accent-glow), inset 0 1px 0 var(--sheen);
}
.quick-card strong { display: block; font-family: var(--display); font-size: 1.02rem; letter-spacing: .1em; text-transform: uppercase; }
.quick-card small { display: block; color: var(--muted); font-size: .84rem; }
.quick-ico { width: 26px; height: 26px; fill: var(--accent); flex: none; }
.quick-primary {
  background: linear-gradient(140deg, color-mix(in srgb, #fff 16%, var(--accent)) 0%, var(--accent) 55%, color-mix(in srgb, var(--accent) 70%, #000) 100%);
  border-color: color-mix(in srgb, var(--accent) 70%, var(--accent-2));
  color: var(--on-accent);
  box-shadow: 0 26px 50px -26px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.quick-primary strong, .quick-primary small { color: var(--on-accent); }
.quick-primary small { opacity: .82; }
.quick-primary .quick-ico { fill: var(--on-accent); }
.quick-primary:hover { filter: brightness(1.06); border-color: var(--accent-2); }
.status-line { display: inline-flex !important; align-items: center; gap: .4rem; }
.flash-wrap { padding-top: 1rem; }

/* ── Sections ─────────────────────────────────────────────────────────────── */

.section { padding-block: clamp(3rem, 6vw, 5.5rem); position: relative; }
.section-tight { padding-block: 1.4rem 2rem; }
.section-alt {
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-2) 90%, transparent), var(--bg));
  border-block: 1px solid var(--hair);
}
.section-head {
  display: flex; align-items: end; justify-content: space-between; gap: 1rem;
  margin-bottom: 1.9rem; padding-bottom: 1rem;
  border-bottom: 1px solid var(--hair);
}
.section-head h2 { margin: 0; font-size: clamp(1.7rem, 3.2vw, 2.4rem); text-transform: uppercase; letter-spacing: .01em; }
.section-head .eyebrow { margin-bottom: .35rem; }
.more {
  display: inline-flex; align-items: center; gap: .45rem; flex: none;
  font-family: var(--display); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: .84rem;
  color: var(--ink); text-decoration: none;
  padding-block: .35rem;
}
.more:hover { color: var(--accent); }
.more .ico { width: 15px; height: 15px; fill: currentColor; transition: transform .18s; }
.more:hover .ico { transform: translateX(4px); }

/* ── News cards ───────────────────────────────────────────────────────────── */

.news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.news-grid .news-card-lead { grid-column: span 2; grid-row: span 2; }
.news-grid-index { grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.news-card {
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-2) 96%, #fff), var(--bg-2));
  border: 1px solid var(--hair);
  border-radius: calc(var(--radius) + 3px);
  overflow: hidden;
  color: var(--text); text-decoration: none;
  box-shadow: 0 20px 44px -36px var(--shade), inset 0 1px 0 var(--sheen-soft);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.news-card:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--hair));
  transform: translateY(-4px);
  box-shadow: 0 34px 60px -34px var(--accent-glow), inset 0 1px 0 var(--sheen);
}
.news-card-img { display: block; position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-3); }
.news-card-img::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(8, 4, 14, .55) 100%);
  opacity: .9;
}
.news-card-img img { width: 100%; height: 100%; object-fit: cover; object-position: 70% center; display: block; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.news-card:hover .news-card-img img { transform: scale(1.055); }
.news-card-body { display: flex; flex-direction: column; gap: .5rem; padding: 1.1rem 1.2rem 1.3rem; flex: 1; }
.news-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; font-size: .78rem; color: var(--muted); letter-spacing: .04em; }
.news-card-meta time { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; }
.news-card-title { font-family: var(--display); font-size: 1.22rem; line-height: 1.2; color: var(--ink); letter-spacing: .015em; }
.news-card-sum { color: var(--muted); font-size: .93rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-card-lead .news-card-img { aspect-ratio: 16 / 8.2; flex: 1; }
.news-card-lead .news-card-title { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.news-card-lead .news-card-body { flex: 0; padding: 1.35rem 1.5rem 1.55rem; }
.news-card-lead .news-card-sum { font-size: 1rem; }

/* ── About ────────────────────────────────────────────────────────────────── */

.about { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(1.75rem, 4.5vw, 4rem); align-items: center; }
.about-copy h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); margin-top: 0; padding-top: 0; border-top: 0; }
.about-art { margin: 0; position: relative; }
.about-art img { display: block; width: 100%; border-radius: calc(var(--radius) + 2px); box-shadow: 0 40px 70px -40px var(--shade); }
.about-art::before {
  content: ""; position: absolute; inset: -14px 14px 14px -14px; z-index: -1;
  border: 1px solid color-mix(in srgb, var(--accent-2) 55%, transparent);
  border-radius: calc(var(--radius) + 2px);
}

/* ── Game guide tiles ─────────────────────────────────────────────────────── */

.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(10.5rem, 1fr); gap: 1rem; overflow-x: auto; padding-bottom: .6rem; scroll-snap-type: x mandatory; }
.strip > * { scroll-snap-align: start; }
.grid-portrait { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 1rem; }
.char-card, .tile {
  position: relative; display: block;
  border-radius: calc(var(--radius) + 2px); overflow: hidden;
  background: var(--bg-3);
  color: #fff; text-decoration: none;
  border: 1px solid var(--hair);
  isolation: isolate;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
}
.char-card { aspect-ratio: 290 / 433; }
.tile { aspect-ratio: 16 / 9; }
.char-card img, .tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .6s cubic-bezier(.2, .7, .2, 1), filter .3s; }
.tile img { object-position: 72% center; }
.char-card::after, .tile::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(0deg, rgba(6, 3, 10, .92) 0%, rgba(6, 3, 10, .35) 46%, transparent 78%);
  transition: opacity .2s;
}
.char-card:hover img, .tile:hover img { transform: scale(1.07); filter: saturate(1.1); }
.char-card:hover, .tile:hover { border-color: color-mix(in srgb, var(--accent) 70%, transparent); }
.tile-copy { position: absolute; left: 0; right: 0; bottom: 0; padding: .9rem 1rem; display: block; }
.tile-copy strong { display: block; color: #fff; font-family: var(--display); font-size: 1.08rem; letter-spacing: .08em; text-transform: uppercase; line-height: 1.18; }
.tile-copy small { display: block; color: rgba(255, 255, 255, .72); font-size: .8rem; }
.char-card:hover .tile-copy strong, .tile:hover .tile-copy strong { color: var(--accent-2); }
.map-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
/* The first map is drawn large only when the count fills the grid exactly
   (5, 9, 13 …); any other count gets an even grid rather than a hole. */
.map-grid .tile:first-child:nth-last-child(4n+1):not(:only-child) { grid-column: span 2; grid-row: span 2; }
.map-grid .tile:first-child:nth-last-child(4n+1):not(:only-child) .tile-copy strong { font-size: 1.55rem; }
.map-grid-all { grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.map-grid-all .tile:first-child { grid-column: auto; grid-row: auto; }
.map-grid-all .tile:first-child .tile-copy strong { font-size: 1.08rem; }

.game-item { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
.game-item-art { margin: 0; }
.game-item-art img { display: block; width: 100%; border-radius: calc(var(--radius) + 2px); border: 1px solid var(--hair); box-shadow: var(--lift); }
.game-item-portrait { grid-template-columns: minmax(12rem, 20rem) minmax(0, 1fr); align-items: start; }
.game-item:not(.game-item-portrait) .game-item-art { display: none; }
.prev-next { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 2.2rem; }

/* ── Steps ────────────────────────────────────────────────────────────────── */

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1.1rem; counter-reset: none; }
.step {
  margin: 0; padding: 1.5rem 1.35rem 1.4rem;
  background: linear-gradient(180deg, var(--panel-sheen), transparent 60%), var(--bg-2);
  border: 1px solid var(--hair); border-radius: calc(var(--radius) + 2px);
  position: relative; overflow: hidden;
  box-shadow: inset 0 1px 0 var(--sheen-soft);
}
.step::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.step-n { display: block; font-size: 2.9rem; font-weight: 800; line-height: .9; color: color-mix(in srgb, var(--accent) 28%, transparent); margin-bottom: .55rem; letter-spacing: -.02em; }
.step strong { display: block; font-family: var(--display); font-size: 1.12rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .35rem; }
.step p { margin: 0; color: var(--muted); font-size: .93rem; }

/* ── Community band ───────────────────────────────────────────────────────── */

.band { position: relative; isolation: isolate; color: #fff; overflow: hidden; background: var(--header); }
.band-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.band-scrim { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, color-mix(in srgb, var(--header) 92%, transparent), color-mix(in srgb, var(--header) 40%, transparent)), radial-gradient(60% 120% at 85% 40%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%); }
.band-copy { padding-block: clamp(3.5rem, 8vw, 6.5rem); max-width: var(--wrap); }
.band-copy h2 { color: #fff; font-size: clamp(2rem, 4.4vw, 3.4rem); margin: 0 0 .7rem; letter-spacing: .015em; }
.band-copy p { max-width: 38rem; color: rgba(255, 255, 255, .85); font-size: 1.08rem; }

/* ── Inner page banner ────────────────────────────────────────────────────── */

.page-banner {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--header);
  color: #fff;
  border-bottom: 1px solid var(--hair);
}
.page-banner-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 40%; z-index: -2; opacity: .6; }
.page-banner::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(96deg, color-mix(in srgb, var(--header) 94%, transparent) 0%, color-mix(in srgb, var(--header) 55%, transparent) 58%, color-mix(in srgb, var(--header) 30%, transparent) 100%),
    radial-gradient(70% 100% at 12% 40%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
}
.page-banner-copy { padding-block: clamp(2.8rem, 6.5vw, 4.6rem) clamp(2.2rem, 5.5vw, 3.6rem); }
.page-banner h1 { color: #fff; margin: 0; max-width: 24ch; font-size: clamp(2.1rem, 4.4vw, 3.3rem); }
.page-banner .lead { color: rgba(255, 255, 255, .82); margin: .8rem 0 0; max-width: 46rem; }
.page-banner .eyebrow { color: var(--accent-2); }

.search-hero {
  display: flex; align-items: center; gap: .5rem;
  max-width: 40rem; margin-top: 1.6rem;
  background: color-mix(in srgb, var(--bg-2) 92%, transparent);
  border: 1px solid var(--hair); border-radius: var(--radius-btn);
  padding: .3rem .3rem .3rem .85rem;
  box-shadow: inset 0 1px 0 var(--sheen-soft), 0 20px 40px -28px var(--shade);
  backdrop-filter: blur(10px);
}
.search-hero .ico { width: 20px; height: 20px; fill: var(--muted); flex: none; }
.search-hero input[type="search"] { border: 0; background: none; padding: .6rem .2rem; flex: 1; min-width: 0; box-shadow: none; }
.search-hero input:focus { outline: none; }

/* ── Page layout ──────────────────────────────────────────────────────────── */

.page-body { padding-block: 2.4rem 1rem; }
main.solo, .page-body > main.solo { max-width: 48rem; }
.layout-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.4rem; align-items: start; }
.layout-split-right { grid-template-columns: minmax(0, 1fr) 19rem; }

/* The control panel and staff area keep their older wrapper classes. */
.page { max-width: var(--wrap); margin: 0 auto; padding: 2.2rem clamp(1rem, 3vw, 2rem) 1rem; width: 100%; }
.page main { min-width: 0; }
.page.solo main { max-width: 48rem; margin: 0 auto; }
.page.split { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 2.2rem; align-items: start; }
.page.split-right { display: grid; grid-template-columns: minmax(0, 1fr) 19rem; gap: 2.2rem; align-items: start; }
.page h1 { font-size: clamp(1.7rem, 3vw, 2.25rem); }

aside { min-width: 0; }
.layout-split aside, .page.split aside, .page.split-right aside { position: sticky; top: 6rem; }
.staff-aside { max-height: calc(100vh - 7rem); overflow-y: auto; scrollbar-width: thin; }
.aside-box {
  background: linear-gradient(180deg, var(--panel-sheen), transparent 55%), var(--bg-2);
  border: 1px solid var(--hair); border-radius: calc(var(--radius) + 2px);
  padding: 1.15rem; margin-bottom: 1rem;
  box-shadow: inset 0 1px 0 var(--sheen-soft);
}
.aside-box h3, .aside-title { margin: 0 0 .75rem; font-size: .82rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.aside-cta .btn { display: flex; width: 100%; margin-bottom: .55rem; }
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { margin: 0; padding: .5rem 0; border-bottom: 1px solid var(--hair); }
.link-list li:last-child { border-bottom: 0; }
.link-list small { display: block; color: var(--muted); font-size: .8rem; }

.prose { max-width: 48rem; }
.prose h2 { margin-top: 2.2rem; padding-top: 1.2rem; border-top: 1px solid var(--hair); }
.prose > h2:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.prose li::marker { color: var(--accent); }
.prose-small { font-size: .93rem; margin-top: .8rem; }
.prose-small ul { padding-left: 1rem; }
.callout {
  margin: 1.3rem 0; padding: 1rem 1.2rem;
  background: linear-gradient(90deg, var(--accent-soft), transparent 85%);
  border-left: 2px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0;
}
.callout p { margin: 0; }
.callout-block { background: linear-gradient(180deg, var(--panel-sheen), transparent 60%), var(--bg-2); border: 1px solid var(--hair); border-left: 2px solid var(--warn); border-radius: var(--radius); padding: 1.1rem 1.3rem; margin-top: 1.6rem; }
.callout-block h2 { margin-top: 0; border: 0; padding: 0; font-size: 1.15rem; }
.body-figure { margin: 1.6rem 0; }
.body-figure img { display: block; width: 100%; border-radius: calc(var(--radius) + 2px); border: 1px solid var(--hair); }
.body-figure figcaption { color: var(--muted); font-size: .86rem; margin-top: .5rem; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; color: var(--muted); font-size: .9rem; }
.crumbs { color: var(--muted); font-size: .88rem; margin-bottom: 1.1rem; letter-spacing: .04em; }
.crumbs a { color: var(--muted); }
.updated { margin-top: 2.2rem; }

/* ── Tabs ─────────────────────────────────────────────────────────────────── */

.tabs { display: flex; flex-wrap: wrap; gap: .15rem; margin: 0 0 1.5rem; border-bottom: 1px solid var(--hair); }
.tabs a {
  padding: .6rem .95rem; margin-bottom: -1px;
  color: var(--muted); text-decoration: none;
  font-weight: 600; letter-spacing: .1em; text-transform: uppercase; font-size: .86rem;
  border-bottom: 2px solid transparent;
  transition: color .16s, border-color .16s;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }

/* ── Support ──────────────────────────────────────────────────────────────── */

.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .9rem; }
.topic {
  display: flex; flex-direction: column; gap: .3rem;
  padding: 1.2rem; background: linear-gradient(180deg, var(--panel-sheen), transparent 60%), var(--bg-2);
  border: 1px solid var(--hair); border-radius: calc(var(--radius) + 2px);
  color: var(--text); text-decoration: none;
  box-shadow: inset 0 1px 0 var(--sheen-soft);
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.topic:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--hair)); transform: translateY(-3px); box-shadow: var(--lift); }
.topic strong { font-family: var(--display); font-size: 1.08rem; letter-spacing: .05em; }
.topic span { color: var(--muted); font-size: .9rem; }
.topic small { color: var(--muted); font-size: .78rem; margin-top: auto; padding-top: .5rem; letter-spacing: .06em; text-transform: uppercase; }
.topic-ico { width: 2.5rem; height: 2.5rem; display: grid !important; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); border-radius: var(--radius); margin-bottom: .5rem; }
.topic-ico .ico { width: 20px; height: 20px; fill: var(--accent); }

.article-list { list-style: none; padding: 0; margin: 0 0 1.3rem; border-top: 1px solid var(--hair); }
.article-list li { margin: 0; border-bottom: 1px solid var(--hair); }
.article-list a { display: block; padding: .95rem .4rem; color: var(--text); text-decoration: none; transition: background-color .15s, padding-left .15s; }
.article-list a:hover { background: var(--bg-2); padding-left: .8rem; }
.article-list strong { display: block; color: var(--ink); }
.article-list a:hover strong { color: var(--link); }
.article-list span { display: block; color: var(--muted); font-size: .92rem; }
.article-list small { display: inline-block; margin-top: .25rem; color: var(--accent-2); font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }

.feedback { margin: 2.2rem 0 1rem; padding: 1.1rem 1.2rem; background: var(--bg-2); border: 1px solid var(--hair); border-radius: calc(var(--radius) + 2px); }
.feedback-form { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 0; }
.feedback-form span { font-weight: 600; color: var(--ink); margin-right: .4rem; }

.choice-group { border: 0; padding: 0; margin: 0 0 1.2rem; }
.choice-group legend { padding: 0; margin-bottom: .5rem; font-size: .9rem; font-weight: 600; color: var(--ink); font-family: var(--sans); }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .55rem; }
.choice {
  display: flex; gap: .65rem; align-items: flex-start;
  padding: .8rem .9rem; border: 1px solid var(--hair); border-radius: var(--radius); background: var(--bg);
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.choice:hover { border-color: var(--hair-strong); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { margin-top: .3rem; accent-color: var(--accent); }
.choice strong { display: block; font-size: .95rem; }
.choice small { display: block; color: var(--muted); font-size: .82rem; line-height: 1.35; }
.req { color: var(--bad); }
.form-panel { padding: 1.6rem; }

.download-list { display: grid; gap: .9rem; margin-bottom: 2.2rem; }
.download {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.1rem; align-items: center;
  padding: 1.2rem 1.3rem; background: linear-gradient(180deg, var(--panel-sheen), transparent 60%), var(--bg-2);
  border: 1px solid var(--hair); border-left: 2px solid var(--accent); border-radius: calc(var(--radius) + 2px);
  box-shadow: inset 0 1px 0 var(--sheen-soft);
}
.download-ico { width: 3.1rem; height: 3.1rem; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); border-radius: var(--radius); }
.download-ico .ico { width: 24px; height: 24px; fill: var(--accent); }
.download h2 { margin: 0 0 .3rem; font-size: 1.28rem; }
.download p { margin: 0; }
.hash code { font-size: .78rem; }

.status-card {
  display: flex; gap: 1.3rem; align-items: center;
  padding: 1.5rem; margin-bottom: 1.5rem;
  background: linear-gradient(180deg, var(--panel-sheen), transparent 60%), var(--bg-2);
  border: 1px solid var(--hair); border-radius: calc(var(--radius) + 2px);
  box-shadow: inset 0 1px 0 var(--sheen-soft);
}
.status-card h2 { margin: 0 0 .45rem; font-size: 1.9rem; }
.status-card.is-up { border-left: 2px solid var(--good); }
.status-card.is-down { border-left: 2px solid var(--bad); }
.status-light .dot { width: 1.4rem; height: 1.4rem; }
.status-copy .facts { margin: 0; }

/* ── Sign-in screen ───────────────────────────────────────────────────────── */

.auth-screen { position: relative; isolation: isolate; min-height: 74vh; display: grid; place-items: center; padding: 3.5rem 1rem; overflow: hidden; background: var(--header); }
.auth-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; opacity: .45; }
.auth-scrim { position: absolute; inset: 0; z-index: -1; background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--accent) 14%, transparent), rgba(0, 0, 0, .88)); }
.auth-card {
  width: 100%; max-width: 26rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-2) 94%, transparent), var(--bg-2));
  border: 1px solid var(--hair); border-top: 2px solid var(--accent); border-radius: calc(var(--radius) + 3px);
  padding: 2rem; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .65), inset 0 1px 0 var(--sheen);
  backdrop-filter: blur(14px);
}
.auth-card h1 { font-size: 1.9rem; }

/* ── Footer ───────────────────────────────────────────────────────────────── */

.site-foot {
  margin-top: 4rem;
  background:
    radial-gradient(70rem 20rem at 20% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    var(--footer);
  color: rgba(255, 255, 255, .68);
  font-size: .92rem;
  position: relative;
}
.site-foot::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent-2) 65%, transparent) 30%, color-mix(in srgb, var(--accent) 65%, transparent) 70%, transparent);
}
.site-foot a { color: rgba(255, 255, 255, .78); }
.site-foot a:hover { color: #fff; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr) auto; gap: 2.5rem; padding-block: 3rem 2rem; align-items: start; }
.foot-brand .brand { color: #fff; margin-bottom: .8rem; }
.foot-brand .brand-name { font-size: 1.3rem; letter-spacing: .18em; }
.foot-tagline { margin: 0 0 1rem; max-width: 22rem; }
.foot-social { display: flex; gap: .35rem; }
.foot-social a { display: inline-flex; padding: .5rem; border: 1px solid rgba(255, 255, 255, .14); border-radius: var(--radius-btn); transition: border-color .16s, background-color .16s; }
.foot-social a:hover { border-color: var(--accent); background: rgba(255, 255, 255, .06); }
.foot-social .ico { width: 17px; height: 17px; fill: currentColor; }
.foot-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .55rem 1.4rem; }
.foot-links a { text-decoration: none; font-weight: 600; letter-spacing: .02em; }
.foot-links a:hover { text-decoration: underline; }
.foot-cta { display: flex; flex-direction: column; gap: .6rem; }
.foot-legal { border-top: 1px solid rgba(255, 255, 255, .09); padding-block: 1.2rem 1.9rem; font-size: .8rem; color: rgba(255, 255, 255, .46); }
.foot-legal p { margin: .3rem 0; max-width: 60rem; }

/* ── Panels, stats, facts ─────────────────────────────────────────────────── */

.panel {
  background: linear-gradient(180deg, var(--panel-sheen), transparent 55%), var(--bg-2);
  border: 1px solid var(--hair); border-radius: calc(var(--radius) + 2px);
  padding: 1.35rem 1.45rem; margin: 0 0 1.3rem;
  box-shadow: inset 0 1px 0 var(--sheen-soft);
}
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .7rem; margin-bottom: 1rem; }
.panel-head h1, .panel-head h2, .panel-head h3 { margin: 0; }
.page-head { margin-bottom: 1.1rem; }
.panel-note { border-left: 2px solid var(--warn); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1.1rem; margin: 0 0 1.3rem; }
.tiles .panel { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1rem 1.5rem; margin: 0 0 1.3rem; padding-top: 1.1rem; border-top: 1px solid var(--hair); }
.stat { position: relative; padding-left: 1rem; }
.stat::before { content: ""; position: absolute; left: 0; top: .2rem; bottom: .45rem; width: 1px; background: linear-gradient(180deg, var(--accent), transparent); opacity: .55; }
.stat dt { color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.stat dd { margin: 0; color: var(--ink); font-family: var(--display); font-size: 1.75rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.3rem; margin: 0 0 1.3rem; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
dl.facts-stack { grid-template-columns: 1fr; gap: 0; }
dl.facts-stack dt { font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin-top: .7rem; }
dl.facts-stack dt:first-child { margin-top: 0; }

/* ── Forms ────────────────────────────────────────────────────────────────── */

.field { margin: 0 0 1.15rem; }
.field label, .field .label { display: block; margin-bottom: .35rem; color: var(--ink); font-weight: 600; font-size: .9rem; letter-spacing: .02em; }
.field .hint { display: block; margin-top: .35rem; color: var(--muted); font-size: .83rem; }

input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="number"], input[type="url"], select, textarea {
  width: 100%;
  padding: .62rem .8rem;
  background: color-mix(in srgb, var(--bg) 55%, var(--bg-2));
  color: var(--text);
  border: 1px solid var(--hair-strong);
  border-radius: var(--radius-btn);
  font: 1rem/1.45 var(--sans);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .18);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  outline: 2px solid var(--accent-soft);
  outline-offset: 0;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .18), 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
input:disabled { opacity: .7; }
textarea { min-height: 7rem; resize: vertical; }
input[type="file"] { color: var(--text); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0 1.1rem; }
.check { display: flex; align-items: flex-start; gap: .55rem; margin: 0 0 .85rem; }
.check input { margin-top: .3rem; }
.check label { font-weight: 400; color: var(--text); }
fieldset { border: 1px solid var(--hair); border-radius: calc(var(--radius) + 2px); padding: 1.1rem 1.2rem; margin: 0 0 1.3rem; min-width: 0; }
legend { padding: 0 .45rem; color: var(--ink); font-weight: 700; font-size: .95rem; letter-spacing: .1em; text-transform: uppercase; }
.form-narrow { max-width: 27rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.3rem; }
.form-cell { min-width: 0; }
.form-cell-wide { grid-column: 1 / -1; }
.color-field { display: flex; gap: .5rem; align-items: center; }
.color-field input[type="color"], .colour-row input[type="color"] { width: 2.7rem; height: 2.45rem; padding: .15rem; border: 1px solid var(--hair-strong); border-radius: var(--radius-btn); background: var(--bg); cursor: pointer; flex: none; }
.color-field input[type="text"] { max-width: 8rem; font-family: var(--mono); }
.image-preview { display: block; max-height: 7rem; max-width: 100%; margin-top: .5rem; border-radius: var(--radius-btn); border: 1px solid var(--hair); }
.sticky-save { position: sticky; bottom: 0; z-index: 5; margin: 0 -.5rem; padding: .8rem .5rem; background: color-mix(in srgb, var(--bg) 92%, transparent); border-top: 1px solid var(--hair); backdrop-filter: blur(10px); }
.settings-group legend { font-size: .92rem; }
.inline-form { display: flex; gap: .4rem; align-items: center; margin: 0; }
.inline-form select { width: auto; padding-block: .32rem; }
.aside-form { margin: 1rem 0 0; padding-top: 1rem; border-top: 1px solid var(--hair); }
.aside-form .field { margin-bottom: .55rem; }
.danger-zone { margin: -.4rem 0 1.3rem; text-align: right; }

/* ── Messages and badges ──────────────────────────────────────────────────── */

.msg {
  margin: 0 0 1.2rem; padding: .85rem 1.05rem;
  border: 1px solid var(--hair); border-left-width: 2px; border-radius: var(--radius-btn);
  background: linear-gradient(90deg, var(--bg-2), color-mix(in srgb, var(--bg-2) 70%, transparent));
  font-size: .94rem;
}
.msg-good { border-left-color: var(--good); }
.msg-bad { border-left-color: var(--bad); }
.msg-note { border-left-color: var(--warn); }

.badge {
  display: inline-block; padding: .14rem .55rem;
  border: 1px solid var(--hair-strong); border-radius: 999px;
  background: color-mix(in srgb, var(--bg-3) 80%, transparent); color: var(--muted);
  font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; line-height: 1.55;
  white-space: nowrap; vertical-align: middle;
}
.badge-on, .badge-open { color: var(--good); border-color: color-mix(in srgb, var(--good) 60%, transparent); background: color-mix(in srgb, var(--good) 10%, transparent); }
.badge-waiting { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 60%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.badge-high { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 60%, transparent); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.badge-staff { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.tone { --tone: var(--muted); color: var(--tone); border-color: color-mix(in srgb, var(--tone) 55%, transparent); background: color-mix(in srgb, var(--tone) 12%, transparent); }

/* ── Tables ───────────────────────────────────────────────────────────────── */

.scroll { overflow-x: auto; margin: 0 0 1.3rem; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; vertical-align: top; padding: .7rem .9rem .7rem 0; border-bottom: 1px solid var(--hair); }
th { color: var(--muted); font-weight: 700; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; border-bottom: 1px solid var(--hair-strong); }
th:last-child, td:last-child { padding-right: 0; }
/* The agent queue has seven columns; below this width it scrolls inside .scroll
   rather than crushing "Waiting" into a two-line sliver. */
.queue { min-width: 46rem; }
tbody tr { transition: background-color .14s; }
tbody tr:nth-child(even) { background: color-mix(in srgb, var(--bg-2) 45%, transparent); }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 8%, var(--bg-2)); }
tr.is-selected { background: var(--accent-soft); }
.nowrap { white-space: nowrap; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }
a.plain { color: var(--ink); text-decoration: none; }
a.plain:hover { color: var(--link); text-decoration: underline; }
.list-thumb { width: 5rem; height: 2.8rem; object-fit: cover; border-radius: 4px; display: block; }
.role-matrix td:not(:first-child), .role-matrix th:not(:first-child) { text-align: center; }

/* ── Staff and control panel navigation ───────────────────────────────────── */

.sidenav { list-style: none; margin: 0; padding: 0; font-size: .93rem; }
.sidenav li { margin: 0; }
.sidenav a {
  display: block; padding: .45rem .75rem; margin-bottom: 1px;
  border-radius: var(--radius-btn); color: var(--text); text-decoration: none;
  border-left: 2px solid transparent;
  transition: background-color .14s, color .14s, border-color .14s;
}
.sidenav a:hover { background: var(--bg-3); color: var(--ink); }
.sidenav a[aria-current] {
  background: linear-gradient(90deg, var(--accent-soft), transparent 90%);
  color: var(--ink); font-weight: 600; border-left-color: var(--accent);
}
.group { margin: 1.1rem 0 .35rem; padding: 0 .75rem; color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }

.searchbar { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 0 1.3rem; }
.searchbar input, .searchbar select { width: auto; flex: 1 1 11rem; min-width: 0; }

.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .9rem; margin: 0 0 1.3rem; }
.hub-card { display: flex; flex-direction: column; gap: .25rem; padding: 1.1rem; background: linear-gradient(180deg, var(--panel-sheen), transparent 60%), var(--bg-2); border: 1px solid var(--hair); border-radius: calc(var(--radius) + 2px); color: var(--text); text-decoration: none; transition: border-color .16s, transform .16s; }
.hub-card:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--hair)); transform: translateY(-2px); }
.hub-card strong { font-family: var(--display); letter-spacing: .05em; font-size: 1.04rem; }
.hub-card span { color: var(--muted); font-size: .88rem; }
.hub-card small { color: var(--accent-2); font-weight: 700; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; margin-top: .35rem; }
.hub-ico { width: 22px; height: 22px; fill: var(--accent); margin-bottom: .35rem; }
.cap-list { columns: 2 16rem; }

details.manage summary { list-style: none; display: inline-flex; }
details.manage summary::-webkit-details-marker { display: none; }
.manage-body { margin-top: .6rem; padding: .9rem; background: var(--bg); border: 1px solid var(--hair); border-radius: var(--radius); min-width: 16rem; }

/* ── Tickets ──────────────────────────────────────────────────────────────── */

.ticket-head h1 { text-transform: none; font-size: clamp(1.4rem, 2.4vw, 1.9rem); margin-bottom: .5rem; }
.ticket-badges { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.thread { margin: 0 0 1.5rem; }
.reply { padding: 1rem 1.2rem; margin: 0 0 .9rem; background: var(--bg-2); border: 1px solid var(--hair); border-radius: calc(var(--radius) + 2px); box-shadow: inset 0 1px 0 var(--sheen-soft); }
.reply-staff { border-left: 2px solid var(--accent); }
.reply-internal { border-left: 2px solid var(--warn); background: var(--bg-3); }
.reply-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; margin-bottom: .5rem; font-size: .84rem; color: var(--muted); }
.reply-head .who { color: var(--ink); font-weight: 600; }
.reply-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.canned-pick select { width: auto; max-width: 18rem; padding-block: .38rem; font-size: .9rem; }

/* ── Theme editor ─────────────────────────────────────────────────────────── */

.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .9rem; }
.preset { display: flex; flex-direction: column; gap: .35rem; padding: 1rem; margin: 0; background: var(--bg); border: 1px solid var(--hair); border-radius: calc(var(--radius) + 2px); }
.preset.is-current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 18px 36px -28px var(--accent-glow); }
.preset small { color: var(--muted); font-size: .84rem; flex: 1; }
.preset .btn { align-self: flex-start; margin-top: .45rem; }
.preset-swatches { display: flex; height: 1.9rem; border-radius: 5px; overflow: hidden; border: 1px solid var(--hair); }
.preset-swatches i { flex: 1; }
/* Order matches lib/theme.php: dark background, dark header, dark accent, light
   background. The generated theme.css overrides these per preset. */
.preset-swatches i:nth-child(1) { background: var(--bg); }
.preset-swatches i:nth-child(2) { background: var(--header); }
.preset-swatches i:nth-child(3) { background: var(--accent); }
.preset-swatches i:nth-child(4) { background: var(--bg-2); }
.colour-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.colour-mode { margin: 0; }
.colour-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 6.2rem; gap: .6rem; align-items: center; padding: .4rem 0; border-bottom: 1px solid var(--hair); }
.colour-row:last-child { border-bottom: 0; }
.colour-row label { font-size: .9rem; font-weight: 600; color: var(--ink); }
.colour-row label small { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; }
.colour-row input[type="text"] { font-family: var(--mono); font-size: .85rem; padding: .38rem .48rem; }
.theme-sample { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 1rem 0; padding: 1.1rem; background: var(--bg); border: 1px dashed var(--hair-strong); border-radius: calc(var(--radius) + 2px); }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .9rem; }
.media-grid-small { grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); }
.media-item { margin: 0; background: var(--bg); border: 1px solid var(--hair); border-radius: calc(var(--radius) + 2px); overflow: hidden; }
.media-item img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--bg-3); }
.media-item figcaption { padding: .6rem; display: flex; flex-direction: column; gap: .3rem; }
.media-item form { margin: 0; }
.media-path { font-size: .72rem; display: block; }

/* ── Rank insignia ────────────────────────────────────────────────────────── */

.rank { display: inline-flex; align-items: center; gap: .45rem; }
.rank img { width: 32px; height: 32px; image-rendering: pixelated; flex: none; }
.rank-small img { width: 16px; height: 16px; }

/* ── Pagination ───────────────────────────────────────────────────────────── */

.pager { display: flex; align-items: center; gap: .8rem; margin: 1.8rem 0; }
.pager-at { color: var(--muted); font-size: .88rem; letter-spacing: .06em; text-transform: uppercase; }

/* ── Installer ────────────────────────────────────────────────────────────── */

.setup-steps { display: flex; flex-wrap: wrap; gap: .45rem .5rem; list-style: none; margin: 0 0 1.7rem; padding: 0; font-size: .8rem; }
.setup-steps li { margin: 0; padding: .26rem .75rem; border: 1px solid var(--hair); border-radius: 999px; color: var(--muted); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.setup-steps .step-now { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.setup-steps .step-done { color: var(--ink); border-color: var(--muted); }
.setup-shell { max-width: 46rem; margin: 0 auto; padding: 2.5rem clamp(1rem, 3vw, 2rem) 3rem; }

/* ── Breakpoints ──────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .news-card:hover, .quick-card:hover, .topic:hover, .hub-card:hover { transform: none; }
}

@media (max-width: 1100px) {
  .nav-main a { padding: 0 .6rem; font-size: .88rem; letter-spacing: .1em; }
  .head-bar { gap: 1.1rem; }
  .hero-copy h1, .hero-copy h2 { font-size: clamp(2.4rem, 6.4vw, 4.2rem); }
}

@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .head-bar { flex-wrap: wrap; gap: .75rem; min-height: 3.9rem; }
  .head-bar > .btn-cta { display: none; }
  .nav-main {
    display: none; order: 3; flex-basis: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    padding-bottom: .9rem;
  }
  .site-head.is-open .nav-main { display: flex; }
  .nav-main a { padding: .8rem .2rem; border-bottom: 1px solid rgba(255, 255, 255, .08); margin: 0; }
  .nav-main a::after { display: none; }
  .nav-main a[aria-current] { border-bottom-color: rgba(255, 255, 255, .08); border-left: 2px solid var(--accent); padding-left: .7rem; }
  .nav-cta-mobile { display: flex !important; margin-top: .9rem; }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .news-grid .news-card-lead { grid-column: 1 / -1; grid-row: auto; }
  .about { grid-template-columns: minmax(0, 1fr); }
  .map-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout-split-right, .page.split, .page.split-right { grid-template-columns: minmax(0, 1fr); }
  .layout-split aside, .page.split aside, .page.split-right aside { position: static; }
  .foot-grid { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .foot-cta { flex-direction: row; flex-wrap: wrap; }
  .colour-modes { grid-template-columns: minmax(0, 1fr); }
  .game-item-portrait { grid-template-columns: minmax(0, 1fr); }
  .game-item-portrait .game-item-art { max-width: 18rem; }
}

@media (max-width: 640px) {
  .util-status { font-size: 0; gap: 0; }
  .util-social { display: none; }
  .util-link { max-width: 9rem; }
  /* Filipino labels run longer: tighten the account strip so it never clips. */
  .util-bar { gap: .5rem; }
  .util-account { gap: .1rem; min-width: 0; }
  .util-link, .util-btn { padding: .28rem .4rem; }
  .lang-pick { margin-right: .15rem; }
  .lang-opt { padding: .2rem .36rem; }
  .brand-name { font-size: 1rem; letter-spacing: .12em; }
  .hero-copy { padding-block: 3.5rem 6rem; }
  .hero-copy h1, .hero-copy h2 { max-width: none; }
  .hero-scrim { background: linear-gradient(0deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 55%, transparent) 5%, rgba(0, 0, 0, .55) 42%, rgba(0, 0, 0, .8) 100%); }
  .hero-dots { bottom: 4.5rem; }
  .quick { grid-template-columns: minmax(0, 1fr); margin-top: -2.75rem; }
  .news-grid { grid-template-columns: minmax(0, 1fr); }
  .map-grid { grid-template-columns: minmax(0, 1fr); }
  .map-grid .tile:first-child:nth-last-child(4n+1):not(:only-child) { grid-column: auto; grid-row: auto; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .download { grid-template-columns: minmax(0, 1fr); }
  .download-ico { display: none; }
  dl.facts { grid-template-columns: minmax(0, 1fr); gap: 0; }
  dl.facts dd { margin-bottom: .6rem; }
  .colour-row { grid-template-columns: auto minmax(0, 1fr); }
  .colour-row input[type="text"] { grid-column: 2; }
  .status-card { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 400px) {
  .util-link .ico { display: none; }
  .util-link { font-size: .8rem; }
}
