/* ==========================================================================
   midwaymadness.org — v0.3 Dark Carnival & Dota 2 In-Game Plaque Design System
   Strict 12-Token Palette (all glow/woodgrain/tint via color-mix) · Zero < 12px
   ========================================================================== */

:root {
  /* Core Carnival Velvet & In-Game Wood Plaque Ladder (4 tokens) */
  --bg: #100b18;
  --surface: #1b1326;
  --surface-2: #251a33;
  --plaque: #172e28;

  /* Warm Parchment & Lavender Typography Ladder (2 tokens) */
  --text: #efeae0;
  --muted: #b0a6ba;

  /* Dark Carnival Crimson & Antique Brass Hierarchy (2 tokens) */
  --accent: #a8292b;
  --gold: #d6b87c;

  /* Dota 2 Rarity & Attribute Semantic Accents (4 tokens) */
  --tier-uncommon: #4ade80;
  --tier-rare: #4e9af1;
  --tier-legendary: #b668ff;
  --tier-eldritch: #2dd4bf;

  /* Derived Surfaces, Woodgrain, Hairlines & Stage Glows (0 extra hexes) */
  --accent-hover: color-mix(in srgb, var(--accent) 78%, var(--bg));
  --plaque-light: color-mix(in srgb, var(--plaque) 84%, var(--gold));
  --plaque-dark: color-mix(in srgb, var(--plaque) 68%, var(--bg));
  --border: color-mix(in srgb, var(--gold) 28%, transparent);
  --border-strong: color-mix(in srgb, var(--gold) 64%, transparent);
  --border-subtle: color-mix(in srgb, var(--text) 11%, transparent);
  --accent-soft: color-mix(in srgb, var(--accent) 22%, transparent);
  --gold-soft: color-mix(in srgb, var(--gold) 15%, transparent);
  --eldritch-soft: color-mix(in srgb, var(--tier-eldritch) 15%, transparent);
  --rare-soft: color-mix(in srgb, var(--tier-rare) 15%, transparent);
  --legendary-soft: color-mix(in srgb, var(--tier-legendary) 16%, transparent);
  --uncommon-soft: color-mix(in srgb, var(--tier-uncommon) 15%, transparent);
  --shadow-deep: 0 18px 44px color-mix(in srgb, var(--bg) 88%, transparent);
  --shadow-card: 0 8px 24px color-mix(in srgb, var(--bg) 74%, transparent);
  --shadow-plaque: 0 12px 30px color-mix(in srgb, var(--bg) 82%, transparent);
  --shadow-popover: 0 18px 42px color-mix(in srgb, var(--bg) 94%, transparent);

  /* Typography */
  --font-display: 'Cinzel', 'PingFang SC', 'Noto Sans SC', 'Microsoft YaHei', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', 'PingFang SC', 'Noto Sans SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;

  /* Strict Type Scale (minimum 12px everywhere) */
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-base: 16px;
  --fs-md: 18px;
  --fs-lg: 22px;
  --fs-xl: 28px;
  --fs-2xl: 36px;
  --fs-3xl: 42px;

  /* Carnival Plaque Geometry */
  --radius-xs: 3px;
  --radius-sm: 5px;
  --radius: 8px;
  --radius-pill: 999px;
  --container: 1200px;
}

/* ---------- Base Reset & Royal Velvet Stage Canvas ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body.mm-body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 68% 360px at 50% -110px, color-mix(in srgb, var(--gold) 13%, transparent), transparent 72%),
    radial-gradient(ellipse 46% 320px at 8% -40px, color-mix(in srgb, var(--accent) 22%, transparent), transparent 72%),
    radial-gradient(ellipse 46% 320px at 92% -40px, color-mix(in srgb, var(--accent) 18%, transparent), transparent 72%),
    radial-gradient(ellipse 64% 480px at 50% 42%, color-mix(in srgb, var(--surface-2) 55%, transparent), transparent 78%);
  color: var(--text);
  overflow-x: clip;
}

img,
svg {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

a {
  color: var(--gold);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--gold) 45%, transparent);
  text-underline-offset: 3px;
  transition: color 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

a:hover {
  color: var(--text);
  text-decoration-color: var(--gold);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

h1, h2, h3, h4 {
  margin: 0 0 0.55em;
  color: var(--text);
  line-height: 1.2;
  font-weight: 700;
}

h1 {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  letter-spacing: 0.025em;
}

h2 {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  letter-spacing: 0.02em;
}

h3 {
  font-size: var(--fs-lg);
}

h4 {
  font-size: var(--fs-md);
}

p {
  margin: 0 0 1em;
}

[hidden] {
  display: none !important;
}

/* ---------- Skip Link & Layout Container ---------- */
.mm-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 12px 18px;
  background: var(--gold);
  color: var(--bg);
  font-weight: 700;
  z-index: 1000;
  text-decoration: none;
}

.mm-skip:focus {
  left: 0;
}

.mm-container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: 24px;
}

.mm-main {
  flex: 1 0 auto;
  padding-block: 24px 68px;
}

.mm-section {
  margin-top: 48px;
}

.mm-section-head {
  margin-bottom: 18px;
}

.mm-section-head h2 {
  margin-bottom: 0;
}

/* ---------- Header & Theatrical Dark Carnival Topbar ---------- */
.mm-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 92%, var(--surface));
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow:
    0 1px 0 color-mix(in srgb, var(--accent) 34%, transparent),
    0 8px 24px color-mix(in srgb, var(--bg) 65%, transparent);
}

.mm-header-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
  padding-block: 8px;
}

.mm-brand-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.mm-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  min-height: 44px;
}

.mm-brand:hover {
  color: var(--gold);
}

.mm-brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  box-shadow: 0 0 12px color-mix(in srgb, var(--gold) 18%, transparent);
  overflow: hidden;
}

.mm-brand-icon img,
.mm-brand-icon svg {
  width: 32px;
  height: 32px;
  display: block;
}

.mm-brand-name {
  font-family: var(--font-display);
  font-size: var(--fs-base);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  white-space: nowrap;
}

.mm-patch-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.mm-nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mm-header-actions {
  display: none;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.mm-lang-compact {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}

.mm-lang-compact-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 36px;
  padding: 0 7px;
  font-size: var(--fs-xs);
  font-weight: 700;
  text-decoration: none;
  color: var(--muted);
}

.mm-lang-compact-link + .mm-lang-compact-link {
  border-left: 1px solid var(--border-subtle);
}

.mm-lang-compact-link.is-active {
  background: color-mix(in srgb, var(--gold) 18%, var(--surface-2));
  color: var(--gold);
}

.mm-nav-trigger {
  display: none;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-xs);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.mm-nav-trigger-bars {
  width: 16px;
  height: 2px;
  background: var(--gold);
  box-shadow: 0 -5px 0 var(--gold), 0 5px 0 var(--gold);
}

.mm-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.mm-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0;
}

/* Subtle in-game Dark Carnival brass diamond nav flourishes */
.mm-nav-list::before,
.mm-nav-list::after {
  content: "";
  width: 5px;
  height: 5px;
  transform: rotate(45deg);
  border: 1px solid color-mix(in srgb, var(--gold) 65%, transparent);
  background: color-mix(in srgb, var(--accent) 45%, transparent);
  margin-inline: 3px;
  flex: 0 0 auto;
}

.mm-nav-list li {
  display: inline-flex;
  align-items: center;
}

.mm-nav-list li + li::before {
  content: "";
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--gold) 42%, transparent);
  margin-inline: 2px;
  flex: 0 0 auto;
}

.mm-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 7px;
  border-radius: var(--radius-xs);
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.mm-nav-link::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 4px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transform: scaleX(0);
  transition: transform 0.18s ease;
}

.mm-nav-link:hover,
.mm-nav-link[aria-current="page"] {
  color: var(--text);
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
}

.mm-nav-link[aria-current="page"] {
  color: var(--gold);
}

.mm-nav-link:hover::after,
.mm-nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}

.mm-lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding-left: 8px;
  border-left: 1px solid var(--border);
  flex: 0 0 auto;
}

.mm-lang-link {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-decoration: none;
  color: var(--muted);
  padding: 4px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  white-space: nowrap;
}

.mm-lang-link.is-active,
.mm-lang-link:hover {
  color: var(--gold);
  border-color: var(--border);
  background: var(--surface);
}

/* ---------- Eyebrows, Badges, Buttons ---------- */
.mm-eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}

.mm-version-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 70%, var(--surface-2));
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.mm-version-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tier-eldritch);
  box-shadow: 0 0 8px var(--tier-eldritch);
}

.mm-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--gold);
  padding: 5px 11px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius-xs);
}

.mm-back-link:hover {
  border-color: var(--gold);
  color: var(--text);
  background: color-mix(in srgb, var(--gold) 14%, var(--surface-2));
}

.mm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.025em;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.12s ease, box-shadow 0.18s ease;
}

.mm-btn:active {
  transform: translateY(1px);
}

.mm-btn-primary {
  background: var(--accent);
  color: var(--text);
  border-color: color-mix(in srgb, var(--gold) 42%, var(--accent));
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--gold) 36%, transparent),
    0 4px 16px color-mix(in srgb, var(--accent) 34%, transparent);
}

.mm-btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--gold);
  color: var(--text);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--gold) 48%, transparent),
    0 6px 20px color-mix(in srgb, var(--accent) 48%, transparent);
}

.mm-btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

.mm-btn-secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: color-mix(in srgb, var(--gold) 10%, var(--surface-2));
}

.mm-btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border-subtle);
}

.mm-btn-ghost:hover {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface-2);
}

/* ==========================================================================
   1. Homepage: Dramatic Dark Carnival Stage Banner & 4-Grid Quick Bar
   ========================================================================== */
.mm-stage-banner {
  position: relative;
  background-color: var(--surface);
  background-image:
    radial-gradient(ellipse 64% 220px at 50% -18px, color-mix(in srgb, var(--gold) 22%, transparent), transparent 72%),
    radial-gradient(ellipse 52% 290px at 4% 35%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 72%),
    radial-gradient(ellipse 52% 290px at 96% 35%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 72%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 70%, transparent) 0%, color-mix(in srgb, var(--surface) 82%, transparent) 58%, color-mix(in srgb, var(--bg) 94%, transparent) 100%),
    url("https://img.midwaymadness.org/s_0q0c4m5h5c6z0u/curtains.27f01c670f.jpg");
  background-size: auto, auto, auto, auto, cover;
  background-position: center, center, center, center, center top;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow:
    inset 0 0 0 4px color-mix(in srgb, var(--surface) 84%, transparent),
    inset 0 0 0 5px color-mix(in srgb, var(--gold) 32%, transparent),
    0 0 36px color-mix(in srgb, var(--accent) 20%, transparent),
    var(--shadow-deep);
  margin-bottom: 30px;
  overflow: hidden;
}

/* Antique brass corner rivets on the theatrical marquee plaque */
.mm-stage-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background-image:
    radial-gradient(circle 3px at 13px 13px, var(--gold) 55%, color-mix(in srgb, var(--bg) 80%, transparent) 76%, transparent 100%),
    radial-gradient(circle 3px at calc(100% - 13px) 13px, var(--gold) 55%, color-mix(in srgb, var(--bg) 80%, transparent) 76%, transparent 100%);
}

/* Top warm gold marquee trim with subtle official fairy lights atmosphere */
.mm-stage-banner::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 24px;
  pointer-events: none;
  background-image:
    linear-gradient(90deg, var(--accent) 0%, var(--gold) 28%, var(--text) 50%, var(--gold) 72%, var(--accent) 100%),
    url("https://img.midwaymadness.org/s_0q0c4m5h5c6z0u/fairy-lights.a2606354ae.png");
  background-size: 100% 3px, auto 22px;
  background-repeat: no-repeat, repeat-x;
  background-position: top center, top center;
  opacity: 0.72;
  z-index: 3;
}

.mm-stage-inner {
  position: relative;
  z-index: 1;
  padding: 30px 32px 22px;
}

.mm-stage-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.mm-stage-meta .mm-eyebrow {
  margin-bottom: 0;
}

.mm-stage-title {
  font-size: var(--fs-2xl);
  line-height: 1.15;
  margin-bottom: 10px;
  letter-spacing: 0.03em;
  color: var(--gold);
  text-shadow: 0 2px 16px color-mix(in srgb, var(--bg) 85%, transparent);
}

.mm-stage-subtitle {
  font-size: var(--fs-base);
  color: var(--text);
  max-width: 72ch;
  margin-bottom: 0;
  opacity: 0.94;
}

/* Theatrical brass diamond & Dark Carnival filigree divider */
.mm-stage-ornament {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  margin-inline: 24px;
}

.mm-stage-ornament::before,
.mm-stage-ornament::after {
  content: "";
  flex: 1 1 auto;
  height: 12px;
  background-image: url("https://img.midwaymadness.org/s_0q0c4m5h5c6z0u/section-divider-tile.5764ccf311.png");
  background-repeat: repeat-x;
  background-position: center;
  background-size: auto 10px;
  opacity: 0.55;
}

.mm-stage-diamond {
  width: 10px;
  height: 10px;
  margin-inline: 12px;
  transform: rotate(45deg);
  background: var(--accent);
  border: 1.5px solid var(--gold);
  box-shadow: 0 0 10px color-mix(in srgb, var(--gold) 50%, transparent);
}

/* 4-Column Quick Tool Bar */
.mm-quick-bar {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 78%, var(--surface));
}

.mm-quick-link {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 14px 18px;
  text-decoration: none;
  color: var(--text);
  border-right: 1px solid var(--border-subtle);
  transition: background-color 0.16s ease, color 0.16s ease;
}

.mm-quick-link::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  opacity: 0;
  transition: opacity 0.16s ease;
}

.mm-quick-link:last-child {
  border-right: 0;
}

.mm-quick-link:hover {
  background: color-mix(in srgb, var(--gold) 10%, var(--surface-2));
  color: var(--gold);
}

.mm-quick-link:hover::before {
  opacity: 1;
}

.mm-quick-label {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

.mm-quick-link:hover .mm-quick-label {
  color: var(--gold);
}

.mm-quick-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--muted);
}

/* Compact Above-the-Fold Mode Overview Card (Answers Head Term Above Hero Grid) */
.mm-intro-card {
  margin: -12px 0 24px;
  padding: 16px 20px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 8%, var(--surface)) 0%, var(--surface) 62%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.mm-intro-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 10px;
}

.mm-intro-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-md);
  color: var(--gold);
  letter-spacing: 0.02em;
}

.mm-intro-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.mm-intro-link {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--gold);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.mm-intro-link:hover {
  border-color: var(--gold);
  color: var(--text);
  background: color-mix(in srgb, var(--gold) 14%, var(--surface-2));
}

.mm-intro-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 22px;
}

.mm-intro-body p {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text);
  line-height: 1.58;
}

/* ==========================================================================
   2. Homepage: Prydwen Interactive Hero Filter Bar & Ravenswatch Hero Cards
   ========================================================================== */
.mm-roster-wrap {
  margin-top: 8px;
}

.mm-roster-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 16px;
}

.mm-roster-top .mm-section-head {
  margin-bottom: 0;
}

.mm-roster-count {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

/* Prydwen-Style Interactive Roster Filter Command Strip */
.mm-roster-filter {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  margin-bottom: 24px;
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-top: 2px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.mm-roster-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mm-roster-search {
  flex: 1 1 auto;
  min-width: 0;
}

.mm-roster-clear {
  flex: 0 0 auto;
  min-height: 44px;
  padding-inline: 14px;
}

.mm-roster-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
}

.mm-filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.mm-roster-empty {
  padding: 32px 20px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--muted);
}

.mm-roster-empty p {
  margin-bottom: 14px;
  color: var(--text);
}

.mm-attr-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.mm-attr-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.mm-roster-section {
  margin-bottom: 32px;
}

.mm-roster-section:last-child {
  margin-bottom: 0;
}

.mm-roster-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 10%, var(--surface)) 0%, var(--surface) 60%);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-xs);
}

.mm-roster-head-main {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.mm-roster-tier {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-md);
  letter-spacing: 0.03em;
  color: var(--gold);
}

.mm-roster-note {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--muted);
}

/* Ravenswatch + Prydwen Hero Portrait Grid */
.mm-hero-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.mm-hero-card {
  --hero-attr-color: var(--gold);
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--surface) 0%, color-mix(in srgb, var(--surface-2) 65%, var(--bg)) 100%);
  border: 1px solid var(--border);
  border-top: 3px solid var(--hero-attr-color);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.2s ease, background-color 0.18s ease;
}

.mm-hero-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  border-top-color: var(--gold);
  color: var(--text);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--gold) 55%, transparent),
    0 12px 28px color-mix(in srgb, var(--accent) 24%, transparent),
    0 6px 20px color-mix(in srgb, var(--gold) 18%, transparent);
}

/* Primary Attribute Color Mapping */
.mm-attr-str {
  --hero-attr-color: var(--accent);
}

.mm-attr-agi {
  --hero-attr-color: var(--tier-uncommon);
}

.mm-attr-int {
  --hero-attr-color: var(--tier-rare);
}

.mm-attr-all {
  --hero-attr-color: var(--gold);
}

.mm-attr-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--hero-attr-color);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--hero-attr-color) 32%, transparent);
}

.mm-hero-portrait-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg);
  overflow: hidden;
}

.mm-hero-portrait-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 90% at 50% 35%, transparent 45%, color-mix(in srgb, var(--bg) 68%, transparent) 100%),
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--bg) 38%, transparent) 0%,
      transparent 34%,
      color-mix(in srgb, var(--surface) 96%, transparent) 100%
    );
  pointer-events: none;
}

.mm-hero-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
  transition: transform 0.3s ease, filter 0.22s ease;
}

.mm-hero-card:hover .mm-hero-portrait {
  transform: scale(1.07);
  filter: brightness(1.1) contrast(1.04);
}

.mm-hero-attr-pip {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border: 1px solid color-mix(in srgb, var(--hero-attr-color) 55%, transparent);
  border-radius: var(--radius-xs);
}

.mm-unlock-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  color: var(--text);
  white-space: nowrap;
}

.mm-hero-portrait-wrap .mm-unlock-pill {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
}

.mm-unlock-pill.is-free {
  border-color: color-mix(in srgb, var(--tier-uncommon) 58%, transparent);
  background: color-mix(in srgb, var(--tier-uncommon) 18%, var(--bg));
  color: var(--text);
}

.mm-unlock-pill.is-cogs {
  border-color: color-mix(in srgb, var(--gold) 58%, transparent);
  background: color-mix(in srgb, var(--gold) 18%, var(--bg));
  color: var(--text);
}

.mm-unlock-pill.is-chapter2 {
  border-color: color-mix(in srgb, var(--tier-legendary) 60%, transparent);
  background: color-mix(in srgb, var(--tier-legendary) 20%, var(--bg));
  color: var(--text);
}

.mm-hero-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 13px 13px;
  flex: 1 0 auto;
}

.mm-hero-name-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.mm-hero-name {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  transition: color 0.16s ease;
}

.mm-hero-card:hover .mm-hero-name {
  color: var(--gold);
}

.mm-hero-blurb {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--muted);
  line-height: 1.48;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   3. In-Game Emerald-Wood Gold-Framed Souvenir Plaques & Augment Popovers
   (Direct faithful recreation of Dota 2 Midway of Madness Souvenir UI)
   ========================================================================== */
.mm-souvenir-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.mm-souvenir-plaque {
  --plaque-ring: var(--gold);
  --plaque-aura: color-mix(in srgb, var(--gold) 24%, transparent);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 24px 20px 18px;
  background-color: var(--plaque);
  background-image:
    radial-gradient(ellipse 90% 55% at 50% 0%, color-mix(in srgb, var(--gold) 14%, transparent), transparent 68%),
    radial-gradient(ellipse 100% 70% at 50% 100%, color-mix(in srgb, var(--bg) 56%, transparent), transparent 72%),
    repeating-linear-gradient(
      90deg,
      color-mix(in srgb, var(--plaque-dark) 44%, transparent) 0px,
      color-mix(in srgb, var(--plaque-dark) 44%, transparent) 2px,
      color-mix(in srgb, var(--plaque-light) 14%, transparent) 2px,
      color-mix(in srgb, var(--plaque-light) 14%, transparent) 16px,
      transparent 16px,
      transparent 34px
    );
  border: 1px solid color-mix(in srgb, var(--plaque-ring) 72%, transparent);
  border-radius: var(--radius-sm);
  box-shadow:
    inset 0 0 0 4px var(--plaque),
    inset 0 0 0 5px color-mix(in srgb, var(--plaque-ring) 32%, transparent),
    var(--shadow-plaque);
  color: var(--text);
  min-width: 0;
  overflow: visible;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.2s ease;
}

/* Four antique brass corner rivets matching the in-game souvenir plaques */
.mm-souvenir-plaque::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background-image:
    radial-gradient(circle 2.6px at 10px 10px, var(--plaque-ring) 58%, color-mix(in srgb, var(--bg) 82%, transparent) 100%),
    radial-gradient(circle 2.6px at calc(100% - 10px) 10px, var(--plaque-ring) 58%, color-mix(in srgb, var(--bg) 82%, transparent) 100%),
    radial-gradient(circle 2.6px at 10px calc(100% - 10px), var(--plaque-ring) 58%, color-mix(in srgb, var(--bg) 82%, transparent) 100%),
    radial-gradient(circle 2.6px at calc(100% - 10px) calc(100% - 10px), var(--plaque-ring) 58%, color-mix(in srgb, var(--bg) 82%, transparent) 100%);
}

.mm-souvenir-plaque:hover {
  transform: translateY(-3px);
  border-color: var(--plaque-ring);
  box-shadow:
    inset 0 0 0 4px var(--plaque),
    inset 0 0 0 5px color-mix(in srgb, var(--plaque-ring) 58%, transparent),
    0 0 24px var(--plaque-aura),
    var(--shadow-deep);
}

/* Pool-Tier Visual Hierarchy on In-Game Souvenir Plaques */
.mm-souvenir-plaque[data-pool-tier="hero_exclusive"] {
  --plaque-ring: var(--gold);
  --plaque-aura: color-mix(in srgb, var(--accent) 42%, transparent);
  background-image:
    radial-gradient(ellipse 80% 42% at 50% 0%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 72%),
    radial-gradient(ellipse 90% 55% at 50% 0%, color-mix(in srgb, var(--gold) 16%, transparent), transparent 68%),
    radial-gradient(ellipse 100% 70% at 50% 100%, color-mix(in srgb, var(--bg) 58%, transparent), transparent 72%),
    repeating-linear-gradient(
      90deg,
      color-mix(in srgb, var(--plaque-dark) 44%, transparent) 0px,
      color-mix(in srgb, var(--plaque-dark) 44%, transparent) 2px,
      color-mix(in srgb, var(--plaque-light) 14%, transparent) 2px,
      color-mix(in srgb, var(--plaque-light) 14%, transparent) 16px,
      transparent 16px,
      transparent 34px
    );
}

.mm-souvenir-plaque[data-pool-tier="hero_exclusive"]::after {
  content: "";
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--gold), var(--accent), transparent);
  pointer-events: none;
}

.mm-souvenir-plaque[data-pool-tier="shared_main"] {
  --plaque-ring: var(--gold);
  --plaque-aura: color-mix(in srgb, var(--gold) 22%, transparent);
}

.mm-souvenir-plaque[data-pool-tier="universal_flex"] {
  --plaque-ring: var(--tier-eldritch);
  --plaque-aura: color-mix(in srgb, var(--tier-eldritch) 26%, transparent);
}

/* Circular Bronze Medallion Emblem (54x54 centered top on plaques, 44x44 on augment cards) */
.mm-medallion {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  margin: 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--gold) 24%, var(--surface-2)), var(--bg) 78%);
  border: 2px solid var(--plaque-ring, var(--gold));
  box-shadow:
    0 0 0 3px var(--plaque),
    0 0 0 4px color-mix(in srgb, var(--plaque-ring, var(--gold)) 42%, transparent),
    0 6px 16px color-mix(in srgb, var(--bg) 82%, transparent);
  color: var(--plaque-ring, var(--gold));
  overflow: hidden;
}

.mm-souvenir-plaque[data-pool-tier="hero_exclusive"] .mm-medallion {
  box-shadow:
    0 0 0 3px var(--plaque),
    0 0 0 5px var(--accent),
    0 0 0 6px color-mix(in srgb, var(--gold) 65%, transparent),
    0 0 18px color-mix(in srgb, var(--accent) 55%, transparent);
}

.mm-medallion img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.mm-medallion:has(.mm-medal-hero-pip),
.mm-medallion:has(.mm-hero-stamp) {
  overflow: visible;
}

.mm-medal-hero-pip {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  background: var(--bg);
  object-fit: cover;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--bg) 90%, transparent);
  z-index: 3;
}

.mm-medallion svg {
  width: 30px;
  height: 30px;
  display: block;
}

.mm-medallion-sm {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--card-accent, var(--gold)) 24%, var(--surface-2)), var(--bg) 82%);
  border: 2px solid var(--card-accent, var(--gold));
  box-shadow:
    0 0 0 2px var(--surface),
    0 4px 12px color-mix(in srgb, var(--bg) 78%, transparent);
  color: var(--card-accent, var(--gold));
  overflow: hidden;
}

.mm-medallion-sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.mm-medallion-sm svg {
  width: 24px;
  height: 24px;
  display: block;
}

/* Souvenir Plaque Dual-Line Typography (Primary CN + Title-Case EN Subtitle) */
.mm-plaque-title {
  margin: 2px 0 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: var(--fs-base);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--gold);
  line-height: 1.28;
  text-shadow: 0 2px 8px color-mix(in srgb, var(--bg) 82%, transparent);
}

.mm-plaque-sub {
  display: block;
  margin: -4px 0 0;
  text-align: center;
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.01em;
  line-height: 1.35;
  color: color-mix(in srgb, var(--gold) 70%, var(--muted));
}

.mm-aug-popover-close,
.mm-popover-close,
.mm-aug-popover button[data-mm-close] {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--gold);
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  transition: border-color 0.14s ease, background-color 0.14s ease, color 0.14s ease;
}

.mm-aug-popover-close:hover,
.mm-popover-close:hover,
.mm-aug-popover button[data-mm-close]:hover {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 16%, var(--surface-2));
  color: var(--text);
}

.mm-plaque-body,
.mm-plaque-desc {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.58;
  color: var(--text);
  text-align: center;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.mm-plaque-body strong,
.mm-plaque-desc strong,
.mm-num {
  color: var(--gold);
  font-weight: 700;
}

.mm-plaque-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.mm-plaque-cooldown {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--bg) 62%, var(--plaque));
  border: 1px solid color-mix(in srgb, var(--gold) 32%, transparent);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--gold);
}

/* Related Souvenir Augment Chips & Floating Hover/Click Popover */
.mm-aug-section,
.mm-plaque-augs {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid color-mix(in srgb, var(--gold) 24%, transparent);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mm-aug-section-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

.mm-aug-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.mm-aug-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--bg) 68%, var(--plaque));
  border: 1px solid color-mix(in srgb, var(--gold) 38%, transparent);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.mm-aug-chip:hover,
.mm-aug-chip:focus-visible,
.mm-aug-chip.is-open {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--bg) 82%, var(--surface-2));
  color: var(--gold);
  z-index: 40;
}

.mm-aug-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.mm-aug-dot,
.mm-dot-rare,
.mm-dot-legendary,
.mm-dot-uncommon,
.mm-dot-eldritch {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 7px;
}

.mm-dot-uncommon,
.mm-aug-dot[data-rarity="common"] {
  background: var(--tier-uncommon);
}

.mm-dot-rare,
.mm-aug-dot[data-rarity="uncommon"] {
  background: var(--tier-rare);
}

.mm-dot-legendary,
.mm-aug-dot[data-rarity="rare"] {
  background: var(--tier-legendary);
}

.mm-aug-dot[data-rarity="legendary"],
.mm-aug-dot[data-rarity="ancient"] {
  background: var(--gold);
}

.mm-dot-eldritch,
.mm-aug-dot[data-rarity="eldritch"] {
  background: var(--tier-eldritch);
}

/* Floating Augment Detail Popover (Desktop hover/focus + Mobile click) */
.mm-aug-popover {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translate(-50%, 6px);
  width: min(320px, calc(100vw - 32px));
  padding: 14px 16px;
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  box-shadow:
    inset 0 0 0 3px color-mix(in srgb, var(--surface) 88%, transparent),
    inset 0 0 0 4px color-mix(in srgb, var(--gold) 28%, transparent),
    var(--shadow-popover);
  color: var(--text);
  text-align: left;
  z-index: 95;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.mm-aug-chip:hover > .mm-aug-popover,
.mm-aug-chip:focus-within > .mm-aug-popover,
.mm-aug-chip.is-open > .mm-aug-popover,
.mm-aug-popover.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.mm-aug-popover.is-flip-down {
  bottom: auto;
  top: calc(100% + 10px);
  transform: translate(-50%, -6px);
}

.mm-aug-chip:hover > .mm-aug-popover.is-flip-down,
.mm-aug-chip:focus-within > .mm-aug-popover.is-flip-down,
.mm-aug-chip.is-open > .mm-aug-popover.is-flip-down,
.mm-aug-popover.is-open.is-flip-down {
  transform: translate(-50%, 0);
}

.mm-aug-popover.is-align-left {
  left: 0;
  transform: translate(0, 6px);
}

.mm-aug-chip:hover > .mm-aug-popover.is-align-left,
.mm-aug-chip:focus-within > .mm-aug-popover.is-align-left,
.mm-aug-chip.is-open > .mm-aug-popover.is-align-left {
  transform: translate(0, 0);
}

.mm-aug-popover.is-align-right {
  left: auto;
  right: 0;
  transform: translate(0, 6px);
}

.mm-aug-chip:hover > .mm-aug-popover.is-align-right,
.mm-aug-chip:focus-within > .mm-aug-popover.is-align-right,
.mm-aug-chip.is-open > .mm-aug-popover.is-align-right {
  transform: translate(0, 0);
}

.mm-aug-popover-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--gold);
  line-height: 1.3;
}

.mm-aug-popover-desc {
  margin: 0 0 10px;
  font-size: var(--fs-xs);
  line-height: 1.55;
  color: var(--text);
  white-space: pre-line;
}

.mm-aug-popover-tiers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mm-popover-tier {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text);
}

.mm-popover-tier[data-rarity="common"] {
  border-color: color-mix(in srgb, var(--tier-uncommon) 68%, transparent);
  background: color-mix(in srgb, var(--tier-uncommon) 18%, var(--bg));
  color: var(--tier-uncommon);
}

.mm-popover-tier[data-rarity="uncommon"] {
  border-color: color-mix(in srgb, var(--tier-rare) 68%, transparent);
  background: color-mix(in srgb, var(--tier-rare) 18%, var(--bg));
  color: var(--tier-rare);
}

.mm-popover-tier[data-rarity="rare"] {
  border-color: color-mix(in srgb, var(--tier-legendary) 68%, transparent);
  background: color-mix(in srgb, var(--tier-legendary) 18%, var(--bg));
  color: var(--tier-legendary);
}

.mm-popover-tier[data-rarity="legendary"],
.mm-popover-tier[data-rarity="ancient"] {
  border-color: color-mix(in srgb, var(--gold) 68%, transparent);
  background: color-mix(in srgb, var(--gold) 18%, var(--bg));
  color: var(--gold);
}

.mm-popover-tier[data-rarity="eldritch"] {
  border-color: color-mix(in srgb, var(--tier-eldritch) 68%, transparent);
  background: color-mix(in srgb, var(--tier-eldritch) 18%, var(--bg));
  color: var(--tier-eldritch);
}

/* ==========================================================================
   4. Compendium Systems Ledger (Homepage Below Hero Roster)
   ========================================================================== */
.mm-systems-ledger {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-top: 2px solid var(--gold);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.mm-system-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.mm-system-row:last-child {
  border-bottom: 0;
}

.mm-system-row:hover {
  background: color-mix(in srgb, var(--gold) 8%, var(--surface-2));
  color: var(--text);
}

.mm-system-index {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.05em;
}

.mm-system-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin-bottom: 4px;
}

.mm-system-title {
  margin: 0;
  font-size: var(--fs-md);
  color: var(--text);
}

.mm-system-row:hover .mm-system-title {
  color: var(--gold);
}

.mm-system-metric {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--gold);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  background: var(--bg);
  border: 1px solid var(--border-subtle);
}

.mm-system-desc {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--muted);
  max-width: 70ch;
}

.mm-system-cta {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

/* ---------- Inner Page & Tool Headers ---------- */
.mm-page-header,
.mm-tool-header {
  position: relative;
  padding: 22px 26px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--surface)) 0%, var(--surface) 58%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-top: 2px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}

.mm-page-header {
  margin-bottom: 36px;
}

.mm-page-header-top,
.mm-tool-header-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.mm-tool-header-crumbs {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.mm-page-header-top .mm-eyebrow,
.mm-tool-header-top .mm-eyebrow {
  margin-bottom: 0;
}

.mm-page-title,
.mm-tool-title {
  font-size: var(--fs-2xl);
  color: var(--gold);
  margin-bottom: 8px;
}

.mm-updated-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.mm-updated-meta::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  flex: 0 0 6px;
}

.mm-page-subtitle,
.mm-tool-subtitle {
  font-size: var(--fs-base);
  color: var(--muted);
  max-width: 72ch;
  margin-bottom: 0;
}

.mm-tool-stage {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-deep);
}

/* Compact Hero Detail Header & Stage (ensures 1280x860 desktop shows 4 tabs + first row above fold) */
.mm-tool-header-compact {
  padding: 10px 16px;
  margin-bottom: 12px;
}

.mm-tool-header-compact .mm-tool-header-top {
  margin-bottom: 0;
}

.mm-tool-header-compact .mm-tool-title {
  font-size: var(--fs-lg);
  margin: 0;
  line-height: 1.2;
}

.mm-tool-page-hero .mm-tool-stage {
  padding: 14px 16px;
}

.mm-tool-page-hero .mm-tool {
  gap: 12px;
}

/* ---------- Prose & Guide Typography ---------- */
.mm-prose {
  margin-top: 40px;
}

.mm-prose h2 {
  margin-top: 40px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  color: var(--gold);
}

.mm-prose h2:first-child {
  margin-top: 0;
}

.mm-prose h3 {
  margin-top: 24px;
  margin-bottom: 8px;
  color: var(--gold);
}

.mm-prose p,
.mm-prose ul,
.mm-prose ol,
.mm-prose blockquote {
  max-width: 72ch;
}

.mm-prose p {
  overflow-wrap: anywhere;
}

.mm-prose ul,
.mm-prose ol {
  padding-left: 22px;
  margin: 0 0 18px;
}

.mm-prose li {
  margin-bottom: 8px;
}

.mm-prose li strong {
  color: var(--text);
}

.mm-prose blockquote {
  margin: 22px 0;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-xs);
  color: var(--text);
}

.mm-prose blockquote p:last-child {
  margin-bottom: 0;
}

.mm-prose code {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--gold);
}

.mm-prose pre {
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 20px 0;
}

.mm-prose pre code {
  border: 0;
  padding: 0;
  background: transparent;
}

.mm-prose hr {
  border: 0;
  height: 14px;
  margin: 36px 0;
  background-image: url("https://img.midwaymadness.org/s_0q0c4m5h5c6z0u/section-divider-tile.5764ccf311.png");
  background-repeat: repeat-x;
  background-position: center;
  background-size: auto 10px;
  opacity: 0.55;
}

.mm-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
}

.mm-prose th {
  text-align: left;
  padding: 11px 14px;
  background: var(--surface-2);
  color: var(--gold);
  font-weight: 700;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.mm-prose td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

.mm-prose tbody tr:last-child td {
  border-bottom: 0;
}

.mm-prose tbody tr:hover td {
  background: color-mix(in srgb, var(--gold) 6%, transparent);
}

/* ==========================================================================
   5. Prydwen + Ravenswatch Hero Detail Page (Strip, Splash Banner, Tabs)
   ========================================================================== */
.mm-tool {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.mm-loading {
  margin: 0;
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-sm);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

/* Ravenswatch-Style Single-Row Smooth Horizontal 29-Hero Switcher Strip */
.mm-hero-strip,
.mm-tool-stage .mm-tool .mm-hero-strip {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  margin-bottom: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) var(--bg);
}

.mm-tool-stage .mm-tool .mm-hero-strip a {
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 4px 10px 4px 6px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  scroll-snap-align: center;
  transition: border-color 0.14s ease, color 0.14s ease, background-color 0.14s ease, transform 0.14s ease;
}

.mm-tool-stage .mm-tool .mm-hero-strip a > span:last-child {
  display: inline-block;
  padding: 0;
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow-wrap: normal;
}

.mm-tool-stage .mm-tool .mm-hero-strip .mm-art {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
}

.mm-tool-stage .mm-tool .mm-hero-strip a:is(:hover, :focus-visible, [aria-current="page"]) {
  color: var(--gold);
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 15%, var(--surface-2));
  box-shadow: 0 0 10px color-mix(in srgb, var(--gold) 28%, transparent);
}

.mm-strip-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mm-strip-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 38px;
  flex: 0 0 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--gold);
  font-size: var(--fs-base);
  font-weight: 700;
  cursor: pointer;
}

.mm-strip-arrow:hover {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 14%, var(--surface-2));
}

/* /hero & /zh/hero Full Expanded 29-Hero Visual Wall (4-col desktop / 3-col tablet / 2-col mobile) */
.mm-hub-roster {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.mm-hub-filter {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-top: 2px solid var(--gold);
  border-radius: var(--radius);
}

.mm-hub-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.mm-hub-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  padding: 9px 14px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 10%, var(--bg)) 0%, var(--bg) 65%);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-xs);
}

.mm-hub-group-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-md);
  color: var(--gold);
}

.mm-hub-grid,
.mm-tool-stage .mm-tool .mm-hub-roster .mm-hero-grid,
.mm-tool-stage .mm-tool .mm-hero-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  overflow: visible;
}

.mm-hub-card,
.mm-tool-stage .mm-tool .mm-hero-picker a {
  --hero-attr-color: var(--gold);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 0;
  background: linear-gradient(180deg, var(--surface) 0%, color-mix(in srgb, var(--surface-2) 65%, var(--bg)) 100%);
  border: 1px solid var(--border);
  border-top: 3px solid var(--hero-attr-color);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  min-width: 0;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.2s ease;
}

.mm-hub-card:hover,
.mm-tool-stage .mm-tool .mm-hero-picker a:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  border-top-color: var(--gold);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--gold) 55%, transparent),
    0 10px 24px color-mix(in srgb, var(--accent) 22%, transparent);
}

.mm-tool-stage .mm-tool .mm-hero-picker a {
  padding: 10px 12px;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.mm-tool-stage .mm-tool .mm-hero-picker a strong {
  display: block;
  font-size: var(--fs-sm);
  color: var(--text);
}

.mm-tool-stage .mm-tool .mm-hero-picker a:hover strong {
  color: var(--gold);
}

.mm-hero-strip-item {
  --hero-attr-color: var(--gold);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  border-bottom: 2px solid var(--hero-attr-color);
  background: var(--surface);
  overflow: hidden;
  text-decoration: none;
  opacity: 0.72;
  transition: opacity 0.14s ease, transform 0.14s ease, border-color 0.14s ease, box-shadow 0.16s ease;
}

.mm-hero-strip-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mm-hero-strip-item:hover {
  opacity: 1;
  transform: translateY(-2px);
  border-color: var(--gold);
}

.mm-hero-strip-item.is-active,
.mm-hero-strip-item[aria-current="page"] {
  opacity: 1;
  transform: scale(1.08);
  border: 2px solid var(--gold);
  box-shadow: 0 0 12px color-mix(in srgb, var(--gold) 52%, transparent);
  z-index: 2;
}

/* Prydwen + Ravenswatch Compact Dramatic Hero Splash Banner (Crimson Velvet Stage) */
.mm-hero-splash,
.mm-hero-banner,
.mm-tool-stage .mm-tool .mm-hero-splash {
  --hero-attr-color: var(--gold);
  position: relative;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
  min-height: 174px;
  padding: 16px 20px;
  background-color: var(--surface);
  background-image:
    radial-gradient(ellipse 58% 220px at 18% 50%, color-mix(in srgb, var(--hero-attr-color) 20%, transparent), transparent 72%),
    radial-gradient(ellipse 65% 220px at 86% 12%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 74%),
    linear-gradient(112deg, color-mix(in srgb, var(--bg) 88%, var(--surface-2)) 0%, color-mix(in srgb, var(--surface) 76%, transparent) 55%, color-mix(in srgb, var(--bg) 86%, transparent) 100%),
    url("https://img.midwaymadness.org/s_0q0c4m5h5c6z0u/curtains.27f01c670f.jpg");
  background-size: auto, auto, auto, cover;
  background-position: center, center, center, center top;
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--hero-attr-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-deep);
  align-items: center;
  overflow: hidden;
}

.mm-tool-stage .mm-tool .mm-hero-splash {
  display: flex;
  min-height: 176px;
  padding: 16px 22px;
}

.mm-tool-stage .mm-tool .mm-hero-splash h2 {
  font-size: clamp(24px, 2.5vw, 32px);
  line-height: 1.12;
  margin: 4px 0 6px;
}

.mm-tool-stage .mm-tool .mm-hero-splash p {
  font-size: var(--fs-sm);
  margin: 0 0 8px;
}

.mm-tool-stage .mm-tool .mm-hero-tabs {
  margin-block: 4px 8px;
}

.mm-hero-splash::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 18px;
  pointer-events: none;
  background: url("https://img.midwaymadness.org/s_0q0c4m5h5c6z0u/fairy-lights.a2606354ae.png") top center / auto 18px repeat-x;
  opacity: 0.45;
  z-index: 1;
}

.mm-hero-splash-media,
.mm-hero-banner-media {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--bg) 82%, transparent);
}

.mm-hero-splash-media img,
.mm-hero-banner-media img,
.mm-tool .mm-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mm-hero-splash-info,
.mm-hero-banner-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.mm-hero-splash-title,
.mm-hero-banner-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  color: var(--gold);
  line-height: 1.12;
  letter-spacing: 0.03em;
}

.mm-hero-splash-blurb {
  margin: 0;
  font-size: var(--fs-base);
  color: var(--text);
  max-width: 64ch;
  line-height: 1.55;
}

.mm-hero-banner-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.mm-hero-banner-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  font-size: var(--fs-xs);
  color: var(--muted);
}

.mm-hero-banner-stats strong {
  color: var(--gold);
  font-family: var(--font-mono);
}

/* Prydwen-Style Hero Detail Tabs */
.mm-hero-tabs {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  gap: 6px;
  padding: 0 4px;
  border-bottom: 1px solid var(--border);
}

.mm-hero-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.mm-hero-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transform: scaleX(0);
  transition: transform 0.18s ease;
}

.mm-hero-tab:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--surface-2) 65%, transparent);
}

.mm-hero-tab.is-active,
.mm-hero-tab[aria-selected="true"] {
  color: var(--gold);
  background: var(--surface-2);
  border-color: var(--border);
}

.mm-hero-tab.is-active::after,
.mm-hero-tab[aria-selected="true"]::after {
  transform: scaleX(1);
}

.mm-hero-tab-count {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  color: var(--muted);
}

.mm-hero-tab.is-active .mm-hero-tab-count,
.mm-hero-tab[aria-selected="true"] .mm-hero-tab-count {
  border-color: var(--border-strong);
  color: var(--gold);
}

.mm-hero-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Hero Switcher fallback */
.mm-hero-switcher {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

/* Ability Cards */
.mm-ability-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}

.mm-ability-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
}

.mm-ability-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  object-fit: cover;
  border: 2px solid var(--border-strong);
  background: var(--bg);
  border-radius: 50%;
}

.mm-ability-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mm-ability-name {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--gold);
}

.mm-ability-meta {
  font-size: var(--fs-xs);
  color: var(--gold);
  font-family: var(--font-mono);
}

.mm-ability-desc {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--text);
  line-height: 1.5;
}

.mm-hero-section,
.mm-pool-section,
.mm-skill-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mm-hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 4px;
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-decoration: none;
}

.mm-hero-chip:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.mm-hero-mini-icon {
  width: 22px;
  height: 22px;
  object-fit: cover;
  border-radius: var(--radius-xs);
}

/* ---------- Toolbar, Inputs, Pills, Generic Tabs ---------- */
.mm-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.mm-toolbar label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mm-search,
.mm-select,
.mm-input {
  min-height: 44px;
  padding: 10px 13px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mm-search {
  flex: 1 1 240px;
  min-width: 0;
}

.mm-select {
  flex: 0 1 210px;
  min-width: 150px;
  cursor: pointer;
}

.mm-search::placeholder,
.mm-input::placeholder {
  color: var(--muted);
}

.mm-search:focus,
.mm-select:focus,
.mm-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 26%, transparent);
}

.mm-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.mm-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--bg);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.mm-pill:hover {
  color: var(--text);
  border-color: var(--gold);
}

.mm-pill.is-active,
.mm-pill.is-selected,
.mm-pill[aria-pressed="true"] {
  background: color-mix(in srgb, var(--gold) 18%, var(--bg));
  border-color: var(--gold);
  color: var(--gold);
}

.mm-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.mm-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.mm-tab:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border);
}

.mm-tab.is-active,
.mm-tab.is-selected,
.mm-tab[aria-selected="true"] {
  background: color-mix(in srgb, var(--gold) 14%, var(--surface-2));
  color: var(--gold);
  border-color: var(--gold);
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* ---------- Structured Groups ---------- */
.mm-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 8px;
}

.mm-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-xs);
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.mm-group-head::-webkit-details-marker {
  display: none;
}

.mm-group-title {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--gold);
}

.mm-group-count {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 2px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--gold);
}

/* ==========================================================================
   6. Hades Companion Style Augments Library & Database Cards
   ========================================================================== */
.mm-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.mm-card,
.mm-aug-card {
  --card-accent: var(--gold);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 17px;
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 1px solid var(--border-subtle);
  border-top: 3px solid var(--card-accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  text-align: left;
  color: var(--text);
  cursor: pointer;
  min-width: 0;
  overflow-wrap: anywhere;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.18s ease, background-color 0.16s ease;
}

.mm-card:hover,
.mm-aug-card:hover {
  border-color: var(--card-accent);
  transform: translateY(-2px);
  box-shadow:
    0 0 18px color-mix(in srgb, var(--card-accent) 24%, transparent),
    var(--shadow-deep);
}

.mm-card.is-active,
.mm-card.is-selected,
.mm-aug-card.is-active {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), var(--shadow-card);
}

.mm-card-head,
.mm-item-head,
.mm-aug-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mm-item-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--card-accent, var(--gold));
  background: var(--bg);
}

.mm-card-title {
  margin: 0;
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.mm-card:hover .mm-card-title,
.mm-aug-card:hover .mm-card-title {
  color: var(--gold);
}

.mm-card-desc,
.mm-card-summary {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.5;
}

.mm-card-meta,
.mm-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px solid var(--border-subtle);
  font-size: var(--fs-xs);
  color: var(--muted);
}

/* Upgrade legacy Souvenir cards & fold details to emerald-wood brass plaque aesthetic */
.mm-card[data-pool-tier],
.mm-fold[data-pool-tier] {
  background-color: var(--plaque);
  background-image:
    radial-gradient(ellipse 85% 50% at 50% 0%, color-mix(in srgb, var(--gold) 12%, transparent), transparent 68%),
    repeating-linear-gradient(
      90deg,
      color-mix(in srgb, var(--plaque-dark) 40%, transparent) 0px,
      color-mix(in srgb, var(--plaque-dark) 40%, transparent) 2px,
      transparent 2px,
      transparent 26px
    );
  border-color: color-mix(in srgb, var(--gold) 48%, transparent);
  box-shadow:
    inset 0 0 0 3px var(--plaque),
    inset 0 0 0 4px color-mix(in srgb, var(--gold) 22%, transparent),
    var(--shadow-card);
}

.mm-card[data-pool-tier] .mm-card-title {
  color: var(--gold);
  font-family: var(--font-display);
}

.mm-card[data-pool-tier] .mm-card-summary {
  color: var(--text);
}

/* ---------- Dota 2 In-Game Augment Rarity Ribbon & Pool Tier Mapping ---------- */
/* Aligned directly to Dota 2 Midway of Madness in-game tooltips (Shiva/Bloodstone):
   Common = Emerald Green, Uncommon = Cobalt Blue, Rare = Amethyst Purple,
   Legendary / Ancient / Divine / Immortal = Gilded Amber Gold, Eldritch = Spectral Teal */
[data-pool-tier="hero_exclusive"] {
  --card-accent: var(--gold);
  border-top-color: var(--gold);
}

[data-pool-tier="shared_main"] {
  --card-accent: var(--tier-rare);
  border-top-color: var(--tier-rare);
}

[data-pool-tier="universal_flex"] {
  --card-accent: var(--tier-eldritch);
  border-top-color: var(--tier-eldritch);
}

[data-rarity="common"] {
  --card-accent: var(--tier-uncommon);
  border-top-color: var(--tier-uncommon);
  background-image:
    radial-gradient(ellipse 68% 110px at 14% 0%, var(--uncommon-soft), transparent 72%),
    linear-gradient(165deg, color-mix(in srgb, var(--tier-rare) 7%, var(--surface-2)) 0%, var(--surface) 100%);
}

[data-rarity="uncommon"] {
  --card-accent: var(--tier-rare);
  border-top-color: var(--tier-rare);
  background-image:
    radial-gradient(ellipse 68% 110px at 14% 0%, var(--rare-soft), transparent 72%),
    linear-gradient(165deg, color-mix(in srgb, var(--tier-rare) 9%, var(--surface-2)) 0%, var(--surface) 100%);
}

[data-rarity="rare"] {
  --card-accent: var(--tier-legendary);
  border-top-color: var(--tier-legendary);
  background-image:
    radial-gradient(ellipse 68% 110px at 14% 0%, var(--legendary-soft), transparent 72%),
    linear-gradient(165deg, color-mix(in srgb, var(--tier-rare) 8%, var(--surface-2)) 0%, var(--surface) 100%);
}

[data-rarity="legendary"],
[data-rarity="ancient"],
[data-rarity="divine"] {
  --card-accent: var(--gold);
  border-top-color: var(--gold);
  background-image:
    radial-gradient(ellipse 72% 115px at 50% 0%, var(--gold-soft), transparent 72%),
    linear-gradient(165deg, color-mix(in srgb, var(--tier-rare) 7%, var(--surface-2)) 0%, var(--surface) 100%);
}

[data-rarity="immortal"] {
  --card-accent: var(--gold);
  border-color: color-mix(in srgb, var(--gold) 62%, transparent);
  border-top: 3px solid var(--gold);
  background-image:
    radial-gradient(ellipse 78% 125px at 50% 0%, color-mix(in srgb, var(--gold) 24%, transparent), transparent 72%),
    linear-gradient(165deg, color-mix(in srgb, var(--gold) 8%, var(--surface-2)) 0%, var(--surface) 100%);
}

[data-rarity="eldritch"] {
  --card-accent: var(--gold);
  border-color: color-mix(in srgb, var(--gold) 68%, var(--accent));
  border-top: 4px double var(--gold);
  background-image:
    radial-gradient(ellipse 78% 125px at 50% 0%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 72%),
    radial-gradient(ellipse 68% 110px at 15% 0%, var(--gold-soft), transparent 72%),
    linear-gradient(165deg, color-mix(in srgb, var(--accent) 10%, var(--surface-2)) 0%, var(--surface) 100%);
}

[data-rarity="special"] {
  --card-accent: var(--tier-legendary);
  border-top-color: var(--tier-legendary);
  background-image:
    radial-gradient(ellipse 68% 110px at 14% 0%, var(--legendary-soft), transparent 72%),
    linear-gradient(165deg, color-mix(in srgb, var(--tier-rare) 8%, var(--surface-2)) 0%, var(--surface) 100%);
}

/* Full-width bottom luminous rarity band matching in-game Augment tooltip cards */
.mm-rarity-band {
  display: block;
  margin: auto -17px -16px;
  padding: 6px 12px;
  text-align: center;
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  text-shadow: 0 1px 4px color-mix(in srgb, var(--bg) 90%, transparent);
  border-top: 1px solid color-mix(in srgb, var(--card-accent, var(--gold)) 72%, transparent);
  border-bottom: 2px solid var(--card-accent, var(--gold));
  border-radius: 0 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px);
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--card-accent, var(--gold)) 18%, var(--bg)) 0%,
    color-mix(in srgb, var(--card-accent, var(--gold)) 45%, var(--bg)) 50%,
    color-mix(in srgb, var(--card-accent, var(--gold)) 18%, var(--bg)) 100%
  );
}

/* Fiery gilded amber-crimson ribbon matching in-game Ancient / Eldritch Augment tooltips */
.mm-rarity-band.is-eldritch,
[data-rarity="eldritch"] .mm-rarity-band {
  border-top: 2px solid var(--gold);
  border-bottom: 2px solid var(--accent);
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--accent) 46%, var(--bg)) 0%,
    color-mix(in srgb, var(--gold) 44%, var(--bg)) 50%,
    color-mix(in srgb, var(--accent) 46%, var(--bg)) 100%
  );
  box-shadow: inset 0 0 16px color-mix(in srgb, var(--accent) 42%, transparent);
}

.mm-aug-card {
  overflow: hidden;
}

.mm-aug-card .mm-medallion-sm {
  box-shadow:
    0 0 0 2px var(--surface),
    0 0 0 4px color-mix(in srgb, var(--card-accent, var(--gold)) 46%, transparent),
    0 4px 14px color-mix(in srgb, var(--bg) 82%, transparent);
}

/* Badges */
.mm-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: var(--radius-xs);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.35;
  border: 1px solid var(--border-subtle);
  background: var(--bg);
  color: var(--text);
  white-space: nowrap;
}

.mm-badge-gold,
.mm-badge-main,
.mm-badge[data-pool-tier="hero_exclusive"],
.mm-badge[data-rarity="legendary"],
.mm-badge[data-rarity="ancient"],
.mm-badge[data-rarity="divine"],
.mm-badge[data-rarity="immortal"] {
  border-color: color-mix(in srgb, var(--gold) 62%, transparent);
  background: color-mix(in srgb, var(--gold) 18%, var(--bg));
  color: var(--text);
}

.mm-badge-rare,
.mm-badge[data-pool-tier="shared_main"],
.mm-badge[data-rarity="uncommon"] {
  border-color: color-mix(in srgb, var(--tier-rare) 60%, transparent);
  background: color-mix(in srgb, var(--tier-rare) 18%, var(--bg));
  color: var(--text);
}

.mm-badge-legendary,
.mm-badge[data-rarity="rare"],
.mm-badge[data-rarity="special"] {
  border-color: color-mix(in srgb, var(--tier-legendary) 60%, transparent);
  background: color-mix(in srgb, var(--tier-legendary) 20%, var(--bg));
  color: var(--text);
}

.mm-badge-uncommon,
.mm-badge[data-rarity="common"] {
  border-color: color-mix(in srgb, var(--tier-uncommon) 60%, transparent);
  background: color-mix(in srgb, var(--tier-uncommon) 16%, var(--bg));
  color: var(--text);
}

.mm-badge-accent,
.mm-badge-crimson {
  border-color: color-mix(in srgb, var(--accent) 64%, transparent);
  background: color-mix(in srgb, var(--accent) 22%, var(--bg));
  color: var(--text);
}

.mm-badge-eldritch,
.mm-badge[data-pool-tier="universal_flex"],
.mm-badge[data-rarity="eldritch"] {
  border-color: color-mix(in srgb, var(--tier-eldritch) 60%, transparent);
  background: color-mix(in srgb, var(--tier-eldritch) 16%, var(--bg));
  color: var(--text);
}

.mm-badge-muted,
.mm-badge-flex,
.mm-badge[data-rarity="common"] {
  border-color: var(--border-subtle);
  background: var(--bg);
  color: var(--muted);
}

.mm-category-icon {
  color: var(--gold);
  align-self: flex-start;
  padding: 5px;
}

/* Tier Progression Strip */
.mm-tier-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
}

.mm-tier-step {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-bottom: 2px solid var(--card-accent, var(--border));
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text);
}

.mm-tier-val {
  font-weight: 700;
  color: var(--text);
}

/* ---------- Slide-Over Detail Drawer ---------- */
.mm-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(5px);
  z-index: 120;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.mm-drawer-backdrop.is-open,
dialog.mm-drawer-backdrop[open] {
  opacity: 1;
  pointer-events: auto;
}

dialog.mm-drawer-backdrop {
  margin: 0;
  padding: 0;
  border: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  color: var(--text);
}

dialog.mm-drawer-backdrop::backdrop {
  background: transparent;
}

.mm-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(540px, 100vw);
  z-index: 130;
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  border-left: 2px solid var(--gold);
  box-shadow: var(--shadow-deep);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transform: translateX(100%);
  transition: transform 0.2s ease;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px;
}

.mm-drawer.is-open,
dialog.mm-drawer-backdrop[open] .mm-drawer {
  transform: translateX(0);
}

.mm-drawer[hidden],
.mm-drawer-backdrop[hidden],
dialog.mm-drawer-backdrop:not([open]) {
  display: none;
}

.mm-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.mm-drawer dt {
  color: var(--gold);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}

.mm-drawer dd {
  margin: 0 0 12px;
  color: var(--text);
  font-size: var(--fs-sm);
}

.mm-drawer-close {
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--fs-md);
  font-weight: 700;
  cursor: pointer;
  flex: 0 0 auto;
}

.mm-drawer-close:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* Harmonized Tool Controls */
.mm-tool button:not(.mm-card):not(.mm-aug-card):not(.mm-node):not(.mm-arcana-node):not(.mm-pill):not(.mm-tab):not(.mm-hero-tab):not(.mm-btn):not(.mm-group-head):not(.mm-aug-chip):not(.mm-preset-btn):not(.mm-strip-arrow):not(.mm-aug-popover-close):not(.mm-popover-close):not(.mm-plaque-open):not(.mm-tier-tile):not(.mm-tier-tab):not(.mm-tier-role) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.mm-tool button:not(.mm-card):not(.mm-aug-card):not(.mm-node):not(.mm-arcana-node):not(.mm-pill):not(.mm-tab):not(.mm-hero-tab):not(.mm-btn):not(.mm-group-head):not(.mm-aug-chip):not(.mm-preset-btn):not(.mm-strip-arrow):not(.mm-aug-popover-close):not(.mm-popover-close):not(.mm-plaque-open):not(.mm-tier-tile):not(.mm-tier-tab):not(.mm-tier-role):hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold);
}

.mm-tool button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.mm-tool .mm-share,
.mm-tool .mm-accept {
  background: var(--accent) !important;
  border-color: color-mix(in srgb, var(--gold) 40%, var(--accent)) !important;
  color: var(--text) !important;
}

.mm-tool .mm-share:hover:not(:disabled),
.mm-tool .mm-accept:hover:not(:disabled) {
  background: var(--accent-hover) !important;
  border-color: var(--gold) !important;
  color: var(--text) !important;
}

.mm-tool .mm-alert:empty {
  display: none;
}

.mm-tool .mm-full-effect {
  white-space: pre-line;
  line-height: 1.6;
}

.mm-tool .mm-count {
  font-size: var(--fs-sm);
  color: var(--muted);
  font-weight: 600;
}

.mm-tool .mm-node-key {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--muted);
}

/* ==========================================================================
   7. Strange Exchange: Hades II Arcana Card Planner & Stat Encyclopedia
   ========================================================================== */
.mm-planner-bar {
  position: sticky;
  top: 64px;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 14px 18px;
  background: color-mix(in srgb, var(--surface-2) 94%, var(--bg));
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-deep);
}

.mm-planner-bar label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mm-planner-bar-group,
.mm-planner-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.mm-budget-meter {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--gold);
  font-family: var(--font-mono);
}

.mm-budget-meter.is-over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 24%, var(--bg));
  color: var(--text);
}

/* Upgrade Planner Live Build Summary Strip & One-Click Preset Bar */
.mm-preset-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--bg) 74%, var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.mm-preset-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
  margin-right: 4px;
}

.mm-preset-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.mm-preset-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: color-mix(in srgb, var(--gold) 12%, var(--surface-2));
}

.mm-preset-btn.is-active,
.mm-preset-btn[aria-pressed="true"] {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--accent) 28%, var(--surface-2));
  color: var(--gold);
  box-shadow: 0 0 12px color-mix(in srgb, var(--gold) 22%, transparent);
}

.mm-build-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 12px 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 11%, var(--surface-2)) 0%, var(--surface) 100%);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.mm-build-summary-head {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mm-build-summary-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.04em;
}

.mm-build-summary-cogs {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--gold);
}

.mm-build-summary-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex: 1 1 320px;
}

.mm-build-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-xs);
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text);
}

.mm-build-stat-chip strong {
  color: var(--gold);
  font-family: var(--font-mono);
}

.mm-alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.mm-alert-error {
  border-color: color-mix(in srgb, var(--accent) 64%, transparent);
  border-left-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 22%, var(--surface));
  color: var(--text);
}

.mm-alert-warn {
  border-color: var(--border-strong);
  border-left-color: var(--gold);
  background: var(--gold-soft);
  color: var(--text);
}

.mm-alert-info,
.mm-alert-success {
  border-color: color-mix(in srgb, var(--tier-eldritch) 58%, transparent);
  border-left-color: var(--tier-eldritch);
  background: var(--eldritch-soft);
  color: var(--text);
}

.mm-confirm-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 20%, var(--surface));
  color: var(--text);
  font-size: var(--fs-sm);
}

.mm-confirm-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mm-planner-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

/* In-Game 8x8 Strange Exchange Crimson-Velvet Curtain Upgrade Stage */
.mm-board-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 70% 60% at 50% 42%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 72%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 78%, transparent) 0%, color-mix(in srgb, var(--bg) 68%, transparent) 50%, color-mix(in srgb, var(--bg) 88%, transparent) 100%),
    url("https://img.midwaymadness.org/s_0q0c4m5h5c6z0u/curtains.27f01c670f.jpg");
  background-size: auto, auto, cover;
  background-position: center, center, center top;
  box-shadow:
    inset 0 0 0 4px color-mix(in srgb, var(--bg) 76%, transparent),
    inset 0 0 0 5px color-mix(in srgb, var(--gold) 26%, transparent),
    var(--shadow-deep);
}

.mm-branches {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.mm-branch {
  padding: 16px;
  background: color-mix(in srgb, var(--bg) 72%, var(--surface));
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
}

.mm-track {
  padding: 12px 16px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 16%, transparent);
  border-radius: 0;
}

.mm-track:last-child {
  border-bottom: 0;
}

.mm-branch-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.mm-branch-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-md);
  color: var(--gold);
  letter-spacing: 0.04em;
  text-shadow: 0 2px 8px color-mix(in srgb, var(--bg) 90%, transparent);
}

.mm-branch-head small {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--muted);
}

.mm-branch-nodes {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
}

.mm-branch-nodes::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 50%;
  height: 2px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 38%, transparent), color-mix(in srgb, var(--gold) 18%, transparent));
  z-index: 0;
  pointer-events: none;
}

/* Circular Bronze Medallion Nodes (matches Dota 2 Midway of Madness 8x8 Upgrade Tree) */
.mm-node {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-height: 112px;
  padding: 11px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  box-shadow: var(--shadow-card);
  color: var(--text);
  text-align: left;
  font-family: var(--font-sans);
  cursor: pointer;
  min-width: 0;
  overflow-wrap: anywhere;
  transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.16s ease, box-shadow 0.18s ease, opacity 0.16s ease;
}

.mm-node.mm-arcana-node {
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  min-height: 0;
  padding: 4px 4px 6px;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.mm-node-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 6px 0 2px;
  border-radius: 50%;
  color: var(--muted);
  border: 3px double color-mix(in srgb, var(--gold) 72%, var(--bg));
  background: radial-gradient(circle at 38% 28%, color-mix(in srgb, var(--tier-rare) 18%, var(--surface-2)), var(--bg) 82%);
  box-shadow:
    0 0 0 2px var(--bg),
    0 0 0 3px color-mix(in srgb, var(--gold) 24%, transparent),
    0 6px 14px color-mix(in srgb, var(--bg) 85%, transparent);
  font-family: var(--font-display);
  font-size: var(--fs-base);
  font-weight: 700;
  transition: border-color 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.18s ease, background 0.18s ease;
}

/* Columns 4 & 8 Keystone Large Medallions */
.is-keystone .mm-node-ring,
.mm-track .mm-arcana-node:nth-child(4) .mm-node-ring,
.mm-track .mm-arcana-node:nth-child(8) .mm-node-ring {
  width: 56px;
  height: 56px;
  margin: 0 0 2px;
  border-width: 4px;
  border-color: color-mix(in srgb, var(--gold) 84%, var(--bg));
  box-shadow:
    0 0 0 2px var(--bg),
    0 0 0 4px color-mix(in srgb, var(--gold) 36%, transparent),
    0 8px 18px color-mix(in srgb, var(--bg) 88%, transparent);
  font-size: var(--fs-md);
}

.mm-arcana-node:hover .mm-node-ring,
.mm-arcana-node:focus-visible .mm-node-ring,
.mm-arcana-node[data-inspected] .mm-node-ring {
  transform: scale(1.07);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow:
    0 0 0 2px var(--bg),
    0 0 14px color-mix(in srgb, var(--gold) 44%, transparent);
}

/* Warm Golden Lantern Activation Glow (matches illuminated Luck node in in-game tree) */
.mm-arcana-node.is-selected .mm-node-ring {
  color: var(--bg);
  border-color: var(--gold);
  background: radial-gradient(circle at 42% 35%, var(--text) 0%, var(--gold) 52%, color-mix(in srgb, var(--gold) 45%, var(--surface)) 100%);
  box-shadow:
    0 0 0 2px var(--bg),
    0 0 18px color-mix(in srgb, var(--gold) 78%, transparent),
    0 0 32px color-mix(in srgb, var(--gold) 40%, transparent);
}

.mm-arcana-node.is-over .mm-node-ring {
  color: var(--text);
  border-color: var(--accent);
  background: radial-gradient(circle at 40% 32%, var(--accent) 0%, color-mix(in srgb, var(--accent) 45%, var(--bg)) 100%);
  box-shadow:
    0 0 0 2px var(--bg),
    0 0 16px color-mix(in srgb, var(--accent) 72%, transparent);
}

.mm-arcana-node.is-locked .mm-node-ring {
  opacity: 0.62;
}

.mm-arcana-node.is-locked:hover .mm-node-ring {
  opacity: 0.94;
}

.mm-node:not(.mm-arcana-node):hover:not(:disabled) {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--gold) 18%, transparent);
}

.mm-node-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.mm-node-step {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--muted);
}

.mm-node-title {
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.32;
  color: var(--text);
}

.mm-node-val {
  font-size: var(--fs-xs);
  color: var(--gold);
  font-weight: 600;
  line-height: 1.32;
}

.mm-node-cost {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--gold);
}

.mm-arcana-node .mm-node-cost {
  align-self: center;
  padding: 0 4px;
  background: transparent;
  border: 0;
  color: var(--gold);
  text-shadow: 0 1px 4px color-mix(in srgb, var(--bg) 92%, transparent);
}

.mm-node:not(.mm-arcana-node).is-available {
  border-color: var(--border-strong);
  background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 10%, var(--surface-2)), var(--surface));
}

.mm-node:not(.mm-arcana-node).is-selected {
  border-color: var(--gold);
  background:
    radial-gradient(ellipse 90% 60% at 50% 0%, color-mix(in srgb, var(--gold) 28%, transparent), transparent 72%),
    linear-gradient(180deg, color-mix(in srgb, var(--gold) 16%, var(--surface-2)), var(--surface));
  box-shadow: inset 0 2px 0 var(--gold), 0 8px 22px color-mix(in srgb, var(--gold) 26%, transparent);
}

.mm-node:not(.mm-arcana-node).is-selected .mm-node-cost {
  background: var(--gold);
  color: var(--bg);
  border-color: var(--gold);
}

.mm-node:not(.mm-arcana-node).is-over {
  border-color: var(--accent);
  background:
    radial-gradient(ellipse 90% 60% at 50% 0%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 72%),
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 18%, var(--surface-2)), var(--surface));
}

.mm-node:not(.mm-arcana-node).is-over .mm-node-cost {
  background: var(--accent);
  color: var(--text);
  border-color: var(--accent);
}

.mm-node:not(.mm-arcana-node).is-locked {
  opacity: 0.56;
  background: var(--bg);
  border-style: dashed;
  box-shadow: none;
}

.mm-node:not(.mm-arcana-node).is-locked:hover {
  opacity: 0.88;
}

.mm-summary {
  padding: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-top: 2px solid var(--gold);
  border-radius: var(--radius);
  min-width: 0;
}

.mm-summary h2,
.mm-summary h3 {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  margin-bottom: 10px;
  color: var(--gold);
}

.mm-summary h4 {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 14px 0 8px;
}

.mm-summary ul,
.mm-summary-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mm-summary li,
.mm-summary-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  font-size: var(--fs-xs);
  color: var(--text);
}

.mm-summary small {
  color: var(--muted);
  font-size: var(--fs-xs);
}

.mm-summary summary {
  cursor: pointer;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--gold);
  padding: 8px 0 4px;
}

/* Level-by-Level Progression Ladder Table */
.mm-step-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
}

.mm-step-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--surface-2);
  color: var(--gold);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}

.mm-step-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text);
  vertical-align: top;
}

.mm-step-table tr:last-child td {
  border-bottom: 0;
}

.mm-step-table tr.is-active td {
  background: var(--gold-soft);
}

.mm-step-table .mm-step-gain {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--gold);
}

/* Attribute & Stat Glossary Cards */
.mm-glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.mm-glossary-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 15px 16px;
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-top: 2px solid var(--gold);
  border-radius: var(--radius-sm);
}

.mm-glossary-term {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text);
}

.mm-glossary-val {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--gold);
}

.mm-glossary-desc {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--muted);
  line-height: 1.5;
}

/* ==========================================================================
   8. Dark Carnival Brass-Framed Antiques Compendium (/antiques & /zh/antiques)
   Warm Purple-Walnut & Antique Brass Ledger (Distinct from Emerald Souvenirs)
   ========================================================================== */

/* Server-Rendered Scale Data Strip (Zero-JS Crawler & Instant Glance Banner) */
.mm-ssr-scale-strip {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: -10px 0 18px;
  padding: 11px 16px;
  background:
    radial-gradient(ellipse 60% 100% at 0% 50%, color-mix(in srgb, var(--gold) 14%, transparent), transparent 72%),
    linear-gradient(90deg, color-mix(in srgb, var(--surface-2) 92%, var(--bg)) 0%, var(--surface) 60%, color-mix(in srgb, var(--gold) 7%, var(--surface)) 100%);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--gold) 24%, transparent),
    var(--shadow-card);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--text);
}

.mm-ssr-scale-strip::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  transform: rotate(45deg);
  background: var(--gold);
  border: 1px solid var(--text);
  box-shadow: 0 0 8px color-mix(in srgb, var(--gold) 55%, transparent);
}

.mm-ssr-scale-strip strong {
  color: var(--gold);
}

/* Antiques Tool Shell & Filter Controls */
.mm-ant-app {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.mm-ant-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1.55fr) repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-top: 2px solid var(--gold);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
}

.mm-ant-controls label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mm-ant-controls input,
.mm-ant-controls select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 12px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mm-ant-controls input::placeholder {
  color: var(--muted);
}

.mm-ant-controls input:focus,
.mm-ant-controls select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 26%, transparent);
}

/* Reverse Recipe Lookup Bar ("What Can I Craft From My Bag?") */
.mm-ant-reverse-bar {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px 18px;
  background:
    radial-gradient(ellipse 56% 120% at 100% 0%, color-mix(in srgb, var(--gold) 13%, transparent), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 86%, var(--bg)) 0%, var(--bg) 100%);
  border: 1px solid var(--border-strong);
  border-top: 2px solid var(--gold);
  border-radius: var(--radius);
  box-shadow:
    inset 0 0 0 3px color-mix(in srgb, var(--bg) 70%, transparent),
    var(--shadow-card);
}

.mm-ant-reverse-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
}

.mm-ant-reverse-title,
.mm-ant-reverse-bar > h2 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--gold);
}

.mm-ant-reverse-hint,
.mm-ant-reverse-bar > p {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--muted);
}

.mm-ant-reverse-chips,
.mm-ant-ing-list,
.mm-ant-reverse-bar [data-reverse] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.mm-ant-reverse-bar [data-selection] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--gold);
}

.mm-ant-reverse-bar [data-selection]:empty {
  display: none;
}

.mm-ant-app button[data-clear],
.mm-ant-app button[data-retry] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--gold);
  background: var(--surface-2);
  color: var(--gold);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.mm-ant-app button[data-clear]:hover,
.mm-ant-app button[data-retry]:hover {
  background: var(--gold);
  color: var(--bg);
}

/* Reverse Lookup Ingredient Capsules (22x16 Item Icon + Name + Count Badge) */
.mm-ant-ing-chip,
.mm-ant-reverse-bar .mm-ant-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 4px 10px 4px 6px;
  border-radius: var(--radius-pill);
  border: 1px solid color-mix(in srgb, var(--gold) 36%, transparent);
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease, transform 0.14s ease, box-shadow 0.18s ease;
}

.mm-ant-ing-chip img,
.mm-ant-reverse-bar .mm-ant-chip img {
  width: 22px;
  height: 16px;
  flex: 0 0 22px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid color-mix(in srgb, var(--gold) 52%, transparent);
  background: var(--bg);
  display: block;
}

.mm-ant-ing-chip .mm-ant-ing-count,
.mm-ant-ing-chip .mm-ant-chip-count,
.mm-ant-ing-chip small,
.mm-ant-ing-chip em,
.mm-ant-reverse-bar .mm-ant-chip b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  border: 1px solid color-mix(in srgb, var(--gold) 38%, transparent);
  color: var(--gold);
  font-family: var(--font-mono);
  font-style: normal;
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.25;
}

.mm-ant-ing-chip:hover,
.mm-ant-reverse-bar .mm-ant-chip:hover {
  transform: translateY(-1px);
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 14%, var(--surface-2));
  color: var(--text);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--gold) 16%, transparent);
}

.mm-ant-ing-chip.is-active,
.mm-ant-ing-chip.is-selected,
.mm-ant-ing-chip[aria-pressed="true"],
.mm-ant-reverse-bar .mm-ant-chip[aria-pressed="true"] {
  background: var(--gold);
  border-color: var(--text);
  color: var(--bg);
  font-weight: 700;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--gold) 36%, transparent),
    0 4px 18px color-mix(in srgb, var(--gold) 34%, transparent);
}

.mm-ant-ing-chip.is-active img,
.mm-ant-ing-chip.is-selected img,
.mm-ant-ing-chip[aria-pressed="true"] img,
.mm-ant-reverse-bar .mm-ant-chip[aria-pressed="true"] img {
  border-color: var(--bg);
}

.mm-ant-ing-chip.is-active .mm-ant-ing-count,
.mm-ant-ing-chip.is-selected .mm-ant-ing-count,
.mm-ant-ing-chip[aria-pressed="true"] .mm-ant-ing-count,
.mm-ant-ing-chip.is-active .mm-ant-chip-count,
.mm-ant-ing-chip.is-selected .mm-ant-chip-count,
.mm-ant-ing-chip[aria-pressed="true"] .mm-ant-chip-count,
.mm-ant-ing-chip.is-active small,
.mm-ant-ing-chip.is-selected small,
.mm-ant-ing-chip[aria-pressed="true"] small,
.mm-ant-ing-chip.is-active em,
.mm-ant-ing-chip.is-selected em,
.mm-ant-ing-chip[aria-pressed="true"] em,
.mm-ant-reverse-bar .mm-ant-chip[aria-pressed="true"] b {
  background: var(--bg);
  border-color: var(--bg);
  color: var(--gold);
}

/* Pool Filter Tabs & Live Count Bar */
.mm-ant-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.mm-ant-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.16s ease;
}

.mm-ant-tabs button:hover {
  border-color: var(--gold);
  color: var(--text);
  background: var(--surface-2);
}

.mm-ant-tabs button[aria-pressed="true"] {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--bg);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--gold) 28%, transparent);
}

.mm-ant-app [data-count] {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--gold);
}

/* Spacious 2-Column Antique Card Grid (Desktop) */
.mm-ant-grid,
.mm-ant-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.mm-ant-results > p {
  grid-column: 1 / -1;
  margin: 0;
  padding: 28px 20px;
  text-align: center;
  background: var(--bg);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: var(--fs-sm);
}

/* Deep Purple-Walnut & Double Antique-Brass Recipe Card */
.mm-ant-card {
  --ant-accent: var(--gold);
  --ant-glow: color-mix(in srgb, var(--gold) 22%, transparent);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px 16px;
  min-width: 0;
  overflow-wrap: anywhere;
  background-color: var(--surface);
  background-image:
    radial-gradient(ellipse 85% 42% at 50% 0%, color-mix(in srgb, var(--gold) 14%, transparent), transparent 68%),
    radial-gradient(ellipse 90% 55% at 100% 100%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 72%),
    repeating-linear-gradient(
      180deg,
      color-mix(in srgb, var(--bg) 28%, transparent) 0px,
      color-mix(in srgb, var(--bg) 28%, transparent) 2px,
      color-mix(in srgb, var(--surface-2) 22%, transparent) 2px,
      color-mix(in srgb, var(--surface-2) 22%, transparent) 18px,
      transparent 18px,
      transparent 36px
    );
  border: 1px solid color-mix(in srgb, var(--ant-accent) 64%, transparent);
  border-radius: var(--radius);
  box-shadow:
    inset 0 0 0 3px var(--surface),
    inset 0 0 0 4px color-mix(in srgb, var(--ant-accent) 28%, transparent),
    var(--shadow-card);
  color: var(--text);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.2s ease;
}

/* Four subtle antique brass corner rivets */
.mm-ant-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background-image:
    radial-gradient(circle 2.4px at 9px 9px, var(--ant-accent) 55%, transparent 100%),
    radial-gradient(circle 2.4px at calc(100% - 9px) 9px, var(--ant-accent) 55%, transparent 100%),
    radial-gradient(circle 2.4px at 9px calc(100% - 9px), var(--ant-accent) 55%, transparent 100%),
    radial-gradient(circle 2.4px at calc(100% - 9px) calc(100% - 9px), var(--ant-accent) 55%, transparent 100%);
}

.mm-ant-card:hover {
  transform: translateY(-2px);
  border-color: var(--ant-accent);
  box-shadow:
    inset 0 0 0 3px var(--surface),
    inset 0 0 0 4px color-mix(in srgb, var(--ant-accent) 54%, transparent),
    0 0 24px var(--ant-glow),
    var(--shadow-deep);
}

.mm-ant-card:target,
.mm-ant-card[data-shared],
.mm-ant-card.is-highlighted {
  border-color: var(--gold);
  box-shadow:
    inset 0 0 0 3px var(--surface),
    inset 0 0 0 5px var(--gold),
    0 0 28px color-mix(in srgb, var(--gold) 38%, transparent),
    var(--shadow-deep);
}

.mm-ant-card[data-status="off_pool"] {
  --ant-accent: var(--tier-rare);
  --ant-glow: color-mix(in srgb, var(--tier-rare) 22%, transparent);
}

/* Card Header: 56x42 Chamfered Brass Item Frame + Dual-Line Title + Gold/Tier/Share */
.mm-ant-head,
.mm-ant-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.mm-ant-card > header {
  justify-content: flex-start;
}

.mm-ant-card > header > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1 1 auto;
}

.mm-ant-card > header small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.mm-ant-head-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.mm-ant-icon-wrap,
.mm-ant-icon-frame {
  position: relative;
  width: 56px;
  height: 42px;
  flex: 0 0 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 22%, var(--surface-2)), var(--bg));
  border: 1.5px solid var(--ant-accent);
  border-radius: var(--radius-xs);
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--gold) 44%, transparent),
    0 4px 12px color-mix(in srgb, var(--bg) 82%, transparent);
  overflow: hidden;
}

.mm-ant-icon-wrap img,
.mm-ant-icon-frame img,
.mm-ant-head > img,
.mm-ant-card > header > img,
.mm-ant-emblem,
.mm-ant-icon {
  width: 56px;
  height: 42px;
  flex: 0 0 56px;
  object-fit: cover;
  display: block;
  background: var(--bg);
}

.mm-ant-head > img,
.mm-ant-card > header > img,
.mm-ant-emblem,
.mm-ant-icon:not(.mm-ant-icon-wrap img):not(.mm-ant-icon-frame img) {
  border: 1.5px solid var(--ant-accent);
  border-radius: var(--radius-xs);
  clip-path: polygon(5px 0, calc(100% - 5px) 0, 100% 5px, 100% calc(100% - 5px), calc(100% - 5px) 100%, 5px 100%, 0 calc(100% - 5px), 0 5px);
  box-shadow:
    0 0 0 2px var(--surface),
    0 0 0 3px color-mix(in srgb, var(--ant-accent) 44%, transparent),
    0 4px 12px color-mix(in srgb, var(--bg) 82%, transparent);
}

.mm-ant-emblem {
  padding: 4px;
  color: var(--gold);
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--accent) 34%, var(--surface-2)), var(--bg) 85%);
}

.mm-ant-icon-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 700;
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--accent) 34%, var(--surface-2)), var(--bg) 85%);
}

.mm-ant-title-wrap,
.mm-ant-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.mm-ant-title,
.mm-ant-head h3,
.mm-ant-head h4,
.mm-ant-card > header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: 0.02em;
  color: var(--gold);
  text-shadow: 0 1px 6px color-mix(in srgb, var(--bg) 84%, transparent);
}

.mm-ant-sub,
.mm-ant-en {
  display: block;
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1.35;
  color: var(--muted);
}

.mm-ant-pool {
  align-self: flex-start;
  margin: -2px 0 0;
  padding: 2px 9px;
  border-radius: var(--radius-xs);
  border: 1px solid color-mix(in srgb, var(--tier-legendary) 58%, transparent);
  background: color-mix(in srgb, var(--tier-legendary) 16%, var(--bg));
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.mm-ant-head-right,
.mm-ant-badges,
.mm-ant-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}

/* Gold Coin Total Badge */
.mm-ant-gold {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 2px 9px;
  border-radius: var(--radius-xs);
  background: color-mix(in srgb, var(--gold) 16%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--gold) 70%, transparent);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Priority Badges (A / B / C) & Status Tags */
.mm-ant-tier,
.mm-ant-prio,
.mm-ant-status,
.mm-ant-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.mm-ant-tier[data-priority="A"],
.mm-ant-prio[data-priority="A"],
.mm-ant-prio-a,
.mm-ant-tier-a {
  background: var(--accent);
  border-color: var(--gold);
  color: var(--text);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--gold) 45%, transparent);
}

.mm-ant-tier[data-priority="B"],
.mm-ant-prio[data-priority="B"],
.mm-ant-prio-b,
.mm-ant-tier-b {
  background: color-mix(in srgb, var(--tier-rare) 22%, var(--bg));
  border-color: var(--tier-rare);
  color: var(--text);
}

.mm-ant-tier[data-priority="C"],
.mm-ant-prio[data-priority="C"],
.mm-ant-prio-c,
.mm-ant-tier-c {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--muted);
}

.mm-ant-status[data-status="off_pool"],
.mm-ant-badge[data-status="off_pool"] {
  border-color: color-mix(in srgb, var(--tier-rare) 65%, transparent);
  background: color-mix(in srgb, var(--tier-rare) 16%, var(--bg));
  color: var(--text);
}

/* Share Anchor Button (High Contrast >= 4.5:1) */
.mm-ant-share,
.mm-ant-anchor {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  align-self: flex-end;
  margin-top: auto;
  min-width: 30px;
  min-height: 32px;
  padding: 4px 12px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--gold);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.mm-ant-head .mm-ant-share,
.mm-ant-head .mm-ant-anchor {
  align-self: center;
  margin-top: 0;
}

.mm-ant-share:hover,
.mm-ant-anchor:hover {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--bg);
}

.mm-ant-share.is-copied,
.mm-ant-anchor.is-copied {
  border-color: var(--tier-uncommon);
  background: color-mix(in srgb, var(--tier-uncommon) 20%, var(--bg));
  color: var(--tier-uncommon);
}

.mm-ant-card > input[readonly] {
  width: 100%;
  margin-top: auto;
  padding: 6px 10px;
  background: var(--bg);
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}

/* Signature Visual Crafting Formula Box (Recessed Dark-Gold Grooved Tray) */
.mm-ant-recipe-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 13px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 90%, var(--surface)) 0%, color-mix(in srgb, var(--gold) 7%, var(--bg)) 100%);
  border: 1px solid color-mix(in srgb, var(--gold) 42%, transparent);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 2px 8px color-mix(in srgb, var(--bg) 78%, transparent);
}

.mm-ant-recipe-label,
.mm-ant-recipe-box > small {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--muted);
  line-height: 1.45;
}

.mm-ant-recipe-row,
.mm-ant-route,
.mm-ant-formula {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.mm-ant-comp,
.mm-ant-part,
.mm-ant-recipe-ing,
.mm-ant-formula .mm-ant-chip,
.mm-ant-scroll {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 3px 8px 3px 5px;
  border-radius: var(--radius-xs);
  border: 1px solid color-mix(in srgb, var(--gold) 36%, transparent);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.14s ease, background-color 0.14s ease, color 0.14s ease, transform 0.12s ease;
}

.mm-ant-comp img,
.mm-ant-part img,
.mm-ant-recipe-ing img,
.mm-ant-formula .mm-ant-chip img,
.mm-ant-scroll img {
  width: 24px;
  height: 18px;
  flex: 0 0 24px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid color-mix(in srgb, var(--gold) 48%, transparent);
  background: var(--bg);
  display: block;
}

.mm-ant-formula .mm-ant-chip b {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--gold);
}

.mm-ant-comp:hover,
.mm-ant-part:hover,
.mm-ant-recipe-ing:hover,
.mm-ant-formula button.mm-ant-chip:hover {
  transform: translateY(-1px);
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 18%, var(--surface-2));
  color: var(--gold);
}

.mm-ant-comp.is-active,
.mm-ant-part.is-active,
.mm-ant-recipe-ing.is-active,
.mm-ant-formula button.mm-ant-chip[aria-pressed="true"] {
  background: var(--gold);
  border-color: var(--text);
  color: var(--bg);
  font-weight: 700;
}

.mm-ant-formula button.mm-ant-chip[aria-pressed="true"] b {
  color: var(--bg);
}

.mm-ant-formula span.mm-ant-chip:not(.mm-ant-scroll) {
  cursor: default;
}

.mm-ant-scroll,
.mm-ant-formula .mm-ant-scroll,
.mm-ant-comp.is-scroll,
.mm-ant-part.is-scroll {
  cursor: default;
  border-style: dashed;
  border-color: color-mix(in srgb, var(--gold) 54%, transparent);
  background: color-mix(in srgb, var(--gold) 10%, var(--bg));
  color: var(--gold);
  font-family: var(--font-mono);
}

.mm-ant-op,
.mm-ant-plus,
.mm-ant-arrow,
.mm-ant-formula > span[aria-hidden="true"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--gold);
  user-select: none;
}

.mm-ant-arrow {
  padding-inline: 2px;
}

.mm-ant-total,
.mm-ant-route-cost {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-xs);
  background: color-mix(in srgb, var(--gold) 18%, var(--bg));
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  white-space: nowrap;
}

/* Multi-Route OR / 或 Divider */
.mm-ant-or,
.mm-ant-route-or {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.mm-ant-or::before,
.mm-ant-or::after,
.mm-ant-route-or::before,
.mm-ant-route-or::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--gold) 45%, transparent), transparent);
}

.mm-ant-no-recipe {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--muted);
  line-height: 1.5;
}

/* Details Container, Stat Attribute Pills & Ability Effect Blocks */
.mm-ant-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mm-ant-stats,
.mm-ant-details > ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mm-ant-stats > span,
.mm-ant-stats > li,
.mm-ant-details > ul > li,
.mm-ant-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-xs);
  background: color-mix(in srgb, var(--bg) 76%, var(--surface-2));
  border: 1px solid var(--border-subtle);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.mm-ant-stats strong,
.mm-ant-stat strong {
  color: var(--gold);
  font-family: var(--font-mono);
}

/* Active / Passive Ability Effect Panel */
.mm-ant-ability,
.mm-ant-details > p {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-2) 66%, var(--bg));
  border: 1px solid var(--border-subtle);
  border-left: 2px solid color-mix(in srgb, var(--gold) 58%, transparent);
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--text);
}

.mm-ant-details > p {
  display: block;
}

.mm-ant-ability p {
  margin: 0;
}

.mm-ant-ability strong,
.mm-ant-details > p strong {
  color: var(--gold);
}

.mm-ant-details > p small {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: var(--radius-xs);
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--gold);
}

.mm-ant-ability-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
}

.mm-ant-ability-name {
  font-weight: 700;
  color: var(--gold);
  font-size: var(--fs-sm);
}

.mm-ant-ability-meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--muted);
}

/* Hero Pool Link Capsules (-> /heroes/<slug>) */
.mm-ant-heroes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  font-size: var(--fs-xs);
  color: var(--tier-eldritch);
  font-weight: 600;
}

.mm-ant-heroes-label,
.mm-ant-heroes > small {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--muted);
  margin-right: 2px;
}

.mm-ant-heroes a,
.mm-ant-hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  border: 1px solid color-mix(in srgb, var(--gold) 34%, transparent);
  color: var(--text);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.14s ease, background-color 0.14s ease, color 0.14s ease;
}

.mm-ant-heroes a:hover,
.mm-ant-hero-pill:hover {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 16%, var(--surface-2));
  color: var(--gold);
}

.mm-ant-heroes img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.mm-ant-hero-all {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--eldritch-soft);
  border: 1px solid color-mix(in srgb, var(--tier-eldritch) 65%, transparent);
  color: var(--tier-eldritch);
  font-size: var(--fs-xs);
  font-weight: 700;
}

/* Priority & Crafting Recommendation Strip */
.mm-ant-priority,
.mm-ant-note {
  margin: 0;
  padding: 8px 11px;
  border-radius: var(--radius-xs);
  background: color-mix(in srgb, var(--gold) 9%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--gold) 28%, transparent);
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--muted);
}

.mm-ant-priority strong,
.mm-ant-note strong {
  color: var(--gold);
}

/* ---------- FAQ Accordion ---------- */
.mm-faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mm-faq-item {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-left: 2px solid var(--border);
  border-radius: var(--radius-sm);
}

.mm-faq-item[open] {
  border-color: var(--border);
  border-left-color: var(--gold);
}

.mm-faq-q {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  min-height: 52px;
}

.mm-faq-q::-webkit-details-marker {
  display: none;
}

.mm-faq-q::after {
  content: "+";
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--gold);
  font-size: var(--fs-md);
  line-height: 1;
}

.mm-faq-item[open] .mm-faq-q::after {
  content: "\2212";
  background: var(--gold-soft);
  border-color: var(--gold);
}

.mm-faq-a {
  padding: 0 18px 16px;
  color: var(--muted);
  font-size: var(--fs-sm);
  max-width: 72ch;
}

.mm-faq-a p:last-child {
  margin-bottom: 0;
}

/* ---------- 404 Page ---------- */
.mm-not-found {
  max-width: 680px;
  margin: 36px auto;
  padding: 40px 32px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-deep);
}

.mm-not-found-title {
  font-size: var(--fs-2xl);
  color: var(--gold);
  margin-bottom: 12px;
}

.mm-not-found-desc {
  color: var(--muted);
  max-width: 54ch;
  margin: 0 auto 24px;
}

.mm-not-found-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* ---------- Footer (Dark Carnival Atmospheric Backdrop & Winged Eye Crest) ---------- */
.mm-footer {
  position: relative;
  margin-top: auto;
  background-color: var(--bg);
  background-image:
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 88%, transparent) 0%, color-mix(in srgb, var(--bg) 96%, transparent) 100%),
    url("https://img.midwaymadness.org/s_0q0c4m5h5c6z0u/footer-background.5cab877a4f.jpg");
  background-size: auto, cover;
  background-position: center, center bottom;
  border-top: 1px solid var(--border-strong);
  padding-block: 44px 28px;
}

.mm-footer-crest {
  position: absolute;
  top: -19px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  line-height: 0;
  pointer-events: none;
}

.mm-footer-eye {
  width: 68px;
  height: auto;
  display: block;
  opacity: 0.88;
}

.mm-footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-subtle);
}

.mm-brand-footer {
  margin-bottom: 10px;
  min-height: auto;
}

.mm-footer-desc {
  font-size: var(--fs-sm);
  color: var(--muted);
  max-width: 46ch;
  margin-bottom: 12px;
}

.mm-footer-contact {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin-bottom: 0;
}

.mm-footer-heading {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin: 0 0 12px;
}

.mm-footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mm-footer-links a {
  font-size: var(--fs-sm);
  color: var(--muted);
  text-decoration: none;
}

.mm-footer-links a:hover {
  color: var(--gold);
}

.mm-footer-bottom {
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
}

.mm-disclaimer,
.mm-copyright {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin: 0;
}

.mm-disclaimer {
  max-width: 72ch;
}

.mm-copyright {
  white-space: nowrap;
}

/* ==========================================================================
   Responsive Breakpoints (Zero Horizontal Overflow Down to 320px)
   ========================================================================== */

@media (max-width: 1120px) {
  .mm-nav-link {
    padding: 0 5px;
    font-size: var(--fs-xs);
  }

  .mm-nav-link::after {
    left: 5px;
    right: 5px;
  }

  .mm-nav-list::before,
  .mm-nav-list::after {
    display: none;
  }
}

@media (max-width: 1024px) {
  .mm-quick-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mm-quick-link {
    border-bottom: 1px solid var(--border-subtle);
  }

  .mm-quick-link:nth-child(even) {
    border-right: 0;
  }

  .mm-hero-grid,
  .mm-hub-grid,
  .mm-tool-stage .mm-tool .mm-hub-roster .mm-hero-grid,
  .mm-tool-stage .mm-tool .mm-hero-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mm-souvenir-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mm-planner-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .mm-branch-nodes {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .mm-branch-nodes::before {
    display: none;
  }
}

@media (max-width: 960px) {
  .mm-header-inner {
    flex-wrap: wrap;
  }

  .mm-prose table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mm-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mm-ant-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mm-ant-grid,
  .mm-ant-results {
    grid-template-columns: minmax(0, 1fr);
  }

  .mm-hero-splash,
  .mm-hero-banner {
    grid-template-columns: minmax(0, 1fr);
  }

  .mm-footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .mm-footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .mm-container {
    padding-inline: 14px;
  }

  .mm-main {
    padding-block: 18px 44px;
  }

  .mm-section {
    margin-top: 34px;
  }

  h1,
  .mm-stage-title,
  .mm-page-title,
  .mm-tool-title,
  .mm-hero-splash-title,
  .mm-not-found-title {
    font-size: var(--fs-xl);
  }

  h2 {
    font-size: var(--fs-lg);
  }

  /* Single-Row Compact Mobile Header (390px: Brand + Patch on left, EN/中 + Menu on right) */
  .mm-header-inner {
    min-height: 52px;
    padding-block: 6px;
    gap: 6px 8px;
  }

  .mm-brand-wrap {
    flex: 1 1 auto;
    min-width: 0;
    gap: 6px;
  }

  .mm-brand {
    min-height: 36px;
    gap: 6px;
    min-width: 0;
  }

  .mm-brand-icon,
  .mm-brand-icon img,
  .mm-brand-icon svg {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
  }

  .mm-brand-name {
    font-size: var(--fs-sm);
    letter-spacing: 0.02em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mm-patch-pill {
    padding: 1px 5px;
    flex: 0 0 auto;
  }

  .mm-header-actions {
    display: inline-flex;
  }

  .mm-nav-trigger {
    display: inline-flex;
  }

  .mm-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
  }

  .mm-nav-toggle:checked ~ .mm-nav {
    display: flex;
  }

  .mm-nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .mm-nav-list::before,
  .mm-nav-list::after,
  .mm-nav-list li + li::before {
    display: none;
  }

  .mm-nav-list li {
    display: block;
  }

  .mm-nav-link {
    width: 100%;
    padding: 10px 12px;
  }

  .mm-lang-switch {
    display: none;
  }

  /* Compact Stage, Roster Filter & Tool Containers on Mobile */
  .mm-stage-inner,
  .mm-page-header,
  .mm-tool-header,
  .mm-tool-stage,
  .mm-hero-splash,
  .mm-hero-banner,
  .mm-not-found {
    padding: 16px 14px;
  }

  .mm-roster-filter {
    padding: 12px;
  }

  .mm-intro-card {
    margin: -8px 0 18px;
    padding: 14px;
  }

  .mm-intro-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .mm-roster-search-row {
    flex-direction: column;
    align-items: stretch;
  }

  .mm-quick-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mm-quick-link {
    padding: 11px 12px;
  }

  /* Dense 2-Column Hero Wall on Mobile (zero horizontal overflow) */
  .mm-hero-grid,
  .mm-hub-grid,
  .mm-tool-stage .mm-tool .mm-hub-roster .mm-hero-grid,
  .mm-tool-stage .mm-tool .mm-hero-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .mm-hero-card-body {
    padding: 8px 10px 10px;
  }

  .mm-hero-attr-pip {
    top: 5px;
    left: 5px;
    padding: 1px 5px;
  }

  .mm-hero-portrait-wrap .mm-unlock-pill {
    top: 5px;
    right: 5px;
    padding: 1px 6px;
  }

  /* Hero Strip smoothly scrolls horizontally on mobile */
  .mm-hero-strip {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Single-column Souvenir Plaques & Database Grids on Mobile */
  .mm-souvenir-grid,
  .mm-ant-grid,
  .mm-ant-results,
  .mm-ant-controls,
  .mm-grid,
  .mm-ability-list,
  .mm-glossary-grid,
  .mm-footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .mm-souvenir-plaque {
    padding: 20px 16px 16px;
  }

  .mm-ant-controls {
    padding: 12px;
    gap: 10px;
  }

  .mm-ant-card {
    padding: 14px 14px 13px;
    gap: 10px;
  }

  .mm-ant-head,
  .mm-ant-card > header {
    flex-wrap: wrap;
    gap: 8px 10px;
  }

  .mm-ant-head-right,
  .mm-ant-badges,
  .mm-ant-meta {
    justify-content: flex-start;
  }

  .mm-ant-reverse-bar {
    padding: 12px;
  }

  .mm-ant-ing-chip,
  .mm-ant-reverse-bar .mm-ant-chip {
    min-height: 36px;
  }

  .mm-ant-recipe-box {
    padding: 10px;
  }

  .mm-ssr-scale-strip {
    margin: -6px 0 14px;
    padding: 10px 12px;
  }

  /* Prevent mobile augment popover from overflowing viewport */
  .mm-aug-popover {
    width: min(300px, calc(100vw - 28px));
  }

  .mm-system-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 14px;
  }

  .mm-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .mm-toolbar label {
    width: 100%;
  }

  .mm-search,
  .mm-select {
    width: 100%;
    flex: 1 1 auto;
    min-width: 0;
  }

  .mm-planner-bar {
    position: static;
    flex-direction: column;
    align-items: stretch;
  }

  .mm-planner-bar-group,
  .mm-planner-actions,
  .mm-not-found-actions,
  .mm-confirm-bar-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .mm-planner-bar .mm-btn,
  .mm-toolbar .mm-btn,
  .mm-not-found-actions .mm-btn,
  .mm-confirm-bar-actions .mm-btn {
    width: 100%;
  }

  .mm-branch-nodes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mm-step-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mm-drawer {
    width: 100vw;
    padding: 18px 14px;
  }
}

@media (max-width: 480px) {
  .mm-tool-stage[data-hero-id] .mm-tool .mm-hero-splash {
    display: grid;
    grid-template-columns: minmax(96px, 1fr) minmax(0, 1.7fr);
    align-items: start;
    gap: .65rem;
    padding: .7rem;
  }

  .mm-tool-stage[data-hero-id] .mm-tool .mm-hero-splash .mm-portrait {
    width: 100%;
    height: 148px;
    max-height: none;
    object-fit: cover;
    object-position: 65% center;
  }

  .mm-tool-stage[data-hero-id] .mm-tool .mm-hero-splash > div {
    width: auto;
    min-width: 0;
  }

  .mm-tool-stage[data-hero-id] .mm-tool .mm-hero-splash h2 {
    font-size: 1.25rem;
  }

  .mm-tool-stage[data-hero-id] .mm-tool .mm-hero-splash p {
    font-size: .82rem;
    line-height: 1.45;
  }

  .mm-tool-stage[data-hero-id] .mm-tool .mm-route-links {
    gap: .35rem;
  }

  .mm-tool-stage[data-hero-id] .mm-tool .mm-route-links a {
    padding: .25rem .4rem;
    min-height: 32px;
  }
}

/* Keep Antique filters and the first recipes in the same viewport. */
.mm-tool-page-antiques .mm-tool-header {
  padding: 15px 20px;
  margin-bottom: 10px;
}

.mm-tool-page-antiques .mm-tool-header-top {
  display: none;
}

.mm-tool-page-antiques .mm-tool-title {
  margin: 0 0 4px;
  font-size: clamp(1.55rem, 2.7vw, 2.1rem);
  line-height: 1.22;
}

.mm-tool-page-antiques .mm-updated-meta {
  margin-bottom: 0;
}

.mm-tool-page-antiques .mm-ssr-scale-strip {
  margin: 0 0 12px;
  padding: 8px 12px;
}

.mm-tool-page-antiques .mm-tool-stage {
  padding: 14px;
}

.mm-tool-page-antiques .mm-ant-app {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.mm-tool-page-antiques .mm-ant-controls {
  padding: 8px 12px;
  gap: 6px 10px;
}

.mm-tool-page-antiques .mm-ant-reverse-bar {
  min-width: 0;
  padding: 10px 12px;
  gap: 5px;
}

.mm-tool-page-antiques .mm-ant-reverse-bar > p {
  margin: 0;
}

.mm-tool-page-antiques .mm-ant-reverse-bar [data-reverse] {
  gap: 4px 6px;
}

.mm-tool-page-antiques [data-reverse] .mm-ant-chip {
  min-height: 34px;
  padding: 4px 7px;
  font-size: var(--fs-xs);
}

.mm-tool-page-antiques .mm-ant-tabs button {
  min-height: 36px;
}

.mm-tool-page-antiques .mm-ant-card:has(.mm-ant-formula [aria-pressed="true"]) {
  border-color: var(--gold);
}

.mm-tool-page-antiques .mm-ant-formula:has([aria-pressed="true"]) {
  background: color-mix(in srgb, var(--gold) 12%, var(--surface));
  border-radius: var(--radius-xs);
  outline: 1px solid var(--gold-soft);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .mm-tool-page-antiques .mm-tool-header {
    padding: 12px;
  }

  .mm-tool-page-antiques .mm-tool-title {
    font-size: clamp(1.1rem, 5.4vw, 1.32rem);
    line-height: 1.15;
  }

  .mm-tool-page-antiques .mm-ssr-scale-strip {
    display: block;
    padding: 6px 10px;
  }

  .mm-tool-page-antiques .mm-ssr-scale-strip::before {
    display: inline-block;
    margin-inline-end: 6px;
  }

  .mm-tool-page-antiques .mm-tool-stage {
    padding: 8px;
  }

  .mm-tool-page-antiques .mm-ant-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 8px;
    gap: 5px;
  }

  .mm-tool-page-antiques .mm-ant-controls label:last-child {
    grid-column: auto;
  }

  .mm-tool-page-antiques .mm-ant-controls label {
    gap: 3px;
    line-height: 1.15;
  }

  .mm-tool-page-antiques .mm-ant-controls select {
    padding-inline: 5px;
    font-size: var(--fs-xs);
  }

  .mm-tool-page-antiques .mm-ant-reverse-bar {
    padding: 8px;
  }

  .mm-tool-page-antiques .mm-ant-reverse-bar h2 {
    font-size: var(--fs-base);
    line-height: 1.2;
  }

  .mm-tool-page-antiques .mm-ant-reverse-bar > p {
    line-height: 1.3;
  }

  .mm-tool-page-antiques .mm-ant-app :is([data-reverse], .mm-ant-tabs) {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 3px 3px 5px;
  }

  .mm-tool-page-antiques [data-reverse] .mm-ant-chip,
  .mm-tool-page-antiques .mm-ant-tabs button {
    flex: 0 0 auto;
    min-height: 42px;
    white-space: nowrap;
  }

  .mm-tool-page-antiques .mm-ant-tabs button {
    padding-inline: .48rem;
    font-size: var(--fs-xs);
  }

  .mm-tool-page-antiques .mm-ant-recipe-box {
    margin: 4px 0;
  }
}

/* ==========================================================================
   9. Wave 2 Dark Carnival Accents: Encounter/Tarot Augments, Trust Strip,
      Changelog Timeline, Compact Hero SSR Strip & Guide Table Polish
   ========================================================================== */

/* Compact Hero Hub Header + SSR Scale Strip Alignment */
.mm-tool-header-compact .mm-updated-meta {
  margin: 6px 0 0;
}

.mm-tool-page-hero .mm-ssr-scale-strip {
  margin: 0 0 14px;
}

/* Augments: Encounter & Tarot Inline SVG Crest Containers */
.mm-aug-crest,
.mm-art[data-mm-art-kind="encounter"],
.mm-art[data-mm-art-kind="tarot"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: radial-gradient(circle at 32% 28%, var(--surface-2), var(--bg) 82%);
  color: var(--gold);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--gold) 24%, transparent),
    0 4px 12px color-mix(in srgb, var(--bg) 82%, transparent);
}

.mm-aug-crest {
  width: 44px;
  height: 44px;
}

.mm-aug-crest .mm-crest,
.mm-art .mm-crest {
  width: 26px;
  height: 26px;
  display: block;
}

.mm-art[data-mm-art-kind="encounter"] {
  border-color: color-mix(in srgb, var(--gold) 74%, var(--accent));
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--accent) 34%, var(--surface-2)), var(--bg) 84%);
  color: var(--gold);
}

.mm-art[data-mm-art-kind="tarot"] {
  border-color: color-mix(in srgb, var(--tier-legendary) 74%, var(--gold));
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--tier-legendary) 30%, var(--surface-2)), var(--bg) 84%);
  color: var(--tier-legendary);
}

/* Augments: Encounter & Tarot Cards, Category Tabs & Semantic Badges */
@media (min-width: 1100px) {
  [data-mm-augments-app] .mm-tab { padding-inline: 12px; }
}

@media (max-width: 600px) {
  html[lang^="zh"] .mm-tool-page:has([data-mm-augments-app]) .mm-tool-title {
    font-size: clamp(1.4rem, 6.7vw, 1.75rem);
    text-wrap: balance;
  }
}

.mm-aug-card:has([data-mm-art-kind="encounter"]),
.mm-aug-card.mm-aug-encounter {
  --card-accent: var(--gold);
  border-top-color: color-mix(in srgb, var(--gold) 78%, var(--accent));
  background-image:
    radial-gradient(ellipse 68% 110px at 14% 0%, var(--gold-soft), transparent 72%),
    linear-gradient(165deg, color-mix(in srgb, var(--accent) 11%, var(--surface-2)) 0%, var(--surface) 100%);
}

.mm-aug-card:has([data-mm-art-kind="tarot"]),
.mm-aug-card.mm-aug-tarot {
  --card-accent: var(--tier-legendary);
  border-top-color: var(--tier-legendary);
  background-image:
    radial-gradient(ellipse 68% 110px at 14% 0%, var(--legendary-soft), transparent 72%),
    linear-gradient(165deg, color-mix(in srgb, var(--tier-legendary) 12%, var(--surface-2)) 0%, var(--surface) 100%);
}

.mm-tab[data-mm-cat="encounter"].is-selected,
.mm-tab[data-mm-cat="encounter"][aria-selected="true"] {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--accent) 22%, var(--surface-2));
  color: var(--gold);
}

.mm-tab[data-mm-cat="tarot"].is-selected,
.mm-tab[data-mm-cat="tarot"][aria-selected="true"] {
  border-color: var(--tier-legendary);
  background: color-mix(in srgb, var(--tier-legendary) 20%, var(--surface-2));
  color: var(--text);
}

.mm-badge-encounter,
.mm-aug-badge-encounter,
.mm-aug-card:has([data-mm-art-kind="encounter"]) > .mm-badge:first-of-type {
  border-color: color-mix(in srgb, var(--gold) 68%, var(--accent));
  background: color-mix(in srgb, var(--accent) 24%, var(--bg));
  color: var(--gold);
}

.mm-badge-tarot,
.mm-aug-badge-tarot,
.mm-aug-card:has([data-mm-art-kind="tarot"]) > .mm-badge:first-of-type {
  border-color: color-mix(in srgb, var(--tier-legendary) 68%, transparent);
  background: color-mix(in srgb, var(--tier-legendary) 22%, var(--bg));
  color: var(--text);
}

.mm-badge-placeholder,
.mm-aug-badge-placeholder,
.mm-aug-card:has([data-mm-art-kind="tarot"]) > .mm-badge + .mm-badge {
  border: 1px dashed color-mix(in srgb, var(--gold) 56%, var(--muted));
  background: color-mix(in srgb, var(--surface-2) 86%, var(--bg));
  color: var(--muted);
  font-size: var(--fs-xs);
}

/* Homepage Bottom Methodology & Patch 7.42a Trust Strip */
.mm-trust-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-top: 32px;
  padding: 20px 22px;
  background:
    radial-gradient(ellipse 56% 120px at 6% 0%, color-mix(in srgb, var(--gold) 14%, transparent), transparent 72%),
    linear-gradient(135deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.mm-trust-strip-copy {
  flex: 1 1 320px;
  min-width: 0;
}

.mm-trust-strip-copy .mm-eyebrow {
  margin-bottom: 4px;
}

.mm-prose .mm-trust-strip-title,
.mm-trust-strip-title {
  margin: 0 0 6px;
  max-width: none;
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.mm-prose .mm-trust-strip-desc,
.mm-trust-strip-desc {
  margin: 0;
  max-width: 68ch;
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.55;
}

.mm-trust-strip-cta {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* /about Dated Patch Changelog Timeline */
.mm-prose ol.mm-changelog,
.mm-changelog {
  list-style: none;
  margin: 20px 0 28px;
  padding: 0 0 0 24px;
  max-width: 76ch;
  border-left: 2px solid var(--border-strong);
}

.mm-changelog-item {
  position: relative;
  margin: 0 0 22px;
  padding: 16px 18px;
  background: linear-gradient(160deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
}

.mm-changelog-item:last-child {
  margin-bottom: 0;
}

.mm-changelog-item::before {
  content: "";
  position: absolute;
  left: -31px;
  top: 20px;
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  background: var(--accent);
  border: 1.5px solid var(--gold);
  box-shadow: 0 0 8px color-mix(in srgb, var(--gold) 52%, transparent);
}

.mm-changelog-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 10px;
}

.mm-changelog-date {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.03em;
}

.mm-prose ul.mm-changelog-list,
.mm-changelog-list {
  margin: 0;
  padding-left: 18px;
  max-width: none;
}

.mm-changelog-list li {
  margin-bottom: 6px;
  font-size: var(--fs-sm);
  color: var(--text);
}

.mm-changelog-list li:last-child {
  margin-bottom: 0;
}

/* Guide & 64-Node Static Reference Table Readability Polish */
.mm-prose tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--surface-2) 48%, transparent);
}

.mm-prose td:first-child,
.mm-prose th:first-child {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .mm-trust-strip {
    padding: 16px 14px;
    gap: 12px;
  }

  .mm-trust-strip-cta {
    width: 100%;
  }

  .mm-prose ol.mm-changelog,
  .mm-changelog {
    padding-left: 18px;
  }

  .mm-changelog-item {
    padding: 14px;
  }

  .mm-changelog-item::before {
    left: -25px;
  }
}

/* ==========================================================================
   10. Best Heroes Dark Carnival Tier List, Spotlight Detail,
       100-Cog First-Unlock Podium & 4-Player Squad Showcase
   ========================================================================== */

/* Elevated Velvet Exhibition Frame for the Tier List Stage */
.mm-tool-stage:has(.mm-tier-app) {
  position: relative;
  background:
    radial-gradient(ellipse 68% 180px at 50% 0%, color-mix(in srgb, var(--gold) 10%, transparent), transparent 72%),
    radial-gradient(ellipse 48% 200px at 0% 28%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 74%),
    radial-gradient(ellipse 48% 200px at 100% 28%, color-mix(in srgb, var(--tier-legendary) 10%, transparent), transparent 74%),
    var(--surface);
  border-color: var(--border-strong);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--gold) 28%, transparent),
    var(--shadow-deep);
}

.mm-tier-app {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  color: var(--text);
}

/* ---------- 10.1 Wave Tabs & Role Filter Controls ---------- */
.mm-tier-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 78%, var(--surface-2));
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--gold) 18%, transparent);
}

.mm-tier-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 82%, var(--surface));
  min-width: 0;
}

.mm-tier-controls .mm-tier-tabs {
  padding: 0;
  border: 0;
  background: transparent;
}

.mm-tier-tab {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 7px 15px;
  margin: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--surface) 88%, var(--bg));
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.015em;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.mm-tier-tab:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
}

.mm-tier-tab.is-active,
.mm-tier-tab[aria-selected="true"],
.mm-tier-tab[aria-pressed="true"] {
  border-color: var(--gold);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--gold) 24%, var(--surface-2)) 0%,
    color-mix(in srgb, var(--accent) 20%, var(--surface)) 100%
  );
  color: var(--gold);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--gold) 58%, transparent),
    0 0 16px color-mix(in srgb, var(--gold) 24%, transparent);
}

.mm-tier-tab span,
.mm-tier-tab small,
.mm-tier-tab em {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: var(--fs-xs);
  font-weight: 700;
}

.mm-tier-roles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.mm-tier-role {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  padding: 5px 12px;
  margin: 0;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg) 82%, var(--surface));
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.16s ease;
}

.mm-tier-role:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
}

.mm-tier-role.is-active,
.mm-tier-role[aria-pressed="true"],
.mm-tier-role[aria-selected="true"] {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 18%, var(--surface-2));
  color: var(--gold);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--gold) 44%, transparent),
    0 2px 10px color-mix(in srgb, var(--gold) 16%, transparent);
}

.mm-tier-preview-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0;
  padding: 11px 15px;
  border-radius: var(--radius-sm);
  border: 1px dashed color-mix(in srgb, var(--gold) 50%, var(--muted));
  border-left: 3px dashed color-mix(in srgb, var(--gold) 74%, var(--tier-legendary));
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--tier-legendary) 11%, var(--bg)) 0%,
    color-mix(in srgb, var(--gold) 7%, var(--surface)) 100%
  );
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.mm-tier-preview-note strong {
  color: var(--gold);
}

/* ---------- 10.2 Horizontal Dark Carnival Tier List Lanes ---------- */
.mm-tier-board {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.mm-tier-lane {
  --lane-accent: var(--gold);
  --lane-letter: var(--gold);
  --lane-badge-bg: linear-gradient(165deg, var(--surface-2) 0%, var(--bg) 100%);
  --lane-glow: color-mix(in srgb, var(--gold) 24%, transparent);
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  min-width: 0;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--lane-accent) 44%, transparent);
  background:
    radial-gradient(ellipse 46% 120px at 0% 50%, color-mix(in srgb, var(--lane-accent) 10%, transparent), transparent 76%),
    linear-gradient(135deg, color-mix(in srgb, var(--lane-accent) 5%, var(--surface)) 0%, color-mix(in srgb, var(--bg) 88%, var(--surface)) 100%);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--lane-accent) 26%, transparent),
    var(--shadow-card);
  overflow: hidden;
}

/* Tier S: Molten Antique Brass & Gold Prestige */
.mm-tier-lane[data-tier="S"] {
  --lane-accent: var(--gold);
  --lane-letter: var(--gold);
  --lane-badge-bg: linear-gradient(
    165deg,
    color-mix(in srgb, var(--gold) 22%, var(--bg)) 0%,
    color-mix(in srgb, var(--accent) 16%, var(--bg)) 100%
  );
  --lane-glow: color-mix(in srgb, var(--gold) 32%, transparent);
  border-color: color-mix(in srgb, var(--gold) 66%, transparent);
  box-shadow:
    inset 0 2px 0 color-mix(in srgb, var(--gold) 52%, transparent),
    0 0 22px color-mix(in srgb, var(--gold) 12%, transparent),
    var(--shadow-card);
}

/* Tier A: Dark Carnival Crimson & Warm Rose Burst */
.mm-tier-lane[data-tier="A"] {
  --lane-accent: var(--accent);
  --lane-letter: color-mix(in srgb, var(--accent) 32%, var(--text));
  --lane-badge-bg: linear-gradient(
    165deg,
    color-mix(in srgb, var(--accent) 44%, var(--surface-2)) 0%,
    color-mix(in srgb, var(--accent) 18%, var(--bg)) 100%
  );
  --lane-glow: color-mix(in srgb, var(--accent) 34%, transparent);
  border-color: color-mix(in srgb, var(--accent) 62%, transparent);
}

/* Tier B: Mystic Violet Utility & Counter-Pick */
.mm-tier-lane[data-tier="B"] {
  --lane-accent: var(--tier-legendary);
  --lane-letter: color-mix(in srgb, var(--tier-legendary) 56%, var(--text));
  --lane-badge-bg: linear-gradient(
    165deg,
    color-mix(in srgb, var(--tier-legendary) 28%, var(--surface-2)) 0%,
    color-mix(in srgb, var(--tier-legendary) 12%, var(--bg)) 100%
  );
  --lane-glow: color-mix(in srgb, var(--tier-legendary) 24%, transparent);
  border-color: color-mix(in srgb, var(--tier-legendary) 48%, transparent);
}

/* Tier C: Tarnished Bronze & Slate Specialist */
.mm-tier-lane[data-tier="C"] {
  --lane-accent: color-mix(in srgb, var(--muted) 70%, var(--gold));
  --lane-letter: var(--muted);
  --lane-badge-bg: linear-gradient(165deg, var(--surface-2) 0%, var(--bg) 100%);
  --lane-glow: color-mix(in srgb, var(--muted) 18%, transparent);
  border-color: color-mix(in srgb, var(--muted) 36%, transparent);
}

.mm-tier-badge {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 14px 8px;
  text-align: center;
  background: var(--lane-badge-bg);
  border-left: 3px solid var(--lane-accent);
  border-right: 1px solid color-mix(in srgb, var(--lane-accent) 42%, transparent);
}

.mm-tier-letter {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--lane-letter);
  text-shadow: 0 2px 12px color-mix(in srgb, var(--bg) 92%, transparent);
}

.mm-tier-sub {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.03em;
  color: color-mix(in srgb, var(--text) 88%, var(--muted));
}

.mm-tier-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  align-content: start;
  min-width: 0;
}

.mm-tier-tile {
  appearance: none;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  padding: 0;
  margin: 0;
  text-align: left;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  color: var(--text);
  background: linear-gradient(
    180deg,
    var(--surface) 0%,
    color-mix(in srgb, var(--surface-2) 70%, var(--bg)) 100%
  );
  border: 1px solid color-mix(in srgb, var(--lane-accent) 34%, var(--border-subtle));
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--bg) 72%, transparent);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.18s ease, background-color 0.16s ease;
}

.mm-tier-tile:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--gold) 54%, transparent),
    0 10px 22px color-mix(in srgb, var(--bg) 84%, transparent),
    0 0 18px var(--lane-glow);
}

.mm-tier-tile:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.mm-tier-tile.is-selected,
.mm-tier-tile[aria-pressed="true"],
.mm-tier-tile[aria-current="true"] {
  border-color: var(--gold);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--gold) 18%, var(--surface-2)) 0%,
    color-mix(in srgb, var(--gold) 8%, var(--surface)) 100%
  );
  box-shadow:
    0 0 0 2px var(--gold),
    0 0 24px color-mix(in srgb, var(--gold) 36%, transparent),
    0 10px 22px color-mix(in srgb, var(--bg) 86%, transparent);
}

.mm-tier-tile.is-selected::after,
.mm-tier-tile[aria-pressed="true"]::after,
.mm-tier-tile[aria-current="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--gold), var(--text), var(--gold), var(--accent));
  pointer-events: none;
}

.mm-tier-portrait-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg);
  overflow: hidden;
}

.mm-tier-portrait {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center 18%;
  background: var(--bg);
  overflow: hidden;
  transition: transform 0.28s ease, filter 0.2s ease;
}

.mm-tier-portrait > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
  transition: transform 0.28s ease, filter 0.2s ease;
}

.mm-tier-tile:hover .mm-tier-portrait,
.mm-tier-tile:hover .mm-tier-portrait > img,
.mm-tier-tile.is-selected .mm-tier-portrait,
.mm-tier-tile.is-selected .mm-tier-portrait > img {
  filter: brightness(1.08) contrast(1.04);
}

.mm-tier-tile:hover img.mm-tier-portrait,
.mm-tier-tile:hover .mm-tier-portrait > img {
  transform: scale(1.05);
}

.mm-tier-legend {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.4;
}

.mm-tier-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.mm-tier-app [data-unlock="starter"] {
  color: var(--tier-eldritch);
  color: color-mix(in srgb, var(--tier-eldritch) 58%, var(--gold));
}

.mm-tier-app [data-unlock="launch"] {
  color: var(--gold);
}

.mm-tier-app [data-unlock="upcoming"] {
  color: var(--tier-legendary);
  color: color-mix(in srgb, var(--tier-legendary) 70%, var(--text));
}

.mm-tier-icon {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}

.mm-tier-cost-tag {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid currentColor;
  border-color: color-mix(in srgb, currentColor 45%, transparent);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 87%, transparent);
}

.mm-tier-tile-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 9px 9px;
  min-width: 0;
  flex: 1 0 auto;
  border-top: 1px solid color-mix(in srgb, var(--lane-accent) 26%, transparent);
}

.mm-tier-hero-name {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s ease;
}

.mm-tier-tile:hover .mm-tier-hero-name,
.mm-tier-tile.is-selected .mm-tier-hero-name,
.mm-tier-tile[aria-pressed="true"] .mm-tier-hero-name {
  color: var(--gold);
}

.mm-tier-chip {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  max-width: 100%;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  border: 1px solid color-mix(in srgb, var(--lane-accent) 34%, transparent);
  background: color-mix(in srgb, var(--bg) 78%, var(--surface-2));
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mm-tier-tile.is-selected .mm-tier-chip,
.mm-tier-tile[aria-pressed="true"] .mm-tier-chip {
  border-color: color-mix(in srgb, var(--gold) 58%, transparent);
  color: var(--text);
}

.mm-tier-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 20px 16px;
  text-align: center;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  background: color-mix(in srgb, var(--bg) 76%, var(--surface));
  color: var(--muted);
  font-size: var(--fs-sm);
}

/* ---------- 10.3 Hero Spotlight Detail Panel ---------- */
.mm-tier-detail {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 24px;
  min-width: 0;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background-color: var(--surface);
  background-image:
    radial-gradient(ellipse 68% 140px at 8% 0%, color-mix(in srgb, var(--gold) 14%, transparent), transparent 72%),
    radial-gradient(ellipse 56% 140px at 96% 100%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 72%),
    linear-gradient(165deg, var(--surface-2) 0%, var(--surface) 58%, color-mix(in srgb, var(--bg) 82%, var(--surface)) 100%);
  box-shadow:
    inset 0 0 0 3px color-mix(in srgb, var(--surface) 84%, transparent),
    inset 0 0 0 4px color-mix(in srgb, var(--gold) 24%, transparent),
    var(--shadow-deep);
}

/* Subtle four-corner antique brass rivets matching the Dark Carnival plaque system */
.mm-tier-detail::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background-image:
    radial-gradient(circle 2.4px at 10px 10px, var(--gold) 55%, transparent 100%),
    radial-gradient(circle 2.4px at calc(100% - 10px) 10px, var(--gold) 55%, transparent 100%),
    radial-gradient(circle 2.4px at 10px calc(100% - 10px), var(--gold) 55%, transparent 100%),
    radial-gradient(circle 2.4px at calc(100% - 10px) calc(100% - 10px), var(--gold) 55%, transparent 100%);
}

.mm-tier-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}

.mm-tier-detail-portrait {
  width: 112px;
  height: 63px;
  flex: 0 0 112px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center 18%;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gold);
  background: var(--bg);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--bg) 84%, transparent);
  display: block;
  overflow: hidden;
}

.mm-tier-detail-portrait > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
}

.mm-tier-detail-head > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
  flex: 1 1 220px;
}

.mm-tier-detail-head h3,
.mm-tier-detail-head h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

.mm-tier-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 28px;
  padding: 2px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.mm-tier-pill[data-tier="S"] {
  background: var(--gold);
  border-color: var(--text);
  color: var(--bg);
  box-shadow: 0 0 14px color-mix(in srgb, var(--gold) 36%, transparent);
}

.mm-tier-pill[data-tier="A"] {
  background: var(--accent);
  border-color: color-mix(in srgb, var(--gold) 56%, var(--accent));
  color: var(--text);
}

.mm-tier-pill[data-tier="B"] {
  background: color-mix(in srgb, var(--tier-legendary) 28%, var(--bg));
  border-color: var(--tier-legendary);
  color: var(--text);
}

.mm-tier-pill[data-tier="C"] {
  background: var(--bg);
  border-color: color-mix(in srgb, var(--muted) 56%, transparent);
  color: var(--muted);
}

.mm-tier-hero-link {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gold);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--gold) 18%, var(--surface-2)) 0%,
    var(--surface) 100%
  );
  color: var(--gold);
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.mm-tier-hero-link:hover {
  background: var(--gold);
  border-color: var(--text);
  color: var(--bg);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--gold) 32%, transparent);
  transform: translateY(-1px);
}

.mm-tier-verdict {
  margin: 0;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--gold);
  background: color-mix(in srgb, var(--bg) 64%, var(--surface));
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: var(--text);
}

.mm-tier-pros-cons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

.mm-tier-pro,
.mm-tier-con {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  min-width: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--text);
}

.mm-tier-pro {
  border-left: 3px solid var(--tier-uncommon);
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--tier-uncommon) 9%, var(--bg)) 0%,
    color-mix(in srgb, var(--bg) 72%, var(--surface)) 48%
  );
}

.mm-tier-con {
  border-left: 3px solid var(--accent);
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--accent) 14%, var(--bg)) 0%,
    color-mix(in srgb, var(--bg) 72%, var(--surface)) 48%
  );
}

.mm-tier-pro h4,
.mm-tier-pro h5,
.mm-tier-pro strong,
.mm-tier-pro .mm-tier-label {
  color: var(--tier-uncommon);
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 700;
}

.mm-tier-con h4,
.mm-tier-con h5,
.mm-tier-con strong,
.mm-tier-con .mm-tier-label {
  color: color-mix(in srgb, var(--accent) 34%, var(--text));
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 700;
}

.mm-tier-pro p,
.mm-tier-con p {
  margin: 0;
  color: var(--text);
}

.mm-tier-pro ul,
.mm-tier-con ul {
  margin: 0;
  padding-left: 18px;
}

.mm-tier-links-block {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  min-width: 0;
}

.mm-tier-links-block > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  flex: 1 0 100%;
  min-width: 0;
}

.mm-tier-souvenir-link {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 52px;
  padding: 8px 14px 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--gold) 46%, transparent);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--plaque) 60%, var(--bg)) 0%,
    color-mix(in srgb, var(--surface-2) 84%, var(--bg)) 100%
  );
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  min-width: 0;
  transition: transform 0.14s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.18s ease;
}

.mm-tier-souvenir-link img {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gold);
  background: var(--bg);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--bg) 84%, transparent);
  display: block;
}

.mm-tier-souvenir-link:hover {
  transform: translateY(-1px);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--gold) 36%, transparent),
    0 0 18px color-mix(in srgb, var(--gold) 24%, transparent);
}

.mm-tier-souvenir-link small,
.mm-tier-souvenir-link span {
  min-width: 0;
}

.mm-tier-augment-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--tier-legendary) 48%, transparent);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--tier-legendary) 15%, var(--bg)) 0%,
    var(--surface) 100%
  );
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  min-width: 0;
  transition: transform 0.14s ease, border-color 0.16s ease, color 0.16s ease, background-color 0.16s ease, box-shadow 0.18s ease;
}

.mm-tier-augment-link img {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: var(--bg);
  display: block;
}

.mm-tier-augment-link:hover {
  transform: translateY(-1px);
  border-color: var(--gold);
  background: color-mix(in srgb, var(--tier-legendary) 24%, var(--surface-2));
  color: var(--gold);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--tier-legendary) 24%, transparent);
}

.mm-tier-evidence {
  flex: 1 0 100%;
  margin: 4px 0 0;
  padding-top: 10px;
  border-top: 1px dashed var(--border-subtle);
  font-size: var(--fs-xs);
  line-height: 1.55;
  color: var(--muted);
}

/* ---------- 10.4 100-Cog First-Unlock 3-Step Podium ---------- */
.mm-cog-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 20px;
  min-width: 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background:
    radial-gradient(ellipse 68% 110px at 50% 0%, color-mix(in srgb, var(--gold) 13%, transparent), transparent 72%),
    linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  box-shadow: var(--shadow-card);
}

.mm-cog-podium > :not(.mm-cog-step) {
  grid-column: 1 / -1;
}

.mm-cog-podium > h2,
.mm-cog-podium > h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  color: var(--gold);
}

.mm-cog-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

.mm-cog-step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px 16px;
  min-width: 0;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--gold) 36%, transparent);
  border-top: 3px solid var(--gold);
  background: linear-gradient(
    165deg,
    color-mix(in srgb, var(--surface-2) 86%, var(--bg)) 0%,
    var(--bg) 100%
  );
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--bg) 74%, transparent);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.18s ease;
}

.mm-cog-step:nth-of-type(2) {
  border-top-color: var(--accent);
}

.mm-cog-step:nth-of-type(3) {
  border-top-color: var(--tier-eldritch);
}

.mm-cog-step:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow:
    0 0 18px color-mix(in srgb, var(--gold) 18%, transparent),
    var(--shadow-card);
}

.mm-cog-step > header,
.mm-cog-step > div,
.mm-cog-step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mm-cog-rank,
.mm-cog-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: color-mix(in srgb, var(--gold) 18%, var(--bg));
  color: var(--gold);
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1;
}

.mm-cog-step img {
  width: 56px;
  height: 32px;
  flex: 0 0 56px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center 18%;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  display: block;
}

.mm-cog-step h3,
.mm-cog-step h4,
.mm-cog-step strong {
  margin: 0;
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

.mm-cog-step a {
  color: var(--gold);
  font-weight: 700;
  text-decoration: none;
}

.mm-cog-step a:hover {
  color: var(--text);
  text-decoration: underline;
}

.mm-cog-step p {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--muted);
}

.mm-cog-tip {
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--gold) 44%, transparent);
  border-left: 3px solid var(--gold);
  background: color-mix(in srgb, var(--gold) 9%, var(--bg));
  color: var(--text);
  font-size: var(--fs-sm);
  line-height: 1.55;
}

.mm-cog-tip strong {
  color: var(--gold);
}

/* ---------- 10.5 4-Player Squad Portrait Showcase Cards ---------- */
.mm-squad-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.mm-squad-section > h2,
.mm-squad-section > h3 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--gold);
}

.mm-squad-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
  min-width: 0;
}

.mm-squad-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  min-width: 0;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--gold) 52%, transparent);
  background-color: var(--surface);
  background-image:
    radial-gradient(ellipse 84% 48% at 50% 0%, color-mix(in srgb, var(--gold) 14%, transparent), transparent 70%),
    radial-gradient(ellipse 80% 56% at 100% 100%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 72%),
    linear-gradient(175deg, var(--surface-2) 0%, var(--surface) 60%, color-mix(in srgb, var(--bg) 84%, var(--surface)) 100%);
  box-shadow:
    inset 0 0 0 3px color-mix(in srgb, var(--surface) 84%, transparent),
    inset 0 0 0 4px color-mix(in srgb, var(--gold) 24%, transparent),
    var(--shadow-card);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.2s ease;
}

.mm-squad-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background-image:
    radial-gradient(circle 2.4px at 9px 9px, var(--gold) 55%, transparent 100%),
    radial-gradient(circle 2.4px at calc(100% - 9px) 9px, var(--gold) 55%, transparent 100%),
    radial-gradient(circle 2.4px at 9px calc(100% - 9px), var(--gold) 55%, transparent 100%),
    radial-gradient(circle 2.4px at calc(100% - 9px) calc(100% - 9px), var(--gold) 55%, transparent 100%);
}

.mm-squad-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow:
    inset 0 0 0 3px color-mix(in srgb, var(--surface) 84%, transparent),
    inset 0 0 0 4px color-mix(in srgb, var(--gold) 48%, transparent),
    0 0 24px color-mix(in srgb, var(--gold) 20%, transparent),
    var(--shadow-deep);
}

.mm-squad-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  min-width: 0;
}

.mm-squad-head h3,
.mm-squad-head h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 700;
  line-height: 1.25;
  color: var(--gold);
}

.mm-squad-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid color-mix(in srgb, var(--gold) 56%, transparent);
  background: color-mix(in srgb, var(--gold) 14%, var(--bg));
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.mm-squad-roster {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.mm-squad-member {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0 0 8px;
  min-width: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg) 74%, var(--surface));
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.14s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.mm-squad-member:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 6px 14px color-mix(in srgb, var(--bg) 82%, transparent);
}

.mm-squad-member img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center 18%;
  display: block;
  background: var(--bg);
  border-bottom: 1px solid var(--border-subtle);
}

.mm-squad-member > strong,
.mm-squad-member > span,
.mm-squad-member > small,
.mm-squad-member > em,
.mm-squad-member > div {
  padding-inline: 7px;
  min-width: 0;
}

.mm-squad-member > strong,
.mm-squad-member-name {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mm-squad-member:hover > strong,
.mm-squad-member:hover .mm-squad-member-name {
  color: var(--gold);
}

.mm-squad-member > small,
.mm-squad-member > em,
.mm-squad-role {
  display: block;
  font-style: normal;
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.25;
  color: var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mm-squad-note {
  margin: auto 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  border-left: 2px solid color-mix(in srgb, var(--gold) 65%, transparent);
  background: color-mix(in srgb, var(--bg) 72%, var(--surface));
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--muted);
}

.mm-squad-note strong {
  color: var(--text);
}

/* ---------- 10.6 Tier List Responsive Breakpoints (Zero Overflow to 320px) ---------- */
.mm-tier-followup {
  display: grid;
  gap: 16px;
  align-items: start;
  min-width: 0;
}

@media (min-width: 1081px) {
  .mm-tool-page:has([data-mm-best-heroes-app]) .mm-tool-header {
    margin-bottom: 14px;
    padding: 9px 16px;
  }

  .mm-tool-page:has([data-mm-best-heroes-app]) :is(.mm-tool-header-top, .mm-updated-meta) {
    margin-bottom: 0;
  }

  .mm-tool-page:has([data-mm-best-heroes-app]) .mm-tool-title {
    margin: 4px 0;
    font-size: clamp(1.65rem, 2.6vw, 2.25rem);
  }

  .mm-tool-page:has([data-mm-best-heroes-app]) .mm-tool-subtitle {
    margin: 2px 0 0;
  }

  .mm-tool-page:has([data-mm-best-heroes-app]) .mm-ssr-scale-strip {
    margin-bottom: 8px;
    padding: 6px 12px;
  }

  .mm-tool-stage:has(.mm-tier-app) {
    padding: 12px;
  }

  .mm-tier-app, .mm-tier-board {
    gap: 8px;
  }

  .mm-tier-controls {
    gap: 6px 12px;
    padding: 6px 8px;
  }

  .mm-tier-controls :is(.mm-tier-tab, .mm-tier-role) {
    min-height: 36px;
    padding: 4px 8px;
  }

  .mm-tier-lane {
    grid-template-columns: 75px minmax(0, 1fr);
  }

  .mm-tier-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    padding: 6px;
  }

  .mm-tier-grid .mm-tier-tile {
    padding: 4px 6px;
  }

  .mm-tier-grid .mm-tier-portrait {
    height: 48px;
    aspect-ratio: auto;
    background: radial-gradient(ellipse, var(--surface-2), var(--bg));
  }

  .mm-tier-grid .mm-tier-portrait > img {
    object-fit: contain;
    object-position: center;
  }

  .mm-tier-grid .mm-tier-tile-meta {
    gap: 2px;
    padding: 2px 0 0;
    border: 0;
  }

  .mm-tier-grid .mm-tier-chip {
    padding: 1px 4px;
  }

  .mm-tier-followup:has(.mm-tier-detail) {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    margin-top: 8px;
  }

  .mm-tier-detail {
    gap: 8px;
    padding: 12px 16px;
  }

  .mm-tier-detail-head {
    gap: 8px;
    padding-bottom: 6px;
  }

  .mm-tier-detail-head h2 {
    margin: 0;
    font-size: 1.45rem;
  }

  .mm-tier-verdict, .mm-tier-pro, .mm-tier-con {
    padding: 6px 9px;
  }

  .mm-tier-links-block {
    gap: 5px;
    padding-top: 5px;
  }

  .mm-tier-links-block h3 {
    width: 100%;
    margin: 0;
    font-size: var(--fs-sm);
  }

  .mm-tier-links-block > div {
    gap: 6px;
  }

  .mm-tier-souvenir-link, .mm-tier-augment-link {
    min-height: 36px;
    padding: 3px 7px;
  }

  .mm-tier-souvenir-link img {
    width: 29px;
    height: 29px;
    flex-basis: 29px;
  }

  .mm-tier-evidence {
    margin: 0;
    padding-top: 4px;
  }

  .mm-tier-followup .mm-cog-podium {
    gap: 8px;
    padding: 12px;
  }

  .mm-tier-followup .mm-cog-steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .mm-tier-followup .mm-cog-step {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 2px 8px;
    padding: 6px 8px;
  }

  .mm-tier-followup .mm-cog-step-head {
    grid-row: span 2;
  }

  .mm-tier-followup .mm-cog-step > span {
    font-size: var(--fs-sm);
    line-height: 1.3;
  }

  .mm-tier-followup .mm-cog-tip {
    padding: 6px 8px;
  }

  .mm-squad-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .mm-squad-section {
    gap: 8px;
  }

  .mm-squad-section > h2 {
    font-size: 1.45rem;
    line-height: 1.2;
  }

  .mm-squad-card {
    gap: 6px;
    padding: 10px;
  }

  .mm-squad-roster {
    gap: 4px;
  }

  .mm-squad-member > :is(strong, small) {
    padding-inline: 3px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .mm-squad-note {
    padding: 5px 6px;
    font-size: var(--fs-xs);
    line-height: 1.45;
  }
}

@media (max-width: 1080px) {
  .mm-tier-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .mm-tier-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mm-cog-podium,
  .mm-cog-steps {
    grid-template-columns: minmax(0, 1fr);
  }

  .mm-squad-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .mm-tier-app {
    gap: 16px;
  }

  .mm-tier-controls {
    padding: 10px;
    gap: 8px;
  }

  .mm-tier-legend {
    column-gap: 2px;
  }

  .mm-tier-tabs {
    padding: 5px;
    gap: 6px;
  }

  .mm-tier-tab {
    min-height: 38px;
    padding: 6px 11px;
    font-size: var(--fs-xs);
  }

  .mm-tier-roles {
    gap: 5px;
  }

  .mm-tier-role {
    min-height: 34px;
    padding: 4px 10px;
  }

  /* Stack Lane Badge into Top Header Bar + 2-Column Portrait Grid */
  .mm-tier-lane {
    grid-template-columns: minmax(0, 1fr);
  }

  .mm-tier-badge {
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    padding: 9px 12px;
    text-align: left;
    border-left: 4px solid var(--lane-accent);
    border-right: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--lane-accent) 42%, transparent);
  }

  .mm-tier-letter {
    font-size: var(--fs-lg);
  }

  .mm-tier-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
  }

  .mm-tier-tile-meta {
    padding: 6px 7px 7px;
  }

  .mm-tier-detail {
    padding: 16px 14px;
    gap: 12px;
  }

  .mm-tier-detail-head {
    align-items: flex-start;
    gap: 10px 12px;
  }

  .mm-tier-detail-portrait {
    width: 88px;
    height: 50px;
    flex-basis: 88px;
  }

  .mm-tier-hero-link {
    margin-left: 0;
    width: 100%;
    min-height: 44px;
  }

  .mm-tier-verdict {
    padding: 11px 12px;
    font-size: var(--fs-base);
  }

  .mm-tier-pros-cons {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .mm-tier-pro,
  .mm-tier-con {
    padding: 12px;
  }

  .mm-tier-souvenir-link,
  .mm-tier-augment-link {
    width: 100%;
  }

  .mm-cog-podium {
    padding: 14px;
    gap: 10px;
  }

  .mm-cog-step {
    padding: 12px;
  }

  .mm-squad-card {
    padding: 9px;
    gap: 7px;
  }

  .mm-squad-grid, .mm-squad-roster {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .mm-squad-badge, .mm-squad-member > :is(strong, small) {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* Page sharing — pinned opposite the compendiums' back-to-top control. */
.mm-share{--share-left:max(16px,env(safe-area-inset-left,0px));--share-right:max(16px,env(safe-area-inset-right,0px));--share-bottom:max(16px,env(safe-area-inset-bottom,0px));--share-top:max(16px,env(safe-area-inset-top,0px));--sh-line:color-mix(in srgb,var(--gold) 46%,transparent);--sh-tint:color-mix(in srgb,var(--gold) 10%,var(--surface-2));--sh-ok-bg:color-mix(in srgb,var(--tier-uncommon) 16%,var(--bg));--sh-scrim:color-mix(in srgb,var(--bg) 56%,transparent);--sh-sheen:inset 0 1px 0 color-mix(in srgb,var(--gold) 24%,transparent)}
#mm-share-toggle,#mm-share-panel :is(button,textarea){font:inherit}
#mm-share-toggle,#mm-share-panel button{cursor:pointer}
.mm-share-mark,#mm-share-panel .mm-share-close,.mm-share-crest{display:grid;place-items:center}
.mm-share-btn-ico,.mm-share-ch-ico,.mm-share-ch-end,.mm-share-native-ico,.mm-share-url-ico{flex:none;display:inline-flex;align-items:center;color:var(--muted)}
.mm-share-btn-ico{color:inherit}
#mm-share-toggle{position:fixed;z-index:22;left:var(--share-left);bottom:var(--share-bottom);display:inline-flex;align-items:center;min-height:44px;min-width:44px;padding:0 14px 0 0;border:1px solid var(--border-strong);border-color:var(--sh-line);border-radius:var(--radius);background:var(--surface);background:color-mix(in srgb,var(--surface) 92%,var(--bg));color:var(--text);font-size:var(--fs-sm);font-weight:600;letter-spacing:.01em;line-height:1;box-shadow:var(--shadow-card),var(--sh-sheen);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);transition:.18s cubic-bezier(.16,1,.3,1)}
.mm-share-mark{align-self:stretch;width:40px;margin-right:11px;border-right:1px solid var(--border);color:var(--gold);transition:.18s}
.mm-share-toggle-label{white-space:nowrap}
.mm-share-toggle-x{display:none;align-items:center;margin-left:9px;color:var(--muted)}
#mm-share-toggle[aria-expanded="true"] .mm-share-toggle-x{display:inline-flex}
#mm-share-toggle:active{transform:none}
#mm-share-toggle[aria-expanded="true"]{border-color:var(--gold);background:var(--surface-2);background:var(--sh-tint)}
#mm-share-toggle[aria-expanded="true"] .mm-share-mark{background:var(--gold-soft);border-right-color:var(--sh-line)}
@keyframes mm-share-pop-in{from{opacity:0;transform:translateY(8px) scale(.985)}to{opacity:1;transform:none}}
@keyframes mm-share-sheet-in{from{opacity:0;transform:translateY(20px)}to{opacity:1;transform:none}}
@keyframes mm-share-fade-in{from{opacity:0}to{opacity:1}}
#mm-share-panel{position:fixed;z-index:1002;inset:auto auto calc(var(--share-bottom) + 56px) var(--share-left);box-sizing:border-box;width:416px;max-width:calc(100% - var(--share-left) - var(--share-right));max-height:calc(100vh - var(--share-bottom) - 64px - var(--share-top));max-height:calc(100dvh - var(--share-bottom) - 64px - var(--share-top));overflow:hidden auto;overscroll-behavior:contain;margin:0;padding:18px 20px 16px;border:1px solid var(--border-strong);border-color:var(--sh-line);border-top:2px solid var(--gold);border-radius:12px;background:var(--surface);background:linear-gradient(180deg,color-mix(in srgb,var(--surface-2) 78%,var(--surface)),var(--surface) 32%,color-mix(in srgb,var(--bg) 42%,var(--surface)));color:var(--text);font:var(--fs-sm)/1.45 var(--font-sans);box-shadow:var(--shadow-deep),var(--sh-sheen)}
#mm-share-panel:not([open]){display:none}
#mm-share-panel[open]{display:block;animation:mm-share-pop-in .18s cubic-bezier(.16,1,.3,1) both}
#mm-share-panel::backdrop{background:var(--sh-scrim);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);animation:mm-share-fade-in .16s ease both}
.mm-share-scrim{position:fixed;z-index:1001;inset:0;background:var(--bg);background:var(--sh-scrim);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}
html.mm-share-open{overflow:hidden}
.mm-share-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding-bottom:13px;border-bottom:1px solid var(--border-subtle)}
.mm-share-head-copy,.mm-share-meta{min-width:0;flex:1}
.mm-share-brand{display:block;color:var(--gold);font:600 var(--fs-xs)/1.2 var(--font-display);letter-spacing:.12em;text-transform:uppercase}
#mm-share-heading{margin:4px 0 0;color:var(--text);font:700 20px/1.2 var(--font-sans);letter-spacing:-.01em}
#mm-share-panel .mm-share-close{flex:0 0 44px;width:44px;height:44px;margin:-6px -8px -4px 0;padding:0;border:1px solid transparent;border-radius:var(--radius);background:transparent;color:var(--muted);transition:.15s}
.mm-share-preview{display:flex;align-items:center;gap:12px;margin:14px 0 12px}
.mm-share-crest{flex:0 0 46px;width:46px;height:46px;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg);background:radial-gradient(circle at 50% 35%,color-mix(in srgb,var(--gold) 14%,var(--surface)),var(--bg) 78%);box-shadow:var(--sh-sheen)}
.mm-share-crest img{width:32px;height:32px}
.mm-share-kicker{display:block;margin-bottom:2px;color:var(--muted);font:600 var(--fs-xs)/1.25 var(--font-sans);letter-spacing:.08em;text-transform:uppercase}
.mm-share-title{min-width:0;margin:0;font-size:var(--fs-sm);font-weight:700;line-height:1.35;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.mm-share-url-row{display:flex;align-items:center;gap:9px;padding:9px 12px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--bg);background:color-mix(in srgb,var(--bg) 82%,var(--surface))}
.mm-share-url{flex:1;min-width:0;margin:0;color:var(--text);color:color-mix(in srgb,var(--text) 88%,var(--muted));font:500 13px/1.35 var(--font-sans);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;-webkit-user-select:all;user-select:all}
.mm-share-actions{display:flex;flex-direction:column;gap:8px;margin-top:12px}
.mm-share-manual{display:block;width:100%;margin-top:8px;padding:10px 12px;border:1px solid var(--border-strong);border-radius:var(--radius-sm);background:var(--bg);color:var(--text);font:500 13px/1.45 var(--font-mono);resize:vertical;-webkit-user-select:text;user-select:text}
#mm-share-panel .mm-share-copy,.mm-share-continue{position:relative;width:100%;min-height:44px;display:flex;justify-content:center;align-items:center;gap:8px;margin:0;padding:10px 14px;border-radius:var(--radius-sm);font-size:var(--fs-sm);font-weight:700;line-height:1.25;text-decoration:none;transition:.15s}
#mm-share-panel .mm-share-copy{border:1px solid var(--gold);background:var(--gold);background:linear-gradient(180deg,color-mix(in srgb,var(--gold) 92%,var(--text)),var(--gold));color:var(--bg);box-shadow:0 2px 10px color-mix(in srgb,var(--gold) 20%,transparent)}
#mm-share-panel .mm-share-copy:active{transform:scale(.99)}
#mm-share-panel .mm-share-copy-text{border:1px solid var(--border-strong);border-color:var(--sh-line);background:var(--surface-2);background:var(--sh-tint);color:var(--text);box-shadow:var(--sh-sheen)}
#mm-share-panel .mm-share-copy-text .mm-share-btn-ico{color:var(--gold)}
#mm-share-panel .mm-share-copy.is-copied{border-color:var(--tier-uncommon);background:var(--surface-2);background:var(--sh-ok-bg);color:var(--tier-uncommon)}
#mm-share-panel .mm-share-copy.is-copied .mm-share-btn-ico{color:var(--tier-uncommon)}
#mm-share-panel .mm-share-copy.is-copied .mm-share-btn-label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.mm-share-ready-note{margin:2px 0 0;color:var(--muted);font-size:var(--fs-xs);line-height:1.4;text-align:center}
.mm-share-status{margin:10px 0 0;padding:8px 11px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--gold-soft);color:var(--gold);font-size:var(--fs-xs);font-weight:600;line-height:1.45}
.mm-share-status[data-mm-status-tone="success"]{border-color:color-mix(in srgb,var(--tier-uncommon) 45%,transparent);background:var(--sh-ok-bg);color:var(--tier-uncommon)}
.mm-share-status[data-mm-status-tone="warn"]{border-color:color-mix(in srgb,var(--accent) 58%,transparent);background:var(--accent-soft);color:var(--text)}
.mm-share-status:empty{display:none;margin:0;padding:0;border:0}
.mm-share-continue{margin-top:8px;border:1px solid var(--gold);background:var(--surface-2);background:var(--sh-tint);color:var(--gold)}
.mm-share-communities{margin-top:14px;padding-top:13px;border-top:1px solid var(--border-subtle)}
#mm-share-community-label{margin:0 0 9px;color:var(--muted);font-size:var(--fs-xs);font-weight:600}
.mm-share-grid{display:grid;gap:6px;grid-template-columns:repeat(3,minmax(0,1fr))}
.mm-share-grid a,#mm-share-panel .mm-share-grid button{display:flex;align-items:center;gap:5px;min-width:0;min-height:44px;padding:8px;border:1px solid var(--border-subtle);border-radius:var(--radius-sm);background:var(--surface-2);background:color-mix(in srgb,var(--surface-2) 68%,var(--bg));color:var(--text);font:600 var(--fs-xs)/1.2 var(--font-sans);text-decoration:none;transition:.15s}
.mm-share-ch-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left}
.mm-share-ch-end{opacity:.72}
#mm-share-panel .mm-share-ico-done,#mm-share-panel .mm-share-btn-done,#mm-share-panel .is-copied .mm-share-ico-default{display:none}
#mm-share-panel .is-copied .mm-share-ico-done{display:inline-flex}
#mm-share-panel .mm-share-copy.is-copied .mm-share-btn-done{display:inline}
.mm-share-grid a:active,#mm-share-panel .mm-share-grid button:active{transform:scale(.98)}
#mm-share-panel .mm-share-grid button.is-copied{border-color:var(--tier-uncommon);background:var(--sh-ok-bg);color:var(--tier-uncommon)}
#mm-share-panel .mm-share-grid button.is-copied :is(.mm-share-ch-ico,.mm-share-ch-end){color:var(--tier-uncommon);opacity:1}
#mm-share-paste-hint{margin:9px 0 0;color:var(--muted);font-size:var(--fs-xs);line-height:1.45}
#mm-share-panel .mm-share-native{width:100%;min-height:44px;display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:12px;padding:10px 10px 8px;border:1px solid transparent;border-top-color:var(--border-subtle);border-radius:0 0 var(--radius-sm) var(--radius-sm);background:transparent;color:var(--muted);font-size:13px;font-weight:600;text-align:left;transition:.15s}
#mm-share-panel .mm-share-native[hidden]{display:none}
.mm-share-native-main{display:inline-flex;align-items:center;gap:9px;min-width:0}
#mm-share-panel .mm-share-native[aria-busy="true"]{opacity:.72}
#mm-share-panel :focus-visible,#mm-share-toggle:focus-visible{outline:2px solid var(--gold);outline-offset:2px}
@media (hover:hover){
  #mm-share-toggle:hover{transform:translateY(-1px);border-color:var(--gold);background:var(--sh-tint);box-shadow:var(--shadow-plaque),var(--sh-sheen)}
  #mm-share-toggle:hover .mm-share-mark{background:var(--gold-soft);border-right-color:var(--sh-line)}
  #mm-share-toggle[aria-expanded="true"]:hover .mm-share-toggle-x{color:var(--text)}
  #mm-share-panel .mm-share-close:hover{background:var(--gold-soft);border-color:var(--border);color:var(--text)}
  #mm-share-panel .mm-share-copy:hover{border-color:var(--text);background:color-mix(in srgb,var(--gold) 88%,var(--text))}
  #mm-share-panel .mm-share-copy-text:hover{border-color:var(--gold);background:color-mix(in srgb,var(--gold) 20%,var(--surface-2));color:var(--text)}
  .mm-share-continue:hover{background:var(--gold);color:var(--bg)}
  .mm-share-grid a:hover,#mm-share-panel .mm-share-grid button:hover{border-color:var(--sh-line);background:var(--sh-tint);color:var(--text)}
  .mm-share-grid a:hover :is(.mm-share-ch-ico,.mm-share-ch-end),#mm-share-panel .mm-share-grid button:hover :is(.mm-share-ch-ico,.mm-share-ch-end),#mm-share-panel .mm-share-native:hover :is(.mm-share-native-ico,.mm-share-ch-end){color:var(--gold);opacity:1}
  #mm-share-panel .mm-share-native:hover{border-color:var(--border);border-radius:var(--radius-sm);background:var(--sh-tint);color:var(--text)}
}
@media (max-width:640px){
  .mm-share{--share-left:max(12px,env(safe-area-inset-left,0px));--share-right:max(12px,env(safe-area-inset-right,0px));--share-bottom:max(12px,env(safe-area-inset-bottom,0px));--share-top:max(12px,env(safe-area-inset-top,0px))}
  #mm-share-toggle{padding-right:12px}
  .mm-share-mark{width:38px;margin-right:9px}
  html.mm-share-open #mm-share-toggle{opacity:0;pointer-events:none}
  #mm-share-panel{inset:auto 0 0 0;width:100%;max-width:100%;max-height:calc(100vh - var(--share-top) - 12px);max-height:min(90dvh,660px);padding:10px 16px calc(14px + env(safe-area-inset-bottom,0px));border-inline:0;border-bottom:0;border-radius:16px 16px 0 0}
  #mm-share-panel[open]{animation:mm-share-sheet-in .2s cubic-bezier(.16,1,.3,1) both}
  #mm-share-panel::before{content:"";display:block;width:38px;height:4px;margin:0 auto 10px;border-radius:var(--radius-pill);background:var(--border)}
  .mm-share-head{padding-bottom:10px}
  #mm-share-heading{font-size:18px}
  .mm-share-preview{margin:11px 0 10px;gap:10px}
  .mm-share-crest{flex-basis:42px;width:42px;height:42px}
  .mm-share-crest img{width:28px;height:28px}
  .mm-share-actions{margin-top:10px;gap:7px}
  .mm-share-communities{margin-top:11px;padding-top:10px}
  #mm-share-panel .mm-share-native{margin-top:10px;padding-top:9px}
}
@media (max-width:430px){
  .mm-share-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  .mm-share-grid a,#mm-share-panel .mm-share-grid button{padding:8px 10px;gap:7px}
}
@media (max-width:360px),(max-height:620px) and (max-width:640px){
  #mm-share-panel{max-height:92dvh;padding:8px 12px calc(12px + env(safe-area-inset-bottom,0px))}
  #mm-share-panel::before{margin-bottom:7px}
  .mm-share-head{padding-bottom:8px}
  .mm-share-preview{margin:8px 0}
  .mm-share-url-row{padding:7px 10px}
  .mm-share-url{font-size:var(--fs-xs)}
  .mm-share-actions{margin-top:8px;gap:6px}
  .mm-share-communities{margin-top:9px;padding-top:8px}
  #mm-share-community-label{margin-bottom:6px}
  .mm-share-grid{gap:6px}
  .mm-share-grid a,#mm-share-panel .mm-share-grid button{padding:7px 9px}
  #mm-share-paste-hint{margin-top:7px}
  #mm-share-panel .mm-share-native{margin-top:8px;padding-top:8px}
}
@media (prefers-reduced-motion:reduce){
  .mm-share *,#mm-share-panel::backdrop{animation:none!important;transition:none!important}
  #mm-share-toggle:hover,#mm-share-toggle:active,#mm-share-panel :is(.mm-share-copy,.mm-share-grid a,.mm-share-grid button):active{transform:none!important}
}
