/* Components: buttons, badges, forms, modals, the hero, the realm UI, header brand, footer. */

/* ---------------------------------------------------------------------------
 * Links in copy
 *
 * Anchors are reset to no underline site-wide, so this is the one place an
 * inline action gets its affordance: "View Live Radar →" and "Read Dispatch →"
 * are buttons that open a panel (there is no id to anchor to), and an
 * outbound link — to the studio, or a mod's home — is dotted.
 * ------------------------------------------------------------------------- */
.studio-link { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; transition: color 0.15s ease; }
.studio-link:hover { color: var(--gold-300); }
.site-footer-brand-link { display: inline-flex; align-items: center; color: inherit; text-decoration: none; transition: color 0.15s ease, filter 0.15s ease; }
.site-footer-brand-link:hover { color: var(--gold-300); filter: brightness(1.15); }

.link-inline {
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s ease;
}
.link-inline:hover { color: var(--parch-100); }

/* ---------------------------------------------------------------------------
 * Buttons. Three kinds, named for what they were before the re-theme:
 *   .btn-ember   the primary action — gold leaf pressed into dark wood
 *   .btn-runic   the second — a rune's cold light
 *   .btn-outline the quiet one — leather with a brass rim
 * ------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.58rem 1.2rem;
  border-radius: 3px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter var(--transition-normal), box-shadow var(--transition-normal), transform var(--transition-normal), border-color var(--transition-normal);
  text-decoration: none;
  user-select: none;
  white-space: nowrap;
}

.btn-ember {
  background: linear-gradient(180deg, #f6e4a6 0%, #e3bd52 36%, #b98b2e 64%, #8a6420 100%);
  color: #2b1a06;
  border-color: #3a2610;
  text-shadow: 0 1px 0 rgba(255, 240, 190, 0.6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -2px 0 rgba(90, 60, 15, 0.5),
    0 0 0 1px rgba(232, 194, 90, 0.3),
    0 4px 10px rgba(0, 0, 0, 0.6);
}
.btn-ember:hover {
  filter: brightness(1.1) saturate(1.1);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 -2px 0 rgba(90, 60, 15, 0.5),
    0 0 0 1px rgba(246, 228, 166, 0.55),
    0 0 20px rgba(232, 194, 90, 0.4),
    0 6px 14px rgba(0, 0, 0, 0.6);
}
.btn-ember:active { transform: translateY(1px); filter: brightness(0.95); }

.btn-runic {
  background: linear-gradient(180deg, rgba(76, 201, 224, 0.2), rgba(12, 52, 72, 0.6));
  color: var(--rune-bright);
  border-color: rgba(76, 201, 224, 0.55);
  box-shadow: inset 0 1px 0 rgba(200, 250, 255, 0.22), 0 0 14px rgba(76, 201, 224, 0.18), 0 3px 8px rgba(0, 0, 0, 0.55);
}
.btn-runic:hover {
  color: #fff;
  border-color: var(--rune);
  background: linear-gradient(180deg, rgba(76, 201, 224, 0.32), rgba(12, 70, 96, 0.7));
  box-shadow: inset 0 1px 0 rgba(200, 250, 255, 0.3), 0 0 22px rgba(76, 201, 224, 0.4), 0 3px 8px rgba(0, 0, 0, 0.55);
  transform: translateY(-1px);
}

.btn-outline {
  background: linear-gradient(180deg, #33231a, #1e140d);
  color: var(--text-secondary);
  border-color: #5b4326;
  box-shadow: inset 0 1px 0 rgba(255, 225, 150, 0.1), 0 2px 5px rgba(0, 0, 0, 0.5);
}
.btn-outline:hover {
  color: var(--parch-100);
  border-color: var(--gold-600);
  box-shadow: inset 0 1px 0 rgba(255, 225, 150, 0.18), 0 0 14px rgba(207, 165, 69, 0.2);
  transform: translateY(-1px);
}

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.72rem; }
.btn-md { padding: 0.58rem 1.2rem; }
.btn-lg { padding: 0.8rem 1.6rem; font-size: 0.92rem; }

/* ---------------------------------------------------------------------------
 * Badges: small engraved plates.
 * ------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.62rem;
  border-radius: 3px;
  font-family: var(--font-display);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.badge-ember { background: rgba(224, 102, 42, 0.18); color: var(--ember-bright); border: 1px solid rgba(224, 102, 42, 0.5); }
.badge-gold { background: rgba(207, 165, 69, 0.18); color: var(--gold-400); border: 1px solid rgba(207, 165, 69, 0.5); }
.badge-cyan { background: rgba(76, 201, 224, 0.14); color: var(--rune); border: 1px solid rgba(76, 201, 224, 0.45); }
.badge-emerald { background: rgba(95, 174, 86, 0.18); color: #7fcf72; border: 1px solid rgba(95, 174, 86, 0.5); }
.badge-purple { background: rgba(143, 111, 208, 0.18); color: #b9a2f0; border: 1px solid rgba(143, 111, 208, 0.5); }
.badge-crimson { background: rgba(196, 64, 46, 0.2); color: #e0705c; border: 1px solid rgba(196, 64, 46, 0.5); }
.badge-slate { background: rgba(169, 154, 120, 0.14); color: #a99a78; border: 1px solid rgba(169, 154, 120, 0.35); }

/* Category filter chips */
.filter-chip {
  padding: 0.42rem 0.95rem;
  border-radius: 3px;
  background: linear-gradient(180deg, #2e2016, #1b120b);
  border: 1px solid #4d3920;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.filter-chip:hover { color: var(--parch-100); border-color: var(--gold-600); transform: translateY(-1px); }
.filter-chip.active {
  background: linear-gradient(180deg, #5e4220, #3a2610);
  color: var(--gold-300);
  border-color: var(--gold-400);
  box-shadow: 0 0 14px rgba(232, 194, 90, 0.28);
}

/* Forms & inputs: a well cut into the wood. */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1.25rem; }
.form-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: rgba(8, 5, 3, 0.8);
  border: 1px solid #5b4326;
  border-radius: 3px;
  padding: 0.7rem 1rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--gold-400);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6), 0 0 0 3px rgba(207, 165, 69, 0.22);
}
.form-textarea { min-height: 140px; resize: vertical; line-height: 1.6; }

.search-container { position: relative; display: flex; align-items: center; width: 100%; }
.search-input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.6rem;
  background: rgba(8, 5, 3, 0.8);
  border: 1px solid #5b4326;
  border-radius: 3px;
  color: var(--text-primary);
  font-size: 0.95rem;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.search-input:focus {
  outline: none;
  border-color: var(--rune);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6), 0 0 14px rgba(76, 201, 224, 0.28);
}
.search-icon { position: absolute; left: 0.85rem; color: var(--text-muted); pointer-events: none; }

/* ---------------------------------------------------------------------------
 * Modals: a gump over a darkened room. The chronicle's body is a parchment
 * scroll (.scroll-body in news.css); the Admin Studio stays dark wood.
 * ------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(12, 8, 4, 0.82), rgba(3, 2, 1, 0.94));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 999;
  opacity: 0;
  animation: modalFadeIn 0.25s forwards cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-content {
  --gump-edge: 24px;
  position: relative;
  width: 100%;
  max-width: 800px;
  max-height: 92vh;
  overflow-y: auto;
  border: var(--gump-edge) solid transparent;
  border-image: url('/assets/ui/gump-container.png') 48 / var(--gump-edge) / 0 round;
  background:
    var(--grain),
    linear-gradient(180deg, #1d140c, #130d08);
  background-clip: padding-box;
  transform: scale(0.96) translateY(10px);
  animation: modalPopIn 0.25s forwards cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-close-btn {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--parch-100);
  background: radial-gradient(circle at 35% 30%, #7a2a20, #3d100b 70%);
  border: 2px solid var(--gold-500);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 200, 170, 0.3);
  cursor: pointer;
  transition: transform var(--transition-fast), filter var(--transition-fast);
  z-index: 10;
}
.modal-close-btn:hover { filter: brightness(1.3); transform: rotate(90deg); }

@keyframes modalFadeIn { to { opacity: 1; } }
@keyframes modalPopIn { to { transform: scale(1) translateY(0); } }

/* Toast notifications: a note pinned to the wood. */
.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: linear-gradient(180deg, #2a1d12, #170f09);
  border: 1px solid var(--border-card);
  border-radius: 3px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 225, 150, 0.1);
  color: var(--text-primary);
  font-size: 0.95rem;
  pointer-events: auto;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast-success { border-left: 4px solid #5fae56; }
.toast-error { border-left: 4px solid #c4402e; }
.toast-info { border-left: 4px solid var(--rune); }
@keyframes toastSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ---------------------------------------------------------------------------
 * The hero: the painting in its frame, a line about the realm, then the gates.
 * ------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding: 2.75rem 0 3.5rem;
  overflow: hidden;
}
/* The same picture, darkened and blurred, as the room behind the frame. */
.hero::before {
  content: '';
  position: absolute;
  inset: -2rem 0 0;
  background: var(--hero-bg-art) center 20% / cover no-repeat;
  filter: blur(14px) saturate(0.8) brightness(0.55);
  opacity: 0.55;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 100%);
  pointer-events: none;
  transition: background-image 0.5s ease;
}
.hero > .container { position: relative; z-index: 1; }
.hero-frame {
  max-width: 1120px;
  margin: 0 auto;
  --gump-edge: 30px;
}
.hero-art { display: block; width: 100%; height: auto; box-shadow: 0 0 0 1px #000, inset 0 0 40px rgba(0, 0, 0, 0.5); transition: opacity 0.3s ease; }
@media (max-width: 640px) { .hero-frame { --gump-edge: 18px; } }

.hero-lede {
  max-width: 46rem;
  margin: 1.75rem auto 0;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--parch-200);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}
.hero-lede strong { color: var(--gold-300); font-weight: 700; }
.hero-lede em { color: var(--rune-bright); font-style: normal; }
.hero-divider {
  height: 28px;
  margin: 1.5rem auto 1.75rem;
  max-width: 420px;
  background: url('/assets/ui/divider.svg') center / contain no-repeat;
}
.hero-gates { max-width: 52rem; margin: 0 auto; }
.hero-gates-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-400);
}
.hero-gates-head .rune { font-family: var(--font-rune); font-size: 1.2em; margin-right: 0.35rem; color: var(--rune); }
.hero-gates-head .count { color: var(--text-muted); font-family: var(--font-mono); letter-spacing: 0.05em; font-weight: 500; }

/* Section kickers and headings (the realm section, the chronicles). */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-500);
}
.kicker .rune { font-family: var(--font-rune); color: var(--rune); font-size: 1.15em; letter-spacing: 0; }
.section-title {
  font-family: var(--font-deco);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--parch-100);
  text-shadow: 0 2px 0 #000, 0 0 22px rgba(232, 194, 90, 0.25);
}
.section-rule {
  height: 28px;
  margin: 0.75rem auto 0;
  max-width: 360px;
  background: url('/assets/ui/divider.svg') center / contain no-repeat;
}

/* ---------------------------------------------------------------------------
 * Realms. Every realm wears one accent — gold for a modded realm, frost azure
 * for the vanilla one, violet for an invite-only one — set as variables on its card, tab, panel and chip, so
 * the two are told apart at a glance rather than by reading their names
 * (src/utils/realmTheme.js picks the class).
 * ------------------------------------------------------------------------- */
.realm-card--modded, .realm-tab--modded, .realm-panel--modded, .realm-chip--modded {
  --accent: #cfa545;
  --accent-bright: #f0d07a;
  --accent-soft: rgba(207, 165, 69, 0.5);
  --accent-bg: rgba(207, 165, 69, 0.1);
  --cloth-top: #8f2a21;
  --cloth-bottom: #4f110c;
  --trim: #e8c25a;
}
.realm-card--invite, .realm-tab--invite, .realm-panel--invite, .realm-chip--invite {
  --accent: #8f6fd0;
  --accent-bright: #c9b6f5;
  --accent-soft: rgba(143, 111, 208, 0.55);
  --accent-bg: rgba(143, 111, 208, 0.12);
  --cloth-top: #4a3585;
  --cloth-bottom: #251848;
  --trim: #b9a2f0;
}

.realm-card {
  box-shadow: inset 4px 0 0 var(--accent), 0 0 0 1px #0a0705, 0 0 0 2px rgba(168, 129, 47, 0.7), 0 0 0 3px #0a0705, 0 18px 36px -10px rgba(0, 0, 0, 0.85);
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}
/* The vanilla realm (Scoop of Vanilla): frost azure, matching its page skin. */
.realm-card--vanilla, .realm-tab--vanilla, .realm-panel--vanilla, .realm-chip--vanilla {
  --accent: #38bdf8;
  --accent-bright: #7dd3fc;
  --accent-soft: rgba(56, 189, 248, 0.5);
  --accent-bg: rgba(56, 189, 248, 0.12);
  --cloth-top: #0369a1;
  --cloth-bottom: #072a42;
  --trim: #7dd3fc;
}
.realm-card--invite { border-color: rgba(143, 111, 208, 0.5); }
.realm-card--vanilla { border-color: rgba(56, 189, 248, 0.5); }
.realm-card.active-realm {
  border-color: var(--accent-bright) !important;
  box-shadow:
    inset 6px 0 0 var(--accent-bright),
    0 0 0 1px #0a0705,
    0 0 0 2px var(--accent-bright),
    0 0 26px var(--accent-bg),
    0 20px 40px -10px rgba(0, 0, 0, 0.9) !important;
  transform: translateY(-2px);
}

/* Realm-specific button variations */
[data-realm="proximamaxi"] .btn-ember {
  background: linear-gradient(180deg, #f5edff 0%, #d8b4fe 36%, #a855f7 64%, #7e22ce 100%);
  color: #1e0938;
  border-color: #3b0764;
  text-shadow: 0 1px 0 rgba(250, 240, 255, 0.6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -2px 0 rgba(60, 10, 100, 0.5),
    0 0 0 1px rgba(192, 132, 252, 0.3),
    0 4px 10px rgba(0, 0, 0, 0.6);
}
[data-realm="proximamaxi"] .btn-ember:hover {
  filter: brightness(1.12) saturate(1.15);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 -2px 0 rgba(60, 10, 100, 0.5),
    0 0 0 1px rgba(235, 215, 255, 0.55),
    0 0 20px rgba(192, 132, 252, 0.5),
    0 6px 14px rgba(0, 0, 0, 0.6);
}
[data-realm="proximamaxi"] .btn-runic {
  background: linear-gradient(180deg, rgba(220, 38, 38, 0.25), rgba(75, 15, 25, 0.7));
  color: #ff9b9b;
  border-color: rgba(220, 38, 38, 0.65);
  box-shadow: inset 0 1px 0 rgba(255, 210, 210, 0.22), 0 0 14px rgba(220, 38, 38, 0.28), 0 3px 8px rgba(0, 0, 0, 0.55);
}
[data-realm="proximamaxi"] .btn-runic:hover {
  color: #fff;
  border-color: #ef4444;
  background: linear-gradient(180deg, rgba(220, 38, 38, 0.38), rgba(110, 20, 35, 0.8));
  box-shadow: inset 0 1px 0 rgba(255, 210, 210, 0.3), 0 0 22px rgba(220, 38, 38, 0.5), 0 3px 8px rgba(0, 0, 0, 0.55);
}

/* Active header chip glow */
body[data-realm="proximamaxi"] [data-realm-chip="proximamaxi"],
body[data-realm="valtima"] [data-realm-chip="valtima"],
body[data-realm="newdawn"] [data-realm-chip="newdawn"],
body[data-realm="scoop"] [data-realm-chip="scoop"] {
  border-color: var(--accent-bright);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 14px var(--accent-soft);
}

/* Proxima Maxi Header Brand & Navigation Theme */
[data-realm="proximamaxi"] .brand-emblem {
  filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.65)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.9));
}
[data-realm="proximamaxi"] .brand:hover .brand-emblem {
  transform: rotate(-18deg) scale(1.08);
  filter: drop-shadow(0 0 16px rgba(239, 68, 68, 0.95)) drop-shadow(0 0 24px rgba(168, 85, 247, 0.6));
}
[data-realm="proximamaxi"] .brand-title {
  background: linear-gradient(180deg, #ffffff 0%, #fecaca 25%, #ef4444 55%, #991b1b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 0 #000) drop-shadow(0 0 14px rgba(239, 68, 68, 0.5));
}
[data-realm="proximamaxi"] .brand-subtitle {
  color: var(--gold-400);
}
[data-realm="proximamaxi"] .top-nav-bar {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.01) 0 2px, transparent 2px 9px),
    var(--grain),
    linear-gradient(180deg, #1b0e29 0%, #11081a 58%, #08030d 100%);
  box-shadow:
    0 8px 26px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(239, 68, 68, 0.25),
    inset 0 -1px 0 rgba(168, 85, 247, 0.45);
}
[data-realm="proximamaxi"] .top-nav-bar::before {
  background: linear-gradient(90deg, transparent, #881337 14%, #ef4444 50%, #881337 86%, transparent);
}
[data-realm="proximamaxi"] .top-nav-bar::after {
  filter: hue-rotate(280deg) saturate(1.8) brightness(0.9);
}
[data-realm="proximamaxi"] .nav-link-pill {
  background: linear-gradient(180deg, #241639, #130a1f);
  border-color: #552d79;
  box-shadow: inset 0 1px 0 rgba(216, 180, 254, 0.14), 0 2px 4px rgba(0, 0, 0, 0.65);
}
[data-realm="proximamaxi"] .nav-link-pill:hover {
  border-color: #a855f7;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(216, 180, 254, 0.25), 0 0 12px rgba(168, 85, 247, 0.35);
}
[data-realm="proximamaxi"] .nav-link-pill.active {
  background: linear-gradient(180deg, #381b54, #190a29);
  border-color: #ef4444;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(248, 113, 113, 0.3), 0 0 16px rgba(239, 68, 68, 0.45);
}
[data-realm="proximamaxi"] .nav-link-pill .rune {
  color: var(--rune-bright);
}
[data-realm="proximamaxi"] .site-footer-ankh {
  width: 1.8rem;
  height: 1.8rem;
  background-image: url('/assets/ui/eclipse-sigil.svg');
  filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.75));
  opacity: 0.95;
}
[data-realm="proximamaxi"] .site-footer-title {
  color: var(--gold-300);
  text-shadow: 0 0 12px rgba(168, 85, 247, 0.5);
}
[data-realm="proximamaxi"] .section-title {
  text-shadow: 0 2px 0 #000, 0 0 22px rgba(239, 68, 68, 0.4);
}
[data-realm="proximamaxi"] .hero-divider,
[data-realm="proximamaxi"] .section-rule {
  filter: hue-rotate(275deg) saturate(1.8) brightness(0.9);
}

/* Proxima Maxi: Subpages, Panels, Modals, Wells & Badges */
[data-realm="proximamaxi"] .realm-panel {
  background:
    var(--grain),
    radial-gradient(ellipse at 50% 0%, rgba(168, 85, 247, 0.22), transparent 55%),
    linear-gradient(180deg, #160d24, #090510);
  box-shadow: 0 0 40px rgba(168, 85, 247, 0.15), 0 20px 40px rgba(0, 0, 0, 0.9);
}
[data-realm="proximamaxi"] .realm-panel-head {
  border-bottom-color: rgba(168, 85, 247, 0.35);
}
[data-realm="proximamaxi"] .glass-panel,
[data-realm="proximamaxi"] .glass-panel-card {
  background:
    var(--rivets),
    var(--grain),
    linear-gradient(180deg, rgba(26, 16, 42, 0.94), rgba(12, 7, 20, 0.97));
  border-color: rgba(168, 85, 247, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(239, 68, 68, 0.18),
    inset 0 0 0 1px rgba(0, 0, 0, 0.6),
    0 8px 18px -8px rgba(0, 0, 0, 0.85);
}
[data-realm="proximamaxi"] .glass-panel-heavy {
  background:
    var(--rivets),
    var(--grain),
    linear-gradient(180deg, rgba(26, 16, 42, 0.94), rgba(12, 7, 20, 0.97));
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(239, 68, 68, 0.2),
    0 0 0 1px #050308,
    0 0 0 2px rgba(168, 85, 247, 0.75),
    0 0 0 3px #050308,
    0 18px 36px -10px rgba(0, 0, 0, 0.95);
}
[data-realm="proximamaxi"] .glass-panel-heavy::before {
  border-color: rgba(239, 68, 68, 0.25);
}
[data-realm="proximamaxi"] .glass-panel-card:hover {
  border-color: #ef4444;
  box-shadow:
    inset 0 1px 0 rgba(248, 113, 113, 0.3),
    inset 0 0 0 1px rgba(0, 0, 0, 0.65),
    0 14px 28px -10px rgba(0, 0, 0, 0.95),
    0 0 24px rgba(239, 68, 68, 0.3);
}
[data-realm="proximamaxi"] .realm-well {
  background: rgba(12, 7, 20, 0.85);
  border-color: rgba(168, 85, 247, 0.3);
  box-shadow: inset 0 2px 7px rgba(0, 0, 0, 0.8), 0 1px 0 rgba(239, 68, 68, 0.15);
}
[data-realm="proximamaxi"] .step-badge {
  color: #ffffff;
  background: radial-gradient(circle at 35% 28%, #ffffff, #ef4444 45%, #7e22ce 100%);
  border-color: #3b0764;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.6), inset 0 -2px 3px rgba(60, 10, 100, 0.5), 0 0 18px rgba(239, 68, 68, 0.45);
  text-shadow: 0 1px 2px #000;
}
[data-realm="proximamaxi"] .realm-subhead-title {
  color: #d8b4fe;
}
[data-realm="proximamaxi"] .realm-guard {
  background: rgba(14, 8, 24, 0.85);
  border-color: rgba(168, 85, 247, 0.25);
}
[data-realm="proximamaxi"] .realm-invite {
  background: rgba(22, 12, 36, 0.8);
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: inset 0 2px 7px rgba(0, 0, 0, 0.7), 0 0 16px rgba(168, 85, 247, 0.15);
}
[data-realm="proximamaxi"] .parchment {
  color: #f1edfa;
  background:
    var(--grain),
    radial-gradient(ellipse at 50% 0%, rgba(168, 85, 247, 0.15), transparent 65%),
    linear-gradient(180deg, #1c1328, #110a1b 55%, #0a0512);
  box-shadow:
    inset 0 0 38px rgba(168, 85, 247, 0.25),
    inset 0 0 0 1px rgba(168, 85, 247, 0.4);
}
[data-realm="proximamaxi"] .scroll-author,
[data-realm="proximamaxi"] .scroll-footnote strong {
  color: #f1edfa;
}
[data-realm="proximamaxi"] .scroll-author-role,
[data-realm="proximamaxi"] .scroll-footnote,
[data-realm="proximamaxi"] .scroll-foot-realm {
  color: #c4b5fd;
}
[data-realm="proximamaxi"] .scroll-byline {
  border-top-color: rgba(168, 85, 247, 0.35);
  border-bottom-color: rgba(168, 85, 247, 0.35);
}
[data-realm="proximamaxi"] .scroll-byline-rune {
  color: #ffffff;
  background: radial-gradient(circle at 35% 30%, #ef4444, #581c87 75%);
  border-color: #ef4444;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 0 12px rgba(239, 68, 68, 0.6);
}
[data-realm="proximamaxi"] .scroll-body .btn-outline {
  background: linear-gradient(180deg, #381b54, #190a29);
  color: #f5edff;
  border-color: #552d79;
}
[data-realm="proximamaxi"] .scroll-body .btn-outline:hover {
  color: #ffffff;
  border-color: #ef4444;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.4);
}
[data-realm="proximamaxi"] .modal-window,
[data-realm="proximamaxi"] .modal-content {
  background: var(--grain), linear-gradient(180deg, #180e28, #0a0512);
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 0 50px rgba(168, 85, 247, 0.3), 0 25px 50px rgba(0, 0, 0, 0.95);
}
[data-realm="proximamaxi"] .text-glow-gold {
  color: #f5edff !important;
  text-shadow: 0 1px 0 #000, 0 0 16px rgba(168, 85, 247, 0.6) !important;
}
[data-realm="proximamaxi"] .text-amber-400 {
  color: #d8b4fe !important;
}
[data-realm="proximamaxi"] .text-amber-300 {
  color: #fca5a5 !important;
}
[data-realm="proximamaxi"] .text-amber-200 {
  color: #fed7aa !important;
}

/* Wubarrks Scoop of Vanilla Theme */
[data-realm="scoop"] .brand-title {
  background: linear-gradient(180deg, #e0f2fe 0%, #7dd3fc 35%, #0284c7 65%, #0369a1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 0 #000) drop-shadow(0 0 14px rgba(56, 189, 248, 0.4));
}
[data-realm="scoop"] .brand-subtitle {
  color: var(--gold-400);
}
[data-realm="scoop"] .top-nav-bar {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.01) 0 2px, transparent 2px 9px),
    var(--grain),
    linear-gradient(180deg, #0d2238 0%, #081624 58%, #030a12 100%);
  box-shadow:
    0 8px 26px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(56, 189, 248, 0.25),
    inset 0 -1px 0 rgba(14, 165, 233, 0.45);
}
[data-realm="scoop"] .top-nav-bar::before {
  background: linear-gradient(90deg, transparent, #0369a1 14%, #38bdf8 50%, #0369a1 86%, transparent);
}
[data-realm="scoop"] .top-nav-bar::after {
  filter: hue-rotate(180deg) saturate(1.5) brightness(0.95);
}
[data-realm="scoop"] .site-footer-title {
  color: var(--gold-300);
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
}
[data-realm="scoop"] .realm-panel {
  background:
    var(--grain),
    radial-gradient(ellipse at 50% 0%, rgba(56, 189, 248, 0.2), transparent 55%),
    linear-gradient(180deg, #071f33, #030d17);
  box-shadow: 0 0 40px rgba(56, 189, 248, 0.15), 0 20px 40px rgba(0, 0, 0, 0.9);
}
[data-realm="scoop"] .glass-panel,
[data-realm="scoop"] .glass-panel-card {
  background:
    var(--rivets),
    var(--grain),
    linear-gradient(180deg, rgba(12, 34, 56, 0.94), rgba(5, 16, 28, 0.97));
  border-color: rgba(56, 189, 248, 0.35);
}
[data-realm="scoop"] .glass-panel-heavy {
  background:
    var(--rivets),
    var(--grain),
    linear-gradient(180deg, rgba(12, 34, 56, 0.94), rgba(5, 16, 28, 0.97));
  border-color: rgba(56, 189, 248, 0.5);
}
[data-realm="scoop"] .step-badge {
  color: #ffffff;
  background: radial-gradient(circle at 35% 28%, #e0f2fe, #38bdf8 45%, #0369a1 100%);
  border-color: #0c4a6e;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.6), 0 0 18px rgba(56, 189, 248, 0.45);
}


.realm-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 3px;
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-bright);
  border: 1px solid var(--accent-soft);
  background: var(--accent-bg);
}

/* The realm tabs are banners: cloth on a gold trim, a swallowtail hem. */
.realm-tabs {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.1rem;
  max-width: 60rem;
  margin: 0 auto 1.6rem;
}
.realm-tab {
  --hem: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  flex: 1 1 15rem;
  max-width: 22rem;
  padding: 1rem 1.2rem calc(var(--hem) + 1.1rem);
  color: var(--text-secondary);
  text-align: center;
  cursor: pointer;
  background: linear-gradient(180deg, var(--trim), color-mix(in srgb, var(--trim) 45%, #000));
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--hem)), 50% 100%, 0 calc(100% - var(--hem)));
  filter: saturate(0.55) brightness(0.72);
  transition: filter 0.2s ease, transform 0.2s ease;
}
.realm-tab::before {
  content: '';
  position: absolute;
  inset: 2px;
  background:
    var(--grain),
    linear-gradient(180deg, var(--cloth-top), var(--cloth-bottom));
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--hem)), 50% 100%, 0 calc(100% - var(--hem)));
}
.realm-tab > * { position: relative; }
.realm-tab:hover { filter: saturate(0.85) brightness(0.9); transform: translateY(-2px); }
.realm-tab.active { filter: none; transform: translateY(-2px); color: var(--parch-100); }
.realm-tab-name {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--trim);
  text-shadow: 0 1px 0 #000;
}
.realm-tab-meta { font-family: var(--font-mono); font-size: 0.64rem; font-weight: 700; letter-spacing: 0.02em; }
.realm-tab-lock { font-size: 0.75rem; letter-spacing: 0; }

/* The window the realm's panels open in. */
.realm-panel {
  --gump-edge: 26px;
  position: relative; /* above the fixed particle backdrop, like every other clickable area */
  border: var(--gump-edge) solid transparent;
  border-image: url('/assets/ui/gump-container.png') 48 / var(--gump-edge) / 0 round;
  background:
    var(--grain),
    radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 55%),
    linear-gradient(180deg, #1d140c, #130d08);
  background-clip: padding-box;
  padding: 0.25rem 0.25rem 0.5rem;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.65));
}
@media (min-width: 640px) { .realm-panel { padding: 0.75rem 1rem 1rem; } }
@media (max-width: 640px) { .realm-panel { --gump-edge: 18px; } }
/* The sections rendered inside a panel keep their own top borders and
 * padding, which double up here. */
.realm-panel > #realm-panel-body > section { border-top: 0; padding-top: 0.5rem; padding-bottom: 0.5rem; }
.realm-panel-head { padding-bottom: 1rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--accent-soft); }

/* Header realm chips: a status gem and a head-count per realm, in the sticky
 * bar, so every realm is readable from anywhere on the page. */
.realm-chips {
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem;
  border-radius: 3px;
  background: rgba(6, 4, 2, 0.7);
  border: 1px solid #4d3920;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.7);
}
.realm-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.7rem;
  border-radius: 2px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.realm-chip strong { color: var(--parch-100); }
.realm-chip:hover { color: var(--parch-100); background: rgba(255, 255, 255, 0.05); border-color: var(--accent-soft); }
.realm-chip--config { padding: 0.3rem 0.5rem; font-size: 0.7rem; color: var(--rune); border-left: 1px solid rgba(255, 255, 255, 0.08); border-radius: 0 2px 2px 0; }
/* Nothing in the sticky bar may wrap: a wrapped chip pushes the actions off
 * the right edge. Names show only where there is room for them. */
.realm-chip-name { display: none; font-family: var(--font-display); letter-spacing: 0.06em; }
@media (min-width: 1680px) { .realm-chip-name { display: inline; } }

/* The status gem: green up, red down or stale, gold unknown. */
.realm-dot {
  position: relative;
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.7);
}
.realm-dot::before {
  content: '';
  position: absolute;
  top: 1.5px;
  left: 2px;
  width: 3.5px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
}
.realm-dot::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: inherit; opacity: 0.6; animation: realmPulse 1.8s ease-out infinite; z-index: -1; }
.realm-dot--online { background: radial-gradient(circle at 40% 35%, #b6f0a8, #4fae44 60%, #2d7326); }
.realm-dot--offline { background: radial-gradient(circle at 40% 35%, #f4a090, #c4402e 60%, #7a1d12); }
.realm-dot--unknown { background: radial-gradient(circle at 40% 35%, #f6e4a6, #cfa545 60%, #7d5a1b); }
.realm-dot--offline::after { animation: none; }
@keyframes realmPulse { 0% { transform: scale(1); opacity: 0.6; } 100% { transform: scale(2.4); opacity: 0; } }

/* ---------------------------------------------------------------------------
 * Header brand: the moongate, and the name carved over it.
 * ------------------------------------------------------------------------- */
.brand { display: flex; align-items: center; gap: 0.8rem; text-decoration: none; }
.brand-emblem {
  flex: none;
  width: 2.7rem;
  height: 2.7rem;
  filter: drop-shadow(0 0 8px rgba(76, 201, 224, 0.45)) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.8));
  transition: transform 0.25s ease, filter 0.25s ease;
}
.brand:hover .brand-emblem { transform: rotate(18deg) scale(1.06); filter: drop-shadow(0 0 12px rgba(76, 201, 224, 0.75)) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.8)); }
.brand-text { display: flex; flex-direction: column; gap: 0.18rem; }
.brand-title {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--font-deco);
  font-weight: 900;
  font-size: 1.28rem;
  line-height: 1.05;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  background: linear-gradient(180deg, #fff3c0 0%, #f0d07a 38%, #c9a24b 62%, #8a6a24 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 0 #000) drop-shadow(0 0 10px rgba(232, 194, 90, 0.25));
}
.brand-subtitle {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--rune);
  white-space: nowrap;
}
@media (max-width: 420px) { .brand-title { font-size: 1.05rem; } .brand-emblem { width: 2.2rem; height: 2.2rem; } }

/* The header row is brand | nav | actions with space-between. When the row
 * is full, space-between leaves NO gap between neighbours — so a minimum
 * gap is set on the row itself. */
.top-nav-bar > .container {
  gap: 1.5rem;
  /* The bar spans the viewport, not the centred content column. */
  max-width: none;
  width: 100%;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
.top-nav-bar > .container > nav,
.top-nav-bar > .container > .brand,
.top-nav-bar .realm-chips { flex: none; }
.top-nav-bar .nav-link-pill { white-space: nowrap; }
/* The nav in three sizes, so the brand, nav, realm chips and actions all fit
 * without anything shrinking under its neighbour:
 *   1680px and up   rune, full label, and the brand's subtitle
 *   1440 to 1679    rune and a short label
 *   below 1440      the rune alone (the label is in the tooltip) */
.nav-short { display: none; }
@media (max-width: 1679px) {
  .brand-subtitle { display: none; }
  .top-nav-bar .nav-label { display: none; }
  .top-nav-bar .nav-short { display: inline; }
}
@media (max-width: 1439px) {
  .top-nav-bar .nav-short { display: none; }
  .top-nav-bar .nav-link-pill { padding-left: 0.8rem; padding-right: 0.8rem; }
  .top-nav-bar .nav-link-pill .rune { font-size: 1.35em; }
}

/* The π. Sized like a footnote, coloured like the bar until hovered. */
.praetorian {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  margin-left: 0.25rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(169, 154, 120, 0.28);
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}
.praetorian:hover { color: var(--gold-400); text-shadow: 0 0 8px rgba(207, 165, 69, 0.6); }
.praetorian--in { color: rgba(232, 194, 90, 0.7); }

/* ---------------------------------------------------------------------------
 * Footer: the foot of the hall — knotwork over a dark floor.
 * ------------------------------------------------------------------------- */
.site-footer {
  position: relative;
  margin-top: 2rem;
  padding: 3.25rem 0 2.25rem;
  color: var(--text-secondary);
  background:
    var(--grain),
    linear-gradient(180deg, #170f09, #0b0805 70%);
  border-top: 1px solid #000;
  box-shadow: inset 0 1px 0 rgba(207, 165, 69, 0.45);
}
.site-footer::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 7px;
  height: 18px;
  background: url('/assets/ui/knot-band.svg') repeat-x left center / auto 18px;
  opacity: 0.8;
}
.site-footer-row { display: flex; flex-direction: column; align-items: center; gap: 1.25rem; text-align: center; }
@media (min-width: 900px) { .site-footer-row { flex-direction: row; align-items: center; justify-content: space-between; text-align: left; } }
.site-footer-brand { display: flex; align-items: center; gap: 0.9rem; flex: none; }
.site-footer-emblem { width: 2.9rem; height: 2.9rem; object-fit: contain; filter: drop-shadow(0 0 10px rgba(207, 165, 69, 0.3)); flex: none; }
.site-footer-title { font-weight: 800; color: var(--gold-300); font-size: 0.9rem; letter-spacing: 0.12em; white-space: nowrap; }
.site-footer-sub { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); margin-top: 0.15rem; white-space: nowrap; }
.site-footer-note { font-family: var(--font-sans); font-size: 0.9rem; color: var(--text-secondary); max-width: 28rem; line-height: 1.5; }
.site-footer-meta { display: flex; align-items: center; gap: 0.75rem; font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; flex: none; }
/* The sister sites (RGlabs, the mods' home, DLNE): a quiet line under the footer row. */
.site-footer-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.4rem 0.75rem; margin-top: 1.1rem; font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); }
.site-footer-ankh { display: block; width: 1.1rem; height: 1.65rem; margin: 0 auto 1.1rem; background: url('/assets/ui/ankh.svg') center / contain no-repeat; opacity: 0.85; }

/* ---------------------------------------------------------------------------
 * Progression tier + enforcement. The Wonderland mod's gear ceiling as a
 * ladder of rungs — lit to the current tier, dim above it — and the server's
 * guards as pills. One strip on the hero card (rungs only) and one on the
 * realm Overview (rungs with names); the header chip carries the tier word.
 * ------------------------------------------------------------------------- */
.realm-guard {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-secondary);
}
.realm-guard--panel {
  margin-bottom: 0;
  padding: 1rem 1.1rem 1.1rem;
  border-radius: 3px;
  border: 1px solid var(--border-subtle);
  background: rgba(6, 4, 2, 0.5);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
}
.realm-guard-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem 0.6rem; }
.realm-guard-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.6rem; }
.realm-guard-title { font-family: var(--font-display); font-size: 0.95rem; font-weight: 700; color: var(--gold-300); letter-spacing: 0.06em; text-transform: uppercase; }
.realm-guard-text { line-height: 1.5; }
.realm-guard-key { color: var(--text-muted); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.62rem; }
.realm-guard-tier { color: var(--accent-bright, var(--gold-300)); font-weight: 700; letter-spacing: 0.04em; }
.realm-guard-dim { color: var(--text-muted); }

.tier-ladder { display: inline-flex; align-items: flex-end; gap: 3px; flex: none; }
.tier-rung {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 7px;
  border-radius: 1px;
  background: rgba(169, 154, 120, 0.16);
  border: 1px solid rgba(169, 154, 120, 0.22);
}
.tier-rung--unlocked { background: var(--accent-soft, rgba(207, 165, 69, 0.5)); border-color: var(--accent, #cfa545); }
.tier-rung--current { background: var(--accent-bright, #f0d07a); border-color: #fff3c0; box-shadow: 0 0 8px var(--accent-bright, #f0d07a); }
.tier-rung--gated { background: rgba(14, 10, 6, 0.6); border-color: rgba(169, 154, 120, 0.2); }
.tier-rung--open { background: rgba(169, 154, 120, 0.16); border-style: dashed; }

/* The named ladder on the Overview: every rung the same width, its tier
 * name beneath, the current one bright. Eight names do not fit a phone,
 * so the names turn on their side there. */
.tier-ladder--named { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 4px; width: 100%; align-items: start; margin-bottom: 1.35rem; }
.tier-ladder--named .tier-rung { width: auto; height: 10px; display: flex; flex-direction: column; align-items: center; border-radius: 2px; }
.tier-rung-name { position: absolute; top: 14px; left: 0; right: 0; text-align: center; font-size: 0.58rem; letter-spacing: 0.04em; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tier-rung--unlocked .tier-rung-name { color: var(--text-secondary); }
.tier-rung--current .tier-rung-name { color: var(--accent-bright, var(--gold-300)); font-weight: 700; }
/* Eight names do not fit a phone in one row: four rungs a row there, with
 * room under each row for its names. */
@media (max-width: 639px) {
  .tier-ladder--named { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 2.1rem; margin-bottom: 2rem; }
  .tier-rung-name { white-space: normal; line-height: 1.15; }
}

.guard-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.16rem 0.55rem;
  border-radius: 2px;
  border: 1px solid rgba(169, 154, 120, 0.25);
  background: rgba(14, 10, 6, 0.55);
  color: var(--text-secondary);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.guard-pill em { font-style: normal; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-muted); }
.guard-pill--on { color: var(--accent-bright, var(--gold-300)); border-color: var(--accent-soft, rgba(207, 165, 69, 0.5)); background: var(--accent-bg, rgba(207, 165, 69, 0.08)); }
.guard-pill--on em { color: var(--accent, var(--gold-400)); }
.guard-pill--off { color: var(--text-muted); border-style: dashed; }
.guard-pill--unknown { color: var(--text-muted); border-style: dashed; }

/* The tier word in a header chip, after the head-count. */
.realm-chip-tier { color: var(--accent-bright, var(--gold-300)); font-weight: 700; padding-left: 0.45rem; border-left: 1px solid rgba(255, 255, 255, 0.1); }

/* ---------------------------------------------------------------------------
 * The invite-only realm: its card says why there is no address — a sealed
 * door, in the realm's violet.
 * ------------------------------------------------------------------------- */
.realm-invite {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  border-radius: 3px;
  border: 1px dashed rgba(143, 111, 208, 0.55);
  background: rgba(20, 12, 36, 0.55);
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}
.realm-invite-lock { flex: none; }
.realm-invite-word { color: #c9b6f5; font-weight: 700; }
.realm-invite--panel { max-width: 44rem; margin: 0 auto; padding: 1rem 1.25rem; font-size: 1rem; }

/* A part-pack realm's "reporting here" note, over its cards. */
.realm-reports {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-radius: 3px;
  border: 1px solid var(--border-subtle);
  background: rgba(6, 4, 2, 0.5);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.45);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--text-secondary);
}
.realm-reports-key { margin-right: 0.4rem; color: var(--text-muted); font-weight: 700; font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; }
.realm-reports-dim { color: var(--text-muted); }

/* The seam between a realm's Raven Iron panels and its Wonderland mod ones. */
.realm-subhead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin: 2rem 0 1rem;
  padding-top: 1.5rem;
  background: url('/assets/ui/knot-band-dim.svg') repeat-x left top / auto 11px;
}
.realm-subhead-title { font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--gold-300); letter-spacing: 0.06em; text-transform: uppercase; }
.realm-subhead-note { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); }

/* ---------------------------------------------------------------------------
 * Wells and medallions
 * ------------------------------------------------------------------------- */
/* A well cut into the wood: where an address, a count or a code sits. */
.realm-well {
  background: rgba(6, 4, 2, 0.75);
  border: 1px solid #4d3920;
  border-radius: 3px;
  box-shadow: inset 0 2px 7px rgba(0, 0, 0, 0.7), 0 1px 0 rgba(255, 225, 150, 0.06);
}

/* The numbered medallion on a join step: a gold-rimmed disc. */
.step-badge {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  font-family: var(--font-deco);
  font-weight: 900;
  font-size: 1.15rem;
  color: #2b1a06;
  background: radial-gradient(circle at 35% 28%, #fff3c0, #e0b94f 45%, #9a6f1f 100%);
  border: 2px solid #3a2610;
  box-shadow: 0 0 0 2px rgba(232, 194, 90, 0.5), inset 0 -2px 3px rgba(90, 60, 15, 0.45), 0 3px 8px rgba(0, 0, 0, 0.6);
  text-shadow: 0 1px 0 rgba(255, 240, 190, 0.6);
}
