/* ==========================================================================
   Avalis website — S54 "Frostbound" design foundation
   One consolidated stylesheet: tokens, base, shell (header / navigation /
   footer) and shared components. Section sheets (avalis-home.css,
   avalis-store.css, …) build on these tokens. No legacy/S53 CSS is loaded.
   ========================================================================== */

@font-face { font-family: "Avalis Text"; src: url("fonts/avalis-text-normal.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Avalis Text"; src: url("fonts/avalis-text-normal-italic.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Avalis Text"; src: url("fonts/avalis-text-bold.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: AvalisRuneScape; src: url("fonts/runescape.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: AvalisRuneScape; src: url("fonts/runescape-bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: dark;
  /* Night sky surfaces */
  --night-0: #030814;
  --night-1: #060d1d;
  --night-2: #0a1629;
  --night-3: #0f203b;
  --night-4: #15305a;
  --glass: rgba(10, 22, 44, .72);
  --glass-strong: rgba(8, 17, 34, .9);
  /* Lines */
  --line: rgba(143, 184, 255, .13);
  --line-2: rgba(143, 190, 255, .24);
  --line-3: rgba(160, 205, 255, .42);
  /* Text */
  --frost: #eef5ff;
  --mist: #b6c6e0;
  --dim: #8497b8;
  /* Brand */
  --sapphire: #2f6bff;
  --sapphire-2: #4c86ff;
  --sapphire-deep: #1a3fb7;
  --sapphire-ink: #0d2a7a;
  --ice: #93d6ff;
  --ice-2: #c8ecff;
  --aurora: #45e3cf;
  --gold: #ffcb66;
  --gold-2: #ffe1a3;
  --gold-deep: #b97d16;
  --success: #46e0a0;
  --warning: #ffb74d;
  --danger: #ff6b7d;
  /* Type */
  --font-display: "Avalis Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-text: "Avalis Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-rs: AvalisRuneScape, "Avalis Text", sans-serif;
  /* Shape */
  --r-xs: 4px; --r-sm: 7px; --r-md: 11px; --r-lg: 16px; --r-xl: 24px;
  --shadow-1: 0 1px 0 rgba(255,255,255,.05) inset, 0 12px 32px rgba(0,0,0,.32);
  --shadow-2: 0 1px 0 rgba(255,255,255,.06) inset, 0 22px 60px rgba(0,0,0,.45);
  --glow: 0 0 0 1px rgba(110,160,255,.35), 0 10px 32px rgba(47,107,255,.32);
  --focus: 0 0 0 3px rgba(147, 214, 255, .55);
  /* Layout */
  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 76px;
  --realm-h: 34px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; min-height: 100vh; font: 400 16px/1.55 var(--font-text); color: var(--mist);
  background-color: var(--night-1);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(47, 107, 255, .14), transparent 60%),
    radial-gradient(900px 520px at -10% 30%, rgba(69, 227, 207, .05), transparent 60%),
    linear-gradient(180deg, var(--night-1), var(--night-0) 1400px);
  background-attachment: fixed;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
img, svg, video { max-width: 100%; }
img { height: auto; }
a { color: var(--ice); text-decoration: none; text-underline-offset: .18em; }
a:hover { color: var(--ice-2); }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { color: var(--frost); margin: 0 0 .45em; line-height: 1.15; }
h1, h2, .display { font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); }
h2 { font-size: clamp(1.4rem, 2.2vw, 1.85rem); }
h3 { font: 700 1.2rem/1.25 var(--font-text); letter-spacing: 0; }
h4 { font: 700 1rem/1.3 var(--font-text); }
strong, b { color: var(--frost); font-weight: 700; }
small { font-size: .84em; }
hr { border: 0; height: 1px; background: var(--line); margin: 28px 0; }
code, kbd { font: .9em/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace; background: rgba(147, 214, 255, .08); border: 1px solid var(--line); border-radius: var(--r-xs); padding: .05em .35em; color: var(--ice-2); }
::selection { background: rgba(76, 134, 255, .45); color: #fff; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--ice); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
table { border-collapse: collapse; width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
details > summary { cursor: pointer; }
.sr-only, .visually-hidden { 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: absolute; left: 12px; top: -80px; z-index: 200; padding: 10px 16px; border-radius: var(--r-sm); background: var(--sapphire); color: #fff; font-weight: 700; transition: top .15s; }
.skip-link:focus { top: 10px; color: #fff; }
#main-content { display: block; height: 0; }

/* --------------------------------------------------------------------------
   Layout helpers
   -------------------------------------------------------------------------- */
.wrap, .container { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-narrow { max-width: calc(860px + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(40px, 5.5vw, 76px); }
.section-tight { padding-block: clamp(32px, 4vw, 56px); }
.stack > * + * { margin-top: var(--stack, 16px); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--gap, 12px); align-items: center; }
.split { display: grid; gap: clamp(24px, 4vw, 48px); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.grid-auto { display: grid; gap: var(--gap, 20px); grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--min, 260px)), 1fr)); }
.muted { color: var(--dim); }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--mist); max-width: 62ch; }
.center { text-align: center; }
main { display: block; }
.page-main { padding-bottom: clamp(56px, 8vw, 110px); }

/* --------------------------------------------------------------------------
   Eyebrows, section headings & the sapphire divider
   -------------------------------------------------------------------------- */
/* Small plain label for real metadata (category, rank, step). Not a slogan slot. */
.eyebrow, .kicker { display: block; margin: 0 0 6px; font: 700 .9rem/1.3 var(--font-text); color: var(--ice); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: clamp(20px, 3vw, 32px); flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head p { margin: 8px 0 0; color: var(--dim); max-width: 60ch; }
.section-head--center { flex-direction: column; align-items: center; text-align: center; }
.rune-divider { display: flex; align-items: center; gap: 14px; color: var(--sapphire-2); margin: 14px auto 0; max-width: 360px; }
.rune-divider::before, .rune-divider::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line-3)); }
.rune-divider::after { transform: scaleX(-1); }
.rune-divider svg { width: 18px; height: 18px; filter: drop-shadow(0 0 8px rgba(95, 155, 255, .9)); }

.text-link, .s53-text-link, .link-arrow {
  display: inline-flex; align-items: center; gap: 8px; font: 700 .91rem/1 var(--font-display); color: var(--ice);
}
.text-link::after, .link-arrow::after { content: "→"; transition: transform .2s var(--ease); font-family: var(--font-text); letter-spacing: 0; }
.s53-text-link span { transition: transform .2s var(--ease); }
.text-link:hover::after, .link-arrow:hover::after, .s53-text-link:hover span { transform: translateX(4px); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn, .button {
  --btn-bg: rgba(18, 38, 74, .7); --btn-line: var(--line-2); --btn-fg: var(--frost);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 22px; border-radius: 10px;
  font: 700 .97rem/1 var(--font-display); text-align: center;
  color: var(--btn-fg); background: var(--btn-bg); border: 1px solid var(--btn-line);
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset;
  transition: background .18s, border-color .18s, box-shadow .18s, transform .18s var(--ease), color .18s;
  cursor: pointer; text-decoration: none; white-space: nowrap; user-select: none;
}
.btn:hover, .button:hover { color: #fff; border-color: var(--line-3); background: rgba(26, 52, 100, .85); }
.btn:active, .button:active { transform: translateY(1px); }
.btn:focus-visible, .button:focus-visible { outline: none; box-shadow: var(--focus); }
.btn svg, .button svg { width: 18px; height: 18px; flex: none; }
.btn-primary, .button.primary {
  --btn-fg: #fff;
  background: linear-gradient(180deg, #5d95ff 0%, #2f6bff 46%, #1f4fd6 100%);
  border-color: #79a8ff #2a5ee8 #163ba8;
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 -2px 0 rgba(0,0,0,.18) inset, 0 8px 22px rgba(35, 90, 240, .35);
  text-shadow: 0 1px 1px rgba(0, 20, 80, .45);
}
.btn-primary:hover, .button.primary:hover { background: linear-gradient(180deg, #74a6ff 0%, #3d78ff 46%, #2457e6 100%); border-color: #9cc0ff #3a6cf0 #1a44b8; box-shadow: 0 1px 0 rgba(255,255,255,.4) inset, 0 -2px 0 rgba(0,0,0,.18) inset, 0 10px 28px rgba(47, 107, 255, .5); color: #fff; }
.btn-secondary, .button.secondary { --btn-bg: rgba(14, 30, 60, .6); --btn-line: var(--line-3); backdrop-filter: blur(6px); }
.btn-ghost { --btn-bg: transparent; --btn-line: transparent; color: var(--ice); padding-inline: 12px; box-shadow: none; }
.btn-ghost:hover { background: rgba(147, 214, 255, .08); border-color: transparent; }
.btn-danger, .button.danger, .danger-button { --btn-bg: rgba(120, 20, 40, .35); --btn-line: rgba(255, 107, 125, .45); --btn-fg: #ffd9de; }
.btn-danger:hover, .button.danger:hover, .danger-button:hover { background: rgba(160, 28, 52, .55); border-color: var(--danger); }
.btn-sm, .button.small { min-height: 36px; padding: 0 16px; font-size: .8rem; border-radius: 999px; }
.btn-lg, .button.large { min-height: 54px; padding: 0 30px; font-size: 1.02rem; border-radius: 12px; }
.btn-block, .button.full { display: flex; width: 100%; }
.btn[disabled], .button[disabled], .btn[aria-disabled="true"], button:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* Illustrated "gem" call to action — faceted sapphire set in a silver bezel.
   Reserved for primary moments (Play now, Create account, Checkout). */
.gem-btn {
  --gem-h: 58px; --cut: 18px;
  position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: var(--gem-h); padding: 0 calc(var(--cut) + 22px); color: #fff; text-decoration: none;
  font: 700 1.08rem/1 var(--font-display); white-space: nowrap;
  text-shadow: 0 1px 0 rgba(0, 18, 70, .7), 0 0 18px rgba(170, 215, 255, .45);
  filter: drop-shadow(0 10px 20px rgba(20, 70, 220, .38)) drop-shadow(0 0 1px rgba(210, 230, 255, .6));
  transition: filter .25s var(--ease), transform .2s var(--ease);
  border: 0; background: none; cursor: pointer;
}
.gem-btn::before, .gem-btn::after { content: ""; position: absolute; z-index: -1; clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% 50%, calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 50%); }
/* silver bezel */
.gem-btn::before { inset: 0; background: linear-gradient(180deg, #f4f8ff 0%, #9fb1cc 22%, #56688a 50%, #aebfd9 78%, #e9f0fb 100%); }
/* sapphire facets */
.gem-btn::after {
  inset: 3px; --cut: 16px;
  background:
    linear-gradient(115deg, transparent 0 38%, rgba(255,255,255,.16) 38% 46%, transparent 46% 100%),
    linear-gradient(180deg, rgba(255,255,255,.34) 0%, rgba(255,255,255,.06) 46%, rgba(0,0,0,0) 50%, rgba(0,10,50,.28) 100%),
    linear-gradient(90deg, #1537b8 0%, #2f6bff 22%, #4a8cff 50%, #2f6bff 78%, #1537b8 100%);
  box-shadow: inset 0 0 0 1px rgba(160, 200, 255, .5);
}
.gem-btn > * { position: relative; z-index: 1; }
.gem-btn .gem-icon { width: 20px; height: 20px; filter: drop-shadow(0 0 6px rgba(200, 235, 255, .9)); }
.gem-btn .gem-shine { position: absolute; inset: 3px; z-index: 0; overflow: hidden; clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 16px 100%, 0 50%); pointer-events: none; }
.gem-btn .gem-shine::before { content: ""; position: absolute; top: -20%; bottom: -20%; left: -40%; width: 30%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent); transform: skewX(-18deg) translateX(-120%); }
.gem-btn:hover { color: #fff; transform: translateY(-1px); filter: drop-shadow(0 14px 28px rgba(40, 110, 255, .55)) drop-shadow(0 0 2px rgba(230, 244, 255, .9)); }
.gem-btn:hover .gem-shine::before { transition: transform .75s var(--ease); transform: skewX(-18deg) translateX(520%); }
.gem-btn:active { transform: translateY(1px); }
.gem-btn:focus-visible { outline: none; filter: drop-shadow(0 0 0 #fff) drop-shadow(0 0 3px #fff) drop-shadow(0 0 10px var(--ice)); }
/* frost variant — dark stone set in silver, for the secondary hero action */
.gem-btn--frost::after {
  background:
    linear-gradient(180deg, rgba(255,255,255,.14) 0%, rgba(255,255,255,.02) 48%, rgba(0,0,0,0) 50%, rgba(0,0,0,.25) 100%),
    linear-gradient(90deg, #0b1a36, #13294f 50%, #0b1a36);
  box-shadow: inset 0 0 0 1px rgba(160, 200, 255, .28);
}
.gem-btn--frost { text-shadow: 0 1px 0 rgba(0,0,0,.7); filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .45)) drop-shadow(0 0 1px rgba(210, 230, 255, .5)); }
.gem-btn--frost:hover { filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .5)) drop-shadow(0 0 2px rgba(230, 244, 255, .9)); }
.gem-btn--sm { --gem-h: 42px; --cut: 13px; padding: 0 calc(var(--cut) + 14px); font-size: .86rem; gap: 8px; }
.gem-btn--sm::after { --cut: 11px; inset: 2px; }
.gem-btn--sm .gem-shine { inset: 2px; clip-path: polygon(11px 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 11px 100%, 0 50%); }
.gem-btn--sm .gem-icon { width: 16px; height: 16px; }
.gem-btn--block { display: flex; width: 100%; }
.gem-btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

/* --------------------------------------------------------------------------
   Realm bar + header + navigation
   -------------------------------------------------------------------------- */
.realm-bar { position: relative; z-index: 60; height: var(--realm-h); background: linear-gradient(90deg, rgba(3, 8, 20, .95), rgba(8, 20, 44, .95) 50%, rgba(3, 8, 20, .95)); border-bottom: 1px solid var(--line); font-size: .8rem; }
.realm-bar__inner { display: flex; align-items: center; justify-content: space-between; height: 100%; gap: 16px; }
.realm-status { display: inline-flex; align-items: center; gap: 8px; color: var(--mist); font-weight: 700; letter-spacing: .02em; }
.realm-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.realm-status.is-live i, .status-live i { background: var(--aurora); box-shadow: 0 0 0 3px rgba(69, 227, 207, .16), 0 0 10px var(--aurora); animation: realm-pulse 2.4s ease-in-out infinite; }
@keyframes realm-pulse { 50% { box-shadow: 0 0 0 6px rgba(69, 227, 207, 0), 0 0 12px var(--aurora); } }
.realm-links { display: flex; gap: 22px; }
.realm-links a { color: var(--dim); font: 700 .82rem/1 var(--font-display); }
.realm-links a:hover { color: var(--frost); }

.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent, rgba(120, 170, 255, .38) 30%, rgba(160, 215, 255, .55) 50%, rgba(120, 170, 255, .38) 70%, transparent) 1;
}
/* The blur lives on a pseudo-element: backdrop-filter on the header itself would
   become the containing block for the fixed mobile drawer and clip it. */
.site-header::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(5, 11, 24, .88), rgba(6, 14, 30, .78)); backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px); }
body.nav-open .site-header { z-index: 90; }
.site-header__inner { display: flex; align-items: center; gap: clamp(14px, 2vw, 28px); height: 100%; }
.brand { display: inline-flex; align-items: center; flex: none; margin-right: 6px; }
.brand img { display: block; width: 156px; height: auto; filter: drop-shadow(0 4px 10px rgba(0,0,0,.5)); transition: transform .25s var(--ease); }
.brand:hover img { transform: scale(1.03); }

.main-nav { display: flex; align-items: center; flex: 1; min-width: 0; }
.main-nav__list { display: flex; align-items: center; gap: clamp(2px, .6vw, 10px); margin: 0; padding: 0; list-style: none; }
.main-nav__list > li { position: relative; }
.nav-link {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: var(--header-h); padding: 0 12px;
  font: 700 .98rem/1 var(--font-display); color: var(--mist);
  background: none; border: 0; transition: color .18s;
}
.nav-link::after {
  content: ""; position: absolute; left: 50%; bottom: 17px; width: 7px; height: 7px; transform: translateX(-50%) rotate(45deg) scale(0);
  background: linear-gradient(135deg, #e0f3ff, var(--sapphire-2) 55%, var(--sapphire-deep)); box-shadow: 0 0 10px rgba(110, 170, 255, .95);
  transition: transform .22s var(--ease);
}
.nav-link::before { content: ""; position: absolute; left: 12px; right: 12px; bottom: 20px; height: 1px; background: linear-gradient(90deg, transparent, rgba(147, 214, 255, .7), transparent); opacity: 0; transition: opacity .2s; }
.nav-link:hover, .has-menu:focus-within > .nav-link, .has-menu:hover > .nav-link { color: var(--frost); }
.nav-link:hover::before { opacity: .55; }
.nav-link.is-active, .nav-link[aria-current="page"] { color: #fff; }
.nav-link.is-active::after, .nav-link[aria-current="page"]::after { transform: translateX(-50%) rotate(45deg) scale(1); }
.nav-link.is-active::before, .nav-link[aria-current="page"]::before { opacity: 1; }
.nav-link svg.chev { width: 12px; height: 12px; opacity: .7; transition: transform .2s; }
.nav-menu {
  position: absolute; top: calc(100% - 10px); left: -12px; min-width: 300px; padding: 10px; border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(14, 30, 58, .98), rgba(8, 18, 36, .98)); border: 1px solid var(--line-2);
  box-shadow: var(--shadow-2); display: none; gap: 2px;
}
.nav-menu::before { content: ""; position: absolute; top: -6px; left: 34px; width: 11px; height: 11px; transform: rotate(45deg); background: rgba(14, 30, 58, .98); border-left: 1px solid var(--line-2); border-top: 1px solid var(--line-2); }
.has-menu:hover > .nav-menu, .has-menu:focus-within > .nav-menu, .has-menu.is-open > .nav-menu { display: grid; animation: menu-in .18s var(--ease); }
@keyframes menu-in { from { opacity: 0; transform: translateY(6px); } }
.has-menu:hover .chev, .has-menu.is-open .chev { transform: rotate(180deg); }
.nav-menu a { display: grid; grid-template-columns: 34px 1fr; gap: 2px 12px; align-items: center; padding: 10px 12px; border-radius: var(--r-sm); color: var(--frost); }
.nav-menu a svg { grid-row: span 2; width: 34px; height: 34px; padding: 7px; border-radius: 9px; color: var(--ice); background: rgba(47, 107, 255, .14); border: 1px solid var(--line); }
.nav-menu a b { font: 700 .95rem/1.2 var(--font-text); }
.nav-menu a small { color: var(--dim); font-size: .8rem; line-height: 1.3; }
.nav-menu a:hover, .nav-menu a:focus-visible { background: rgba(47, 107, 255, .14); }
.nav-menu a:hover svg { color: #fff; background: var(--sapphire); }
.main-nav__account { display: none; }

.header-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; flex: none; }
.header-login { font: 700 .93rem/1 var(--font-display); color: var(--mist); padding: 8px 4px; }
.header-login:hover { color: #fff; }
.header-signup { min-height: 40px; }
.nav-toggle { display: none; }

.user-chip { display: inline-flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 999px; background: rgba(20, 40, 76, .55); border: 1px solid var(--line-2); color: var(--frost); max-width: 200px; }
.user-chip:hover { border-color: var(--line-3); color: #fff; }
.user-chip__avatar, .user-chip-headshot { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; flex: none; background: radial-gradient(circle at 50% 30%, #25467f, #0b1730); border: 1px solid var(--line-2); display: grid; place-items: center; }
.user-chip__avatar img, .user-chip-headshot img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.user-chip b { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--mist); background: rgba(20, 40, 76, .45); border: 1px solid var(--line); transition: color .15s, border-color .15s, background .15s; }
.icon-btn:hover { color: #fff; border-color: var(--line-3); background: rgba(30, 60, 110, .6); }
.icon-btn svg { width: 19px; height: 19px; }

.notification-menu { position: relative; }
.notification-menu > summary { list-style: none; position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--mist); background: rgba(20, 40, 76, .45); border: 1px solid var(--line); }
.notification-menu > summary::-webkit-details-marker { display: none; }
.notification-menu > summary:hover, .notification-menu[open] > summary { color: #fff; border-color: var(--line-3); }
.notification-menu > summary svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notification-menu > summary b { position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--danger); color: #fff; font: 700 .7rem/19px var(--font-text); text-align: center; box-shadow: 0 0 0 2px var(--night-1); }
.notification-dropdown { position: absolute; right: -8px; top: calc(100% + 12px); width: min(360px, calc(100vw - 24px)); border-radius: var(--r-md); background: linear-gradient(180deg, #10224a, #0a1730); border: 1px solid var(--line-2); box-shadow: var(--shadow-2); overflow: hidden; z-index: 70; }
.notification-dropdown header, .notification-dropdown footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.notification-dropdown header strong { font: 700 .95rem var(--font-display); }
.notification-dropdown header span { color: var(--dim); font-size: .8rem; }
.notification-dropdown footer { border-bottom: 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.notification-dropdown footer form { display: flex; gap: 6px; }
.notification-dropdown footer button { background: none; border: 1px solid var(--line-2); border-radius: var(--r-xs); color: var(--mist); padding: 5px 9px; font-size: .78rem; }
.notification-dropdown footer button:hover { color: #fff; border-color: var(--line-3); }
.notification-dropdown-list { max-height: 340px; overflow: auto; }
.notification-dropdown-list > p { padding: 20px 16px; margin: 0; color: var(--dim); }
.notification-dropdown-list a { display: flex; gap: 12px; padding: 12px 16px; color: var(--mist); border-bottom: 1px solid var(--line); }
.notification-dropdown-list a:hover { background: rgba(47, 107, 255, .1); }
.notification-dropdown-list a > span { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(47, 107, 255, .18); color: var(--ice); font: 700 .8rem var(--font-display); }
.notification-dropdown-list a strong { display: block; font-size: .9rem; line-height: 1.3; }
.notification-dropdown-list a small { color: var(--dim); }
.notification-dropdown-list a.unread strong::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 8px; border-radius: 50%; background: var(--sapphire-2); vertical-align: middle; }
.logout-form { margin: 0; }
.logout-form button { background: none; border: 0; color: var(--dim); font: 700 .86rem/1 var(--font-display); padding: 8px 2px; }
.logout-form button:hover { color: #fff; }

/* Tablet & mobile navigation — slide-in drawer, no tile grid */
@media (max-width: 1480px) {
  .nav-link { padding: 0 9px; }
  .user-chip { max-width: 170px; }
}
@media (max-width: 1320px) { .user-chip b { display: none; } .user-chip { padding: 3px; } }
@media (max-width: 1180px) {
  .header-login, .logout-form, .user-chip b { display: none; }
  .user-chip { padding: 3px; }
}
@media (max-width: 1020px) {
  :root { --header-h: 66px; }
  .brand img { width: 128px; }
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px 0 12px; border-radius: var(--r-sm);
    background: rgba(20, 40, 76, .55); border: 1px solid var(--line-2); color: var(--frost);
    font: 700 .85rem/1 var(--font-display);
  }
  .nav-toggle__bars { position: relative; width: 18px; height: 12px; }
  .nav-toggle__bars::before, .nav-toggle__bars::after, .nav-toggle__bars i { content: ""; position: absolute; left: 0; right: 0; height: 2px; border-radius: 2px; background: currentColor; transition: transform .25s var(--ease), opacity .2s; }
  .nav-toggle__bars::before { top: 0; } .nav-toggle__bars i { top: 5px; } .nav-toggle__bars::after { bottom: 0; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(5px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bars i { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-5px) rotate(-45deg); }
  .main-nav {
    position: fixed; z-index: 80; top: 0; right: 0; bottom: 0; width: min(380px, 88vw); flex-direction: column; align-items: stretch;
    padding: calc(var(--header-h) + 10px) 22px 28px; overflow-y: auto; overscroll-behavior: contain;
    background:
      radial-gradient(420px 300px at 100% 0, rgba(47, 107, 255, .22), transparent 70%),
      linear-gradient(180deg, #0c1c3a, #060e20 60%);
    border-left: 1px solid var(--line-2); box-shadow: -30px 0 80px rgba(0,0,0,.6);
    clip-path: inset(0 0 0 100%); visibility: hidden; transition: clip-path .34s var(--ease), visibility 0s .34s;
  }
  .main-nav.open { clip-path: inset(0 0 0 -80px); visibility: visible; transition: clip-path .34s var(--ease); }
  .nav-scrim { position: fixed; inset: 0; z-index: 75; background: rgba(2, 6, 16, .62); backdrop-filter: blur(2px); opacity: 0; visibility: hidden; transition: opacity .25s, visibility 0s .25s; }
  .nav-scrim.is-visible { opacity: 1; visibility: visible; transition: opacity .25s; }
  .nav-toggle { position: relative; z-index: 90; }
  .main-nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .main-nav__list > li { border-bottom: 1px solid var(--line); }
  .nav-link { width: 100%; height: auto; padding: 16px 4px; font-size: 1.15rem; justify-content: flex-start; }
  .nav-link::before { display: none; }
  .nav-link::after { left: auto; right: 8px; bottom: auto; top: 50%; transform: translateY(-50%) rotate(45deg) scale(0); }
  .nav-link.is-active::after, .nav-link[aria-current="page"]::after { transform: translateY(-50%) rotate(45deg) scale(1); }
  .has-menu > .nav-link .chev { display: none; }
  .nav-menu, .has-menu:hover > .nav-menu, .has-menu:focus-within > .nav-menu { position: static; display: grid; min-width: 0; animation: none; padding: 0 0 12px; border: 0; box-shadow: none; background: none; }
  .nav-menu::before { display: none; }
  .nav-menu a { padding: 8px 6px; grid-template-columns: 30px 1fr; }
  .nav-menu a svg { width: 30px; height: 30px; padding: 6px; }
  .nav-menu a small { display: none; }
  .main-nav__account { display: grid; gap: 10px; margin-top: 22px; }
  .main-nav__account .btn, .main-nav__account button { width: 100%; }
  .main-nav__account form { margin: 0; }
  .header-actions { gap: 10px; }
  .header-signup { display: none; }
  body.nav-open { overflow: hidden; }
}
@media (max-width: 560px) {
  :root { --realm-h: 30px; --header-h: 62px; }
  .realm-links a:not(:last-child) { display: none; }
  .brand img { width: 112px; }
  .header-actions .gem-btn--sm { --gem-h: 38px; padding: 0 20px; font-size: .78rem; }
  .header-actions .gem-btn--sm .gem-icon { display: none; }
  .nav-toggle__label { display: none; }
  .nav-toggle { padding: 0 12px; }
  .header-actions .user-chip { display: none; }
  .notification-menu > summary, .icon-btn { width: 36px; height: 36px; }
  .user-chip__avatar, .user-chip-headshot { width: 30px; height: 30px; }
}
@media (max-width: 380px) {
  .header-actions { gap: 6px; }
  .header-actions .gem-btn--sm { padding: 0 13px; }
  .brand img { width: 92px; }
  .nav-toggle { padding: 0 10px; }
}

/* --------------------------------------------------------------------------
   Page hero (sub pages) — art-backed band, compact
   -------------------------------------------------------------------------- */
.page-hero { position: relative; isolation: isolate; overflow: hidden; padding: clamp(44px, 7vw, 92px) 0 clamp(34px, 5vw, 60px); border-bottom: 1px solid var(--line); }
.page-hero__art { position: absolute; inset: 0; z-index: -2; background-position: center; background-size: cover; opacity: .55; }
.page-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(6, 13, 29, .96) 0%, rgba(6, 13, 29, .82) 40%, rgba(6, 13, 29, .35) 100%), linear-gradient(0deg, var(--night-1) 0%, transparent 55%); }
.page-hero h1 { margin-bottom: 10px; max-width: 30ch; }
.page-hero .lede { margin: 0; }
.page-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.page-hero--compact { padding: clamp(32px, 5vw, 56px) 0 clamp(26px, 4vw, 40px); }
.page-hero--compact h1 { font-size: clamp(1.75rem, 3vw, 2.4rem); }
.art-citadel { background-image: url("art/hero-citadel-1920.webp"); }
.art-gate { background-image: url("art/realm-gate-1920.webp"); }
.art-fortress { background-image: url("art/ice-fortress-1920.webp"); }
.art-pass { background-image: url("art/frozen-pass-1920.webp"); }
.art-vault { background-image: url("art/store-vault-1920.webp"); }
.art-champions { background-image: url("art/champions-hall-1920.webp"); }
.art-community { background-image: url("art/community-hall-1920.webp"); }
.art-wyrm { background-image: url("art/frost-wyrm-1920.webp"); }
@media (max-width: 760px) {
  .art-citadel { background-image: url("art/hero-citadel-960.webp"); }
  .art-gate { background-image: url("art/realm-gate-960.webp"); }
  .art-fortress { background-image: url("art/ice-fortress-960.webp"); }
  .art-pass { background-image: url("art/frozen-pass-960.webp"); }
  .art-vault { background-image: url("art/store-vault-960.webp"); }
  .art-champions { background-image: url("art/champions-hall-960.webp"); }
  .art-community { background-image: url("art/community-hall-960.webp"); }
  .art-wyrm { background-image: url("art/frost-wyrm-960.webp"); }
}

/* Breadcrumbs */
.breadcrumbs, .crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 16px; padding: 0; list-style: none; font-size: .84rem; color: var(--dim); }
.breadcrumbs a, .crumbs a { color: var(--mist); }
.breadcrumbs a:hover, .crumbs a:hover { color: #fff; }
.breadcrumbs > * + *::before, .crumbs > * + *::before { content: "›"; margin-right: 10px; color: var(--dim); }

/* --------------------------------------------------------------------------
   Surfaces
   -------------------------------------------------------------------------- */
.panel, .surface {
  position: relative; border-radius: var(--r-lg); padding: clamp(18px, 2.4vw, 28px);
  background: linear-gradient(180deg, rgba(18, 36, 68, .72), rgba(10, 22, 42, .82));
  border: 1px solid var(--line); box-shadow: var(--shadow-1);
}
.panel::before, .surface::before { content: ""; position: absolute; inset: 0 0 auto; height: 1px; border-radius: inherit; background: linear-gradient(90deg, transparent, rgba(160, 205, 255, .35), transparent); pointer-events: none; }
.panel-title { font: 700 1.05rem/1.2 var(--font-display); color: var(--frost); margin: 0 0 14px; }
.panel--flat { background: rgba(12, 26, 50, .55); box-shadow: none; }
.panel--glow { border-color: rgba(110, 160, 255, .38); box-shadow: var(--shadow-1), 0 0 0 1px rgba(47, 107, 255, .12), 0 0 40px rgba(47, 107, 255, .12); }

.card { position: relative; display: flex; flex-direction: column; border-radius: var(--r-lg); overflow: hidden; background: linear-gradient(180deg, rgba(16, 33, 62, .85), rgba(9, 20, 40, .92)); border: 1px solid var(--line); transition: border-color .2s, transform .25s var(--ease), box-shadow .25s; }
.card:hover { border-color: var(--line-2); }
a.card:hover, .card--link:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.card__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--night-2); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
a.card:hover .card__media img, .card--link:hover .card__media img { transform: scale(1.04); }
.card__body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card__body h3 { margin: 0; }
.card__body p { margin: 0; color: var(--mist); }

/* Chips, tags, badges */
.chip, .tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font: 700 .8rem/1.2 var(--font-display); color: var(--ice-2); background: rgba(47, 107, 255, .16); border: 1px solid rgba(110, 160, 255, .3); white-space: nowrap; }
.chip--gold { color: var(--gold-2); background: rgba(255, 203, 102, .12); border-color: rgba(255, 203, 102, .35); }
.chip--green, .chip--success { color: #b8f5dc; background: rgba(70, 224, 160, .12); border-color: rgba(70, 224, 160, .35); }
.chip--red, .chip--danger { color: #ffd0d6; background: rgba(255, 107, 125, .12); border-color: rgba(255, 107, 125, .38); }
.chip--muted { color: var(--mist); background: rgba(255,255,255,.04); border-color: var(--line-2); }
.chip img { width: 16px; height: 16px; image-rendering: pixelated; }

/* Stat blocks */
.stat { display: grid; gap: 2px; }
.stat b, .stat strong { font: 700 clamp(1.2rem, 2.24vw, 1.72rem)/1 var(--font-display); color: var(--frost); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.stat span, .stat small { font: 700 .8rem/1.3 var(--font-display); color: var(--dim); }
.num { font-family: var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.credits { color: var(--gold); font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
label { color: var(--frost); font-weight: 700; font-size: .9rem; }
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field > span, .field-label { font-weight: 700; font-size: .9rem; color: var(--frost); }
.field small, .field-hint, .hint { color: var(--dim); font-weight: 400; font-size: .82rem; }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="hidden"]), select, textarea {
  width: 100%; min-height: 46px; padding: 11px 14px; border-radius: var(--r-sm);
  background: rgba(3, 9, 22, .72); border: 1px solid var(--line-2); color: var(--frost);
  box-shadow: 0 1px 0 rgba(255,255,255,.03), inset 0 2px 6px rgba(0,0,0,.35);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { min-height: 140px; line-height: 1.55; resize: vertical; }
select { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393d6ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
select option { background: var(--night-2); color: var(--frost); }
input::placeholder, textarea::placeholder { color: #6d7fa0; }
input:hover, select:hover, textarea:hover { border-color: var(--line-3); }
input:focus-visible, select:focus-visible, textarea:focus-visible, input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ice) !important; box-shadow: var(--focus), inset 0 2px 6px rgba(0,0,0,.35); background-color: rgba(6, 16, 36, .9); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--sapphire-2); vertical-align: -3px; }
input[type="file"] { color: var(--mist); font-size: .9rem; }
input[type="file"]::file-selector-button { margin-right: 12px; padding: 8px 14px; border-radius: var(--r-sm); border: 1px solid var(--line-3); background: rgba(20, 40, 76, .7); color: var(--frost); font: 700 .85rem var(--font-display); cursor: pointer; }
input[type="color"] { width: 48px; height: 38px; padding: 2px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: transparent; }
input[aria-invalid="true"], .is-invalid { border-color: var(--danger) !important; }
.check-label, .checkbox { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; color: var(--mist); line-height: 1.45; }
.check-label input, .checkbox input { margin-top: 2px; flex: none; }
.two-fields, .form-pair, .form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 8px; }
fieldset { border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 18px; margin: 0 0 18px; }
legend { padding: 0 8px; font: 700 .87rem var(--font-display); color: var(--ice); }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--dim); pointer-events: none; }
.input-icon input { padding-left: 42px !important; }
@media (max-width: 640px) { .two-fields, .form-pair, .form-row { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------------------
   Alerts
   -------------------------------------------------------------------------- */
.alert {
  position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px 14px 18px; margin: 0 0 18px; border-radius: var(--r-md);
  background: rgba(47, 107, 255, .1); border: 1px solid rgba(110, 160, 255, .32); color: var(--frost); line-height: 1.5;
}
.alert::before { content: ""; flex: none; width: 9px; height: 9px; margin-top: 7px; transform: rotate(45deg); background: var(--ice); box-shadow: 0 0 10px var(--ice); }
.alert.success { background: rgba(70, 224, 160, .09); border-color: rgba(70, 224, 160, .38); }
.alert.success::before { background: var(--success); box-shadow: 0 0 10px var(--success); }
.alert.error, .alert.danger { background: rgba(255, 107, 125, .1); border-color: rgba(255, 107, 125, .45); }
.alert.error::before, .alert.danger::before { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
.alert.warning { background: rgba(255, 183, 77, .09); border-color: rgba(255, 183, 77, .42); }
.alert.warning::before { background: var(--warning); box-shadow: 0 0 10px var(--warning); }
.alert a { color: #fff; text-decoration: underline; }
.alert > button { margin-left: auto; background: none; border: 0; color: var(--mist); font-size: 1.3rem; line-height: 1; padding: 0 4px; }
.alert > button:hover { color: #fff; }

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.table-scroll, .table-wrap { position: relative; width: 100%; overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--line); background: rgba(8, 18, 36, .6); -webkit-overflow-scrolling: touch; }
.table, .classic-table, .data-table { width: 100%; font-size: .93rem; font-variant-numeric: tabular-nums; }
.table th, .table td, .classic-table th, .classic-table td, .data-table th, .data-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table thead th, .classic-table thead th, .data-table thead th { position: sticky; top: 0; z-index: 1; background: #0c1a33; font: 700 .82rem/1.2 var(--font-display); color: var(--dim); white-space: nowrap; }
.table tbody tr:nth-child(even), .classic-table tbody tr:nth-child(even), .data-table tbody tr:nth-child(even) { background: rgba(255,255,255,.018); }
.table tbody tr:hover, .classic-table tbody tr:hover, .data-table tbody tr:hover { background: rgba(47, 107, 255, .08); }
.table tbody tr:last-child td, .classic-table tbody tr:last-child td, .data-table tbody tr:last-child td { border-bottom: 0; }
.table .num, td.num, th.num { text-align: right; }
.empty-row td { text-align: center; color: var(--dim); padding: 28px; }

/* Rank medals (1st/2nd/3rd) */
.rank { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; font: 700 .95rem/1 var(--font-display); color: var(--mist); }
.rank--1, .rank--2, .rank--3 { width: 30px; color: #1a1200; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.rank--1 { background: linear-gradient(135deg, #fff1c2, #ffcb66 45%, #b97d16); }
.rank--2 { background: linear-gradient(135deg, #ffffff, #c9d6ea 45%, #7d8ea8); }
.rank--3 { background: linear-gradient(135deg, #ffe0c6, #d99a62 45%, #8a5427); }

/* --------------------------------------------------------------------------
   Tabs & segmented controls
   -------------------------------------------------------------------------- */
.tabs { position: relative; display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.tabs a, .tabs button { position: relative; padding: 12px 16px; background: none; border: 0; color: var(--dim); font: 700 .91rem/1 var(--font-display); }
.tabs a:hover, .tabs button:hover { color: var(--frost); }
.tabs .is-active, .tabs [aria-selected="true"], .tabs [aria-current="page"], .tabs .active { color: #fff; }
.tabs .is-active::after, .tabs [aria-selected="true"]::after, .tabs [aria-current="page"]::after, .tabs .active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: linear-gradient(90deg, var(--sapphire), var(--ice)); box-shadow: 0 0 10px rgba(110, 170, 255, .8); }
.segmented { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: rgba(3, 9, 22, .7); border: 1px solid var(--line-2); }
.segmented a, .segmented button, .segmented label { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 0; background: none; color: var(--mist); font: 700 .86rem/1 var(--font-display); cursor: pointer; }
.segmented .is-active, .segmented [aria-current="page"], .segmented input:checked + span, .segmented label:has(input:checked) { background: linear-gradient(180deg, #4a84ff, #2350d8); color: #fff; box-shadow: 0 4px 14px rgba(40, 100, 255, .35); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.pill-nav { position: relative; display: flex; gap: 8px; flex-wrap: wrap; }
.pill-nav a { padding: 9px 16px; border-radius: 999px; background: rgba(14, 30, 58, .6); border: 1px solid var(--line-2); color: var(--mist); font: 700 .85rem/1 var(--font-display); }
.pill-nav a:hover { color: #fff; border-color: var(--line-3); }
.pill-nav a.is-active, .pill-nav a[aria-current="page"], .pill-nav a.active { background: linear-gradient(180deg, #4a84ff, #2350d8); border-color: #6c9dff; color: #fff; }

/* --------------------------------------------------------------------------
   Pagination (markup from pagination.php)
   -------------------------------------------------------------------------- */
.s53-pagination, .pager { display: flex; align-items: center; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.s53-pagination p { margin: 0; color: var(--dim); font-size: .88rem; }
.s53-pagination p b { color: var(--frost); }
.s53-pagination p span { margin-left: 12px; padding-left: 12px; border-left: 1px solid var(--line-2); }
.s53-page-links { display: flex; flex-wrap: wrap; gap: 6px; }
.s53-page-links a, .s53-page-links span { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 12px; border-radius: var(--r-sm); font: 700 .91rem/1 var(--font-display); color: var(--mist); background: rgba(14, 30, 58, .6); border: 1px solid var(--line-2); }
.s53-page-links a:hover { color: #fff; border-color: var(--line-3); background: rgba(30, 60, 110, .7); }
.s53-page-links .s53-page-current { color: #fff; background: linear-gradient(180deg, #4a84ff, #2350d8); border-color: #6c9dff; box-shadow: 0 6px 16px rgba(40, 100, 255, .35); }
.s53-page-links .s53-page-disabled { opacity: .4; }
.s53-page-links .s53-page-gap { background: none; border: 0; min-width: 20px; padding: 0; }

/* --------------------------------------------------------------------------
   Empty & status states
   -------------------------------------------------------------------------- */
.empty-state, .s53-empty, .directory-empty, .forum-empty, .wiki-empty, .catalogue-empty {
  display: grid; justify-items: center; gap: 8px; padding: clamp(28px, 5vw, 48px) 20px; text-align: center; border-radius: var(--r-lg);
  border: 1px dashed var(--line-2); background: rgba(10, 22, 42, .45); color: var(--mist);
}
.empty-state h2, .empty-state h3 { margin: 0; font-size: 1.3rem; }
.empty-state p { margin: 0; color: var(--dim); max-width: 48ch; }
.empty-state__icon { width: 46px; height: 46px; color: var(--sapphire-2); filter: drop-shadow(0 0 12px rgba(95, 155, 255, .6)); }

/* --------------------------------------------------------------------------
   Dialogs
   -------------------------------------------------------------------------- */
dialog { color: var(--mist); }
dialog::backdrop { background: rgba(2, 6, 16, .72); backdrop-filter: blur(4px); }
.modal { width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; border-radius: var(--r-lg); border: 1px solid var(--line-2); background: linear-gradient(180deg, #0f2143, #081329); box-shadow: 0 30px 90px rgba(0,0,0,.7); overflow: hidden; }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal__close { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(20, 40, 76, .6); color: var(--frost); font-size: 1.3rem; line-height: 1; }
.modal__close:hover { border-color: var(--line-3); color: #fff; }

/* World screenshot dialog (site.js) */
.s53-world-dialog { width: min(1100px, calc(100vw - 24px)); padding: 0; border-radius: var(--r-lg); border: 1px solid var(--line-2); background: #081329; box-shadow: 0 30px 90px rgba(0,0,0,.75); overflow: hidden; }
.s53-world-dialog header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.s53-world-dialog header strong { font: 700 1rem var(--font-display); color: var(--frost); }
.s53-world-dialog header button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(20, 40, 76, .6); color: var(--frost); font-size: 1.3rem; }
.s53-world-dialog img { display: block; width: 100%; max-height: 72vh; object-fit: contain; background: #000; }
.s53-world-dialog p { margin: 0; padding: 12px 16px; color: var(--mist); font-size: .9rem; }


/* --------------------------------------------------------------------------
   Players, avatars, name colours, badges
   -------------------------------------------------------------------------- */
.player-name { color: var(--frost); font-weight: 700; }
.player-name.coloured { color: var(--player-name-colour); text-shadow: 0 1px 1px rgba(0,0,0,.75); }
.name-colour-red { --player-name-colour: #ff0000; --preview-colour: #ff0000; }
.name-colour-lavender { --player-name-colour: #d7a0ff; --preview-colour: #d7a0ff; }
.name-colour-orange { --player-name-colour: #ff981f; --preview-colour: #ff981f; }
.name-colour-coral { --player-name-colour: #ff5f56; --preview-colour: #ff5f56; }
.name-colour-pink { --player-name-colour: #ff69b4; --preview-colour: #ff69b4; }
.name-colour-hot-pink { --player-name-colour: #ff2d8d; --preview-colour: #ff2d8d; }
.name-colour-gold { --player-name-colour: #ffd700; --preview-colour: #ffd700; }
.name-colour-yellow { --player-name-colour: #ffff00; --preview-colour: #ffff00; }
.name-colour-lime { --player-name-colour: #7cff00; --preview-colour: #7cff00; }
.name-colour-emerald { --player-name-colour: #00c96b; --preview-colour: #00c96b; }
.name-colour-teal { --player-name-colour: #00c9a7; --preview-colour: #00c9a7; }
.name-colour-cyan { --player-name-colour: #00ffff; --preview-colour: #00ffff; }
.name-colour-sky-blue { --player-name-colour: #66ccff; --preview-colour: #66ccff; }
.name-colour-royal-blue { --player-name-colour: #4d7cfe; --preview-colour: #4d7cfe; }
.name-colour-purple { --player-name-colour: #b266ff; --preview-colour: #b266ff; }
.name-colour-silver { --player-name-colour: #c0c7d1; --preview-colour: #c0c7d1; }
.avatar, .player-headshot { position: relative; flex: none; width: var(--avatar, 44px); height: var(--avatar, 44px); border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 50% 30%, #27497f, #0a1630); border: 1px solid var(--line-2); box-shadow: 0 0 0 3px rgba(47, 107, 255, .08); }
.avatar img, .player-headshot img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; display: block; }
.game-mode-icon { width: 16px; height: 16px; vertical-align: -2px; image-rendering: pixelated; }
.forum-icon { width: 20px; height: 20px; }
.role-badge, .forum-role { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font: 700 .76rem/1.4 var(--font-display); background: rgba(147, 214, 255, .1); border: 1px solid var(--line-2); color: var(--ice-2); }

/* --------------------------------------------------------------------------
   Prose (articles, guides, forum posts)
   -------------------------------------------------------------------------- */
.prose, .post-body { color: #cdd9ec; font-size: 1.04rem; line-height: 1.75; overflow-wrap: anywhere; }
.prose > * + *, .post-body > * + * { margin-top: 1em; }
.prose h2, .post-body h2 { font-size: 1.6rem; margin-top: 1.6em; }
.prose h3, .post-body h3 { margin-top: 1.4em; }
.prose a, .post-body a { text-decoration: underline; text-decoration-color: rgba(147, 214, 255, .45); }
.prose img, .post-body img { border-radius: var(--r-md); border: 1px solid var(--line); }
.prose blockquote, .post-body blockquote { margin: 1.2em 0; padding: 12px 18px; border-left: 3px solid var(--sapphire-2); background: rgba(47, 107, 255, .08); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--mist); }
.prose pre, .post-body pre { padding: 14px 16px; border-radius: var(--r-md); background: #050c1b; border: 1px solid var(--line); overflow: auto; }
.prose ul, .prose ol, .post-body ul, .post-body ol { padding-left: 1.3em; }
.prose li + li, .post-body li + li { margin-top: .35em; }
.prose li::marker, .post-body li::marker { color: var(--sapphire-2); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer { position: relative; isolation: isolate; margin-top: 0; padding-top: clamp(56px, 8vw, 96px); border-top: 1px solid var(--line); overflow: hidden; background: linear-gradient(180deg, rgba(4, 10, 22, .6), #02060f 70%); }
.site-footer::before { content: ""; position: absolute; inset: 0 0 auto; height: 340px; z-index: -1; background: url("art/frozen-pass-1920.webp") center 70% / cover; opacity: .12; -webkit-mask-image: linear-gradient(180deg, #000, transparent); mask-image: linear-gradient(180deg, #000, transparent); }
.footer-cta { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-bottom: clamp(36px, 5vw, 56px); margin-bottom: clamp(36px, 5vw, 56px); border-bottom: 1px solid var(--line); }
.footer-cta h2 { margin: 0 0 6px; font-size: clamp(1.38rem, 2.58vw, 1.98rem); }
.footer-cta p { margin: 0; color: var(--dim); }
.footer-cta__actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); gap: 32px; padding-bottom: 40px; }
.footer-brand img { width: 170px; margin-bottom: 14px; }
.footer-brand p { color: var(--dim); font-size: .9rem; max-width: 34ch; }
.footer-col h3 { margin: 0 0 14px; font: 700 .85rem/1 var(--font-display); color: var(--frost); }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.footer-col a { color: var(--dim); font-size: .92rem; }
.footer-col a:hover { color: var(--frost); }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 0 28px; border-top: 1px solid var(--line); color: #62759a; font-size: .8rem; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 420px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px 18px; } }

/* Local preview label injected by tests/preview-router.php (never in production) */
.s53-preview-label { position: fixed; left: 10px; bottom: 10px; z-index: 300; padding: 6px 10px; border-radius: 6px; background: rgba(255, 183, 77, .95); color: #1c1200; font: 700 .68rem/1 var(--font-text); letter-spacing: .06em; box-shadow: 0 6px 18px rgba(0,0,0,.45); pointer-events: none; }

/* --------------------------------------------------------------------------
   Motion preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .gem-btn:hover .gem-shine::before { transform: none; }
}
.has-menu.is-dismissed > .nav-menu { display: none; }
@media (max-width: 1020px) { .has-menu.is-dismissed > .nav-menu { display: grid; } }

/* Generic error page (404.php) */
.error-routes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.error-routes a { display: flex; gap: 12px; align-items: center; height: 100%; padding: 16px; border-radius: var(--r-md); background: rgba(10, 22, 42, .6); border: 1px solid var(--line); color: var(--mist); }
.error-routes a:hover { border-color: var(--line-3); color: var(--mist); background: rgba(20, 42, 80, .6); }
.error-routes svg { flex: none; width: 40px; height: 40px; padding: 9px; border-radius: 50%; color: var(--ice); background: rgba(47, 107, 255, .15); }
.error-routes b { display: block; color: var(--frost); font: 700 1rem/1.2 var(--font-display); }
.error-routes small { color: var(--dim); }
@media (max-width: 900px) { .error-routes { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .error-routes { grid-template-columns: 1fr; } }
