/* =========================
   RESET
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', sans-serif;
  min-height: 100vh;
  color: white;
  padding-top: 90px;
  background: radial-gradient(circle at center, #4aa1d8 0%, #87ceeb 50%, #cce7f9 100%);
  /* overflow: hidden;  <-- SUPPRIMÉ pour permettre le scroll */
  position: relative; /* utile pour positionner les éléments */
}

/* Conteneur pour les éléments animés en fond */
.background-elements {
  position: fixed; /* reste en fond */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* ne bloque pas les clics */
  z-index: 0;
}

.cloud {
  position: absolute;
  width: 100px;
  height: 60px;
  background-image: url('https://www.123-stickers.com/7290-thickbox/sticker-nuage-mario.jpg');
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.8;
  animation: moveClouds 60s linear infinite;
}

/* Animations */
@keyframes moveClouds {
  0% { transform: translateX(-150px); }
  100% { transform: translateX(110vw); }
}

/* HEADER PRINCIPAL */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background-color: #ff0000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  z-index: 1000;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

header .logo a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: 'Press Start 2P', cursive;
  color: #ffd700;
  font-size: 14px;
}

header nav ul {
  list-style: none;
  display: flex;
  gap: 15px;
  margin: 0;
  padding: 0;
}

header nav ul li a {
  text-decoration: none;
  font-family: 'Press Start 2P', cursive;
  font-size: 11px;
  color: white;
  padding: 8px 14px;
  border: 2px solid #ffd700;
  border-radius: 8px;
  background: #ff0000;
  box-shadow: 0 4px #b30000;
  transition: all 0.2s ease;
}

header nav ul li a:hover,
header nav ul li a.active {
  background: #ffd700;
  color: #ff0000;
  transform: translateY(2px);
  box-shadow: 0 2px #b30000;
}

/* =========================
   HEADER / MENU
========================= */
/* =========================
   CONTAINER OBSERVATOIRE
========================= */
.observatoire {
  position: relative;
  background: rgba(255, 255, 255, 0.95);
  color: #000;
  padding: 40px 30px;
  border-radius: 16px;
  width: 90%;
  max-width: 900px;
  margin: 120px auto 50px auto;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  animation: pop 0.4s ease;
  z-index: 1;
}

/* =========================
   HEADER OBSERVATOIRE
========================= */
.header-observatoire {
  text-align: center;
  margin-bottom: 30px;
}

.logo-observatoire {
  width: 80px;
  height: auto;
  margin-bottom: 12px;
  animation: bounce 1.2s infinite alternate;
}

.header-observatoire h1 {
  font-family: 'Press Start 2P', cursive;
  font-size: 22px;
  color: #ffdd00;
  margin-bottom: 8px;
  text-shadow: 2px 2px #b30000;
}

.header-observatoire p {
  font-size: 13px;
  color: #555;
  margin-bottom: 25px;
}

/* =========================
   ANIMATION LOGO
========================= */
@keyframes bounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-10px); }
}

/* =========================
   SEARCH SECTION
========================= */
.observatoire .search-section {
  position: relative; /* nécessaire pour positionner les suggestions */
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 500px;
  margin: 0 auto 30px;
}

.observatoire .search-section input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 50px;
  border: 2px solid #ffd700;
  font-size: 14px;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

.observatoire .search-section input:focus {
  outline: none;
  border-color: #ff0000;
  box-shadow: 0 0 8px rgba(255,0,0,0.5);
}

.observatoire .search-section button {
  margin-top: 10px;
  width: 50%;
  padding: 12px;
  font-size: 14px;
  border-radius: 50px;
  border: none;
  background: #ff0000;
  color: white;
  cursor: pointer;
  box-shadow: 0 5px #b30000;
  transition: all 0.2s ease;
}

.observatoire .search-section button:hover {
  background: #ffd700;
  color: #ff0000;
  transform: translateY(2px);
  box-shadow: 0 3px #b30000;
}

/* Suggestions */
.observatoire #suggestions {
  position: absolute;
  top: 100%; /* juste sous l'input */
  left: 0;
  width: 100%;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 12px;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  z-index: 100;
  display: none; /* caché par défaut */
}

.observatoire #suggestions div {
  padding: 10px 15px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  transition: background 0.2s, color 0.2s;
}

.observatoire #suggestions div:last-child {
  border-bottom: none;
}

.observatoire #suggestions div:hover {
  background: #ffd700;
  color: #ff0000;
}

.observatoire #error {
  margin-top: 12px;
  color: #ff5555;
  font-weight: bold;
}

/* =========================
   SUGGESTIONS STYLÉES
========================= */
.observatoire #suggestions {
  position: absolute;
  top: 60px;
  left: 0;
  width: 100%;
  max-width: 500px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 12px;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  z-index: 20;
  text-align: left;
  display: none; /* caché par défaut */
}

/* Chaque suggestion */
.observatoire #suggestions div {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  transition: background 0.2s, color 0.2s;
}

.observatoire #suggestions div:last-child {
  border-bottom: none;
}

/* Image ronde */
.observatoire #suggestions img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-right: 10px;
  object-fit: cover;
}

/* Hover */
.observatoire #suggestions div:hover {
  background: #ffd700;
  color: #ff0000;
}

/* =========================
   ERREURS
========================= */
.observatoire #error {
  margin-top: 12px;
  color: #ff5555;
  font-weight: bold;
}

/* =========================
   ANIMATION POP
========================= */
@keyframes pop {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* =========================
   CONTAINER - LARGE HORIZONTALE
========================= */
.container {
  position: relative;
  background: rgba(255, 255, 255, 0.95);
  color: #000;
  padding: 35px;
  border-radius: 14px;
  width: 90%;
  max-width: 900px;
  margin: 120px auto 0 auto;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  animation: pop 0.4s ease;
  z-index: 1;
}

@keyframes pop {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* =========================
   TITRES
========================= */
h1 {
  font-family: 'Press Start 2P', cursive;
  font-size: 18px;
  margin-bottom: 15px;
}

.subtitle {
  font-size: 14px;
  margin-bottom: 20px;
  color: #555;
}

/* =========================
   INPUT
========================= */
input {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border-radius: 6px;
  border: 2px solid #ccc;
  margin-bottom: 10px;
}

input:focus {
  outline: none;
  border-color: #ff0000;
}

/* =========================
   BOUTON
========================= */
button {
  width: 100%;
  padding: 12px;
  font-family: 'Press Start 2P', cursive;
  font-size: 12px;
  background: #ff0000;
  color: white;
  border: none;
  border-radius: 8px;
  box-shadow: 0 5px #b30000;
  cursor: pointer;
  transition: all 0.2s ease;
}

button:hover {
  transform: translateY(2px);
  box-shadow: 0 3px #b30000;
}

/* =========================
   AUTOCOMPLETE
========================= */
#suggestions {
  position: absolute;
  top: 155px;
  left: 35px;
  width: calc(100% - 70px);
  background: #ffffff;
  border: 1px solid #ccc;
  border-radius: 6px;
  max-height: 160px;
  overflow-y: auto;
  z-index: 10;
}

#suggestions div {
  padding: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

#suggestions div:hover {
  background: #ffd700;
}

/* =========================
   ERREURS
========================= */
#error {
  margin-top: 12px;
  color: #ff5555;
  font-weight: bold;
}

/* =========================
   TOP 8 TABLEAUX
========================= */
.top8-container {
  display: flex;
  gap: 40px;
  justify-content: center;
  flex-wrap: nowrap;
  margin-top: 40px;
}

.top8-box {
  background: #ffffff;
  color: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  width: 45%;
}

.top8-title {
  font-family: 'Press Start 2P', cursive;
  background: #ff0000;
  color: #ffd700;
  padding: 12px;
  text-align: center;
  font-size: 14px;
}

.top8-box table {
  width: 100%;
  border-collapse: collapse;
}

.top8-box th, .top8-box td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #ddd;
  font-size: 14px;
}

.top8-box th {
  background-color: #ff0000;
  color: #ffd700;
  font-family: 'Press Start 2P', cursive;
  font-size: 13px;
}

.top8-box td img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin-right: 10px;
  vertical-align: middle;
}

/* Responsive */
@media (max-width: 1000px) {
  .top8-container { flex-wrap: wrap; }
  .top8-box { width: 90%; }
}

/* Liens dans le Top 8 */
.top8-box td a {
  text-decoration: none;
  color: #000;
  font-weight: bold;
  transition: color 0.2s;
}

.top8-box td a:hover {
  color: #ff0000;
}

.top8-title-link {
  color: #ffd700;
  text-decoration: none;
}

.top8-title-link:hover {
  color: #ffffff;
}

/* ======================
   Cartouches Joueurs Avancées
====================== */
.players-container {
  display: grid;

  /* 3 colonnes fixes */
  grid-template-columns: repeat(3, 1fr);

  gap: 24px;
  margin: 40px auto;

  width: 100%;
  max-width: 1400px; /* évite que les cartes soient trop étirées */
  justify-items: center;
}

.player-card {
  position: relative;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  overflow: hidden; /* pour effet de fade sur l'image */
  padding: 5px 10px;
  height: 60px;
  max-width: 450px;
  width: 100%;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.player-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.35);
}

.player-card img {
  height: 100%;           /* prend toute la hauteur de la carte */
  width: auto;            /* largeur automatique pour garder les proportions */
  object-fit: cover;      /* recadre l'image si nécessaire */
  object-position: top;   /* optionnel, pour que le haut de l'image soit visible */
  border-radius: 8px;     /* coins arrondis */
  
  /* Effet fade (optionnel, si tu veux garder) */
  -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: cover;
  mask-image: linear-gradient(to right, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
  mask-repeat: no-repeat;
  mask-size: cover;
}

/* infos joueur */
.player-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

/* ligne RC + pseudo */
.player-name {
  display: flex;
  align-items: center;
  gap: 6px;

  min-width: 0;            /* OBLIGATOIRE pour ellipsis */
  direction: rtl;          /* le texte "pousse" vers la gauche */
}

/* pseudo */
.player-name h3 {
  font-family: 'Press Start 2P', cursive;
  font-size: 9px;
  margin: 0;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  text-align: left;        /* important avec rtl */
  flex: 1;
}

/* tag RC */
.team-tag {
  font-family: 'Press Start 2P', cursive;
  font-size: 14px;
  color: #1e90ff;

  flex-shrink: 0;
  direction: ltr;          /* pour que RC reste lisible */
}

/* drapeau (pour plus tard) */
.player-info .flag {
  margin-top: 2px;
  width: 20px;
  height: 12px;
}

/* responsive mobile */
@media (max-width: 500px) {
  .player-card {
    height: 50px;
  }

  .player-card img {
    width: 40px;
    height: 40px;
  }

  .player-info h3 {
    font-size: 10px;
  }

  .team-tag {
    font-size: 9px;
  }
}

/* ======================
   COULEURS PAR CARTE
====================== */

/* Carte 1 – Rouge Mario */
.player-card:nth-child(1) {
  border-left: 6px solid #e63900;
}

/* Carte 2 – Bleu Luigi */
.player-card:nth-child(2) {
  border-left: 6px solid #1e90ff;
}

/* Carte 3 – Jaune Étoile */
.player-card:nth-child(3) {
  border-left: 6px solid #f7d51d;
}

/* Carte 4 – Vert Yoshi */
.player-card:nth-child(4) {
  border-left: 6px solid #2ecc71;
}

/* Carte 5 – Rose Peach */
.player-card:nth-child(5) {
  border-left: 6px solid #ff69b4;
}

/* Carte 6 – Violet Waluigi */
.player-card:nth-child(6) {
  border-left: 6px solid #8e44ad;
}

/* Carte 7 – Orange Donkey Kong */
.player-card:nth-child(7) {
  border-left: 6px solid #e67e22;
}

/* Carte 8 – Gris Bowser */
.player-card:nth-child(8) {
  border-left: 6px solid #555555;
}

/* Carte 9 – Cyan Rosalina */
.player-card:nth-child(9) {
  border-left: 6px solid #00cec9;
}


/* ======================
   Top 8 existant
====================== */
.top8-container {
  display: flex;
  gap: 40px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 60px;
}

/* =========================
   RANDOM TOURNOI TABLEAU
========================= */

/* Titre du tournoi */
.random-tournament-title {
  text-align: center;
  font-size: 24px;
  font-weight: bold;
  margin-top: 50px;
  color: #ffdd00;
  text-shadow: 2px 2px #b30000;
  font-family: 'Press Start 2P', cursive;
}

/* Wrapper du tournoi */
.random-tournament-wrapper {
  display: grid;
  grid-template-columns: repeat(4, 120px) repeat(2, 100px);
  grid-template-rows: repeat(2, 120px);
  gap: 10px;
  justify-content: center;
  margin: 30px auto 60px auto; /* espace entre plusieurs tableaux */
}

/* Grandes et petites cartes */
.big-card, .small-card {
  position: relative;   /* nécessaire pour le footer overlay */
  border-radius: 12px;
  overflow: hidden;
  height: 100%;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Wrapper image + footer */
.card-avatar {
  position: relative;  /* footer en overlay */
  width: 100%;
  height: 100%;        /* prend toute la hauteur de la carte */
}

.card-avatar img {
  width: 100%;
  height: 100%;        /* remplit toute la carte */
  object-fit: cover;   /* recadrage si nécessaire */
  object-position: top; /* <-- Ajouté : le haut de l'image touche le haut de la case */
  display: block;
}

/* Bande sombre overlay sur l'image */
.card-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(0,0,0,0.5); /* semi-transparente */
  color: #fff;
  padding: 5px 0;
  font-size: 12px;
  text-align: center;
  box-sizing: border-box;
}

/* Placement et pseudo */
.card-footer .placement {
  font-weight: bold;
  display: block;
}

.card-footer .username {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Responsive */
@media (max-width: 1000px) {
  .random-tournament-wrapper {
    grid-template-columns: repeat(2, 120px) repeat(2, 100px);
    grid-template-rows: repeat(4, 120px);
  }
}


/* ======================
   Articles à Lire
====================== */
.articles-container {
  max-width: 1000px;
  margin: 60px auto 100px auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

/* Carte article */
.article-card {
  display: block;                 /* pour que <a> prenne toute la carte */
  background: linear-gradient(145deg, #ffffff, #f3f3f3);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  text-decoration: none;
  color: #222;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* Effet hover Mario */
.article-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 10px 28px rgba(0,0,0,0.35);
}

/* Bande Mario en haut */
.article-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 6px;
  width: 100%;
  background: linear-gradient(
    90deg,
    #e60012, /* rouge Mario */
    #ffcc00, /* jaune étoile */
    #0099ff  /* bleu */
  );
}

/* Titre */
.article-card h3 {
  margin: 10px 0 8px 0;
  font-size: 18px;
  color: #b30000;
  font-family: 'Press Start 2P', cursive;
  line-height: 1.4;
}

/* Description */
.article-card p {
  font-size: 14px;
  line-height: 1.6;
  color: #444;
}

/* Petit effet pièce */
.article-card::after {
  content: "★";
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-size: 22px;
  color: rgba(255, 204, 0, 0.6);
}


/* =========================
   FOOTER STYLÉ
========================= */


.site-footer {
  margin: 80px auto 20px;
  max-width: 1100px;
  padding: 0 15px;
  color: #aaa;
  font-size: 11px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.footer-left,
.footer-right {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.footer-brand {
  color: #ffdd00;
  font-weight: bold;
}

.footer-sep {
  opacity: 0.4;
}

.site-footer a {
  color: #aaa;
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-footer a:hover {
  color: #ffdd00;
}

.footer-bottom {
  margin-top: 8px;
  text-align: center;
  opacity: 0.4;
}

/* Mobile */
@media (max-width: 700px) {
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}
