/* ============================================================
   LEGEND PAGE — phone-first responsive system
   Loaded after mobile-fix.css. Overrides scoped via .legend-hero
   ancestor + .content-area children to avoid leaking globally.
   Breakpoints:
     ≤  640px  phone portrait (default — mobile-first)
     641-1024  tablet portrait
     1025+     desktop
   ============================================================ */

/* ─── PHONE FIRST (the default for every screen ≤ 640) ───── */
@media (max-width: 640px) {

  /* ─── Hero: tighter, no 70vh, photo first then text ─── */
  .legend-hero {
    min-height: auto !important;
    padding: 14px 16px 18px !important;
    display: block !important;
  }
  .legend-hero-content {
    padding: 12px 0 0 !important;
    padding-top: 12px !important;
  }
  .legend-hero-bg {
    filter: brightness(.18) saturate(1.4) !important;
  }
  /* Kill the 360x360 colored blob — too big on phone, eats vertical space */
  .legend-hero > div[style*="border-radius:50%"] {
    width: 220px !important;
    height: 220px !important;
    bottom: -40px !important;
    right: -40px !important;
    opacity: .6;
  }
  /* Back to legends — touch target */
  .legend-hero-content > a:first-child {
    min-height: 44px;
    display: inline-flex !important;
    align-items: center;
    margin-bottom: 14px !important;
    font-size: 13px !important;
    color: rgba(255,255,255,.7) !important;
  }

  /* ─── Hero meta block: stack avatar + info vertically, centered ─── */
  .legend-meta {
    flex-direction: column !important;
    align-items: center !important;
    gap: 16px !important;
    text-align: center !important;
  }
  .legend-avatar {
    width: 96px !important;
    height: 96px !important;
    border-width: 2px !important;
  }
  .legend-info {
    text-align: center !important;
  }
  /* Region badge — center it */
  .legend-info > div:first-child {
    margin: 0 auto 10px !important;
  }
  /* TYPO_PASS2_RESP_FIX 2026-05-22 — block 1: defer to legend.php inline rule (serif treatment) */
  .legend-name {
    font-family: var(--fd) !important;
    font-weight: 400 !important;
    font-size: clamp(40px, 10vw, 64px) !important;
    line-height: 0.98 !important;
    letter-spacing: -0.015em !important;
    margin-bottom: 8px !important;
  }
  .legend-era-line {
    font-size: 12px !important;
    margin-top: 2px !important;
    margin-bottom: 8px !important;
  }
  /* TYPO_PASS2_RESP_FIX block 2 */
  .legend-tagline {
    font-family: var(--fb) !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    margin-top: 12px !important;
    color: rgba(255,255,255,.70) !important;
    max-width: 90%;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* ─── Tab nav: horizontal scroll, touch-friendly, sticky ─── */
  .tab-nav {
    position: sticky !important;
    top: var(--nav-h, 66px) !important;
    z-index: 100 !important;
    background: var(--bg2, #0C0C14) !important;
    border-bottom: 1px solid var(--bor, rgba(255,255,255,.07)) !important;
  }
  .tab-nav-inner {
    padding: 0 12px !important;
    gap: 0 !important;
    min-width: 100% !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }
  .tab-nav-inner::-webkit-scrollbar { display: none; }
  .tab-btn {
    padding: 14px 16px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    flex-shrink: 0 !important;
    min-height: 48px !important;
    white-space: nowrap !important;
    border-bottom-width: 3px !important;
  }

  /* ─── Content area: edge-to-edge with comfortable padding ─── */
  .content-area {
    padding: 20px 16px 80px !important;
    max-width: 100% !important;
  }

  /* ─── Video player: edge-to-edge, no border on phone ─── */
  .mm-video-player {
    border-radius: 14px !important;
    box-shadow: 0 8px 30px rgba(0,0,0,.6) !important;
    margin-left: -4px;
    margin-right: -4px;
  }

  /* ─── Story tab: stack the 2fr/1fr grid ─── */
  .legend-story-grid,
  div[style*="grid-template-columns:2fr 1fr"],
  div[style*="grid-template-columns: 2fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  .legend-story-grid h2,
  .content-area h2 {
    font-size: 28px !important;
    line-height: 1.15 !important;
    margin-bottom: 14px !important;
  }
  .legend-story-grid p,
  .content-area p {
    font-size: 16px !important;
    line-height: 1.7 !important;
  }
  /* Sidebar cards on story tab */
  .legend-story-grid + div div[style*="background:var(--sur)"],
  .content-area div[style*="background:var(--sur);border-radius:var(--r2);padding:22px"] {
    padding: 18px !important;
  }

  /* ─── Timeline tab: stack date + content ─── */
  .content-area div[style*="grid-template-columns:160px 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
    padding: 16px 0 !important;
  }
  .content-area div[style*="grid-template-columns:160px 1fr"] > div:first-child {
    font-size: 12px !important;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700 !important;
  }
  .content-area div[style*="grid-template-columns:160px 1fr"] h3 {
    font-size: 20px !important;
    margin-bottom: 6px !important;
  }

  /* ─── Lessons grid: comfortable single column ─── */
  .content-area div[style*="repeat(auto-fit,minmax(260px,1fr))"] {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .content-area div[style*="repeat(auto-fit,minmax(260px,1fr))"] img {
    height: 200px !important;
  }
  .content-area div[style*="repeat(auto-fit,minmax(260px,1fr))"] h3 {
    font-size: 22px !important;
  }

  /* ─── Practice tab CTA cards: already handled, just tighten ─── */
  .practice-cta-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .practice-cta {
    padding: 22px 20px !important;
    min-height: auto !important;
    border-radius: 18px !important;
  }
  .practice-cta-title {
    font-size: 22px !important;
  }
  .practice-cta-meta {
    font-size: 11px !important;
  }
  .practice-cta-desc {
    font-size: 13.5px !important;
    margin-bottom: 18px !important;
  }
  .practice-cta-btn {
    width: 100%;
    justify-content: center;
    padding: 13px 20px !important;
  }

  /* ─── Admin video card: stack the flex row ─── */
  #mm-video-generation-card > div {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  #mm-video-generation-card button {
    width: 100% !important;
    min-height: 48px !important;
  }
}

/* ─── EXTRA SMALL PHONES (≤ 380px) ───────────────── */
@media (max-width: 380px) {
  .legend-hero { padding: 12px 14px 16px !important; }
  .content-area { padding: 16px 14px 80px !important; }
  .legend-name { font-size: 40px !important; font-family: var(--fd) !important; font-weight: 400 !important; line-height: 0.98 !important; letter-spacing: -0.015em !important; }
  .tab-btn { padding: 14px 12px !important; font-size: 13px !important; }
  .practice-cta { padding: 18px 16px !important; }
  .practice-cta-title { font-size: 20px !important; }
}

/* ─── TABLET PORTRAIT (641 - 1024px) ────────────── */
@media (min-width: 641px) and (max-width: 1024px) {
  .legend-hero {
    min-height: 50vh !important;
    padding: 60px 32px 40px !important;
  }
  .legend-hero-content { padding: 60px 0 0 !important; }
  .legend-meta {
    flex-direction: row !important;
    align-items: flex-end !important;
    gap: 24px !important;
  }
  .legend-avatar { width: 130px !important; height: 130px !important; }
  .legend-name { font-size: clamp(52px, 7vw, 78px) !important; font-family: var(--fd) !important; font-weight: 400 !important; line-height: 0.98 !important; letter-spacing: -0.015em !important; }
  .legend-tagline { font-size: 17px !important; line-height: 1.5; font-family: var(--fb) !important; font-weight: 400 !important; color: rgba(255,255,255,.72) !important; }
  .content-area { padding: 40px 32px 60px !important; }
  .tab-nav-inner { padding: 0 32px !important; }
  .legend-story-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }
  .practice-cta-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
  }
}

/* ─── DESKTOP (1025+): keep existing styles, just enforce sane defaults ─ */
@media (min-width: 1025px) {
  .content-area { max-width: 1200px; }
}

/* ─── UNIVERSAL (all screens) ─────────────────────────── */
/* No horizontal overflow, ever */
.content-area, .tab-nav-inner, .legend-hero, .legend-hero-content {
  max-width: 100%;
  box-sizing: border-box;
}
.content-area * { max-width: 100%; }
.content-area img, .legend-hero-bg, .legend-avatar, .mm-video-player video {
  max-width: 100%;
  height: auto;
}

/* iPhone safe area on bottom (for sticky tabs / fixed CTAs) */
@supports (padding: max(0px)) {
  .content-area { padding-bottom: max(80px, env(safe-area-inset-bottom)); }
}

/* ============================================================
   LEGENDS INDEX PAGE  (/legends)
   Phone-first overrides for the library/grid view.
   Targets:
     .page-header   = top hero with title + search + filter pills
     .grid-3        = the 12-legend grid
     .legend-card   = each card
     .section, .section-inner = grid container wrapper
   ============================================================ */

/* ─── PHONE (≤ 640px) — single column, tight spacing ─── */
@media (max-width: 640px) {

  /* Page header — way less padding, fluid type */
  .page-header {
    padding: 22px 16px 24px !important;
  }
  .page-header h1 {
    font-size: clamp(28px, 8vw, 38px) !important;
    line-height: 1.05 !important;
    margin-bottom: 10px !important;
  }
  .page-header > .page-header-inner > p,
  .page-header p {
    font-size: 14.5px !important;
    line-height: 1.5 !important;
    margin-bottom: 18px !important;
  }
  .section-eyebrow {
    font-size: 10px !important;
    margin-bottom: 6px !important;
  }

  /* Search form — stack vertically, full-width input */
  .page-header form {
    flex-direction: column !important;
    gap: 12px !important;
    align-items: stretch !important;
  }
  .page-header form input[name="q"] {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
    padding: 12px 14px !important;
    font-size: 16px !important;  /* prevents iOS zoom on focus */
  }
  /* Region pill row — horizontal scroll instead of wrap */
  .page-header form > div[style*="flex-wrap:wrap"] {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin: 0 -16px !important;
    padding: 0 16px 4px !important;
    gap: 8px !important;
  }
  .page-header form > div[style*="flex-wrap:wrap"]::-webkit-scrollbar { display: none; }
  .page-header form button {
    flex-shrink: 0 !important;
    min-height: 40px !important;
    padding: 10px 14px !important;
    font-size: 13px !important;
    white-space: nowrap !important;
  }

  /* Section container — phone padding */
  .section {
    padding: 24px 16px 60px !important;
  }
  .section-inner {
    max-width: 100% !important;
  }

  /* The grid — single column, full-width cards */
  .grid-3 {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* Each legend card */
  .legend-card {
    flex: none !important;
    width: 100% !important;
  }
  .legend-card-img {
    aspect-ratio: 16/10 !important;
  }
  .legend-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .legend-card-body {
    padding: 16px 18px 18px !important;
  }
  .legend-card-body h3 {
    font-size: 22px !important;
    line-height: 1.15 !important;
    margin-bottom: 4px !important;
  }
  .legend-card-era {
    font-size: 12px !important;
    margin-bottom: 8px !important;
  }
  .legend-card-tag {
    font-size: 14px !important;
    line-height: 1.5 !important;
  }

  /* Empty state */
  .section-inner > div[style*="text-align:center"][style*="padding:72px"] {
    padding: 48px 16px !important;
  }
}

/* ─── EXTRA SMALL PHONES (≤ 380px) ─── */
@media (max-width: 380px) {
  .page-header { padding: 18px 14px 20px !important; }
  .page-header h1 { font-size: 26px !important; }
  .section { padding: 20px 14px 60px !important; }
  .legend-card-body h3 { font-size: 20px !important; }
}

/* ─── TABLET PORTRAIT (641 – 1024px) — 2 columns ─── */
@media (min-width: 641px) and (max-width: 1024px) {
  .page-header {
    padding: 40px 32px 32px !important;
  }
  .page-header h1 {
    font-size: clamp(36px, 5.5vw, 52px) !important;
  }
  .section {
    padding: 40px 32px 60px !important;
  }
  .grid-3 {
    grid-template-columns: 1fr 1fr !important;
    gap: 18px !important;
  }
  .legend-card { flex: none !important; width: 100%; }
  .legend-card-img { aspect-ratio: 4/3 !important; }
  .legend-card-body h3 { font-size: 24px !important; }
}

/* ─── DESKTOP (1025+) — keep base 290px auto-fill grid ─── */
@media (min-width: 1025px) {
  /* Existing .grid-3 minmax(290px,1fr) is fine. Just ensure no flex leak. */
  .legend-card { flex: none !important; }
}

/* ─── UNIVERSAL — anti-overflow on legends index ─── */
.page-header form,
.page-header form input,
.page-header form button {
  box-sizing: border-box;
}
.legend-card * { max-width: 100%; }

/* ============================================================
   LEGEND CARD — universal fixes (all screen sizes)
   • Pin .legend-card-region badge to top-left of image (was floating)
   • Add accent-color glow on the legend name
   • Hide redundant top-bar stripe (region badge already shows the color)
   • Establish proper image container + body layout
   ============================================================ */

.legend-card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--tx);
}

.legend-card-img {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  flex-shrink: 0;
}
.legend-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(.85);
  transition: filter .4s, transform .6s ease;
}
.legend-card:hover .legend-card-img img,
.legend-card:active .legend-card-img img {
  filter: brightness(1);
  transform: scale(1.04);
}

.legend-card-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,0,.55) 100%);
  pointer-events: none;
  z-index: 2;
}

/* The thin colored stripe — REMOVED.
   The region badge now carries the accent color clearly. */
.legend-card-top-bar {
  display: none !important;
}

/* THE REGION BADGE — pinned to top-left of image, glowing */
.legend-card-region {
  position: absolute !important;
  top: 12px !important;
  left: 12px !important;
  z-index: 3 !important;
  padding: 6px 12px !important;
  border-radius: 100px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 0 20px currentColor, 0 4px 12px rgba(0,0,0,.4);
  white-space: nowrap;
  /* The inline styles already set background, color, border using the region's color */
}

/* The card body */
.legend-card-body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.legend-card-body h3 {
  font-family: var(--fd);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -.01em;
  margin: 0;
  color: var(--tx);
  /* The glow — uses the era line's color (which is set inline as the legend's accent) as a hint */
  text-shadow: 0 0 24px currentColor, 0 2px 6px rgba(0,0,0,.5);
  /* But h3 itself has color:var(--tx) (white-ish) so currentColor would be white. We need a different approach.
     The accent color is on .legend-card-era (sibling). We can't pull it into h3 via CSS alone without a custom property.
     Solution: rely on a subtle white glow that works on every card, regardless of accent color. */
}
.legend-card-era {
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: 0 !important;
  /* color is inline (legend's accent) — preserve it */
  text-shadow: 0 0 16px currentColor;  /* this DOES glow with the accent */
}
.legend-card-tag {
  font-size: 14px !important;
  line-height: 1.5 !important;
  color: var(--tx2);
  margin: 4px 0 0 !important;
}

/* Hover lift */
.legend-card {
  transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s;
}
.legend-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 50px rgba(0,0,0,.5);
}

/* Legend name glow — h3 inline color is the accent, currentColor makes the shadow match */
.legend-card-body h3 {
  text-shadow:
    0 0 16px currentColor,
    0 0 32px currentColor,
    0 2px 8px rgba(0,0,0,.6) !important;
  letter-spacing: -.005em;
  filter: saturate(1.2);
}

/* ============================================================
   HOME PAGE  (/)
   Phone-first overrides. The hero already has decent mobile
   coverage at lines 571-580 in index.php. We add:
     • Section vertical padding tightened on phone
     • All mm-grid-* → 1-col on phone, 2-col on tablet
     • mm-pricing-mini fixed grid → 1-col phone, 2x2 tablet
     • Section heads stack on phone
     • Inline-styled sections (featured legends, pricing, CTA) tightened
     • Proof bar wraps cleanly
   ============================================================ */

/* ─── PHONE (≤ 640px) ─── */
@media (max-width: 640px) {

  /* Section padding — global tightening */
  .mm-section-dark {
    padding: 44px 16px !important;
  }

  /* Inline-styled sections that use 80px clamp(...) */
  .mm-home-wrap > div[style*="padding:80px clamp(16px,4vw,80px)"] {
    padding: 44px 16px !important;
  }

  /* Section header — stack title and "View All" link */
  .mm-section-head {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 16px !important;
    margin-bottom: 24px !important;
  }
  .mm-section-h2 {
    font-size: clamp(26px, 7vw, 36px) !important;
    line-height: 1.1 !important;
  }
  .mm-section-h2[style*="text-align:center"] {
    /* center variants — keep centered but smaller */
    margin-bottom: 24px !important;
  }
  .mm-section-eye {
    font-size: 10px !important;
    margin-bottom: 6px !important;
  }
  .mm-view-link {
    align-self: stretch;
    text-align: center;
    padding: 12px 16px !important;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* All grids → single column on phone */
  .mm-grid-regions,
  .mm-grid-legends,
  .mm-grid-steps,
  .mm-grid-resources {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* Region tiles — keep a comfortable height */
  .mm-region-tile {
    min-height: 200px !important;
  }

  /* Pricing mini — was 4-col fixed, now 2-col phone (still readable) */
  .mm-pricing-mini {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  /* Proof bar — tighter, stacked */
  .mm-proof-bar {
    padding: 24px 16px !important;
  }
  .mm-proof-bar > div > div[style*="gap:24px"] {
    gap: 12px 16px !important;
    justify-content: center !important;
    font-size: 12px !important;
  }

  /* Hero refinements — existing 571-580 block is good, just sharpen a few */
  .mm-hero {
    /* Already min-height:auto on phone, just ensure viewport doesn't get blown out */
    padding-top: 32px !important;
    padding-bottom: 40px !important;
  }
  .mm-hero-glow {
    /* 700x700px on a 360px phone is overkill — shrink it */
    width: 360px !important;
    height: 360px !important;
    top: -60px !important;
    right: -80px !important;
    opacity: .7;
  }
  .mm-hero-pill span:last-child {
    /* "AI-Powered World Music Learning Platform" — long string, allow wrap */
    font-size: 11px !important;
  }
  .mm-hero-pill {
    flex-wrap: wrap;
    max-width: 100%;
    padding: 6px 12px !important;
  }
  .mm-cta-primary,
  .mm-cta-secondary {
    min-height: 52px !important;  /* big tappable */
    padding: 16px 20px !important;
    font-size: 15px !important;
  }
  .mm-hero-stats {
    gap: 20px !important;
    width: 100%;
  }
  .mm-hero-stats > div {
    flex: 1;
    min-width: 0;
  }
  .mm-hero-stat-num {
    font-size: 28px !important;
  }

  /* Pricing teaser specific — line 146-170 inline-styled block */
  .mm-home-wrap > div[style*="background:linear-gradient(180deg,#0C0C14 0%,#05050A"] {
    padding: 44px 16px !important;
  }

  /* Final CTA section — line 203 inline-styled block */
  .mm-home-wrap > div[style*="background:linear-gradient(135deg,rgba(245,158,11"] {
    padding: 48px 16px 56px !important;
  }
}

/* ─── EXTRA SMALL (≤ 380px) ─── */
@media (max-width: 380px) {
  .mm-hero-title { font-size: 32px !important; }
  .mm-section-h2 { font-size: 24px !important; }
  .mm-pricing-mini { grid-template-columns: 1fr !important; }
  .mm-section-dark { padding: 36px 14px !important; }
  .mm-cta-primary, .mm-cta-secondary { font-size: 14px !important; padding: 14px 18px !important; }
}

/* ─── TABLET (641 – 1024px) ─── */
@media (min-width: 641px) and (max-width: 1024px) {
  .mm-section-dark { padding: 60px 32px !important; }
  .mm-grid-regions,
  .mm-grid-legends,
  .mm-grid-steps,
  .mm-grid-resources {
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
  }
  .mm-pricing-mini {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* ─── UNIVERSAL — anti-overflow on home ─── */
.mm-home-wrap, .mm-hero, .mm-hero-inner,
.mm-section-dark, .mm-grid-regions, .mm-grid-legends,
.mm-grid-steps, .mm-grid-resources, .mm-pricing-mini {
  max-width: 100%;
  box-sizing: border-box;
}
.mm-home-wrap img { max-width: 100%; height: auto; }

/* ============================================================
   HERO GLOW + ALIGNMENT (phone fix from screenshot)
   ============================================================ */

.mm-hero-pill {
  /* Pill needs breathing room from nav */
  margin-top: 12px;
  box-shadow: 0 0 24px rgba(245,158,11,.18);
}

.mm-hero-title em {
  /* "Hear" in orange — add the glow halo */
  text-shadow:
    0 0 20px rgba(245,158,11,.55),
    0 0 40px rgba(245,158,11,.35),
    0 2px 8px rgba(0,0,0,.6);
  filter: saturate(1.15);
}
.mm-hero-title {
  /* Soft white halo on the rest of the line */
  text-shadow: 0 0 32px rgba(255,255,255,.08), 0 2px 12px rgba(0,0,0,.5);
}

@media (max-width: 640px) {
  .mm-hero {
    /* More breathing room from the nav */
    padding-top: 64px !important;
  }
  .mm-hero-pill {
    margin-top: 8px;
  }
  .mm-hero-glow {
    /* Existing 700px glow → smaller on phone, brighter to feel intentional */
    width: 420px !important;
    height: 420px !important;
    top: -80px !important;
    right: -100px !important;
    background: radial-gradient(circle, rgba(245,158,11,.16) 0%, transparent 65%) !important;
  }
}

/* ============================================================
   WORLD MAP — 12 legend dots with staggered pulse
   ============================================================ */

.mm-world-map-section {
  position: relative;
  padding: 64px clamp(16px,4vw,80px);
  background: linear-gradient(180deg, #05050A 0%, #0A0A12 100%);
  border-top: 1px solid rgba(255,255,255,.04);
  border-bottom: 1px solid rgba(255,255,255,.04);
  overflow: hidden;
}
.mm-world-map-section::before {
  /* Subtle ambient glow */
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 800px;
  height: 800px;
  transform: translate(-50%,-50%);
  background: radial-gradient(circle, rgba(245,158,11,.04) 0%, transparent 60%);
  pointer-events: none;
}
.mm-world-map-inner {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}
.mm-world-map-eye {
  color: var(--gold,#F59E0B);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 10px;
  text-shadow: 0 0 20px rgba(245,158,11,.4);
}
.mm-world-map-h2 {
  font-family: var(--fd,'Cormorant Garamond',serif);
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 400;
  color: #EEEEF5;
  margin-bottom: 10px;
  text-shadow: 0 0 32px rgba(255,255,255,.06);
}
.mm-world-map-h2 em {
  color: var(--gold,#F59E0B);
  font-style: italic;
  text-shadow: 0 0 20px rgba(245,158,11,.5);
}
.mm-world-map-sub {
  color: rgba(255,255,255,.45);
  font-size: 14px;
  margin-bottom: 36px;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

.mm-world-map-frame {
  position: relative;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  aspect-ratio: 2/1;
  background: rgba(255,255,255,.02);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.05);
  overflow: hidden;
}
.mm-world-map-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.mm-world-map-svg .mm-continent {
  fill: rgba(255,255,255,.04);
  stroke: rgba(255,255,255,.10);
  stroke-width: 0.6;
}

.mm-legend-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 3;
  background: var(--dot-color, #F59E0B);
  box-shadow: 0 0 12px var(--dot-color, #F59E0B), 0 0 24px var(--dot-color, #F59E0B);
  text-decoration: none;
}
.mm-legend-dot::before {
  /* Pulsing halo */
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: var(--dot-color, #F59E0B);
  opacity: .5;
  animation: mm-dot-pulse 3s ease-out infinite;
  animation-delay: var(--dot-delay, 0s);
}
.mm-legend-dot::after {
  /* Outer slow pulse */
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: var(--dot-color, #F59E0B);
  opacity: .25;
  animation: mm-dot-pulse 3s ease-out infinite;
  animation-delay: var(--dot-delay, 0s);
  animation-duration: 4s;
}
.mm-legend-dot:hover,
.mm-legend-dot:focus {
  z-index: 4;
}
.mm-legend-dot:hover .mm-dot-label,
.mm-legend-dot:focus .mm-dot-label,
.mm-legend-dot.active .mm-dot-label {
  opacity: 1;
  transform: translateX(-50%) translateY(-100%) scale(1);
}
.mm-dot-label {
  position: absolute;
  left: 50%;
  top: -10px;
  transform: translateX(-50%) translateY(-100%) scale(.9);
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  border: 1px solid var(--dot-color, rgba(255,255,255,.2));
  box-shadow: 0 0 16px var(--dot-color, transparent);
}

@keyframes mm-dot-pulse {
  0%   { transform: scale(1); opacity: .55; }
  70%  { transform: scale(2.4); opacity: 0; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* Currently-pulsing legend caption below map */
.mm-world-map-caption {
  margin-top: 24px;
  color: rgba(255,255,255,.5);
  font-size: 13px;
  text-align: center;
  min-height: 20px;
}
.mm-world-map-caption strong {
  color: var(--gold,#F59E0B);
  font-weight: 700;
}

@media (max-width: 640px) {
  .mm-world-map-section { padding: 44px 16px; }
  .mm-world-map-h2 { font-size: 26px; }
  .mm-world-map-sub { font-size: 13px; margin-bottom: 24px; }
  .mm-legend-dot { width: 11px; height: 11px; }
  .mm-legend-dot::before { inset: -5px; }
  .mm-legend-dot::after { inset: -11px; }
  .mm-dot-label { font-size: 11px; padding: 5px 8px; }
}

/* Map polish — make continents more visible & frame less cluttered */
.mm-world-map-svg .mm-continent {
  fill: rgba(245, 158, 11, .04) !important;
  stroke: rgba(255, 255, 255, .18) !important;
  stroke-width: 0.6 !important;
}
.mm-world-map-frame {
  background: radial-gradient(ellipse at center, rgba(15,15,28,.8) 0%, rgba(5,5,10,.95) 80%) !important;
  border: 1px solid rgba(255,255,255,.06) !important;
  box-shadow: inset 0 0 80px rgba(245,158,11,.04);
}
/* Soften the dot halos so the map breathes through */
.mm-legend-dot::before { opacity: .35 !important; }
.mm-legend-dot::after  { opacity: .15 !important; }

/* ============================================================
   DAILY FACT CARD
   ============================================================ */
.mm-daily-fact-section {
  padding: 36px clamp(16px,4vw,80px) 56px;
  background: linear-gradient(180deg, #0A0A12 0%, #05050A 100%);
}
.mm-daily-fact-inner {
  max-width: 720px;
  margin: 0 auto;
}
.mm-daily-fact-card {
  --fact-accent: #F59E0B;
  position: relative;
  padding: 28px 28px 24px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(245,158,11,.06), rgba(15,15,28,.95));
  border: 1px solid rgba(245,158,11,.18);
  box-shadow: 0 0 60px rgba(245,158,11,.05), inset 0 0 80px rgba(245,158,11,.02);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .6s ease, transform .6s ease, border-color .4s;
}
.mm-daily-fact-card.mm-daily-fact-loaded {
  opacity: 1;
  transform: translateY(0);
  border-color: color-mix(in srgb, var(--fact-accent) 35%, transparent);
}
.mm-daily-fact-eye {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fact-accent);
  margin-bottom: 14px;
  text-shadow: 0 0 16px var(--fact-accent);
}
.mm-daily-fact-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fact-accent);
  box-shadow: 0 0 12px var(--fact-accent);
  animation: mm-daily-pulse 2s ease-in-out infinite;
}
@keyframes mm-daily-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .4; transform: scale(.7); }
}
.mm-daily-fact-text {
  font-family: var(--fd, 'Cormorant Garamond', serif);
  font-size: clamp(20px, 3vw, 26px);
  line-height: 1.4;
  color: #F0F0F8;
  margin: 0 0 18px;
  font-weight: 400;
  text-shadow: 0 2px 12px rgba(0,0,0,.4);
}
.mm-daily-fact-cta {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--fact-accent);
  color: #05050A;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  letter-spacing: .01em;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 0 24px color-mix(in srgb, var(--fact-accent) 50%, transparent);
}
.mm-daily-fact-cta:hover {
  transform: translateX(2px);
}
.mm-daily-fact-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.05);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .mm-daily-fact-section { padding: 24px 16px 36px; }
  .mm-daily-fact-card { padding: 22px 20px 18px; border-radius: 16px; }
  .mm-daily-fact-text { font-size: 19px; line-height: 1.45; }
  .mm-daily-fact-cta { width: 100%; justify-content: center; padding: 12px 16px; }
}

/* Map polish — reset and use real geometry */
.mm-world-map-svg .mm-continent {
  fill: rgba(245, 158, 11, .12) !important;
  stroke: rgba(245, 158, 11, .35) !important;
  stroke-width: 1.5 !important;
  stroke-linejoin: round;
}
/* Quiet the dot halos so map is visible */
.mm-legend-dot { width: 10px !important; height: 10px !important; }
.mm-legend-dot::before { inset: -3px !important; opacity: .35 !important; }
.mm-legend-dot::after  { inset: -7px !important; opacity: .15 !important; }
@keyframes mm-dot-pulse {
  0%   { transform: scale(1); opacity: .55; }
  70%  { transform: scale(1.8); opacity: 0; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* ============================================================
   LEGEND PREVIEW MODAL
   ============================================================ */
.mm-legend-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.mm-legend-modal.is-open { display: flex; }

.mm-legend-modal-scrim {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: mm-modal-scrim-in .3s ease;
}
@keyframes mm-modal-scrim-in { from { opacity:0 } to { opacity:1 } }

.mm-legend-modal-card {
  --modal-accent: #F59E0B;
  position: relative;
  width: 100%;
  max-width: 480px;
  background: linear-gradient(180deg, #14141F 0%, #0A0A14 100%);
  border-radius: 24px 24px 0 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--modal-accent) 25%, transparent);
  border-bottom: none;
  box-shadow: 0 -20px 60px rgba(0,0,0,.5),
              0 0 80px color-mix(in srgb, var(--modal-accent) 20%, transparent);
  animation: mm-modal-slide-up .35s cubic-bezier(.2,.9,.3,1);
  margin-bottom: env(safe-area-inset-bottom, 0);
}
@keyframes mm-modal-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.mm-legend-modal-close {
  position: absolute; top: 12px; right: 12px;
  z-index: 3;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.6);
  color: white;
  font-size: 24px; line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.mm-legend-modal-close:hover { background: rgba(0,0,0,.85); }

.mm-legend-modal-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: #1a1a28;
}
.mm-legend-modal-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.mm-legend-modal-img-fade {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 40%, #14141F 100%);
  pointer-events: none;
}

.mm-legend-modal-body {
  padding: 4px 24px 28px;
}
.mm-legend-modal-meta {
  display: flex; align-items: center; gap: 8px;
  color: var(--modal-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 10px;
  text-shadow: 0 0 12px color-mix(in srgb, var(--modal-accent) 50%, transparent);
}
.mm-legend-modal-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--modal-accent);
  display: inline-block;
}
.mm-legend-modal-card h3 {
  font-family: var(--fd, 'Cormorant Garamond', serif);
  font-size: 32px;
  font-weight: 400;
  color: #F0F0F8;
  margin: 0 0 12px;
  line-height: 1.1;
  text-shadow: 0 0 24px color-mix(in srgb, var(--modal-accent) 40%, transparent);
}
.mm-legend-modal-tagline {
  font-family: var(--fd, 'Cormorant Garamond', serif);
  font-size: 17px;
  line-height: 1.5;
  color: rgba(255,255,255,.78);
  font-style: italic;
  margin: 0 0 24px;
}
.mm-legend-modal-cta {
  display: inline-flex;
  align-items: center;
  width: 100%;
  justify-content: center;
  padding: 14px 22px;
  background: var(--modal-accent);
  color: #05050A;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .02em;
  text-decoration: none;
  border-radius: 12px;
  box-shadow: 0 0 28px color-mix(in srgb, var(--modal-accent) 50%, transparent);
  transition: transform .2s, box-shadow .2s;
}
.mm-legend-modal-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 32px color-mix(in srgb, var(--modal-accent) 65%, transparent);
}

/* Desktop: center the modal, smaller width */
@media (min-width: 768px) {
  .mm-legend-modal { align-items: center; }
  .mm-legend-modal-card {
    max-width: 460px;
    border-radius: 20px;
    border: 1px solid color-mix(in srgb, var(--modal-accent) 25%, transparent);
    margin: 20px;
  }
  @keyframes mm-modal-slide-up {
    from { transform: translateY(20px) scale(.98); opacity: 0; }
    to   { transform: translateY(0) scale(1);     opacity: 1; }
  }
}
