/* ===================================================
   FIFA WORLD CUP 2026 — Tableau final circulaire
   fifaworldcup.css
   =================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #050d1f;
  --surface:   rgba(255, 255, 255, 0.04);
  --border:    rgba(255, 255, 255, 0.1);
  --text:      #f8fafc;
  --muted:     #8b95b0;
  --blue-deep:  #1d4ed8;
  --blue-mid:   #2563eb;
  --blue-light: #60a5fa;
  --blue-sky:   #0ea5e9;
  --gold:      #f5c451;
  --danger:    #f87171;
  --radius:    16px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Space Grotesk', system-ui, sans-serif;
  overflow-x: hidden;
}

/* ---------- Fond animé (repris du portfolio) ---------- */
.bg-animated {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, #050d1f, #0a1628, #071222, #050d1f);
  background-size: 400% 400%;
  animation: bgShift 20s ease infinite;
}
@keyframes bgShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.bg-animated::before,
.bg-animated::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.28;
  pointer-events: none;
}
.bg-animated::before {
  width: 600px; height: 600px; top: -150px; left: -150px;
  background: radial-gradient(circle, var(--blue-deep), transparent 70%);
}
.bg-animated::after {
  width: 500px; height: 500px; bottom: -100px; right: -100px;
  background: radial-gradient(circle, var(--blue-sky), transparent 70%);
}

/* ---------- Lang switcher (identique au portfolio) ---------- */
.lang-switcher { position: fixed; top: 1.25rem; right: 1.25rem; z-index: 50; }
.lang-btn {
  display: flex; align-items: center; gap: .4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  color: var(--text);
  border-radius: 100px;
  padding: .5rem .9rem;
  font-size: .8rem; font-weight: 600;
  cursor: pointer;
  transition: border-color .2s, transform .2s;
}
.lang-btn:hover { border-color: var(--blue-light); transform: translateY(-1px); }

/* ---------- Layout ---------- */
.wc-page {
  position: relative; z-index: 1;
  min-height: 100vh;
  padding: 5rem 1.5rem 3rem;
  display: flex; flex-direction: column; align-items: center;
  gap: 1.5rem;
}

.wc-back {
  position: fixed;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 50;
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  border-radius: 100px;
  padding: .5rem .9rem .5rem .7rem;
  color: var(--muted);
  text-decoration: none;
  font-size: .85rem;
  transition: color .2s, transform .2s, border-color .2s;
}
.wc-back:hover { color: var(--blue-light); transform: translateX(-2px); }
.wc-back__icon { flex-shrink: 0; }

.wc-header { text-align: center; max-width: 640px; }
.wc-header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  background: linear-gradient(90deg, var(--gold), var(--blue-light));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.wc-header p { color: var(--muted); margin-top: .5rem; font-size: .95rem; }

.wc-status {
  font-size: .78rem;
  color: var(--muted);
  display: inline-flex; align-items: center; gap: .4rem;
}
.wc-status::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted);
}
.wc-status.is-ok::before { background: #34d399; }
.wc-status.is-error { color: var(--danger); }
.wc-status.is-error::before { background: var(--danger); }
.wc-status.is-loading::before { background: var(--blue-light); animation: pulse 1.2s ease infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; } 50% { opacity: .3; }
}

/* ---------- Bracket ---------- */
.wc-bracket-wrap {
  width: 100%;
  max-width: 980px;
  overflow: auto;
  display: flex;
  justify-content: center;
}
#wc-svg {
  width: 100%;
  max-width: 980px;
  min-width: 640px;
  height: auto;
  aspect-ratio: 1 / 1;
}

.wc-connector {
  fill: none;
  stroke: var(--blue-light);
  stroke-width: 2;
  opacity: .85;
  transition: opacity .2s, stroke .2s;
}
.wc-connector.is-eliminated {
  stroke: #4b5468;
  opacity: .35;
}
.wc-connector--ghost {
  stroke: #4b5468;
  opacity: .25;
  stroke-dasharray: 3 4;
  pointer-events: none;
}

.wc-match { cursor: pointer; }
.wc-match.is-hovered .wc-connector:not(.is-eliminated) { stroke: var(--gold); opacity: 1; }

.wc-badge__ring {
  fill: #0b1730;
  stroke: var(--blue-light);
  stroke-width: 1.5;
}
.wc-badge__label {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
}

.wc-leaf.is-eliminated .wc-badge__ring,
.wc-marker.is-eliminated .wc-badge__ring {
  filter: grayscale(1);
  opacity: .4;
  stroke: #4b5468;
}
.wc-leaf.is-eliminated image,
.wc-marker.is-eliminated image {
  filter: grayscale(1);
  opacity: .55;
}
.wc-leaf.is-pending .wc-badge__ring { stroke-dasharray: 2 3; opacity: .5; }

.wc-marker--pending circle {
  fill: rgba(255,255,255,.05);
  stroke: var(--muted);
  stroke-dasharray: 2 3;
}
.wc-marker--pending.is-live circle {
  stroke: var(--gold);
  animation: pulse 1.2s ease infinite;
}

.wc-match.is-hovered .wc-marker .wc-badge__ring { stroke: var(--gold); }

.wc-trophy__glow {
  fill: url(#wc-trophy-gradient);
  filter: blur(14px);
  opacity: .5;
}

/* ---------- Tooltip ---------- */
.wc-tooltip {
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  background: rgba(8, 14, 30, 0.95);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: .75rem .9rem;
  min-width: 220px;
  max-width: 280px;
  font-size: .82rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s ease;
  box-shadow: 0 12px 30px rgba(0,0,0,.4);
}
.wc-tooltip.is-visible { opacity: 1; }

.wc-tooltip__status-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem;
  margin-bottom: .35rem;
}
.wc-tooltip__status {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.wc-tooltip__status.is-live { color: var(--gold); }
.wc-tooltip__status.is-finished { color: #34d399; }
.wc-tooltip__round {
  font-size: .68rem;
  font-weight: 700;
  color: var(--blue-light);
  background: rgba(96, 165, 250, .12);
  border-radius: 6px;
  padding: .1rem .4rem;
}

.wc-tooltip__teams {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem;
  font-weight: 600;
}
.wc-tooltip__team { flex: 1; }
.wc-tooltip__team:last-child { text-align: right; }
.wc-tooltip__score {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  color: var(--blue-light);
  white-space: nowrap;
}
.wc-tooltip__pens { color: var(--muted); font-weight: 400; font-size: .72rem; }

.wc-tooltip__meta {
  margin-top: .4rem;
  display: flex; flex-direction: column; gap: .15rem;
  color: var(--muted);
  font-size: .72rem;
}

.wc-tooltip__form-section {
  margin-top: .55rem;
  padding-top: .5rem;
  border-top: 1px solid var(--border);
}

.wc-tooltip__form-title {
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: .35rem;
}

.wc-tooltip__form-row {
  display: flex; align-items: center; gap: .5rem;
  font-size: .72rem;
  margin-top: .3rem;
}
.wc-tooltip__form-row:first-of-type { margin-top: 0; }
.wc-tooltip__form-team {
  flex: 1;
  font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wc-tooltip__form-record { color: var(--muted); white-space: nowrap; }
.wc-tooltip__form-goals { color: var(--muted); white-space: nowrap; }
.wc-tooltip__form-pct {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
  min-width: 2.4em;
  text-align: right;
}

.wc-tooltip__form-dots {
  display: flex; gap: .25rem;
  margin: .2rem 0 .1rem;
}
.wc-form-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--muted);
}
.wc-form-dot.is-w { background: #34d399; }
.wc-form-dot.is-d { background: var(--muted); }
.wc-form-dot.is-l { background: var(--danger); }

.wc-tooltip__prediction {
  margin-top: .5rem;
  padding-top: .45rem;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem;
}
.wc-tooltip__prediction-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.wc-tooltip__prediction-score {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: .85rem;
  color: var(--gold);
}

/* ---------- Sondage ---------- */
.wc-poll {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  text-align: center;
}

.wc-poll h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.wc-poll__subtitle {
  margin-top: .4rem;
  font-size: .82rem;
  color: var(--muted);
}

.wc-poll__form {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: .75rem;
  justify-content: center;
}
.wc-poll__form[hidden] { display: none; }

.wc-poll__field {
  display: flex; flex-direction: column; gap: .35rem;
  text-align: left;
  flex: 1 1 160px;
}
.wc-poll__field label {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.wc-poll__field select {
  appearance: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .6rem .8rem;
  color: var(--text);
  font-family: inherit;
  font-size: .85rem;
  cursor: pointer;
}
.wc-poll__field select:focus-visible { outline: 2px solid var(--blue-light); }

.wc-poll__submit {
  flex: 0 0 auto;
  background: linear-gradient(90deg, var(--blue-deep), var(--blue-sky));
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: .65rem 1.4rem;
  font-family: inherit;
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
  transition: transform .2s, opacity .2s;
}
.wc-poll__submit:hover { transform: translateY(-1px); }
.wc-poll__submit:disabled { opacity: .5; cursor: default; transform: none; }

.wc-poll__skip {
  display: block;
  margin: .9rem auto 0;
  background: none;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: .75rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  transition: color .2s;
}
.wc-poll__skip:hover { color: var(--blue-light); }

.wc-poll__error {
  margin-top: .8rem;
  font-size: .78rem;
  color: var(--danger);
}

.wc-poll__results {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  text-align: left;
}
.wc-poll__results-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: .9rem;
}
.wc-poll__results-head h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: .95rem;
  font-weight: 700;
}
.wc-poll__total { font-size: .75rem; color: var(--muted); }

.wc-poll__bar-row {
  display: flex; align-items: center; gap: .6rem;
  margin-bottom: .6rem;
}
.wc-poll__bar-flag {
  width: 22px; height: 22px; border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.wc-poll__bar-body { flex: 1; min-width: 0; }
.wc-poll__bar-label {
  display: flex; justify-content: space-between;
  font-size: .78rem;
  margin-bottom: .25rem;
}
.wc-poll__bar-team { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wc-poll__bar-pct { color: var(--gold); font-weight: 700; flex-shrink: 0; margin-left: .5rem; }
.wc-poll__bar-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.wc-poll__bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue-deep), var(--blue-light));
  transition: width .4s ease;
}

/* ---------- Footer ---------- */
.wc-footer {
  position: relative; z-index: 1;
  text-align: center;
  padding: 0 1.5rem 2rem;
  font-size: .72rem;
  color: var(--muted);
  opacity: .6;
}

@media (max-width: 720px) {
  .wc-page { padding-top: 4.5rem; }
  #wc-svg { min-width: 560px; }
}

/* En dessous de ~600px, le tableau ne tient plus lisiblement à 560px de large sans
   défilement horizontal peu évident sur mobile : on le laisse plutôt se réduire pour
   tenir entièrement dans la largeur de l'écran (le SVG reste net, basé sur un viewBox) ;
   l'utilisateur peut pincer-zoomer nativement pour voir le détail d'un match précis. */
@media (max-width: 600px) {
  .wc-page { padding: 4rem 1rem 2.5rem; min-height: auto; }
  .wc-bracket-wrap { overflow: visible; }
  #wc-svg { min-width: 0; width: 100%; }
  .wc-header p { font-size: .85rem; }
  .wc-legend { font-size: .68rem; gap: .4rem .8rem; }
  .wc-poll { padding: 1.5rem 1.25rem; }
  .wc-poll__form { flex-direction: column; align-items: stretch; }
  .wc-poll__field { flex: none; }
  .wc-poll__submit { width: 100%; }
}
