/* ═══════════════════════════════════════════════════════════════
   Portal v2 — Aetheria, evolved dark-fantasy.

   Deep slate base · refined gold accent · solid panels over glass ·
   Cinzel display + Inter UI (self-hosted, CSP-clean).
   ═══════════════════════════════════════════════════════════════ */

/* ── Fonts ─────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Inter';
  src: url('/static/fonts/inter-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cinzel';
  src: url('/static/fonts/cinzel-latin.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

/* ── Design tokens ─────────────────────────────────────────────── */
:root {
  /* Surfaces — deep slate with a warm undertone */
  --bg: #0b0d12;
  --bg-raise: #10141c;
  --panel: #141925;
  --panel-2: #1a2130;
  --panel-inset: #0d1018;

  /* Lines — gold-tinted hairlines */
  --line: rgba(214, 178, 110, 0.10);
  --line-strong: rgba(214, 178, 110, 0.22);
  --line-bright: rgba(230, 196, 130, 0.38);

  /* Text */
  --text: #e9e3d4;
  --text-2: #b0a892;
  --text-3: #7c745f;

  /* Accent — refined gold */
  --gold: #d4a94f;
  --gold-2: #eec97f;
  --gold-deep: #a9823a;
  --gold-soft: rgba(212, 169, 79, 0.13);
  --gold-glow: rgba(212, 169, 79, 0.30);

  /* Semantic */
  --green: #6fae6a;
  --red: #d05f4e;
  --blue: #6f9fd8;
  --violet: #a78bca;
  --orange: #d18a4e;

  /* Elevation */
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow-2: 0 10px 30px -8px rgba(0, 0, 0, 0.55);
  --shadow-3: 0 24px 60px -16px rgba(0, 0, 0, 0.65);
  --glass: blur(14px) saturate(150%);

  /* Type */
  --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Cinzel', 'Inter', serif;

  /* Metrics */
  --nav-h: 64px;
  --r-s: 6px;
  --r-m: 10px;
  --r-l: 14px;
  --r-xl: 20px;
  --wrap: 1180px;
  --wrap-wide: 1400px;

  /* ── Legacy var bridge ──────────────────────────────────────────
     portal.legacy.css components reference the OLD palette through
     these names. Aliasing them to v2 tokens recolors every unmigrated
     component into the new design automatically — and because the
     aliases point at v2 vars, theme-day adapts for free.
     (Same-named vars --bg/--text/--red/--green already resolve to v2.) */
  --bg-panel: var(--panel);
  --bg-panel-alt: var(--panel-2);
  --bg-input: var(--panel-inset);
  --parchment: var(--panel);
  --parchment-light: var(--panel-2);
  --border: var(--line-strong);
  --border-light: var(--line-strong);
  --border-gold: var(--line-bright);
  --text-dim: var(--text-2);
  --text-bright: #f2e8cf;
  --ink: var(--text-2);
  --accent: var(--gold);
  --accent-gold: var(--gold-2);
  --accent-gold-bright: #f7dc9e;
  --arcane: var(--blue);
  --pink: var(--violet);
  --shadow: rgba(0, 0, 0, 0.45);
  --glass-blur: var(--glass);
  --glass-border: 1px solid var(--line-strong);
  --glass-shadow: var(--shadow-2);
  --glass-shadow-lg: var(--shadow-3);
  --grad-aurora: linear-gradient(135deg, #eec97f 0%, #b98c3c 50%, #f7dc9e 100%);
  --grad-cyan: linear-gradient(135deg, #6f9fd8 0%, #4a6fa0 100%);
  --grad-purple: linear-gradient(135deg, #a78bca 0%, #7a5fa0 100%);
  --grad-pink: linear-gradient(135deg, #d05f4e 0%, #9c4234 100%);
  --grad-green: linear-gradient(135deg, #6fae6a 0%, #4e8549 100%);
  --grad-surface: linear-gradient(180deg, var(--panel-2), var(--panel));
  --r-sm: var(--r-s);
  --r-md: var(--r-m);
  --r-lg: var(--r-l);
  --r-pill: 100px;
  /* secondary aliases — still used by wiki hub, rank rows, misc panels */
  --bg-dark: var(--panel-inset);
  --border-dim: var(--line);
  --danger: var(--red);
  --muted: var(--text-3);
  --text-muted: var(--text-3);
}

/* Day theme — warm parchment */
body.theme-day {
  --bg: #ece4d2;
  --bg-raise: #f3ecdb;
  --panel: #faf5e8;
  --panel-2: #f2ead6;
  --panel-inset: #e6dcc4;
  --line: rgba(120, 92, 40, 0.18);
  --line-strong: rgba(120, 92, 40, 0.32);
  --line-bright: rgba(140, 108, 48, 0.45);
  --text: #2c251a;
  --text-2: #57492f;
  --text-3: #857455;
  --gold: #8f6a24;
  --gold-2: #a9823a;
  --gold-deep: #6e5218;
  --gold-soft: rgba(143, 106, 36, 0.14);
  --gold-glow: rgba(143, 106, 36, 0.30);
  --shadow-1: 0 1px 2px rgba(80, 60, 20, 0.12);
  --shadow-2: 0 10px 30px -8px rgba(80, 60, 20, 0.20);
  --shadow-3: 0 24px 60px -16px rgba(80, 60, 20, 0.28);
}

/* ── Reset / base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background:
    radial-gradient(ellipse 90% 45% at 50% -10%, rgba(212, 169, 79, 0.07), transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(111, 159, 216, 0.05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.drawer-open { overflow: hidden; }

@keyframes page-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
body.page-fade-in { animation: page-in 0.25s ease-out; }

::selection { background: rgba(212, 169, 79, 0.30); color: #fff; }

a { color: var(--gold-2); text-decoration: none; transition: color 0.15s; }
a:hover { color: #f7dc9e; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.25;
  color: #f2e8cf;
  margin: 0 0 14px;
  letter-spacing: 0.02em;
}
body.theme-day h1, body.theme-day h2,
body.theme-day h3, body.theme-day h4 { color: #3a2f1c; }

h1 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
h1.page-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
h1.page-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-strong), transparent);
}
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 12px; }
img { max-width: 100%; height: auto; }
/* World map: markers/routes are positioned in the image's native pixel
   space — the img must render at natural size or they desync. */
#worldmap-img { max-width: none; }
code, .mono {
  font-family: 'Cascadia Code', 'JetBrains Mono', Consolas, monospace;
  font-size: 0.9em;
  background: var(--panel-inset);
  padding: 2px 6px;
  border-radius: var(--r-s);
}
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* Icons */
.ic {
  width: 16px; height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
  vertical-align: -3px;
}
.ic-lg { width: 20px; height: 20px; }

/* ── Utilities ─────────────────────────────────────────────────── */
.muted { color: var(--text-3); }
.dim { color: var(--text-2); }
.gold { color: var(--gold-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.small { font-size: 12.5px; }
.hidden, .load-more-hidden { display: none !important; }

.reveal-hidden {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.reveal-hidden.revealed { opacity: 1; transform: none; }

/* ══════════════════════════════════════════════════════════════
   Top navigation
   ══════════════════════════════════════════════════════════════ */
.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 200;
  background: rgba(13, 16, 24, 0.88);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  border-bottom: 1px solid var(--line);
  transition: background 0.3s, border-color 0.3s;
}
body.theme-day .site-nav { background: rgba(250, 245, 232, 0.88); }

/* Over a hero, start transparent; solidify on scroll */
.site-nav.over-hero:not(.scrolled) {
  background: linear-gradient(180deg, rgba(8, 10, 15, 0.72), rgba(8, 10, 15, 0));
  border-bottom-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.nav-inner {
  max-width: var(--wrap-wide);
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.brand img { width: 38px; height: 38px; display: block; }
.brand-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gold-2);
  text-transform: uppercase;
}
body.theme-day .brand-name { color: var(--gold-deep); }

/* Primary links */
.primary-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 100%;
}
.primary-nav > a,
.nav-drop-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 100%;
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: 13.5px;
  font-weight: 550;
  letter-spacing: 0.02em;
  cursor: pointer;
  position: relative;
  transition: color 0.15s;
}
.primary-nav > a:hover,
.nav-drop-btn:hover,
.nav-drop.open .nav-drop-btn,
.nav-drop:focus-within .nav-drop-btn { color: var(--text); }
.primary-nav > a.active {
  color: var(--gold-2);
}
.primary-nav > a.active::after,
.nav-drop-btn.active::after {
  content: '';
  position: absolute;
  left: 12px; right: 12px; bottom: 0;
  height: 2px;
  background: var(--gold);
  border-radius: 2px 2px 0 0;
}
.nav-drop-btn .ic { width: 13px; height: 13px; opacity: 0.6; }
.nav-drop.open .nav-drop-btn .ic { transform: rotate(180deg); }

/* Dropdown menus */
.nav-drop { position: relative; height: 100%; display: flex; align-items: stretch; }
.nav-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translate(-50%, 6px);
  min-width: 250px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-3);
  padding: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 210;
}
.nav-menu.align-right { left: auto; right: 0; transform: translate(0, 6px); }
.nav-drop.open .nav-menu {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
.nav-drop.open .nav-menu.align-right { transform: translate(0, 0); }
@media (hover: hover) and (min-width: 1100px) {
  .nav-drop:hover .nav-menu,
  .nav-drop:focus-within .nav-menu {
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
  }
  .nav-drop:hover .nav-menu.align-right,
  .nav-drop:focus-within .nav-menu.align-right { transform: translate(0, 0); }
  /* Invisible bridge so the menu doesn't close crossing the 6px gap */
  .nav-drop::after {
    content: '';
    position: absolute;
    top: 100%; left: -20%; right: -20%;
    height: 8px;
  }
}
.nav-menu.mega { min-width: 620px; }
.nav-menu.mega-lg { min-width: 780px; }

.menu-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 4px 18px;
}
.menu-cat {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 8px 10px 4px;
}
.nav-menu a {
  display: block;
  padding: 6px 10px;
  border-radius: var(--r-s);
  color: var(--text-2);
  font-size: 13.5px;
  transition: background 0.12s, color 0.12s;
}
.nav-menu a:hover { background: var(--gold-soft); color: var(--gold-2); }
.nav-menu a.active { color: var(--gold-2); background: var(--gold-soft); }
.nav-menu .menu-form { margin: 0; }
.nav-menu button.menu-link {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 10px;
  border: 0;
  border-radius: var(--r-s);
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}
.nav-menu button.menu-link:hover { background: var(--gold-soft); color: var(--gold-2); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* Right-side actions */
.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px 0 12px;
  min-width: 190px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--panel-inset);
  color: var(--text-3);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.nav-search:hover { border-color: var(--line-strong); color: var(--text-2); }
.nav-search kbd {
  margin-left: auto;
  font-family: inherit;
  font-size: 11px;
  color: var(--text-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  background: var(--panel);
}

/* Play Now — the nav's primary CTA */
.play-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-m);
  background: linear-gradient(180deg, #eec97f, var(--gold));
  color: #241a06;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(238, 201, 127, 0.35), 0 4px 14px rgba(212, 169, 79, 0.28);
  transition: filter 0.15s, transform 0.12s, box-shadow 0.2s;
}
.play-btn .ic { width: 14px; height: 14px; }
.play-btn:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(238, 201, 127, 0.5), 0 6px 20px rgba(212, 169, 79, 0.4); }
.play-btn:active { transform: translateY(0); }
.play-btn-drawer { width: 100%; justify-content: center; height: 44px; margin-bottom: 10px; font-size: 15px; }
@media (min-width: 1101px) { .play-btn-drawer { display: none; } }

/* Play modal — client picker */
.play-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 4, 9, 0.72);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.18s ease-out;
}
.play-modal {
  position: relative;
  width: min(92vw, 480px);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-3);
  padding: 34px 30px 30px;
  text-align: center;
  animation: popIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes popIn { from { opacity: 0; transform: scale(0.94) translateY(8px); } to { opacity: 1; transform: none; } }
.play-modal-crest { width: 54px; height: 54px; object-fit: contain; margin-bottom: 10px; }
.play-modal-title { font-family: var(--font-display); font-size: 1.5rem; color: var(--gold-2); margin-bottom: 4px; }
.play-modal-sub { color: var(--text-3); font-size: 13.5px; margin-bottom: 22px; }
.play-modal-close { position: absolute; top: 12px; right: 12px; }
.play-options { display: grid; gap: 12px; }
.play-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  background: var(--panel-inset);
  transition: border-color 0.15s, transform 0.12s, background 0.15s;
}
.play-option:hover { border-color: var(--line-bright); transform: translateY(-1px); background: var(--panel-2); }
.play-option--primary { border-color: var(--line-bright); background: var(--gold-soft); }
.play-option--primary:hover { border-color: var(--gold-2); }
.play-option-icon { width: 26px; height: 26px; color: var(--gold-2); margin-bottom: 2px; }
.play-option-name { font-weight: 650; font-size: 15px; color: var(--text); }
.play-option-desc { font-size: 12.5px; color: var(--text-3); line-height: 1.45; }

.online-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border-radius: 100px;
  background: var(--gold-soft);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 550;
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-3);
  display: inline-block;
}
.status-dot.online { background: var(--green); box-shadow: 0 0 8px rgba(111, 174, 106, 0.7); }
.status-dot.idle { background: var(--orange); }

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid transparent;
  border-radius: var(--r-m);
  background: none;
  color: var(--text-2);
  font: inherit;
  cursor: pointer;
  position: relative;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--gold-soft); color: var(--gold-2); }
.icon-btn .ic { width: 18px; height: 18px; vertical-align: 0; }
.notif-badge {
  position: absolute;
  top: 2px; right: 0;
  min-width: 15px; height: 15px;
  padding: 0 4px;
  border-radius: 100px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
}
.acct-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: 13.5px;
  font-weight: 550;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.acct-chip:hover { border-color: var(--line-strong); color: var(--text); }
.acct-chip .ic { width: 13px; height: 13px; }
.acct-chip .ic-lg { width: 17px; height: 17px; }
.role-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-2);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 1px 6px;
}
.role-badge.premium { background: var(--gold); color: #1c1508; border-color: var(--gold); }

#navBurger { display: none; }

/* ── Mobile drawer ─────────────────────────────────────────────── */
.nav-drawer {
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  z-index: 190;
  background: rgba(11, 13, 18, 0.98);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  overflow-y: auto;
  padding: 16px 20px 60px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.2s, transform 0.2s;
}
.nav-drawer.open { opacity: 1; pointer-events: auto; transform: none; }
.nav-drawer .drawer-search {
  width: 100%;
  margin-bottom: 14px;
  justify-content: flex-start;
}
.drawer-section {
  border-bottom: 1px solid var(--line);
}
.drawer-section summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 4px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--gold-2);
  cursor: pointer;
}
.drawer-section summary::-webkit-details-marker { display: none; }
.drawer-section summary .ic { opacity: 0.5; transition: transform 0.15s; }
.drawer-section[open] summary .ic { transform: rotate(180deg); }
.drawer-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding-bottom: 12px;
}
.drawer-links a {
  padding: 9px 10px;
  border-radius: var(--r-s);
  color: var(--text-2);
  font-size: 14px;
}
.drawer-links a:active, .drawer-links a:hover { background: var(--gold-soft); color: var(--gold-2); }
.drawer-cat {
  grid-column: 1 / -1;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 10px 10px 2px;
}
.drawer-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 4px;
  flex-wrap: wrap;
}
.drawer-foot .lang-link { font-size: 13px; }

/* ── Page container ────────────────────────────────────────────── */
.page {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: calc(var(--nav-h) + 28px) 22px 70px;
  min-height: 60vh;
}
body.has-hero .page { padding-top: 40px; }
.page.page-wide { max-width: var(--wrap-wide); }

/* Page titles — first-level h1 gets the display treatment + rule */
.page > h1:first-child,
.page > div > h1:first-child {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.page > h1:first-child::after,
.page > div > h1:first-child::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-strong), transparent);
}

/* Legacy widget boxes rendered inside content — restyle as cards */
.sidebox {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-1);
  margin-bottom: 16px;
  overflow: hidden;
}
.sidebox-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 13px 18px 10px;
  border-bottom: 1px solid var(--line);
}
.sidebox-body { padding: 14px 18px; font-size: 14px; color: var(--text-2); }
.sidebox-body p:last-child { margin-bottom: 0; }

/* ── Footer ────────────────────────────────────────────────────── */
.site-foot {
  border-top: 1px solid var(--line);
  background: var(--bg-raise);
  margin-top: 30px;
}
.foot-inner {
  max-width: var(--wrap-wide);
  margin: 0 auto;
  padding: 44px 22px 30px;
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 40px;
}
.foot-brand .brand { margin-bottom: 12px; }
.foot-tag {
  color: var(--text-3);
  font-size: 13px;
  max-width: 260px;
}
.foot-status { margin-top: 14px; }
.foot-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 24px;
}
.foot-cols .menu-cat { padding: 0 0 8px; }
.foot-cols a {
  display: block;
  padding: 4px 0;
  color: var(--text-2);
  font-size: 13.5px;
}
.foot-cols a:hover { color: var(--gold-2); }
.foot-bar {
  border-top: 1px solid var(--line);
  padding: 14px 22px;
  text-align: center;
  color: var(--text-3);
  font-size: 12.5px;
}
.foot-bar a { color: var(--text-2); }
.foot-bar a:hover { color: var(--gold-2); }

/* ── Maintenance banner ────────────────────────────────────────── */
.maintenance-banner {
  background: linear-gradient(90deg, rgba(208, 95, 78, 0.16), rgba(208, 95, 78, 0.08));
  border: 1px solid rgba(208, 95, 78, 0.4);
  border-radius: var(--r-m);
  color: #e8a99e;
  padding: 10px 16px;
  margin-bottom: 20px;
  font-size: 13.5px;
}

/* ══════════════════════════════════════════════════════════════
   Components
   ══════════════════════════════════════════════════════════════ */

/* Buttons */
.btn, button.btn, input.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: var(--r-m);
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s, background 0.15s;
}
.btn:hover {
  border-color: var(--line-bright);
  color: var(--gold-2);
  transform: translateY(-1px);
}
.btn:active { transform: none; }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn-primary {
  background: linear-gradient(180deg, #e0b45f, #b98c3c);
  border-color: #e8c170;
  color: #1c1508;
  font-weight: 650;
}
.btn-primary:hover { color: #1c1508; box-shadow: 0 6px 20px -6px var(--gold-glow); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-danger { border-color: rgba(208, 95, 78, 0.5); color: #e8968a; }
.btn-danger:hover { background: rgba(208, 95, 78, 0.12); color: #f0b3a9; border-color: var(--red); }
.btn-small { padding: 5px 12px; font-size: 12.5px; border-radius: var(--r-s); }
.btn-medieval { /* legacy alias — renders as standard btn */ }

/* Badges & chips */
.badge, .news-tag, .period-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  border: 1px solid var(--line);
  background: var(--gold-soft);
  color: var(--gold-2);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-premium { background: var(--gold); color: #1c1508; border-color: var(--gold); }
.badge-starter { border-color: rgba(111, 174, 106, 0.4); color: var(--green); background: rgba(111, 174, 106, 0.10); }
.badge-endgame { border-color: rgba(208, 95, 78, 0.4); color: var(--red); background: rgba(208, 95, 78, 0.10); }
.badge-danger { border-color: rgba(208, 95, 78, 0.4); color: #e8968a; background: rgba(208, 95, 78, 0.10); }

/* Panels & cards */
.panel, .card, .info-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 18px 20px;
  box-shadow: var(--shadow-1);
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.info-card {
  /* sheen fed by pointer-tilt JS (--mx/--my) */
  overflow: hidden;
}
.info-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%),
    rgba(212, 169, 79, 0.07), transparent 45%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}
.info-card:hover::before { opacity: 1; }
.info-card:hover, .card:hover { border-color: var(--line-strong); }
.info-card h3 { font-size: 1rem; margin-bottom: 6px; }
.info-card p:last-child { margin-bottom: 0; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }

/* Bento grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.bento-tile {
  grid-column: span 2;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 18px 20px;
  box-shadow: var(--shadow-1);
  position: relative;
  overflow: hidden;
}
.bento-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%),
    rgba(212, 169, 79, 0.07), transparent 45%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}
.bento-tile:hover::before { opacity: 1; }
.bento-tile:hover { border-color: var(--line-strong); }
.bento-tile-large { grid-column: span 4; grid-row: span 2; }
.bento-tile-wide { grid-column: span 4; }
.bento-tile-tall { grid-column: span 2; grid-row: span 2; }
.bento-tile-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.bento-tile-title .ic { width: 14px; height: 14px; color: var(--gold); }
.bento-stat { display: flex; flex-direction: column; }
.bento-stat-num {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--gold-2);
  line-height: 1.1;
}
.bento-stat-label {
  font-size: 11.5px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}
.bento-stat-row { display: flex; gap: 24px; align-items: center; }
.fx-live { border-color: rgba(111, 174, 106, 0.30); }

.gradient-border-hover { position: relative; }
.gradient-border-hover::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(238, 201, 127, 0.5), transparent 40%, transparent 70%, rgba(238, 201, 127, 0.3));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.gradient-border-hover:hover::after { opacity: 1; }

/* Tables */
table.list, table.sortable, table.admin-table, .data-table, table.spell-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  overflow: hidden;
  font-size: 14px;
}
table.list th, table.sortable th, table.admin-table th,
.data-table th, table.spell-table th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 11px 14px;
  background: var(--panel-inset);
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
table.list td, table.sortable td, table.admin-table td,
.data-table td, table.spell-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
}
table.list tbody tr:last-child td, table.sortable tr:last-child td { border-bottom: 0; }
table.list tbody tr, table.sortable tbody tr, table.admin-table tbody tr {
  transition: background 0.12s;
}
table.list tbody tr:hover, table.sortable tbody tr:hover,
table.admin-table tbody tr:hover { background: rgba(212, 169, 79, 0.05); }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]:hover { color: var(--text); }
th[data-sort].sort-asc::after { content: ' ▲'; font-size: 9px; color: var(--gold); }
th[data-sort].sort-desc::after { content: ' ▼'; font-size: 9px; color: var(--gold); }
tr.rank-gold td { color: #f2d48a; }
tr.rank-silver td { color: #cfd4dc; }
tr.rank-bronze td { color: #d0a184; }
.rank-change.rank-up { color: var(--green); }
.rank-change.rank-down { color: var(--red); }
.table-wrap { overflow-x: auto; border-radius: var(--r-l); }

/* Tabs & filters */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: var(--panel-inset);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  margin-bottom: 16px;
  width: fit-content;
  max-width: 100%;
}
.tabs a, .tabs .tab {
  padding: 7px 14px;
  border-radius: var(--r-s);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
}
.tabs a:hover, .tabs .tab:hover { color: var(--text); background: var(--gold-soft); }
.tabs a.active, .tabs .tab.active {
  background: var(--panel-2);
  color: var(--gold-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.period-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.period-btn { padding: 5px 13px; cursor: pointer; }
.period-btn:hover { border-color: var(--line-strong); }
.period-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #1c1508;
}

/* Forms */
input[type="text"], input[type="password"], input[type="email"],
input[type="number"], input[type="search"], input[type="date"],
input[type="time"], input[type="url"], select, textarea {
  width: 100%;
  padding: 9px 13px;
  background: var(--panel-inset);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
label { display: block; font-size: 13px; font-weight: 550; color: var(--text-2); margin-bottom: 6px; }
.form-row { margin-bottom: 14px; }
.form-card, .auth-form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 26px 28px;
  max-width: 460px;
  margin: 0 auto;
  box-shadow: var(--shadow-2);
}
.msg-box {
  padding: 12px 16px;
  border-radius: var(--r-m);
  border: 1px solid var(--line-strong);
  background: var(--panel);
  margin-bottom: 16px;
  font-size: 14px;
}
.msg-box.error, .msg-box.msg-error { border-color: rgba(208, 95, 78, 0.5); color: #e8968a; }
.msg-box.success, .msg-box.msg-success { border-color: rgba(111, 174, 106, 0.5); color: #a5d4a1; }

/* Event ticker */
.event-ticker {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 14px 18px;
  margin-bottom: 22px;
}
.event-ticker-event {
  border-left: 3px solid var(--gold);
  padding: 4px 0 4px 14px;
  font-size: 14px;
}
.event-ticker-event + .event-ticker-event { margin-top: 8px; }
.event-ticker-event .muted { margin-left: 8px; }
.event-ticker-mults { margin-left: 10px; color: var(--gold-2); font-weight: 600; font-size: 12.5px; }
.event-ticker-standing { margin-top: 12px; font-size: 13px; }
.event-ticker-standing ol { margin: 6px 0 0; padding-left: 22px; color: var(--text-2); }
.event-ticker-feed {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12.5px;
  color: var(--text-3);
}
.event-ticker-player { color: var(--gold-2); font-weight: 600; }
.fx-tick-cycle .event-ticker-event { opacity: 0; transition: opacity 0.5s; display: none; }
.fx-tick-cycle .event-ticker-event.fx-tick-on { opacity: 1; display: block; }

/* Live activity ticker — slim strip above the footer */
.activity-ticker {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 34px;
  padding: 0 16px;
  background: rgba(13, 16, 24, 0.92);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  border-top: 1px solid var(--line);
  overflow: hidden;
}
body.theme-day .activity-ticker { background: rgba(250, 245, 232, 0.92); }
.activity-ticker-label {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
}
.activity-ticker-label .ic { width: 13px; height: 13px; }
.activity-ticker-scroll {
  display: flex;
  gap: 26px;
  white-space: nowrap;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.activity-ticker-item { font-size: 12.5px; color: var(--text-3); flex: none; }
.activity-ticker-item strong { color: var(--text-2); font-weight: 600; }
.activity-ticker-time { color: var(--text-3); opacity: 0.7; }
.site-foot { padding-bottom: 34px; }

/* News */
.news-post {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 20px 24px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-1);
  transition: border-color 0.2s;
}
.news-post:hover { border-color: var(--line-strong); }
.news-post.hidden-post { opacity: 0.55; }
.news-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.news-head h3 { margin: 0; font-size: 1.15rem; }
.news-meta { font-size: 12.5px; color: var(--text-3); }
.news-category { color: var(--gold-2); font-weight: 600; }
.news-body { color: var(--text-2); font-size: 14.5px; }
.news-body p:last-child { margin-bottom: 0; }
.news-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.news-tag { font-size: 10.5px; }

/* Deaths feed */
.deaths-feed { display: flex; flex-direction: column; gap: 9px; }
.death-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-2);
}
.death-entry a { font-weight: 600; }

/* Load more */
.load-more-wrap { text-align: center; margin-top: 16px; }
.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 22px;
  border-radius: 100px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--gold-2);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.load-more-btn:hover { background: var(--gold-soft); border-color: var(--line-bright); }
.load-more-spinner {
  width: 12px; height: 12px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--gold);
  border-radius: 50%;
  display: none;
  animation: spin 0.7s linear infinite;
}
.load-more-btn.loading .load-more-spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Toasts */
.toast-container {
  position: fixed;
  top: calc(var(--nav-h) + 14px);
  right: 16px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--blue);
  border-radius: var(--r-m);
  box-shadow: var(--shadow-2);
  font-size: 13.5px;
  color: var(--text);
  animation: toast-in 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  pointer-events: auto;
  max-width: 380px;
}
.toast.success { border-left-color: var(--green); }
.toast.success .toast-icon { color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.error .toast-icon { color: var(--red); }
.toast.info .toast-icon { color: var(--blue); }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: none; }
}

/* Command palette */
.cmd-palette-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(5, 6, 10, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
}
.cmd-palette-box {
  width: min(560px, 92vw);
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-3);
  overflow: hidden;
  animation: palette-in 0.15s ease-out;
}
@keyframes palette-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.cmd-palette-input {
  width: 100%;
  padding: 15px 18px;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: transparent !important;
  font-size: 15px;
  box-shadow: none !important;
}
.cmd-palette-results { max-height: 380px; overflow-y: auto; padding: 6px; }
.cmd-palette-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-s);
  color: var(--text-2);
  font-size: 14px;
}
.cmd-palette-item.selected, .cmd-palette-item:hover {
  background: var(--gold-soft);
  color: var(--gold-2);
}
.cmd-palette-empty { padding: 20px; text-align: center; color: var(--text-3); font-size: 13.5px; }

/* Notification panel */
.notif-panel {
  z-index: 400;
  width: min(340px, 92vw);
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-3);
  overflow: hidden;
}
.notif-panel-header {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  border-bottom: 1px solid var(--line);
}
.notif-panel-body { max-height: 400px; overflow-y: auto; }
.notif-item { border-bottom: 1px solid var(--line); }
.notif-item > a, .notif-item > div { display: block; padding: 11px 16px; }
.notif-item:hover { background: var(--gold-soft); }
.notif-item-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.notif-item-body { font-size: 12.5px; color: var(--text-2); }
.notif-item-time { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.notif-read { opacity: 0.6; }
.notif-empty, .notif-loading { padding: 22px; text-align: center; color: var(--text-3); font-size: 13px; }

/* Skeletons */
.skeleton-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 16px;
  margin-bottom: 10px;
}
.skeleton {
  border-radius: var(--r-s);
  background: linear-gradient(90deg,
    var(--panel-2) 25%, var(--bg-raise) 50%, var(--panel-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.skeleton-text { height: 12px; margin-bottom: 8px; }
.skeleton-text.short { width: 55%; }
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ── Gap-fill: classes with no prior styling ─────────────────────
   Covers the ~200 template classes that never had rules — buttons,
   section containers, stat chips, detail cells, sprite slots. ─── */

/* Buttons on table/search pages (was: browser-default) */
.ot-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--r-m);
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 550;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.ot-btn:hover { border-color: var(--line-bright); color: var(--gold-2); }

/* Page intro lead paragraph */
.page-intro {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-2);
  max-width: 70ch;
  margin-bottom: 24px;
}

/* Section containers (rules/wiki/systems/pulse pages) */
.rules-section, .wiki-section, .tip-section, .lore-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-1);
}
.rules-section h2, .wiki-section h2, .lore-section h2 { font-size: 1.2rem; }
.rules-list { padding-left: 22px; color: var(--text-2); }
.rules-list li { margin: 8px 0; line-height: 1.65; }
.rules-note, .wiki-note, .tip-note {
  border-left: 3px solid var(--gold);
  background: var(--gold-soft);
  padding: 10px 14px;
  border-radius: 0 var(--r-s) var(--r-s) 0;
  color: var(--text-2);
  font-size: 13.5px;
  margin: 12px 0;
}
.rules-note { border-left-color: var(--red); background: rgba(208, 95, 78, 0.08); }
.wiki-intro { font-size: 15px; color: var(--text-2); margin-bottom: 20px; }
.wiki-search-result { display: block; padding: 12px 16px; border-radius: var(--r-m); border: 1px solid transparent; }
.wiki-search-result:hover { background: var(--panel); border-color: var(--line); }

/* Systems page — card grid */
.systems-group { margin-bottom: 30px; }
.systems-group-title {
  font-size: 0.95rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--gold-2);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-strong);
  margin-bottom: 14px;
}
.systems-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.system-card {
  display: flex;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 16px 18px;
  box-shadow: var(--shadow-1);
  transition: border-color 0.2s, transform 0.15s;
}
.system-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.system-card h3 { margin-bottom: 5px; font-size: 1.02rem; }
.system-card p { font-size: 13.5px; color: var(--text-2); margin-bottom: 10px; }
.system-icon {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: var(--r-m);
  background: var(--gold-soft);
  border: 1px solid var(--line);
  color: var(--gold-2);
  font-size: 20px;
}
.system-body { min-width: 0; }
.system-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.system-tooltip { position: relative; }
.stat-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--panel-inset);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 550;
}
.systems-summary { margin-top: 20px; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.summary-stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 14px;
  text-align: center;
}
.summary-num {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--gold-2);
  display: block;
}
.summary-label { font-size: 11px; color: var(--text-3); letter-spacing: 0.05em; text-transform: uppercase; }

/* Tips */
.tip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.tip-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.tip-icon {
  flex: none;
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--r-s);
  background: var(--gold-soft);
  color: var(--gold-2);
  font-size: 15px;
}
.tip-label { font-weight: 600; color: var(--text); font-size: 14px; }
.tip-list { padding-left: 20px; color: var(--text-2); font-size: 13.5px; }
.tip-list li { margin: 5px 0; }

/* Spell category tabs */
.spell-category-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.spell-cat-btn {
  padding: 5px 13px;
  border-radius: 100px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  transition: all 0.15s;
}
.spell-cat-btn:hover { border-color: var(--line-strong); color: var(--text); }
.spell-cat-btn.active, .spell-cat-btn[aria-pressed="true"] {
  background: var(--gold);
  border-color: var(--gold);
  color: #1c1508;
}
.spell-type-tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
}
.spell-type-tag.aggressive { color: #e8968a; background: rgba(208, 95, 78, 0.12); }
.spell-type-tag.defensive { color: #9fc3e8; background: rgba(111, 159, 216, 0.12); }
.spell-words, .spell-words-cell { font-family: 'Cascadia Code', Consolas, monospace; color: var(--gold-2); font-size: 12.5px; }
.spell-name-cell { font-weight: 600; color: var(--text); }
.spell-item-label { font-size: 11px; color: var(--text-3); }
.monster-name-cell { font-weight: 600; }
.monster-race { font-size: 12px; color: var(--text-3); }
.monster-spawns-section { margin-top: 8px; }
.zone-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  background: var(--panel-inset);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 11px;
  margin: 2px 3px 2px 0;
}

/* Boss / crafting / gathering detail bits */
.boss-kind-badge, .badge-gear, .item-tier, .craft-tier, .craft-difficulty {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--panel-inset);
  color: var(--text-2);
}
.craft-difficulty.easy { color: var(--green); }
.craft-difficulty.medium { color: var(--orange); }
.craft-difficulty.hard { color: var(--red); }
.craft-gold, .craft-material, .gather-mat { font-variant-numeric: tabular-nums; }
.boss-countdown, .countdown-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--gold-2);
}
.boss-lore-conn { color: var(--text-3); font-size: 12px; }
.achievement-info { min-width: 0; }
.chronicle-when { color: var(--text-3); font-size: 12.5px; }
.pulse-ward { border-left: 3px solid var(--violet); padding-left: 12px; }
/* 46.1 community world goals: progress bars on /pulse event cards */
.pulse-goals { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.pulse-goal-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.pulse-goal-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line-strong); overflow: hidden; }
.pulse-goal-fill { height: 100%; background: linear-gradient(90deg, var(--gold-2), #d9b45a); transition: width 0.3s; }
.quest-spoiler { border: 1px dashed var(--line-strong); border-radius: var(--r-m); padding: 12px 16px; margin: 10px 0; }
.quest-chest-entry, .quest-chests-section { font-size: 13.5px; }
.form-error { color: #e8968a; font-size: 13px; margin-top: 6px; }
.fav-add, .fav-remove { cursor: pointer; }
.tz-label { color: var(--text-3); font-size: 11px; }
.walk-anim { image-rendering: pixelated; }
.killer-cell { min-width: 140px; }
.col-sprite { width: 44px; text-align: center; }
.col-sprite img, .killer-sprite img, .monster-item-sprite img,
.spell-item-sprite img, .craft-mat-sprite img, .gather-node-sprite img,
.gather-tool-sprite img, .gather-mat-sprite img, .loot-sprite img,
.boss-loot-sprite img, .craft-card-sprite img, .boosted-sprite {
  width: 32px; height: 32px;
  object-fit: contain;
  image-rendering: pixelated;
}
.item-row { transition: background 0.12s; }
.item-row:hover { background: rgba(212, 169, 79, 0.05); }
.opt-select { width: auto; min-width: 140px; }
.highscore-table { margin-top: 8px; }
.portal-page, .wiki-page { max-width: 860px; margin: 0 auto; }

/* Search results page */
.search-section { margin-bottom: 24px; }
.search-result {
  display: block;
  padding: 10px 14px;
  border-radius: var(--r-m);
  border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s;
}
.search-result:hover { background: var(--panel); border-color: var(--line); }

/* Language switch links (footer/drawer) */
.lang-switch { display: inline-flex; gap: 4px; }
.lang-link {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-3);
  padding: 3px 7px;
  border-radius: 4px;
}
.lang-link:hover { color: var(--text); }
.lang-link.active { color: var(--gold-2); background: var(--gold-soft); }

/* Scrollbars */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--panel-2);
  border: 3px solid var(--bg);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover { background: var(--gold-deep); }

/* Focus visibility — a11y */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}
.primary-nav > a:focus-visible, .nav-drop-btn:focus-visible,
.nav-menu a:focus-visible, .icon-btn:focus-visible { outline-offset: -2px; }

/* ══════════════════════════════════════════════════════════════
   Responsive
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .primary-nav, .nav-search, .nav-actions .lang-switch { display: none; }
  #navBurger { display: flex; }
  .nav-inner { gap: 10px; }
}
@media (min-width: 1101px) {
  .nav-drawer { display: none; }
}
@media (max-width: 900px) {
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
  .bento-tile, .bento-tile-large, .bento-tile-wide, .bento-tile-tall {
    grid-column: span 2;
    grid-row: auto;
  }
  .foot-inner { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 640px) {
  .page { padding-left: 14px; padding-right: 14px; }
  .online-pill .online-pill-text { display: none; }
  .acct-chip .acct-name { display: none; }
  .activity-ticker { display: none; }
  .site-foot { padding-bottom: 0; }
  .bento-grid { grid-template-columns: 1fr; }
  .bento-tile, .bento-tile-large, .bento-tile-wide, .bento-tile-tall { grid-column: span 1; }
}

/* ===== Portal art slots (P0) =============================================
   Shared presentation for PixelLab-generated portal art. Slots without a
   packaged asset render as a neutral inset box (see templates/_macros.html),
   so a page can land before its art batch is approved. */
.art { display:block; max-width:100%; height:auto; }
.art.pixel, .pixel { image-rendering: pixelated; image-rendering: crisp-edges; }
.art-slot {
  display:block; width:100%;
  border:1px dashed rgba(212,169,79,.28);
  border-radius:8px;
  background:
    linear-gradient(180deg, rgba(16,20,28,.85), rgba(11,13,18,.95)),
    radial-gradient(ellipse at 50% 0%, rgba(212,169,79,.10), transparent 70%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
}
.art-frame {
  display:inline-flex; align-items:center; justify-content:center;
  padding:4px;
  border:1px solid rgba(212,169,79,.35);
  border-radius:8px;
  background:linear-gradient(180deg, rgba(20,25,34,.9), rgba(12,15,22,.95));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03), 0 1px 0 rgba(212,169,79,.08);
}
.art-hero { width:100%; border-radius:14px; box-shadow: 0 18px 50px rgba(0,0,0,.45); }
.art-band { width:100%; border-radius:12px; }
.art-tile { width:100%; border-radius:10px; }
.art-crest { width:100%; max-width:96px; border-radius:50%; }

/* Day theme: generated art is dark; lift it slightly on the parchment
   theme so it does not read as a black hole. */
body.theme-day .art-hero,
body.theme-day .art-band { box-shadow: 0 12px 30px rgba(60,45,20,.18); }
body.theme-day .art-slot { border-color: rgba(143,106,36,.3); }


/* ===== Crest art (portal P2) ========================================== */
.town-crest {
  float: right; width: 72px; height: 72px; margin: 0 0 8px 14px;
  image-rendering: pixelated;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.45));
}
.faction-crest {
  float: left; width: 52px; height: 52px; margin: 0 12px 6px 0;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.45));
}


/* ===== P3 page art ==================================================== */
.auth-art { float: right; width: 220px; margin: 0 0 18px 22px; }
.auth-art .art-panel { width: 100%; height: auto; border-radius: 12px; }
.platform-row { display: flex; gap: 14px; margin: 6px 0 18px; }
.platform-tile { width: 88px; height: 88px; image-rendering: pixelated; }
.news-thumb {
  float: left; width: 64px; height: 64px; margin: 0 14px 8px 0;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.45));
}
.wiki-hub-art { width: 72px; height: 72px; image-rendering: pixelated; }


/* ===== Error pages (portal P3) ======================================== */
.error-page { max-width: 620px; margin: 34px auto 60px; text-align: center; }
.error-art {
  width: 100%; max-width: 420px; margin: 0 auto 20px;
  border-radius: 14px; image-rendering: pixelated;
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
}
.error-page h1 { font-family: Georgia, serif; color: var(--gold-2); letter-spacing: .06em; }
.error-page .btn { display: inline-block; margin-top: 8px; }


/* Landing villain portraits (portal P1). */
.j-villain-art { width: 84px; height: 84px; image-rendering: pixelated; }


/* ===== Per-page header art (P4) ====================================== */
.wiki-page-art { margin: 6px 0 12px; }
.wiki-page-tile {
  width: 64px; height: 64px; image-rendering: pixelated;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.45));
}
