/* ============================================================
   MIAMICLUB × MONDIAL 2026 — système visuel "Le feutre et la pelouse"
   Le vert du billard est le vert du stade. Nuit de stade,
   texte craie, or trophée = seul accent de prestige,
   vert pelouse = accent fonctionnel (data positive).

   Tout est scopé sous body.wc-theme. Thème coupé = site d'origine
   au pixel près (seule une pastille de réactivation subsiste).
   ============================================================ */

/* ------------------------------------------------------------
   1. TOKENS
   ------------------------------------------------------------ */

body.wc-theme {
  /* Noirs de scène : noir pur OLED en fond (= le noir du logo FIFA),
     les surfaces remontent par paliers de gris pour l'élévation */
  --wc-night: #000000;
  --wc-pitch-950: #0a0a0b;
  --wc-pitch-900: #0f0f12;
  --wc-pitch-800: #15151a;
  --wc-pitch-700: #1c1c22;

  /* Or trophée */
  --wc-gold-200: #fff3c4;
  --wc-gold-300: #ffe9a8;
  --wc-gold-400: #f7d774;
  --wc-gold-500: #e8b923;
  --wc-gold-600: #b87f0a;

  /* Métaux du podium */
  --wc-silver-hi: #eef2f8;
  --wc-silver-lo: #8d99ad;
  --wc-bronze-hi: #f0c49a;
  --wc-bronze-lo: #9a5f2a;

  /* Pelouse fonctionnelle */
  --wc-green-400: #37d97e;
  --wc-green-500: #1db965;

  /* Neutres craie */
  --wc-chalk: #f2f0e6;
  --wc-chalk-dim: #b9bdae;

  /* Hairlines & élévation */
  --wc-hairline: rgba(255, 255, 255, 0.14);
  --wc-hairline-soft: rgba(242, 240, 230, 0.07);
  --wc-shadow: 0 14px 44px rgba(2, 8, 4, 0.65);

  /* Gris minimal (style Vercel/Apple : monochrome, un seul accent rare) */
  --wc-white: #ededed;
  --wc-gray: #8f8f98;

  /* Remap des variables du site : tout le système suit */
  --bg: var(--wc-night);
  --bg-soft: var(--wc-pitch-950);
  --card: var(--wc-pitch-900);
  --card-glow: rgba(255, 255, 255, 0.06);
  --text: var(--wc-chalk);
  --muted: var(--wc-gray);
  --accent: var(--wc-white);
  --accent-2: var(--wc-gray);
  --accent-3: var(--wc-gray);
  --brand-pink: var(--wc-chalk);
  --brand-blue: var(--wc-gray);
  --gold: var(--wc-gold-400);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

/* ------------------------------------------------------------
   2. FOND DE SCÈNE — nuit de stade
   ------------------------------------------------------------ */

/* Noir pur absolu : aucune couche d'ambiance — le logo FIFA (fond #000)
   fusionne avec la scène sans le moindre raccord */
body.wc-theme {
  background: var(--wc-night);
}

body.wc-theme::before,
body.wc-theme::after {
  opacity: 0;
}

body.wc-theme .glass-overlay {
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.wc-theme .page::before {
  display: none;
}

/* Logo Mondial à la place du logo MiamiClub (filigrane central) */
body.wc-theme .logo-bg {
  background-image: url("assets/mondial26-logo.png");
  opacity: 0.04;
  filter: none;
}

body.wc-theme .logo-bg {
  opacity: 0.07;
  filter: saturate(0.9) contrast(1.05);
}

/* Tracé du terrain en filigrane : ligne médiane + rond central */
.wc-pitch {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  background:
    radial-gradient(circle at center,
      transparent calc(19vmin - 1px),
      rgba(242, 240, 230, 0.5) 19vmin,
      transparent calc(19vmin + 1px)),
    linear-gradient(to bottom,
      transparent calc(50% - 0.5px),
      rgba(242, 240, 230, 0.5) 50%,
      transparent calc(50% + 0.5px));
}

body.wc-theme .wc-pitch {
  opacity: 0.04;
}

/* ------------------------------------------------------------
   3. TOPLINE — barre Mondial, sobre et fixe
   ------------------------------------------------------------ */

.wc-topline {
  position: fixed;
  inset: 0 0 auto 0;
  min-height: 46px;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 16px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}

/* Le menu de la page, déplacé dans la barre du haut */
.wc-topline-menu {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.wc-topline-menu .controls {
  gap: 8px;
}

.wc-topline-menu .icon-btn,
.wc-topline-menu .ghost {
  min-height: 30px;
}

.wc-topline-menu .ranking-meta {
  display: none;
}

body:not(.wc-theme) .wc-topline {
  display: none;
}

.wc-topline::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.wc-topline-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: "Bebas Neue", "Space Grotesk", sans-serif;
  font-size: 16px;
  letter-spacing: 3px;
  color: var(--wc-chalk);
}

.wc-topline-brand svg {
  color: var(--wc-gold-400);
}

.wc-topline-brand svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.wc-topline-hosts {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--wc-chalk-dim);
}

.wc-topline-right {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.wc-countdown {
  font-family: "Bebas Neue", "Space Grotesk", sans-serif;
  font-size: 15px;
  letter-spacing: 2.4px;
  color: var(--wc-gray);
}

.wc-toggle {
  min-height: 22px;
  padding: 2px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: none;
  color: var(--wc-gray);
  font: 600 10px/1 "Space Grotesk", sans-serif;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.wc-toggle:hover {
  color: var(--wc-chalk);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Pastille de réactivation quand le thème est coupé */
.wc-restore {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 60;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(8, 8, 10, 0.85);
  box-shadow: none;
  color: #e8b923;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.wc-restore svg {
  width: 18px;
  height: 18px;
}

.wc-restore:hover {
  transform: scale(1.08);
  border-color: #f7d774;
}

body.wc-theme .wc-restore {
  display: none;
}

/* Décalage sous la topline par padding : la page fait exactement 100vh,
   aucun débordement possible quelle que soit l'interprétation du vh */
body.wc-theme .page {
  height: 100vh;
  margin-top: 0;
  padding-top: 52px;
}

body.wc-theme.ranking .page {
  height: auto;
  min-height: 100vh;
}

/* Mode TV : zéro chrome, plein écran */
body.wc-theme.display-mode .wc-topline {
  display: none;
}

body.wc-theme.display-mode .page {
  height: 100vh;
  padding-top: 12px;
}

/* ------------------------------------------------------------
   4. HEADER — la marque sous les projecteurs
   ------------------------------------------------------------ */

body.wc-theme .topbar {
  border-bottom-color: var(--wc-hairline-soft);
}

/* Le logo fusionne avec le noir pur du fond : plus de tuile, il flotte.
   Agrandi (ratio 201×251 respecté). */
body.wc-theme .brand-logo {
  width: 84px;
  height: 105px;
  border: none;
  border-radius: 0;
  box-shadow: none;
  animation: none;
  object-fit: contain;
  background: transparent;
}

body.wc-theme .brand-club {
  color: var(--wc-gray);
}

body.wc-theme .tagline {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--wc-gray);
}

body.wc-theme .header-marquee {
  opacity: 0.05;
}

body.wc-theme .header-marquee .brand-miami,
body.wc-theme .header-marquee .brand-club {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--wc-chalk);
}

body.wc-theme .header-sep {
  color: rgba(255, 255, 255, 0.3);
}

body.wc-theme .ghost.icon-btn:hover,
body.wc-theme .ghost:hover {
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--wc-chalk);
  box-shadow: none;
}

body.wc-theme .ranking-date-filter input[type="date"]:focus {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

/* ------------------------------------------------------------
   5. LANDING — l'affiche du Mondial
   ------------------------------------------------------------ */

body.wc-theme .landing-hero-copy {
  background: #101013;
  border-color: rgba(255, 255, 255, 0.09);
}

body.wc-theme .landing-hero-visual {
  background: #0d0d10;
  border-color: rgba(255, 255, 255, 0.07);
}

body.wc-theme .landing-mark-simple {
  color: var(--wc-gray);
  letter-spacing: 4px;
}

body.wc-theme .landing-title-simple span:last-child {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--wc-chalk);
}

body.wc-theme .landing-sub-simple {
  color: var(--wc-gray);
}

/* Kicker Mondial injecté sous le sous-titre */
.wc-kicker {
  display: none;
  width: fit-content;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--wc-gray);
}

body.wc-theme .wc-kicker {
  display: inline-flex;
}

.wc-kicker svg {
  width: 13px;
  height: 13px;
  flex: none;
  color: var(--wc-gold-400);
}

.wc-kicker .wc-kicker-hosts {
  color: var(--wc-chalk-dim);
  letter-spacing: 2px;
}

/* Entrées : bouton principal blanc, signature du style (Vercel/Apple) */
body.wc-theme .landing-entry-primary {
  background: var(--wc-white);
  border-color: transparent;
  color: #0a0a0b;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

body.wc-theme .landing-entry-primary:hover {
  transform: translateY(-3px);
  background: #ffffff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

body.wc-theme .landing-entry-secondary {
  background: #101013;
  border-color: rgba(255, 255, 255, 0.1);
}

body.wc-theme .landing-entry-secondary:hover {
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: none;
}

/* 3 accès sur l'accueil (Tables · Rankings · PlayStation) en une rangée */
.landing-main-actions-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* 3 tuiles d'accès alignées : icône en haut, titre en bas, contenu cohérent */
body.wc-theme .landing-main-actions-3 .landing-entry {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 168px;
  padding: 22px;
}

.landing-entry-ico {
  display: block;
  width: 40px;
  height: 40px;
  opacity: 0.92;
}

.landing-entry-ico svg {
  width: 100%;
  height: 100%;
}

.landing-main-actions-3 .landing-entry-title {
  font-size: clamp(22px, 1.9vw, 36px);
  letter-spacing: 1px;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.wc-theme .landing-entry-ps {
  background:
    radial-gradient(circle at top right, rgba(247, 215, 116, 0.12), transparent 44%),
    #101013;
}

@media (max-width: 780px) {
  .landing-main-actions-3 {
    grid-template-columns: 1fr;
  }
}

/* La landing tient dans l'écran, sans scroll : le main absorbe la hauteur */
body.wc-theme.landing .page {
  overflow: hidden;
}

body.wc-theme .landing-main-simple {
  flex: 1;
  min-height: 0;
  padding-bottom: 0;
}

body.wc-theme .landing-hero-simple {
  height: 100%;
}

body.wc-theme .landing-hero-copy,
body.wc-theme .landing-hero-visual {
  min-height: 0;
  overflow: hidden;
}

body.wc-theme .landing-title-simple {
  font-size: clamp(64px, 9vw, 150px);
}

/* Le panneau de droite devient l'affiche : le VRAI logo FIFA 26 (net, HD),
   seul sur le noir — les fausses tables décoratives disparaissent */
body.wc-theme .landing-hero-visual {
  background: #000000 url("assets/wc26-logo.jpg") center / contain no-repeat;
  border-color: rgba(255, 255, 255, 0.07);
}

/* Pas de logo filigrane au centre de l'écran sur la landing : le hero suffit
   (sinon deux logos se chevauchent en grand écran) */
body.wc-theme.landing .logo-bg {
  display: none;
}

body.wc-theme .landing-table-stage,
body.wc-theme .landing-versus-strip {
  display: none;
}

/* En haut à gauche : la marque MiamiClub seule (le FIFA est déjà à droite) */
body.wc-theme.landing .brand-logo {
  display: none;
}

/* ------------------------------------------------------------
   6. CLASSEMENT — le podium d'abord, la donnée ensuite
   ------------------------------------------------------------ */

/* Podium injecté (aria-hidden : la table reste la source de vérité) */
.wc-podium {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

body.wc-theme .wc-podium {
  display: grid;
}

.wc-step {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding-top: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: #101013;
  overflow: hidden;
  text-align: center;
  animation: wcRise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.wc-step-2 { order: 1; animation-delay: 0.1s; }
.wc-step-1 { order: 2; border-color: rgba(255, 255, 255, 0.16); animation-delay: 0s; }
.wc-step-3 { order: 3; animation-delay: 0.18s; }

/* Entrées décoratives : transform uniquement — le contenu reste
   toujours visible même si l'animation est gelée (onglet caché, TV). */
@keyframes wcRise {
  from { transform: translateY(14px); }
  to { transform: translateY(0); }
}

.wc-step-trophy {
  height: 26px;
  display: grid;
  place-items: center;
  color: var(--wc-gold-400);
}

.wc-step-trophy svg {
  width: 22px;
  height: 22px;
}

.wc-step-name {
  font-family: "Bebas Neue", "Space Grotesk", sans-serif;
  font-size: clamp(26px, 2.6vw, 40px);
  letter-spacing: 1.5px;
  line-height: 1;
  color: var(--wc-chalk);
  padding: 0 12px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wc-step-1 .wc-step-name {
  color: var(--wc-chalk);
}

.wc-step-stat {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--wc-chalk-dim);
  font-variant-numeric: tabular-nums;
}

/* Marches plates : surface sombre + filet métal, le chiffre porte la couleur */
.wc-step-base {
  margin-top: 10px;
  width: 100%;
  display: grid;
  place-items: center;
  font-family: "Bebas Neue", "Space Grotesk", sans-serif;
  font-size: 30px;
  line-height: 1;
  background: #141417;
  border-top: 2px solid;
}

.wc-step-1 .wc-step-base {
  height: 76px;
  font-size: 38px;
  border-top-color: rgba(255, 255, 255, 0.85);
  color: #ffffff;
}

.wc-step-2 .wc-step-base {
  height: 56px;
  border-top-color: rgba(255, 255, 255, 0.35);
  color: #9a9aa2;
}

.wc-step-3 .wc-step-base {
  height: 44px;
  border-top-color: rgba(255, 255, 255, 0.18);
  color: #6b6b73;
}

/* Cartes stats : compactes, icône en filigrane, hairline or */
body.wc-theme .ranking-top-card {
  position: relative;
  overflow: hidden;
  background: #101013;
  border-color: rgba(255, 255, 255, 0.08);
  padding: 18px 22px;
}

body.wc-theme .ranking-top-card::before {
  content: none;
}

.wc-card-icon {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  color: var(--wc-chalk);
  opacity: 0.08;
  pointer-events: none;
  display: none;
}

body.wc-theme .wc-card-icon {
  display: block;
}

.wc-card-icon svg {
  width: 100%;
  height: 100%;
}

body.wc-theme .ranking-top-metric {
  font-family: "Bebas Neue", "Space Grotesk", sans-serif;
  letter-spacing: 1px;
  color: var(--wc-chalk);
}

/* Tableau : hiérarchie nette, métaux typographiques, zebra discret */
body.wc-theme .ranking-board {
  background: #101013;
  border-color: rgba(255, 255, 255, 0.08);
}

body.wc-theme .ranking-table-wrap {
  border-color: rgba(255, 255, 255, 0.07);
}

body.wc-theme .ranking-table th {
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--wc-gray);
  letter-spacing: 1.6px;
}

body.wc-theme .ranking-table td {
  border-bottom-color: rgba(242, 240, 230, 0.05);
  font-variant-numeric: tabular-nums;
}

body.wc-theme .ranking-table tbody tr:not(.ranking-placeholder) {
  animation: wcRowIn 0.35s ease both;
}

body.wc-theme .ranking-table tbody tr:nth-child(1) { animation-delay: 0.02s; }
body.wc-theme .ranking-table tbody tr:nth-child(2) { animation-delay: 0.05s; }
body.wc-theme .ranking-table tbody tr:nth-child(3) { animation-delay: 0.08s; }
body.wc-theme .ranking-table tbody tr:nth-child(4) { animation-delay: 0.11s; }
body.wc-theme .ranking-table tbody tr:nth-child(5) { animation-delay: 0.14s; }
body.wc-theme .ranking-table tbody tr:nth-child(6) { animation-delay: 0.17s; }

@keyframes wcRowIn {
  from { transform: translateY(6px); }
  to { transform: translateY(0); }
}

body.wc-theme .ranking-table tbody tr:nth-child(even):not(.ranking-placeholder) {
  background: rgba(242, 240, 230, 0.015);
}

body.wc-theme .ranking-table tbody tr:hover:not(.ranking-placeholder) {
  background: rgba(255, 255, 255, 0.04);
}

/* Top 3 : couleurs métal plates, sobres */
body.wc-theme .ranking-table tbody tr:nth-child(-n+3):not(.ranking-placeholder) td.is-rank {
  font-family: "Bebas Neue", "Space Grotesk", sans-serif;
  font-size: 28px;
}

body.wc-theme .ranking-table tbody tr:nth-child(1):not(.ranking-placeholder) td.is-rank {
  color: #ffffff;
}

body.wc-theme .ranking-table tbody tr:nth-child(2):not(.ranking-placeholder) td.is-rank {
  color: #9a9aa2;
}

body.wc-theme .ranking-table tbody tr:nth-child(3):not(.ranking-placeholder) td.is-rank {
  color: #6b6b73;
}

body.wc-theme .ranking-table tbody tr:nth-child(1):not(.ranking-placeholder) {
  background: rgba(255, 255, 255, 0.035);
}

body.wc-theme .ranking-table tbody tr:nth-child(1):not(.ranking-placeholder) td.is-player {
  color: var(--wc-chalk);
}

/* Taux de victoire : valeur + barre de donnée, sobre */
.wc-rate {
  display: inline-grid;
  gap: 6px;
  min-width: 120px;
}

.wc-rate-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

body.wc-theme .wc-rate-value {
  color: var(--wc-chalk);
}

.wc-rate-bar {
  display: none;
  height: 4px;
  border-radius: 999px;
  background: rgba(242, 240, 230, 0.08);
  overflow: hidden;
}

body.wc-theme .wc-rate-bar {
  display: block;
}

.wc-rate-fill {
  height: 100%;
  border-radius: inherit;
  background: #d9d9de;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

body.wc-theme .ranking-table tbody tr:nth-child(1):not(.ranking-placeholder) .wc-rate-fill {
  background: #ffffff;
}

/* ------------------------------------------------------------
   7. PAGES TABLES / TOURNOI — monochrome strict
   ------------------------------------------------------------ */

/* Pastilles de table : blanc plat, plus de doré ni d'animation */
body.wc-theme .table-chip {
  background: var(--wc-white);
  color: #0a0a0b;
  box-shadow: none;
  animation: none;
}

/* États des tables : la hiérarchie par la lumière, pas par la couleur */
body.wc-theme .table-card {
  background: #101013;
  border-color: rgba(255, 255, 255, 0.07);
}

body.wc-theme .table-card:hover {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

body.wc-theme .table-card.live {
  border-color: rgba(255, 255, 255, 0.22);
}

body.wc-theme .table-card.waiting {
  border-color: rgba(255, 255, 255, 0.1);
}

body.wc-theme .table-card::before {
  background: rgba(255, 255, 255, 0.5);
  animation: none;
}

/* Chrono de match : pastille verre dépoli */
body.wc-theme .match-timer {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--wc-chalk);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body.wc-theme .queue-count {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Paliers de gains : hiérarchie en niveaux de gris */
body.wc-theme .milestone.tier-1,
body.wc-theme .milestone.tier-2,
body.wc-theme .milestone.tier-3 {
  border-color: rgba(255, 255, 255, 0.1);
}

body.wc-theme .milestone.tier-3 {
  border-color: rgba(255, 255, 255, 0.22);
}

body.wc-theme .milestone.tier-1:hover,
body.wc-theme .milestone.tier-2:hover,
body.wc-theme .milestone.tier-3:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

body.wc-theme .milestone-chip .icon,
body.wc-theme .milestone-chip {
  color: var(--wc-chalk);
}

body.wc-theme .milestone-chip.payout {
  color: var(--wc-chalk);
}

body.wc-theme .milestone-chip .unit {
  color: var(--wc-gray);
}

/* Cercle VS : trait blanc, plus de néon cyan */
body.wc-theme .versus {
  color: var(--wc-chalk);
  text-shadow: none;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: none;
  animation: none;
}

/* Le vert "succès" passe au blanc : la donnée parle par la lumière */
body.wc-theme {
  --success: var(--wc-chalk);
}

/* Chasse au cyan résiduel : badges, files, overlays, focus — tout en blanc */
body.wc-theme .queue-count {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
}

body.wc-theme .stat-chip.win {
  border-color: rgba(255, 255, 255, 0.22);
}

body.wc-theme .player-slot.empty {
  border-color: rgba(255, 255, 255, 0.12);
}

body.wc-theme .switch input:checked + .switch-ui {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.45);
}

body.wc-theme .exit-display:hover {
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

body.wc-theme input[type="text"]:focus,
body.wc-theme .bulk-add textarea:focus {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

body.wc-theme .toast {
  border-color: rgba(255, 255, 255, 0.2);
}

body.wc-theme .win-popup {
  background: rgba(14, 14, 17, 0.78);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

body.wc-theme .win-name {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--wc-chalk);
}

body.wc-theme .swap-btn {
  background: rgba(255, 255, 255, 0.12);
  color: var(--wc-chalk);
}

body.wc-theme .table-lane.live,
body.wc-theme .match-card.status-live,
body.wc-theme .opening-card.status-live {
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: none;
}

body.wc-theme .badge-table {
  border-color: rgba(255, 255, 255, 0.25);
}

body.wc-theme .mini-pill.live {
  border-color: rgba(255, 255, 255, 0.25);
}

/* Paliers : hiérarchie gris → blanc, plus de bronze/argent/or criards */
body.wc-theme .milestone.tier-1 .milestone-chip:first-child {
  color: #6b6b73;
}

body.wc-theme .milestone.tier-2 .milestone-chip:first-child {
  color: #9a9aa2;
}

body.wc-theme .milestone.tier-3 .milestone-chip:first-child {
  color: #ffffff;
}

body.wc-theme .panel-title {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--wc-chalk);
}

/* Boutons pleins : blancs sur noir, la signature du style.
   Les ghost et les contrôles du thème gardent leur propre peau. */
body.wc-theme button:not(.ghost):not(.wc-toggle):not(.wc-restore) {
  background: var(--wc-white);
  color: #0a0a0b;
  box-shadow: none;
}

body.wc-theme button:not(.ghost):not(.wc-toggle):not(.wc-restore):hover {
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

body.wc-theme button.ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: none;
}

body.wc-theme .bracket-scrollbar::-webkit-slider-thumb {
  background: var(--wc-white);
}

body.wc-theme .bracket-scrollbar::-moz-range-thumb {
  background: var(--wc-white);
}

/* ------------------------------------------------------------
   7b. CARTE DU MONDE EN FOND + PAYS HÔTES + TOUCHES D'OR
   ------------------------------------------------------------ */

/* Carte du monde plein écran, NETTE, uniforme sur toute la page.
   Aucun flou, aucun masque dégradé : elle se tient parfaitement derrière. */
.wc-worldmap {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background: #000 url("assets/worldmap.png?v=2") center / cover no-repeat;
}

body.wc-theme .wc-worldmap {
  opacity: 0.6;
}

/* Léger voile sombre uniforme (PAS de flou) : assoit la lecture du texte
   posé directement sur le fond, sans toucher la netteté de la carte */
.wc-glass {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background: rgba(0, 0, 0, 0.42);
}

body.wc-theme .wc-glass {
  opacity: 1;
}

/* Le contenu passe au-dessus de la carte */
body.wc-theme .page {
  position: relative;
  z-index: 1;
}

/* Panneaux OPAQUES : lecture parfaite, la carte reste visible dans les marges */
body.wc-theme .table-card,
body.wc-theme .tourney-panel,
body.wc-theme .ranking-board,
body.wc-theme .ranking-top-card,
body.wc-theme .landing-hero-copy {
  background: #0e0e11;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* ---- Header : la marque de gauche disparaît (le menu est passé dans la topline) ---- */
body.wc-theme .topbar > .brand {
  display: none;
}

/* Emblème pleine largeur : stats aux bords, coupe isolée au centre (comme l'affiche) */
.wc-emblem {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 3;
  pointer-events: none;
}

body.wc-theme .wc-emblem {
  display: flex;
}

/* Le "MiamiClub" qui défile en fond de header est retiré sous le thème */
body.wc-theme .header-marquee {
  display: none;
}

/* Rangée principale : stats poussées aux bords, coupe isolée au centre */
.wc-emblem-main {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  padding: 0 clamp(28px, 6vw, 120px);
}

.wc-emblem-main > .wc-stat-col:first-child {
  justify-self: start;
}

.wc-emblem-main > .wc-centerlogo {
  justify-self: center;
}

.wc-emblem-main > .wc-stat-col:last-child {
  justify-self: end;
}

.wc-centerlogo {
  display: block;
  height: 172px;
  width: auto;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.6));
}

/* Stats du tournoi de part et d'autre de la coupe */
.wc-stat-col {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.wc-stat {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wc-stat-ic {
  width: 36px;
  height: 36px;
  flex: none;
  color: var(--wc-gold-400);
}

.wc-stat-ic svg {
  width: 100%;
  height: 100%;
}

.wc-stat-txt {
  display: grid;
  gap: 2px;
}

.wc-stat-num {
  font-family: "Bebas Neue", "Space Grotesk", sans-serif;
  font-size: clamp(18px, 1.6vw, 23px);
  letter-spacing: 1.5px;
  line-height: 1;
  color: var(--wc-chalk);
}

.wc-stat-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--wc-gold-400);
}

/* Display-mode (TV plein écran) : stats masquées, on garde la coupe seule */
body.wc-theme.display-mode .wc-stat-col {
  display: none;
}

/* ---- Cartes de table : match compact "live" → la queue reprend la place ---- */

/* Le bloc des deux joueurs actifs se resserre en bandeau */
body.wc-theme .match {
  margin-bottom: 10px;
  gap: 12px;
}

body.wc-theme .player-slot {
  min-height: 0;
  padding: 9px 14px;
  gap: 2px;
}

/* Nom plus mesuré (lisible sur écran, mais ne mange plus toute la carte) */
body.wc-theme .player-name {
  font-size: clamp(20px, 1.9vw, 28px);
}

/* "14 to 15W" retiré */
body.wc-theme .player-meta {
  display: none;
}

/* Étoile (victoires) compacte, collée sous le nom */
body.wc-theme .player-stats {
  gap: 6px;
}

body.wc-theme .stat-chip {
  font-size: 13px;
  padding: 1px 6px;
}

body.wc-theme .stat-chip .icon {
  width: 14px;
  height: 14px;
}

/* Barre de progression fine, marge réduite */
body.wc-theme .player-progress {
  margin-top: 3px;
  gap: 0;
}

body.wc-theme .player-progress progress {
  height: 5px;
}

/* Boutons d'action compacts mais tapables par l'opérateur */
body.wc-theme .slot-actions {
  gap: 6px;
  margin-top: 2px;
}

body.wc-theme .slot-actions .icon-btn {
  min-height: 28px;
}

/* La queue (liste d'attente) respire et devient la zone principale de la carte */
body.wc-theme .queue-head {
  margin-bottom: 6px;
}

body.wc-theme .queue-list {
  gap: 5px;
}

/* Header haut UNIQUEMENT pour l'emblème complet (coupe + stats + pays) :
   écrans live (tables, tournoi). Landing, pub et classement/PS en sont exclus. */
body.wc-theme:not(.landing):not(.pub-admin):not(.ranking) .topbar {
  overflow: visible;
  min-height: 252px;
}

/* Classement / PlayStation : header compact, logo seul centré */
body.wc-theme.ranking .topbar {
  overflow: visible;
  min-height: 116px;
}

body.wc-theme.ranking .wc-centerlogo {
  height: 88px;
}

/* /ps : entête complète des écrans live (logo + stats + pays) MAIS page défilable */
body.ps-page {
  overflow-y: auto;
}

body.wc-theme.ps-page .page {
  height: auto;
  min-height: 100vh;
  overflow: visible;
}

body.wc-theme.display-mode .topbar {
  min-height: 72px;
}

body.wc-theme.display-mode .wc-emblem .wc-hostrow {
  display: none;
}

body.wc-theme.display-mode .wc-centerlogo {
  height: 84px;
}

/* Rangée des pays sous la coupe */
.wc-hostrow {
  display: flex;
  align-items: flex-end;
  gap: clamp(22px, 5vw, 64px);
}

.wc-hr-col {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 92px;
}

.wc-hr-name {
  font-family: "Bebas Neue", "Space Grotesk", sans-serif;
  font-size: clamp(22px, 2.2vw, 32px);
  letter-spacing: 2.5px;
  line-height: 1;
  color: var(--wc-chalk);
}

.wc-hr-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--wc-gold-400);
}

.wc-hr-sep {
  width: 1px;
  height: 46px;
  align-self: center;
  background: linear-gradient(180deg, transparent, rgba(232, 185, 35, 0.5), transparent);
}

/* Accents drapeaux sous chaque pays (fines barres aux couleurs officielles) */
.wc-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 9px;
  margin-top: 2px;
}

.wc-flag i {
  display: block;
  width: 26px;
  height: 3px;
  border-radius: 2px;
}

.wc-flag-ca em {
  display: inline-flex;
  width: 14px;
  height: 14px;
  color: #d52b1e;
}

.wc-flag-ca em svg {
  width: 100%;
  height: 100%;
}

.wc-flag-us {
  gap: 7px;
  color: #fff;
  font-size: 12px;
  line-height: 1;
}

.wc-flag-mx i {
  width: 22px;
}

body.wc-theme.display-mode .wc-topline {
  display: none;
}

/* ---- Un peu d'or qui revient sur les éléments vivants (demande client) ---- */

/* Marque + compte à rebours de la topline */
body.wc-theme .wc-topline-brand span {
  color: var(--wc-gold-300);
}

/* Statut LIVE : la pastille passe en or, ça pulse discrètement */
body.wc-theme .table-status.live {
  color: var(--wc-gold-400);
}

body.wc-theme .table-card.live {
  border-color: rgba(232, 185, 35, 0.32);
}

body.wc-theme .table-card.live::before {
  background: linear-gradient(90deg, transparent, var(--wc-gold-500), transparent);
}

/* Cercle VS : filet or fin */
body.wc-theme .versus {
  border-color: rgba(232, 185, 35, 0.4);
  color: var(--wc-gold-300);
}

/* Chrono : chiffres or doux */
body.wc-theme .match-timer {
  color: var(--wc-gold-300);
  border-color: rgba(232, 185, 35, 0.25);
}

/* Palier le plus haut : retour à l'or */
body.wc-theme .milestone.tier-3 .milestone-chip:first-child {
  color: var(--wc-gold-400);
}

body.wc-theme .milestone.tier-3 {
  border-color: rgba(232, 185, 35, 0.28);
}

/* Pastille de table : liseré or autour du blanc */
body.wc-theme .table-chip {
  box-shadow: 0 0 0 2px rgba(232, 185, 35, 0.45);
}

/* ------------------------------------------------------------
   8. RESPONSIVE & MOTION
   ------------------------------------------------------------ */

@media (max-width: 900px) {
  .wc-topline-hosts {
    display: none;
  }

  .wc-podium {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .wc-step-1 { order: 1; }
  .wc-step-2 { order: 2; }
  .wc-step-3 { order: 3; }

  .wc-step-1 .wc-step-base,
  .wc-step-2 .wc-step-base,
  .wc-step-3 .wc-step-base {
    height: 42px;
    font-size: 26px;
  }
}

@media (max-width: 700px) {
  .wc-countdown {
    display: none;
  }

  .wc-topline-brand {
    font-size: 14px;
    letter-spacing: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wc-topline::after {
    animation: none;
    background: rgba(255, 255, 255, 0.1);
  }

  .wc-step,
  body.wc-theme .ranking-table tbody tr:not(.ranking-placeholder) {
    animation: none;
  }

  .wc-rate-fill {
    transition: none;
  }
}
