@layer components {
  /* ══════════════════════════════════════════════════════════════════
     FIFA RANKING — match overview (national-team matches only)
     Two treatments share this sheet:
       · .fifa-vs    → single card, head-to-head + ONE superimposed chart
       · .fifa-cards → two compact rank cards + a "Ver evolución" reveal
     Plus .fifa-badge, the slim "FIFA #5" chip under the hero team names.
     The superimposed line chart is drawn by `fifa-ranking-versus`; the
     compact-card sparklines reuse the single-team `fifa-ranking-chart`.
     ══════════════════════════════════════════════════════════════════ */

  /* ── Shared: head-to-head comparison row (two teams facing off) ── */
  .fifa-h2h {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-2);
    margin-top: 2px;
  }

  .fifa-h2h__team {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1 1 0;
  }

  .fifa-h2h__team--away {
    align-items: flex-end;
    text-align: right;
  }

  .fifa-h2h__label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
  }

  .fifa-h2h__team--away .fifa-h2h__label {
    flex-direction: row-reverse;
  }

  .fifa-h2h__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  .fifa-h2h__name {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .fifa-h2h__rank {
    font-family: var(--font-title);
    font-size: 30px;
    font-weight: 700;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
    /* colour set inline per team (team accent) */
  }

  .fifa-h2h__pts {
    font-family: var(--font-body);
    font-size: 11px;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
  }

  /* ── Superimposed chart wrapper (versus) ── */
  .fifa-vs__chart-wrapper {
    position: relative;
    height: 170px;
    margin-top: var(--space-3);
  }

  .fifa-vs__chart-wrapper[hidden] {
    display: none;
  }

  .fifa-vs-tooltip {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    background: var(--color-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: 8px;
    padding: 6px 9px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transition: opacity 150ms ease;
    z-index: 10;
    min-width: 96px;
  }

  .fifa-vs-tooltip__year {
    font-family: var(--font-body);
    font-size: 10px;
    color: var(--color-text-muted);
    text-align: center;
    margin-bottom: 3px;
    font-variant-numeric: tabular-nums;
  }

  .fifa-vs-tooltip__row {
    display: flex;
    align-items: center;
    gap: 5px;
  }

  .fifa-vs-tooltip__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  .fifa-vs-tooltip__name {
    font-family: var(--font-body);
    font-size: 11px;
    color: var(--color-text);
    flex: 1 1 auto;
    white-space: nowrap;
  }

  .fifa-vs-tooltip__rank {
    font-family: var(--font-title);
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
  }

  /* ── Hero badge: "FIFA #5" button under each team name (opens the modal) ── */
  .fifa-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border: 0;
    border-radius: 999px;
    background: color-mix(in oklab, var(--color-text) 12%, transparent);
    font-family: var(--font-title);
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.5;
    color: color-mix(in oklab, var(--color-text) 70%, transparent);
    white-space: nowrap;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: background 0.15s var(--easing-default, ease);
  }

  .fifa-badge:hover {
    background: color-mix(in oklab, var(--color-text) 22%, transparent);
    color: var(--color-text);
  }

  .fifa-badge:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
  }

  .fifa-badge__rank {
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
  }
}
