.comp-wrap {
    /* Brand tokens */
    --navy: #003f7c;
    --navy-dark: #002a5d;
    --red: #d62242;
    --red-dark: #b91c3a;
    --gold: #f59e0b;
    --gray: #676767;
    --gray-light: #e9ecef;
    --gray-lighter: #f8f9fa;
    --white: #ffffff;
    --text: #0f141a;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-pill: 9999px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.05);
    --shadow-md: 0 4px 12px rgba(0, 63, 124, 0.12);
    --shadow-lg: 0 10px 30px rgba(0, 42, 93, 0.18);
    --shadow-red: 0 4px 16px rgba(214, 34, 66, 0.22);
    --font-display: 'Barlow Semi Condensed', 'Poppins', -apple-system, sans-serif;
    --font-body: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --ease: cubic-bezier(.4, 0, .2, 1);
  }

  /* Scoped reset */
  .comp-wrap *, .comp-wrap *::before, .comp-wrap *::after { box-sizing: border-box; }

  .comp-wrap {
    /* Largeur « large » du thème (wide-size) : la sortie du shortcode porte
       .alignwide ; ce max-width sert de repli hors contexte thème */
    box-sizing: border-box;
    max-width: var(--wp--style--global--wide-size, 1280px);
    margin-left: auto;
    margin-right: auto;
    padding: 20px clamp(16px, 2.5vw, 48px);
    font-family: var(--font-body);
    background: var(--gray-lighter);
    color: var(--text);
    border-radius: var(--radius-lg);
  }

  /* ==============================================
     HEADER COMPÉTITION
     ============================================== */
  .comp-title {
    position: relative;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
    color: white;
    padding: 18px 24px 16px;
    border-radius: var(--radius-lg);
    margin-bottom: 18px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
  }
  .comp-title::before {
    content: '';
    position: absolute; inset: 0;
    background: repeating-linear-gradient(
      -45deg,
      transparent 0 20px,
      rgba(255,255,255,0.04) 20px 21px
    );
    pointer-events: none;
  }
  .comp-title::after {
    content: '';
    position: absolute;
    right: -60px; top: 50%;
    transform: translateY(-50%);
    width: 220px; height: 220px;
    background: radial-gradient(circle, var(--red) 0%, transparent 65%);
    opacity: 0.28;
    pointer-events: none;
  }
  .comp-title-inner { position: relative; }
  .comp-title h1 {
    font-family: var(--font-display);
    font-size: 1.55rem;
    line-height: 1.05;
    margin: 0;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }
  .comp-kicker {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(255,255,255,0.7);
    margin-bottom: 5px;
  }
  .comp-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
  }
  .comp-live-count {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--red);
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    box-shadow: 0 2px 10px rgba(214,34,66,0.4);
  }
  .comp-live-count::before {
    content: '';
    width: 7px; height: 7px;
    background: white;
    border-radius: 50%;
    animation: blink 1.5s infinite;
  }
  .comp-year-pill {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
  }
  @keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

  /* ==============================================
     SECTION LABELS
     ============================================== */
  .comp-section-label {
    font-family: var(--font-display);
    margin: 22px 0 10px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .comp-section-label::before {
    content: '';
    display: inline-block;
    width: 3px; height: 16px;
    background: var(--red);
    border-radius: var(--radius-pill);
  }
  .comp-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--gray-light), transparent);
  }
  .comp-section-label:first-of-type { margin-top: 14px; }

  /* ==============================================
     POULE SELECTOR (sticky)
     ============================================== */
  .poule-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.95);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: var(--comp-sticky-top, 0px);
    z-index: 20;
  }
  .poule-btn {
    padding: 8px 16px;
    background: white;
    border: 1.5px solid var(--gray-light);
    border-radius: var(--radius-pill);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--navy);
    cursor: pointer;
    transition: all 0.2s var(--ease);
    text-transform: uppercase;
    font-family: inherit;
  }
  .poule-btn {
    font-family: var(--font-display);
  }
  .poule-btn:hover {
    border-color: var(--red);
    color: var(--red);
    transform: translateY(-1px);
  }
  .poule-btn.active {
    background: var(--navy);
    color: white;
    border-color: var(--navy);
    box-shadow: 0 2px 10px rgba(0,63,124,0.3);
  }

  /* ==============================================
     PHASE CONTAINER
     ============================================== */
  .phase-container { margin-bottom: 28px; }
  .phase-container.group { display: none; }
  .phase-container.group.active { display: block; animation: fadeIn 0.3s var(--ease); }
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* Phase header (standalone card) */
  .phase-header {
    position: relative;
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 42, 93, 0.1);
  }
  .phase-container.group .phase-header {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  }
  .phase-container.knockout .phase-header {
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  }
  .phase-header::before {
    content: '';
    position: absolute; inset: 0;
    background: repeating-linear-gradient(
      -45deg,
      transparent 0 18px,
      rgba(255,255,255,0.04) 18px 19px
    );
    pointer-events: none;
  }
  .phase-title {
    position: relative;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .phase-badge {
    position: relative;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,0.25);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  .phase-badge.live { background: rgba(255,255,255,0.2); }
  .phase-badge.live::before {
    content: '';
    width: 6px; height: 6px;
    background: white;
    border-radius: 50%;
    animation: blink 1.5s infinite;
  }

  /* Phase subtabs (journées) — standalone card */
  .phase-subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px 14px;
    background: white;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
  }
  .phase-subtab {
    position: relative;
    padding: 6px 13px;
    background: white;
    border: 1.5px solid var(--gray-light);
    border-radius: var(--radius-pill);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    color: var(--navy);
    cursor: pointer;
    transition: all 0.2s var(--ease);
    white-space: nowrap;
  }
  .phase-subtab:hover {
    border-color: var(--navy);
    transform: translateY(-1px);
  }
  .phase-subtab.active {
    background: var(--navy);
    color: white;
    border-color: var(--navy);
  }
  .phase-subtab.has-live::after {
    content: '';
    position: absolute;
    top: -3px; right: -3px;
    width: 9px; height: 9px;
    background: var(--red);
    border: 2px solid white;
    border-radius: 50%;
    animation: blink 1.5s infinite;
  }
  .phase-subtab.current .dot-current {
    display: inline-block;
    width: 5px; height: 5px;
    background: var(--red);
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
  }
  .phase-subtab.active .dot-current { background: white; }

  /* Phase content — standalone card */
  .phase-content {
    background: white;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
  }

  /* Phase body: sidebar (standings) + main (matches) */
  .phase-body { display: block; }
  .phase-main { min-width: 0; }
  .phase-sidebar { min-width: 0; }

  /* Onglets Résultats / Classement (dans le bandeau navy de la poule) */
  .view-tabs {
    position: relative;
    margin-left: auto;
    display: flex;
    gap: 6px;
  }
  .phase-badge + .view-tabs { margin-left: 0; }
  .view-tab {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: var(--radius-pill);
    padding: 6px 14px;
    font-size: 12.5px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s var(--ease);
  }
  .view-tab:hover { background: rgba(255, 255, 255, 0.24); }
  .view-tab.active {
    background: #fff;
    color: var(--navy);
    border-color: #fff;
  }

  .view-panel { display: none; }
  .view-panel.active { display: block; animation: fadeIn 0.2s var(--ease); }

  /* Classement dans son onglet : table centrée, pas étirée en pleine largeur */
  .phase-standings .standings-wrap {
    max-width: 1000px;
    margin: 0 auto;
  }

  /* Phases finales : grille 2 colonnes sur desktop */
  .knockouts-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .knockouts-grid .phase-container { margin-bottom: 0; min-width: 0; }
  .phase-journee-panel { display: none; }
  .phase-journee-panel.active { display: block; animation: fadeIn 0.2s var(--ease); }

  /* ==============================================
     KNOCKOUT — onglets Aller/Retour + rangées compactes
     ============================================== */
  .ko-leg-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    padding: 4px;
    background: var(--gray-lighter);
    border-radius: var(--radius);
  }
  .ko-leg-tab {
    flex: 1;
    position: relative;
    padding: 8px 14px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.18s var(--ease);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }
  .ko-leg-tab:hover { color: var(--navy); }
  .ko-leg-tab.active {
    background: white;
    color: var(--navy-dark);
    box-shadow: var(--shadow-sm);
  }
  .ko-leg-tab .ko-leg-count {
    display: inline-block;
    padding: 1px 7px;
    background: var(--gray-light);
    color: var(--navy);
    border-radius: var(--radius-pill);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.4;
  }
  .ko-leg-tab.active .ko-leg-count { background: var(--navy); color: white; }
  .ko-leg-tab .ko-leg-live {
    display: inline-block;
    width: 7px; height: 7px;
    background: var(--red);
    border-radius: 50%;
    animation: blink 1.5s infinite;
  }
  .ko-leg-panel { display: none; }
  .ko-leg-panel.active { display: block; animation: fadeIn 0.18s var(--ease); }

  /* Rangées compactes — une ligne par match */
  .match-compact {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto minmax(0, 1fr) 22px;
    column-gap: 10px;
    align-items: center;
    padding: 6px 12px;
    background: white;
    border: 1px solid var(--gray-light);
    border-radius: 6px;
    margin-bottom: 4px;
    text-decoration: none;
    color: var(--navy);
    font-size: 12.5px;
    line-height: 1.3;
    position: relative;
    transition: border-color 0.15s var(--ease), background 0.15s var(--ease), transform 0.15s var(--ease);
  }
  .match-compact:last-child { margin-bottom: 0; }
  .match-compact:hover {
    border-color: var(--red);
    background: white;
    transform: translateX(2px);
    text-decoration: none;
    color: var(--navy);
  }
  .match-compact.live {
    border-color: rgba(214,34,66,0.4);
    background: rgba(214,34,66,0.04);
  }
  .match-compact.live::before {
    content: '';
    position: absolute;
    left: -1px; top: -1px; bottom: -1px;
    width: 3px;
    background: var(--red);
    border-radius: 6px 0 0 6px;
  }
  .match-compact.finished { background: var(--gray-lighter); }
  .match-compact .team-logo-mini {
    width: 22px; height: 22px;
    flex-shrink: 0;
  }
  .match-compact .team-logo-mini img {
    width: 100%; height: 100%;
    object-fit: contain;
    display: block;
  }
  .match-compact .team-name-mini {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }
  .match-compact .team-name-mini.visitor { text-align: right; }
  .match-compact.finished.local-loser .team-name-mini.local,
  .match-compact.finished.visitor-loser .team-name-mini.visitor {
    color: var(--gray);
    font-weight: 500;
  }
  .match-compact.finished.local-winner .team-name-mini.local,
  .match-compact.finished.visitor-winner .team-name-mini.visitor {
    color: var(--navy-dark);
    font-weight: 700;
  }
  .match-compact .match-mid { display: flex; align-items: center; justify-content: center; min-width: 90px; }
  .match-compact .score-pill {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    padding: 4px 9px;
    background: var(--navy);
    color: white;
    border-radius: 4px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
  }
  .match-compact .score-pill.live { background: var(--red); }
  .match-compact .score-pill .score-dash { font-weight: 400; opacity: 0.5; }
  .match-compact .live-mini {
    margin-left: 6px;
    padding: 2px 6px;
    background: var(--red);
    color: white;
    border-radius: var(--radius-pill);
    font-family: var(--font-display);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    animation: blink 1.5s infinite;
  }
  .match-compact .match-time-compact {
    font-size: 11.5px;
    color: var(--gray);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .match-compact .match-time-compact strong {
    color: var(--navy);
    font-weight: 700;
    margin-left: 4px;
  }
  /* Badge "Cumul aller-retour" sur le retour quand les 2 manches sont jouées */
  .match-compact .cumul-badge {
    position: absolute;
    top: -7px; right: 10px;
    padding: 2px 7px;
    background: var(--gold);
    color: white;
    border-radius: var(--radius-pill);
    font-family: var(--font-display);
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    box-shadow: 0 2px 4px rgba(245,158,11,0.35);
    pointer-events: none;
    white-space: nowrap;
  }
  .match-compact .cumul-badge .cumul-dash { opacity: 0.7; margin: 0 2px; }
  .match-compact .cumul-badge.draw { background: var(--gray); }

  /* ==============================================
     MATCH ROW
     ============================================== */
  .match-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    padding: 14px 18px 14px 21px;
    background: white;
    border: 1.5px solid var(--gray-light);
    border-radius: var(--radius);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.25s var(--ease);
    align-items: center;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
  }
  .match-row:last-child { margin-bottom: 0; }
  .match-row:hover {
    border-color: var(--red);
    transform: translateY(-2px);
    box-shadow: var(--shadow-red);
    text-decoration: none;
    color: inherit;
  }
  .match-row.live {
    background: linear-gradient(90deg, rgba(214,34,66,0.05) 0%, transparent 60%);
    border-color: rgba(214,34,66,0.35);
  }
  .match-row::after {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: transparent;
    transition: background 0.25s var(--ease);
  }
  .match-row.live::after { background: var(--red); }
  .match-row.finished::after { background: var(--navy); }

  /* Today pill */
  .today-pill {
    display: inline-block;
    padding: 2px 7px;
    background: var(--gold);
    color: white;
    border-radius: var(--radius-pill);
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }

  .team-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
  }
  .team-info.away {
    flex-direction: row-reverse;
    text-align: right;
  }
  .team-name {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--navy);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .team-info.away .team-name { color: var(--gray); }
  .team-logo {
    width: 40px; height: 40px;
    object-fit: contain;
    flex-shrink: 0;
    transition: transform 0.25s var(--ease);
  }
  .match-row:hover .team-logo { transform: scale(1.08); }

  .match-center {
    text-align: center;
    min-width: 84px;
  }
  .score-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: var(--navy);
    color: white;
    padding: 7px 12px;
    border-radius: var(--radius);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    min-width: 68px;
  }
  .score-box .score-dash {
    font-weight: 400;
    opacity: 0.5;
    margin: 0 2px;
  }
  .score-box.live {
    background: var(--red);
    animation: pulse 2s infinite;
  }
  @keyframes pulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(214,34,66,.4); }
    50%     { box-shadow: 0 0 0 10px rgba(214,34,66,0); }
  }
  .live-pill {
    display: block;
    font-family: var(--font-body);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--red);
    margin-top: 4px;
    text-transform: uppercase;
  }
  .live-pill::before {
    content: '';
    display: inline-block;
    width: 5px; height: 5px;
    background: var(--red);
    border-radius: 50%;
    margin-right: 4px;
    animation: blink 1.5s infinite;
    vertical-align: middle;
  }
  .match-datetime {
    font-size: 12px;
    color: var(--gray);
    line-height: 1.3;
  }
  .match-datetime .match-date {
    display: block;
    font-weight: 500;
  }
  .match-time {
    display: block;
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--navy);
    font-size: 1.05rem;
    margin-top: 3px;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
  }

  /* ==============================================
     STANDINGS
     ============================================== */
  .standings-wrap {
    background: white;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 0 0 16px;
  }
  .comp-standings {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
  }
  .comp-standings thead tr {
    background: var(--navy);
    color: white;
  }
  .comp-standings th {
    padding: 13px 8px;
    text-align: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
  }
  .comp-standings th:nth-child(2) { text-align: left; padding-left: 16px; }
  .comp-standings td {
    padding: 11px 8px;
    text-align: center;
    border-bottom: 1px solid var(--gray-light);
    font-variant-numeric: tabular-nums;
  }
  .comp-standings td:nth-child(2) { text-align: left; padding-left: 16px; }
  .comp-standings tbody tr:last-child td { border-bottom: 0; }
  .comp-standings tbody tr { transition: background 0.15s ease; }
  .comp-standings tbody tr:hover { background: #fafbfd; }

  .rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px; height: 26px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    color: var(--navy);
    background: var(--gray-lighter);
    border-radius: 6px;
  }
  .comp-standings tbody tr:first-child .rank {
    background: linear-gradient(135deg, var(--gold), #d97706);
    color: white;
    box-shadow: 0 2px 6px rgba(245,158,11,0.4);
  }

  .team-cell {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .team-cell img {
    width: 24px; height: 24px;
    object-fit: contain;
    flex-shrink: 0;
  }
  .team-cell span {
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--navy);
  }
  .comp-standings td.pts strong {
    display: inline-block;
    background: var(--navy);
    color: white;
    padding: 4px 11px;
    border-radius: var(--radius);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    min-width: 36px;
    font-variant-numeric: tabular-nums;
  }

  /* Forme column */
  .forme-cell {
    display: inline-flex;
    gap: 3px;
    justify-content: center;
  }
  .forme-dot {
    width: 18px; height: 18px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 700;
    color: white;
  }
  .forme-dot.V { background: #16a34a; }
  .forme-dot.N { background: var(--gray); }
  .forme-dot.D { background: var(--red); }

  /* ==============================================
     TEAM SEARCH
     ============================================== */
  .team-search {
    position: relative;
    margin-bottom: 14px;
  }
  .team-search input {
    width: 100%;
    padding: 11px 38px 11px 40px;
    background: white;
    border: 1.5px solid var(--gray-light);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text);
    outline: none;
    transition: all 0.2s var(--ease);
  }
  .team-search input::placeholder {
    color: #9aa3af;
    font-family: var(--font-body);
  }
  .team-search input:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(0, 63, 124, 0.12);
  }
  .team-search .ts-icon {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    pointer-events: none;
    width: 16px; height: 16px;
  }
  .team-search .ts-clear {
    position: absolute;
    right: 10px; top: 50%;
    transform: translateY(-50%);
    width: 22px; height: 22px;
    border: 0;
    background: var(--gray-light);
    border-radius: 50%;
    color: var(--gray);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: 14px;
    line-height: 1;
  }
  .team-search .ts-clear:hover { background: var(--red); color: white; }
  .team-search.has-value .ts-clear { display: inline-flex; }
  .ts-hint {
    display: none;
    margin-top: 6px;
    font-size: 12px;
    color: var(--gray);
    padding: 0 4px;
  }
  .team-search.has-value + .ts-hint { display: block; }

  /* Highlight matching rows/matches */
  .comp-standings tbody tr.is-match {
    background: rgba(245, 158, 11, 0.12);
    box-shadow: inset 3px 0 0 var(--gold);
  }
  .match-row.is-dim { opacity: 0.35; filter: saturate(0.4); }
  .match-row.is-match {
    border-color: var(--gold);
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.2);
  }
  .poule-btn.is-match {
    border-color: var(--gold);
    color: var(--gold);
  }
  .poule-btn.is-match.active {
    background: var(--gold);
    color: white;
    border-color: var(--gold);
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35);
  }

  /* ==============================================
     DAY GROUPING (inside a journée)
     ============================================== */
  .day-group + .day-group { margin-top: 14px; }
  .day-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 10px;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--gray);
  }
  .day-header::before {
    content: '';
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--navy);
  }
  .day-header.is-today::before { background: var(--red); animation: blink 1.5s infinite; }
  .day-header.is-today { color: var(--red); }
  .day-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-light);
  }

  /* ==============================================
     EMPTY / LOADING / ERROR
     ============================================== */
  .empty-state {
    text-align: center;
    padding: 36px 20px;
    color: var(--gray);
    font-size: 14px;
  }
  .empty-state::before {
    content: '';
    display: block;
    width: 44px; height: 44px;
    margin: 0 auto 12px;
    background: var(--gray-lighter);
    border-radius: 50%;
    background-image: radial-gradient(circle, var(--gray-light) 30%, var(--gray-lighter) 31%);
  }

  .comp-loading { padding: 8px 0; }
  .skel {
    background: linear-gradient(90deg, #eef1f5 0%, #f7f9fb 50%, #eef1f5 100%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: var(--radius);
  }
  .skel-title { height: 110px; margin-bottom: 20px; border-radius: var(--radius-lg); }
  .skel-row { height: 66px; margin-bottom: 8px; }
  @keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }

  .comp-error {
    padding: 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    border-radius: var(--radius);
  }

  /* ==============================================
     RESPONSIVE
     ============================================== */
  @media (max-width: 768px) {
    .comp-wrap { padding: 12px; }
    .comp-title { padding: 14px 16px; }
    .comp-title h1 { font-size: 1.25rem; }
    .comp-kicker { font-size: 9px; }
    .poule-selector { padding: 8px 10px; gap: 6px; }
    .poule-btn { padding: 6px 12px; font-size: 12px; }
    .match-row { padding: 12px 12px 12px 16px; gap: 10px; }
    .team-info { gap: 8px; }
    .team-name { font-size: 13px; }
    .team-logo { width: 32px; height: 32px; }
    .match-center { min-width: 88px; }
    .score-box { font-size: 1rem; padding: 6px 11px; min-width: 62px; }
    .match-time { font-size: 0.95rem; }
    .match-datetime { font-size: 11px; }
    .comp-standings { font-size: 12px; }
    .comp-standings th, .comp-standings td { padding: 9px 4px; }
    .comp-standings th:nth-child(2), .comp-standings td:nth-child(2) { padding-left: 10px; }
    .rank { width: 22px; height: 22px; font-size: 12px; }
    .team-cell { gap: 6px; }
    .team-cell img { width: 18px; height: 18px; }
    .comp-standings td.pts strong { padding: 3px 9px; font-size: 12px; min-width: 30px; }
    .phase-header { padding: 10px 14px; }
    .phase-title { font-size: 0.95rem; }
    .phase-content { padding: 12px; }
    .phase-subtabs { padding: 10px 12px; }
    .phase-subtab { font-size: 11px; padding: 5px 10px; }
    .forme-dot { width: 16px; height: 16px; font-size: 9px; }
    .hide-mobile { display: none; }
  }
  @media (max-width: 480px) {
    .comp-standings th, .comp-standings td { padding: 7px 3px; font-size: 11px; }
    .team-cell span { font-size: 11px; }
  }

  /* ==============================================
     DESKTOP (≥1024px) — matchs en grille pleine largeur
     ============================================== */
  @media (min-width: 1024px) {
    .comp-title { padding: 24px 28px 22px; }
    .comp-title h1 { font-size: 1.75rem; }

    /* Journée active : grille de matchs multi-colonnes */
    .phase-journee-panel.active {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(430px, 1fr));
      gap: 8px 16px;
      align-content: start;
    }
    .phase-journee-panel.active > .match-row { margin-bottom: 0; }
    .phase-journee-panel .day-group {
      grid-column: 1 / -1;
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(430px, 1fr));
      gap: 8px 16px;
    }
    .phase-journee-panel .day-group .match-row { margin-bottom: 0; }
    .phase-journee-panel .day-header { grid-column: 1 / -1; }
    .phase-journee-panel .empty-state { grid-column: 1 / -1; }

    /* More generous match row on desktop */
    .match-row { padding: 16px 20px 16px 24px; }
    .team-logo { width: 44px; height: 44px; }
    .team-name { font-size: 15px; }
    .score-box { font-size: 1.25rem; padding: 8px 14px; min-width: 72px; }
    .match-time { font-size: 1.15rem; }

    /* Phases finales : 2 colonnes */
    .knockouts-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 18px;
    }
    /* Match rows en phase finale (single-leg) repassent compacts */
    .knockouts-grid .match-row { padding: 14px 16px 14px 18px; }
    .knockouts-grid .team-logo { width: 36px; height: 36px; }
    .knockouts-grid .team-name { font-size: 13.5px; }
    .knockouts-grid .score-box { font-size: 1.05rem; padding: 6px 11px; min-width: 62px; }
    .knockouts-grid .match-time { font-size: 1rem; }
    /* Finale plein écran (D) */
    .knockouts-grid .phase-container.is-final { grid-column: 1 / -1; }
    .knockouts-grid .phase-container.is-final .phase-title { font-size: 1.4rem; letter-spacing: 0.06em; }
    .knockouts-grid .phase-container.is-final .match-compact {
      padding: 12px 18px;
      font-size: 14.5px;
    }
    .knockouts-grid .phase-container.is-final .match-compact .team-logo-mini { width: 32px; height: 32px; }
    .knockouts-grid .phase-container.is-final .match-compact .score-pill { font-size: 1.15rem; padding: 7px 14px; }
  }

  /* Reduced motion — respect user preference */
  @media (prefers-reduced-motion: reduce) {
    .comp-wrap *,
    .comp-wrap *::before,
    .comp-wrap *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }
