/* ==== Duel en direct ==================================================== */

/* 1. La scène : deux territoires pastel, un éclair au centre */
.duel-stage {
  --seam: 0.5;
  position: relative; width: 100%; height: 100vh; height: 100dvh; min-height: 560px; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: 1fr; grid-template-rows: auto 1fr auto auto;
  padding: calc(var(--nav-h) + clamp(20px, 3.5vh, 44px)) var(--gutter) clamp(24px, 4vh, 48px);
}
.duel-fields { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }

.duel-clock {
  grid-column: 1 / -1; justify-self: center; text-align: center;
  padding: 14px 32px 16px; border-radius: 28px;
  background: rgba(255, 255, 255, 0.72); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 10px 40px rgba(60, 20, 120, 0.08);
}
.duel-clock p { display: inline-flex; align-items: center; font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); }
.duel-clock__time { display: flex; justify-content: center; margin-top: 4px; font-size: clamp(30px, 2.8vw, 52px); }
.duel-clock__skills { margin-top: 6px; font-size: var(--fs-xs) !important; font-weight: 600 !important; color: var(--text) !important; }

.duel-team {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; min-width: 0;
  container-type: inline-size; padding: 0 clamp(16px, 2vw, 40px);
}
/* chaque équipe reste centrée dans son territoire, qui grandit ou rétrécit */
.duel-team--a { left: 0; width: calc(var(--seam) * 100%); }
.duel-team--b { right: 0; width: calc((1 - var(--seam)) * 100%); }
.duel-team__id { display: flex; align-items: center; gap: 16px; }
.duel-team__id > div { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; text-align: left; }
.duel-team__name { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; white-space: nowrap; }
.duel-team .belt { background: rgba(255, 255, 255, 0.7); font-size: var(--fs-xs); }
.duel-team__score { position: relative; font-size: min(200px, 24cqi); letter-spacing: -0.06em; white-space: nowrap; }

.duel-fly {
  position: absolute; top: -0.2em; left: 50%; font-size: 0.26em; font-weight: 700; letter-spacing: -0.02em;
  animation: fly 1600ms var(--ease) forwards; pointer-events: none;
}
@keyframes fly {
  0% { opacity: 0; transform: translate(-50%, 30%) scale(0.85); }
  18% { opacity: 1; transform: translate(-50%, -30%) scale(1.05); }
  100% { opacity: 0; transform: translate(-50%, -140%) scale(1); }
}


.duel-ticker {
  grid-column: 1 / -1; grid-row: 3; justify-self: center; position: relative; z-index: 1;
  display: flex; align-items: center; gap: 14px; max-width: min(900px, 100%);
  padding: 14px 24px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.78); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 10px 40px rgba(60, 20, 120, 0.08);
  font-size: var(--fs-md); color: var(--text-2);
}
.duel-ticker p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.duel-ticker b { color: var(--text); font-weight: 700; }
.duel-ticker__dot { flex: none; width: 9px; height: 9px; border-radius: 50%; }
.duel-ticker.is-a .duel-ticker__dot { background: var(--team-a); }
.duel-ticker.is-b .duel-ticker__dot { background: var(--team-b); }
.duel-ticker.is-ceo { box-shadow: 0 0 0 1.5px var(--gold), 0 10px 40px rgba(60, 20, 120, 0.08); }
.duel-ticker__pts { flex: none; font-weight: 700; color: var(--text); }
.ticker-enter-active { transition: opacity 500ms var(--ease), transform 600ms var(--ease-spring); }
.ticker-leave-active { transition: opacity 200ms var(--ease), transform 200ms var(--ease); }
.ticker-enter-from { opacity: 0; transform: translateY(14px) scale(0.96); }
.ticker-leave-to { opacity: 0; transform: translateY(-8px); }

/* 2 à 4. Les chapitres, une idée chacun */
.duel-chapter { max-width: 1200px; margin: 0 auto; padding: var(--section) var(--gutter) 0; text-align: center; }
.duel-chapter:last-child { padding-bottom: var(--section); }
.duel-lead .lead { margin-top: 18px; }
.duel-actions { display: flex; align-items: center; justify-content: center; gap: 28px; margin-top: 36px; flex-wrap: wrap; }

.duel-ceo { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: clamp(40px, 6vw, 80px) clamp(24px, 4vw, 64px); }
.duel-ceo .title-lg { max-width: 24ch; }
.duel-ceo__face { display: grid; grid-template-columns: 1fr 1.8fr 1fr; align-items: center; gap: 24px; width: 100%; margin: 24px 0 12px; }
.duel-ceo__side { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.duel-ceo__avatar {
  width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 8px;
  font-size: 30px; font-weight: 700; letter-spacing: -0.03em; color: #fff;
}
.duel-ceo__avatar.is-a { background: var(--team-a); }
.duel-ceo__avatar.is-b { background: var(--team-b); }
.duel-ceo__split { display: flex; height: 14px; border-radius: 999px; overflow: hidden; gap: 4px; }
.duel-ceo__split span { border-radius: 999px; transition: flex-grow 1200ms var(--ease-spring); }
.duel-ceo__split .is-a { flex: var(--s) 0 0; background: var(--team-a); }
.duel-ceo__split .is-b { flex: calc(1 - var(--s)) 0 0; background: var(--team-b); }
.duel-ceo__name { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.025em; }
.duel-ceo__role { font-size: var(--fs-sm); color: var(--text-2); }
.duel-ceo__pts { font-size: clamp(48px, 5vw, 88px); margin-top: 6px; }

.duel-chapter__title { margin-bottom: clamp(32px, 5vh, 56px); }
.duel-tops { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); text-align: left; }
.duel-top { list-style: none; margin: 0; padding: 0; }
.duel-top li { display: grid; grid-template-columns: 28px 1fr auto 70px; align-items: center; gap: 16px; height: 68px; }
.duel-top li + li { border-top: 1px solid var(--line); }
.duel-top__rank { font-size: var(--fs-sm); font-weight: 600; color: var(--text-3); }
.duel-top__name { font-size: var(--fs-md); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.duel-top__name:hover { text-decoration: underline; text-underline-offset: 4px; }
.duel-top__pts { font-size: var(--fs-lg); font-weight: 700; text-align: right; letter-spacing: -0.02em; }

@media (max-width: 900px) {
  .duel-tops, .duel-ceo__face { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .duel-team__id { flex-direction: column; }
  .duel-team__id > div { align-items: center; text-align: center; }
  .duel-team__name { white-space: normal; font-size: var(--fs-md); }
  .duel-ticker p { white-space: normal; }
}

/* plein cadre : la navigation flotte, transparente, au-dessus des deux territoires */
body.is-stage:not(.is-scrolled) .nav { background: transparent; border-bottom-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }

/* petite incitation à défiler, en bas de la scène */
.duel-cue {
  grid-row: 4; justify-self: center; position: relative; z-index: 1; margin-top: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); transition: color 200ms var(--ease);
}
.duel-cue:hover { color: var(--text); }
.duel-cue svg { animation: cue 2.4s var(--ease) infinite; }
@keyframes cue { 0%, 100% { transform: translateY(0); opacity: 0.6; } 50% { transform: translateY(5px); opacity: 1; } }
.duel-ceo__photo { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; margin-bottom: 8px; box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--team-a), 0 16px 40px rgba(0, 0, 0, 0.12); }
.duel-ceo__photo.is-b { box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--team-b), 0 16px 40px rgba(0, 0, 0, 0.12); }

/* ---------- Duel des présidents : une mini-scène vivante ---------- */
.duel-ceo__line { max-width: 24ch; margin: 14px auto 0; }
.duel-ceo2 {
  --seam: 0.5;
  position: relative; overflow: hidden; isolation: isolate; margin-top: clamp(36px, 6vh, 64px);
  min-height: clamp(380px, 46vh, 520px); border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(60, 20, 120, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
}
.duel-ceo2__side {
  position: absolute; top: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 32px 20px; text-align: center; container-type: inline-size;
}
.duel-ceo2__side.is-a { left: 0; width: calc(var(--seam) * 100%); }
.duel-ceo2__side.is-b { right: 0; width: calc((1 - var(--seam)) * 100%); }
.duel-ceo2__ring {
  --c: var(--team-a);
  position: relative; width: 132px; height: 132px; border-radius: 50%; margin-bottom: 10px;
  box-shadow: 0 0 0 5px #fff, 0 0 0 8px var(--c), 0 20px 50px rgba(0, 0, 0, 0.14);
  animation: ceo-breathe 4.5s var(--ease) infinite;
}
.duel-ceo2__ring.is-b { --c: var(--team-b); animation-delay: -2.2s; }
.duel-ceo2__ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
/* halo qui s'étend quand le président marque */
.duel-ceo2__ring::after {
  content: ''; position: absolute; inset: -8px; border-radius: 50%; border: 3px solid var(--c); opacity: 0;
}
.duel-ceo2__ring.is-hit::after { animation: ceo-hit 1200ms var(--ease) forwards; }
@keyframes ceo-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
@keyframes ceo-hit { 0% { opacity: 0.9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.45); } }
.duel-ceo2 .duel-ceo__role { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.duel-ceo2 .duel-ceo__role .belt { background: rgba(255, 255, 255, 0.7); font-size: var(--fs-xs); }
.duel-ceo2__pts { position: relative; margin-top: 6px; font-size: min(96px, 26cqi); letter-spacing: -0.06em; }

@media (max-width: 700px) {
  .duel-ceo2__ring { width: 84px; height: 84px; }
  .duel-ceo2 .duel-ceo__role { font-size: var(--fs-xs); }
}

/* « Partager le duel » vibre très légèrement, de temps en temps */
.duel-share-btn { animation: share-buzz 5s var(--ease) 2s infinite; }
.duel-share-btn:hover { animation: none; }
@keyframes share-buzz {
  0%, 86%, 100% { transform: none; }
  88% { transform: translateX(-1.5px) rotate(-0.6deg); }
  90% { transform: translateX(1.5px) rotate(0.6deg); }
  92% { transform: translateX(-1px) rotate(-0.4deg); }
  94% { transform: translateX(1px) rotate(0.3deg); }
  96% { transform: none; }
}
