/* ==========================================================================
   Travix W — public theme design system
   One stylesheet for every public page: tokens, night/day palettes,
   components and page layouts. Night is the default palette; the day
   palette overrides the same tokens under html[data-theme="day"].
   ========================================================================== */

/* ---------- Fonts (self-hosted, variable Cinzel covers 400–900) ---------- */
@font-face {
  font-family: 'Cinzel';
  src: url('../fonts/cinzel-latin-ext.woff2') format('woff2');
  font-weight: 400 900; font-style: normal; font-display: swap;
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Cinzel';
  src: url('../fonts/cinzel-latin.woff2') format('woff2');
  font-weight: 400 900; 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: 'Great Vibes';
  src: url('../fonts/great-vibes-latin-ext.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Great Vibes';
  src: url('../fonts/great-vibes-latin.woff2') format('woff2');
  font-weight: 400; 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;
}

/* ---------- Tokens: night (default) ---------- */
:root {
  color-scheme: dark;

  --font-display: 'Cinzel', 'Trajan Pro', Georgia, 'Times New Roman', serif;
  --font-script: 'Great Vibes', 'Segoe Script', cursive;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --bg: #070a12;
  --bg-2: #0a0f1b;
  --bg-3: #0e1524;
  --surface: rgba(13, 19, 33, .80);
  --surface-2: rgba(22, 30, 50, .62);
  --surface-3: rgba(255, 255, 255, .035);
  --surface-solid: #0f1626;
  --hover: rgba(255, 255, 255, .06);
  --line: rgba(222, 186, 110, .15);
  --line-2: rgba(222, 186, 110, .32);
  --line-soft: rgba(255, 255, 255, .075);

  --text: #eceff6;
  --text-2: #aab4c6;
  --text-3: #7d889e;

  --gold: #e2b65a;
  --gold-hi: #f6da96;
  --gold-lo: #b0812a;
  --gold-ink: #e8c36e;
  --gold-soft: rgba(226, 182, 90, .12);
  --gold-ring: rgba(226, 182, 90, .30);
  --gold-glow: rgba(226, 182, 90, .40);
  --on-gold: #1d1404;

  --green: #4fd18b; --green-soft: rgba(79, 209, 139, .13);
  --red: #f0696b;   --red-soft: rgba(240, 105, 107, .13);
  --blue: #78aaff;  --blue-soft: rgba(120, 170, 255, .13);
  --violet: #ab8ffb; --violet-soft: rgba(171, 143, 251, .14);

  --input-bg: rgba(5, 8, 15, .55);
  --input-bg-focus: rgba(5, 8, 15, .78);
  --input-border: rgba(255, 255, 255, .11);

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .35);
  --shadow: 0 18px 50px rgba(0, 0, 0, .50);
  --shadow-lg: 0 40px 110px rgba(0, 0, 0, .62);
  --inner-hi: rgba(255, 228, 170, .07);

  --header-bg: rgba(7, 10, 18, .74);
  --header-top: linear-gradient(180deg, rgba(4, 6, 12, .62) 0%, rgba(4, 6, 12, 0) 100%);

  --hero-scrim:
    linear-gradient(90deg, rgba(5, 8, 15, .93) 0%, rgba(5, 8, 15, .74) 34%, rgba(5, 8, 15, .18) 66%, rgba(5, 8, 15, .06) 100%),
    linear-gradient(180deg, rgba(5, 8, 15, .45) 0%, rgba(5, 8, 15, 0) 22%, rgba(5, 8, 15, 0) 68%, var(--bg) 100%);
  --page-scrim:
    linear-gradient(180deg, rgba(5, 8, 15, .80) 0%, rgba(5, 8, 15, .88) 45%, var(--bg) 100%);
  --hero-scrim-m:
    linear-gradient(180deg, rgba(5, 8, 15, .30) 0%, rgba(5, 8, 15, .10) 22%, rgba(5, 8, 15, .58) 46%, rgba(5, 8, 15, .90) 66%, var(--bg) 100%);
  --band-scrim:
    linear-gradient(180deg, var(--bg) 0%, rgba(5, 8, 15, .55) 30%, rgba(5, 8, 15, .55) 70%, var(--bg) 100%);
  --backdrop: radial-gradient(ellipse at 50% 32%, rgba(10, 14, 24, .58) 0%, rgba(2, 4, 9, .86) 100%);

  --map-bg: radial-gradient(circle at 50% 50%, #18233b 0%, #0d1424 75%);
  --map-grid: rgba(255, 255, 255, .045);
  --map-dot: #e9c46a;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --header-h: 72px;
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
}

/* ---------- Tokens: day ----------
   A warm, muted parchment rather than paper white: mid-tone surfaces, no
   pure-white fills, and the day artwork is dimmed and warmed a little. */
html[data-theme="day"] {
  color-scheme: light;

  --bg: #ddd1ba;
  --bg-2: #d3c6ac;
  --bg-3: #c9ba9d;
  --surface: rgba(236, 227, 209, .90);
  --surface-2: rgba(228, 217, 196, .92);
  --surface-3: rgba(70, 50, 15, .055);
  --surface-solid: #e9dfcb;
  --hover: rgba(70, 50, 15, .075);
  --line: rgba(110, 76, 20, .24);
  --line-2: rgba(110, 76, 20, .42);
  --line-soft: rgba(60, 42, 12, .12);

  --text: #21180d;
  --text-2: #4a3e2e;
  --text-3: #625546;

  --gold: #ab7a22;
  --gold-hi: #cf9f40;
  --gold-lo: #80570f;
  --gold-ink: #744c07;
  --gold-soft: rgba(171, 122, 34, .14);
  --gold-ring: rgba(171, 122, 34, .28);
  --gold-glow: rgba(150, 100, 20, .34);

  --green: #166a39; --green-soft: rgba(22, 106, 57, .12);
  --red: #b23434;   --red-soft: rgba(178, 52, 52, .11);
  --blue: #285db8;  --blue-soft: rgba(40, 93, 184, .11);
  --violet: #6246c2; --violet-soft: rgba(98, 70, 194, .11);

  --input-bg: rgba(244, 237, 223, .80);
  --input-bg-focus: #f6f0e3;
  --input-border: rgba(80, 58, 18, .26);

  --shadow-sm: 0 2px 10px rgba(60, 40, 10, .14);
  --shadow: 0 18px 50px rgba(60, 40, 10, .22);
  --shadow-lg: 0 40px 110px rgba(40, 26, 6, .32);
  --inner-hi: rgba(255, 250, 238, .45);

  --header-bg: rgba(226, 215, 194, .90);
  --header-top: linear-gradient(180deg, rgba(222, 210, 188, .85) 0%, rgba(222, 210, 188, 0) 100%);

  --hero-scrim:
    linear-gradient(90deg, rgba(221, 209, 186, .94) 0%, rgba(221, 209, 186, .80) 33%, rgba(221, 209, 186, .18) 64%, rgba(221, 209, 186, 0) 100%),
    linear-gradient(180deg, rgba(221, 209, 186, .40) 0%, rgba(221, 209, 186, 0) 22%, rgba(221, 209, 186, 0) 70%, var(--bg) 100%);
  --page-scrim:
    linear-gradient(180deg, rgba(219, 207, 184, .84) 0%, rgba(219, 207, 184, .92) 45%, var(--bg) 100%);
  --hero-scrim-m:
    linear-gradient(180deg, rgba(221, 209, 186, .30) 0%, rgba(221, 209, 186, .10) 22%, rgba(221, 209, 186, .62) 46%, rgba(221, 209, 186, .92) 66%, var(--bg) 100%);
  --band-scrim:
    radial-gradient(ellipse 60% 52% at 50% 50%, rgba(228, 217, 196, .78) 0%, rgba(228, 217, 196, .45) 62%, rgba(228, 217, 196, 0) 100%),
    linear-gradient(180deg, var(--bg) 0%, rgba(219, 207, 184, .66) 30%, rgba(219, 207, 184, .66) 70%, var(--bg) 100%);
  --backdrop: radial-gradient(ellipse at 50% 32%, rgba(50, 36, 14, .34) 0%, rgba(30, 20, 6, .58) 100%);

  --map-bg: radial-gradient(circle at 50% 50%, #ece1c9 0%, #d8c9a9 80%);
  --map-grid: rgba(100, 72, 22, .10);
  --map-dot: #94660f;
}

/* ---------- Light version ----------
   Computers without graphics acceleration (html.lite, w.js liteCheck) redraw
   blur, fixed backgrounds and looping effects on the processor every frame.
   There the glass panels lose the blur and get a little more solid instead,
   the page glow scrolls with the page, and the fireflies and small looping
   effects stay still. Everything else looks the same. */
html.lite:not([data-theme="day"]) {
  --surface: rgba(13, 19, 33, .93);
  --surface-2: rgba(22, 30, 50, .86);
  --header-bg: rgba(7, 10, 18, .94);
}
html.lite[data-theme="day"] {
  --surface: rgba(236, 227, 209, .97);
  --surface-2: rgba(228, 217, 196, .97);
  --header-bg: rgba(226, 215, 194, .97);
}
html.lite *, html.lite *::before, html.lite *::after { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
html.lite body { background-attachment: scroll; }
html.lite .fx-canvas { display: none; }
html.lite .theme-switch .stars::after, html.lite .theme-switch .clouds::before, html.lite .theme-switch .clouds::after,
html.lite .theme-switch .rays::before, html.lite .theme-switch .rays::after, html.lite .pill-live .dot, html.lite .tl-fill::after,
html.lite .scroll-cue .mouse::after, html.lite .tx-loader-name { animation: none; }

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  scrollbar-color: var(--gold-lo) var(--bg);
  scrollbar-width: thin;
}
body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 620px at 85% -8%, rgba(120, 170, 255, .07), transparent 62%),
    radial-gradient(900px 600px at -5% 28%, rgba(226, 182, 90, .06), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
html[data-theme="day"] body {
  background-image:
    radial-gradient(1100px 620px at 85% -8%, rgba(255, 214, 140, .16), transparent 62%),
    radial-gradient(900px 600px at -5% 28%, rgba(110, 140, 80, .08), transparent 60%);
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: var(--gold-ink); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold-hi); }
html[data-theme="day"] a:hover { color: var(--gold-lo); }
::selection { background: var(--gold); color: var(--on-gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo));
  border: 3px solid var(--bg);
  border-radius: 999px;
}
h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; text-wrap: balance; }
p + p { margin-top: .9em; }
code {
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: .9em;
  padding: .12em .45em;
  border-radius: 6px;
  background: var(--gold-soft);
  border: 1px solid var(--line);
  color: var(--gold-ink);
}
.icon { display: inline-block; vertical-align: -.18em; width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-fill { fill: currentColor; stroke: none; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.gold { color: var(--gold-ink); }
.green { color: var(--green); }
.red { color: var(--red); }

/* Smooth palette swap when the View Transition API is unavailable or skipped
   (Samsung Internet, w.js setTheme). The artwork crossfades on its own (.art). */
html.theme-anim body,
html.theme-anim .site-header,
html.theme-anim .panel,
html.theme-anim .card,
html.theme-anim .btn,
html.theme-anim .input {
  transition: background-color .8s ease, color .8s ease, border-color .8s ease, box-shadow .8s ease !important;
}
/* Day / night with the View Transition API: the new look fades in slowly over a
   still picture of the old one, the whole page in one piece, like dusk or dawn.
   html.vt is only set for this switch (page-to-page transitions are below).
   The still picture cannot scroll or be clicked, so scrolling, clicking or a
   key finishes the fade at once (w.js). */
html.vt::view-transition-old(root), html.vt::view-transition-new(root) { mix-blend-mode: normal; }
html.vt::view-transition-old(root) { animation: none; }
html.vt::view-transition-new(root) { animation: themeIn 3s cubic-bezier(.45, .05, .35, 1) both; }
@keyframes themeIn { from { opacity: 0; } }

/* Page to page (login, register, activation, ...): a soft cross-fade instead of
   a hard cut, where the browser supports it (cross-document View Transitions,
   Chrome/Edge 126+, Safari 18.2+). The header stays put, the background stays
   put and the main card glides into the next page's card. Names apply only
   during these transitions, so they change nothing else. Only the first card
   on a page is named (register has state variants; a name must be unique). */
@view-transition { navigation: auto; types: page; }
html:active-view-transition-type(page) .site-header { view-transition-name: site-header; }
html:active-view-transition-type(page) .page-art { view-transition-name: page-art; }
html:active-view-transition-type(page) .auth-card:not(.auth-card ~ .auth-card) { view-transition-name: auth-card; }
html:active-view-transition-type(page)::view-transition-old(root) { animation: pageOut .45s cubic-bezier(.4, 0, .6, 1) both; }
html:active-view-transition-type(page)::view-transition-new(root) { animation: pageIn 1s cubic-bezier(.22, 1, .36, 1) .1s both; }
html:active-view-transition-type(page)::view-transition-group(auth-card) { animation-duration: 1s; animation-timing-function: cubic-bezier(.22, 1, .36, 1); }
/* The old card is stretched while the box grows: let it go quickly. */
html:active-view-transition-type(page)::view-transition-old(auth-card) { animation-duration: .25s; }
html:active-view-transition-type(page)::view-transition-new(auth-card) { animation-duration: .6s; }
@keyframes pageOut { to { opacity: 0; } }
@keyframes pageIn { from { opacity: 0; transform: translateY(30px); } }
/* Arriving through such a transition, the scroll-in reveals would fade the
   card in a second time: show them at once (head.php sets html.vt-nav). */
html.js.vt-nav .reveal { opacity: 1; transform: none; transition: none; }

/* Loading cover (head.php) on every visit: shown with html.tx-wait from the
   first paint, lifted by html.tx-ready once the page has loaded (w.js, or a
   14 s timer in head.php). */
.tx-loader { display: none; }
html.js .tx-loader {
  position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center;
  background-color: var(--bg);
  background-image: radial-gradient(760px 460px at 50% 46%, var(--gold-soft), transparent 68%);
  opacity: 0; visibility: hidden;
  transition: opacity .7s ease, visibility 0s linear .7s;
}
html.js.tx-wait:not(.tx-ready) .tx-loader { opacity: 1; visibility: visible; transition: opacity .35s ease; }
.tx-loader-in { display: flex; flex-direction: column; align-items: center; transition: transform .7s var(--ease-out); }
html.tx-ready .tx-loader-in { transform: translateY(-10px) scale(.98); }
.tx-loader-name {
  font-family: var(--font-script); font-size: clamp(54px, 9vw, 84px); line-height: 1.15; padding: 0 12px 6px;
  background: linear-gradient(180deg, #fff3a8 0%, #f6d06a 48%, #d39b2f 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 18px rgba(226, 182, 90, .3));
  animation: txGlow 2.4s ease-in-out infinite alternate;
}
html[data-theme="day"] .tx-loader-name {
  background: linear-gradient(180deg, #c9902a 0%, #a5701a 55%, #7f5309 100%); -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .6));
}
.tx-loader-sub { font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: .5em; padding-left: .5em; color: var(--text-3); margin-top: -4px; }
.tx-loader-bar { position: relative; width: min(240px, 64vw); height: 3px; margin-top: 26px; border-radius: 3px; overflow: hidden; background: var(--line); }
/* The fill: head.php scales it from 0 to 1 as the page loads. A glint runs
   along the filled part. */
.tx-loader-bar i {
  position: absolute; inset: 0; overflow: hidden; border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-lo), var(--gold) 55%, var(--gold-hi));
  transform: scaleX(0); transform-origin: left center;
  transition: transform .25s ease-out;
}
.tx-loader-bar i::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 42%;
  background: linear-gradient(90deg, transparent, rgba(255, 246, 214, .7), transparent);
  animation: txSweep 1.5s cubic-bezier(.45, 0, .55, 1) infinite;
}
@keyframes txSweep { from { transform: translateX(-100%); } to { transform: translateX(240%); } }
@keyframes txGlow { from { opacity: .82; } to { opacity: 1; } }

/* Language switch: brief dip while the copy is replaced. */
html.lang-switching main, html.lang-switching .site-header nav, html.lang-switching .site-footer {
  opacity: .25; transition: opacity .14s ease;
}
main, .site-header nav, .site-footer { transition: opacity .3s ease; }
/* First paint in a non-English language waits for the translation pass
   (a safety animation reveals the page even if scripts never run). */
html.i18n-wait body { opacity: 0; animation: i18nReveal 0s linear 1.4s forwards; }
@keyframes i18nReveal { to { opacity: 1; } }
body { transition: opacity .25s ease; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.container-sm { max-width: calc(880px + var(--gutter) * 2); }
.section { position: relative; padding-block: clamp(64px, 9vw, 112px); }
.section-tight { padding-block: clamp(44px, 6vw, 72px); }
.stack > * + * { margin-top: var(--stack, 16px); }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1 1 auto; min-width: 0; }

/* Scroll reveal (only when JS is running). */
html.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); transition-delay: var(--d, 0s); }
html.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Ornaments & section heads ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--font-display);
  font-size: 12px; font-weight: 700; letter-spacing: .34em; text-transform: uppercase;
  color: var(--gold-ink);
}
.eyebrow::before, .eyebrow::after {
  content: ''; width: 38px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.eyebrow::after { background: linear-gradient(270deg, transparent, var(--gold)); }
.eyebrow.left::before { display: none; }
.sec-head { text-align: center; max-width: 760px; margin: 0 auto clamp(32px, 5vw, 52px); }
.sec-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.7vw, 46px);
  font-weight: 700; line-height: 1.12; letter-spacing: .01em;
  margin-top: 12px;
}
.sec-sub { color: var(--text-2); font-size: clamp(15px, 1.4vw, 17px); margin-top: 12px; }
.accent {
  background: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 55%, var(--gold-lo) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--gold);
}
html[data-theme="day"] .accent { background: linear-gradient(180deg, #c8952f 0%, #9d6c14 60%, #7a5009 100%); -webkit-background-clip: text; background-clip: text; }
.divider-orn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  color: var(--gold); margin: 14px auto 0;
}
.divider-orn::before, .divider-orn::after { content: ''; height: 1px; width: 70px; background: linear-gradient(90deg, transparent, var(--line-2)); }
.divider-orn::after { background: linear-gradient(270deg, transparent, var(--line-2)); }
.divider-orn i { width: 7px; height: 7px; transform: rotate(45deg); border: 1px solid var(--gold); background: var(--gold-soft); }

/* ---------- Buttons ---------- */
.btn {
  --h: 44px;
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: var(--h); padding: 0 20px;
  border-radius: 11px; border: 1px solid transparent;
  font-family: var(--font-display); font-size: 13.5px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; white-space: nowrap;
  color: var(--text); background: transparent;
  transition: transform .2s var(--ease), box-shadow .25s, background-color .25s, border-color .25s, color .2s, filter .2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn .icon { width: 17px; height: 17px; }
.btn:active { transform: translateY(1px) scale(.985); }
.btn-sm { --h: 36px; padding: 0 14px; font-size: 12px; border-radius: 9px; }
.btn-lg { --h: 52px; padding: 0 28px; font-size: 14.5px; border-radius: 13px; }
.btn-block { width: 100%; }
/* Long labels (other languages, narrow phones): big and full-width buttons take
   a second line instead of cutting their text off; labels that fit keep the
   one-line height (min-height = --h). No icon or logo shrinks away. Small
   header and toolbar buttons stay on one line. */
.btn > svg { flex: none; }
.btn-lg, .btn-block, .world-actions .btn, .srv-actions .btn, #hall-of-fame .btn { white-space: normal; text-align: center; line-height: 1.2; height: auto; min-height: var(--h); padding-top: 6px; padding-bottom: 6px; max-width: 100%; }
@media (max-width: 420px) {
  .btn-lg, .btn-block, .world-actions .btn, .srv-actions .btn, #hall-of-fame .btn { letter-spacing: .05em; gap: 7px; }
  .srv-actions .btn { padding-left: 14px; padding-right: 14px; }
  .btn-lg { padding-left: 16px; padding-right: 16px; }
  .world-actions .btn { flex-basis: 100%; }
}
.btn-gold {
  color: #241604;
  background: linear-gradient(180deg, #f8df9e 0%, #e8be5f 44%, #c3912f 100%);
  border-color: rgba(120, 80, 10, .55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -1px 0 rgba(90, 55, 0, .25), 0 8px 24px -8px var(--gold-glow);
  text-shadow: 0 1px 0 rgba(255, 240, 200, .5);
}
.btn-gold::after {
  content: ''; position: absolute; z-index: -1; top: 0; bottom: 0; left: -60%; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-20deg); transition: left .7s var(--ease);
}
.btn-gold:hover { color: #241604; filter: brightness(1.05) saturate(1.05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 12px 30px -8px var(--gold-glow); transform: translateY(-1px); }
.btn-gold:hover::after { left: 120%; }
.btn-ghost { border-color: var(--line-2); background: var(--surface-3); color: var(--text); backdrop-filter: blur(6px); }
.btn-ghost:hover { color: var(--text); border-color: var(--gold); background: var(--gold-soft); }
.btn-quiet { color: var(--text-2); }
.btn-quiet:hover { color: var(--text); background: var(--hover); }
.btn-danger {
  color: #fff; border-color: rgba(120, 20, 20, .5);
  background: linear-gradient(180deg, #ef7272 0%, #c93d40 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 8px 24px -10px rgba(220, 60, 60, .6);
}
.btn-danger:hover { color: #fff; filter: brightness(1.06); }
.btn-google {
  font-family: var(--font-body); text-transform: none; letter-spacing: 0; font-size: 15px; font-weight: 600;
  background: #131314; color: #e3e3e3; border-color: #5f6368;
}
.btn-google:hover { color: #fff; background: #1d1e20; border-color: #8e918f; }
html[data-theme="day"] .btn-google { background: #fff; color: #1f1f1f; border-color: #c4c7c5; }
html[data-theme="day"] .btn-google:hover { background: #f8f9fa; border-color: #8e918f; color: #1f1f1f; }
.btn-google .g-logo { width: 18px; height: 18px; }
.btn.is-loading { color: transparent !important; text-shadow: none; pointer-events: none; }
.btn.is-loading::before {
  content: ''; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px;
  border-radius: 50%; border: 2px solid rgba(36, 22, 4, .25); border-top-color: #241604;
  animation: spin .7s linear infinite;
}
.btn-ghost.is-loading::before { border-color: var(--line-2); border-top-color: var(--gold); }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface-3);
  color: var(--text-2); transition: color .2s, background .2s, border-color .2s, transform .2s;
}
.icon-btn:hover { color: var(--gold-ink); border-color: var(--line-2); background: var(--gold-soft); }
.icon-btn .icon { width: 19px; height: 19px; }
.link-btn { color: var(--gold-ink); font-weight: 600; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Pills / chips ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 26px; padding: 0 11px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  border: 1px solid var(--line-2); background: var(--surface-3); color: var(--text-2);
  backdrop-filter: blur(8px);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-live { color: var(--green); border-color: color-mix(in srgb, var(--green) 45%, transparent); background: var(--green-soft); }
.pill-live .dot { animation: pulseDot 1.8s ease-in-out infinite; }
.pill-soon { color: var(--gold-ink); border-color: color-mix(in srgb, var(--gold) 50%, transparent); background: var(--gold-soft); }
.pill-closed, .pill-ended { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, transparent); background: var(--red-soft); }
.pill-info { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 45%, transparent); background: var(--blue-soft); }
.pill-current { color: #241604; background: linear-gradient(180deg, #f6d98f, #d7a548); border-color: rgba(120, 80, 10, .5); }
.pill-violet { color: var(--violet); border-color: color-mix(in srgb, var(--violet) 45%, transparent); background: var(--violet-soft); }
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); }
  50% { box-shadow: 0 0 0 6px transparent; }
}
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--text-2);
  background: var(--surface-3); border: 1px solid var(--line-soft);
}
.gold-coin { display: inline-block; width: 13px; height: 13px; border-radius: 50%; vertical-align: -1px;
  background: radial-gradient(circle at 35% 30%, #fff3c4 0 18%, #f2c752 40%, #b07d16 100%);
  box-shadow: inset 0 0 0 1px rgba(110, 70, 0, .45), 0 0 6px rgba(240, 190, 80, .35); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 960; height: var(--header-h);
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(1.25); -webkit-backdrop-filter: blur(16px) saturate(1.25);
  transition: background-color .35s, border-color .35s, backdrop-filter .35s, box-shadow .35s;
}
.site-header.is-top { background: var(--header-top); border-bottom-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.site-header .bar { height: 100%; display: flex; align-items: center; gap: 22px; }
.header-spacer { height: var(--header-h); }
.brand { display: inline-flex; flex-direction: column; align-items: center; line-height: 1; flex: none; color: inherit; }
.brand:hover { color: inherit; }
.brand-name {
  font-family: var(--font-script); font-size: 36px; font-weight: 400; padding: 0 6px 4px; margin-top: -4px;
  background: linear-gradient(180deg, #fff3a8 0%, #f6d06a 48%, #d39b2f 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 10px rgba(226, 182, 90, .25));
}
html[data-theme="day"] .brand-name { background: linear-gradient(180deg, #c9902a 0%, #a5701a 55%, #7f5309 100%); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .6)); }
.brand-sub { font-family: var(--font-display); font-size: 8.5px; font-weight: 700; letter-spacing: .42em; color: var(--text-3); margin-top: -2px; padding-left: .42em; }
.main-nav { display: flex; align-items: center; gap: 2px; margin-left: 6px; }
.main-nav > a, .nav-drop > button {
  position: relative; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  height: 40px; padding: 0 13px; border-radius: 10px;
  font-family: var(--font-display); font-size: 12.5px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase;
  color: var(--text-2); transition: color .2s, background .2s;
}
.main-nav > a:hover, .nav-drop > button:hover, .nav-drop.is-open > button { color: var(--text); background: var(--hover); }
.main-nav > a.is-active, .nav-drop > button.is-active { color: var(--gold-ink); }
.main-nav > a.is-active::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 5px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  box-shadow: 0 0 10px var(--gold-glow);
}
.nav-drop { position: relative; }
.nav-drop > button .icon { width: 14px; height: 14px; transition: transform .25s; }
.nav-drop.is-open > button .icon { transform: rotate(180deg); }
.dropdown {
  position: absolute; top: calc(100% + 10px); left: 0; min-width: 230px; z-index: 50;
  padding: 8px; border-radius: 14px;
  background: var(--surface-solid); border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 var(--inner-hi);
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98); transform-origin: top left;
  transition: opacity .2s, transform .25s var(--ease-out), visibility .2s;
}
.dropdown.right { left: auto; right: 0; transform-origin: top right; }
.is-open > .dropdown { opacity: 1; visibility: visible; transform: none; }
.drop-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--text); font-size: 14px; font-weight: 600; width: 100%; text-align: left;
}
.drop-item:hover, .drop-item:focus-visible { background: var(--hover); color: var(--text); outline: none; }
.drop-item .icon { width: 18px; height: 18px; color: var(--gold-ink); }
.drop-item small { display: block; font-size: 12px; font-weight: 500; color: var(--text-3); }
.drop-item .end { margin-left: auto; color: var(--text-3); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.drop-item.is-active { background: var(--gold-soft); }
.drop-item.is-active .end { color: var(--gold-ink); }
.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

/* Language picker */
.lang-picker { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 11px 0 9px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface-3);
  font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--text-2);
  transition: border-color .2s, background .2s, color .2s;
}
.lang-btn:hover, .lang-picker.is-open .lang-btn { color: var(--text); border-color: var(--line-2); background: var(--gold-soft); }
.lang-btn .icon { width: 14px; height: 14px; transition: transform .25s; }
.lang-picker.is-open .lang-btn .icon { transform: rotate(180deg); }
.flag { display: inline-block; vertical-align: middle; width: 24px; height: 16px; flex: none; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, .18), 0 1px 3px rgba(0, 0, 0, .25); }
[data-lang-current] { display: inline-flex; }
.flag svg { width: 100%; height: 100%; display: block; }
.lang-menu { min-width: 236px; }
.lang-menu .drop-item { padding: 9px 12px; }
.lang-menu .check { margin-left: 6px; width: 16px; height: 16px; color: var(--gold-ink); opacity: 0; }
.lang-menu .is-active .check { opacity: 1; }

/* Day / night switch, timed to the 3 s page fade (w.js setTheme, themeIn).
   To day: the crescent waxes to a full moon, glides left turning gold under a
   dawn sky and becomes the sun, whose rays burst out; clouds drift in.
   To night: the sun sinks below the edge, reddening under a sunset sky, then
   the crescent moon rises on the right and the stars come out.
   Day look: a glowing sun with slowly turning rays, two layers of drifting
   clouds. Night is the default; D = the day look, which follows
   html[data-theme] except while w.js flips the switch ahead of the page
   ([data-to], set on the click). Each look's rules carry the timing of the
   change towards it; a 0s duration moves a hidden part out of the way. */
@property --cut { syntax: '<length>'; inherits: false; initial-value: 8px; }
@property --mx { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --my { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --sy { syntax: '<length>'; inherits: false; initial-value: 0px; }
.theme-switch {
  --travel: 30px;
  position: relative; flex: none; width: 64px; height: 34px; border-radius: 999px;
  border: 1px solid var(--line-2); overflow: hidden; isolation: isolate;
  background: linear-gradient(180deg, #0b1330 0%, #1a2654 100%);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, .18);
  transition: border-color .3s;
}
/* Sky layers over the night blue: dawn / dusk glow, then the day sky. */
.theme-switch::before, .theme-switch::after { content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0; }
.theme-switch::before {
  background:
    radial-gradient(90% 75% at 24% 108%, #ffd27a 0%, #ff9a5c 30%, rgba(236, 104, 120, 0) 72%),
    linear-gradient(180deg, #2c3a7c 0%, #7a5aa6 50%, #e07f8a 100%);
  transition: opacity 1.7s ease 1.3s;
}
.theme-switch::after {
  background:
    radial-gradient(70% 90% at 16% 50%, rgba(255, 250, 225, .75) 0%, rgba(255, 250, 225, 0) 70%),
    linear-gradient(180deg, #3d8ee6 0%, #6fb2f2 55%, #b3dbfd 100%);
  transition: opacity 1.7s ease .2s;
}
.theme-switch .stars, .theme-switch .clouds { position: absolute; inset: 0; }
.theme-switch .stars { background:
  radial-gradient(1px 1px at 9px 10px, #fff 50%, transparent 51%),
  radial-gradient(1.2px 1.2px at 17px 21px, #fff 50%, transparent 51%),
  radial-gradient(1px 1px at 25px 8px, #dfe8ff 50%, transparent 51%),
  radial-gradient(.8px .8px at 13px 27px, #fff 50%, transparent 51%),
  radial-gradient(1px 1px at 29px 25px, #fff 50%, transparent 51%);
  opacity: 1; transform: none;
  transition: opacity 1s ease 2s, transform 1.2s var(--ease-out) 2s; }
.theme-switch .stars::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(1.4px 1.4px at 14px 15px, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 22px 28px, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 6px 20px, #e9efff 50%, transparent 51%);
  animation: tsTwinkle 2.6s ease-in-out infinite alternate;
}
@keyframes tsTwinkle { from { opacity: .15; } to { opacity: 1; } }
/* Clouds: two repeating strips sliding left forever, the far one slower. */
.theme-switch .clouds {
  opacity: 0; transform: translateX(16px);
  transition: opacity .8s ease, transform 0s .8s;
}
.theme-switch .clouds::before, .theme-switch .clouds::after {
  content: ''; position: absolute; top: 0; left: 0; height: 100%; background-repeat: repeat-x;
}
.theme-switch .clouds::before {
  width: calc(100% + 52px);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='32'%3E%3Cg fill='%23cfe0f3' transform='translate(0 1)'%3E%3Ccircle cx='24.16' cy='9.84' r='2.16'/%3E%3Ccircle cx='27.46' cy='7.8' r='2.88'/%3E%3Ccircle cx='31.36' cy='8.64' r='2.4'/%3E%3Ccircle cx='34.06' cy='10.2' r='1.68'/%3E%3Crect x='24.16' y='9.6' width='9.9' height='2.4' rx='1.2'/%3E%3C/g%3E%3Cg fill='%23f4f9ff'%3E%3Ccircle cx='24.16' cy='9.84' r='2.16'/%3E%3Ccircle cx='27.46' cy='7.8' r='2.88'/%3E%3Ccircle cx='31.36' cy='8.64' r='2.4'/%3E%3Ccircle cx='34.06' cy='10.2' r='1.68'/%3E%3Crect x='24.16' y='9.6' width='9.9' height='2.4' rx='1.2'/%3E%3C/g%3E%3C/svg%3E");
  animation: tsDriftFar 30s linear infinite;
}
.theme-switch .clouds::after {
  width: calc(100% + 72px);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='32'%3E%3Cg fill='%23c6daef' transform='translate(0 1.4)'%3E%3Ccircle cx='5.6' cy='22.4' r='3.6'/%3E%3Ccircle cx='11.1' cy='19' r='4.8'/%3E%3Ccircle cx='17.6' cy='20.4' r='4'/%3E%3Ccircle cx='22.1' cy='23' r='2.8'/%3E%3Crect x='5.6' y='22' width='16.5' height='4' rx='2'/%3E%3Ccircle cx='44.45' cy='18.55' r='2.45'/%3E%3Ccircle cx='48.19' cy='16.24' r='3.26'/%3E%3Ccircle cx='52.61' cy='17.19' r='2.72'/%3E%3Ccircle cx='55.67' cy='18.96' r='1.9'/%3E%3Crect x='44.45' y='18.28' width='11.22' height='2.72' rx='1.36'/%3E%3C/g%3E%3Cg fill='%23ffffff'%3E%3Ccircle cx='5.6' cy='22.4' r='3.6'/%3E%3Ccircle cx='11.1' cy='19' r='4.8'/%3E%3Ccircle cx='17.6' cy='20.4' r='4'/%3E%3Ccircle cx='22.1' cy='23' r='2.8'/%3E%3Crect x='5.6' y='22' width='16.5' height='4' rx='2'/%3E%3Ccircle cx='44.45' cy='18.55' r='2.45'/%3E%3Ccircle cx='48.19' cy='16.24' r='3.26'/%3E%3Ccircle cx='52.61' cy='17.19' r='2.72'/%3E%3Ccircle cx='55.67' cy='18.96' r='1.9'/%3E%3Crect x='44.45' y='18.28' width='11.22' height='2.72' rx='1.36'/%3E%3C/g%3E%3C/svg%3E");
  animation: tsDriftNear 18s linear infinite;
}
@keyframes tsDriftFar { to { transform: translateX(-52px); } }
@keyframes tsDriftNear { to { transform: translateX(-72px); } }
/* Sun: halo, rays, disc. --sy sinks it below the edge. */
.theme-switch .sun, .theme-switch .moon { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; }
.theme-switch .sun {
  transform: translateY(var(--sy)); --sy: 34px; opacity: 0;
  filter: hue-rotate(-30deg) saturate(1.6) brightness(.95);
  transition: --sy 1.8s cubic-bezier(.45, 0, .8, .55), filter 1.4s ease .1s, opacity 0s 1.8s;
}
.theme-switch .sun::before {
  content: ''; position: absolute; inset: -9px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 236, 160, .75) 0%, rgba(255, 214, 110, .3) 45%, rgba(255, 214, 110, 0) 70%);
}
.theme-switch .sun::after {
  content: ''; position: absolute; inset: 3px; border-radius: 50%;
  background: radial-gradient(circle at 36% 33%, #fffbe8 0%, #ffe680 26%, #ffc935 62%, #f6a51f 100%);
  box-shadow: inset -2px -3px 4px rgba(226, 120, 10, .35), 0 0 7px 1px rgba(255, 206, 80, .75);
}
.theme-switch .rays {
  position: absolute; inset: -2px; border-radius: 50%;
  opacity: 0; scale: .55; transform: rotate(-60deg);
  transition: opacity .6s ease, scale .8s ease, transform .8s ease;
}
.theme-switch .rays::before, .theme-switch .rays::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  animation: tsSpin 40s linear infinite;
}
.theme-switch .rays::before {
  background: repeating-conic-gradient(from -4deg, #ffcf48 0deg 8deg, rgba(255, 207, 72, 0) 8deg 45deg);
  -webkit-mask: radial-gradient(closest-side, transparent 69%, #000 72%, rgba(0, 0, 0, .75) 88%, transparent 100%);
  mask: radial-gradient(closest-side, transparent 69%, #000 72%, rgba(0, 0, 0, .7) 86%, transparent 100%);
}
.theme-switch .rays::after {
  background: repeating-conic-gradient(from 18.5deg, #ffdb6e 0deg 5deg, rgba(255, 219, 110, 0) 5deg 45deg);
  -webkit-mask: radial-gradient(closest-side, transparent 69%, #000 72%, transparent 88%);
  mask: radial-gradient(closest-side, transparent 69%, #000 72%, transparent 86%);
}
@keyframes tsSpin { to { rotate: 360deg; } }
/* Moon: --cut slides the shadow (crescent to full), the gold layer turns it
   into the sun's disc, --mx / --my move it (it waits below the edge by day). */
.theme-switch .moon {
  transform: translate(var(--mx), var(--my)); --mx: var(--travel); --my: 0px; scale: 1; opacity: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .45)) drop-shadow(0 0 5px rgba(200, 215, 255, .4));
  transition: --mx 0s, --my 1.4s cubic-bezier(.25, .6, .3, 1) 1.5s, scale 0s, opacity 0s, filter 0s;
}
.theme-switch .disc {
  position: absolute; inset: 0; border-radius: 50%; overflow: hidden;
  background:
    radial-gradient(circle 2.6px at 8px 15px, rgba(140, 152, 185, .6) 92%, transparent),
    radial-gradient(circle 1.8px at 13px 21px, rgba(140, 152, 185, .55) 92%, transparent),
    radial-gradient(circle 1.4px at 6px 9px, rgba(140, 152, 185, .5) 92%, transparent),
    radial-gradient(circle at 35% 40%, #ffffff 0%, #e4e9f7 55%, #b9c3dd 100%);
  -webkit-mask: radial-gradient(circle 11px at calc(50% + var(--cut)) calc(50% - var(--cut) * .75), transparent 10.5px, #000 11px);
  mask: radial-gradient(circle 11px at calc(50% + var(--cut)) calc(50% - var(--cut) * .75), transparent 10.5px, #000 11px);
  --cut: 8px;
  transition: --cut 0s;
}
.theme-switch .disc::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle at 36% 33%, #fffbe8 0%, #ffe680 26%, #ffc935 62%, #f6a51f 100%);
  transition: opacity 0s;
}
/* The day look, and the timing of the change to it. */
:is(html[data-theme="day"] .theme-switch:not([data-to="night"]), .theme-switch[data-to="day"])::before {
  opacity: 1; transition: opacity 1.1s ease .3s; }
:is(html[data-theme="day"] .theme-switch:not([data-to="night"]), .theme-switch[data-to="day"])::after {
  opacity: 1; transition: opacity 1.5s ease 1.3s; }
:is(html[data-theme="day"] .theme-switch:not([data-to="night"]), .theme-switch[data-to="day"]) .stars {
  opacity: 0; transform: translateY(5px); transition: opacity 1s ease .4s, transform 1.2s ease .4s; }
:is(html[data-theme="day"] .theme-switch:not([data-to="night"]), .theme-switch[data-to="day"]) .stars::after { animation: none; }
:is(html[data-theme="day"] .theme-switch:not([data-to="night"]), .theme-switch[data-to="day"]) .clouds {
  opacity: 1; transform: none;
  transition: opacity 1s ease 2s, transform 1.4s var(--ease-out) 1.9s; }
:is(html[data-theme="day"] .theme-switch:not([data-to="night"]), .theme-switch[data-to="day"]) .sun {
  --sy: 0px; opacity: 1; filter: none;
  transition: --sy 0s, filter 0s, opacity .35s ease 1.95s; }
:is(html[data-theme="day"] .theme-switch:not([data-to="night"]), .theme-switch[data-to="day"]) .rays {
  opacity: 1; scale: 1; transform: none;
  transition: opacity .5s ease 2.05s, scale 1s cubic-bezier(.3, 1.5, .5, 1) 2s, transform 1.2s var(--ease-out) 2s; }
:is(html[data-theme="day"] .theme-switch:not([data-to="night"]), .theme-switch[data-to="day"]) .moon {
  --mx: 0px; --my: 34px; scale: .77; opacity: 0;
  filter: drop-shadow(0 0 6px rgba(255, 210, 90, .85));
  transition: --mx 1.15s cubic-bezier(.6, 0, .3, 1) .95s, --my 0s 2.6s, scale 1s ease 1s, opacity .3s ease 2.25s, filter 1.8s ease .3s; }
:is(html[data-theme="day"] .theme-switch:not([data-to="night"]), .theme-switch[data-to="day"]) .disc {
  --cut: 28px; transition: --cut 1s cubic-bezier(.45, 0, .3, 1); }
:is(html[data-theme="day"] .theme-switch:not([data-to="night"]), .theme-switch[data-to="day"]) .disc::after {
  opacity: 1; transition: opacity .9s ease 1.15s; }
/* During the slow page fade (html.vt) the clicked switch is lifted out of the
   still picture (w.js adds .is-flip) and keeps playing on top of it. */
.theme-switch.is-flip { view-transition-name: theme-switch; }
html.vt .theme-switch.is-flip, html.vt .theme-switch.is-flip *,
html.vt .theme-switch.is-flip *::before, html.vt .theme-switch.is-flip *::after { animation-play-state: running !important; }
html.vt::view-transition-group(theme-switch), html.vt::view-transition-new(theme-switch) { animation: none; }
html.vt::view-transition-old(theme-switch) { display: none; }
@media (prefers-reduced-motion: reduce) {
  .theme-switch::before, .theme-switch::after, .theme-switch *, .theme-switch *::before, .theme-switch *::after { transition-delay: 0s !important; }
}

/* Discord */
.discord-btn { color: #7983f5; }
.discord-btn:hover { color: #fff; background: #5865f2; border-color: #5865f2; }
.discord-btn .icon { width: 20px; height: 20px; }

/* Burger + drawer */
.burger { display: none; }
html.nav-tight .site-header .bar { gap: 14px; }
html.nav-tight .main-nav > a, html.nav-tight .nav-drop > button { padding: 0 8px; letter-spacing: .06em; font-size: 12px; }
html.nav-tight .header-actions { gap: 8px; }
html.nav-tight .header-actions .discord-btn { display: none; }
html.nav-compact .main-nav, html.nav-compact .header-actions .hide-m { display: none !important; }
html.nav-compact .burger { display: inline-grid; }
.burger span { display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .3s var(--ease-out), opacity .2s; }
.burger span + span { margin-top: 4px; }
/* The wrapper is only a container for the three bars: without this it picked up the bar
   styles above (2px tall, filled) and the drawn icon hung 6px below the button's centre. */
.burger .lines { display: grid; gap: 4px; width: 18px; height: auto; border-radius: 0; background: none; transition: none; }
.burger .lines span + span { margin-top: 0; }
.drawer-root { position: fixed; inset: 0; z-index: 970; visibility: hidden; }
.drawer-root.is-open { visibility: visible; }
.drawer-backdrop { position: absolute; inset: 0; background: var(--backdrop); backdrop-filter: blur(6px); opacity: 0; transition: opacity .3s; }
.drawer-root.is-open .drawer-backdrop { opacity: 1; }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(380px, 88vw);
  display: flex; flex-direction: column; gap: 18px; padding: 18px 20px 26px; overflow-y: auto;
  background: var(--surface-solid); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg);
  transform: translateX(100%); transition: transform .42s var(--ease-out);
}
.drawer-root.is-open .drawer { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; }
.drawer-nav { display: flex; flex-direction: column; gap: 2px; }
.drawer-nav a {
  display: flex; align-items: center; gap: 14px; padding: 13px 12px; border-radius: 12px;
  color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 14px; letter-spacing: .08em; text-transform: uppercase;
}
.drawer-nav a .icon { width: 20px; height: 20px; color: var(--gold-ink); }
.drawer-nav a:hover, .drawer-nav a.is-active { background: var(--gold-soft); color: var(--text); }
.drawer-label { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); margin: 6px 4px -6px; }
.drawer-langs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.drawer-langs button {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px;
  border: 1px solid var(--line-soft); background: var(--surface-3); font-size: 14px; font-weight: 600; color: var(--text-2);
}
.drawer-langs button.is-active { border-color: var(--gold); background: var(--gold-soft); color: var(--text); }
.drawer-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 4px; }
.drawer-cta { display: grid; gap: 10px; margin-top: auto; }

/* ---------- Hero (index) ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: clamp(640px, 100svh, 1000px);
  display: flex; align-items: center;
  padding: calc(var(--header-h) + 40px) 0 110px;
}
.art-stack { position: absolute; inset: 0; z-index: -3; overflow: hidden; background: var(--bg); }
/* Artwork files and sizes come from hero.css (generated by _build/tools/art.py).
   The picture stands still; only the fireflies (.fx-canvas) move. */
.art-stack .art {
  position: absolute; inset: 0;
  background-size: cover; background-position: 62% 42%;
  transition: opacity 1.1s ease;
}
.art-day { opacity: 0; }
.art-night { opacity: 1; }
html[data-theme="day"] .art-day { opacity: 1; filter: brightness(.84) saturate(.9) sepia(.08); }
html[data-theme="day"] .art-night { opacity: 0; }
/* Only the visible look's picture downloads at first; w.js adds html.art-all
   once the page has loaded, or just before a day/night switch. */
html[data-theme="night"]:not(.art-all) .art-day,
html[data-theme="day"]:not(.art-all) .art-night { background-image: none; }
/* While head.php downloads the picture for the loading bar, the stylesheet
   doesn't ask for it a second time; once done it comes from the cache. */
html.art-hold .art-stack .art { background-image: none; }
/* A picture still downloading after the loading cover stays hidden and fades
   in once it is ready (w.js initLoader). */
html.art-late .art-stack .art { opacity: 0; }
.hero-scrim { position: absolute; inset: 0; z-index: -2; background: var(--hero-scrim); }
.fx-canvas { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; transition: opacity 1s ease; }
.hero-content { max-width: 660px; }
.hero-status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 26px; }
.hero h1 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(40px, 6.2vw, 78px); line-height: 1.02; letter-spacing: .005em;
  text-shadow: 0 4px 30px rgba(0, 0, 0, .35);
}
html[data-theme="day"] .hero h1 { text-shadow: 0 2px 0 rgba(255, 255, 255, .5); }
/* Gradient text has a transparent fill, so a text-shadow would bleed through it. */
.accent { text-shadow: none !important; }
.hero h1 .accent { filter: drop-shadow(0 6px 26px rgba(0, 0, 0, .35)); }
html[data-theme="day"] .hero h1 .accent { filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .7)); }
.hero h1 .line { display: block; }
.hero .lede { margin-top: 22px; font-size: clamp(16px, 1.55vw, 19px); color: var(--text-2); max-width: 560px; }
.hero .lede b, .hero .lede strong { color: var(--text); font-weight: 700; }
.hero .lede p + p { margin-top: 6px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero-stats {
  display: flex; flex-wrap: wrap; gap: 0; margin-top: 46px;
  border-top: 1px solid var(--line); padding-top: 22px; max-width: 560px;
}
.hero-stat { flex: 1 1 0; min-width: 120px; padding-right: 18px; }
.hero-stat + .hero-stat { padding-left: 22px; border-left: 1px solid var(--line); }
.hero-stat .v { font-family: var(--font-display); font-size: clamp(26px, 2.6vw, 34px); font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hero-stat .k { margin-top: 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.hero-stat.online .v { color: var(--green); }
.hero-countdown { margin-top: 30px; }
.scroll-cue {
  position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--text-3); font-size: 10.5px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase;
}
.scroll-cue .mouse { width: 22px; height: 34px; border-radius: 12px; border: 1.5px solid currentColor; position: relative; opacity: .8; }
.scroll-cue .mouse::after { content: ''; position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--gold); animation: wheel 1.8s ease-in-out infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(-2px); } 30% { opacity: 1; } 70% { opacity: 1; transform: translateY(8px); } 100% { opacity: 0; transform: translateY(10px); } }

/* ---------- Panels ---------- */
/* No glass blur: a panel sits on the plain page background, where the blur
   changes no pixel, but the header's blur re-blurring it on every frame made
   in-page scrolling stutter on 4K screens. */
.panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow), inset 0 1px 0 var(--inner-hi);
}
.ornate::before {
  content: ''; position: absolute; top: -1px; left: 9%; right: 9%; height: 2px; z-index: 2; pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, var(--gold) 22%, var(--gold-hi) 50%, var(--gold) 78%, transparent 100%);
  box-shadow: 0 0 22px var(--gold-glow);
  border-radius: 2px;
}
.ornate::after {
  --c: color-mix(in srgb, var(--gold) 55%, transparent);
  content: ''; position: absolute; inset: 12px; pointer-events: none; z-index: 1;
  background:
    linear-gradient(var(--c), var(--c)) top left / 18px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) top left / 1px 18px no-repeat,
    linear-gradient(var(--c), var(--c)) top right / 18px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) top right / 1px 18px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 18px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 1px 18px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 18px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 1px 18px no-repeat;
}
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--inner-hi);
  transition: transform .35s var(--ease-out), border-color .3s, box-shadow .35s;
}
.card.hoverable:hover { transform: translateY(-5px); border-color: var(--line-2); box-shadow: var(--shadow), 0 0 0 1px var(--gold-soft); }

/* ---------- Stat + fact boxes ---------- */
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat {
  padding: 10px 8px; text-align: center; border-radius: 12px;
  background: var(--surface-3); border: 1px solid var(--line-soft);
}
.stat .v { font-family: var(--font-display); font-size: 19px; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.stat.online .v { color: var(--green); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; }
.fact { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--line-soft); }
.fact .icon { width: 18px; height: 18px; color: var(--gold-ink); }
.fact .v { font-weight: 700; font-size: 14px; line-height: 1.2; white-space: nowrap; }
.fact .k { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }

/* ---------- Milestone timeline ---------- */
.tl-label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; color: var(--text-2); }
.tl-label b { font-family: var(--font-display); font-size: 15px; color: var(--text); letter-spacing: .03em; }
.tl-label .gold { font-weight: 700; }
.tl { position: relative; height: 22px; margin: 6px 9px 0; }
.tl-track, .tl-fill { position: absolute; left: 0; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 3px; }
.tl-track { right: 0; background: var(--line-soft); }
.tl-fill { width: calc(100% * var(--p, 0)); background: linear-gradient(90deg, #a855f7, #6366f1 45%, #3b82f6); box-shadow: 0 0 10px rgba(99, 102, 241, .5); }
html.js .tl-fill { width: 0; transition: width 1.6s var(--ease-out) .2s; }
html.js .tl.is-in .tl-fill { width: calc(100% * var(--p, 0)); }
.tl-fill::after {
  content: ''; position: absolute; right: -6px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 12px var(--gold); animation: tlPulse 1.8s ease-in-out infinite;
}
.tl.is-done .tl-fill::after, .tl.is-zero .tl-fill::after { display: none; }
@keyframes tlPulse { 0%, 100% { box-shadow: 0 0 0 0 var(--gold-glow); } 50% { box-shadow: 0 0 0 7px transparent; } }
.tl-dot {
  position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; z-index: 2; border-radius: 50%;
  background: var(--surface-solid); border: 2px solid var(--line-2); outline: none; cursor: help;
  transition: transform .2s;
  --tl-zoom: 1.3; /* hover/focus size; w.js fitTlTip() reads it */
}
.tl-dot.on { border-color: var(--c, var(--gold)); background: var(--c, var(--gold)); box-shadow: 0 0 8px var(--c, var(--gold)); }
.tl-dot.end-reached { border-color: var(--red); background: var(--red); box-shadow: 0 0 10px var(--red); }
.tl-dot:hover, .tl-dot:focus-visible { transform: scale(var(--tl-zoom)); }
.tl-tip {
  position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translate(-50%, 4px);
  width: max-content; max-width: 210px; padding: 9px 12px; border-radius: 10px;
  background: var(--surface-solid); border: 1px solid var(--line-2); box-shadow: var(--shadow);
  font-size: 12px; line-height: 1.45; color: var(--text-2); text-align: left; white-space: normal;
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .18s, transform .18s, visibility .18s; z-index: 30;
}
.tl-tip b { display: block; color: var(--text); font-size: 12.5px; margin-bottom: 2px; }
.tl-dot:hover .tl-tip, .tl-dot:focus-visible .tl-tip { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.tl-dot.first .tl-tip { left: -6px; transform: translate(0, 4px); }
.tl-dot.first:hover .tl-tip, .tl-dot.first:focus-visible .tl-tip { transform: translate(0, 0); }
.tl-dot.last .tl-tip { left: auto; right: -6px; transform: translate(0, 4px); }
.tl-dot.last:hover .tl-tip, .tl-dot.last:focus-visible .tl-tip { transform: translate(0, 0); }

/* ---------- Countdown ---------- */
.countdown-blocks { display: inline-flex; gap: 8px; }
.cd-unit {
  min-width: 62px; padding: 9px 8px 7px; text-align: center; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line-2); box-shadow: inset 0 1px 0 var(--inner-hi);
  backdrop-filter: blur(10px);
}
.cd-unit b { display: block; font-family: var(--font-display); font-size: 26px; line-height: 1.1; color: var(--gold-ink); font-variant-numeric: tabular-nums; }
.cd-unit span { display: block; font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.cd-label { display: block; margin-bottom: 10px; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }
.status-line {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 9px 13px; border-radius: 11px; border: 1px dashed var(--line-2); background: var(--surface-3);
  font-size: 13px; color: var(--text-2);
}
.status-line b { color: var(--text); font-weight: 700; }
.status-line .cd { color: var(--gold-ink); font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---------- Current world feature card ---------- */
.world-feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); overflow: hidden; }
.world-art { position: relative; min-height: 360px; background-size: cover; background-position: 72% center; }
.world-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 55%, var(--surface-solid) 100%), linear-gradient(180deg, rgba(0, 0, 0, .25), transparent 35%); opacity: .92; }
.world-art .badges { position: absolute; top: 16px; left: 16px; right: 16px; display: flex; flex-wrap: wrap; gap: 8px; z-index: 2; }
.world-body { display: flex; flex-direction: column; gap: 16px; padding: clamp(20px, 3vw, 32px); }
.world-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.world-title h3 { font-family: var(--font-display); font-size: clamp(24px, 2.6vw, 32px); }
.world-title .speed { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--gold-ink); letter-spacing: .08em; }
.world-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }
.world-actions .btn { flex: 1 1 140px; }

/* ---------- Server cards ---------- */
.srv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.srv-card { display: flex; flex-direction: column; overflow: hidden; }
.srv-card.is-current { border-color: color-mix(in srgb, var(--gold) 60%, transparent); box-shadow: 0 0 0 1px var(--gold-soft), var(--shadow); }
.srv-banner { position: relative; height: 200px; overflow: hidden; }
.srv-banner .img { position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform .8s var(--ease-out); }
.srv-card:hover .srv-banner .img { transform: scale(1.06); }
.srv-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .08) 0%, transparent 24%, transparent 58%, var(--surface-solid) 100%); }
.srv-banner .badges { position: absolute; z-index: 2; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; gap: 8px; }
/* Pills sitting on bright artwork get a dark plate so coloured text stays legible. */
.srv-banner .pill:not(.pill-current), .world-art .pill:not(.pill-current) { background-color: rgba(7, 10, 18, .78); box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
html[data-theme="day"] .srv-banner .pill:not(.pill-current), html[data-theme="day"] .world-art .pill:not(.pill-current) { background-color: rgba(255, 252, 245, .92); }
.srv-name { position: absolute; z-index: 2; left: 18px; right: 18px; bottom: 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.srv-name h3 { font-family: var(--font-display); font-size: 21px; text-shadow: 0 2px 12px rgba(0, 0, 0, .45); }
html[data-theme="day"] .srv-name h3 { text-shadow: 0 1px 0 rgba(255, 255, 255, .6); }
.srv-name .speed { font-family: var(--font-display); font-weight: 700; color: var(--gold-ink); font-size: 14px; letter-spacing: .06em; }
.srv-body { display: flex; flex-direction: column; gap: 14px; padding: 6px 18px 18px; flex: 1; }
.srv-actions { display: flex; gap: 10px; margin-top: auto; }
.srv-actions .btn { flex: 1; }

/* ---------- Hall of fame ---------- */
.alert.hof-notice { max-width: 760px; margin: 0 auto 24px; }
.hof-switch { margin-top: 16px; }
.hof-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.hof-card { overflow: hidden; padding: 28px 20px 24px; text-align: center; }
.hof-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--c), transparent); }
.hof-medal {
  width: 64px; height: 64px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 50%;
  color: var(--c); background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%);
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 8%, transparent), 0 0 30px color-mix(in srgb, var(--c) 25%, transparent);
}
.hof-medal .icon { width: 28px; height: 28px; }
.hof-cat { font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--text-3); }
.hof-name { margin-top: 10px; font-size: 20px; font-weight: 800; color: var(--gold-ink); }
.hof-score { margin-top: 2px; font-family: var(--font-display); font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hof-score-lbl { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.hof-meta { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.c-attack { --c: #ef6a6a; } .c-defend { --c: #5fa4f0; } .c-hero { --c: #a98cf6; } .c-pop { --c: #4fd18b; } .c-gold { --c: #e2b65a; }
html[data-theme="day"] .c-attack { --c: #c63c3c; } html[data-theme="day"] .c-defend { --c: #2a6ac3; } html[data-theme="day"] .c-hero { --c: #6a4bd0; } html[data-theme="day"] .c-pop { --c: #1d8549; }

/* ---------- Features ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.feature { padding: 24px 22px; }
.feature-icon {
  width: 50px; height: 50px; display: grid; place-items: center; border-radius: 14px; margin-bottom: 16px;
  color: var(--gold-ink); background: linear-gradient(180deg, var(--gold-soft), transparent);
  border: 1px solid var(--line-2); box-shadow: inset 0 1px 0 var(--inner-hi);
  transition: box-shadow .3s, transform .3s var(--ease-out);
}
.feature-icon .icon { width: 24px; height: 24px; }
.feature:hover .feature-icon { box-shadow: 0 0 24px var(--gold-glow), inset 0 1px 0 var(--inner-hi); transform: translateY(-2px) rotate(-3deg); }
.feature h3 { font-family: var(--font-display); font-size: 16.5px; color: var(--text); letter-spacing: .02em; margin-bottom: 8px; }
.feature p { font-size: 14.5px; color: var(--text-2); }

/* ---------- Gallery + lightbox ---------- */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: clamp(140px, 15vw, 190px); gap: 14px; }
.shot {
  position: relative; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface-solid); cursor: zoom-in; padding: 0; text-align: left;
}
.shot:nth-child(1) { grid-column: span 2; grid-row: span 2; }
.shot:nth-child(6) { grid-column: span 2; }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-out), filter .4s; }
.shot:hover img { transform: scale(1.06); }
.shot .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 14px 12px;
  background: linear-gradient(180deg, transparent, rgba(4, 6, 12, .88));
  color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 14px; letter-spacing: .04em;
  transform: translateY(6px); opacity: .92; transition: transform .35s var(--ease-out), opacity .35s;
}
.shot:hover .cap { transform: none; opacity: 1; }
.lightbox { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 60px 90px; visibility: hidden; }
.lightbox.is-open { visibility: visible; }
.lightbox .lb-bg { position: absolute; inset: 0; background: rgba(3, 5, 10, .93); backdrop-filter: blur(8px); opacity: 0; transition: opacity .3s; }
.lightbox.is-open .lb-bg { opacity: 1; }
.lb-figure { position: relative; max-width: min(1200px, 100%); opacity: 0; transform: scale(.97); transition: opacity .35s var(--ease-out), transform .45s var(--ease-out); }
.lightbox.is-open .lb-figure { opacity: 1; transform: none; }
.lb-figure img { max-height: calc(100svh - 190px); width: auto; margin: 0 auto; border-radius: var(--radius); border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 30px 90px rgba(0, 0, 0, .7); }
.lb-figure figcaption { margin-top: 14px; text-align: center; color: #dfe4ee; }
.lb-figure figcaption b { display: block; font-family: var(--font-display); font-size: 18px; color: #fff; }
.lb-figure figcaption span { font-size: 14px; color: #a7b0c2; }
.lb-count { position: absolute; top: 20px; left: 24px; color: #a7b0c2; font-size: 13px; font-weight: 700; letter-spacing: .14em; }
.lb-btn { position: absolute; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; color: #fff; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); transition: background .2s; }
.lb-btn:hover { background: rgba(255, 255, 255, .18); }
.lb-btn .icon { width: 22px; height: 22px; }
.lb-close { top: 16px; right: 18px; }
/* The viewer is always dark, whatever the page palette. */
.lightbox .x-btn { position: absolute; --tc: rgba(232, 194, 106, .85); color: #e6eaf2; background-color: rgba(255, 255, 255, .07); }
.lightbox .x-btn:hover { color: #f6da96; background-color: rgba(226, 182, 90, .16); }
.lb-prev { left: 22px; top: 50%; margin-top: -24px; }
.lb-next { right: 22px; top: 50%; margin-top: -24px; }

/* ---------- CTA band ---------- */
.cta-band { position: relative; isolation: isolate; overflow: hidden; padding-block: clamp(80px, 11vw, 140px); text-align: center; }
.cta-band .art-stack .art { background-position: 50% 70%; }
.cta-band .band-scrim { position: absolute; inset: 0; z-index: -2; background: var(--band-scrim); }
.cta-band h2 { font-family: var(--font-display); font-size: clamp(30px, 4.4vw, 54px); line-height: 1.1; }
.cta-band p { margin: 14px auto 0; max-width: 560px; color: var(--text-2); font-size: 17px; }
.cta-band .hero-cta { justify-content: center; }
/* Day: the bright artwork sits right behind the copy, so the scrim gets a
   light pool in the middle (--band-scrim) and the text a soft parchment halo. */
html[data-theme="day"] .cta-band h2 { text-shadow: 0 1px 0 rgba(255, 250, 238, .55), 0 0 22px rgba(236, 227, 209, .9); }
html[data-theme="day"] .cta-band h2 .accent { filter: drop-shadow(0 1px 0 rgba(255, 250, 238, .7)) drop-shadow(0 0 14px rgba(236, 227, 209, .85)); }
html[data-theme="day"] .cta-band p { color: var(--text); font-weight: 500; text-shadow: 0 0 14px rgba(236, 227, 209, .95), 0 0 4px rgba(236, 227, 209, .8); }
html[data-theme="day"] .cta-band .eyebrow { text-shadow: 0 0 12px rgba(236, 227, 209, .95); }

/* ---------- Footer ---------- */
.site-footer { position: relative; border-top: 1px solid var(--line); background: linear-gradient(180deg, transparent, var(--bg-2)); padding-top: 56px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 36px; }
.footer-brand p { margin-top: 12px; color: var(--text-3); font-size: 14px; max-width: 320px; }
.footer-brand .brand { align-items: flex-start; }
.footer-brand .brand-sub { padding-left: 8px; }
.site-footer h4 { font-family: var(--font-display); font-size: 12.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-ink); margin-bottom: 14px; }
.footer-links { list-style: none; display: grid; gap: 9px; }
.footer-links a { color: var(--text-2); font-size: 14.5px; }
.footer-links a:hover { color: var(--text); }
.footer-bottom {
  margin-top: 46px; padding: 20px 0 26px; border-top: 1px solid var(--line-soft);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  font-size: 13px; color: var(--text-3);
}
.footer-tools { display: flex; align-items: center; gap: 10px; }

/* ---------- Modal system ----------
   Opening: the backdrop dims, the panel rises and settles, the gold top line
   draws out from the centre, the corner ticks settle in and the content fades
   up. Closing: the panel sinks and fades, then the backdrop clears.
   Only opacity and transform animate: the GPU runs those by itself, so a busy
   first frame (a big view drawn for the first time) delays the animation
   instead of swallowing it. No blur filters here, they run on the main thread.
   Each state carries its own transition: .is-open timings play when opening,
   the base timings when closing. .is-shown = open (drawn, still transparent
   for its first frame); .is-open = the animated state, added a frame later.
   Opacity uses even ease-in-out curves: an ease-out fade is 90% done in a
   fifth of its time and reads as a pop. Opening takes ~1.5 s, closing ~1 s
   (w.js unlocks the page at 1000 ms). */
.modal { position: fixed; inset: var(--header-h) 0 0 0; z-index: 900; display: grid; place-items: center; padding: 22px; visibility: hidden; transition: visibility 0s linear 1s; }
.modal.is-shown { visibility: visible; transition-delay: 0s; }
.modal-backdrop {
  position: absolute; inset: 0; background: var(--backdrop);
  backdrop-filter: blur(9px) saturate(1.1); -webkit-backdrop-filter: blur(9px) saturate(1.1);
  opacity: 0; will-change: opacity;
  transition: opacity .8s cubic-bezier(.4, 0, .2, 1) .15s;
}
.modal.is-open .modal-backdrop { opacity: 1; transition: opacity .9s cubic-bezier(.4, 0, .2, 1); }
.modal-panel {
  position: relative; width: min(var(--w, 500px), 100%); max-height: calc(100svh - var(--header-h) - 40px);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; transform: translateY(70px) scale(.94); will-change: opacity, transform;
  transition: opacity .7s cubic-bezier(.4, 0, .6, 1), transform .75s cubic-bezier(.5, 0, .75, 0);
}
/* The invisible first frame must still be drawn, or the drawing work just
   moves into the animation: a near-zero opacity keeps it drawn, and every
   part that animates gets its own layer up front. */
.modal.is-shown:not(.is-open) .modal-panel { opacity: .002; }
.modal .view.is-active, .modal-panel.ornate::before, .modal-panel.ornate::after { will-change: opacity, transform; }
.modal.is-open .modal-panel {
  opacity: 1; transform: none;
  transition: opacity 1.1s cubic-bezier(.45, 0, .25, 1) .1s, transform 1.4s cubic-bezier(.22, 1, .36, 1) .1s;
}
/* Frame details arrive after the panel: the top line draws outwards, the corner ticks close in. */
.modal-panel.ornate::before { opacity: 0; transform: scaleX(.12); transition: opacity .3s ease, transform .4s ease; }
.modal.is-open .modal-panel.ornate::before { opacity: 1; transform: none; transition: opacity .8s ease .55s, transform 1.4s cubic-bezier(.22, 1, .36, 1) .55s; }
.modal-panel.ornate::after { opacity: 0; transform: scale(1.02); transition: opacity .3s ease, transform .4s ease; }
.modal.is-open .modal-panel.ornate::after { opacity: 1; transform: none; transition: opacity .9s ease .65s, transform 1.4s cubic-bezier(.22, 1, .36, 1) .65s; }
/* While a panel covers the page, the slow zoom underneath pauses (the fireflies stop too, in w.js). */
.modal-panel.panel { background: var(--surface-solid); box-shadow: var(--shadow-lg), 0 0 90px -30px var(--gold-glow), inset 0 1px 0 var(--inner-hi); }
html:not([data-theme="day"]) .modal-panel.panel { background: linear-gradient(170deg, rgba(20, 27, 46, .98) 0%, rgba(11, 16, 29, .99) 60%, rgba(15, 21, 37, .98) 100%); }
html.modal-lock { scrollbar-gutter: stable; }
html.vt .art-stack .art { transition: none !important; }
/* During the day/night fade nothing underneath moves: the slow zoom and the
   small looping animations pause, the fireflies fade out with the old look and
   come back after (w.js stops drawing them). A page moving under the fade has
   to be re-captured every frame, which made Firefox flicker. */
html.vt *, html.vt *::before, html.vt *::after { animation-play-state: paused !important; }
html.vt .fx-canvas { opacity: 0; transition: none; }

/* One-page panels: the header stays usable above any open panel. */
html.modal-lock .site-header,
html.modal-lock .site-header.is-top {
  background: var(--header-bg); border-bottom-color: var(--line);
  backdrop-filter: blur(16px) saturate(1.25); -webkit-backdrop-filter: blur(16px) saturate(1.25);
}
.modal-page .modal-scroll { padding: clamp(30px, 4vw, 52px) clamp(16px, 4vw, 52px) clamp(28px, 4vw, 48px); }
.pm-head { text-align: center; max-width: 760px; margin: 0 auto clamp(24px, 3vw, 36px); }
.pm-head h2 { font-family: var(--font-display); font-size: clamp(28px, 3.6vw, 44px); line-height: 1.12; margin-top: 12px; }
.pm-head p { margin-top: 10px; color: var(--text-2); font-size: clamp(15px, 1.4vw, 17px); }
.pm-sub { text-align: center; margin: clamp(40px, 5vw, 60px) auto 22px; max-width: 760px; }
.pm-sub h3 { font-family: var(--font-display); font-size: clamp(22px, 2.6vw, 30px); margin-top: 10px; }
.pm-sub p { margin-top: 8px; color: var(--text-2); }
.pm-center { display: flex; justify-content: center; margin-bottom: 24px; }
.pm-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 28px; }
/* Inside a panel the page is already behind a solid surface: drop the nested
   glass blur (expensive while scrolling) and the scroll-in animations. */
.modal .panel, .modal .card, .modal .tabs, .modal .faq details, .modal .tut-step, .modal .cd-unit {
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.modal .panel, .modal .card { box-shadow: var(--shadow-sm), inset 0 1px 0 var(--inner-hi); }
html.js .modal .reveal { opacity: 1; transform: none; }
.modal .toc { top: 0; }
.modal .rules-layout { grid-template-columns: 230px minmax(0, 1fr); gap: 26px; }
.modal .rule { scroll-margin-top: 12px; }
.modal .tut-panel { padding: clamp(18px, 3vw, 32px); }
.modal-page .view { min-height: 40vh; }
@media (max-width: 980px) {
  .modal .rules-layout { grid-template-columns: 1fr; }
  .modal .toc { margin: 0 -4px; }
}

/* Server info modal */
.si-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.si-panel { padding: 16px 18px; border-radius: 16px; background: var(--surface-3); border: 1px solid var(--line-soft); }
.si-title { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-family: var(--font-display); font-size: 13.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-ink); }
.si-title .icon { width: 18px; height: 18px; }
.si-sec { margin: 16px 0 4px; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }
.si-row { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 7px 0; border-bottom: 1px dashed var(--line-soft); font-size: 13.5px; }
.si-row:last-child { border-bottom: 0; }
.si-row > span { color: var(--text-2); }
.si-row > b { color: var(--text); font-weight: 700; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.si-row > b.green { color: var(--green); }
@media (max-width: 720px) { .si-grid { grid-template-columns: 1fr; } }
/* Bracketed close button: the same gold corner ticks as the panel frame, so it
   reads as part of the frame. It takes the place of the panel's top-right
   bracket (see .ornate.has-close). */
.x-btn {
  --tc: color-mix(in srgb, var(--gold) 78%, transparent);
  --tl: 10px;
  position: relative; display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; padding: 0; border: 0; border-radius: 2px;
  color: var(--text-2);
  background-color: var(--surface-3);
  background-image:
    linear-gradient(var(--tc), var(--tc)), linear-gradient(var(--tc), var(--tc)),
    linear-gradient(var(--tc), var(--tc)), linear-gradient(var(--tc), var(--tc)),
    linear-gradient(var(--tc), var(--tc)), linear-gradient(var(--tc), var(--tc)),
    linear-gradient(var(--tc), var(--tc)), linear-gradient(var(--tc), var(--tc));
  background-repeat: no-repeat;
  background-position: top left, top left, top right, top right, bottom left, bottom left, bottom right, bottom right;
  background-size: 10px 1.5px, 1.5px 10px, 10px 1.5px, 1.5px 10px, 10px 1.5px, 1.5px 10px, 10px 1.5px, 1.5px 10px;
  transition: background-size .4s var(--ease-out), background-color .25s, color .25s, box-shadow .3s;
}
.x-btn .icon { width: 16px; height: 16px; stroke-width: 1.7; transition: transform .45s var(--ease-out); }
.x-btn:hover, .x-btn:focus-visible {
  color: var(--gold-hi);
  background-color: var(--gold-soft);
  background-size: 16px 1.5px, 1.5px 16px, 16px 1.5px, 1.5px 16px, 16px 1.5px, 1.5px 16px, 16px 1.5px, 1.5px 16px;
  box-shadow: 0 0 24px -6px var(--gold-glow);
}
html[data-theme="day"] .x-btn:hover, html[data-theme="day"] .x-btn:focus-visible { color: var(--gold-ink); }
.x-btn:hover .icon, .x-btn:focus-visible .icon { transform: rotate(90deg); }
.x-btn:active .icon { transform: rotate(90deg) scale(.82); }
.modal-close { position: absolute; top: 12px; right: 12px; z-index: 5; }
/* The panel's own top-right bracket gives way to the close button. */
.ornate.has-close::after {
  background:
    linear-gradient(var(--c), var(--c)) top left / 18px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) top left / 1px 18px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 18px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 1px 18px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 18px 1px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 1px 18px no-repeat;
}
.modal-scroll { overflow-y: auto; overscroll-behavior: contain; padding: clamp(26px, 4vw, 38px) clamp(20px, 4vw, 38px) clamp(22px, 3vw, 32px); scrollbar-width: thin; }
.modal-views { position: relative; transition: height .38s var(--ease-out); }
.view { display: none; }
.view.is-active { display: block; animation: viewIn .42s var(--ease-out) both; }
.view.is-leaving { display: block; position: absolute; top: 0; left: 0; right: 0; animation: viewOut .2s ease both; pointer-events: none; }
/* w.js focusFirst() parks focus on the open view (or panel) itself - no ring around the whole panel */
.view:focus, .modal:focus { outline: none; border-radius: 0; }
/* Opening a panel: the content waits for the panel, then rises in. */
.modal:not(.is-open) .view.is-active { animation: none; }
.modal.is-entering .view.is-active { animation: viewIn 1.1s cubic-bezier(.22, 1, .36, 1) .45s both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes viewOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-6px); } }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; color: var(--text-3); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.back-link:hover { color: var(--gold-ink); }
.back-link .icon { width: 15px; height: 15px; }
html.modal-lock, html.modal-lock body { overflow: hidden; }

/* ---------- Auth components ---------- */
.auth-head { text-align: center; margin-bottom: 24px; }
.auth-head .crest {
  width: 58px; height: 58px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 16px;
  color: var(--gold-ink); background: linear-gradient(180deg, var(--gold-soft), transparent); border: 1px solid var(--line-2);
  box-shadow: 0 0 30px var(--gold-soft), inset 0 1px 0 var(--inner-hi);
}
.auth-head .crest .icon { width: 28px; height: 28px; }
.auth-title { font-family: var(--font-display); font-size: clamp(24px, 3vw, 30px); letter-spacing: .02em; }
.auth-sub { margin-top: 8px; color: var(--text-2); font-size: 14.5px; }
.auth-sub b { color: var(--text); }
.auth-foot { margin-top: 20px; text-align: center; font-size: 14px; color: var(--text-2); }
.auth-foot a, .auth-foot button { color: var(--gold-ink); font-weight: 700; }
.auth-foot a:hover, .auth-foot button:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-note { margin-top: 18px; font-size: 12.5px; color: var(--text-3); text-align: center; }
.or { display: flex; align-items: center; gap: 14px; margin: 18px 0; font-size: 11.5px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--text-3); }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line-soft); }

.field { display: block; margin-bottom: 16px; }
.field-label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 7px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); }
.field-label .opt { font-weight: 600; letter-spacing: .04em; text-transform: none; color: var(--text-3); }
.field-label a { font-size: 12.5px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.input-wrap { position: relative; }
.input {
  width: 100%; height: 48px; padding: 0 44px 0 44px;
  border-radius: 12px; border: 1px solid var(--input-border); background: var(--input-bg);
  color: var(--text); font-size: 15.5px; font-family: var(--font-body);
  transition: border-color .2s, box-shadow .2s, background .2s;
  -webkit-appearance: none; appearance: none;
}
.input::placeholder { color: var(--text-3); opacity: .8; }
.input:hover { border-color: var(--line-2); }
.input:focus { outline: none; border-color: var(--gold); background: var(--input-bg-focus); box-shadow: 0 0 0 4px var(--gold-ring); }
.input:-webkit-autofill { -webkit-text-fill-color: var(--text); box-shadow: 0 0 0 100px var(--input-bg-focus) inset; caret-color: var(--text); }
.input-icon { position: absolute; left: 15px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--text-3); pointer-events: none; transition: color .2s; }
.input-wrap:focus-within .input-icon { color: var(--gold-ink); }
.input-end { position: absolute; right: 6px; top: 50%; margin-top: -18px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; color: var(--text-3); }
button.input-end:hover { color: var(--text); background: var(--hover); }
.input-end .icon { width: 18px; height: 18px; }
.input-state { pointer-events: none; opacity: 0; transform: scale(.6); transition: opacity .2s, transform .25s var(--ease-out); }
.field.is-valid .input-state, .field.is-checking .input-state, .field.is-invalid .input-state { opacity: 1; transform: none; }
.field.is-valid .input-state { color: var(--green); }
.field.is-invalid .input-state { color: var(--red); }
.field.is-checking .input-state .icon { animation: spin .8s linear infinite; color: var(--gold-ink); }
.field.is-invalid .input { border-color: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.field.is-valid .input { border-color: color-mix(in srgb, var(--green) 65%, transparent); }
.field-msg { display: block; min-height: 0; margin-top: 6px; font-size: 12.5px; color: var(--text-3); }
.field-msg:empty { display: none; }
.field.is-invalid .field-msg { color: var(--red); }
.field.is-valid .field-msg { color: var(--green); }
.strength { display: flex; gap: 5px; margin-top: 8px; }
.strength i { flex: 1; height: 4px; border-radius: 3px; background: var(--line-soft); transition: background .3s; }
.strength[data-score="1"] i:nth-child(-n+1) { background: var(--red); }
.strength[data-score="2"] i:nth-child(-n+2) { background: #f0a14a; }
.strength[data-score="3"] i:nth-child(-n+3) { background: var(--gold); }
.strength[data-score="4"] i { background: var(--green); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

.check-row { display: flex; align-items: flex-start; gap: 12px; margin: 6px 0 18px; font-size: 13.5px; color: var(--text-2); line-height: 1.5; cursor: pointer; }
.check-row input { position: absolute; opacity: 0; pointer-events: none; }
.check-box {
  flex: none; width: 21px; height: 21px; margin-top: 1px; border-radius: 6px; display: grid; place-items: center;
  border: 1.5px solid var(--line-2); background: var(--input-bg); transition: background .2s, border-color .2s, box-shadow .2s;
}
.check-box .icon { width: 14px; height: 14px; stroke-width: 3; color: var(--on-gold); opacity: 0; transform: scale(.5); transition: opacity .2s, transform .25s var(--ease-out); }
.check-row input:checked + .check-box { background: linear-gradient(180deg, #f3d488, #d3a142); border-color: var(--gold-lo); }
.check-row input:checked + .check-box .icon { opacity: 1; transform: none; }
.check-row input:focus-visible + .check-box { box-shadow: 0 0 0 4px var(--gold-ring); }
.check-row.is-invalid .check-box { border-color: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }

.alert {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; margin-bottom: 18px;
  border: 1px solid var(--line-2); background: var(--surface-3); color: var(--text-2); font-size: 14px; text-align: left;
}
.alert > .icon { width: 20px; height: 20px; margin-top: 1px; color: var(--gold-ink); }
.alert b, .alert strong { color: var(--text); }
.alert .alert-title { display: block; font-weight: 800; color: var(--text); margin-bottom: 2px; font-size: 14.5px; }
.alert p + p { margin-top: 6px; }
.alert.success { border-color: color-mix(in srgb, var(--green) 45%, transparent); background: var(--green-soft); }
.alert.success > .icon, .alert.success .alert-title { color: var(--green); }
.alert.error { border-color: color-mix(in srgb, var(--red) 45%, transparent); background: var(--red-soft); }
.alert.error > .icon, .alert.error .alert-title { color: var(--red); }
.alert.info { border-color: color-mix(in srgb, var(--blue) 40%, transparent); background: var(--blue-soft); }
.alert.info > .icon, .alert.info .alert-title { color: var(--blue); }
.alert.warn { border-color: color-mix(in srgb, var(--gold) 50%, transparent); background: var(--gold-soft); }
.alert a { font-weight: 700; }
.one-per { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; font-size: 12.5px; color: var(--text-3); text-align: center; }
.one-per .icon { width: 15px; height: 15px; color: var(--gold-ink); }

/* Choose view (modal start) */
.world-mini {
  display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: center; padding: 10px; margin-bottom: 18px;
  border-radius: 16px; border: 1px solid var(--line); background: var(--surface-3);
}
.world-mini .thumb { height: 72px; border-radius: 11px; background-size: cover; background-position: center; border: 1px solid var(--line-soft); }
.world-mini h4 { font-family: var(--font-display); font-size: 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.world-mini .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: 13px; color: var(--text-2); }
.world-mini .meta b { color: var(--text); font-variant-numeric: tabular-nums; }
.world-mini .meta .online b { color: var(--green); }
.path-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.path-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 18px 16px; text-align: left;
  border-radius: 16px; border: 1px solid var(--line); background: var(--surface-3); color: var(--text);
  transition: border-color .25s, background .25s, transform .3s var(--ease-out), box-shadow .3s;
}
.path-card:hover { border-color: var(--gold); background: var(--gold-soft); transform: translateY(-3px); box-shadow: 0 12px 30px -12px var(--gold-glow); }
.path-card .icon-tile { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--gold-ink); border: 1px solid var(--line-2); background: var(--gold-soft); }
.path-card .icon-tile .icon { width: 22px; height: 22px; }
.path-card b { font-family: var(--font-display); font-size: 16px; letter-spacing: .03em; }
.path-card span { font-size: 13px; color: var(--text-2); line-height: 1.45; }
.path-card.primary { border-color: color-mix(in srgb, var(--gold) 55%, transparent); }
.world-list { display: grid; gap: 10px; }
.world-row {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 8px 10px 8px 8px;
  border-radius: 14px; border: 1px solid var(--line-soft); background: var(--surface-3); color: var(--text);
  transition: border-color .2s, background .2s;
}
.world-row:hover { border-color: var(--line-2); background: var(--hover); color: var(--text); }
.world-row .thumb { height: 48px; border-radius: 10px; background-size: cover; background-position: center; }
.world-row b { font-family: var(--font-display); font-size: 15px; }
.world-row small { display: block; font-size: 12.5px; color: var(--text-3); }
.world-row.is-current { border-color: color-mix(in srgb, var(--gold) 50%, transparent); }

/* Account chooser (Google) */
.acct-list { display: grid; gap: 10px; }
.acct-btn {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; text-align: left;
  border-radius: 14px; border: 1px solid var(--line); background: var(--surface-3); color: var(--text);
  transition: border-color .2s, background .2s, transform .25s var(--ease-out);
}
.acct-btn:hover { border-color: var(--gold); background: var(--gold-soft); transform: translateX(3px); }
.acct-avatar { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; color: var(--gold-ink); background: var(--gold-soft); border: 1px solid var(--line-2); font-family: var(--font-display); font-weight: 800; font-size: 17px; }
.acct-btn b { display: block; font-size: 15.5px; }
.acct-btn small { color: var(--text-3); font-size: 12.5px; }
.acct-btn .go { margin-left: auto; color: var(--gold-ink); }
.google-badge { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-3); margin-bottom: 18px; }
.google-badge .g-logo { width: 26px; height: 26px; flex: none; }
.google-badge small { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.google-badge b { font-size: 14.5px; word-break: break-all; }

/* Stepper */
.stepper { display: flex; align-items: flex-start; justify-content: center; margin: 0 auto 26px; max-width: 420px; }
.step { display: flex; flex-direction: column; align-items: center; gap: 7px; flex: none; width: 74px; text-align: center; }
.step-num {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
  font-family: var(--font-body); font-weight: 800; font-size: 14px;
  color: var(--text-3); border: 1.5px solid var(--line-2); background: var(--surface-3);
  transition: background .35s, color .35s, border-color .35s, box-shadow .35s;
}
.step-num .icon { width: 16px; height: 16px; stroke-width: 3; display: none; }
.step-lbl { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); transition: color .3s; }
.step.is-active .step-num { color: #241604; border-color: var(--gold-lo); background: linear-gradient(180deg, #f6da93, #d6a445); box-shadow: 0 0 0 5px var(--gold-soft), 0 0 18px var(--gold-glow); }
.step.is-active .step-lbl { color: var(--gold-ink); }
.step.is-done .step-num { color: var(--gold-ink); border-color: var(--gold); background: var(--gold-soft); }
.step.is-done .step-num span { display: none; }
.step.is-done .step-num .icon { display: block; }
.step.is-done .step-lbl { color: var(--text-2); }
.step-line { flex: 1; height: 2px; margin-top: 16px; border-radius: 2px; background: var(--line-soft); position: relative; overflow: hidden; }
.step-line::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, var(--gold-lo), var(--gold)); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease-out); }
.step-line.is-done::after { transform: scaleX(1); }
.wizard-panel { display: none; }
.wizard-panel.is-active { display: block; animation: stepIn .45s var(--ease-out) both; }
.wizard-panel.is-active.back { animation-name: stepInBack; }
@keyframes stepIn { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes stepInBack { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
.wizard-nav { display: flex; gap: 10px; margin-top: 22px; }
.wizard-nav .btn { flex: 1; }
.wizard-nav .btn-ghost { flex: 0 0 auto; }
.group-title { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; font-family: var(--font-display); font-size: 14px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-ink); }
.group-title .n { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; font-size: 12px; border: 1px solid var(--line-2); background: var(--gold-soft); }
.group-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }

/* Tribe picker */
.tribes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tribe {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 10px 14px;
  border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface-3); cursor: pointer; text-align: center;
  transition: border-color .25s, background .25s, transform .3s var(--ease-out), box-shadow .3s;
}
.tribe:hover { border-color: var(--line-2); transform: translateY(-3px); }
.tribe input { position: absolute; opacity: 0; pointer-events: none; }
.tribe-frame {
  width: 100%; aspect-ratio: 4 / 3.6; display: grid; place-items: center; overflow: hidden; border-radius: 11px;
  background: radial-gradient(circle at 50% 40%, #fffaf0 0%, #efe3c8 100%);
  box-shadow: inset 0 0 0 1px rgba(120, 85, 20, .25), inset 0 -18px 30px -18px rgba(120, 85, 20, .35);
}
.tribe-frame img { height: 92%; width: auto; aspect-ratio: 1; object-fit: contain; transition: transform .45s var(--ease-out); }
.tribe:hover .tribe-frame img { transform: scale(1.06); }
.tribe b { font-family: var(--font-display); font-size: 15px; letter-spacing: .04em; }
.tribe .traits { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.tribe .traits span { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; color: var(--text-2); background: var(--surface-3); border: 1px solid var(--line-soft); }
.tribe .tick {
  position: absolute; top: -9px; right: -9px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%;
  color: #241604; background: linear-gradient(180deg, #f6da93, #d6a445); border: 2px solid var(--surface-solid);
  opacity: 0; transform: scale(.4); transition: opacity .25s, transform .35s var(--ease-out);
}
.tribe .tick .icon { width: 14px; height: 14px; stroke-width: 3; }
.tribe.is-selected { border-color: var(--gold); background: var(--gold-soft); box-shadow: 0 0 0 4px var(--gold-soft), 0 14px 30px -14px var(--gold-glow); }
.tribe.is-selected .tick { opacity: 1; transform: none; }
.tribe:focus-within { box-shadow: 0 0 0 4px var(--gold-ring); }

/* Quadrant map */
.quad-wrap { display: grid; gap: 12px; justify-items: center; }
.quad-map {
  position: relative; width: 100%; max-width: 330px; aspect-ratio: 1; border-radius: 18px; overflow: hidden;
  background: var(--map-bg); border: 1px solid var(--line-2); box-shadow: inset 0 0 40px rgba(0, 0, 0, .25);
}
.quad-map::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--map-grid) 1px, transparent 1px), linear-gradient(90deg, var(--map-grid) 1px, transparent 1px);
  background-size: 10% 10%; }
.quad-map .axis-v, .quad-map .axis-h { position: absolute; background: var(--line-2); pointer-events: none; z-index: 2; }
.quad-map .axis-v { left: 50%; top: 0; bottom: 0; width: 1px; }
.quad-map .axis-h { top: 50%; left: 0; right: 0; height: 1px; }
.quad-map .dot { position: absolute; width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: var(--map-dot); opacity: .75; box-shadow: 0 0 5px var(--map-dot); pointer-events: none; z-index: 1; }
.quad { position: absolute; width: 50%; height: 50%; display: grid; place-items: center; cursor: pointer; z-index: 3; transition: background .25s; }
.quad input { position: absolute; opacity: 0; pointer-events: none; }
.quad.nw { top: 0; left: 0; } .quad.ne { top: 0; right: 0; } .quad.sw { bottom: 0; left: 0; } .quad.se { bottom: 0; right: 0; }
.quad:hover { background: var(--gold-soft); }
.quad .q { display: grid; justify-items: center; gap: 2px; padding: 8px 10px; border-radius: 12px; text-align: center; transition: background .25s, transform .3s var(--ease-out); }
.quad .q b { font-size: 12.5px; font-weight: 800; letter-spacing: .04em; color: var(--text); text-shadow: 0 1px 6px var(--bg); }
.quad .q small { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.quad .rec { font-size: 9.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--green); padding: 2px 7px; border-radius: 999px; background: var(--green-soft); border: 1px solid color-mix(in srgb, var(--green) 40%, transparent); }
.quad.is-selected { background: color-mix(in srgb, var(--gold) 20%, transparent); box-shadow: inset 0 0 0 2px var(--gold); }
.quad.is-selected .q { background: var(--surface); transform: scale(1.04); }
.quad:focus-within { box-shadow: inset 0 0 0 2px var(--gold-ring); }
.seg { display: inline-flex; padding: 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-3); gap: 4px; }
.seg label { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 9px; font-size: 13.5px; font-weight: 700; color: var(--text-2); cursor: pointer; transition: background .2s, color .2s; }
.seg label input { position: absolute; opacity: 0; pointer-events: none; }
.seg label .icon { width: 16px; height: 16px; }
.seg label.is-selected { color: #241604; background: linear-gradient(180deg, #f6da93, #d6a445); }
/* The real reCAPTCHA / hCaptcha widget (the provider draws it; it keeps its own width).
   color-scheme: light matches the provider's page: when the frame's scheme
   (dark, inherited from :root) differs from its page's, the browser paints the
   frame white, which showed as white slivers round the dark widget's corners. */
.captcha-live { display: flex; justify-content: center; margin: 16px 0; min-height: 78px; color-scheme: light; }

/* ---------- Auth pages ---------- */
.page-art { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.page-art .art-stack { z-index: 0; }
.page-art .art-stack .art { filter: saturate(1.05); }
.page-art .scrim { position: absolute; inset: 0; z-index: 1; background: var(--page-scrim); }
.page-art .fx-canvas { z-index: 2; }
body.page-auth { display: flex; flex-direction: column; min-height: 100svh; }
.auth-main { flex: 1; display: flex; flex-direction: column; }
.auth-stage { flex: 1; display: grid; place-items: center; padding: calc(var(--header-h) + 36px) var(--gutter) 56px; }
.auth-card { width: min(var(--w, 470px), 100%); padding: clamp(26px, 4vw, 40px) clamp(20px, 4vw, 40px); }
.auth-split { width: min(1080px, 100%); display: grid; grid-template-columns: 1fr minmax(0, 470px); gap: clamp(28px, 5vw, 70px); align-items: center; }
.auth-aside h1 { font-family: var(--font-display); font-size: clamp(34px, 4.4vw, 54px); line-height: 1.06; }
.auth-aside .lede { margin-top: 16px; color: var(--text-2); font-size: 17px; max-width: 470px; }
.auth-aside .world-mini { margin-top: 28px; max-width: 470px; background: var(--surface); backdrop-filter: blur(12px); }
.auth-aside .perks { list-style: none; display: grid; gap: 12px; margin-top: 26px; }
.auth-aside .perks li { display: flex; align-items: center; gap: 12px; color: var(--text-2); font-size: 15px; }
.auth-aside .perks .icon { width: 20px; height: 20px; color: var(--gold-ink); }
.auth-mini-foot { text-align: center; padding: 18px var(--gutter) 26px; font-size: 13px; color: var(--text-3); }
.auth-mini-foot a { color: var(--text-2); margin: 0 8px; }
.auth-mini-foot a:hover { color: var(--gold-ink); }
.big-icon { width: 76px; height: 76px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 50%; color: var(--c, var(--gold-ink)); border: 1px solid color-mix(in srgb, var(--c, var(--gold)) 45%, transparent); background: radial-gradient(circle, color-mix(in srgb, var(--c, var(--gold)) 18%, transparent), transparent 70%); box-shadow: 0 0 0 7px color-mix(in srgb, var(--c, var(--gold)) 7%, transparent); }
.big-icon .icon { width: 34px; height: 34px; }
.big-icon.ok { --c: var(--green); } .big-icon.bad { --c: var(--red); } .big-icon.info { --c: var(--blue); }
.redirect-bar { margin-top: 20px; }
.redirect-bar .track { height: 4px; border-radius: 3px; background: var(--line-soft); overflow: hidden; }
.redirect-bar .track i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--gold-lo), var(--gold)); transform-origin: left; }
.redirect-bar p { margin-top: 8px; font-size: 13px; color: var(--text-3); text-align: center; }
.code-input { text-align: center; letter-spacing: .5em; font-family: var(--font-display); font-weight: 700; font-size: 20px; padding-left: 44px; text-transform: uppercase; }
/* Activation accepted (w.js activateAjax): the ring and the tick draw in, the
   badge pops once, the text rises, then the count to dorf1 runs. */
.field.is-typing .code-input { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent); }
.act-done { text-align: center; padding-top: 6px; }
.act-check { --c: var(--green); width: 96px; height: 96px; margin: 0 auto 20px; border-radius: 50%; color: var(--c); background: radial-gradient(circle, color-mix(in srgb, var(--c) 20%, transparent), transparent 70%); }
.act-check svg { display: block; width: 100%; height: 100%; overflow: visible; }
.act-ring, .act-tick { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.act-ring { stroke-width: 3; stroke-dasharray: 227; stroke-dashoffset: 227; transform: rotate(-90deg); transform-origin: 50% 50%; }
.act-tick { stroke-width: 5; stroke-dasharray: 48; stroke-dashoffset: 48; }
.act-done > :not(.act-check) { opacity: 0; transform: translateY(8px); }
.act-done.is-in .act-ring { animation: act-draw .65s cubic-bezier(.65, 0, .35, 1) .1s forwards; }
.act-done.is-in .act-tick { animation: act-draw .4s cubic-bezier(.65, 0, .35, 1) .7s forwards; }
.act-done.is-in .act-check { animation: act-pop .8s cubic-bezier(.16, 1, .3, 1) 1s both; }
.act-done.is-in > :not(.act-check) { animation: act-rise .55s cubic-bezier(.16, 1, .3, 1) 1.05s forwards; }
.act-done.is-in > .auth-sub { animation-delay: 1.15s; }
.act-done.is-in > .act-cd, .act-done.is-in > .btn { animation-delay: 1.3s; }
.act-cd { margin-top: 16px; min-height: 1.6em; font-size: 15px; color: var(--text-2); }
.act-cd b { display: inline-block; min-width: 1ch; font-family: var(--font-display); font-size: 21px; line-height: 1; color: var(--gold-ink); font-variant-numeric: tabular-nums; animation: act-num .45s cubic-bezier(.16, 1, .3, 1); }
@keyframes act-draw { to { stroke-dashoffset: 0; } }
@keyframes act-pop {
  0% { transform: scale(1); box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 45%, transparent); }
  30% { transform: scale(1.08); }
  100% { transform: scale(1); box-shadow: 0 0 0 20px color-mix(in srgb, var(--c) 0%, transparent); }
}
@keyframes act-rise { to { opacity: 1; transform: none; } }
@keyframes act-num { from { opacity: 0; transform: scale(1.7); } to { opacity: 1; transform: none; } }
.reg-card { width: min(920px, 100%); }
.reg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }

/* ---------- Content pages ---------- */
.page-hero { position: relative; isolation: isolate; overflow: hidden; padding: calc(var(--header-h) + clamp(48px, 7vw, 86px)) 0 clamp(44px, 6vw, 70px); }
.page-hero .art-stack .art { background-position: 50% 55%; }
.page-hero .scrim { position: absolute; inset: 0; z-index: -2; background: var(--page-scrim); }
.page-hero h1 { font-family: var(--font-display); font-size: clamp(34px, 5vw, 60px); line-height: 1.08; margin-top: 14px; }
.page-hero .lede { margin-top: 14px; color: var(--text-2); font-size: clamp(15px, 1.5vw, 18px); max-width: 640px; }
.page-hero.center { text-align: center; }
.page-hero.center .lede { margin-inline: auto; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); }
.crumbs a { color: var(--text-2); }
.crumbs a:hover { color: var(--gold-ink); }
.crumbs .icon { width: 14px; height: 14px; }
.page-hero.center .crumbs { justify-content: center; }

/* Rules */
.rules-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 34px; align-items: start; }
.toc { position: sticky; top: calc(var(--header-h) + 24px); padding: 18px 12px; }
.toc-title { padding: 0 10px 10px; font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-ink); }
.toc a { position: relative; display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 10px; color: var(--text-2); font-size: 14px; font-weight: 600; transition: color .2s, background .2s; }
.toc a span { font-family: var(--font-display); font-size: 12.5px; color: var(--text-3); min-width: 24px; }
.toc a:hover { color: var(--text); background: var(--hover); }
.toc a.is-active { color: var(--text); background: var(--gold-soft); }
.toc a.is-active::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--gold); box-shadow: 0 0 10px var(--gold-glow); }
.toc a.is-active span { color: var(--gold-ink); }
.rules-content { display: grid; gap: 20px; }
.rule-intro { padding: 22px 24px; font-size: 15px; color: var(--text-2); border-left: 3px solid var(--gold); }
.rule { padding: clamp(20px, 3vw, 30px); scroll-margin-top: calc(var(--header-h) + 20px); }
.rule-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.rule-tag { flex: none; display: grid; place-items: center; min-width: 46px; height: 46px; padding: 0 8px; border-radius: 13px; font-family: var(--font-display); font-weight: 800; font-size: 16px; color: var(--gold-ink); background: var(--gold-soft); border: 1px solid var(--line-2); }
.rule-head h2, .rule-head h3 { font-family: var(--font-display); font-size: clamp(19px, 2.2vw, 23px); }
.rule-lead { font-size: 15.5px; color: var(--text); margin-bottom: 14px; }
.sub-rules { display: grid; gap: 12px; }
.sub-rule { padding: 16px 18px; border-radius: 14px; background: var(--surface-3); border: 1px solid var(--line-soft); }
.sub-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.sub-tag { font-family: var(--font-display); font-size: 13px; font-weight: 800; color: var(--gold-ink); }
.sub-title { font-weight: 800; font-size: 15px; }
.sub-rule p, .rule-body li { font-size: 14.5px; color: var(--text-2); line-height: 1.7; }
.sub-rule ol, .sub-rule ul, .rule-body > ul, .rule-body > ol { margin: 10px 0 10px 22px; display: grid; gap: 5px; }
.sub-rule li::marker { color: var(--gold-ink); font-weight: 700; }

/* Tabs */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 6px; padding: 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); backdrop-filter: blur(12px); }
.tab {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 11px;
  font-family: var(--font-display); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2);
  transition: color .2s, background .25s, box-shadow .25s;
}
.tab:hover { color: var(--text); background: var(--hover); }
.tab[aria-selected="true"] { color: #241604; background: linear-gradient(180deg, #f6da93, #d6a445); box-shadow: 0 6px 18px -8px var(--gold-glow); }
.tab small { font-family: var(--font-body); font-size: 11px; font-weight: 700; letter-spacing: .02em; text-transform: none; opacity: .75; }
.tab .icon { width: 16px; height: 16px; }
.tabpanel { animation: viewIn .45s var(--ease-out) both; }
.tabpanel[hidden] { display: none !important; }

/* Hiscores */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-pills button {
  height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-3);
  font-size: 13px; font-weight: 700; color: var(--text-2); transition: all .2s;
}
.filter-pills button:hover { color: var(--text); border-color: var(--line-2); }
.filter-pills button.is-active { color: #241604; border-color: var(--gold-lo); background: linear-gradient(180deg, #f6da93, #d6a445); }
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); -webkit-overflow-scrolling: touch; }
.w-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.w-table th {
  position: sticky; top: 0; padding: 14px 14px; text-align: left; white-space: nowrap;
  font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3);
  background: var(--surface-solid); border-bottom: 1px solid var(--line);
}
.w-table td { padding: 13px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; white-space: nowrap; color: var(--text-2); }
.w-table tbody tr { transition: background .2s; }
.w-table tbody tr:hover { background: var(--hover); }
.w-table tbody tr:last-child td { border-bottom: 0; }
.w-table .player { color: var(--text); font-weight: 700; }
.w-table .pts { display: block; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.w-table .winner { display: flex; align-items: center; gap: 10px; color: var(--gold-ink); font-weight: 800; }
.w-table .winner .icon { width: 18px; height: 18px; }
/* Hiscores: round number, and one column with the start date over the end date */
.w-table .rn { text-align: center; }
.w-table td.rn { font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.w-table .dates span { display: block; }
.w-table td.dates span + span { margin-top: 3px; }
.speed-badge { display: inline-block; padding: 3px 10px; border-radius: 8px; font-family: var(--font-display); font-weight: 800; font-size: 12.5px; color: var(--gold-ink); background: var(--gold-soft); border: 1px solid var(--line-2); }
.ally-tag { display: inline-block; padding: 2px 8px; border-radius: 7px; font-size: 12px; font-weight: 800; letter-spacing: .04em; color: var(--blue); background: var(--blue-soft); }
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 18px; }
.pager button { min-width: 38px; height: 38px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-3); color: var(--text-2); font-weight: 700; font-size: 14px; display: inline-grid; place-items: center; }
.pager button:hover:not(:disabled) { color: var(--text); border-color: var(--line-2); }
.pager button.is-active { color: #241604; border-color: var(--gold-lo); background: linear-gradient(180deg, #f6da93, #d6a445); }
.pager button:disabled { opacity: .4; cursor: default; }
.pager .icon { width: 16px; height: 16px; }
.empty-state { padding: 54px 20px; text-align: center; color: var(--text-3); }
.empty-state .icon { width: 40px; height: 40px; margin: 0 auto 12px; color: var(--gold-ink); }

/* Tutorial */
.tut-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 26px; }
.tut-step {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px 12px;
  border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); text-align: center;
  backdrop-filter: blur(10px); transition: border-color .25s, color .25s, background .25s, transform .3s var(--ease-out);
}
.tut-step:hover { color: var(--text); transform: translateY(-2px); }
.tut-step .n { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); font-family: var(--font-display); font-weight: 800; color: var(--gold-ink); background: var(--gold-soft); }
.tut-step b { font-size: 13px; font-weight: 700; letter-spacing: .04em; }
.tut-step[aria-selected="true"] { border-color: var(--gold); color: var(--text); background: var(--gold-soft); }
.tut-step[aria-selected="true"] .n { color: #241604; background: linear-gradient(180deg, #f6da93, #d6a445); border-color: var(--gold-lo); box-shadow: 0 0 16px var(--gold-glow); }
.tut-step.is-done .n { color: var(--green); border-color: color-mix(in srgb, var(--green) 45%, transparent); background: var(--green-soft); }
.tut-panel { padding: clamp(22px, 4vw, 40px); }
.tut-panel h2, .tut-title { font-family: var(--font-display); font-size: clamp(22px, 2.8vw, 30px); margin-bottom: 22px; }
.tut-panel h2 small, .tut-title small { display: block; font-size: 12.5px; letter-spacing: .24em; color: var(--gold-ink); margin-bottom: 6px; }
.tut-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 18px; }
.tut-figs figure { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-3); }
.tut-figs figure:only-child { width: 100%; max-width: 720px; justify-self: center; }
.tut-figs .img { background: #f3ebdb; }
.tut-figs img { display: block; width: 100%; height: auto; }
.tut-map-art { position: relative; container-type: inline-size; }
.tut-map-tooltips {
  position: absolute; z-index: 1; inset: 0; pointer-events: none;
}
.tut-map-tip {
  position: absolute; left: var(--tip-x); top: var(--tip-y); width: 0; height: 0;
}
.tut-map-art .tip.free.tip-top .tip-box {
  /* Same appearance as compact.css's game tooltip, anchored to the artwork. */
  position: absolute !important; left: 50%; top: auto; right: auto !important; bottom: 100% !important;
  transform: translate(-50%, -8px) !important;
  transform: translate(-50%, -1.1cqw) !important;
  background: rgba(0, 0, 0, .7); color: #fff; border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px; padding: 6px 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
  font: 10px/1.35 Arial, sans-serif; text-align: left; white-space: nowrap;
  width: max-content; min-width: 0; opacity: 1; visibility: visible; pointer-events: none;
  border-radius: 1.1cqw; padding: .83cqw 1.1cqw; font-size: clamp(7px, 1.4cqw, 10px);
}
.tut-map-art .tip-row { display: block; margin-bottom: 2px; margin-bottom: .28cqw; }
.tut-map-art .tip-row:last-child { margin-bottom: 0; }
.tut-map-art .tip-row strong { font-weight: 600; margin-right: 6px; margin-right: .83cqw; }
@supports not (container-type: inline-size) {
  @media (max-width: 560px) {
    .tut-map-art .tip-box { padding: 3px 4px; font-size: 7px; }
  }
}
/* Tutorial step 5: the game's own navigation bar (Templates/header.tpl, compact.css
   .game-header) over full-screen screenshots taken with the real bar hidden
   (_parts/tutorial-navigation.php). The screenshots are 920 game pixels wide and --u
   is one of them at the figure's width, so the bar sits where the game draws it. */
.tg-game { position: relative; container-type: inline-size; }
.tg-game-nav {
  --u: calc(100cqw / 920);
  position: absolute; z-index: 2; top: calc(92 * var(--u)); left: 50%; transform: translateX(-50%);
  display: flex; align-items: flex-start; width: calc(350 * var(--u)); height: calc(72 * var(--u));
  font: 10px/1.35 Verdana, Tahoma, Arial, sans-serif; color: #3e4437;
}
.tg-game-nav button {
  position: relative; display: flex; justify-content: center; align-items: center;
  margin: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer;
}
.tg-game-nav button:focus-visible { outline: 2px solid #6b943c; outline-offset: 3px; }
.tg-nav-button { flex: 0 0 calc(70 * var(--u)); width: calc(70 * var(--u)); height: calc(66 * var(--u)); padding: 0 0 calc(2 * var(--u)); }
.tg-nav-button::before, .tg-split::before {
  content: ""; position: absolute; inset: 0 calc(3 * var(--u)) calc(2 * var(--u));
  border: 1px solid #b6b8ae; border-radius: 50%;
  background: linear-gradient(135deg, #fff 4%, #e9eae4 34%, #fdfdf8 56%, #c9cbc3 100%);
  box-shadow: inset 0 0 0 calc(3 * var(--u)) #fafbf6, inset 0 0 0 calc(4 * var(--u)) #b4b7aa, 0 calc(2 * var(--u)) calc(2 * var(--u)) #0003;
  transition: border-color .12s, box-shadow .12s, background .12s;
}
.tg-nav-button:hover::before, .tg-nav-button[aria-selected="true"]::before {
  border-color: #729452; background: linear-gradient(135deg, #fff, #eef4e5 48%, #c8d9b3);
  box-shadow: inset 0 0 0 calc(3 * var(--u)) #fafcf4, inset 0 0 0 calc(4 * var(--u)) #7e9f5d, 0 calc(2 * var(--u)) calc(3 * var(--u)) #0003;
}
/* The pack's pictures, each cropped to its painted area as in the game header. */
.tg-art { display: block; position: relative; z-index: 1; overflow: hidden; flex-shrink: 0; background-repeat: no-repeat; }
.tg-nav-button .tg-art { width: calc(47 * var(--u)); height: calc(47 * var(--u)); filter: saturate(.48); transition: filter .13s, transform .13s; }
.tg-nav-button:hover .tg-art, .tg-nav-button[aria-selected="true"] .tg-art { filter: saturate(.95); }
.tg-nav-button:active .tg-art { transform: translateY(1px); }
.tg-art[data-art="fields"] { background-image: url("../../../../assets/travix_default/img/l/head_fields.png"); background-size: calc(51.98 * var(--u)); background-position: calc(-2.76 * var(--u)) calc(-2.35 * var(--u)); }
.tg-art[data-art="village"] { background-image: url("../../../../assets/travix_default/img/l/head_village.png"); background-size: calc(49.64 * var(--u)); background-position: calc(-1.32 * var(--u)) calc(-1.19 * var(--u)); }
.tg-art[data-art="map"] { background-image: url("../../../../assets/travix_default/img/l/head_map.png"); background-size: calc(51.37 * var(--u)); background-position: calc(-2.46 * var(--u)) calc(-2.46 * var(--u)); }
.tg-art[data-art="statistics"] { background-image: url("../../../../assets/travix_default/img/l/head_statistics.png"); background-size: calc(52.6 * var(--u)); background-position: calc(-4.48 * var(--u)) calc(-3.22 * var(--u)); }
.tg-art[data-art="reports"] { background-image: url("../../../../assets/travix_default/img/l/head_reports.png"); background-size: calc(32.67 * var(--u)) calc(56.21 * var(--u)); background-position: calc(-2.95 * var(--u)) calc(-.21 * var(--u)); border-radius: calc(28 * var(--u)) 0 0 calc(28 * var(--u)); }
.tg-art[data-art="messages"] { background-image: url("../../../../assets/travix_default/img/l/head_messages.png"); background-size: calc(32.38 * var(--u)) calc(57.29 * var(--u)); background-position: calc(-3.17 * var(--u)) calc(-.86 * var(--u)); border-radius: 0 calc(28 * var(--u)) calc(28 * var(--u)) 0; }
/* Reports | messages share one medallion; grey until something is unread. */
.tg-split { position: relative; isolation: isolate; display: flex; flex: 0 0 calc(70 * var(--u)); width: calc(70 * var(--u)); height: calc(66 * var(--u)); padding: calc(4 * var(--u)) calc(7 * var(--u)) calc(6 * var(--u)); }
.tg-split::before { z-index: -1; }
.tg-split-button { flex: 0 0 calc(28 * var(--u)); width: calc(28 * var(--u)); height: calc(56 * var(--u)); padding: 0; }
.tg-split-button:first-child { border-right: 1px solid #b9bcae; border-radius: calc(27 * var(--u)) 0 0 calc(27 * var(--u)); }
.tg-split-button:last-child { border-radius: 0 calc(27 * var(--u)) calc(27 * var(--u)) 0; }
.tg-split-button:hover { background: #d6e8b966; }
/* The game marks the open half only once it is read; here it shows which view is on. */
.tg-split-button[aria-selected="true"] { background: #e4e5dc77; }
.tg-split-button .tg-art { width: calc(28 * var(--u)); height: calc(56 * var(--u)); filter: grayscale(1); }
.tg-split-button.is-unread .tg-art { filter: none; }
.tg-badge {
  position: absolute; z-index: 3; top: calc(-4 * var(--u)); right: calc(8 * var(--u));
  min-width: calc(15 * var(--u)); height: calc(15 * var(--u)); padding: 0 calc(3 * var(--u));
  border: 1px solid #fff; border-radius: calc(9 * var(--u)); background: #8dc63f; color: #fff;
  font: bold calc(9 * var(--u)) / calc(13 * var(--u)) Verdana, sans-serif; text-align: center; white-space: nowrap;
}
.tg-badge-messages { right: auto; left: calc(8 * var(--u)); background: #b7662d; }
/* compact.css .tip-box, above the button (below it where the figure is too short). */
.tg-tip {
  position: absolute; z-index: 4; bottom: 100%; left: 50%; transform: translate(-50%, -8px);
  padding: 6px 8px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 8px;
  background: rgba(0, 0, 0, .7); color: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
  font-size: 10px; line-height: 1.35; white-space: nowrap;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}
.tg-game-nav button:hover .tg-tip, .tg-game-nav button:focus-visible .tg-tip {
  opacity: 1; visibility: visible; transform: translate(-50%, -12px);
  transition: opacity .18s ease, transform .18s ease, visibility 0s;
}
@container (max-width: 480px) {
  .tg-tip { top: 100%; bottom: auto; transform: translate(-50%, 8px); }
  .tg-game-nav button:hover .tg-tip, .tg-game-nav button:focus-visible .tg-tip { transform: translate(-50%, 12px); }
}
@media (prefers-reduced-motion: reduce) {
  .tg-game-nav *, .tg-game-nav *::before { transition: none !important; }
}
.tut-figs figcaption { display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-weight: 700; font-size: 14.5px; }
.tut-figs figcaption .n { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 50%; font-size: 12px; color: var(--gold-ink); background: var(--gold-soft); border: 1px solid var(--line-2); }
.tut-text { margin-top: 22px; font-size: 16px; color: var(--text-2); max-width: 760px; }
.tut-text ol { margin: 6px 0 0 20px; display: grid; gap: 8px; }
.tut-text li b { color: var(--text); }
.tut-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line-soft); }

/* Manual */
.manual-tabs { display: flex; justify-content: center; margin-bottom: 30px; }
.tribe-section { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; padding: clamp(20px, 3.4vw, 34px); }
.tribe-portrait { border-radius: 16px; overflow: hidden; border: 1px solid var(--line-2); background: radial-gradient(circle at 50% 40%, #fffaf0, #eadfc6); display: grid; place-items: center; padding: 16px; align-self: start; }
.tribe-portrait img { max-height: 230px; max-width: 100%; width: 100%; object-fit: contain; }
.tribe-section h2, .tribe-section h3 { font-family: var(--font-display); font-size: clamp(24px, 3vw, 32px); }
.tribe-section .desc p { color: var(--text-2); font-size: 15px; }
.tribe-section .desc { margin-top: 12px; }
.troop-table { margin-top: 22px; }
/* Unit tables fit their card without sideways scrolling: tight cells and a unit name that may wrap. */
.troop-table .w-table th { padding: 12px 6px; letter-spacing: .05em; }
.troop-table .w-table td { padding: 9px 6px; }
.troop-table td.unit { white-space: normal; min-width: 7.5em; line-height: 1.3; }
.troop-table td:first-child, .troop-table th:first-child { padding-left: 12px; padding-right: 2px; width: 40px; }
.troop-table td:last-child, .troop-table th:last-child { padding-right: 12px; }
.troop-table td.unit { color: var(--text); font-weight: 700; }
.troop-table td.n { text-align: right; font-variant-numeric: tabular-nums; }
.troop-table th.n { text-align: right; }
.troop-table th img { display: inline-block; vertical-align: middle; }
.troop-table .u-icon { width: 16px; min-width: 16px; max-width: none; height: 16px; aspect-ratio: 1; object-fit: contain; display: inline-block; vertical-align: middle; image-rendering: pixelated; }
.troop-table .att { color: var(--red); } .troop-table .dfi { color: var(--blue); } .troop-table .dfc { color: var(--violet); }
/* Portrait above the text below 1100 px, so the table always has room for its columns. */
@media (max-width: 1100px) {
  .tribe-section { grid-template-columns: minmax(0, 1fr); }
  .tribe-portrait { max-width: 220px; }
}
/* Phones: every unit becomes three short lines (name, combat values, costs). The small
   pictures take the place of the column headings; they are the same ones the headings use. */
@media (max-width: 820px) {
  .unit-table thead { display: none; }
  .unit-table .w-table, .unit-table tbody { display: block; }
  .unit-table .w-table tbody tr { display: flex; flex-wrap: wrap; align-items: center; padding: 11px 8px 8px; border-bottom: 1px solid var(--line-soft); }
  .unit-table .w-table tbody tr:last-child { border-bottom: 0; }
  .unit-table .w-table td, .unit-table .w-table td:first-child, .unit-table .w-table td:last-child { display: block; width: auto; padding: 3px 4px; border: 0; }
  .unit-table .w-table td:first-child { flex: 0 0 36px; padding: 0 0 0 4px; }
  .unit-table .w-table td.unit { flex: 1 1 calc(100% - 36px); padding: 0 4px 0 6px; font-size: 15px; }
  .unit-table .w-table td.n { flex: 0 0 20%; order: 1; min-width: 0; text-align: left; font-size: 13.5px; white-space: nowrap; }
  .unit-table .w-table td:nth-child(n+6):nth-child(-n+9) { flex-basis: 25%; order: 2; }
  .unit-table .w-table td.n::before { display: inline-block; margin-right: 5px; vertical-align: -2px; }
  .unit-table .w-table td:nth-child(3)::before { content: url(../../../../assets/travix_default/img/a/att_all.gif); }
  .unit-table .w-table td:nth-child(4)::before { content: url(../../../../assets/travix_default/img/a/def_i.gif); }
  .unit-table .w-table td:nth-child(5)::before { content: url(../../../../assets/travix_default/img/a/def_c.gif); }
  .unit-table .w-table td:nth-child(6)::before { content: url(../../../../assets/travix_default/img/r/1.gif); }
  .unit-table .w-table td:nth-child(7)::before { content: url(../../../../assets/travix_default/img/r/2.gif); }
  .unit-table .w-table td:nth-child(8)::before { content: url(../../../../assets/travix_default/img/r/3.gif); }
  .unit-table .w-table td:nth-child(9)::before { content: url(../../../../assets/travix_default/img/r/4.gif); }
  .unit-table .w-table td:nth-child(10)::before { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M2.5 4l4.5 4-4.5 4M8.5 4l4.5 4-4.5 4' fill='none' stroke='%23b8985a' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
  .unit-table .w-table td:nth-child(11)::before { content: url(../../../../assets/travix_default/img/a/car.gif); }
}
@media (max-width: 400px) {
  .unit-table .w-table td.n { padding: 3px 2px; font-size: 12.5px; }
  .unit-table .w-table td.n::before { margin-right: 3px; }
}
/* Natars details in the manual: note, sub-headings, lists and the 1x tables. */
.natar-note { margin-top: 18px; }
.natar-h { margin: 26px 0 10px; font-family: var(--font-display); font-size: 17px; letter-spacing: .04em; color: var(--gold-ink); }
.natar-h + .troop-table { margin-top: 0; }
.natar-list { display: grid; gap: 6px; margin: 0; padding-left: 20px; color: var(--text-2); font-size: 14.5px; line-height: 1.55; }
.natar-list strong { color: var(--text); }
.natar-table { border: 1px solid var(--line-soft); }
.natar-cap { margin: -4px 0 10px; color: var(--text-3); font-size: 13.5px; }
.natar-cap + .troop-table { margin-top: 0; }
.natar-waves td:first-child, .natar-waves th:first-child { width: auto; padding-right: 14px; }
.natar-waves td.lvl { font-weight: 800; color: var(--text); text-align: center; border-right: 1px solid var(--line-soft); }
.natar-waves tr.wave-first td { border-top: 1px solid var(--line); }
/* Small labels and pictures inside the cells only exist for the phone layout below. */
.troop-table .lbl, .troop-table .cell-icon { display: none; }
@media (max-width: 820px) {
  .troop-table .lbl { display: inline; }
  .troop-table .cell-icon { display: inline-block; flex: none; }
  .natar-table .w-table td { white-space: normal; }
  /* Defenders by size: unit on the first line, the three sizes side by side under it. */
  .natar-sizes thead { display: none; }
  .natar-sizes .w-table, .natar-sizes tbody { display: block; }
  .natar-sizes .w-table tbody tr { display: flex; flex-wrap: wrap; align-items: center; padding: 10px 8px 8px; border-bottom: 1px solid var(--line-soft); }
  .natar-sizes .w-table tbody tr:last-child { border-bottom: 0; }
  .natar-sizes .w-table td, .natar-sizes .w-table td:first-child, .natar-sizes .w-table td:last-child { display: block; width: auto; padding: 3px 4px; border: 0; }
  .natar-sizes .w-table td:first-child { flex: 0 0 36px; padding: 0 0 0 4px; }
  .natar-sizes .w-table td.unit { flex: 1 1 calc(100% - 36px); padding: 0 4px 0 6px; font-size: 15px; }
  .natar-sizes .w-table td.n { flex: 1 1 33%; min-width: 0; text-align: left; font-size: 13.5px; }
  .natar-sizes .lbl { display: block; margin-bottom: 1px; color: var(--text-3); font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
  /* Attack waves: level heading, wave line, then the six unit counts in two rows of three. */
  .natar-waves thead { display: none; }
  .natar-waves .w-table, .natar-waves tbody { display: block; }
  .natar-waves .w-table tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 6px; padding: 9px 8px 11px; border-bottom: 1px solid var(--line-soft); }
  .natar-waves .w-table tbody tr.wave-first { border-top: 1px solid var(--line); }
  .natar-waves .w-table tbody tr:last-child { border-bottom: 0; }
  .natar-waves .w-table td, .natar-waves .w-table td:first-child { display: flex; align-items: center; gap: 6px; width: auto; padding: 2px 4px; border: 0; text-align: left; white-space: nowrap; }
  .natar-waves .w-table td.lvl { grid-column: 1 / -1; order: -2; justify-content: flex-start; padding-bottom: 0; font-size: 15px; text-align: left; }
  .natar-waves .w-table td.wave { grid-column: 1 / -1; order: -1; color: var(--text); font-weight: 700; }
  .natar-waves .w-table td.n:not(.lvl) { font-size: 13.5px; }
}
.buildings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.building { padding: 20px; display: grid; grid-template-columns: 84px 1fr; gap: 16px; align-items: start; }
.building .pic { width: 84px; height: 104px; border-radius: 12px; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #fffaf0, #e7dbc0); border: 1px solid var(--line); overflow: hidden; }
.building .pic img { max-width: 92%; max-height: 92%; mix-blend-mode: multiply; }
.building h3 { font-family: var(--font-display); font-size: 17px; }
.building p { margin-top: 6px; font-size: 13.5px; color: var(--text-2); line-height: 1.55; }
.building .adv { margin-top: 8px; font-size: 12.5px; color: var(--gold-ink); }
.costs { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px; font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.costs span { display: inline-flex; align-items: center; gap: 4px; }
.costs img { width: 18px; height: 12px; }
.prereq { margin-top: 8px; font-size: 12.5px; color: var(--text-3); }
.prereq + .prereq { margin-top: 3px; }
.buildings-group { margin: 34px 0 14px; text-align: center; }
.buildings-group:first-of-type { margin-top: 0; }
.faq { display: grid; gap: 12px; max-width: 900px; margin: 0 auto; }
.faq-group { margin: 14px 0 2px; font-family: var(--font-display); font-size: 13px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-ink); }
.faq details { border-radius: 16px; border: 1px solid var(--line); background: var(--surface); backdrop-filter: blur(10px); overflow: hidden; transition: border-color .25s; }
.faq details[open] { border-color: var(--line-2); }
.faq summary { display: flex; align-items: center; gap: 14px; padding: 18px 20px; cursor: pointer; list-style: none; font-weight: 700; font-size: 15.5px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .q-icon { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: var(--gold-ink); background: var(--gold-soft); border: 1px solid var(--line-2); font-family: var(--font-display); font-weight: 800; font-size: 14px; }
.faq summary .chev { margin-left: auto; width: 18px; height: 18px; color: var(--text-3); transition: transform .3s var(--ease-out); }
.faq details[open] summary .chev { transform: rotate(180deg); color: var(--gold-ink); }
.faq .answer { padding: 0 20px 20px 64px; color: var(--text-2); font-size: 14.5px; }
.faq .answer .w-table { margin-top: 12px; font-size: 13px; }
.faq .answer .w-table td, .faq .answer .w-table th { padding: 8px 10px; }
.faq .answer .table-wrap { margin-top: 12px; }
.faq .answer .table-wrap .w-table { margin-top: 0; }
.faq .answer .cp-table td, .faq .answer .cp-table th { padding: 6px 7px; text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.faq .answer .cp-table th.text { text-align: left; }
.faq .answer .cp-need { table-layout: fixed; min-width: 640px; }

/* Error page */
.error-stage { text-align: center; }
.error-code {
  font-family: var(--font-display); font-weight: 900; line-height: .9; letter-spacing: .04em;
  font-size: clamp(110px, 22vw, 210px);
  background: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 50%, var(--gold-lo) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 10px 40px var(--gold-glow));
}
.error-stage h1 { margin-top: 10px; font-family: var(--font-display); font-size: clamp(24px, 3.4vw, 36px); }
.error-stage p { margin: 12px auto 0; max-width: 520px; color: var(--text-2); font-size: 16.5px; }
.error-stage .hero-cta { justify-content: center; }

/* ---------- Toasts / cookie ---------- */
.toasts { position: fixed; z-index: 1100; right: 20px; bottom: 20px; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 14px; pointer-events: auto;
  background: var(--surface-solid); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); color: var(--text-2); font-size: 14px;
  animation: toastIn .45s var(--ease-out) both;
}
.toast.out { animation: toastOut .3s ease both; }
.toast .icon { width: 20px; height: 20px; color: var(--gold-ink); margin-top: 1px; }
.toast b { color: var(--text); display: block; }
.toast.success .icon { color: var(--green); }
.toast.error .icon { color: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }
.cookie {
  position: fixed; z-index: 850; left: 20px; right: 20px; bottom: 20px; margin: 0 auto; max-width: 680px;
  display: flex; align-items: center; gap: 16px; padding: 14px 16px 14px 18px; border-radius: 16px;
  background: var(--surface-solid); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); font-size: 14px; color: var(--text-2);
  transform: translateY(140%); transition: transform .6s var(--ease-out);
}
.cookie.is-shown { transform: none; }
.cookie .icon { width: 24px; height: 24px; color: var(--gold-ink); }
.cookie p { flex: 1; }

/* Cinzel draws "1" like a capital I — small numeric labels use the body face. */
.speed-badge, .tab, .tut-step .n, .rule-tag, .toc a span, .sub-tag, .group-title .n,
.tut-figs figcaption .n, .tut-panel h2 small, .tut-title small, .srv-name .speed, .world-title .speed {
  font-family: var(--font-body); font-weight: 800;
}
.tab { letter-spacing: .06em; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .main-nav > a, .nav-drop > button { padding: 0 9px; letter-spacing: .08em; }
  .hof-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 980px) {
  :root { --header-h: 64px; }
  .main-nav, .header-actions .hide-m { display: none !important; }
  .burger { display: inline-grid; }
  .world-feature { grid-template-columns: 1fr; }
  .world-art { min-height: 220px; }
  .world-art::after { background: linear-gradient(180deg, rgba(0, 0, 0, .15) 0%, transparent 40%, var(--surface-solid) 100%); }
  .auth-split { grid-template-columns: 1fr; max-width: 520px; }
  .auth-aside { text-align: center; }
  .auth-aside .lede, .auth-aside .world-mini { margin-inline: auto; }
  .auth-aside .perks { display: none; }
  .rules-layout { grid-template-columns: 1fr; }
  .toc { position: sticky; top: var(--header-h); z-index: 20; display: flex; gap: 6px; overflow-x: auto; padding: 8px; border-radius: 14px; scrollbar-width: none; }
  .toc::-webkit-scrollbar { display: none; }
  .toc-title { display: none; }
  .toc a { flex: none; white-space: nowrap; padding: 7px 12px; }
  .toc a.is-active::before { display: none; }
  .reg-grid { grid-template-columns: 1fr; }
  .tribe-section { grid-template-columns: minmax(0, 1fr); }
  .tribe-portrait { max-width: 220px; }
}
@media (max-width: 760px) {
  .hero-scrim { background: var(--hero-scrim-m); }
  .hero { padding-bottom: 90px; align-items: flex-end; }
  .hero-content { text-align: left; }
  .art-stack .art { background-position: 70% 40%; }
  .hero-stats { margin-top: 32px; }
  .hero-stat { min-width: 0; }
  .hero-stat + .hero-stat { padding-left: 14px; }
  .scroll-cue { display: none; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .shot:nth-child(6) { grid-column: span 1; }
  .feature-grid { grid-template-columns: 1fr; }
  .tut-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  .tut-step { padding: 10px 4px; }
  .tut-step b { display: none; }
  .lightbox { padding: 64px 12px 84px; }
  .lb-prev, .lb-next { top: auto; bottom: 18px; margin-top: 0; }
  .lb-prev { left: calc(50% - 60px); } .lb-next { right: calc(50% - 60px); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-brand { grid-column: 1 / -1; }
  .header-actions .lang-btn .code { display: none; }
}
@media (max-width: 560px) {
  .modal { padding: 0; align-items: end; }
  .modal-panel { width: 100%; max-height: calc(100svh - var(--header-h) - 10px); border-radius: 22px 22px 0 0; transform: translateY(110px); }
  .modal-panel.ornate::after { inset: 10px; }
  /* The sign-in box is short: centred with a margin all round instead of a sheet stuck to the bottom. */
  #authModal { padding: 14px; align-items: center; }
  #authModal .modal-panel { border-radius: 22px; max-height: calc(100svh - var(--header-h) - 28px); }
  .field-row { grid-template-columns: 1fr; }
  .path-grid { grid-template-columns: 1fr; }
  .tribes { gap: 8px; }
  .tribe { padding: 8px 6px 10px; }
  .tribe .traits { display: none; }
  .hof-grid { grid-template-columns: 1fr; }
  .stats3 { gap: 6px; }
  .srv-grid { grid-template-columns: 1fr; }
  .cd-unit { min-width: 54px; }
  .cd-unit b { font-size: 22px; }
  .header-actions { gap: 8px; }
  .site-header .bar { gap: 12px; }
  .brand-name { font-size: 31px; }
  .theme-switch { width: 58px; --travel: 24px; }
  .auth-card { padding: 26px 18px; }
  .auth-split > .auth-aside { display: none; }
  .auth-stage { padding-top: calc(var(--header-h) + 20px); }
  .tribe-section { padding: 16px 12px; gap: 18px; }
  .building { grid-template-columns: 64px 1fr; padding: 16px; }
  .building .pic { width: 64px; height: 84px; }
  .faq .answer { padding-left: 20px; }
  .toasts { right: 16px; bottom: 16px; }
  .cookie { left: 12px; right: 12px; bottom: 12px; flex-wrap: wrap; }
}

/* Tooltips: every title="…" on the site (w.js moves it to data-tip and draws this box). */
.w-tip {
  position: fixed; z-index: 1200; left: 0; top: 0;
  width: max-content; max-width: min(280px, calc(100vw - 16px)); padding: 8px 12px; border-radius: 10px;
  background: var(--surface-solid); border: 1px solid var(--line-2); box-shadow: var(--shadow);
  color: var(--text); font-size: 12.5px; font-weight: 600; line-height: 1.45; text-align: center; white-space: normal;
  pointer-events: none; opacity: 0; visibility: hidden; transform: translateY(4px);
  transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
}
.w-tip.is-below { transform: translateY(-4px); }
.w-tip.is-on { opacity: 1; visibility: visible; transform: none; transition: opacity .16s ease, transform .16s ease, visibility 0s; }
.w-tip::after {
  content: ''; position: absolute; left: var(--ax, 50%); top: 100%; width: 9px; height: 9px; margin: -5px 0 0 -5px;
  background: var(--surface-solid); border: solid var(--line-2); border-width: 0 1px 1px 0; transform: rotate(45deg);
}
.w-tip.is-below::after { top: 0; border-width: 1px 0 0 1px; }
[data-tip]:not(a):not(button) { cursor: help; }

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

/* Phones to 420px: the brand and the three header buttons share one bar. The Lithuanian and Russian subtitle with
   its wide letter spacing pushed the night-mode switch and the menu button past a 320-360px screen. */
@media (max-width: 420px) {
  .site-header .bar { gap: 8px; }
  .brand-name { font-size: 27px; }
  .brand-sub { font-size: 7.5px; letter-spacing: .14em; padding-left: .14em; }
  .header-actions { gap: 6px; }
  .header-actions .lang-btn > svg:last-child { display: none; }
  .header-actions .lang-btn { padding-left: 8px; padding-right: 8px; }
  .theme-switch { width: 50px; --travel: 18px; }
}

/* Travix account (one sign-in on travix.lt for every world): the button on #login / #register
   and the badge in the character wizard (auth-panels.php, wizard-register.php). */
.acc-crest {
  flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
  font-family: var(--font-display, 'Cinzel', Georgia, serif); font-weight: 700; font-size: 15px; line-height: 1;
  color: #1d1404; background: linear-gradient(180deg, #f8de9c 0%, #e2b65a 55%, #c48f35 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 0 0 1px rgba(29, 20, 4, .25);
}
.btn-acc .acc-crest { width: 24px; height: 24px; font-size: 14px; color: #f6da96; background: #1d1404; box-shadow: none; }
.acc-note { margin: 10px 0 0; text-align: center; font-size: 13px; color: var(--text-3); }
.acc-note a { color: var(--gold-ink); font-weight: 700; }
.acc-badge .acc-crest { width: 30px; height: 30px; font-size: 17px; }
