/* ==========================================================================
   MWRO • template skin
   Port of the "saas-landing" design system onto the game site: warm near-black
   surfaces, ember accents, Google Sans type scale, squircle radii and the
   inset "depth" edge instead of painted borders. Loaded last from
   includes/theme_assets.php so every page inherits it.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Template palette */
  --tw-bg: #0b0908;
  --tw-surface: #121010;
  --tw-surface-2: #191514;
  --tw-raised: #211b19;
  --tw-line: rgb(255 236 224 / 0.08);
  --tw-line-strong: rgb(255 236 224 / 0.14);
  --tw-fg: #f3ede8;
  --tw-muted: #a89e97;
  --tw-faint: #746a64;
  --tw-accent: #ff7a45;
  --tw-accent-2: #ffb547;
  --tw-accent-3: #ff4d6d;

  /* Template radii */
  --tw-r-sm: 14px;
  --tw-r-md: 16px;
  --tw-r-lg: 18px;
  --tw-r-xl: 24px;

  --tw-font: 'Google Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --tw-glow: 0 30px 80px -20px rgb(0 0 0 / 0.7);
  --tw-depth: inset 0 0 0 1px var(--tw-line-strong), inset 0 2px 0 rgb(255 255 255 / 0.1);

  /* Re-point the site's own tokens so legacy components inherit the skin */
  --realm-bg: var(--tw-bg);
  --realm-panel: var(--tw-surface);
  --realm-line: var(--tw-line-strong);
  --realm-gold: var(--tw-accent-2);
  --realm-ink: var(--tw-fg);
  --realm-muted: var(--tw-muted);
  --mw-gold: var(--tw-accent-2);
  --mw-gold-dim: #d99a3f;
  --mw-orange: var(--tw-accent);
  --mw-bronze: #8a6a4a;
  --mw-charcoal: var(--tw-surface-2);
  --mw-bg: var(--tw-bg);
  --mw-bg-panel: var(--tw-surface);
  --mw-panel: rgb(18 16 16 / 0.96);
  --mw-border: var(--tw-line-strong);
  --mw-border-soft: var(--tw-line);
  --mw-text: var(--tw-fg);
  --mw-text-bright: var(--tw-fg);
  --mw-muted: var(--tw-muted);
  --mw-sun: var(--tw-accent-2);
  --bs-body-bg: var(--tw-bg);
  --bs-body-color: var(--tw-fg);
  --bs-border-color: var(--tw-line-strong);
  --bs-secondary-color: var(--tw-muted);
  --bs-tertiary-bg: var(--tw-surface-2);
  --bs-link-color: var(--tw-accent-2);
  --bs-link-hover-color: #ffd8a1;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

html {
  background-color: var(--tw-bg) !important;
  scroll-behavior: smooth;
  scroll-padding-top: 96px !important;
  -webkit-text-size-adjust: 100%;
}

html body,
html body.mw-scene,
html body.guide-page {
  margin: 0 !important;
  background-color: var(--tw-bg) !important;
  color: var(--tw-fg) !important;
  font-family: var(--tw-font) !important;
  font-size: 15px !important;
  line-height: 1.65 !important;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

/* Ember field behind the page, replacing the cartoon sky photograph. */
html body:before {
  content: '' !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: -2 !important;
  pointer-events: none !important;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgb(255 122 69 / 0.16), transparent 70%),
    radial-gradient(ellipse 60% 50% at 12% 8%, rgb(255 77 109 / 0.10), transparent 70%),
    radial-gradient(ellipse 60% 55% at 88% 4%, rgb(255 181 71 / 0.10), transparent 70%),
    linear-gradient(180deg, #100c0a 0%, var(--tw-bg) 55%, #080606 100%) !important;
  filter: none !important;
}

html body:after {
  content: '' !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: -1 !important;
  pointer-events: none !important;
  opacity: 0.5;
  background-image:
    linear-gradient(to right, rgb(255 236 224 / 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(255 236 224 / 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 25%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 25%, transparent 100%);
}

::selection {
  background: rgb(255 122 69 / 0.35) !important;
  color: #fff !important;
}

:focus-visible {
  outline: 2px solid rgb(255 122 69 / 0.7) !important;
  outline-offset: 2px !important;
}

* {
  border-color: var(--tw-line);
}

*,
*::before,
*::after {
  corner-shape: squircle;
}

/* Page-level decorative layers from the old theme stay out of the way. */
html body :is(.news-bg, .wiki-bg, .ranking-bg, .quest-bg, .pet-bg, .page-bg, .realm-world) {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */

html body h1,
html body h2,
html body h3,
html body h4,
html body h5,
html body h6,
html body .cloud-text,
html body :is(.guide-title, .wrapper-title-plate, .section-title) {
  font-family: var(--tw-font) !important;
  font-weight: 600 !important;
  color: var(--tw-fg) !important;
  letter-spacing: -0.025em !important;
  line-height: 1.12 !important;
  text-transform: none !important;
  text-shadow: none !important;
}

html body h1,
html body .cloud-text,
html body .section-title { font-size: clamp(32px, 4vw, 46px) !important; }
html body h2 { font-size: clamp(26px, 3vw, 34px) !important; }
html body h3 { font-size: 22px !important; }
html body h4 { font-size: 18px !important; }
html body h5 { font-size: 16px !important; }
html body h6 { font-size: 14px !important; }

html body p,
html body li,
html body dd,
html body td,
html body .lead {
  color: var(--tw-muted) !important;
  font-family: var(--tw-font) !important;
}

html body :is(p, li, td) :is(strong, b, em) { color: var(--tw-fg); }

html body a {
  color: var(--tw-accent-2) !important;
  text-decoration: none;
  transition: color 0.2s ease;
}
html body a:hover { color: #ffd8a1 !important; }

html body :is(small, .text-muted, .text-secondary, .muted, .wiki-muted) {
  color: var(--tw-muted) !important;
}

html body hr {
  border: 0 !important;
  border-top: 1px solid var(--tw-line) !important;
  opacity: 1;
}

html body code,
html body pre,
html body kbd,
html body samp {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  background: var(--tw-surface-2) !important;
  border: 1px solid var(--tw-line) !important;
  border-radius: 10px !important;
  color: #ffd2bd !important;
}
html body pre { padding: 16px 18px !important; overflow: auto; }
html body code { padding: 2px 6px !important; }

/* --------------------------------------------------------------------------
   Layout rhythm
   -------------------------------------------------------------------------- */

html body .mw-shell { width: min(1120px, calc(100% - 40px)) !important; }

html body .mw-section {
  padding: 72px 0 !important;
  position: relative;
}
html body .mw-section:nth-of-type(2n + 1) {
  background: linear-gradient(90deg, transparent, rgb(255 236 224 / 0.02), transparent) !important;
}
html body .mw-section-tight { padding: 52px 0 80px !important; }

html body :is(.page-content, .page-shell, .guide-shell, .pet-shell, .ranking-shell, .wiki-shell) {
  position: relative;
  z-index: 1;
}

html body > .container,
html body > .container-fluid {
  position: relative;
  z-index: 1;
  margin-top: 48px;
  margin-bottom: 64px;
}

/* --------------------------------------------------------------------------
   Top bar — floating pill, template Nav treatment
   -------------------------------------------------------------------------- */

html body .mw-topbar {
  position: sticky !important;
  top: 14px !important;
  height: 64px !important;
  width: min(1120px, calc(100% - 32px)) !important;
  margin: 14px auto 0 !important;
  padding: 0 8px 0 16px !important;
  gap: 14px !important;
  border: 0 !important;
  border-radius: var(--tw-r-lg) !important;
  background: rgb(11 9 8 / 0.72) !important;
  box-shadow: var(--tw-depth), 0 10px 40px -20px rgb(0 0 0 / 0.8) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  z-index: 1100;
}

html body .realm-brand { width: auto !important; gap: 2px; }
html body .realm-brand img { width: auto !important; height: 38px !important; }
html body .realm-brand .realm-brand-two { height: 26px !important; }

html body .mw-topnav { gap: 2px !important; }

html body .realm-menu-trigger,
html body .mw-topnav > li > a {
  display: inline-flex !important;
  align-items: center !important;
  height: 36px !important;
  padding: 0 12px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: transparent !important;
  color: var(--tw-muted) !important;
  font-family: var(--tw-font) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  transition: background-color 0.2s ease, color 0.2s ease !important;
}
html body .realm-menu-trigger:hover,
html body .mw-topnav > li:hover > .realm-menu-trigger,
html body .mw-topnav > li.is-active > .realm-menu-trigger,
html body .mw-topnav > li > a:hover {
  background: rgb(255 255 255 / 0.06) !important;
  color: var(--tw-fg) !important;
}

html body .mw-topnav > li.is-active:after { display: none !important; }

html body .mw-submenu {
  margin-top: 8px !important;
  padding: 6px !important;
  min-width: 214px !important;
  border: 0 !important;
  border-radius: var(--tw-r-md) !important;
  background: rgb(18 16 16 / 0.98) !important;
  box-shadow: var(--tw-depth), var(--tw-glow) !important;
  backdrop-filter: blur(20px);
}
html body .mw-submenu a {
  display: flex !important;
  align-items: center;
  gap: 8px;
  height: 38px !important;
  padding: 0 10px !important;
  border-radius: 10px !important;
  color: var(--tw-muted) !important;
  font-size: 14px !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
html body .mw-submenu a:hover {
  background: rgb(255 255 255 / 0.06) !important;
  color: var(--tw-fg) !important;
}

html body .mw-topbar-tools { gap: 6px !important; }

html body .mw-topbar-tools :is(button, .mw-lang-btn) {
  height: 36px !important;
  min-width: 36px !important;
  padding: 0 10px !important;
  border: 1px solid var(--tw-line-strong) !important;
  border-radius: 12px !important;
  background: rgb(255 255 255 / 0.04) !important;
  color: var(--tw-muted) !important;
  font-size: 12px !important;
  box-shadow: none !important;
}
html body .mw-topbar-tools :is(button, .mw-lang-btn):hover {
  background: rgb(255 255 255 / 0.08) !important;
  color: var(--tw-fg) !important;
}

html body .mw-discord-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  height: 36px !important;
  padding: 0 12px !important;
  border: 1px solid var(--tw-line-strong) !important;
  border-radius: 12px !important;
  background: rgb(255 255 255 / 0.04) !important;
  color: var(--tw-muted) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  box-shadow: none !important;
}
html body .mw-discord-btn:hover {
  background: rgb(255 255 255 / 0.08) !important;
  color: var(--tw-fg) !important;
}

html body .realm-nav-play {
  height: 36px !important;
  min-height: 0 !important;
  padding: 0 16px !important;
  border-radius: 12px !important;
  font-size: 13px !important;
  letter-spacing: 0 !important;
}

html body .mw-burger {
  border-radius: 12px !important;
  color: var(--tw-fg) !important;
}
html body .mw-burger span { background: currentColor !important; }

/* Member navigation pill row */
html body .realm-member-nav { border: 0 !important; background: transparent !important; }
html body .realm-member-nav a {
  border: 1px solid var(--tw-line) !important;
  border-radius: 14px !important;
  background: rgb(255 255 255 / 0.03) !important;
  color: var(--tw-muted) !important;
  font-size: 13px !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  box-shadow: none !important;
}
html body .realm-member-nav a.is-current,
html body .realm-member-nav a:hover {
  border-color: rgb(255 236 224 / 0.22) !important;
  background: rgb(255 255 255 / 0.07) !important;
  color: var(--tw-fg) !important;
}
html body .realm-member-nav img { filter: none; opacity: 0.9; }

/* --------------------------------------------------------------------------
   Page hero bands
   -------------------------------------------------------------------------- */

html body :is(.hero, .mw-hero, .page-hero, .ranking-hero, .wiki-hero, .pet-hero,
  .rank-hero, .donate-hero, .guide-hero, .news-page-hero, .event-hero,
  body > section.hero) {
  position: relative;
  margin: 0 0 32px !important;
  padding: 64px 20px 48px !important;
  text-align: center;
  border: 0 !important;
  border-bottom: 1px solid var(--tw-line) !important;
  background:
    radial-gradient(ellipse 70% 90% at 50% 0%, rgb(255 122 69 / 0.14), transparent 70%) !important;
  box-shadow: none !important;
  min-height: 0 !important;
}
html body .mw-hero { min-height: 0 !important; }

html body :is(.hero, .mw-hero, .page-hero, .ranking-hero, .wiki-hero, .pet-hero,
  .rank-hero, .donate-hero, .guide-hero, .news-page-hero, .event-hero)::after {
  display: none !important;
}

html body :is(.hero, .page-hero, .ranking-hero, .wiki-hero, .pet-hero, .rank-hero,
  .donate-hero, .guide-hero, .news-page-hero) h1 {
  font-size: clamp(30px, 3.6vw, 44px) !important;
  letter-spacing: -0.03em !important;
  margin-inline: auto;
}

html body :is(.hero, .page-hero, .ranking-hero, .wiki-hero, .pet-hero, .rank-hero,
  .donate-hero, .guide-hero, .news-page-hero) p {
  max-width: 680px;
  margin-inline: auto;
  font-size: 16px !important;
  line-height: 1.7 !important;
  color: var(--tw-muted) !important;
}

/* Hero icon plates from the old theme are replaced by a quiet accent eyebrow. */
html body :is(.hero, .page-hero, .ranking-hero, .wiki-hero, .pet-hero, .rank-hero,
  .donate-hero, .guide-hero, .news-page-hero) h1::before {
  width: 72px !important;
  height: 72px !important;
  margin: 0 auto 18px !important;
  opacity: 0.85;
  filter: drop-shadow(0 12px 24px rgb(0 0 0 / 0.6)) !important;
}

html body .mw-flourish {
  gap: 10px !important;
  margin-top: 18px !important;
}
html body .mw-flourish:before,
html body .mw-flourish:after {
  background: linear-gradient(90deg, transparent, var(--tw-line-strong)) !important;
  height: 1px !important;
}
html body .mw-flourish i {
  background: var(--tw-accent) !important;
  transform: rotate(45deg) !important;
  opacity: 0.8;
}

html body :is(.section-divider, .guide-divider) {
  width: 64px !important;
  max-width: 64px !important;
  height: 1px !important;
  margin: 22px auto !important;
  background: linear-gradient(90deg, transparent, var(--tw-accent), transparent) !important;
  box-shadow: none !important;
}

html body .realm-eyebrow {
  color: var(--tw-accent) !important;
  font-family: var(--tw-font) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  letter-spacing: 0.18em !important;
}
html body .realm-eyebrow span { background: linear-gradient(90deg, transparent, var(--tw-line-strong)) !important; }

html body :is(.mw-head, .section-head) h2 { margin: 0 !important; }
html body :is(.mw-head, .section-head) p { margin-top: 16px !important; font-size: 16px !important; }

/* --------------------------------------------------------------------------
   Surfaces
   -------------------------------------------------------------------------- */

html body :is(
  .card, .card-body, .mw-news-card, .mw-action, .mw-media-card, .mw-champ-row,
  .mw-guide-step, .mw-perk, .mw-clip, .mw-gallery, .mw-tab, .mw-join,
  .realm-gateway, .wiki-card, .wiki-section, .quest-card, .quest-chain,
  .news-card, .news-featured, .news-grid-card, .pet-card, .card-pet,
  .pet-summary, .pet-toolbar, .ranking-table-wrap, .prize-card, .stat-card,
  .score-panel, .filter-bar, .panel, .summary-card, .score-stat,
  .ranking-card, .rank-card, .rank-card, .guide-card, .guide-search,
  .retro-card, .npc-card, .mall-card, .char-card, .section-card, .map-card,
  .setup-card, .weather-card, .beta-card, .leader-frame, .info-box,
  .event-banner, .ranking-event-banner, .event-section, .spring-section,
  .spring-round, .event-card, .reborn-route, .reborn-card, .wiki-sidebar,
  .wiki-toc, .eg-card, .eg-intro, .eg-summary, .eg-panel, .eg-toc, .eg-event,
  .closed-card, .summary-card, .modal-content, .dropdown-menu, .list-group-item,
  .accordion-item, .toast, .offcanvas, .ng-callout, .rule-chip
) {
  background: linear-gradient(160deg, var(--tw-surface-2), var(--tw-surface)) !important;
  border: 1px solid var(--tw-line) !important;
  border-radius: var(--tw-r-xl) !important;
  box-shadow: none !important;
  color: var(--tw-fg) !important;
}

/* The template's inset depth edge on the main surface groups. */
html body :is(
  .card, .mw-news-card, .mw-action, .mw-media-card, .mw-guide-step, .mw-perk,
  .realm-gateway, .wiki-card, .quest-card, .news-card, .news-featured,
  .news-grid-card, .pet-card, .card-pet, .prize-card, .stat-card, .score-panel,
  .filter-bar, .panel, .summary-card, .guide-card, .retro-card, .npc-card,
  .mall-card, .char-card, .section-card, .map-card, .setup-card, .weather-card,
  .event-card, .reborn-route, .wiki-sidebar, .eg-card, .eg-panel, .closed-card
) {
  position: relative;
}
html body :is(
  .card, .mw-news-card, .mw-action, .mw-media-card, .mw-guide-step, .mw-perk,
  .realm-gateway, .wiki-card, .quest-card, .news-card, .news-featured,
  .news-grid-card, .pet-card, .card-pet, .prize-card, .stat-card, .score-panel,
  .filter-bar, .panel, .summary-card, .guide-card, .retro-card, .npc-card,
  .mall-card, .char-card, .section-card, .map-card, .setup-card, .weather-card,
  .event-card, .reborn-route, .wiki-sidebar, .eg-card, .eg-panel, .closed-card
)::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--tw-line-strong), inset 0 2px 0 rgb(255 255 255 / 0.06);
}

/* Drop the old inventory-slot / gold picture frames. */
html body [data-realm-public] :is(.retro-card, .prize-card, .wiki-card, .quest-card, .card-pet, .reborn-route, .pet-toolbar)::after {
  display: none !important;
}

html body :is(.card-header, .card-footer, .modal-header, .modal-footer, .panel-head, .panel-footer) {
  background: transparent !important;
  border-color: var(--tw-line) !important;
  color: var(--tw-fg) !important;
}

html body :is(.card-title, .modal-title, .panel-title) { color: var(--tw-fg) !important; }

html body :is(.mw-media-stage, .pet-stage, .mw-gallery, .game-frame, .clip-media, .mw-clip-media) {
  background: radial-gradient(ellipse at center, rgb(255 122 69 / 0.12), transparent 65%), var(--tw-bg) !important;
  border-color: var(--tw-line) !important;
}

html body .mw-news-card { padding: 24px !important; }
html body .mw-news-card:hover,
html body :is(.card-pet, .wiki-card, .quest-card, .news-card, .pet-card):hover {
  border-color: var(--tw-line-strong) !important;
  transform: translateY(-2px);
  box-shadow: 0 24px 60px -30px rgb(0 0 0 / 0.9) !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease !important;
}

html body .realm-gateway {
  margin: 0 0 40px !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border-radius: var(--tw-r-xl) !important;
}
html body .realm-gateway::before,
html body .realm-gateway::after { display: none !important; }
html body .realm-gateway > a {
  padding: 20px !important;
  border-right: 1px solid var(--tw-line) !important;
  color: var(--tw-fg) !important;
  background: transparent !important;
}
html body .realm-gateway > a:hover { background: rgb(255 255 255 / 0.05) !important; }
html body .realm-gateway small {
  color: var(--tw-faint) !important;
  font-family: var(--tw-font) !important;
  font-size: 10px !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
}
html body .realm-gateway b { color: var(--tw-fg) !important; font-weight: 500 !important; }
html body .realm-gateway i { color: var(--tw-accent-2) !important; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

html body :is(.btn, .btn-custom, .action-btn, .tile-btn, .filter-tab, .new-board-btn,
  .submit-score-btn, .claim-prize-btn, .btn-outline-custom, .btn-outline-warning,
  .btn-gold, .pet-anim-btn, .pet-dir-btn, .pet-play-btn, button.btn) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px !important;
  padding: 0 20px !important;
  border: 1px solid var(--tw-line-strong) !important;
  border-radius: var(--tw-r-sm) !important;
  background: rgb(255 255 255 / 0.04) !important;
  color: var(--tw-fg) !important;
  font-family: var(--tw-font) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  text-shadow: none !important;
  box-shadow: none !important;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease !important;
}
html body :is(.btn, .btn-custom, .action-btn, .tile-btn, .filter-tab, .new-board-btn,
  .submit-score-btn, .claim-prize-btn, .btn-outline-custom, .btn-outline-warning,
  .btn-gold, .pet-anim-btn, .pet-dir-btn, .pet-play-btn):hover {
  background: rgb(255 255 255 / 0.08) !important;
  border-color: rgb(255 236 224 / 0.24) !important;
  color: #fff !important;
  transform: none !important;
}
html body :is(.btn, .btn-custom, .btn-gold, .action-btn):active { transform: scale(0.985) !important; }

/* Primary: light on dark, as in the template. */
html body :is(.btn-gold, .btn-primary, .btn-warning, .btn-custom, .btn-success,
  .new-board-btn, .submit-score-btn, .claim-prize-btn, .btn-lg.btn-gold) {
  background: var(--tw-fg) !important;
  border-color: transparent !important;
  color: var(--tw-bg) !important;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.6), 0 8px 24px -12px rgb(255 255 255 / 0.4) !important;
}
html body :is(.btn-gold, .btn-primary, .btn-warning, .btn-custom, .btn-success,
  .new-board-btn, .submit-score-btn, .claim-prize-btn):hover {
  background: #fff !important;
  color: var(--tw-bg) !important;
}

html body :is(.btn-secondary, .btn-outline-secondary, .btn-outline-light, .btn-dark) {
  background: rgb(255 255 255 / 0.04) !important;
  border-color: var(--tw-line-strong) !important;
  color: var(--tw-fg) !important;
}

html body :is(.btn-danger, .btn-outline-danger) {
  background: rgb(255 77 109 / 0.12) !important;
  border-color: rgb(255 77 109 / 0.4) !important;
  color: #ffb3c1 !important;
}
html body .btn-danger:hover { background: rgb(255 77 109 / 0.2) !important; color: #fff !important; }

html body .btn-link {
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
  color: var(--tw-accent-2) !important;
}

html body .btn-lg { min-height: 52px !important; padding: 0 26px !important; font-size: 15px !important; }
html body .btn-sm { min-height: 34px !important; padding: 0 14px !important; font-size: 13px !important; border-radius: 12px !important; }

html body :is(.btn, .action-btn, .tile-btn) svg,
html body :is(.btn, .action-btn, .tile-btn) i[data-lucide] { width: 16px !important; height: 16px !important; }

html body .action-btn.is-active,
html body .tile-btn.is-active,
html body .filter-tab.active,
html body .filter-tab.is-active,
html body :is(.pet-anim-btn, .pet-dir-btn).is-active {
  background: rgb(255 122 69 / 0.16) !important;
  border-color: rgb(255 122 69 / 0.45) !important;
  color: #ffd2bd !important;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

html body :is(.form-control, .form-select, .input-group-text, input[type='text'],
  input[type='email'], input[type='password'], input[type='search'],
  input[type='number'], input[type='tel'], input[type='url'], input[type='date'],
  select, textarea) {
  min-height: 44px !important;
  padding: 10px 14px !important;
  background-color: var(--tw-surface) !important;
  border: 1px solid var(--tw-line-strong) !important;
  border-radius: var(--tw-r-sm) !important;
  color: var(--tw-fg) !important;
  font-family: var(--tw-font) !important;
  font-size: 14px !important;
  box-shadow: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
html body :is(.form-control, .form-select, input, select, textarea):focus {
  background-color: var(--tw-surface-2) !important;
  border-color: rgb(255 122 69 / 0.55) !important;
  box-shadow: 0 0 0 3px rgb(255 122 69 / 0.16) !important;
  color: #fff !important;
  outline: none !important;
}
html body :is(input, textarea)::placeholder { color: var(--tw-faint) !important; }
html body .form-label,
html body label {
  color: var(--tw-muted) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
}
html body .form-text,
html body .field-hint { color: var(--tw-faint) !important; font-size: 12px !important; }
html body .form-check-input {
  background-color: var(--tw-surface) !important;
  border-color: var(--tw-line-strong) !important;
}
html body .form-check-input:checked {
  background-color: var(--tw-accent) !important;
  border-color: var(--tw-accent) !important;
}
html body .input-group-text {
  background: var(--tw-surface-2) !important;
  color: var(--tw-muted) !important;
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

html body :is(.table, .table-dark-custom, .ranking-table, .wiki-table, .ng-table, table) {
  --bs-table-color: var(--tw-fg);
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgb(255 236 224 / 0.03);
  --bs-table-striped-color: var(--tw-fg);
  --bs-table-hover-bg: rgb(255 236 224 / 0.055);
  --bs-table-hover-color: #fff;
  --bs-table-border-color: var(--tw-line);
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--tw-fg) !important;
  font-size: 14px !important;
}

html body :is(.table, .table-dark-custom, .ranking-table, .wiki-table, table) th {
  padding: 12px 16px !important;
  background: var(--tw-surface-2) !important;
  border: 0 !important;
  border-bottom: 1px solid var(--tw-line-strong) !important;
  color: var(--tw-muted) !important;
  font-family: var(--tw-font) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  text-align: left;
  white-space: nowrap;
}

html body :is(.table, .table-dark-custom, .ranking-table, .wiki-table, table) td {
  padding: 13px 16px !important;
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid var(--tw-line) !important;
  color: var(--tw-muted) !important;
  font-family: var(--tw-font) !important;
  font-size: 13px !important;
  vertical-align: middle;
}

html body :is(.table, .table-dark-custom, .ranking-table, .wiki-table, table) tbody tr:nth-child(2n) td {
  background: rgb(255 236 224 / 0.02) !important;
}
html body :is(.table, .table-dark-custom, .ranking-table, .wiki-table, table) tbody tr:hover td {
  background: rgb(255 236 224 / 0.05) !important;
  color: var(--tw-fg) !important;
}
html body :is(.table, .table-dark-custom, .ranking-table, .wiki-table, table) tbody tr:last-child td { border-bottom: 0 !important; }

html body :is(.table-responsive, .ranking-table-wrap, .wiki-table-wrap, .ng-table, .eg-table-wrap) {
  border: 1px solid var(--tw-line) !important;
  border-radius: var(--tw-r-lg) !important;
  overflow: auto;
  background: var(--tw-surface) !important;
}

html body :is(.table, .ranking-table, .wiki-table) a { color: var(--tw-fg) !important; font-weight: 500; }
html body :is(.table, .ranking-table, .wiki-table) a:hover { color: var(--tw-accent-2) !important; }

/* --------------------------------------------------------------------------
   Chips, badges, tabs, pagination
   -------------------------------------------------------------------------- */

html body :is(.badge, .pill, .mini-pill, .chip, .tag, .event-chip, .event-pill,
  .quest-meta-pill, .pet-id, .pet-skill-badge, .pet-resist-badge, .quest-level,
  .hero-badge, .showcase-badge, .news-tag, .mw-news-tag, .shortcut-key) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px !important;
  border: 1px solid var(--tw-line-strong) !important;
  border-radius: 999px !important;
  background: rgb(255 255 255 / 0.05) !important;
  color: var(--tw-muted) !important;
  font-family: var(--tw-font) !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  box-shadow: none !important;
  white-space: nowrap;
}

html body :is(.badge-gold, .badge-warning, .is-gold) {
  background: rgb(255 181 71 / 0.14) !important;
  border-color: rgb(255 181 71 / 0.35) !important;
  color: #ffd8a1 !important;
}
html body :is(.badge-danger, .badge-red) {
  background: rgb(255 77 109 / 0.14) !important;
  border-color: rgb(255 77 109 / 0.35) !important;
  color: #ffb3c1 !important;
}

html body .mw-tabs { gap: 6px !important; margin: 22px 0 !important; }
html body .mw-tab {
  padding: 9px 14px !important;
  border: 1px solid var(--tw-line) !important;
  border-radius: 12px !important;
  background: rgb(255 255 255 / 0.03) !important;
  color: var(--tw-muted) !important;
  font-size: 13px !important;
}
html body .mw-tab.active,
html body .mw-tab.is-active {
  background: rgb(255 255 255 / 0.09) !important;
  border-color: var(--tw-line-strong) !important;
  color: var(--tw-fg) !important;
}

html body :is(.nav-tabs, .nav-pills) { border-color: var(--tw-line) !important; gap: 4px; }
html body :is(.nav-tabs, .nav-pills) .nav-link {
  border: 1px solid transparent !important;
  border-radius: 12px !important;
  background: transparent !important;
  color: var(--tw-muted) !important;
  font-size: 14px !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
html body :is(.nav-tabs, .nav-pills) .nav-link.active {
  background: rgb(255 255 255 / 0.08) !important;
  border-color: var(--tw-line-strong) !important;
  color: var(--tw-fg) !important;
}

html body .pagination .page-link {
  min-width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--tw-line) !important;
  border-radius: 12px !important;
  background: rgb(255 255 255 / 0.03) !important;
  color: var(--tw-muted) !important;
  font-size: 13px !important;
  margin: 0 2px;
}
html body .pagination .page-link:hover { background: rgb(255 255 255 / 0.07) !important; color: var(--tw-fg) !important; }
html body .pagination .active .page-link {
  background: var(--tw-fg) !important;
  border-color: transparent !important;
  color: var(--tw-bg) !important;
}

html body :is(.progress, .progress-bar) { border-radius: 999px !important; }
html body .progress {
  height: 8px !important;
  background: rgb(255 236 224 / 0.08) !important;
  border: 0 !important;
}
html body .progress-bar {
  background: linear-gradient(90deg, var(--tw-accent-3), var(--tw-accent), var(--tw-accent-2)) !important;
}

/* --------------------------------------------------------------------------
   Overlays
   -------------------------------------------------------------------------- */

html body .modal-content {
  background: rgb(18 16 16 / 0.98) !important;
  border: 1px solid var(--tw-line-strong) !important;
  border-radius: var(--tw-r-xl) !important;
  box-shadow: var(--tw-glow) !important;
}
html body .modal-header,
html body .modal-footer { border-color: var(--tw-line) !important; }
html body .modal-backdrop { background: #050404 !important; }
html body .modal-backdrop.show { opacity: 0.78 !important; }
html body .btn-close {
  filter: invert(1) grayscale(1) !important;
  opacity: 0.6 !important;
}
html body .btn-close:hover { opacity: 1 !important; }

html body .dropdown-menu {
  padding: 6px !important;
  border: 1px solid var(--tw-line-strong) !important;
  border-radius: var(--tw-r-md) !important;
  background: rgb(18 16 16 / 0.98) !important;
  box-shadow: var(--tw-glow) !important;
}
html body .dropdown-item {
  border-radius: 10px !important;
  color: var(--tw-muted) !important;
  font-size: 14px !important;
}
html body .dropdown-item:hover,
html body .dropdown-item:focus {
  background: rgb(255 255 255 / 0.06) !important;
  color: var(--tw-fg) !important;
}
html body .dropdown-divider { border-color: var(--tw-line) !important; }

html body .alert {
  border: 1px solid var(--tw-line-strong) !important;
  border-radius: var(--tw-r-md) !important;
  background: var(--tw-surface-2) !important;
  color: var(--tw-fg) !important;
  font-size: 14px !important;
}
html body .alert-info { border-color: rgb(255 181 71 / 0.28) !important; }
html body .alert-danger { border-color: rgb(255 77 109 / 0.35) !important; background: rgb(255 77 109 / 0.1) !important; }
html body .alert-success { border-color: rgb(120 200 140 / 0.3) !important; }

html body .tooltip-inner {
  background: var(--tw-raised) !important;
  color: var(--tw-fg) !important;
  border-radius: 10px !important;
  font-size: 12px !important;
}

html body :is(.list-group-item, .accordion-item) {
  border-color: var(--tw-line) !important;
  background: var(--tw-surface) !important;
}
html body .accordion-button {
  background: transparent !important;
  color: var(--tw-fg) !important;
  box-shadow: none !important;
}
html body .accordion-button:not(.collapsed) { color: var(--tw-fg) !important; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

html body .mw-footer {
  margin-top: 64px !important;
  padding: 56px 0 28px !important;
  border-top: 1px solid var(--tw-line) !important;
  background: linear-gradient(180deg, transparent, rgb(255 236 224 / 0.02)) !important;
}

html body .realm-footer-mark {
  color: rgb(255 236 224 / 0.06) !important;
  font-family: var(--tw-font) !important;
  font-weight: 700 !important;
  font-size: 44px !important;
  letter-spacing: 0.28em !important;
  margin-bottom: 40px !important;
}

html body .mw-footer-nav {
  gap: 6px !important;
  font-size: 14px !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
html body .mw-footer-nav a {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--tw-muted) !important;
  font-weight: 500;
}
html body .mw-footer-nav a:hover { background: rgb(255 255 255 / 0.06) !important; color: var(--tw-fg) !important; }
html body .mw-footer-nav li.is-active a { color: var(--tw-fg) !important; background: rgb(255 255 255 / 0.05) !important; }

html body .mw-footer-main { border-color: var(--tw-line) !important; }
html body .mw-footer-main p { color: var(--tw-muted) !important; font-size: 14px !important; line-height: 1.7 !important; }
html body .mw-footer-logo { filter: none; }
html body .mw-footer-legal {
  color: var(--tw-faint) !important;
  font-size: 13px !important;
  letter-spacing: 0 !important;
  border-top: 1px solid var(--tw-line);
  padding-top: 20px !important;
}

html body .mw-lang-menu {
  padding: 6px !important;
  border: 1px solid var(--tw-line-strong) !important;
  border-radius: var(--tw-r-md) !important;
  background: rgb(18 16 16 / 0.98) !important;
  box-shadow: var(--tw-glow) !important;
}
html body .mw-lang-menu a {
  border-radius: 10px !important;
  color: var(--tw-muted) !important;
  font-size: 13px !important;
}
html body .mw-lang-menu a:hover,
html body .mw-lang-menu a.is-current {
  background: rgb(255 255 255 / 0.06) !important;
  color: var(--tw-fg) !important;
}

/* --------------------------------------------------------------------------
   Scrollbars
   -------------------------------------------------------------------------- */

html body,
html body * {
  scrollbar-width: thin;
  scrollbar-color: rgb(255 236 224 / 0.16) transparent;
}
html body ::-webkit-scrollbar { width: 10px; height: 10px; }
html body ::-webkit-scrollbar-track { background: transparent; }
html body ::-webkit-scrollbar-thumb {
  background: rgb(255 236 224 / 0.14);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
html body ::-webkit-scrollbar-thumb:hover { background: rgb(255 236 224 / 0.26); background-clip: content-box; }

/* --------------------------------------------------------------------------
   Home hero
   -------------------------------------------------------------------------- */

/* The painted sky/temple scene is replaced by the ember field behind the page. */
html body .realm-landscape { display: none !important; }

html body .mw-hero {
  padding-top: 8px !important;
  background: transparent !important;
  border-bottom: 0 !important;
}

html body .mw-hero .realm-hero-inner {
  padding: 56px 0 40px !important;
  max-width: 760px;
}

html body .mw-hero .realm-eyebrow {
  justify-content: center !important;
  color: var(--tw-accent) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  letter-spacing: 0.2em !important;
  text-transform: uppercase !important;
  margin-bottom: 8px;
}

html body .realm-logo { margin: 0 auto 12px !important; }
html body .realm-logo :is(.realm-logo-ring, .realm-logo-runes) {
  opacity: 0.16 !important;
  filter: grayscale(1) brightness(1.4) !important;
}
html body .realm-logo .realm-logo-glow { opacity: 0.35 !important; }

html body .mw-hero-copy { max-width: 680px; margin: 0 auto; }

html body .mw-hero-title {
  font-size: clamp(34px, 5vw, 58px) !important;
  font-weight: 600 !important;
  letter-spacing: -0.035em !important;
  line-height: 1.05 !important;
  margin: 0 auto 18px !important;
  max-width: 20ch;
  background: linear-gradient(100deg, #ffffff 0%, #ffd2bd 40%, #ffb547 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
}

html body .mw-hero-lead {
  font-size: 17px !important;
  line-height: 1.7 !important;
  max-width: 560px !important;
  margin: 0 auto 26px !important;
  color: var(--tw-muted) !important;
}

html body .mw-hero-row {
  justify-content: center !important;
  gap: 10px !important;
  margin-bottom: 26px !important;
}

html body .mw-hero-status {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  padding: 7px 14px !important;
  border: 1px solid var(--tw-line-strong) !important;
  border-radius: 999px !important;
  background: rgb(255 255 255 / 0.04) !important;
  color: var(--tw-muted) !important;
  font-family: var(--tw-font) !important;
  font-size: 12px !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
html body .mw-hero-status strong { color: var(--tw-fg) !important; font-weight: 500 !important; }
html body .mw-status-dot {
  width: 7px !important;
  height: 7px !important;
  border-radius: 999px !important;
  background: var(--tw-faint) !important;
  box-shadow: 0 0 0 3px rgb(255 236 224 / 0.06) !important;
}
html body .mw-status-dot.is-online {
  background: #7ddb9a !important;
  box-shadow: 0 0 10px rgb(125 219 154 / 0.7) !important;
}
html body .mw-status-dot.is-offline { background: var(--tw-accent-3) !important; }
html body .realm-live-events { color: var(--tw-faint) !important; font-size: 11px !important; }

html body .realm-scroll {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  margin-top: 34px !important;
  color: var(--tw-faint) !important;
  font-family: var(--tw-font) !important;
  font-size: 12px !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
}
html body .realm-scroll:hover { color: var(--tw-muted) !important; }

/* Alternate copy blocks */
html body :is(.mw-why-copy, .mw-feature-copy, .mw-guild) p { font-size: 15px !important; line-height: 1.8 !important; }
html body .mw-feature-rule { background: linear-gradient(90deg, var(--tw-line-strong), transparent) !important; }
html body .mw-perk b { color: var(--tw-fg) !important; }
html body .mw-step-num {
  border: 1px solid var(--tw-line-strong) !important;
  border-radius: 12px !important;
  background: rgb(255 255 255 / 0.05) !important;
  color: var(--tw-accent-2) !important;
  font-family: var(--tw-font) !important;
  font-weight: 600 !important;
}
html body .mw-step b { color: var(--tw-fg) !important; font-weight: 500 !important; }

html body .mw-join {
  background: radial-gradient(ellipse at center, rgb(255 122 69 / 0.14), transparent 70%), var(--tw-surface) !important;
  border-radius: var(--tw-r-xl) !important;
}

/* --------------------------------------------------------------------------
   Review pass — fixes found on the running homepage
   -------------------------------------------------------------------------- */

/* The quick-nav is also a .mw-shell; the margin shorthand below cancelled
   margin-inline:auto, so the strip sat against the left edge. */
html body .realm-gateway { margin: 0 auto 40px !important; }

/* The spinning rune plate behind the brand mark overflowed the floating pill. */
html body .realm-brand:before { display: none !important; }

/* Centre the link group between the brand and the tools, as in the template. */
html body .mw-topnav { margin-inline: auto !important; }

/* Reclaim the top of the fold so the hero actions sit higher. */
html body .mw-hero .realm-hero-inner { padding: 40px 0 32px !important; }
html body .realm-logo { margin: 0 auto 4px !important; }

/* Serif faces the old theme left on bold labels, rank numbers and captions. */
html body :is(b, strong, .mw-perk b, .mw-action b, .mw-step b, .mw-champ-name,
  .mw-champ-rank, .mw-champ-level, .mw-champ-meta, .realm-gateway b,
  .mw-news-tag, .mw-news-more, .news-date, .news-meta, .pet-skills-label,
  .score-label, .stat-label, .summary-label, .info-label) {
  font-family: var(--tw-font) !important;
  letter-spacing: -0.01em !important;
}

html body .mw-champ-rank {
  color: var(--tw-accent-2) !important;
  font-weight: 600 !important;
}
html body :is(.mw-champ-name, .realm-gateway b) { color: var(--tw-fg) !important; }
html body :is(.mw-champ-meta, .mw-champ-level) { color: var(--tw-muted) !important; }

/* Headline sat flush against the emblem's glow. */
html body .mw-hero-copy { margin-top: 14px !important; }

/* Play control still wore the old navy fill and gold ring. */
html body .mw-media-play {
  width: 66px !important;
  height: 66px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: rgb(243 237 232 / 0.94) !important;
  color: var(--tw-bg) !important;
  box-shadow: 0 12px 32px -8px rgb(0 0 0 / 0.8), inset 0 1px 0 rgb(255 255 255 / 0.7) !important;
  transition: transform 0.2s ease, background-color 0.2s ease !important;
}
html body .mw-media-play:hover {
  background: #fff !important;
  color: var(--tw-bg) !important;
  transform: translate(-50%, -50%) scale(1.06) !important;
}
html body .mw-media-play span,
html body .mw-media-play svg,
html body .mw-media-play i {
  display: grid !important;
  place-items: center !important;
  width: 22px !important;
  height: 22px !important;
  color: inherit !important;
}

/* The clip lightbox close button kept the old cream colour. */
html body .mw-clip-lightbox-close { color: var(--tw-fg) !important; }

/* Two identical primary buttons sat side by side under the clip strip. */
html body .mw-clip-actions .btn + .btn {
  background: rgb(255 255 255 / 0.04) !important;
  border: 1px solid var(--tw-line-strong) !important;
  color: var(--tw-fg) !important;
  box-shadow: none !important;
}
html body .mw-clip-actions .btn + .btn:hover {
  background: rgb(255 255 255 / 0.08) !important;
  color: #fff !important;
}

/* Trim the dead space the download band left above the footer. */
html body .mw-section-tight { padding: 52px 0 56px !important; }
html body .realm-footer-mark { margin-bottom: 26px !important; }

/* Root scroller kept the old gold thumb; the rule above only reached body. */
html::-webkit-scrollbar,
html body::-webkit-scrollbar { width: 10px; height: 10px; }
html::-webkit-scrollbar-track,
html body::-webkit-scrollbar-track { background: transparent !important; }
html::-webkit-scrollbar-thumb,
html body::-webkit-scrollbar-thumb {
  background: rgb(255 236 224 / 0.14) !important;
  border-radius: 999px !important;
  border: 2px solid transparent !important;
  background-clip: content-box !important;
}
html::-webkit-scrollbar-thumb:hover,
html body::-webkit-scrollbar-thumb:hover { background: rgb(255 236 224 / 0.26) !important; background-clip: content-box !important; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  html body .mw-topbar {
    top: 10px !important;
    height: 60px !important;
    margin-top: 10px !important;
    padding: 0 6px 0 12px !important;
  }
  html body .mw-topnav {
    top: 70px !important;
    border: 1px solid var(--tw-line-strong) !important;
    border-radius: var(--tw-r-lg) !important;
    background: rgb(18 16 16 / 0.98) !important;
    box-shadow: var(--tw-depth), var(--tw-glow) !important;
    padding: 8px !important;
  }
  html body .mw-submenu {
    margin-top: 4px !important;
    background: rgb(255 255 255 / 0.03) !important;
    box-shadow: none !important;
    border-radius: var(--tw-r-sm) !important;
  }
  html body .realm-gateway { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (max-width: 767px) {
  html body .mw-shell { width: calc(100% - 32px) !important; }
  html body .mw-topbar { top: 8px !important; margin-top: 8px !important; }
  html body .realm-brand img { height: 32px !important; }
  html body .realm-nav-play { display: none !important; }

  html body :is(.hero, .mw-hero, .page-hero, .ranking-hero, .wiki-hero, .pet-hero,
    .rank-hero, .donate-hero, .guide-hero, .news-page-hero) {
    padding: 44px 16px 34px !important;
  }
  html body :is(.hero, .page-hero, .ranking-hero, .wiki-hero, .pet-hero) h1::before {
    width: 56px !important;
    height: 56px !important;
  }
  html body .mw-section { padding: 48px 0 !important; }
  html body .realm-gateway { grid-template-columns: 1fr !important; }
  html body .realm-gateway > a { border-right: 0 !important; border-bottom: 1px solid var(--tw-line) !important; }
  html body .realm-footer-mark { font-size: 28px !important; letter-spacing: 0.2em !important; }
  html body .mw-footer-nav { justify-content: center !important; }
}

/* --------------------------------------------------------------------------
   Page scope pass
   realm-public.css and the per-page sheets scope their rules to
   body[data-realm-public=…] (0,2,x–0,3,x), which outranked the base rules
   above. These repeats carry the same attribute plus a class, so the template
   skin wins on wiki, rankings, pets, quests and events. The signed-out pages
   (login, register, news) are covered separately at the end.
   -------------------------------------------------------------------------- */

html body[data-realm-public] :is(
  .retro-card, .prize-card, .wiki-card, .quest-card, .quest-chain, .card-pet,
  .pet-summary, .pet-toolbar, .filter-bar, .wiki-sidebar, .wiki-toc,
  .summary-card, .stat-card, .event-banner, .ranking-event-banner,
  .event-section, .spring-section, .spring-round, .event-card, .reborn-route,
  .reborn-card, .score-panel, .eg-card, .eg-intro, .eg-summary, .eg-panel,
  .eg-toc, .eg-event, .closed-card, .news-featured, .news-card,
  .news-grid-card, .map-card, .guide-card, .info-box, .leader-frame
) {
  background-image: linear-gradient(160deg, var(--tw-surface-2), var(--tw-surface)) !important;
  background-color: transparent !important;
  border: 1px solid var(--tw-line) !important;
  border-radius: var(--tw-r-xl) !important;
  box-shadow: none !important;
  color: var(--tw-fg) !important;
}

html body[data-realm-public] :is(
  .wiki-table, .ranking-table, .table-dark-custom, .ng-table, table
) th {
  background: var(--tw-surface-2) !important;
  border: 0 !important;
  border-bottom: 1px solid var(--tw-line-strong) !important;
  color: var(--tw-muted) !important;
  font-family: var(--tw-font) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.09em !important;
  text-transform: uppercase !important;
}

html body[data-realm-public] :is(
  .wiki-table, .ranking-table, .table-dark-custom, .ng-table, table
) td {
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid var(--tw-line) !important;
  color: var(--tw-muted) !important;
  font-family: var(--tw-font) !important;
  font-size: 13px !important;
}

html body[data-realm-public] :is(
  .wiki-table, .ranking-table, .table-dark-custom, table
) tbody tr:nth-child(2n) td {
  background: rgb(255 236 224 / 0.02) !important;
}

html body[data-realm-public] :is(
  .wiki-table, .ranking-table, .table-dark-custom, table
) tbody tr:hover td {
  background: rgb(255 236 224 / 0.05) !important;
  color: var(--tw-fg) !important;
}

html body[data-realm-public] :is(
  .hero, .ranking-hero, .wiki-hero, .page-hero, .pet-hero, .guide-hero, .rank-hero
) {
  background-image: radial-gradient(ellipse 70% 90% at 50% 0%, rgb(255 122 69 / 0.14), transparent 70%) !important;
  background-color: transparent !important;
  border-bottom: 1px solid var(--tw-line) !important;
  padding: clamp(28px, 4vw, 56px) 20px clamp(24px, 3vw, 38px) !important;
  margin: 0 0 28px !important;
}

html body[data-realm-public] :is(
  .form-control, .form-select
) {
  background-color: var(--tw-surface) !important;
  border-color: var(--tw-line-strong) !important;
  border-radius: var(--tw-r-sm) !important;
  color: var(--tw-fg) !important;
  font-family: var(--tw-font) !important;
  font-size: 14px !important;
  min-height: 44px !important;
  box-shadow: none !important;
}

html body[data-realm-public] :is(
  .quest-meta-pill, .event-pill, .pet-id, .pet-skill-badge, .pet-resist-badge,
  .pill, .mini-pill, .event-chip, .quest-level, .spring-boss-badge, .shortcut-key
) {
  background: rgb(255 255 255 / 0.05) !important;
  border: 1px solid var(--tw-line-strong) !important;
  border-radius: 999px !important;
  color: var(--tw-muted) !important;
  font-family: var(--tw-font) !important;
  box-shadow: none !important;
}

html body[data-realm-public] :is(
  .player-avatar, .pet-img, .quest-npc-img, .quest-map-thumb, .leader-frame
) {
  background-color: var(--tw-surface-2) !important;
  background-image: none !important;
  border: 1px solid var(--tw-line-strong) !important;
  border-radius: var(--tw-r-sm) !important;
  box-shadow: none !important;
}

html body[data-realm-public] :is(
  .wiki-nav a, .filter-tab, .wiki-sidebar a, .eg-toc a, .wiki-toc a
) {
  background: rgb(255 255 255 / 0.03) !important;
  border: 1px solid var(--tw-line) !important;
  border-radius: 12px !important;
  color: var(--tw-muted) !important;
  font-family: var(--tw-font) !important;
  font-size: 13px !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

html body[data-realm-public] :is(
  .wiki-nav a, .filter-tab, .eg-toc a, .wiki-toc a
):is(:hover, .active, .is-active, .is-current) {
  background: rgb(255 122 69 / 0.14) !important;
  border-color: rgb(255 122 69 / 0.4) !important;
  color: #ffd2bd !important;
}

html body[data-realm-public] .filter-tabs {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
}

html body[data-realm-public] :is(
  .wiki-title, .map-name, .map-levels, .quest-meta, .qm-npc, .qm-loc, .qm-lvl,
  .tip-range, .class-role, .race-hometown, .section-title, .player-name,
  .player-reborn, .level-text, .rank-medal, .player-class-badge, .rank-badge,
  .quest-name, .quest-npc-name, .quest-npc-role, .quest-map-name,
  .quest-map-label, .quest-badge, .spring-stage-name, .spring-boss-badge,
  .reborn-step, .event-title, .news-title, .pet-name, .pet-story, .score-title,
  .event-banner-title, .summary-value, .stat-value, .prize-place,
  .leaderboard-name, .player-score
) {
  font-family: var(--tw-font) !important;
  letter-spacing: -0.01em !important;
}

html body[data-realm-public] .wiki-title { color: var(--tw-fg) !important; font-weight: 600 !important; }
html body[data-realm-public] :is(.summary-value, .stat-value, .prize-place, .player-score) {
  color: var(--tw-fg) !important;
  font-weight: 600 !important;
}

/* Hero titles and card headings need one more class to outrank :is(h1, .hero-title). */
html body[data-realm-public] :is(.hero, .wiki-hero, .ranking-hero, .page-hero, .pet-hero)
  :is(h1, .cloud-text, .hero-title) {
  font-family: var(--tw-font) !important;
  font-weight: 600 !important;
  letter-spacing: -0.03em !important;
  color: var(--tw-fg) !important;
  text-shadow: none !important;
  text-transform: none !important;
}

html body[data-realm-public] :is(.card-pet, .wiki-card, .quest-card, .news-card,
  .news-featured, .news-grid-card, .event-card, .eg-card, .prize-card)
  :is(h2, h3, h4, h5, .h5, .card-title) {
  font-family: var(--tw-font) !important;
  font-weight: 600 !important;
  color: var(--tw-fg) !important;
  letter-spacing: -0.02em !important;
}

html body[data-realm-public] :is(.news-body, .wiki-card p, .quest-card p,
  .news-card p, .pet-story, .event-summary, .quest-desc) {
  color: var(--tw-muted) !important;
  font-family: var(--tw-font) !important;
}

/* Skip link kept the old navy plate. */
html body .realm-skip {
  background: var(--tw-raised) !important;
  border: 1px solid var(--tw-line-strong) !important;
  border-radius: 12px !important;
  color: var(--tw-fg) !important;
  font-family: var(--tw-font) !important;
}

/* --------------------------------------------------------------------------
   Signed-out pages: login / register / verify / recovery and news bodies
   -------------------------------------------------------------------------- */

html body :is(.login-card, .register-card, .verify-card, .recovery-card,
  .mfa-card, .maintenance-card, .beta-card, .login-guide, .register-guide) {
  background-image: linear-gradient(160deg, var(--tw-surface-2), var(--tw-surface)) !important;
  background-color: transparent !important;
  border: 1px solid var(--tw-line) !important;
  border-radius: var(--tw-r-xl) !important;
  box-shadow: none !important;
  color: var(--tw-fg) !important;
  font-family: var(--tw-font) !important;
}

html body .login-wrapper,
html body .register-wrapper {
  border: 1px solid var(--tw-line-strong) !important;
  border-radius: var(--tw-r-xl) !important;
  box-shadow: none !important;
  overflow: hidden;
}

html body :is(.login-guide, .register-guide, .guide-title, .guide-steps h6,
  .step-text, .login-card h2, .register-card h2, .page-shell h2,
  .maintenance-card h1) {
  font-family: var(--tw-font) !important;
  letter-spacing: -0.02em !important;
  color: var(--tw-fg) !important;
}

html body :is(.login-guide p, .register-guide p, .step-text p, .guide-steps p) {
  color: var(--tw-muted) !important;
  font-size: 13px !important;
}

html body :is(.mfa-help, .server-tip, .registration-note) {
  background: var(--tw-surface-2) !important;
  border: 1px solid var(--tw-line-strong) !important;
  border-radius: var(--tw-r-sm) !important;
  color: var(--tw-muted) !important;
}

html body :is(.btn-custom, .btn-outline-custom) { font-family: var(--tw-font) !important; }

/* News bodies sat on their own navy plate under the card surface. */
html body :is(.news-card-body, .news-featured-body, .news-cover) {
  background: transparent !important;
}

html body :is(.news-title, .news-body, .news-meta, .news-date, .empty-news) {
  font-family: var(--tw-font) !important;
}

html body :is(.news-card-body h3, .news-featured-body h2, .news-shell h2) {
  font-family: var(--tw-font) !important;
  font-weight: 600 !important;
  color: var(--tw-fg) !important;
  letter-spacing: -0.02em !important;
}

/* --------------------------------------------------------------------------
   Page scope pass II: stragglers found on quests, rankings and members
   -------------------------------------------------------------------------- */

/* Ranking, wiki and quest table wrappers kept the gold 1px frame. */
html body[data-realm-public] :is(.ranking-table-wrap, .wiki-table-wrap,
  .table-responsive, .eg-table-wrap, .ng-table) {
  background: var(--tw-surface) !important;
  border: 1px solid var(--tw-line) !important;
  border-radius: var(--tw-r-lg) !important;
  box-shadow: none !important;
}

html body[data-realm-public] :is(.reborn-title, .text-white-50,
  .spring-total-pill, .spring-round-num, .spring-round-title,
  .spring-round-reward, .ranking-event-title, .spring-banner-title,
  .reborn-step-title, .quest-stage-title) {
  font-family: var(--tw-font) !important;
  letter-spacing: -0.01em !important;
}

html body[data-realm-public] .spring-banner {
  background-image: linear-gradient(150deg, var(--tw-surface-2), var(--tw-surface)) !important;
  border: 1px solid var(--tw-line) !important;
  border-radius: var(--tw-r-lg) !important;
  box-shadow: none !important;
}

/* --------------------------------------------------------------------------
   Authenticated pages (profile, marketplace, bank, wheel)
   realm-members.css scopes to body[data-realm-member]; repeat the skin with
   the same attribute plus a class so the warmer surface wins.
   -------------------------------------------------------------------------- */

html body[data-realm-member] :is(
  .section-card, .market-card, .bank-card, .mall-card, .setup-card,
  .verify-card, .report-card, .panel, .char-selector-wrap, .prize-legend,
  .spins-counter, .result-box, .armory-panel, .builder-menu, .battle-journal,
  .chat-panel, .inventory-panel, .character-panel, .quest-panel
) {
  background-image: linear-gradient(160deg, var(--tw-surface-2), var(--tw-surface)) !important;
  background-color: transparent !important;
  border: 1px solid var(--tw-line) !important;
  border-radius: var(--tw-r-xl) !important;
  box-shadow: none !important;
  color: var(--tw-fg) !important;
}

html body[data-realm-member] :is(
  .section-card, .market-card, .bank-card, .mall-card, .setup-card,
  .report-card, .char-selector-wrap, .prize-legend
)::after {
  display: none !important;
}

html body[data-realm-member] :is(
  .char-card, .listing-card, .milestone-card, .bank-stat, .donation-stats-box,
  .char-option, .char-card-select, .char-card-option, .craft-item,
  .armory-item, .class-card, .hint-box, .locked-panel, .secret-box, .mfa-help
) {
  background-image: none !important;
  background-color: var(--tw-surface-2) !important;
  border: 1px solid var(--tw-line) !important;
  border-radius: var(--tw-r-sm) !important;
  color: var(--tw-muted) !important;
  box-shadow: none !important;
}

html body[data-realm-member] :is(
  .realm-member-hero, .mall-hero, .market-hero, .bank-hero, .wof-header, .hero
) {
  background-image: radial-gradient(ellipse 70% 90% at 50% 0%, rgb(255 122 69 / 0.14), transparent 70%) !important;
  background-color: transparent !important;
  border-bottom: 1px solid var(--tw-line) !important;
  padding: clamp(28px, 4vw, 52px) 20px clamp(22px, 3vw, 34px) !important;
  box-shadow: none !important;
}

html body[data-realm-member] :is(
  .realm-member-hero, .mall-hero, .market-hero, .bank-hero, .wof-header, .hero
) :is(h1, h2) {
  font-family: var(--tw-font) !important;
  font-weight: 600 !important;
  letter-spacing: -0.03em !important;
  color: var(--tw-fg) !important;
  text-shadow: none !important;
}

html body[data-realm-member] :is(
  .profile-username, .char-name, .listing-name, .wrapper-title-plate,
  .section-card .wrapper-title-plate, .char-level, .milestone-amount,
  .listing-price, .im-price-display, .mall-card h3, .mall-card h4,
  .mall-card h5, .setup-card h2, .bank-stat strong
) {
  font-family: var(--tw-font) !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
  color: var(--tw-fg) !important;
  text-shadow: none !important;
}

html body[data-realm-member] .realm-member-nav {
  background: transparent !important;
  border-bottom: 1px solid var(--tw-line) !important;
}

html body[data-realm-member] .realm-member-nav a {
  border: 1px solid var(--tw-line) !important;
  border-radius: 14px !important;
  background: rgb(255 255 255 / 0.03) !important;
  color: var(--tw-muted) !important;
  font-family: var(--tw-font) !important;
  font-size: 13px !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

html body[data-realm-member] .realm-member-nav a.is-current,
html body[data-realm-member] .realm-member-nav a:hover {
  background: rgb(255 255 255 / 0.07) !important;
  border-color: rgb(255 236 224 / 0.22) !important;
  color: var(--tw-fg) !important;
  box-shadow: none !important;
}

html body[data-realm-member] .realm-member-avatar {
  background-image: none !important;
  border-radius: var(--tw-r-sm) !important;
}

html body[data-realm-member] :is(.char-icon, .mall-icon, .listing-icon,
  .result-icon, .quest-npc-img) {
  background-image: none !important;
  background-color: var(--tw-surface-2) !important;
  border-radius: var(--tw-r-sm) !important;
}

html body[data-realm-member] .secret-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
}

/* Home page tab labels (class selector under "About MWRO") were still serif. */
html body :is(.mw-tab, .mw-tabs .mw-tab, .mw-tabs button) {
  font-family: var(--tw-font) !important;
  font-weight: 500 !important;
  letter-spacing: -0.01em !important;
  text-transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
  html body *,
  html body *::before,
  html body *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
