/* NEXUS website design system: base, layout, components and motion primitives.
   Colors, sizes and timings come from tokens.css. Page files add layout only. */

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nx-nav-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--nx-bg);
  color: var(--nx-text);
  font: 400 var(--nx-fs-body-m) / var(--nx-lh-body) var(--nx-font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
/* Fine film grain over everything: keeps big dark areas from looking flat. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-family: var(--nx-font-display); font-weight: 700; line-height: var(--nx-lh-heading); letter-spacing: var(--nx-tracking-display); text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--nx-focus); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--nx-accent); color: var(--nx-accent-ink); }
[hidden] { display: none !important; }
.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; }
.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 100;
  padding: 10px 16px; border-radius: var(--nx-radius-sm);
  background: var(--nx-accent); color: var(--nx-accent-ink); font-weight: 600; text-decoration: none;
  transform: translateY(-160%); transition: transform var(--nx-dur-ui) var(--nx-ease-out);
}
.skip-link:focus { transform: none; }
main { position: relative; z-index: 2; display: block; }

/* ============ Type ============ */
.display-xl, .display-l, .display-m {
  font-family: var(--nx-font-display);
  font-stretch: var(--nx-display-stretch);
  font-weight: 750;
  line-height: var(--nx-lh-display);
  letter-spacing: var(--nx-tracking-display);
  text-transform: uppercase;
}
.display-xl { font-size: var(--nx-fs-display-xl); }
.display-l { font-size: var(--nx-fs-display-l); }
.display-m { font-size: var(--nx-fs-display-m); }
.heading-xl { font-size: var(--nx-fs-heading-xl); }
.heading-l { font-size: var(--nx-fs-heading-l); }
.heading-m { font-size: var(--nx-fs-heading-m); line-height: 1.25; }
.body-l { font-size: var(--nx-fs-body-l); line-height: 1.55; color: var(--nx-text-muted); }
.body-s { font-size: var(--nx-fs-body-s); }
.caption { font-size: var(--nx-fs-caption); color: var(--nx-text-faint); }
.muted { color: var(--nx-text-muted); }
.faint { color: var(--nx-text-faint); }
.tabular { font-variant-numeric: tabular-nums; }
.accent-text { color: var(--nx-accent); }

/* Eyebrow: a small label with the Link ring in front of it. */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 var(--nx-fs-caption) / 1 var(--nx-font-body);
  letter-spacing: var(--nx-tracking-caps);
  text-transform: uppercase;
  color: var(--nx-accent);
}
.eyebrow::before {
  content: '';
  width: 16px; height: 6px; flex: none;
  border: 1.5px solid currentColor; border-radius: 50%;
}
.eyebrow--energy { color: var(--nx-energy); }
.eyebrow--plain::before { display: none; }

/* ============ Layout ============ */
.container { width: min(var(--nx-container), 100% - 2 * var(--nx-gutter)); margin-inline: auto; }
.container--narrow { width: min(var(--nx-container-narrow), 100% - 2 * var(--nx-gutter)); margin-inline: auto; }
.section { position: relative; padding-block: var(--nx-section-y); }
.section--tight { padding-block: calc(var(--nx-section-y) * 0.6); }
.section--deep { background: var(--nx-bg-deep); }
.section--haze { background: var(--nx-haze), var(--nx-bg); }
.section__head { display: grid; gap: var(--nx-space-4); max-width: 780px; margin-bottom: var(--nx-space-7); }
.section__head--center { margin-inline: auto; text-align: center; justify-items: center; }
.section__head--split { max-width: none; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: var(--nx-space-5) var(--nx-space-7); }
.section__head--split > :not(.section__actions) { grid-column: 1; }
.section__actions { display: flex; gap: var(--nx-space-3); flex-wrap: wrap; align-items: center; margin-top: var(--nx-space-2); }
.section__head--split .section__actions { grid-column: 2; grid-row: 1 / span 3; align-self: end; margin-top: 0; }
@media (max-width: 760px) {
  .section__head--split { grid-template-columns: 1fr; }
  .section__head--split .section__actions { grid-column: 1; grid-row: auto; }
}
.section__lead { font-size: var(--nx-fs-body-l); color: var(--nx-text-muted); max-width: var(--nx-measure); }
.stack { display: grid; gap: var(--nx-stack, var(--nx-space-4)); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--nx-cluster, var(--nx-space-3)); }
.grid { display: grid; gap: var(--nx-grid-gap, var(--nx-space-5)); grid-template-columns: repeat(auto-fill, minmax(min(var(--nx-grid-min, 260px), 100%), 1fr)); }
.divider { height: 1px; border: 0; margin: 0; background: linear-gradient(90deg, transparent, var(--nx-border-strong), transparent); }
/* Fine grid texture for technical areas. */
.bg-grid { position: relative; isolation: isolate; }
.bg-grid::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--nx-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--nx-border) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
}

/* ============ Icons ============ */
.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 1em; height: 1em; }
.icon--lg { width: 1.6em; height: 1.6em; }
.flux { display: inline-flex; align-items: center; gap: 0.3em; font-variant-numeric: tabular-nums; font-weight: 600; }
.flux .icon { color: var(--nx-accent); width: 1em; height: 1em; }

/* ============ Buttons ============
   The shape is drawn on ::before so focus rings stay visible (clip-path would clip them). */
.btn {
  --btn-bg: var(--nx-surface-raised);
  --btn-fg: var(--nx-text);
  --btn-edge: var(--nx-border-strong);
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  border: 0; background: none; color: var(--btn-fg);
  font: 650 0.9rem / 1 var(--nx-font-display);
  font-stretch: 90%;
  letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; white-space: nowrap;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform var(--nx-dur-micro) var(--nx-ease-out), color var(--nx-dur-ui) var(--nx-ease-out);
}
.btn::before, .btn::after { content: ''; position: absolute; clip-path: var(--nx-cut-shape); z-index: -1; transition: background var(--nx-dur-ui) var(--nx-ease-out), opacity var(--nx-dur-ui) var(--nx-ease-out), inset var(--nx-dur-ui) var(--nx-ease-out); }
.btn::before { inset: 0; background: var(--btn-edge); }
.btn::after { inset: 1px; background: var(--btn-bg); }
.btn:hover { --btn-edge: rgb(238 234 246 / 0.4); }
.btn:active { transform: translateY(1px) scale(0.985); }
.btn:focus-visible { outline-offset: 4px; border-radius: 2px; }
.btn[disabled], .btn[aria-disabled='true'] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn .icon { width: 1.1em; height: 1.1em; transition: transform var(--nx-dur-ui) var(--nx-ease-emphasis); }
.btn:hover .icon--arrow { transform: translateX(3px); }

.btn--primary { --btn-bg: var(--nx-accent); --btn-edge: var(--nx-accent); --btn-fg: var(--nx-accent-ink); }
.btn--primary:hover { --btn-bg: var(--nx-accent-strong); --btn-edge: var(--nx-accent-strong); }
.btn--primary::after { box-shadow: none; }
.btn--energy { --btn-bg: var(--nx-energy); --btn-edge: var(--nx-energy); --btn-fg: var(--nx-energy-ink); }
.btn--ghost { --btn-bg: var(--nx-surface-overlay); }
.btn--ghost:hover { --btn-bg: rgb(27 24 46 / 0.9); }
.btn--quiet { --btn-bg: transparent; --btn-edge: transparent; padding-inline: 10px; }
.btn--quiet:hover { --btn-edge: transparent; color: var(--nx-accent); }
.btn--sm { min-height: 38px; padding: 0 14px; font-size: 0.78rem; --nx-cut: 7px; }
.btn--lg { min-height: 58px; padding: 0 30px; font-size: 1rem; --nx-cut: 13px; }
.btn--block { width: 100%; }
/* Enter buttons carry the Link ring, which opens up on hover like a gate. */
.btn__ring { width: 18px; height: 8px; border: 1.8px solid currentColor; border-radius: 50%; transition: transform var(--nx-dur-large) var(--nx-ease-emphasis), height var(--nx-dur-large) var(--nx-ease-emphasis); }
.btn:hover .btn__ring { height: 16px; transform: scale(1.05); }
.btn.is-busy { pointer-events: none; }
.btn.is-busy .btn__label { opacity: 0.55; }

/* Icon-only button */
.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: var(--nx-radius-md);
  border: 1px solid var(--nx-border); background: var(--nx-surface-overlay); color: var(--nx-text);
  transition: border-color var(--nx-dur-ui), background var(--nx-dur-ui), transform var(--nx-dur-micro);
}
.icon-btn:hover { border-color: var(--nx-border-strong); background: var(--nx-surface-raised); }
.icon-btn:active { transform: scale(0.96); }
.icon-btn[aria-pressed='true'] { border-color: var(--nx-accent); color: var(--nx-accent); }

/* Text link with an arrow */
.link-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--nx-text); font-weight: 600; text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size var(--nx-dur-ui) var(--nx-ease-out), color var(--nx-dur-ui);
}
.link-arrow:hover { background-size: 100% 1px; color: var(--nx-accent); }
.link-arrow .icon { transition: transform var(--nx-dur-ui) var(--nx-ease-emphasis); }
.link-arrow:hover .icon { transform: translateX(3px); }

/* ============ Tags, badges, chips ============ */
.tag {
  --tag-c: var(--nx-text-muted);
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 9px; border-radius: var(--nx-radius-sm);
  font: 600 0.7rem / 1 var(--nx-font-body); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--tag-c); background: color-mix(in srgb, var(--tag-c) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--tag-c) 26%, transparent);
  white-space: nowrap;
}
.tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag--plain::before { display: none; }
.tag--live { --tag-c: var(--nx-state-live); }
.tag--live::before { box-shadow: 0 0 0 0 currentColor; animation: nx-pulse 2.4s var(--nx-ease-out) infinite; }
.tag--event { --tag-c: var(--nx-state-event); }
.tag--soon { --tag-c: var(--nx-state-soon); }
.tag--mystery { --tag-c: var(--nx-state-mystery); }
.tag--info { --tag-c: var(--nx-state-info); }
.tag--ended { --tag-c: var(--nx-text-muted); }
.tag--owned { --tag-c: var(--nx-state-success); }
.tag--mock { --tag-c: var(--nx-energy); border-style: dashed; }
@keyframes nx-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 14px; border-radius: var(--nx-radius-sm);
  border: 1px solid var(--nx-border); background: var(--nx-surface);
  color: var(--nx-text-muted); font-weight: 500; font-size: 0.92rem; white-space: nowrap;
  transition: color var(--nx-dur-ui), border-color var(--nx-dur-ui), background var(--nx-dur-ui);
}
.chip:hover { color: var(--nx-text); border-color: var(--nx-border-strong); }
.chip[aria-pressed='true'], .chip[aria-selected='true'] { color: var(--nx-text); border-color: var(--nx-accent); background: var(--nx-accent-soft); }
.chip__count { font-size: 0.78rem; color: var(--nx-text-faint); font-variant-numeric: tabular-nums; }
.chip[aria-pressed='true'] .chip__count, .chip[aria-selected='true'] .chip__count { color: var(--nx-text-muted); }
.chip-row { display: flex; gap: var(--nx-space-2); overflow-x: auto; scrollbar-width: none; padding: 6px; margin: -6px; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.chip-row::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .chip-row { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; } }

/* Rarity mark: a small rotated square in the rarity color. */
.rarity { --r: var(--nx-rarity-common); display: inline-flex; align-items: center; gap: 7px; color: var(--r); font-weight: 600; font-size: 0.82rem; }
.rarity::before { content: ''; width: 8px; height: 8px; background: var(--r); transform: rotate(45deg); border-radius: 1px; box-shadow: 0 0 10px color-mix(in srgb, var(--r) 60%, transparent); }
[data-rarity='common'] { --r: var(--nx-rarity-common); }
[data-rarity='uncommon'] { --r: var(--nx-rarity-uncommon); }
[data-rarity='rare'] { --r: var(--nx-rarity-rare); }
[data-rarity='epic'] { --r: var(--nx-rarity-epic); }
[data-rarity='legendary'] { --r: var(--nx-rarity-legendary); }
[data-rarity='mythic'] { --r: var(--nx-rarity-mythic); }

/* ============ Tabs ============ */
.tabs { position: relative; display: flex; gap: var(--nx-space-5); border-bottom: 1px solid var(--nx-border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; flex: none; padding: 14px 0; border: 0; background: none;
  color: var(--nx-text-muted); font-weight: 600; font-size: 0.95rem; white-space: nowrap;
  transition: color var(--nx-dur-ui);
}
.tab::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--nx-accent); transform: scaleX(0); transform-origin: left; transition: transform var(--nx-dur-ui) var(--nx-ease-emphasis); }
.tab:hover { color: var(--nx-text); }
.tab[aria-selected='true'] { color: var(--nx-text); }
.tab[aria-selected='true']::after { transform: none; }
.tab__count { margin-left: 6px; color: var(--nx-text-faint); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ============ Cards ============ */
.card {
  position: relative;
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius-lg);
  padding: var(--nx-card-pad, var(--nx-space-5));
  box-shadow: var(--nx-shadow-1);
}
.card--raised { background: var(--nx-surface-raised); box-shadow: var(--nx-shadow-2); }
.card--quiet { background: transparent; box-shadow: none; }
.card--dashed { background: transparent; box-shadow: none; border-style: dashed; border-color: var(--nx-border-strong); }
.card--link { transition: transform var(--nx-dur-ui) var(--nx-ease-out), border-color var(--nx-dur-ui), background var(--nx-dur-ui); }
.card--link:hover { transform: translateY(-3px); border-color: var(--nx-border-strong); background: var(--nx-surface-raised); }
.card__title { font-size: var(--nx-fs-heading-m); margin-bottom: 6px; }
.card__text { color: var(--nx-text-muted); }
.card a.card__cover { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.card a.card__cover:focus-visible { outline-offset: 2px; }

/* World card: a destination, not a thumbnail. */
.world-card {
  --wc-accent: var(--nx-state-live);
  position: relative; isolation: isolate;
  display: grid; align-content: end;
  min-height: 420px; padding: var(--nx-space-5);
  border-radius: var(--nx-radius-lg); overflow: hidden;
  border: 1px solid var(--nx-border);
  background: var(--nx-surface);
  color: var(--nx-text); text-decoration: none;
  transition: transform var(--nx-dur-large) var(--nx-ease-emphasis), border-color var(--nx-dur-ui), box-shadow var(--nx-dur-large);
}
.world-card__media { position: absolute; inset: 0; z-index: -2; }
.world-card__media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.02); transition: transform 1.4s var(--nx-ease-out), filter var(--nx-dur-large); }
.world-card::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgb(5 4 11 / 0.15) 0%, rgb(5 4 11 / 0.35) 40%, rgb(5 4 11 / 0.94) 82%); }
.world-card__top { position: absolute; top: var(--nx-space-4); left: var(--nx-space-4); right: var(--nx-space-4); display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.world-card__name { font: 750 clamp(1.9rem, 1.4rem + 1.2vw, 2.5rem) / 0.92 var(--nx-font-display); font-stretch: var(--nx-display-stretch); text-transform: uppercase; }
.world-card__by { margin-top: 8px; color: var(--nx-text-muted); font-size: 0.9rem; }
.world-card__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; color: var(--nx-text-muted); font-size: 0.85rem; }
.world-card__meta span { display: inline-flex; align-items: center; gap: 6px; }
.world-card__desc { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--nx-dur-large) var(--nx-ease-emphasis), opacity var(--nx-dur-large); opacity: 0; }
.world-card__desc > p { overflow: hidden; color: var(--nx-text-muted); padding-top: 12px; font-size: 0.95rem; }
.world-card__enter { display: inline-flex; align-items: center; gap: 10px; margin-top: 18px; font: 650 0.8rem / 1 var(--nx-font-display); font-stretch: 90%; letter-spacing: 0.1em; text-transform: uppercase; color: var(--wc-accent); }
.world-card__ring { width: 22px; height: 8px; border: 1.8px solid currentColor; border-radius: 50%; transition: height var(--nx-dur-large) var(--nx-ease-emphasis), width var(--nx-dur-large) var(--nx-ease-emphasis), box-shadow var(--nx-dur-large); }
.world-card:hover, .world-card:focus-visible { border-color: color-mix(in srgb, var(--wc-accent) 45%, transparent); box-shadow: 0 30px 80px -40px color-mix(in srgb, var(--wc-accent) 60%, transparent); transform: translateY(-4px); }
.world-card:hover .world-card__media img, .world-card:focus-visible .world-card__media img { transform: scale(1.08); }
.world-card:hover .world-card__desc, .world-card:focus-visible .world-card__desc { grid-template-rows: 1fr; opacity: 1; }
.world-card:hover .world-card__ring, .world-card:focus-visible .world-card__ring { width: 22px; height: 22px; box-shadow: 0 0 16px currentColor; }
.world-card--sealed { --wc-accent: var(--nx-state-soon); }
.world-card--sealed .world-card__media img { filter: saturate(0.6) brightness(0.8); }
.world-card--mystery { --wc-accent: var(--nx-state-mystery); }
.world-card--compact { min-height: 320px; }
@media (hover: none) { .world-card__desc { grid-template-rows: 1fr; opacity: 1; } }

/* Cosmetic card */
.item-card {
  --r: var(--nx-rarity-common);
  position: relative; display: grid; gap: 10px; align-content: start;
  padding: 10px 10px 14px; border-radius: var(--nx-radius-lg);
  background: var(--nx-surface); border: 1px solid var(--nx-border);
  color: var(--nx-text); text-decoration: none;
  transition: transform var(--nx-dur-ui) var(--nx-ease-out), border-color var(--nx-dur-ui), background var(--nx-dur-ui);
}
.item-card__media {
  position: relative; aspect-ratio: 1; border-radius: calc(var(--nx-radius-lg) - 6px); overflow: hidden;
  background: radial-gradient(90% 90% at 50% 30%, color-mix(in srgb, var(--r) 22%, var(--void-750)), var(--void-850) 75%);
}
.item-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--nx-dur-large) var(--nx-ease-emphasis); }
.item-card__media::after { content: ''; position: absolute; left: 12%; right: 12%; bottom: 0; height: 2px; background: var(--r); box-shadow: 0 0 14px var(--r); opacity: 0.8; }
.item-card__body { display: grid; gap: 4px; padding-inline: 4px; }
.item-card__name { font: 650 1rem / 1.25 var(--nx-font-body); }
.item-card__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.85rem; color: var(--nx-text-muted); }
.item-card__flag { position: absolute; top: 18px; left: 18px; z-index: 1; }
/* Tags that sit on artwork get a solid backing so their text holds contrast on any image. */
.world-card__top .tag, .item-card__flag, .world-hero .tag, .hero .tag { background: color-mix(in srgb, var(--tag-c) 16%, var(--nx-bg)); }
.item-card:hover, .item-card:focus-visible { transform: translateY(-3px); border-color: color-mix(in srgb, var(--r) 45%, transparent); background: var(--nx-surface-raised); }
.item-card:hover .item-card__media img { transform: scale(1.06) rotate(-1deg); }
.item-card--legendary .item-card__media, .item-card--mythic .item-card__media { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--r) 45%, transparent), inset 0 -40px 60px -30px color-mix(in srgb, var(--r) 50%, transparent); }

/* Stat */
.stat { display: grid; gap: 2px; }
.stat__value { font: 750 clamp(1.8rem, 1.4rem + 1.2vw, 2.6rem) / 1 var(--nx-font-display); font-stretch: var(--nx-display-stretch); font-variant-numeric: tabular-nums; }
.stat__label { color: var(--nx-text-muted); font-size: 0.85rem; }

/* ============ Forms ============ */
.field { display: grid; gap: 7px; }
.field + .field { margin-top: var(--nx-space-4); }
.field__label { font-weight: 600; font-size: 0.92rem; display: flex; justify-content: space-between; gap: 8px; }
.field__label small { font-weight: 400; color: var(--nx-text-faint); }
.field__hint { color: var(--nx-text-faint); font-size: 0.84rem; }
.field__error { color: var(--nx-state-error); font-size: 0.86rem; min-height: 0; }
.input {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border-radius: var(--nx-radius-md); border: 1px solid var(--nx-border-control);
  background: var(--nx-surface-sunken); color: var(--nx-text);
  transition: border-color var(--nx-dur-ui), box-shadow var(--nx-dur-ui), background var(--nx-dur-ui);
}
.input::placeholder { color: var(--nx-text-faint); }
.input:hover { border-color: rgb(238 234 246 / 0.3); }
.input:focus { outline: none; border-color: var(--nx-accent); box-shadow: 0 0 0 3px var(--nx-accent-soft); background: var(--nx-bg); }
.input[aria-invalid='true'] { border-color: var(--nx-state-error); }
.check input[aria-invalid='true'] { border-color: var(--nx-state-error); }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 52px; }
.input-wrap__btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 42px; display: grid; place-items: center; border: 0; background: none; color: var(--nx-text-muted); border-radius: var(--nx-radius-sm); }
.input-wrap__btn:hover { color: var(--nx-text); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem; color: var(--nx-text-muted); cursor: pointer; }
.check input { appearance: none; flex: none; width: 20px; height: 20px; margin: 1px 0 0; border-radius: 5px; border: 1px solid var(--nx-border-control); background: var(--nx-surface-sunken); display: grid; place-items: center; cursor: pointer; transition: background var(--nx-dur-micro), border-color var(--nx-dur-micro); }
.check input::after { content: ''; width: 10px; height: 6px; border: 2px solid var(--nx-accent-ink); border-top: 0; border-right: 0; transform: rotate(-45deg) scale(0); transition: transform var(--nx-dur-micro) var(--nx-ease-emphasis); margin-top: -2px; }
.check input:checked { background: var(--nx-accent); border-color: var(--nx-accent); }
.check input:checked::after { transform: rotate(-45deg) scale(1); }
.form-status { min-height: 1.5em; font-size: 0.92rem; }
.form-status.is-error { color: var(--nx-state-error); }
.form-status.is-ok { color: var(--nx-state-success); }

/* Event banner: shared by Home, Discover, Events and world pages. */
.event-banner {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; gap: var(--nx-space-4); align-content: end;
  min-height: 100%; padding: var(--nx-space-6); border-radius: var(--nx-radius-xl);
  border: 1px solid color-mix(in srgb, var(--nx-energy) 35%, transparent);
  background: radial-gradient(90% 70% at 85% 10%, rgb(255 179 107 / 0.2), transparent 60%), linear-gradient(160deg, #221a33, var(--nx-surface) 60%);
}
.event-banner__rewards { display: flex; gap: 10px; flex-wrap: wrap; }
.event-banner__reward { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border-radius: var(--nx-radius-md); background: rgb(5 4 11 / 0.45); border: 1px solid var(--nx-border); text-decoration: none; }
.event-banner__reward img { width: 44px; height: 44px; border-radius: 8px; }
.event-banner__reward:hover { border-color: var(--nx-border-strong); }
.event-banner__time { color: var(--nx-text-muted); display: flex; gap: 8px; align-items: center; }
.event-banner__rift { position: absolute; right: -60px; top: -60px; width: 300px; height: 300px; z-index: -1; border-radius: 50%; border: 1px solid rgb(255 179 107 / 0.3); box-shadow: inset 0 0 80px rgb(255 179 107 / 0.12); }
.event-banner__rift::after { content: ''; position: absolute; inset: 50px; border-radius: 50%; border: 1px dashed rgb(255 179 107 / 0.25); }

/* ============ Navigation ============ */
.nav {
  position: sticky; top: 0; z-index: var(--nx-z-nav);
  height: var(--nx-nav-h);
  transition: background var(--nx-dur-large) var(--nx-ease-out), border-color var(--nx-dur-large), backdrop-filter var(--nx-dur-large);
  border-bottom: 1px solid transparent;
}
.nav.is-solid, body:not([data-nav='overlay']) .nav { background: rgb(10 9 20 / 0.82); border-bottom-color: var(--nx-border); -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2); }
body[data-nav='overlay'] .nav { position: fixed; left: 0; right: 0; }
.nav__inner { height: 100%; display: flex; align-items: center; gap: var(--nx-space-5); }
.nav__brand { display: inline-flex; align-items: center; flex: none; padding: 6px 4px; margin-left: -4px; border-radius: var(--nx-radius-sm); }
.nav__brand img { height: 28px; width: auto; }
.nav__links { display: flex; align-items: center; gap: 2px; margin-inline: auto; }
.nav__link {
  position: relative; padding: 10px 12px; border-radius: var(--nx-radius-sm);
  color: var(--nx-text-muted); text-decoration: none; font-weight: 600; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase;
  transition: color var(--nx-dur-ui);
}
.nav__link::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 1.5px; background: var(--nx-accent); transform: scaleX(0); transition: transform var(--nx-dur-ui) var(--nx-ease-emphasis); }
.nav__link:hover { color: var(--nx-text); }
.nav__link[aria-current='page'] { color: var(--nx-text); }
.nav__link[aria-current='page']::after { transform: none; }
.nav__actions { display: flex; align-items: center; gap: var(--nx-space-2); flex: none; }
.nav__signin { color: var(--nx-text); text-decoration: none; font-weight: 600; font-size: 0.9rem; padding: 10px 12px; border-radius: var(--nx-radius-sm); }
.nav__signin:hover { color: var(--nx-accent); }
.nav__toggle { display: none; }
.account-menu { position: relative; }
.account-menu__btn { display: inline-flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; min-height: 44px; border-radius: var(--nx-radius-md); border: 1px solid var(--nx-border); background: var(--nx-surface-overlay); color: var(--nx-text); font-weight: 600; font-size: 0.9rem; max-width: 220px; }
.account-menu__btn:hover { border-color: var(--nx-border-strong); }
.account-menu__btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu__panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; padding: 8px;
  border-radius: var(--nx-radius-md); border: 1px solid var(--nx-border-strong); background: var(--nx-surface-raised); box-shadow: var(--nx-shadow-3);
  transform-origin: top right; animation: nx-pop var(--nx-dur-ui) var(--nx-ease-emphasis);
}
.account-menu__meta { padding: 10px 12px 12px; border-bottom: 1px solid var(--nx-border); margin-bottom: 6px; }
.account-menu__meta strong { display: block; }
.account-menu__meta span { color: var(--nx-text-muted); font-size: 0.85rem; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: var(--nx-radius-sm); background: none; color: var(--nx-text); text-decoration: none; font-size: 0.95rem; text-align: left; }
.menu-item:hover, .menu-item:focus-visible { background: var(--nx-surface); outline-offset: -2px; }
.menu-item .icon { color: var(--nx-text-muted); }
@keyframes nx-pop { from { opacity: 0; transform: translateY(-4px) scale(0.97); } }

.avatar-dot { width: 34px; height: 34px; border-radius: 10px; flex: none; background: radial-gradient(circle at 50% 38%, #2c2a44, #121120 70%); border: 1px solid var(--nx-border-strong); display: grid; place-items: center; overflow: hidden; }
.avatar-dot img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; transform: scale(1.9) translateY(18%); }

/* Mobile menu */
.mobile-menu { display: none; }
@media (max-width: 1080px) {
  .nav__links, .nav__actions .nav__signin, .nav__actions .account-menu { display: none; }
  .nav__actions { margin-left: auto; }
  .nav__toggle { display: inline-grid; }
  .mobile-menu {
    display: block; position: fixed; inset: 0; z-index: var(--nx-z-menu);
    background: rgb(5 4 11 / 0.97);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    padding: calc(var(--nx-nav-h) + 8px) var(--nx-gutter) calc(24px + env(safe-area-inset-bottom));
    overflow-y: auto; overscroll-behavior: contain;
    visibility: hidden; opacity: 0;
    transition: opacity var(--nx-dur-large) var(--nx-ease-out), visibility 0s linear var(--nx-dur-large);
  }
  .mobile-menu.is-open { visibility: visible; opacity: 1; transition: opacity var(--nx-dur-large) var(--nx-ease-out); }
  .mobile-menu__list { list-style: none; display: grid; }
  .mobile-menu__link {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 0; border-bottom: 1px solid var(--nx-border);
    font: 750 clamp(1.8rem, 7vw, 2.6rem) / 1 var(--nx-font-display); font-stretch: var(--nx-display-stretch); text-transform: uppercase;
    color: var(--nx-text); text-decoration: none;
    opacity: 0; transform: translateY(12px);
    transition: opacity var(--nx-dur-large) var(--nx-ease-out), transform var(--nx-dur-large) var(--nx-ease-emphasis), color var(--nx-dur-ui);
    transition-delay: calc(var(--i, 0) * 40ms);
  }
  .mobile-menu.is-open .mobile-menu__link { opacity: 1; transform: none; }
  .mobile-menu__link[aria-current='page'] { color: var(--nx-accent); }
  .mobile-menu__link small { font: 500 0.85rem / 1.3 var(--nx-font-body); color: var(--nx-text-faint); text-transform: none; letter-spacing: 0; max-width: 16ch; text-align: right; }
  .mobile-menu__foot { display: grid; gap: var(--nx-space-3); margin-top: var(--nx-space-6); }
  .mobile-menu__me { display: grid; grid-template-columns: 1fr 1fr; gap: var(--nx-space-3); }
  .mobile-menu__me[hidden] { display: none; }
  .nav.is-menu-open { background: transparent; border-bottom-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; z-index: calc(var(--nx-z-menu) + 1); }
}
.nav__toggle-lines { position: relative; width: 18px; height: 12px; }
.nav__toggle-lines::before, .nav__toggle-lines::after { content: ''; position: absolute; left: 0; right: 0; height: 1.8px; background: currentColor; border-radius: 2px; transition: transform var(--nx-dur-ui) var(--nx-ease-emphasis), top var(--nx-dur-ui); }
.nav__toggle-lines::before { top: 2px; }
.nav__toggle-lines::after { top: 8px; }
.nav__toggle[aria-expanded='true'] .nav__toggle-lines::before { top: 5px; transform: rotate(45deg); }
.nav__toggle[aria-expanded='true'] .nav__toggle-lines::after { top: 5px; transform: rotate(-45deg); }
body.is-locked { overflow: hidden; }

/* ============ Footer ============ */
.footer { position: relative; z-index: 2; border-top: 1px solid var(--nx-border); background: var(--nx-bg-deep); padding: var(--nx-space-8) 0 var(--nx-space-6); }
.footer__top { display: grid; grid-template-columns: minmax(240px, 1.2fr) 2.4fr; gap: var(--nx-space-7); }
.footer__brand img { height: 28px; width: auto; }
.footer__tag { margin-top: var(--nx-space-4); color: var(--nx-text-muted); max-width: 34ch; }
.footer__cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--nx-space-5); }
.footer__col h2 { font: 600 var(--nx-fs-caption) / 1 var(--nx-font-body); letter-spacing: var(--nx-tracking-caps); text-transform: uppercase; color: var(--nx-text-faint); margin-bottom: var(--nx-space-4); }
.footer__col ul { list-style: none; display: grid; gap: 10px; }
.footer__col a, .footer__col span { color: var(--nx-text-muted); text-decoration: none; font-size: 0.95rem; }
.footer__col a:hover { color: var(--nx-text); }
.footer__col span { color: var(--nx-text-faint); }
.footer__signup { margin-top: var(--nx-space-6); display: grid; gap: 10px; max-width: 420px; }
.footer__signup-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--nx-space-3); margin-top: var(--nx-space-8); padding-top: var(--nx-space-5); border-top: 1px solid var(--nx-border); color: var(--nx-text-faint); font-size: 0.85rem; }
@media (max-width: 900px) {
  .footer__top { grid-template-columns: 1fr; }
  .footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) { .footer__signup-row { grid-template-columns: 1fr; } }

/* ============ States: loading, empty, error ============ */
.state { display: grid; justify-items: center; text-align: center; gap: var(--nx-space-3); padding: var(--nx-space-8) var(--nx-space-5); border: 1px dashed var(--nx-border-strong); border-radius: var(--nx-radius-lg); color: var(--nx-text-muted); }
.state__title { font: 750 1.6rem / 1 var(--nx-font-display); font-stretch: var(--nx-display-stretch); text-transform: uppercase; color: var(--nx-text); }
.state__text { max-width: 44ch; }
.state--inline { padding: var(--nx-space-6) var(--nx-space-4); }
.state--error .state__title { color: var(--nx-state-mystery); }
.gate-loader { display: inline-grid; place-items: center; gap: 14px; color: var(--nx-accent); }
.gate-loader__ring { width: 44px; height: 14px; border: 2px solid currentColor; border-radius: 50%; animation: nx-gate 1.6s var(--nx-ease-in-out) infinite; }
.gate-loader__label { font: 600 var(--nx-fs-caption) / 1 var(--nx-font-body); letter-spacing: var(--nx-tracking-caps); text-transform: uppercase; color: var(--nx-text-muted); }
@keyframes nx-gate { 0%, 100% { height: 14px; opacity: 0.7; } 50% { height: 40px; opacity: 1; box-shadow: 0 0 18px currentColor; } }
.skeleton { position: relative; overflow: hidden; background: var(--nx-surface); border-radius: var(--nx-radius-lg); }
.skeleton::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgb(238 234 246 / 0.05), transparent); animation: nx-shimmer 1.6s infinite; }
@keyframes nx-shimmer { to { transform: translateX(100%); } }

/* Notice: honest labels for mock or not-yet-real things. */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--nx-radius-md); border: 1px dashed color-mix(in srgb, var(--nx-energy) 45%, transparent); background: var(--nx-energy-soft); color: var(--nx-text); font-size: 0.92rem; }
.notice .icon { color: var(--nx-energy); margin-top: 2px; }

/* ============ Modal (native <dialog>) ============ */
.modal { width: min(560px, calc(100% - 32px)); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid var(--nx-border-strong); border-radius: var(--nx-radius-xl); background: var(--nx-surface-raised); color: var(--nx-text); box-shadow: var(--nx-shadow-3); }
.modal::backdrop { background: rgb(5 4 11 / 0.7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal[open] { animation: nx-modal var(--nx-dur-large) var(--nx-ease-emphasis); }
.modal__body { padding: var(--nx-space-6); display: grid; gap: var(--nx-space-4); }
.modal__close { position: absolute; top: 12px; right: 12px; }
@keyframes nx-modal { from { opacity: 0; transform: translateY(12px) scale(0.97); } }

/* Toast */
.toast-host { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: var(--nx-z-toast); display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); pointer-events: none; }
.toast { pointer-events: auto; padding: 14px 18px; border-radius: var(--nx-radius-md); background: var(--nx-surface-raised); border: 1px solid var(--nx-border-strong); box-shadow: var(--nx-shadow-3); animation: nx-modal var(--nx-dur-large) var(--nx-ease-emphasis); }
.toast--ok { border-color: color-mix(in srgb, var(--nx-state-success) 50%, transparent); }
.toast--error { border-color: color-mix(in srgb, var(--nx-state-error) 50%, transparent); }

/* Tooltip */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translate(-50%, 4px);
  padding: 7px 10px; border-radius: var(--nx-radius-sm); background: var(--nx-surface-raised); border: 1px solid var(--nx-border-strong);
  color: var(--nx-text); font-size: 0.8rem; font-weight: 500; white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity var(--nx-dur-ui), transform var(--nx-dur-ui) var(--nx-ease-out); z-index: 5;
}
[data-tooltip]:hover::after, [data-tooltip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }

/* ============ Page hero (inner pages) ============ */
.page-hero { position: relative; isolation: isolate; padding: calc(var(--nx-nav-h) + clamp(48px, 8vw, 110px)) 0 clamp(40px, 6vw, 80px); overflow: hidden; }
body:not([data-nav='overlay']) .page-hero { padding-top: clamp(48px, 8vw, 110px); }
.page-hero__bg { position: absolute; inset: 0; z-index: -1; }
.page-hero__bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.55; }
.page-hero__bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(10 9 20 / 0.2), var(--nx-bg) 96%), linear-gradient(90deg, rgb(10 9 20 / 0.85), transparent 70%); }
.page-hero__inner { display: grid; gap: var(--nx-space-4); max-width: 820px; }
.page-hero__actions { display: flex; flex-wrap: wrap; gap: var(--nx-space-3); margin-top: var(--nx-space-3); }

/* Breadcrumb */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; font-size: 0.85rem; color: var(--nx-text-faint); }
.crumbs a { color: var(--nx-text-muted); text-decoration: none; }
.crumbs a:hover { color: var(--nx-text); }
.crumbs li + li::before { content: '/'; margin-right: 8px; color: var(--nx-text-faint); }
/* Over hero art the crumbs get a shadow and brighter text so they stay readable on any render. */
.world-hero .crumbs { color: var(--nx-text-muted); text-shadow: 0 1px 10px rgb(5 4 11 / 0.95), 0 0 2px rgb(5 4 11 / 0.9); }
.world-hero .crumbs a { color: var(--nx-text); }
.world-hero .crumbs li + li::before { color: var(--nx-text-muted); }

/* ============ Motion primitives ============
   [data-reveal] fades content up as it enters the view; --i staggers siblings.
   Content is visible without JavaScript: the hidden state only applies once .js is set. */
.js [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity var(--nx-dur-cinematic) var(--nx-ease-out), transform var(--nx-dur-cinematic) var(--nx-ease-emphasis); transition-delay: calc(var(--i, 0) * 70ms); }
.js [data-reveal='scale'] { transform: scale(0.96); }
.js [data-reveal='fade'] { transform: none; }
.js [data-reveal='left'] { transform: translateX(-24px); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
[data-parallax] { will-change: transform; }
.count-up { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
}

/* Page transitions: a short fade between pages where the browser supports it. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 260ms; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* Stop/start button the avatar viewer adds when the avatar turns on its own. */
.viewer-spin { position: absolute; top: 12px; right: 12px; z-index: 2; width: 38px; height: 38px; border-radius: 9px; background: rgb(10 9 20 / 0.72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
