/* =====================================================================
   Fond de court — styles propres au jeu (préfixe fc-)
   La barre, le plein écran et les infobulles sont dans css/games.css.
   ===================================================================== */

.fc-jeu {
  --mg-jeu-largeur: 1204px; /* barre de 1180 px + marges de 12 px : ne pas changer */
  --mgb-fond: radial-gradient(120% 180% at 0% 0%, rgba(228, 247, 90, 0.22), transparent 55%),
    linear-gradient(120deg, #0d3527, #1b6a49);
  --mgb-accent: #e4f75a;
  --mgb-titre: linear-gradient(100deg, #ffffff, #e4f75a 60%, #c6e83a);
  --mgb-police-titre: "Barlow Condensed", "Madimi One", sans-serif;
  --mgb-texte: #eaf7ef;
  --mgb-doux: #9fcab4;
  --mgb-btn-texte-survol: #e4f75a;
  --mgb-ombre: 0 4px 18px rgba(6, 40, 26, 0.35);
  --mg-fs-fond: #06140e;
  --mg-bulle-fond: #0d3527;
  --fc-police: "Barlow Condensed", system-ui, sans-serif;
  --fc-balle: #e4f75a;
  --fc-vert: #1b6a49;
  --fc-vert-fonce: #0d3527;
}

.fc-jeu [hidden] {
  display: none !important;
}

.fc-jeu .mg-barre-titre {
  font-weight: 800;
  letter-spacing: 0.5px;
}
.fc-stat-surface {
  --mg-stat-largeur: 6.4em;
}
.fc-stat-echange {
  --mg-stat-largeur: 3.6em;
}
.fc-stat-vitesse {
  --mg-stat-largeur: 6.4em;
}

/* ---------- Zone de jeu ---------- */
.fc-zone {
  position: relative;
  box-sizing: border-box;
  align-self: center;
  width: min(var(--mg-barre-largeur, 1180px), calc(100vw - 24px));
  border-radius: 16px;
  overflow: hidden;
  background: #0d3527;
  font-family: var(--fc-police);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.fc-jeu.mg-fs .fc-zone {
  align-self: stretch;
  width: auto;
  flex: 1;
  min-height: 0;
}
.fc-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- Tableau de score (façon télé) ---------- */
.fc-tableau {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  display: grid;
  grid-template-columns: auto;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  font-size: clamp(14px, 1.6vw, 19px);
  font-weight: 700;
  pointer-events: none;
}
.fc-ligne {
  display: flex;
  align-items: stretch;
  background: rgba(10, 30, 22, 0.92);
  color: #fff;
}
.fc-ligne + .fc-ligne {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.fc-ligne > span {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  min-width: 1.4em;
}
.fc-ligne .fc-sert {
  width: 0.9em;
  min-width: 0;
  padding: 0 0 0 8px;
}
.fc-ligne .fc-sert i {
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: var(--fc-balle);
  box-shadow: 0 0 6px var(--fc-balle);
}
.fc-ligne .fc-nom {
  justify-content: flex-start;
  min-width: 7.5em;
  gap: 6px;
  letter-spacing: 0.3px;
}
.fc-ligne .fc-nom em {
  width: 0.6em;
  height: 0.6em;
  border-radius: 2px;
  flex-shrink: 0;
}
.fc-ligne .fc-set {
  color: #b9d6c6;
  font-weight: 600;
}
.fc-ligne .fc-set.fc-gagne {
  color: #fff;
}
.fc-ligne .fc-set sup {
  font-size: 0.6em;
  margin-left: 1px;
}
.fc-ligne .fc-jeux {
  background: rgba(255, 255, 255, 0.1);
}
.fc-ligne .fc-pts {
  min-width: 2.2em;
  background: var(--fc-balle);
  color: #10301f;
}
.fc-tableau-titre {
  padding: 2px 10px;
  background: #e4f75a;
  color: #10301f;
  font-size: 0.72em;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ---------- Annonces ---------- */
.fc-annonce {
  position: absolute;
  left: 50%;
  top: 30%;
  z-index: 6;
  transform: translate(-50%, -50%);
  pointer-events: none;
  text-align: center;
  white-space: nowrap;
}
.fc-annonce span {
  display: inline-block;
  padding: 6px 26px 8px;
  border-radius: 10px;
  background: rgba(10, 30, 22, 0.88);
  color: #fff;
  font-size: clamp(26px, 4.4vw, 54px);
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  animation: fc-annonce 1.5s ease-out forwards;
}
.fc-annonce span.fc-faute {
  background: #c62f2f;
}
.fc-annonce span.fc-ace {
  background: var(--fc-balle);
  color: #10301f;
}
.fc-annonce span.fc-jeu-gagne {
  background: linear-gradient(100deg, #1b6a49, #2f9a64);
}
.fc-annonce span.fc-long {
  animation-duration: 2.6s;
}
.fc-annonce small {
  display: block;
  font-size: 0.42em;
  font-weight: 600;
  letter-spacing: 0.5px;
  opacity: 0.85;
  text-transform: none;
}
@keyframes fc-annonce {
  0% {
    transform: scale(0.4);
    opacity: 0;
  }
  12% {
    transform: scale(1.08);
    opacity: 1;
  }
  20% {
    transform: scale(1);
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-14px);
  }
}

.fc-aide-ctrl {
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 5;
  transform: translateX(-50%);
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(10, 30, 22, 0.8);
  color: #eaf7ef;
  font-size: clamp(14px, 1.4vw, 17px);
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}
.fc-aide-ctrl kbd {
  display: inline-block;
  padding: 0 6px;
  margin: 0 2px;
  border-radius: 4px;
  background: var(--fc-balle);
  color: #10301f;
  font: inherit;
  font-weight: 800;
}

/* Boutons tactiles */
.fc-tactile {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 5;
  display: flex;
  gap: 10px;
}
.fc-tactile-btn {
  width: 74px;
  height: 74px;
  margin: 0;
  border: 3px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  background: rgba(228, 247, 90, 0.85);
  color: #10301f;
  font: 800 17px var(--fc-police);
  touch-action: none;
}
.fc-tactile-lob {
  width: 58px;
  height: 58px;
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.75);
  font-size: 15px;
}

/* ---------- Panneaux (menus, présentation, fin) ---------- */
.fc-voile {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(3, 16, 10, 0.55);
  backdrop-filter: blur(3px);
  animation: fc-fondu 0.25s ease-out;
}
@keyframes fc-fondu {
  from {
    opacity: 0;
  }
}
.fc-panneau {
  position: relative;
  box-sizing: border-box;
  width: min(820px, 100%);
  max-height: 100%;
  overflow: auto;
  padding: 18px 24px 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #eef6f0);
  color: #163628;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  text-align: center;
  font-size: 17px;
  animation: fc-monte 0.3s ease-out;
}
.fc-panneau-petit {
  width: min(520px, 100%);
}
@keyframes fc-monte {
  from {
    transform: translateY(18px) scale(0.97);
    opacity: 0;
  }
}
.fc-panneau h2 {
  margin: 0;
  font-family: var(--fc-police);
  font-size: 2.2em;
  font-weight: 800;
  line-height: 1.05;
  color: #0d3527;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.fc-panneau h3 {
  margin: 10px 0 5px;
  font-size: 1.05em;
  font-weight: 700;
  color: #1b6a49;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.fc-sous-titre {
  margin: 2px 0 12px;
  color: #5a7a69;
  font-weight: 500;
}
.fc-retour {
  position: absolute;
  top: 12px;
  left: 14px;
  margin: 0;
  padding: 4px 12px;
  border: 0;
  border-radius: 999px;
  background: #e1eee6;
  color: #1b6a49;
  font: 700 0.9em var(--fc-police);
  cursor: pointer;
}
.fc-retour:hover {
  background: #d1e6da;
}

.fc-modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 8px;
}
.fc-carte {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0 0 12px;
  overflow: hidden;
  border: 2px solid #cfe2d6;
  border-radius: 14px;
  background: #fff;
  color: #163628;
  font: inherit;
  cursor: pointer;
  transition:
    transform 0.12s,
    border-color 0.12s,
    box-shadow 0.12s;
}
.fc-carte:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: #1b6a49;
  box-shadow: 0 8px 18px rgba(13, 53, 39, 0.18);
}
.fc-carte:focus-visible,
.fc-choix:focus-visible,
.fc-perso:focus-visible,
.fc-retour:focus-visible {
  outline: 3px solid #c6a700;
  outline-offset: 2px;
}
.fc-carte:disabled {
  cursor: default;
  opacity: 0.55;
}
.fc-carte-img {
  width: 100%;
  height: 82px;
  margin-bottom: 6px;
}
.fc-carte b {
  font-size: 1.3em;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.fc-carte small {
  padding: 0 10px;
  color: #5a7a69;
  font-size: 0.88em;
  line-height: 1.2;
}
.fc-trophees {
  color: #c69a00;
  font-weight: 700;
}

.fc-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #d6e7dc;
}
.fc-options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 600;
  cursor: pointer;
}

/* Interrupteurs aux couleurs du jeu */
.fc-jeu input[type="checkbox"] {
  background: #cfe0d6;
  border-color: rgba(13, 53, 39, 0.18);
}
.fc-jeu input[type="checkbox"]:checked {
  background: #1b6a49;
  border-color: #0d3527;
}
.fc-jeu input[type="checkbox"]:hover:not(:disabled) {
  box-shadow:
    inset 0 1px 2px rgba(13, 53, 39, 0.15),
    0 0 0 4px rgba(27, 106, 73, 0.18);
}
.fc-jeu input[type="checkbox"]:focus-visible {
  outline-color: #c6a700;
}

/* Choix (surfaces, formats) */
.fc-rangee {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.fc-choix {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 7px 14px;
  border: 2px solid #cfe2d6;
  border-radius: 12px;
  background: #fff;
  color: #163628;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.fc-choix small {
  font-weight: 500;
  font-size: 0.78em;
  color: #5a7a69;
}
.fc-choix[aria-pressed="true"] {
  border-color: #1b6a49;
  background: #1b6a49;
  color: #fff;
}
.fc-choix[aria-pressed="true"] small {
  color: #cfe9da;
}
.fc-pastille-sol {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  border-radius: 4px;
  vertical-align: -0.15em;
  margin-right: 6px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7);
}

/* Personnages */
.fc-persos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 6px;
}
.fc-perso {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 6px 4px 7px;
  border: 2px solid #cfe2d6;
  border-radius: 12px;
  background: #fff;
  color: #163628;
  font: inherit;
  font-size: 0.92em;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
}
.fc-perso[aria-pressed="true"] {
  border-color: #1b6a49;
  box-shadow: 0 0 0 2px #1b6a49;
}
.fc-perso img {
  width: 50px;
  height: 50px;
}
.fc-niveau {
  color: #c69a00;
  font-size: 0.85em;
  letter-spacing: 1px;
}
.fc-niveau i {
  font-style: normal;
  color: #d7e3db;
}

/* Tournois */
.fc-tournois {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.fc-tournoi .fc-tours {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: 4px 0 2px;
}
.fc-tours span {
  position: relative;
}
.fc-tours img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}
.fc-tours .fc-battu img {
  filter: grayscale(1) opacity(0.6);
}
.fc-tours .fc-battu::after {
  content: "✓";
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #1b6a49;
  color: #fff;
  font-size: 12px;
  line-height: 18px;
}
.fc-coupe {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 1.6em;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
}

/* Présentation du match : deux fiches identiques face à face */
.fc-face {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 12px;
  margin: 8px 0 4px;
}
.fc-fiche {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 14px 10px 12px;
  border: 2px solid #d6e7dc;
  border-radius: 16px;
  background: #fff;
}
.fc-fiche img {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
}
.fc-fiche .fc-fiche-nom {
  max-width: 100%;
  font-size: 1.3em;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-wrap: balance; /* jamais coupé : un nom long passe sur deux lignes */
  overflow-wrap: anywhere;
}
.fc-fiche-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 6px;
  min-height: 2.6em;
  color: #5a7a69;
  font-size: 0.92em;
  font-weight: 600;
  line-height: 1.2;
}
.fc-fiche-info kbd {
  padding: 0 5px;
  border-radius: 4px;
  background: #163628;
  color: #fff;
  font: inherit;
  font-size: 0.92em;
}
.fc-vs {
  align-self: center;
  font-size: 2.4em;
  font-weight: 800;
  color: #c69a00;
  font-style: italic;
}
.fc-citation {
  margin: 10px auto 0 !important;
  max-width: 420px;
  color: #3f5c4e;
  font-style: italic;
  line-height: 1.3;
}
.fc-tirage {
  margin: 10px 0 0;
  font-weight: 700;
  color: #1b6a49;
}

/* Tout le texte des panneaux dans la police du jeu */
.fc-panneau,
.fc-panneau p,
.fc-panneau small,
.fc-panneau span,
.fc-panneau b,
.fc-panneau td,
.fc-panneau label,
.fc-panneau button {
  font-family: var(--fc-police);
}

/* Fin de match */
.fc-score-final {
  display: inline-flex;
  gap: 10px;
  margin: 6px 0 8px;
  font-size: 1.5em;
  font-weight: 800;
}
.fc-score-final span {
  padding: 2px 12px;
  border-radius: 8px;
  background: #e1eee6;
}
.fc-stats {
  width: min(420px, 100%);
  margin: 4px auto 0;
  border-collapse: collapse;
  font-size: 1em;
}
.fc-stats td {
  padding: 3px 8px;
  border-bottom: 1px solid #e0ece4;
}
.fc-stats td:first-child,
.fc-stats td:last-child {
  width: 22%;
  font-weight: 800;
  font-size: 1.1em;
}
.fc-stats td:nth-child(2) {
  color: #5a7a69;
}
.fc-stats tr:first-child td {
  font-weight: 800;
  color: #163628;
  text-transform: uppercase;
  font-size: 0.85em;
}
.fc-trophee {
  font-size: 4em;
  line-height: 1;
  animation: fc-trophee 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 6px 8px rgba(150, 110, 0, 0.35));
}
@keyframes fc-trophee {
  from {
    transform: scale(0) rotate(-30deg);
  }
}
.fc-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}
.fc-touches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
  font-size: 0.92em;
  text-align: left;
}
.fc-touches div {
  padding: 8px 12px;
  border-radius: 10px;
  background: #f1f7f3;
}
.fc-touches kbd {
  display: inline-block;
  padding: 0 5px;
  border-radius: 4px;
  background: #163628;
  color: #fff;
  font: inherit;
  font-weight: 700;
}

/* Boutons des fenêtres, aux couleurs du court */
.fc-jeu .btn-vert {
  background: #2f9a64;
  border-color: #2f9a64;
  color: #fff;
  box-shadow: 0 3px 0 #1b6a49;
}
.fc-jeu .btn-vert:hover {
  background: #36ad71;
  border-color: #36ad71;
}
.fc-jeu .btn-bleu {
  background: #0d3527;
  border-color: #0d3527;
  color: #fff;
  box-shadow: 0 3px 0 #04170f;
}
.fc-jeu .btn-bleu:hover {
  background: #1b4c39;
  border-color: #1b4c39;
}
.fc-jeu .btn-rouge {
  background: transparent;
  border-color: #c4473f;
  color: #c4473f;
  box-shadow: none;
}
.fc-jeu .btn-rouge:hover {
  background: rgba(196, 71, 63, 0.1);
  border-color: #c4473f;
}
.fc-jeu .btn-vert:focus-visible,
.fc-jeu .btn-bleu:focus-visible,
.fc-jeu .btn-rouge:focus-visible {
  outline-color: #c6a700;
}

@media (max-width: 700px) {
  .fc-modes,
  .fc-tournois {
    grid-template-columns: 1fr;
  }
  .fc-touches {
    grid-template-columns: 1fr;
  }
  .fc-fiche img {
    width: 80px;
    height: 80px;
  }
  .fc-fiche .fc-fiche-nom {
    font-size: 1.1em;
  }
  .fc-panneau {
    font-size: 15px;
  }
}

/* Les <b> du site sont violets : on garde nos couleurs */
.fc-panneau b,
.fc-tableau b {
  font-family: inherit;
  color: inherit;
}

@media (max-width: 640px) {
  .fc-aide-ctrl {
    display: none !important;
  }
  .fc-tableau {
    font-size: 13px;
  }
}

.fc-panneau.fc-panneau-pres {
  width: min(640px, 100%);
}
.fc-jeu .fc-panneau b,
.fc-jeu .fc-fiche .fc-fiche-nom {
  font-family: var(--fc-police);
}
