/**
 * ITS Rugby Live — Widget score & timeline en direct [its_live].
 * Charte It's : angles droits (aucun border-radius), teal / vanilla / sauge,
 * Noto Sans. Pas de !important, pas d'inline.
 */

.its-live-match {
  --ilm-teal: #1C3D34;
  --ilm-vanilla: #F2E5D2;
  font-family: "Noto Sans", system-ui, sans-serif;
  max-width: 640px;
  margin: 1.5rem auto;
  background: var(--ilm-teal);
  color: var(--ilm-vanilla);
  border: 2px solid var(--ilm-teal);
}

.its-live-match .ilm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.9rem;
  background: #142c26;
  font-size: 0.8rem;
  text-transform:none;
  letter-spacing:0;
}

.its-live-match .ilm-compet {
  color: var(--ilm-vanilla);
  opacity: 0.85;
}

.its-live-match .ilm-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  color: var(--ilm-teal);
  background: var(--ilm-vanilla);
  padding: 0.15rem 0.5rem;
}

.its-live-match .ilm-status::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  background: var(--ilm-teal);
  display: inline-block;
}

.its-live-match.is-final .ilm-status {
  background: var(--ilm-vanilla);
}

.its-live-match .ilm-board {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  padding: 1.1rem 0.9rem;
}

.its-live-match .ilm-team {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.its-live-match .ilm-team--home {
  justify-content: flex-start;
}

.its-live-match .ilm-team--away {
  justify-content: flex-end;
}

.its-live-match .ilm-name {
  font-size: 1.05rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.its-live-match .ilm-score {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--ilm-vanilla);
  font-variant-numeric: tabular-nums;
}

.its-live-match .ilm-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0 0.6rem;
  min-width: 4.5rem;
}

.its-live-match .ilm-clock {
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.its-live-match .ilm-period {
  font-size: 0.72rem;
  text-transform:none;
  letter-spacing:0;
  opacity: 0.8;
}

/* ── Faits de match : timeline claire (casse le bloc « tout vert ») ─ */
.its-live-match .ilm-events {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  background: var(--ilm-vanilla);
  color: var(--ilm-teal);
  position: relative;
}

/* Ligne verticale centrale de la timeline. */
.its-live-match .ilm-events::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: rgba(28, 61, 52, 0.12);
}

.its-live-match .ilm-ev {
  display: grid;
  grid-template-columns: 1fr 2.6rem 1fr;
  align-items: center;
  column-gap: 0.5rem;
  padding: 0.3rem 0.9rem;
  position: relative;
}

/* Bande d'accent discrète sur les essais (temps forts). */
.its-live-match .ilm-ev[data-kind="try"] {
  background: rgba(28, 61, 52, 0.16);
}

/* Minute : pastille centrée sur la ligne. */
.its-live-match .ilm-ev-min {
  grid-column: 2;
  justify-self: center;
  z-index: 1;
  min-width: 2.4rem;
  padding: 0.05rem 0;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ilm-teal);
  background: var(--ilm-vanilla);
}

.its-live-match .ilm-ev-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.its-live-match .ilm-ev[data-side="home"] .ilm-ev-card {
  grid-column: 1;
  justify-content: flex-end;
  flex-direction: row-reverse;
  text-align: right;
}

.its-live-match .ilm-ev[data-side="away"] .ilm-ev-card {
  grid-column: 3;
  justify-content: flex-start;
}

/* Pastille icône (lettre du type d'événement). */
.its-live-match .ilm-ev-ico {
  flex: 0 0 auto;
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1;
  background: var(--ilm-teal);
  color: var(--ilm-vanilla);
}

.its-live-match .ilm-ev-txt {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.its-live-match .ilm-ev-player {
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.its-live-match .ilm-ev-type {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform:none;
  letter-spacing:0;
  opacity: 0.6;
}

/* Couleurs de pastille par type d'événement. */
.its-live-match .ilm-ev[data-kind="try"]    .ilm-ev-ico { background: var(--teal, #1C3D34); color: var(--ilm-teal); }
.its-live-match .ilm-ev[data-kind="kick"]   .ilm-ev-ico { background: var(--ilm-teal);   color: var(--ilm-vanilla); }
.its-live-match .ilm-ev[data-kind="yellow"] .ilm-ev-ico { background: #E9B824; color: #1C3D34; }
.its-live-match .ilm-ev[data-kind="orange"] .ilm-ev-ico { background: #E67E22; color: #FFFFFF; }
.its-live-match .ilm-ev[data-kind="red"]    .ilm-ev-ico { background: #C0392B; color: #FFFFFF; }
.its-live-match .ilm-ev[data-kind="sub"]    .ilm-ev-ico { background: #CFE3C4; color: #1C3D34; }
.its-live-match .ilm-ev[data-kind="misc"]   .ilm-ev-ico { background: #D9CDBA; color: #1C3D34; }
.its-live-match .ilm-ev[data-kind="white"]  .ilm-ev-ico { background: #fff; color: #1C3D34; box-shadow: inset 0 0 0 1px #1C3D34; }
.its-live-match .ilm-ev[data-kind="card"]   .ilm-ev-ico,
.its-live-match .ilm-ev[data-kind="back"]   .ilm-ev-ico { background: #D9CDBA; color: #1C3D34; }

.its-live-match .ilm-empty {
  margin: 0;
  padding: 0.9rem;
  text-align: center;
  font-size: 0.85rem;
  background: var(--ilm-vanilla);
  color: var(--ilm-teal);
  opacity: 0.75;
}

@media (max-width: 480px) {
  .its-live-match .ilm-name { font-size: 0.9rem; }
  .its-live-match .ilm-score { font-size: 1.8rem; }
  .its-live-match .ilm-ev { grid-template-columns: 1fr 2.2rem 1fr; column-gap: 0.35rem; padding: 0.3rem 0.55rem; }
  .its-live-match .ilm-ev-ico { width: 1.35rem; height: 1.35rem; font-size: 0.72rem; }
  .its-live-match .ilm-ev-player { font-size: 0.82rem; }
}

/* ════════════════════════════════════════════════════════════════
 * Intégration au hero de la fiche match (mode "hero").
 * ════════════════════════════════════════════════════════════════ */

/* Les classes de base .badge / .score-nums (thème) posent un `display` qui,
 * étant une règle author, l'emporte sur l'attribut UA [hidden]. On rétablit
 * l'effet de `hidden` avec une spécificité suffisante pour tous les slots live. */
.match-header .match-top-row .badge[hidden],
.match-header .badge.badge-live[hidden],
.match-header .score-nums.score-live[hidden],
.match-header .score-nums.score-upcoming[hidden],
.match-header .sc-live-clock[hidden],
.match-header .sc-kickoff-lbl[hidden] {
  display: none;
}

/* Badge LIVE animé dans .match-top-row (hérite de .badge côté template).
 * Charte It's : pastille vanilla sur teal, point teal clignotant (charte teal/vanilla, 15/10). */
.badge.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #F2E5D2;
  color: #1C3D34;
  font-weight: 800;
  text-transform:none;
  letter-spacing:0;
}

.badge.badge-live::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  background: #1C3D34;
  display: inline-block;
  animation: ilm-pulse 1.1s ease-in-out infinite;
}

.match-header.is-final .badge.badge-live,
.match-header.is-unconfirmed .badge.badge-live {
  background: #F2E5D2;
}

.match-header.is-final .badge.badge-live::before,
.match-header.is-unconfirmed .badge.badge-live::before {
  animation: none;
}

@keyframes ilm-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.25; transform: scale(0.7); }
}

@media (prefers-reduced-motion: reduce) {
  .badge.badge-live::before { animation: none; }
}

/* Score live (hérite de .score-nums) + horloge. */
.match-header .score-nums.score-live .sl-h,
.match-header .score-nums.score-live .sl-a {
  font-variant-numeric: tabular-nums;
}

.match-header .sc-live-clock {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #F2E5D2;
}

.match-header.is-final .sc-live-clock {
  color: inherit;
}
