/* ============================================
   PITCH26 — ENCYCLOPEDIA STYLES
   Version 1.0 | July 2026 — Retrospective Edition
   Combines: nation detail page + directory grid
   Design: "Floodlight Almanac" dark system
   Depends on: main.css design tokens
   ============================================ */

/* ============================================
   SHARED SECTION LAYOUT
   ============================================ */
:root {
  /* Fallback only — encyclopedia.js measures the real .nav and
     overwrites this before paint. 74px matches the real desktop/
     laptop main-nav height (main.css .nav is padding+content driven,
     not a fixed height, so it's not the 57px this used to assume). */
  --main-nav-height: 57px;

  /* ── Floodlight Almanac dark theme tokens ── */
  --ink: #0b0f1e;
  --ink-2: #111530;
  --ink-3: #1a1f3a;
  /* --ink-line: for DARK surfaces (white at 10% opacity) */
  --ink-line: rgba(255, 255, 255, 0.1);
  --ink-muted: #8a92a8;
  --ink-text: #e0e4f0;
  --paper: #f5f5f0;
  /* --paper-line: for LIGHT/paper surfaces (black at 8% opacity) */
  /* Previously undefined — caused invisible borders on the roster table */
  --paper-line: rgba(0, 0, 0, 0.08);
  --paper-line-strong: rgba(0, 0, 0, 0.15);
  --true-white: #ffffff;
  --fwc-sky: #00d4ff;
  --font-display: "Anton", "Arial Narrow", sans-serif;
  --font-heading: "Space Grotesk", "Arial Narrow", sans-serif;
  --font-body: "Space Grotesk", Arial, Helvetica, sans-serif;
  --font-mono: "Space Mono", "Courier New", monospace;
  /* ── Nation color defaults (overridden by JS) ── */
  --nation-primary: #e61d25;
  --nation-secondary: #f5a623;
}

.nation-section {
  padding: var(--space-xxxl) 0;
  border-bottom: 1px solid var(--ink-line);
  /* Clear the main nav + sticky sub-nav (57px) so an anchored
     section's heading isn't hidden underneath them. Main-nav height
     comes from --main-nav-height, kept in sync at runtime — see
     initNavHeightSync() in encyclopedia.js. */
  scroll-margin-top: calc(var(--main-nav-height) + 57px);
}

.nation-hero {
  scroll-margin-top: var(--main-nav-height);
  margin-top: 0;
  padding-top: 0;
}

.nation-section:last-of-type {
  border-bottom: none;
}

.section-eyebrow {
  display: block;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fwc-red);
  margin-bottom: var(--space-sm);
}

.nation-section .section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--font-size-xxl);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-heading);
  position: relative;
  display: inline-block;
  padding-bottom: var(--space-md);
  color: var(--ink-text);
}

.section-title {
  color: var(--ink-text);
}

/* ============================================
   ENCYCLOPEDIA PAGE HERO
   ============================================ */
.encyclopedia-hero {
  position: relative;
  overflow: hidden;
  padding-top: 7rem;
  padding-bottom: var(--space-xxl);
  background: linear-gradient(135deg, #0a0e1a 0%, #101535 40%, #1a2050 100%);
  border-bottom: 1px solid var(--ink-line);
}
.encyclopedia-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(
      ellipse at 25% 20%,
      rgba(43, 207, 156, 0.08),
      transparent 60%
    ),
    radial-gradient(
      ellipse at 75% 80%,
      rgba(242, 183, 5, 0.06),
      transparent 60%
    );
  pointer-events: none;
}
.encyclopedia-hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}
.encyclopedia-hero-inner .eyebrow {
  color: var(--fwc-green);
  margin-bottom: var(--space-sm);
}
.encyclopedia-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  color: var(--true-white);
  margin: 0 0 var(--space-md);
  letter-spacing: 0.02em;
}
.encyclopedia-hero-subtitle {
  font-size: var(--font-size-large);
  color: var(--ink-muted);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Make sure hero section clears the main nav when scrolled to */
#encyclopedia-top {
  scroll-margin-top: var(--main-nav-height, 72px);
}

/* ============================================
   IN-PAGE STICKY SECTION NAV
   ============================================ */
.nation-nav {
  position: sticky;
  top: var(--main-nav-height, 72px);
  z-index: var(--z-sticky);
  height: 57px;
  flex-shrink: 0;
  background: rgba(11, 15, 30, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ink-line);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  /* Isolate into its own compositing layer so it can't get
     squashed/clipped by scroll repaints when combined with
     position: sticky + backdrop-filter (a known cross-browser
     rendering issue, notably in WebKit). */
  isolation: isolate;
  transform: translateZ(0);
  will-change: transform;
  margin-top: 0;
}

.nation-nav-container {
  max-width: var(--max-width-desktop);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.nation-nav-container::-webkit-scrollbar {
  display: none;
}

.nation-nav-link {
  padding: var(--space-md) var(--space-lg);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast);
  min-height: 48px;
  display: flex;
  align-items: center;
}

.nation-nav-link:hover {
  color: var(--ink-text);
  background: rgba(255, 255, 255, 0.04);
  border-bottom-color: var(--fwc-amber);
}

.nation-nav-link.active {
  color: var(--fwc-amber);
  border-bottom-color: var(--fwc-amber);
}

/* ============================================
   HERO — Nation Detail
   ============================================ */
.nation-hero-banner {
  position: relative;
  min-height: 420px;
  background: var(--ink-2);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.nation-flag-blur {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.12;
  filter: blur(30px) saturate(1.5);
  transform: scale(1.06);
  z-index: 0;
  pointer-events: none;
}

.nation-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(11, 15, 30, 0.85) 0%,
    rgba(11, 15, 30, 0.7) 50%,
    rgba(11, 15, 30, 0.9) 100%
  );
  z-index: 1;
}

.nation-hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: var(--space-xxl) var(--space-lg) 0;
}

.nation-hero-identity {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  padding-bottom: var(--space-xxl);
}

.nation-hero-flag {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 3px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.nation-hero-title-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.nation-hero-tla {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-small);
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  margin: 0;
}

.nation-hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 4vw + 1rem, 56px);
  color: var(--true-white);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.5);
  margin: 0;
  line-height: 1.05;
}

.nation-hero-group-badge {
  display: inline-flex;
  align-items: center;
  background: var(--fwc-red);
  color: var(--true-white);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 14px;
  border-radius: var(--radius-sm);
  width: fit-content;
  margin: 0;
}

/* ── Stat Strip — bottom-anchored glass bar ── */
.nation-hero-strip {
  display: flex;
  align-items: center;
  background: rgba(11, 15, 30, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin: 0 calc(-1 * var(--space-lg));
  padding: var(--space-md) var(--space-lg);
  overflow-x: auto;
  scrollbar-width: none;
  gap: 0;
}

.nation-hero-strip::-webkit-scrollbar {
  display: none;
}

.strip-stat {
  flex: 1;
  min-width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-sm) var(--space-md);
  text-align: center;
}

.strip-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--font-size-xl);
  color: var(--true-white);
  line-height: 1.1;
  white-space: nowrap;
}

.strip-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

.strip-divider {
  width: 1px;
  height: 36px;
  background: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

/* ============================================
   SQUAD CTA BANNER — In hero, prompts user to click flag to see squad
   Uses nation primary/secondary colors dynamically
   ============================================ */
.nation-squad-cta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--nation-primary, var(--fwc-red)) 20%, transparent)
      0%,
    color-mix(
        in srgb,
        var(--nation-secondary, var(--fwc-amber)) 15%,
        transparent
      )
      100%
  );
  border: 1px solid
    color-mix(in srgb, var(--nation-primary, var(--fwc-red)) 30%, transparent);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all var(--transition-base);
  margin: var(--space-lg) 0 0 0;
  position: relative;
  overflow: hidden;
}

.nation-squad-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(
        in srgb,
        var(--nation-secondary, var(--fwc-amber)) 8%,
        transparent
      )
      50%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity var(--transition-base);
}

.nation-squad-cta:hover {
  border-color: var(--nation-secondary, var(--fwc-amber));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px
    color-mix(in srgb, var(--nation-primary, var(--fwc-red)) 20%, transparent);
}

.nation-squad-cta:hover::before {
  opacity: 1;
}

.nation-squad-cta-flag {
  width: 48px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(255, 255, 255, 0.3);
  object-fit: cover;
  flex-shrink: 0;
}

.nation-squad-cta-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nation-squad-cta-label {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--true-white);
}

.nation-squad-cta-sub {
  font-size: 12px;
  color: var(--ink-muted);
}

.nation-squad-cta-arrow {
  font-size: 1.5rem;
  color: var(--nation-secondary, var(--fwc-amber));
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.nation-squad-cta:hover .nation-squad-cta-arrow {
  transform: translateX(6px);
}

@media (max-width: 640px) {
  .nation-squad-cta {
    flex-direction: column;
    text-align: center;
    gap: var(--space-sm);
  }
  .nation-squad-cta-text {
    align-items: center;
  }
}

/* ============================================
   CULTURE SECTION
   ============================================ */
.culture-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  align-items: start;
  margin-bottom: var(--space-xl);
}

.culture-narrative {
  font-size: var(--font-size-base);
  line-height: 1.85;
  color: var(--ink-text);
  padding: var(--space-xl);
  background: rgba(11, 15, 30, 0.4);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-lg);
  border-left: 3px solid var(--nation-primary, var(--fwc-sky));
}

.culture-quote {
  background: linear-gradient(
    135deg,
    rgba(242, 183, 5, 0.08) 0%,
    rgba(239, 67, 96, 0.05) 100%
  );
  border: 1px solid var(--ink-line);
  border-left: 4px solid var(--fwc-amber);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-xl);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--font-size-large);
  color: var(--fwc-amber);
  font-style: italic;
  line-height: 1.55;
  margin: 0;
  position: relative;
  display: flex;
  align-items: center;
  /* Sits in its own compact row below the narrative — sized to its
     content instead of stretching to match the narrative's height */
  width: 100%;
  max-width: 900px;
}

.culture-quote::before {
  content: "\201C";
  font-size: 80px;
  font-family: var(--font-display);
  color: var(--fwc-red);
  opacity: 0.2;
  position: absolute;
  top: -8px;
  left: 12px;
  line-height: 1;
}

/* Culture detail grid — full width below narrative + quote */
.culture-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.culture-detail-card {
  background: rgba(11, 15, 30, 0.55);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition:
    border-color var(--transition-base),
    transform var(--transition-fast);
}

.culture-detail-card:hover {
  border-color: var(--nation-primary, var(--fwc-sky));
  transform: translateY(-2px);
}

.culture-detail-icon {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-sm);
  display: inline-block;
  width: 48px;
  height: 48px;
  line-height: 48px;
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
}

.culture-detail-label {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--nation-secondary, var(--fwc-amber));
  margin: 0 0 var(--space-sm);
}

.culture-detail-text {
  font-size: var(--font-size-body);
  line-height: 1.6;
  color: var(--ink-text);
  margin: 0;
}

@media (max-width: 1023px) {
  .culture-layout {
    grid-template-columns: 1fr;
  }
  .culture-detail-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .culture-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   HISTORY / TIMELINE
   ============================================ */
.timeline-wrapper {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-line) transparent;
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-xl);
}

.timeline {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: var(--space-lg) 0;
  position: relative;
  min-width: max-content;
}

.timeline::before {
  content: "";
  position: absolute;
  top: calc(var(--space-lg) + 22px);
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--ink-line) 8%,
    var(--ink-line) 92%,
    transparent
  );
  z-index: 0;
}

.timeline-node {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 88px;
  cursor: pointer;
  transition: transform var(--transition-fast);
  position: relative;
  z-index: 1;
  padding: 0 4px;
}

.timeline-node:hover {
  transform: translateY(-6px);
}

.timeline-year {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  color: var(--ink-muted);
  margin-bottom: var(--space-sm);
  letter-spacing: 0.04em;
}

.timeline-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: var(--space-sm);
  border: 3px solid var(--ink-2);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.timeline-node:hover .timeline-badge {
  transform: scale(1.18);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.timeline-round {
  font-size: 9px;
  font-weight: 700;
  color: var(--ink-muted);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  max-width: 76px;
  line-height: 1.3;
  opacity: 0.85;
}

/* Badge colour variants */
.winner-gold {
  background: linear-gradient(135deg, #f6d365, #fda085);
}
.runner-silver {
  background: linear-gradient(135deg, #e0e0e0, #b0b0b0);
}
.third-bronze {
  background: linear-gradient(135deg, #cd7f32, #b8620f);
}
.fourth-blue {
  background: linear-gradient(135deg, var(--fwc-sky), #1a2440);
}
.semis-blue {
  background: linear-gradient(135deg, #3a5bd9, #1a2440);
}
.quarters-purple {
  background: linear-gradient(135deg, #7b3fa0, #5a2d82);
}
.r16-orange {
  background: linear-gradient(135deg, var(--fwc-amber), #cf9c04);
}
.group-grey {
  background: linear-gradient(135deg, #3a3f52, #2a2f42);
}

/* History Summary Cards */
.history-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

.summary-card {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
  background: rgba(11, 15, 30, 0.55);
  color: var(--ink-text);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-lg);
  border-top: 3px solid var(--fwc-amber);
  border-radius: var(--radius-md);
  transition:
    border-color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
  cursor: default;
}

.summary-card:hover {
  border-top-color: var(--fwc-red);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.summary-icon {
  display: block;
  font-size: 2rem;
  margin-bottom: var(--space-sm);
  line-height: 1;
}

.summary-value {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--font-size-xl);
  color: var(--fwc-white);
  margin: 0;
}

.summary-card h3 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-small);
  color: var(--fwc-amber);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: var(--space-xs) 0 0;
  opacity: 0.7;
}

/* ============================================
   ALL-TIME XI - Card grid (no pitch SVG)
   ============================================ */
.nation-all-time-xi {
  background: var(--ink);
}

.xi-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
  list-style: none;
  padding: 0;
  margin: 0;
}

.xi-card {
  display: flex;
  align-items: stretch;
  background: rgba(11, 15, 30, 0.55);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition:
    border-color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.xi-card:hover {
  border-color: var(--fwc-amber);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.xi-card-position {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-base);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fwc-amber);
  background: rgba(245, 166, 35, 0.08);
  border-right: 1px solid var(--ink-line);
}

.xi-card-body {
  flex: 1;
  padding: var(--space-md) var(--space-lg);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.xi-card-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--font-size-base);
  color: var(--fwc-white);
  margin: 0 0 var(--space-xs);
  line-height: 1.3;
}

.xi-card-years {
  font-size: var(--font-size-small);
  color: var(--ink-muted);
  margin: 0;
}

/* Wikipedia link inside All-Time XI card name */
.atxi-name {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.atxi-name:hover {
  color: var(--fwc-amber);
  text-decoration: underline;
}

@media (max-width: 480px) {
  .xi-card-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   ICONIC MOMENTS CAROUSEL
   ============================================ */
.nation-moments {
  background: var(--ink-2);
}

.moments-carousel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  max-width: 960px;
  margin: 0 auto;
}

.carousel-viewport {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 820px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.carousel-track {
  display: flex;
  transition: transform 380ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.moment-card {
  flex: 0 0 100%;
  background: rgba(11, 15, 30, 0.55);
  color: var(--ink-text);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.moment-card-accent {
  height: 6px;
  background: linear-gradient(90deg, var(--fwc-red), var(--fwc-amber));
  flex-shrink: 0;
}

.moment-card-body {
  padding: var(--space-xxl);
  flex: 1;
}

.moment-year {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 48px;
  color: var(--fwc-red);
  line-height: 1;
  margin-bottom: var(--space-sm);
  opacity: 0.9;
}

.moment-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--font-size-xl);
  color: var(--fwc-sky);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-heading);
  margin-bottom: var(--space-md);
  line-height: 1.25;
}

.moment-description {
  font-size: var(--font-size-body);
  line-height: 1.75;
  color: var(--ink-text);
  margin-bottom: var(--space-xl);
}

.moment-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-md);
  border-top: 2px solid var(--ink-line);
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.moment-opponent {
  font-size: var(--font-size-small);
  font-weight: 700;
  color: var(--ink-text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
}

.moment-score {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--font-size-xl);
  color: var(--fwc-sky);
}

/* Carousel Buttons */
.carousel-btn {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: var(--ink-2);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  transition: all var(--transition-fast);
  color: var(--ink-text);
}

.carousel-btn:hover,
.carousel-btn:focus {
  background: var(--fwc-amber);
  border-color: var(--fwc-amber);
  color: var(--ink);
  outline: none;
}

/* Dots */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--ink-line);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
}

.carousel-dot.active {
  background: var(--fwc-amber);
  transform: scale(1.35);
}

.carousel-dot:hover {
  background: var(--fwc-red);
  transform: scale(1.2);
}

/* ============================================
   PATH TO 2026
   ============================================ */
.nation-path {
  background: var(--ink);
}

.path-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  max-width: 900px;
  margin: 0 auto var(--space-xl);
}

.path-card {
  padding: var(--space-xl) var(--space-lg);
  background: rgba(11, 15, 30, 0.55);
  color: var(--ink-text);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-lg);
  border-top: 4px solid var(--fwc-amber);
  border-radius: var(--radius-md);
  text-align: center;
  transition:
    border-top-color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.path-card:hover {
  border-top-color: var(--fwc-red);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.path-card-icon {
  display: block;
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

.path-card h3 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-small);
  color: var(--fwc-amber);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 var(--space-xs);
  opacity: 0.7;
}

.path-value {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--font-size-large);
  color: var(--fwc-white);
  margin: 0;
}

.path-cta {
  text-align: center;
  margin-top: var(--space-xl);
}

/* ============================================
   NATION DIRECTORY — CARDS
   ============================================ */
.nations-controls {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
  justify-content: center;
}

.encyclopedia-search-input {
  min-width: 240px;
  height: 48px;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-sm);
  padding: 0 var(--space-md);
  font-size: var(--font-size-body);
  font-family: var(--font-body);
  background: var(--ink-2);
  color: var(--ink-text);
  transition: border-color var(--transition-fast);
}

.encyclopedia-search-input::placeholder {
  color: var(--ink-muted);
}
.encyclopedia-search-input:focus {
  border-color: var(--fwc-amber);
  outline: none;
}

.encyclopedia-select-input {
  height: 48px;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-sm);
  padding: 0 var(--space-md);
  font-size: var(--font-size-body);
  font-family: var(--font-body);
  background: var(--ink-2);
  color: var(--ink-text);
  cursor: pointer;
  min-width: 180px;
}

.encyclopedia-select-input:focus {
  border-color: var(--fwc-amber);
  outline: none;
}

.nations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.loading-skeleton {
  grid-column: 1 / -1;
  min-height: 320px;
  border-radius: var(--radius-lg);
  background: linear-gradient(
    100deg,
    var(--ink-2) 30%,
    var(--ink-3) 50%,
    var(--ink-2) 70%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.nations-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--ink-muted);
  font-size: var(--font-size-large);
  padding: var(--space-xxl);
}

.nations-empty strong {
  color: var(--fwc-amber);
}

.nation-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  border-radius: var(--radius-lg);
  border: 1px solid var(--ink-line);
  border-top: 3px solid var(--fwc-amber);
  background: var(--fwc-blue);
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base),
    border-color var(--transition-base);
}

.nation-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  border-top-color: var(--fwc-red);
  border-color: var(--fwc-red);
}

.nation-card:focus {
  outline: 3px solid var(--fwc-amber);
  outline-offset: 2px;
}

.nation-flag-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--ink-3);
}

.nation-flag-img {
  width: 100%;
  aspect-ratio: 3 / 2;
  height: auto;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform var(--transition-base);
}

.nation-card:hover .nation-flag-img {
  transform: scale(1.05);
}

.nation-group-badge {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: var(--fwc-red);
  color: var(--true-white);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.nation-card-body {
  padding: var(--space-md) var(--space-lg);
  flex: 1;
}

.nation-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--font-size-large);
  color: var(--fwc-sky);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nation-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

.nation-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nation-meta-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-text);
  opacity: 0.6;
}

.nation-meta-value {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-body);
  color: var(--ink-text);
}

.nation-meta-value.squad-val {
  color: var(--fwc-green);
}

.nation-card-footer {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--ink-line);
  background: rgba(0, 0, 0, 0.04);
}

/* ============================================
   SECTION SUBTITLE (directory page)
   ============================================ */
.section-subtitle {
  text-align: center;
  color: var(--fwc-sky);
  font-size: var(--font-size-large);
  margin-bottom: var(--space-xl);
}

.section-subtitle.dark {
  color: var(--ink-text);
}

/* ============================================
   DIRECTORY PAGE STICKY SECTION NAV
   ============================================ */
.encyclopedia-directory-nav {
  position: sticky;
  top: var(--main-nav-height, 72px);
  z-index: var(--z-sticky);
  height: 57px;
  flex-shrink: 0;
  background: rgba(11, 15, 30, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ink-line);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  isolation: isolate;
  transform: translateZ(0);
  will-change: transform;
}

.encyclopedia-directory-nav-container {
  max-width: var(--max-width-desktop);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.encyclopedia-directory-nav-container::-webkit-scrollbar {
  display: none;
}

.encyclopedia-directory-nav-link {
  padding: var(--space-md) var(--space-lg);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast);
  min-height: 48px;
  display: flex;
  align-items: center;
}

.encyclopedia-directory-nav-link:hover {
  color: var(--ink-text);
  background: rgba(255, 255, 255, 0.04);
  border-bottom-color: var(--fwc-amber);
}

.encyclopedia-directory-nav-link.active {
  color: var(--fwc-amber);
  border-bottom-color: var(--fwc-amber);
}

/* Ensure directory sections clear both sticky navs when scrolled to */
#encyclopedia-directory .section,
#encyclopedia-directory .directory-extra {
  scroll-margin-top: calc(var(--main-nav-height, 57px) + 57px + 16px);
}

@media (max-width: 767px) {
  .encyclopedia-directory-nav {
    top: var(--main-nav-height, 78px);
    height: 52px;
  }

  .encyclopedia-directory-nav-link {
    padding: var(--space-sm) var(--space-md);
    font-size: 12px;
    min-height: 44px;
  }

  .encyclopedia-hero {
    padding-top: 5rem;
    padding-bottom: var(--space-xl);
  }

  .encyclopedia-hero-title {
    font-size: clamp(2rem, 8vw, 2.8rem);
  }

  .encyclopedia-hero-subtitle {
    font-size: var(--font-size-body);
  }
}

/* ============================================
   DIRECTORY EXTRA SECTIONS — All 48 Nations
   ------------------------------------------
   Four extra sections on the index/directory page
   (no ?slug=), each with its own background so the
   transition between sections reads clearly while
   scrolling. Data is hardcoded in encyclopedia.js
   (WC48_NATIONS) — no JSON/database dependency.
   ============================================ */
.directory-extra {
  padding: var(--space-xxxl) 0;
}

.directory-extra .section-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.directory-extra .eyebrow {
  display: block;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fwc-amber);
  margin-bottom: var(--space-sm);
}

.directory-extra .section-title {
  color: inherit;
}

.directory-extra .section-subtitle {
  color: inherit;
  opacity: 0.75;
}

/* -- 1. Confederation Explorer: dark navy -- */
.directory-extra-1 {
  background: var(--ink);
  color: var(--ink-text);
}

/* -- 2. Groups at a Glance -- */
.directory-extra-2 {
  background: rgba(11, 15, 30, 0.55);
  color: var(--ink-text);
}
.directory-extra-2 .eyebrow {
  color: var(--fwc-red);
}

/* -- 3. A–Z Index: dark charcoal (different shade) -- */
.directory-extra-3 {
  background: var(--ink-2);
  color: var(--ink-text);
}

/* -- 4. Trivia Wall: branded gradient, most distinct -- */
.directory-extra-4 {
  background: linear-gradient(
    135deg,
    var(--fwc-red) 0%,
    #3a1210 60%,
    var(--ink) 100%
  );
  color: var(--true-white);
}
.directory-extra-4 .eyebrow {
  color: var(--fwc-amber);
}

.directory-extra-5 {
  background: var(--ink, #0b0f1e);
}
.directory-extra-6 {
  background: var(--ink-2, #121a30);
}
.directory-extra-7 {
  background: var(--ink, #0b0f1e);
}
.directory-extra-8 {
  background: var(--ink-2, #121a30);
}
.directory-extra-9 {
  background: var(--ink, #0b0f1e);
}

/* ── Confederation pills ── */
.confed-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.confed-pill {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-pill, 999px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-text);
  cursor: pointer;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
}

.confed-pill:hover {
  border-color: var(--fwc-amber);
  color: var(--fwc-amber);
}

.confed-pill.active {
  background: var(--fwc-amber);
  border-color: var(--fwc-amber);
  color: var(--ink);
}

/* ── Confederation flag-chip grid ── */
.confed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-md);
}

.confed-chip {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  border: 1px solid var(--ink-line);
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
  color: var(--ink-text);
  transition:
    transform var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast);
}

.confed-chip:hover {
  transform: translateY(-2px);
  border-color: var(--fwc-amber);
  background: rgba(255, 255, 255, 0.07);
}

.confed-chip img {
  width: 32px;
  height: 21px;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}

.confed-chip-name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--font-size-small);
}

/* ── Groups at a Glance ── */
.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-lg);
}

.group-card {
  background: rgba(11, 15, 30, 0.55);
  border: 1px solid var(--ink-line);
  border-top: 3px solid var(--fwc-blue);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
}

.group-card-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-body);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fwc-amber);
  margin-bottom: var(--space-sm);
}

.group-card-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.group-card-list a {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  color: var(--ink-text);
  font-size: var(--font-size-small);
  padding: 4px 0;
  transition: color var(--transition-fast);
}

.group-card-list a:hover {
  color: var(--fwc-amber);
}

.group-card-list img {
  width: 20px;
  height: 13px;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── A–Z Index ── */
.az-index {
  columns: 4;
  column-gap: var(--space-xl);
}

.az-block {
  break-inside: avoid;
  margin-bottom: var(--space-lg);
  display: flex;
  gap: var(--space-md);
}

.az-letter {
  font-family: var(--font-display);
  font-size: var(--font-size-xxl);
  color: var(--fwc-amber);
  line-height: 1;
  flex-shrink: 0;
}

.az-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.az-list a {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  text-decoration: none;
  color: var(--ink-text);
  font-size: var(--font-size-small);
  transition: color var(--transition-fast);
}

.az-list a:hover {
  color: var(--fwc-amber);
}

.az-confed {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ── Trivia Wall (flip cards) ── */
.trivia-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-md);
}

.trivia-card {
  perspective: 1000px;
  height: 160px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.trivia-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
  transition: transform 0.5s;
  transform-style: preserve-3d;
}

.trivia-card[data-flipped="true"] .trivia-card-inner {
  transform: rotateY(180deg);
}

.trivia-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  text-align: center;
}

.trivia-face-front {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  gap: var(--space-sm);
}

.trivia-face-front img {
  width: 56px;
  height: 37px;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.trivia-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.trivia-hint {
  font-size: 11px;
  opacity: 0.6;
}

.trivia-face-back {
  background: var(--fwc-amber);
  color: var(--ink);
  transform: rotateY(180deg);
}

.trivia-fact {
  font-size: 12px;
  line-height: 1.4;
  font-weight: 600;
}

.trivia-cycle-hint {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.65;
}

.trivia-card:focus-visible .trivia-face-front {
  outline: 3px solid var(--fwc-amber);
  outline-offset: 2px;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Laptop (1024px–1279px) */
@media (max-width: 1279px) {
  .history-summary {
    grid-template-columns: repeat(2, 1fr);
  }
  .path-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet (768px–1023px) */
@media (max-width: 1023px) {
  .nation-hero-banner {
    min-height: 360px;
  }
  .nation-hero-flag {
    width: 88px;
    height: 60px;
  }
  .nation-hero-title {
    font-size: var(--font-size-xxl);
  }
  .nation-hero-identity {
    gap: var(--space-lg);
  }
  .strip-stat {
    min-width: 80px;
  }
  .strip-value {
    font-size: var(--font-size-large);
  }
  .history-summary {
    grid-template-columns: repeat(2, 1fr);
  }
  .xi-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .path-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .moments-carousel {
    gap: var(--space-sm);
  }
  .moment-card-body {
    padding: var(--space-xl);
  }
  .az-index {
    columns: 2;
  }
}

/* Mobile (<768px) */
@media (max-width: 767px) {
  :root {
    /* Real mobile main-nav height (measured, hamburger layout) —
       used only until JS overwrites it. */
    --main-nav-height: 78px;
  }

  .nation-nav {
    top: var(--main-nav-height);
    height: 56px;
  }

  .nation-section {
    scroll-margin-top: calc(var(--main-nav-height) + 56px);
  }

  .nation-hero {
    scroll-margin-top: var(--main-nav-height);
  }

  .nation-hero-banner {
    min-height: 300px;
    align-items: flex-end;
  }
  .nation-hero-identity {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
    padding-bottom: var(--space-lg);
  }
  .nation-hero-flag {
    width: 72px;
    height: 48px;
  }
  .nation-hero-title {
    font-size: var(--font-size-xl);
  }

  .nation-hero-strip {
    margin: 0 calc(-1 * var(--space-xs));
    padding: var(--space-xs) var(--space-xs);
  }
  .strip-value {
    font-size: var(--font-size-small);
  }
  .strip-stat {
    min-width: 72px;
  }

  .nation-section {
    padding: var(--space-xxl) 0;
  }

  .culture-narrative {
    font-size: var(--font-size-body);
  }
  .culture-quote {
    font-size: var(--font-size-body);
    padding: var(--space-md) var(--space-lg);
    max-width: 100%;
  }

  .timeline-node {
    min-width: 64px;
  }
  .timeline-badge {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }
  .timeline-year {
    font-size: 10px;
  }

  .history-summary {
    grid-template-columns: repeat(2, 1fr);
  }
  .summary-value {
    font-size: var(--font-size-xl);
  }

  .xi-card-grid {
    grid-template-columns: 1fr;
  }

  .moment-card-body {
    padding: var(--space-lg);
  }
  .moment-year {
    font-size: var(--font-size-xxl);
  }
  .moment-title {
    font-size: var(--font-size-large);
  }
  .moments-carousel {
    gap: var(--space-xs);
  }
  .carousel-btn {
    width: 40px;
    height: 40px;
  }

  .path-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .path-value {
    font-size: var(--font-size-large);
  }

  .nation-nav-container {
    padding: 0 var(--space-md);
  }
  .nation-nav-link {
    padding: var(--space-md) var(--space-md);
    font-size: 11px;
  }

  .nations-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .encyclopedia-search-input,
  .encyclopedia-select-input {
    min-width: unset;
    width: 100%;
  }
  .nation-meta {
    grid-template-columns: repeat(2, 1fr);
  }

  .directory-extra {
    padding: var(--space-xxl) 0;
  }
  .az-index {
    columns: 1;
  }
  .trivia-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
  .trivia-card {
    height: 140px;
  }
  .confed-pills {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: var(--space-xs);
  }
  .confed-pill {
    flex-shrink: 0;
  }
}

/* Small Mobile (≤375px) */
@media (max-width: 375px) {
  .nation-hero-title {
    font-size: var(--font-size-large);
  }
  .strip-stat {
    min-width: 60px;
  }
  .strip-value {
    font-size: var(--font-size-small);
  }
  .strip-label {
    font-size: 9px;
    line-height: 1.2;
    white-space: normal;
    word-break: break-word;
    max-width: 64px;
  }
  .strip-divider {
    display: none;
  }
  .timeline-node {
    min-width: 52px;
  }
  .timeline-badge {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }
  .history-summary {
    grid-template-columns: 1fr;
  }
  .path-grid {
    grid-template-columns: 1fr;
  }
  .nation-meta {
    grid-template-columns: 1fr;
  }
  .summary-value {
    font-size: var(--font-size-large);
  }
}
/* ============================================
   PITCH26 — ENCYCLOPEDIA V2 SECTION STYLES
   Added to encyclopedia.css for v2 enrichment
   Design: "Floodlight Almanac" dark system
   ============================================ */

/* ── No-data placeholder ── */
.no-data-placeholder {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-xxl) var(--space-lg);
  color: var(--ink-text);
  opacity: 0.6;
  font-size: var(--font-size-body);
}

/* ============================================
   TOURNAMENT 2026 SECTION
   ============================================ */
.tournament-summary-card {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  background: rgba(11, 15, 30, 0.72);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-lg);
}

.summary-field {
  text-align: center;
  padding: var(--space-sm) var(--space-md);
}

.summary-label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fwc-amber);
  margin-bottom: var(--space-xs);
}

.summary-val {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--font-size-large);
  color: var(--fwc-white);
  margin: 0;
}

.tournament-subtitle {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-base);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fwc-red);
  margin: var(--space-xl) 0 var(--space-md);
}

.tournament-matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-md);
}

.match-card {
  background: rgba(11, 15, 30, 0.55);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition:
    border-color var(--transition-base),
    transform var(--transition-fast);
}

.match-card:hover {
  border-color: var(--fwc-amber);
  transform: translateY(-2px);
}

.match-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  background: rgba(11, 15, 30, 0.4);
  border-bottom: 1px solid var(--ink-line);
}

.match-round {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fwc-amber);
}

.match-date {
  font-size: var(--font-size-small);
  color: var(--fwc-light-gray);
  opacity: 0.7;
}

.match-card-body {
  padding: var(--space-md);
}

.match-opponent-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.opponent-flag {
  width: 32px;
  height: 22px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.opponent-name {
  font-weight: 700;
  font-size: var(--font-size-base);
  color: var(--fwc-white);
}

.match-score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xs);
}

.match-score {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-xl);
  color: var(--fwc-white);
}

.match-result-badge {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-small);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  min-width: 36px;
  text-align: center;
}

.badge-win {
  background: rgba(60, 172, 59, 0.2);
  color: var(--fwc-green);
  border: 1px solid rgba(60, 172, 59, 0.4);
}

.badge-loss {
  background: rgba(230, 29, 37, 0.2);
  color: var(--fwc-red);
  border: 1px solid rgba(230, 29, 37, 0.4);
}

.badge-draw {
  background: rgba(245, 166, 35, 0.2);
  color: var(--fwc-amber);
  border: 1px solid rgba(245, 166, 35, 0.4);
}

.match-venue {
  font-size: var(--font-size-small);
  color: var(--fwc-light-gray);
  opacity: 0.6;
  margin-top: var(--space-xs);
}

.tournament-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-md);
}

.tournament-stats-grid .stat-card {
  background: rgba(11, 15, 30, 0.55);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  text-align: center;
}

.tournament-stats-grid .stat-card h4 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fwc-amber);
  margin: 0 0 var(--space-xs);
}

.tournament-stats-grid .stat-card p {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--font-size-base);
  color: var(--fwc-white);
  margin: 0;
}

/* ============================================
   LEGENDARY PLAYERS
   ============================================ */
.legends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
}

.legend-card {
  background: rgba(11, 15, 30, 0.55);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition:
    border-color var(--transition-base),
    transform var(--transition-fast);
}

.legend-card:hover {
  border-color: var(--fwc-amber);
  transform: translateY(-2px);
}

.legend-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-sm);
}

.legend-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-large);
  color: var(--fwc-white);
  margin: 0;
}

.legend-position-badge {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-small);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(42, 57, 141, 0.3);
  color: var(--fwc-white);
  border: 1px solid rgba(42, 57, 141, 0.5);
  white-space: nowrap;
}

.legend-era {
  font-size: var(--font-size-small);
  color: var(--fwc-amber);
  margin-bottom: var(--space-xs);
}

.legend-achievement {
  font-weight: 700;
  font-size: var(--font-size-body);
  color: var(--fwc-white);
  margin-bottom: var(--space-sm);
}

.legend-legacy {
  font-size: var(--font-size-body);
  line-height: 1.5;
  color: var(--fwc-light-gray);
  margin: 0;
}

/* ============================================
   MANAGER PROFILE
   ============================================ */
.manager-card-container {
  max-width: 720px;
  margin: 0 auto;
}

.manager-card {
  background: rgba(11, 15, 30, 0.55);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}

.manager-card-header {
  margin-bottom: var(--space-lg);
}

.manager-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-xxl);
  color: var(--fwc-white);
  margin: 0;
}

.manager-card-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.manager-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm) var(--space-md);
}

.manager-meta p {
  font-size: var(--font-size-body);
  color: var(--fwc-light-gray);
  margin: 0;
}

.manager-meta strong {
  color: var(--fwc-amber);
}

.manager-style-box {
  padding: var(--space-md);
  background: rgba(11, 15, 30, 0.4);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--fwc-amber);
}

.manager-style-box strong {
  color: var(--fwc-amber);
  display: block;
  margin-bottom: var(--space-xs);
  font-family: var(--font-heading);
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.manager-style-desc {
  font-size: var(--font-size-body);
  line-height: 1.6;
  color: var(--fwc-light-gray);
  margin: 0;
}

.manager-highlights-container {
  margin-bottom: var(--space-lg);
}

.manager-highlights-container h4 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fwc-amber);
  margin: 0 0 var(--space-sm);
}

.manager-highlights-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.manager-highlights-list li {
  padding: var(--space-xs) 0 var(--space-xs) var(--space-md);
  border-bottom: 1px solid var(--ink-line);
  font-size: var(--font-size-body);
  color: var(--fwc-light-gray);
  position: relative;
}

.manager-highlights-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--fwc-red);
}

.manager-quote-box {
  border-left: 3px solid var(--fwc-red);
  padding: var(--space-sm) var(--space-md);
  margin: 0;
}

.manager-quote-text {
  font-style: italic;
  font-size: var(--font-size-body);
  color: var(--fwc-light-gray);
  margin: 0;
}

/* ============================================
   RIVALRIES
   ============================================ */
.rivalries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-md);
}

.rivalry-card {
  background: rgba(11, 15, 30, 0.55);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: border-color var(--transition-base);
}

.rivalry-card:hover {
  border-color: var(--fwc-red);
}

.rivalry-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.rivalry-opponent-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.rivalry-opponent {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-large);
  color: var(--fwc-white);
  margin: 0;
}

.rivalry-description {
  font-size: var(--font-size-body);
  line-height: 1.5;
  color: var(--fwc-light-gray);
  margin: 0 0 var(--space-md);
}

.rivalry-record {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: rgba(11, 15, 30, 0.4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
}

.record-label {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-small);
  text-transform: uppercase;
  color: var(--fwc-amber);
}

.record-stats {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--font-size-body);
  color: var(--fwc-white);
}

.rivalry-memorable {
  font-size: var(--font-size-small);
  color: var(--fwc-light-gray);
  opacity: 0.8;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--ink-line);
}

/* ============================================
   KEY PLAYERS 2026
   ============================================ */
/* ── Key Player Spotlight Grid ──
   2 per row on desktop, 1 per row on smaller screens.
   Card design uses an initials avatar instead of a photo image. */
.key-players-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

@media (max-width: 640px) {
  .key-players-grid {
    grid-template-columns: 1fr;
  }
}

.key-player-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: rgba(11, 15, 30, 0.55);
  border: 1px solid var(--ink-line);
  border-left: 3px solid var(--nation-primary, var(--fwc-amber));
  border-radius: var(--radius-md);
  transition:
    border-color var(--transition-base),
    transform var(--transition-fast);
}

.key-player-card:hover {
  border-color: var(--nation-secondary, var(--fwc-amber));
  transform: translateY(-2px);
}

/* Head row: avatar circle + name/role */
.key-player-head {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.key-player-avatar {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: color-mix(
    in srgb,
    var(--nation-primary, var(--fwc-amber)) 25%,
    var(--ink-2)
  );
  border: 2px solid var(--nation-primary, var(--fwc-amber));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-large);
  color: var(--nation-secondary, var(--fwc-amber));
  text-transform: uppercase;
}

.key-player-head-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.key-player-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-large);
  color: var(--ink-text);
  margin: 0;
  line-height: 1.2;
}

.key-player-role-badge {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  background: color-mix(
    in srgb,
    var(--nation-primary, var(--fwc-amber)) 15%,
    transparent
  );
  color: var(--nation-secondary, var(--fwc-amber));
  border: 1px solid
    color-mix(in srgb, var(--nation-primary, var(--fwc-amber)) 30%, transparent);
  width: fit-content;
}

.key-player-reason {
  font-size: var(--font-size-body);
  line-height: 1.5;
  color: var(--ink-muted);
  margin: 0;
  flex: 1;
}

.key-player-link {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--nation-secondary, var(--fwc-amber));
  text-decoration: none;
  padding: var(--space-xs) var(--space-md);
  border: 1px solid var(--nation-secondary, var(--fwc-amber));
  border-radius: var(--radius-sm);
  margin-top: auto;
  transition: background var(--transition-fast);
  width: fit-content;
}

.key-player-link:hover {
  background: var(--nation-secondary, var(--fwc-amber));
  color: var(--ink);
}

/* ============================================
   FUN FACTS — Nation-accented cards
   Uses --nation-accent (set from primary_colour by JS)
   as border-left + category label colour, not as background.
   ============================================ */
.fun-fact-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
  list-style: none;
  padding: 0;
  margin: 0;
}

.fun-fact-card {
  background: var(--paper);
  color: var(--ink-3);
  border-left: 4px solid var(--nation-accent, var(--fwc-amber));
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

.fun-fact-category {
  color: var(--nation-accent, var(--fwc-amber));
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: uppercase;
  font-size: var(--font-size-small);
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.fun-fact-text {
  color: var(--ink-3);
  font-size: var(--font-size-body);
  line-height: 1.6;
  margin: 0;
}

@media (max-width: 480px) {
  .fun-fact-card-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   WC RECORDS
   ============================================ */
.records-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
}

.record-card {
  background: rgba(11, 15, 30, 0.55);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  text-align: center;
}

.record-icon {
  font-size: var(--font-size-xl);
  display: block;
  margin-bottom: var(--space-xs);
}

.record-card h3 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fwc-amber);
  margin: 0 0 var(--space-xs);
}

.record-value {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--font-size-body);
  color: var(--fwc-white);
  margin: 0;
  line-height: 1.4;
}

/* ============================================
   CULTURE DETAIL (dynamically created)
   ============================================ */

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .tournament-summary-card {
    grid-template-columns: repeat(2, 1fr);
  }

  .tournament-matches-grid {
    grid-template-columns: 1fr;
  }

  .legends-grid,
  .rivalries-grid,
  .key-players-grid,
  .records-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .manager-meta {
    grid-template-columns: 1fr;
  }

  .manager-card {
    padding: var(--space-md);
  }

  .key-player-avatar {
    width: 40px;
    height: 40px;
    font-size: var(--font-size-body);
  }
}

@media (max-width: 480px) {
  .legends-grid,
  .rivalries-grid,
  .key-players-grid,
  .records-grid {
    grid-template-columns: 1fr;
  }
  .legend-card,
  .rivalry-card,
  .key-player-card,
  .record-card {
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .tournament-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .records-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   NATION-COLORED THEMING
   Activated when .nation-themed class is applied
   by applyNationColors() in the JS.
   Uses --nation-primary and --nation-secondary
   which are set dynamically per nation.
   ============================================ */

/* Flag as hero background with heavy overlay.
   NOTE: an earlier "nation-colored gradient overlay" rule for this
   same selector used to live here too, but its background-image was
   always being silently overridden by this rule (which comes later
   in the stylesheet and sets background-image directly), so it never
   actually rendered. Removed rather than kept as dead code — if a
   nation-color-tinted hero is still wanted, it needs to be layered
   in here explicitly (e.g. as a second background layer) rather than
   as a separate same-selector rule. */
.nation-themed .nation-hero-banner {
  background-image: var(--flag-bg, none);
  background-size: cover;
  background-position: center;
  background-blend-mode: overlay;
}

/* Section eyebrows use nation primary color */
.nation-themed .section-eyebrow {
  color: var(--nation-primary);
}

/* Section title underline gradient uses nation colors */
.nation-themed .nation-section .section-title::after {
  background: linear-gradient(
    90deg,
    var(--nation-primary),
    var(--nation-secondary)
  );
}

/* Culture section gets a nation-colored gradient border */
.nation-themed #culture {
  position: relative;
}

.nation-themed #culture::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--nation-primary),
    var(--nation-secondary),
    var(--nation-primary)
  );
  opacity: 0.7;
}

/* Culture detail cards use nation-colored accents */
.nation-themed .culture-detail-card {
  border-left: 3px solid var(--nation-primary);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--nation-primary) 8%, rgba(11, 15, 30, 0.55)),
    rgba(11, 15, 30, 0.55)
  );
}

.nation-themed .culture-detail-label {
  color: var(--nation-secondary);
}

.nation-themed .culture-detail-icon {
  filter: drop-shadow(
    0 0 8px color-mix(in srgb, var(--nation-primary) 40%, transparent)
  );
}

/* Nation-colored stat strip in hero */
.nation-themed .nation-hero-strip {
  border-top: 2px solid var(--nation-primary);
}

.nation-themed .strip-value {
  text-shadow: 0 0 12px
    color-mix(in srgb, var(--nation-primary) 30%, transparent);
}

/* Key player cards get nation-colored avatar + accent */
.nation-themed .key-player-avatar {
  border-color: var(--nation-primary);
  background: color-mix(in srgb, var(--nation-primary) 20%, var(--ink-2));
  color: var(--nation-secondary);
}

.nation-themed .key-player-card {
  border-left-color: var(--nation-primary);
}

/* Legend cards get nation-colored hover */
.nation-themed .legend-card:hover {
  border-color: var(--nation-primary);
  box-shadow: 0 4px 20px
    color-mix(in srgb, var(--nation-primary) 20%, transparent);
}

.nation-themed .legend-position-badge {
  background: color-mix(
    in srgb,
    var(--nation-secondary) 20%,
    rgba(11, 15, 30, 0.4)
  );
  color: var(--nation-secondary);
  border-color: color-mix(in srgb, var(--nation-secondary) 40%, transparent);
}

/* Rivalry cards get nation-colored hover */
.nation-themed .rivalry-card:hover {
  border-color: var(--nation-primary);
}

/* Tournament summary uses nation-colored accents */
.nation-themed .summary-label {
  color: var(--nation-secondary);
}

/* Path cards get nation-colored icons */
.nation-themed .path-card {
  border-top: 2px solid transparent;
  transition: border-color var(--transition-base);
}

.nation-themed .path-card:hover {
  border-top-color: var(--nation-primary);
}

/* Sticky nav active link uses nation color */
.nation-themed .nation-nav-link.active {
  color: var(--nation-secondary);
  border-bottom-color: var(--nation-primary);
}

/* Fallback for browsers without color-mix */
@supports not (color: color-mix(in srgb, red, blue)) {
  .nation-themed .culture-detail-card {
    background: rgba(11, 15, 30, 0.55);
  }
  .nation-themed .nation-hero-banner {
    background: rgba(11, 15, 30, 0.88);
  }
}

/* ============================================
   SQUAD ANALYSIS (Tactical Breakdown) STYLES
   ============================================ */
.analysis-grid-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.analysis-two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.analysis-column {
  padding: var(--space-lg);
  background: rgba(11, 15, 30, 0.55);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-lg);
}

.analysis-column h3 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fwc-amber);
  margin: 0 0 var(--space-md);
}

.analysis-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.analysis-list li {
  padding: var(--space-xs) 0 var(--space-xs) var(--space-md);
  border-bottom: 1px solid var(--ink-line);
  font-size: var(--font-size-body);
  color: var(--ink-text);
  position: relative;
}

.analysis-list.strengths-list li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--fwc-green);
  font-weight: 700;
}

.analysis-list.weaknesses-list li::before {
  content: "\2717";
  position: absolute;
  left: 0;
  color: var(--fwc-red);
  font-weight: 700;
}

.analysis-tactical-container {
  padding: var(--space-lg);
  background: rgba(11, 15, 30, 0.4);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--fwc-amber);
}

.analysis-tactical-container h3 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fwc-amber);
  margin: 0 0 var(--space-sm);
}

.analysis-tactical-text {
  font-size: var(--font-size-body);
  line-height: 1.6;
  color: var(--ink-text);
  margin: 0;
}

.analysis-formation-container h3 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fwc-amber);
  margin: 0 0 var(--space-md);
}

.formation-badge {
  display: inline-block;
  margin: 0 0 var(--space-md);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  background: rgba(11, 15, 30, 0.55);
  border: 1px solid var(--ink-line);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--font-size-small);
  letter-spacing: 0.04em;
  color: var(--nation-primary, var(--fwc-amber));
}

/* ============================================
   FORMATION PITCH GRAPHIC
   ----------------------------------------------
   SVG is generated in JS (renderFormationPitch) from
   squad_analysis.predicted_xi + manager.preferred_formation.
   Line colours are interpolated between the nation's own
   --nation-primary / --nation-secondary, set globally by
   applyNationColors() in encyclopedia.js.
   ============================================ */
.formation-pitch-wrap {
  width: 100%;
  max-width: 420px;
  margin: 0 auto var(--space-lg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--ink-line);
  background: radial-gradient(
    ellipse at center,
    #123a26 0%,
    #0c2a1b 70%,
    #0a2117 100%
  );
}

.formation-pitch-wrap svg {
  display: block;
  width: 100%;
  height: auto;
}

.formation-pitch-line {
  stroke: rgba(255, 255, 255, 0.28);
  stroke-width: 2;
  fill: none;
}

.formation-player-circle {
  stroke: rgba(255, 255, 255, 0.5);
  stroke-width: 1.5;
}

.formation-player-pos {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 11px;
  text-anchor: middle;
  dominant-baseline: middle;
}

.formation-player-name {
  font-family: var(--font-body, sans-serif);
  font-weight: 700;
  font-size: 12px;
  text-anchor: middle;
  fill: var(--fwc-white, #fff);
}

.predicted-xi-display {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.predicted-player {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  background: rgba(11, 15, 30, 0.55);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-full);
  font-size: var(--font-size-body);
  color: var(--ink-text);
}

.player-marker {
  font-size: var(--font-size-small);
}

.player-position-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.03em;
}

.player-name-text {
  font-weight: 600;
}

@media (max-width: 768px) {
  .nation-nav {
    top: 80.5px;
  }
  .analysis-two-columns {
    grid-template-columns: 1fr;
  }
  .predicted-xi-display {
    flex-direction: column;
  }
  .predicted-player {
    width: 100%;
  }
}

/* ============================================
   FIX: Sticky nav gap — ensure no space between
   main nav and nation-nav
   ============================================ */
main {
  padding-top: 0 !important;
}

#encyclopedia-detail {
  margin-top: 0;
}

/* ============================================
   FLAG-BASED BACKGROUNDS
   Uses nation flag as decorative background
   ============================================ */

/* Culture section flag background */
.nation-culture {
  position: relative;
  overflow: hidden;
  background: var(--ink-2);
}

.nation-culture::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0.06;
  filter: blur(40px);
  z-index: 0;
  pointer-events: none;
}

.nation-culture > .container {
  position: relative;
  z-index: 1;
}

/* Tournament section with flag accent */
.nation-tournament {
  position: relative;
  overflow: hidden;
  background: var(--ink);
}

.nation-tournament::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: bottom center;
  opacity: 0.04;
  filter: blur(20px);
  z-index: 0;
  pointer-events: none;
}

.nation-tournament > .container {
  position: relative;
  z-index: 1;
}

/* History section with subtle flag */
.nation-history {
  position: relative;
  overflow: hidden;
  background: var(--ink);
}

.nation-history::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0.03;
  filter: blur(30px);
  z-index: 0;
  pointer-events: none;
}

.nation-history > .container {
  position: relative;
  z-index: 1;
}

/* Section backgrounds — all dark for consistency.
   (tournament/culture/history/all-time-xi/moments/path are set on
   their own rules above; the sections below have no other rule.) */
.nation-legends {
  background: var(--ink-2);
}

.nation-manager {
  background: var(--ink-2);
}

.nation-analysis {
  background: var(--ink);
}

.nation-rivalries {
  background: var(--ink);
}

.nation-key-players {
  background: var(--ink-2);
}

.nation-fun-facts {
  background: var(--ink-2);
}

.nation-records {
  background: var(--ink);
}

/* ════════════════════════════════════════════════════════════
   TOURNAMENT DASHBOARD — aggregate stats across 48 nations
   ════════════════════════════════════════════════════════════ */
.tour-dash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

@media (max-width: 768px) {
  .tour-dash-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .tour-dash-grid {
    grid-template-columns: 1fr;
  }
}

.tour-dash-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--ink-line, rgba(233, 238, 255, 0.08));
  border-radius: 16px;
  transition:
    border-color 0.3s,
    transform 0.3s;
  position: relative;
  overflow: hidden;
}

.tour-dash-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--fwc-amber, #f2b705),
    var(--fwc-sky, #4cc9f0)
  );
  opacity: 0;
  transition: opacity 0.3s;
}

.tour-dash-card:hover {
  border-color: rgba(242, 183, 5, 0.15);
  transform: translateY(-3px);
}
.tour-dash-card:hover::before {
  opacity: 1;
}

.tour-dash-icon {
  font-size: 28px;
  margin-bottom: 12px;
}

.tour-dash-value {
  font-family: var(--font-display, "Anton", sans-serif);
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-weight: 900;
  color: var(--ink-text, #eef1fb);
  line-height: 1.1;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.tour-dash-label {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted, #9aa3c4);
  font-weight: 600;
}

.tour-dash-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--ink-line, rgba(233, 238, 255, 0.06));
  border-radius: 14px;
}

.tour-dash-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--ink-line, rgba(233, 238, 255, 0.08));
  font-size: 13px;
  color: var(--ink-text, #eef1fb);
}

.tour-dash-chip strong {
  color: var(--fwc-amber, #f2b705);
  font-family: var(--font-mono, monospace);
}

/* ════════════════════════════════════════════════════════════
   HALL OF CHAMPIONS — past World Cup winners
   ════════════════════════════════════════════════════════════ */
.champions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 900px) {
  .champions-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 600px) {
  .champions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 400px) {
  .champions-grid {
    grid-template-columns: 1fr;
  }
}

.champion-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--ink-line, rgba(233, 238, 255, 0.08));
  border-radius: 16px;
  transition:
    border-color 0.3s,
    transform 0.3s,
    box-shadow 0.3s;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.champion-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #f2b705, #ffd700, #f2b705);
  opacity: 0;
  transition: opacity 0.3s;
}

.champion-card:hover {
  border-color: rgba(242, 183, 5, 0.25);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(242, 183, 5, 0.08);
}
.champion-card:hover::before {
  opacity: 1;
}

.champion-card-flag {
  width: 56px;
  height: auto;
  aspect-ratio: 3 / 2;
  border-radius: 6px;
  margin-bottom: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  object-fit: cover;
}

.champion-card-flag--placeholder {
  width: 56px;
  height: 37px;
  border-radius: 6px;
  margin-bottom: 12px;
  background: rgba(242, 183, 5, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.champion-card-name {
  font-family: var(--font-heading, "Space Grotesk", sans-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-text, #eef1fb);
  margin-bottom: 6px;
}

.champion-card-titles {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}

.champion-card-trophy {
  font-size: 14px;
  filter: drop-shadow(0 0 4px rgba(242, 183, 5, 0.4));
}

.champion-card-years {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: var(--fwc-amber, #f2b705);
  font-weight: 600;
}

.champion-card-current {
  font-size: 10px;
  color: var(--ink-muted, #9aa3c4);
  margin-top: 4px;
}

/* ════════════════════════════════════════════════════════════
   STORYLINES GRID — debutants and narratives
   ════════════════════════════════════════════════════════════ */
.storylines-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 900px) {
  .storylines-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .storylines-grid {
    grid-template-columns: 1fr;
  }
}

.storyline-card {
  display: flex;
  flex-direction: column;
  padding: 22px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--ink-line, rgba(233, 238, 255, 0.08));
  border-radius: 16px;
  transition:
    border-color 0.3s,
    transform 0.3s;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.storyline-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent, var(--fwc-amber, #f2b705));
  opacity: 0;
  transition: opacity 0.3s;
}

.storyline-card:hover {
  border-color: rgba(43, 207, 156, 0.15);
  transform: translateY(-3px);
}
.storyline-card:hover::before {
  opacity: 1;
}

.storyline-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  width: fit-content;
}

.storyline-card-badge--debut {
  color: var(--fwc-green, #2bcf9c);
  background: rgba(43, 207, 156, 0.08);
  border: 1px solid rgba(43, 207, 156, 0.15);
}

.storyline-card-badge--underdog {
  color: var(--fwc-sky, #4cc9f0);
  background: rgba(76, 201, 240, 0.08);
  border: 1px solid rgba(76, 201, 240, 0.15);
}

.storyline-card-badge--comeback {
  color: var(--fwc-amber, #f2b705);
  background: rgba(242, 183, 5, 0.08);
  border: 1px solid rgba(242, 183, 5, 0.15);
}

.storyline-card-badge--record {
  color: #e4405f;
  background: rgba(228, 64, 95, 0.08);
  border: 1px solid rgba(228, 64, 95, 0.15);
}

.storyline-card-flag {
  width: 40px;
  height: auto;
  aspect-ratio: 3 / 2;
  border-radius: 4px;
  margin-bottom: 10px;
}

.storyline-card-name {
  font-family: var(--font-heading, "Space Grotesk", sans-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-text, #eef1fb);
  margin-bottom: 8px;
}

.storyline-card-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-muted, #9aa3c4);
  margin-bottom: 12px;
}

.storyline-card-meta {
  display: flex;
  gap: 12px;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: var(--ink-muted, #9aa3c4);
  margin-top: auto;
}

.storyline-card-meta span strong {
  color: var(--fwc-amber, #f2b705);
}

/* ════════════════════════════════════════════════════════════
   STAR POWER INDEX — top-rated players across all squads
   ════════════════════════════════════════════════════════════ */
.star-power-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

@media (max-width: 900px) {
  .star-power-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 600px) {
  .star-power-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 400px) {
  .star-power-grid {
    grid-template-columns: 1fr;
  }
}

.star-power-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--ink-line, rgba(233, 238, 255, 0.08));
  border-radius: 16px;
  transition:
    border-color 0.3s,
    transform 0.3s,
    box-shadow 0.3s;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.star-power-card:hover {
  border-color: rgba(242, 183, 5, 0.2);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.star-power-rank {
  position: absolute;
  top: 8px;
  left: 12px;
  font-family: var(--font-display, "Anton", sans-serif);
  font-size: 14px;
  font-weight: 900;
  color: var(--ink-muted, #9aa3c4);
  opacity: 0.5;
}

.star-power-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 10px;
  border: 2px solid var(--fwc-amber, #f2b705);
}

.star-power-photo-fallback {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin-bottom: 10px;
  background: linear-gradient(
    135deg,
    var(--fwc-amber, #f2b705),
    var(--fwc-sky, #4cc9f0)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display, sans-serif);
  font-size: 20px;
  font-weight: 900;
  color: var(--ink, #0b0f1e);
}

.star-power-name {
  font-family: var(--font-heading, "Space Grotesk", sans-serif);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-text, #eef1fb);
  margin-bottom: 4px;
  line-height: 1.3;
}

.star-power-nation {
  font-size: 11px;
  color: var(--ink-muted, #9aa3c4);
  margin-bottom: 8px;
}

.star-power-form {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 700;
  color: var(--fwc-amber, #f2b705);
  background: rgba(242, 183, 5, 0.1);
  border: 1px solid rgba(242, 183, 5, 0.15);
}

.star-power-pos {
  font-size: 10px;
  color: var(--ink-muted, #9aa3c4);
  margin-top: 4px;
  font-family: var(--font-mono, monospace);
}

/* ════════════════════════════════════════════════════════════
   HOST NATION SPOTLIGHT — USA, Mexico, Canada
   ════════════════════════════════════════════════════════════ */
.host-spotlight-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 700px) {
  .host-spotlight-grid {
    grid-template-columns: 1fr;
  }
}

.host-spotlight-card {
  text-align: center;
  padding: 32px 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--ink-line, rgba(233, 238, 255, 0.08));
  border-radius: 20px;
  transition:
    border-color 0.3s,
    transform 0.3s;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.host-spotlight-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent, var(--fwc-amber, #f2b705));
}

.host-spotlight-card:hover {
  border-color: rgba(242, 183, 5, 0.2);
  transform: translateY(-3px);
}

.host-spotlight-flag {
  width: 72px;
  height: auto;
  aspect-ratio: 3 / 2;
  border-radius: 8px;
  margin: 0 auto 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  display: block;
  object-fit: cover;
}

.host-spotlight-name {
  font-family: var(--font-heading, "Space Grotesk", sans-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-text, #eef1fb);
  margin-bottom: 6px;
}

.host-spotlight-role {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fwc-amber, #f2b705);
  font-weight: 700;
  margin-bottom: 16px;
}

.host-spotlight-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
}

.host-spotlight-stat {
  text-align: center;
}

.host-spotlight-stat-num {
  font-family: var(--font-display, "Anton", sans-serif);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--ink-text, #eef1fb);
}

.host-spotlight-stat-label {
  font-size: 10px;
  color: var(--ink-muted, #9aa3c4);
  font-family: var(--font-mono, monospace);
  text-transform: uppercase;
}

.host-spotlight-detail {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-muted, #9aa3c4);
  margin-bottom: 16px;
}

.host-spotlight-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--fwc-amber, #f2b705);
  transition: transform 0.2s;
  display: inline-block;
}

.host-spotlight-card:hover .host-spotlight-link {
  transform: translateX(4px);
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE — new encyclopedia directory sections
   ════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .tour-dash-card {
    padding: 20px 14px;
  }
  .champion-card {
    padding: 18px 12px;
  }
  .storyline-card {
    padding: 16px 14px;
  }
  .star-power-card {
    padding: 16px 12px;
  }
  .star-power-photo,
  .star-power-photo-fallback {
    width: 52px;
    height: 52px;
  }
  .host-spotlight-card {
    padding: 24px 16px;
  }
  .host-spotlight-stats {
    gap: 16px;
  }
}
