/* Wax public website: one shared stylesheet for every public page (header, footer, panels, buttons, fields, tables,
   pills, headings, links, focus, scrollbars). Page stylesheets (home.css, shop.css, vote.css, wiki.css,
   rankings.css, team.css, patch-notes.css, article.css, account-recovery.css) only hold page layout.
   Look: the home page hero (night sky from teal to violet, violet glass, lilac frames, mint primary button, Cinzel
   headings) and the game palette (docs/WAX-PALETTE.md: purple slate surfaces, lilac grey frames, teal for state,
   soft violet for highlighted text, purple for accents), a little richer than the admin site (admin.css).
   Static background only: no per-frame effect outside the home hero. */

:root {
  color-scheme: dark;
  /* night and surfaces */
  --wx-night: #080c16;
  --wx-night-2: #0e1222;
  --wx-surface: rgba(30, 26, 50, 0.72);
  --wx-surface-2: rgba(40, 34, 64, 0.86);
  --wx-surface-solid: #1a1729;
  --wx-sunken: rgba(6, 7, 15, 0.55);
  --wx-glass: linear-gradient(160deg, rgba(46, 34, 78, 0.74), rgba(20, 20, 38, 0.84) 62%, rgba(16, 22, 34, 0.86));
  --wx-glass-strong: linear-gradient(150deg, rgba(62, 36, 106, 0.84), rgba(26, 24, 50, 0.9) 58%, rgba(16, 24, 36, 0.92));
  /* frames */
  --wx-line: rgba(204, 196, 224, 0.12);
  --wx-line-2: rgba(204, 196, 224, 0.2);
  --wx-line-3: rgba(204, 196, 224, 0.32);
  --wx-line-accent: rgba(201, 155, 255, 0.45);
  /* text (AA on every surface above) */
  --wx-text: #efebf8;
  --wx-text-2: #cfc8e0;
  --wx-muted: #a9a2be;
  --wx-dim: #8f88a6;
  /* teal: state, selection, focus, the primary button */
  --wx-teal: #80d4d2;
  --wx-teal-hi: #b4ece6;
  --wx-teal-lo: #3e8a8e;
  --wx-teal-bg: rgba(128, 212, 210, 0.12);
  --wx-teal-line: rgba(128, 212, 210, 0.45);
  /* violet: highlighted text, links, accents */
  --wx-violet: #c2aaf0;
  --wx-violet-hi: #e4d6ff;
  --wx-magic: #9a5fe0;
  --wx-magic-deep: #6e3cb6;
  --wx-violet-bg: rgba(154, 95, 224, 0.16);
  /* meaning */
  --wx-gold: #e8cb8e;
  --wx-gold-bg: rgba(232, 203, 142, 0.12);
  --wx-ok: #8fdcbf;
  --wx-bad: #f2a2a6;
  --wx-bad-bg: rgba(242, 162, 166, 0.12);
  /* type, shape, layout */
  --wx-font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wx-display: Cinzel, Georgia, "Times New Roman", serif;
  --wx-radius: 16px;
  --wx-radius-md: 12px;
  --wx-radius-sm: 8px;
  --wx-shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
  --wx-glow: 0 0 34px rgba(150, 90, 230, 0.2);
  --wx-focus: #a9ece5;
  --wx-max: 1180px;
  /* names the home hero (home-hero.css) reads */
  --max: var(--wx-max);
  --header-height: 76px;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html {
  min-width: 320px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
  background: var(--wx-night);
  scrollbar-color: rgba(204, 196, 224, 0.32) rgba(8, 12, 22, 0.6);
}
body {
  min-height: 100vh;
  margin: 0;
  color: var(--wx-text);
  background: transparent; /* html paints the night colour; the sky below must not be covered */
  font: 400 15px/1.65 var(--wx-font);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}
/* the night sky, still: teal glow high left, violet dusk low right (one fixed layer, painted once) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(70% 55% at 10% -8%, rgba(44, 150, 168, 0.26), rgba(44, 150, 168, 0) 70%),
    radial-gradient(60% 50% at 82% 2%, rgba(70, 92, 170, 0.16), rgba(70, 92, 170, 0) 70%),
    radial-gradient(75% 65% at 98% 106%, rgba(126, 64, 156, 0.4), rgba(126, 64, 156, 0) 70%),
    radial-gradient(55% 50% at 6% 104%, rgba(84, 48, 120, 0.26), rgba(84, 48, 120, 0) 70%),
    linear-gradient(180deg, #070c15 0%, #0a1220 36%, #12122a 74%, #1a1430 100%);
}
::selection { background: rgba(154, 95, 224, 0.5); color: #fff; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--wx-violet); text-decoration: none; -webkit-tap-highlight-color: transparent; }
a:hover { color: var(--wx-violet-hi); }
button, input, select, textarea { font: inherit; letter-spacing: 0; color: inherit; }
button, summary, select, label:has(input[type="radio"], input[type="checkbox"]) { cursor: pointer; }
:where(h1, h2) { font-family: var(--wx-display); font-weight: 700; letter-spacing: 0.01em; color: var(--wx-text); }
:where(h3, h4) { color: var(--wx-text); }
:where(h1) { line-height: 1.15; }
:where(h2) { line-height: 1.25; }
:where(code) { padding: 1px 6px; border: 1px solid var(--wx-line); border-radius: 6px; background: var(--wx-sunken); color: var(--wx-text-2); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.9em; }
:where(hr) { height: 1px; margin: 28px 0; border: 0; background: var(--wx-line-2); }

/* one focus ring everywhere: teal (the game's focus colour), never removed */
:focus-visible { outline: 2px solid var(--wx-focus); outline-offset: 3px; }
:where(input, select, textarea):focus-visible { outline-offset: 1px; }

/* scrollbars (WebKit; Firefox reads scrollbar-color above) */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: rgba(8, 12, 22, 0.6); }
::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 999px; background: rgba(204, 196, 224, 0.3) padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(204, 196, 224, 0.48) padding-box; }

.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; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 100; padding: 10px 16px; border: 1px solid var(--wx-line-accent); border-radius: var(--wx-radius-sm); background: var(--wx-surface-solid); color: var(--wx-text); }
.skip-link:focus { top: 10px; }

/* ---------------------------------------------------------------- header (templates/public_header.html) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-height);
  border-bottom: 1px solid var(--wx-line-2);
  background: linear-gradient(180deg, rgba(14, 12, 28, 0.99), rgba(11, 12, 25, 0.985));
  box-shadow: 0 1px 0 rgba(201, 155, 255, 0.08), 0 10px 30px rgba(0, 0, 0, 0.25);
}
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, rgba(128, 212, 210, 0), rgba(128, 212, 210, 0.45) 30%, rgba(201, 155, 255, 0.55) 70%, rgba(201, 155, 255, 0));
  pointer-events: none;
}
.site-header-inner { width: min(var(--wx-max), calc(100% - 48px)); height: 100%; margin: auto; display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; align-items: center; gap: 24px; }
.site-brand { display: flex; align-items: center; width: 112px; height: 56px; }
.site-brand img { width: 112px; height: 56px; object-fit: contain; filter: drop-shadow(0 0 14px rgba(160, 96, 230, 0.3)); transition: filter 0.2s ease; }
.site-brand:hover img { filter: drop-shadow(0 0 18px rgba(180, 120, 250, 0.5)); }
.site-nav { display: flex; align-items: center; justify-content: center; gap: 6px; height: 100%; }
.site-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 11px;
  border-radius: 999px;
  color: var(--wx-text-2);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.site-nav a:hover { color: var(--wx-text); background: rgba(204, 196, 224, 0.08); }
.site-nav a[aria-current] { color: var(--wx-violet-hi); background: var(--wx-violet-bg); box-shadow: inset 0 0 0 1px rgba(201, 155, 255, 0.28); }
.site-nav a[aria-current]::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--wx-teal); }
.site-actions { display: flex; align-items: center; gap: 12px; }
.site-languages { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--wx-line-2); border-radius: 999px; background: var(--wx-sunken); }
.site-languages a { display: grid; place-items: center; width: 32px; height: 28px; border-radius: 999px; color: var(--wx-muted); font-size: 11px; font-weight: 700; }
.site-languages a:hover { color: var(--wx-text); }
.site-languages a[aria-current] { background: var(--wx-violet-bg); color: var(--wx-violet-hi); box-shadow: inset 0 0 0 1px rgba(201, 155, 255, 0.35); }
.site-account {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  min-height: 36px;
  padding: 7px 16px;
  border: 1px solid var(--wx-line-accent);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(84, 50, 140, 0.55), rgba(48, 30, 86, 0.55));
  color: var(--wx-text);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.4;
  box-shadow: 0 0 18px rgba(150, 90, 230, 0.18);
}
.site-account:hover { color: #fff; border-color: rgba(222, 196, 255, 0.8); background: linear-gradient(180deg, rgba(104, 62, 170, 0.7), rgba(62, 38, 110, 0.7)); }

/* ---------------------------------------------------------------- page frame */
.wx-page { width: min(var(--wx-max), calc(100% - 48px)); margin: 0 auto; padding: 48px 0 88px; }
.wx-page-narrow { width: min(860px, calc(100% - 48px)); }
.wx-heading { margin-bottom: 32px; }
.wx-kicker { display: block; margin: 0 0 8px; color: var(--wx-teal); font-size: 11.5px; font-weight: 800; line-height: 1.4; letter-spacing: 0.14em; text-transform: uppercase; }
.wx-title { margin: 0 0 12px; font: 700 clamp(32px, 4.4vw, 50px)/1.1 var(--wx-display); letter-spacing: 0.01em; color: var(--wx-text); text-shadow: 0 0 30px rgba(170, 104, 240, 0.35), 0 4px 18px rgba(0, 0, 0, 0.4); }
.wx-lead { margin: 0; max-width: 68ch; color: var(--wx-text-2); font-size: 16.5px; line-height: 1.7; }
.wx-muted { color: var(--wx-muted); }

/* ---------------------------------------------------------------- panels and cards */
.wx-panel {
  position: relative;
  border: 1px solid var(--wx-line-2);
  border-radius: var(--wx-radius);
  background: var(--wx-glass);
  box-shadow: var(--wx-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.wx-panel-accent { border-color: var(--wx-line-accent); background: var(--wx-glass-strong); box-shadow: var(--wx-shadow), var(--wx-glow), inset 0 1px 0 rgba(255, 255, 255, 0.07); }
.wx-card {
  border: 1px solid var(--wx-line);
  border-radius: var(--wx-radius-md);
  background: linear-gradient(165deg, rgba(40, 34, 64, 0.62), rgba(18, 18, 34, 0.72));
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
a.wx-card:hover, .wx-card.is-link:hover { border-color: var(--wx-line-accent); box-shadow: var(--wx-glow); }
.wx-notice { margin: 24px 0; padding: 15px 18px; border: 1px solid var(--wx-line); border-left: 3px solid var(--wx-teal); border-radius: 0 var(--wx-radius-sm) var(--wx-radius-sm) 0; background: var(--wx-teal-bg); color: var(--wx-text-2); }

/* ---------------------------------------------------------------- buttons */
.wx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--wx-line-3);
  border-radius: 10px;
  background: rgba(14, 12, 28, 0.72);
  color: var(--wx-text);
  font: 700 14px/1.2 var(--wx-font);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}
.wx-btn:hover:not(:disabled) { color: #fff; border-color: var(--wx-teal-line); background: rgba(30, 28, 52, 0.9); }
.wx-btn-primary {
  border-color: #a6ece4;
  background: linear-gradient(180deg, #9ae2dd, #74cbc8);
  color: #0a2224;
  box-shadow: 0 0 0 3px rgba(128, 212, 210, 0.12), 0 8px 24px rgba(0, 0, 0, 0.3);
}
.wx-btn-primary:hover:not(:disabled) { color: #061a1b; border-color: #c4f5ee; background: linear-gradient(180deg, #aaeae5, #82d6d2); filter: brightness(1.04); }
.wx-btn-violet {
  border-color: rgba(214, 180, 255, 0.6);
  background: linear-gradient(180deg, #9a64e2, #7442c2);
  color: #fff;
  box-shadow: 0 0 22px rgba(150, 90, 230, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.wx-btn-violet:hover:not(:disabled) { border-color: #e4d6ff; background: linear-gradient(180deg, #a874f2, #8250d0); }
.wx-btn-sm { min-height: 36px; padding: 0 14px; font-size: 12.5px; border-radius: 8px; }
.wx-btn-block { width: 100%; }
.wx-btn:disabled, .wx-btn[aria-disabled="true"] { opacity: 0.45; cursor: default; filter: saturate(0.6); }
.wx-link-btn { padding: 2px 0; border: 0; background: none; color: var(--wx-violet); font-size: 12.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.wx-link-btn:hover { color: var(--wx-violet-hi); }

/* ---------------------------------------------------------------- form fields */
:where(input:not([type="checkbox"], [type="radio"], [type="hidden"], [type="submit"], [type="button"]), select, textarea) {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--wx-line-3);
  border-radius: 9px;
  background: rgba(8, 9, 20, 0.62);
  color: var(--wx-text);
  font-size: 14px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
:where(input:not([type="checkbox"], [type="radio"]), select, textarea):hover { border-color: rgba(204, 196, 224, 0.45); }
:where(input:not([type="checkbox"], [type="radio"]), select, textarea):focus { border-color: var(--wx-teal-line); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(128, 212, 210, 0.12); }
:where(input, textarea)::placeholder { color: var(--wx-dim); opacity: 1; }
:where(select) { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--wx-violet) 50%), linear-gradient(135deg, var(--wx-violet) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
:where(select) option { background: var(--wx-surface-solid); color: var(--wx-text); }
:where(input[type="checkbox"], input[type="radio"]) { accent-color: var(--wx-teal); }
.wx-field { display: grid; gap: 7px; color: var(--wx-text-2); font-size: 13px; font-weight: 600; }
.wx-form { display: grid; gap: 15px; }

/* ---------------------------------------------------------------- pills */
.wx-pill { display: inline-flex; align-items: center; gap: 7px; min-height: 26px; padding: 3px 11px; border: 1px solid var(--wx-line-2); border-radius: 999px; background: rgba(14, 12, 28, 0.6); color: var(--wx-text-2); font-size: 12px; font-weight: 700; line-height: 1.3; white-space: nowrap; }
.wx-pill-violet { border-color: rgba(190, 140, 255, 0.5); background: rgba(60, 30, 100, 0.55); color: #ecdfff; }
.wx-pill-teal { border-color: var(--wx-teal-line); background: var(--wx-teal-bg); color: var(--wx-teal-hi); }
.wx-pill-gold { border-color: rgba(232, 203, 142, 0.5); background: var(--wx-gold-bg); color: #f6e2b4; }

/* ---------------------------------------------------------------- tables */
.wx-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.wx-table th { padding: 12px 14px; border-bottom: 1px solid var(--wx-line-2); background: rgba(40, 34, 64, 0.5); color: var(--wx-muted); font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-align: left; text-transform: uppercase; }
.wx-table td { padding: 13px 14px; border-bottom: 1px solid var(--wx-line); color: var(--wx-text-2); }
.wx-table tbody tr:hover td { background: rgba(154, 95, 224, 0.06); }
.wx-table tbody tr:last-child td { border-bottom: 0; }

/* ---------------------------------------------------------------- state dot (servers up / down) */
.state-dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: #e48a7e; box-shadow: 0 0 0 4px rgba(228, 138, 126, 0.18); }
.state-dot.is-up { background: var(--wx-teal); box-shadow: 0 0 0 4px rgba(128, 212, 210, 0.2); }
.state-dot.is-unavailable { background: #8f88a6; box-shadow: 0 0 0 4px rgba(143, 136, 166, 0.18); }

/* ---------------------------------------------------------------- footer (inner pages) */
.content-footer {
  position: relative;
  min-height: 84px;
  padding: 22px max(24px, calc((100vw - var(--wx-max)) / 2));
  border-top: 1px solid var(--wx-line-2);
  background: linear-gradient(180deg, rgba(12, 11, 26, 0.92), rgba(9, 9, 20, 0.98));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--wx-muted);
  font-size: 12px;
}
.content-footer span { display: inline-flex; align-items: center; gap: 10px; color: var(--wx-text); font: 700 13px var(--wx-display); letter-spacing: 0.06em; }
.content-footer span::before { content: ""; width: 40px; height: 27px; background: url("/static/wax-logo.webp") center / contain no-repeat; filter: drop-shadow(0 0 10px rgba(160, 96, 230, 0.35)); }

/* ---------------------------------------------------------------- responsive header */
@media (max-width: 1060px) {
  .site-nav { gap: 2px; }
  .site-nav a { padding: 0 8px; }
}
@media (max-width: 900px) {
  :root { --header-height: 112px; }
  .site-header-inner { grid-template-columns: 112px 1fr; grid-template-rows: 60px 52px; gap: 0 16px; }
  .site-actions { justify-self: end; }
  .site-nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; gap: 4px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a:last-child { margin-right: 24px; }
}
/* With WaxBook's entry (eight entries, public_header.go Wide) the nav needs ~630-692 px in Spanish and French: it takes
   its own row up to 1100 px. The pages below the header (its siblings) read the taller header's height; no :has(),
   which restyles the whole page on every DOM change. */
@media (min-width: 901px) and (max-width: 1100px) {
  .site-header-wide, .site-header-wide ~ * { --header-height: 112px; }
  .site-header-wide .site-header-inner { grid-template-columns: 112px 1fr; grid-template-rows: 60px 52px; gap: 0 16px; }
  .site-header-wide .site-actions { justify-self: end; }
  .site-header-wide .site-nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; gap: 4px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
  .site-header-wide .site-nav::-webkit-scrollbar { display: none; }
  .site-header-wide .site-nav a:last-child { margin-right: 24px; }
}
@media (max-width: 560px) {
  .site-header-inner { width: calc(100% - 28px); grid-template-columns: 96px 1fr; }
  .site-brand, .site-brand img { width: 96px; height: 50px; }
  .site-actions { gap: 8px; }
  .site-languages a { width: 28px; }
  .site-account { min-width: 0; padding-inline: 13px; }
  .site-nav a { padding: 0 9px; font-size: 12.5px; }
  .wx-page, .wx-page-narrow { width: calc(100% - 32px); padding: 32px 0 64px; }
  .content-footer { flex-direction: column; align-items: flex-start; gap: 10px; padding: 20px 16px; }
}
@media (max-width: 360px) {
  .site-languages a { width: 25px; }
  .site-account { padding-inline: 10px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
