/* ----- RESET & BASE ----- */
body {
  margin: 0;
  background: #2c2c2c;
  font-family: Arial, sans-serif;
  color: #fff;
  user-select: none;
  overflow-x: hidden; /* bloque le swipe horizontal */
}

html {
  touch-action: manipulation; /* empêche double-tap zoom */
}

/* ----- CONTAINER PRINCIPAL ----- */
#game-container {
  display: flex;
  flex-direction: row; /* cote à cote sur PC */
  width: 100%;
  min-height: 100vh;
  padding: 20px;
  box-sizing: border-box;
  gap: 15px;
  overflow-x: hidden; /* bloque horizontal */
}

/* ----- SECTIONS ----- */
#clicker-section,
#purchases-section,
#shop-section {
  border: 2px solid #fff;
  border-radius: 10px;
  background: #3a3a3a;
  padding: 20px;
  box-shadow: 0 0 10px rgba(0,0,0,0.4);
  overflow-x: hidden; /* bloque horizontal */
}

/* ==============================
   🚬 CLICKER
============================== */
#clicker-section {
  flex: 0.25;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

#smoker {
  width: 120px;
  cursor: pointer;
  transition: transform 0.1s ease;
}

#smoker:active {
  transform: scale(0.9);
}

/* ==============================
   💨 ACHATS
============================== */
#purchases-section {
  flex: 0.5;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
}

#purchased-items-container {
  display: flex;
  flex-wrap: wrap; /* items vont à la ligne */
  justify-content: center;
  margin-top: 20px;
  gap: 10px;
}

/* ==============================
   🛒 BOUTIQUE
============================== */
#shop-section {
  flex: 0.25;
  overflow-y: auto;
  padding: 15px;
}

/* ==============================
   VERSION MOBILE
============================== */
@media (max-width: 768px) {
  #game-container {
    flex-direction: column; /* empile sections */
    padding: 10px;
    gap: 10px;
  }

  #clicker-section,
  #purchases-section,
  #shop-section {
    width: 100%;
    flex: 1 1 auto;
    box-sizing: border-box;
  }

  #clicker-section {
    justify-content: flex-start; /* clicker en haut */
  }

  /* Items s’affichent tous, pas de swipe */
  .purchased-items-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    overflow-x: hidden; /* bloque swipe */
    width: 100%;
  }

  .category-container {
    width: 100%;
  }

  button {
    padding: 10px 15px;
    font-size: 1em;
  }
}
/* ==============================
   🛒 BOUTIQUE HORIZONTALE - IMAGE + TEXTE
============================== */
.shop-item {
  display: flex;
  flex-direction: row;   /* image à gauche, texte à droite */
  align-items: center;   /* centrer verticalement */
  justify-content: flex-start;
  width: 220px;          /* largeur de l’item */
  padding: 6px 8px;
  margin: 4px 0;         /* moins de marge verticale */
  border-radius: 6px;
  background: #2e2e2e;
  color: #fff;
  font-size: 0.85em;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.3s ease;
}

/* Image à gauche */
.shop-item img {
  width: 50px;
  height: auto;
  margin-right: 8px; /* espace entre image et texte */
}

/* Texte à droite */
.shop-item .item-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px; /* espace entre nom, prix et rareté */
}

/* Hover glow selon rareté */
.shop-item.common:hover {
  box-shadow: 0 0 8px 3px #7fff7f; /* vert */
  border-color: #7fff7f;
}

.shop-item.epic:hover {
  box-shadow: 0 0 10px 3px #aa00ff; /* violet */
  border-color: #aa00ff;
}

.shop-item.legendary:hover {
  box-shadow: 0 0 12px 4px #ffcc00; /* jaune */
  border-color: #ffcc00;
}

.shop-item.secret:hover {
  box-shadow: 0 0 15px 5px #ff3399; /* rose */
  border-color: #ff3399;
}

/* Texte du prix / rareté */
.shop-item .item-info .item-name {
  font-weight: bold;
}

.shop-item .item-info .item-price,
.shop-item .item-info .item-rarity {
  font-size: 0.75em;
}

/* ==============================
   💎 Glow Items achetés (corrigé)
============================== */
.purchased-item {
  width: 70px;
  height: 70px;
  margin: 5px;
  border-radius: 8px;
  border: 2px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.8em;
  color: #fff;
  background: #2c2c2c;
}

/* Glow hover selon rareté */
.purchased-item.common:hover {
  box-shadow: 0 0 8px 3px #7fff7f, 0 0 3px 1px #7fff7f44 inset; /* vert */
  border-color: #7fff7f;
}

.purchased-item.epic:hover {
  box-shadow: 0 0 10px 3px #aa00ff, 0 0 4px 1.5px #aa00ff44 inset; /* violet */
  border-color: #aa00ff;
}

.purchased-item.legendary:hover {
  box-shadow: 0 0 12px 4px #ffcc00, 0 0 5px 2px #ffcc0044 inset; /* jaune */
  border-color: #ffcc00;
}

.purchased-item.secret:hover {
  box-shadow: 0 0 15px 5px #ff3399, 0 0 6px 2.5px #ff339944 inset; /* rose */
  border-color: #ff3399;
}

/* Agrandir légèrement sur hover */
.purchased-item:hover {
  transform: scale(1.15);
}

/* Texte compteur */
.purchased-item span {
  font-size: 0.75em;
  margin-top: 2px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Conteneur des items achetés - affichage horizontal */
#purchased-items-container {
  display: flex;
  flex-direction: row;   /* items alignés horizontalement */
  flex-wrap: nowrap;     /* pas de retour à la ligne */
  justify-content: flex-start; /* alignement à gauche */
  gap: 6px;             /* espace entre les items */
  margin-top: 10px;
  overflow-x: auto;      /* si trop d’items, on peut scroller horizontalement */
  padding-bottom: 5px;   /* pour ne pas couper les items */
}

/* Items achetés */
.purchased-item {
  flex: 0 0 auto;       /* ne rétrécit pas et garde sa taille */
  width: 60px;
  height: 60px;
  margin: 0;            /* marge déjà gérée par gap */
  font-size: 0.75em;
}

/* Texte compteur */
.purchased-item span {
  font-size: 0.65em;
  margin-top: 1px;
}

/* Glow hover reste inchangé */
.purchased-item.common:hover {
  box-shadow: 0 0 8px 3px #7fff7f, 0 0 3px 1px #7fff7f44 inset;
  border-color: #7fff7f;
}
.purchased-item.epic:hover {
  box-shadow: 0 0 10px 3px #aa00ff, 0 0 4px 1.5px #aa00ff44 inset;
  border-color: #aa00ff;
}
.purchased-item.legendary:hover {
  box-shadow: 0 0 12px 4px #ffcc00, 0 0 5px 2px #ffcc0044 inset;
  border-color: #ffcc00;
}
.purchased-item.secret:hover {
  box-shadow: 0 0 15px 5px #ff3399, 0 0 6px 2.5px #ff339944 inset;
  border-color: #ff3399;
}

.inventory-item {
  width: 90px;
  height: 90px;
  background:#3a3a3a;
  border-radius:8px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  color:#fff;
  font-size:0.75em;
  padding:5px;
  text-align:center;
  transition:0.3s;
  border: 2px solid transparent;
}

.inventory-item.owned {
  border-color: #4CAF50;
  box-shadow: 0 0 10px 2px #4CAF50;
}

.inventory-item.not-owned {
  filter: grayscale(100%);
  opacity:0.4;
}

.inventory-item img {
  width:50px;
  height:50px;
  object-fit:contain;
  margin-bottom:5px;
}

/* ==============================
   📘 ENCYCLOPÉDIE
============================== */

/* Bouton encyclopédie */
#encyclopedia-btn {
  position: fixed;
  bottom: 15px;
  right: 15px;
  background: linear-gradient(135deg, #4CAF50, #2e7d32);
  border: none;
  color: white;
  padding: 10px 14px;
  font-size: 0.95em;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
  z-index: 1000;
}

#encyclopedia-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 10px #4CAF50;
}

/* ✅ Adapté au téléphone */
@media (max-width: 768px) {
  #encyclopedia-btn {
    bottom: 10px;
    right: 10px;
    font-size: 0.85em;
    padding: 8px 12px;
  }
}

/* Fenêtre encyclopédie (flou de fond + centrage) */
#encyclopedia {
  display: none; /* masquée par défaut */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 999;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  padding: 20px;
}

/* Contenu de l’encyclopédie */
#encyclopedia-content {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  max-width: 90%;
}

/* Carte d’un item */
.encyclopedia-item {
  width: 110px;
  height: 130px;
  background: #3a3a3a;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.1);
  text-align: center;
  color: #fff;
  padding: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 0 6px rgba(0,0,0,0.5);
}

.encyclopedia-item img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  margin-bottom: 8px;
}

.encyclopedia-item:hover {
  transform: scale(1.08);
  box-shadow: 0 0 10px rgba(255,255,255,0.3);
}

/* Bouton fermer */
#close-encyclopedia {
  position: fixed;
  top: 15px;
  right: 20px;
  background: #ff4444;
  color: white;
  border: none;
  padding: 8px 12px;
  font-size: 0.9em;
  border-radius: 6px;
  cursor: pointer;
  z-index: 1001;
  transition: 0.3s;
}

#close-encyclopedia:hover {
  background: #ff6666;
}

/* ==============================
   🏪 BOUTIQUE JOURNALIÈRE
============================== */
.daily-shop {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 15px;
}

.daily-item {
  background: #333;
  border-radius: 8px;
  padding: 10px;
  width: 130px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 0 5px rgba(0,0,0,0.4);
  transition: 0.3s;
}

.daily-item img {
  width: 60px;
  height: 60px;
  margin-bottom: 8px;
}

.daily-item button {
  background: #4CAF50;
  color: white;
  border: none;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8em;
  transition: 0.3s;
}

.daily-item button:hover {
  background: #66bb6a;
}

.daily-item button[disabled] {
  background: #555;
  cursor: not-allowed;
}

#mobilePage {
    width: 100%;
    height: 100vh; /* prend tout l'écran */
    background: #2c2c2c;
    color: #fff;
    overflow-y: auto;
    padding: 10px;
    font-family: Arial, sans-serif;
}

/* ==============================
   🏆 TOP 100 (PC + Mobile)
============================== */

/* ----- CONTAINER ----- */
.category-container.category-top100 {
  flex: 0.25;
  background: #3a3a3a;
  border: 2px solid #fff;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 0 10px rgba(0,0,0,0.4);
  color: #fff;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ----- TITRE (PC) ----- */
.category-container.category-top100 .category-title {
  background: linear-gradient(90deg, #ffcc00, #ffaa00);
  color: #000;
  text-shadow: 0 0 8px #ffcc00;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 1.1em;
  font-weight: bold;
  margin-bottom: 10px;
  text-align: center;
}

/* ----- LISTE (PC) ----- */
#top100-list {
  width: 100%;
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ----- ÉLÉMENT (PC) ----- */
#top100-list li {
  background: #2e2e2e;
  border-radius: 6px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 0 5px rgba(0,0,0,0.4);
  transition: all 0.2s ease;
  font-size: 0.9em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Hover glow */
#top100-list li:hover {
  background: #444;
  box-shadow: 0 0 8px #ffaa00;
  transform: scale(1.03);
}

/* Rang / Nom / Score */
.top-rank {
  font-weight: bold;
  color: #ffcc00;
  text-shadow: 0 0 6px #ffcc00;
}
.top-player {
  flex: 1;
  text-align: left;
  margin-left: 10px;
}
.top-score {
  color: #66ff66;
  font-weight: bold;
}

/* Couleurs spéciales podium */
#top100-list li:nth-child(1) .top-rank { color: #ffd700; text-shadow: 0 0 10px #ffd700; }
#top100-list li:nth-child(2) .top-rank { color: #c0c0c0; text-shadow: 0 0 10px #c0c0c0; }
#top100-list li:nth-child(3) .top-rank { color: #cd7f32; text-shadow: 0 0 10px #cd7f32; }

/* Scroll bar */
.category-container.category-top100::-webkit-scrollbar {
  width: 8px;
}
.category-container.category-top100::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 6px;
}
.category-container.category-top100::-webkit-scrollbar-thumb:hover {
  background: #777;
}

/* ====== Top 100 (PC & Mobile) - Thème harmonisé ====== */
#top100-container {
  width: 100%;
  margin: 20px auto 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.9));
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.7), 0 0 20px rgba(76, 175, 80, 0.3);
  overflow: hidden;
  position: relative;
  z-index: 10;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.top100-header {
  background: linear-gradient(45deg, #4CAF50, #2E7D32);
  padding: 18px 15px;
  text-align: center;
  position: relative;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.top100-header h2 {
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  font-size: 22px;
  margin: 0 0 10px 0;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.username-container {
  display: flex;
  justify-content: center;
  margin-top: 10px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 10px;
}

#add-username-button {
  padding: 12px 20px;
  border-radius: 25px;
  border: none;
  background: linear-gradient(45deg, #ffcc00, #ff9900);
  color: #333;
  font-weight: bold;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}

#add-username-button:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: 0.5s;
}

#add-username-button:hover {
  background: linear-gradient(45deg, #ffd700, #ffaa00);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

#add-username-button:hover:before {
  left: 100%;
}

.soon-message {
  font-size: 36px !important;
  font-weight: bold !important;
  color: #4CAF50 !important;
  text-align: center !important;
  padding: 30px !important;
  text-shadow: 0 2px 5px rgba(0,0,0,0.2) !important;
  letter-spacing: 3px !important;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 0.7; transform: scale(1); }
}

.player-stats-container {
  background: rgba(0, 0, 0, 0.5);
  padding: 15px;
  margin: 0;
  border-top: 1px solid rgba(76, 175, 80, 0.3);
  border-bottom: 1px solid rgba(76, 175, 80, 0.3);
  color: white;
  text-align: center;
  display: none;
}

.player-stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(76, 175, 80, 0.3);
  padding-bottom: 10px;
}

.player-stats-header h3 {
  margin: 0;
  font-size: 20px;
  color: #ffcc00;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.close-stats {
  font-size: 24px;
  cursor: pointer;
  color: #ff4444;
  transition: all 0.2s ease;
}

.close-stats:hover {
  transform: scale(1.2);
}

.player-stats-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
}

.stat-item {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 10px;
  width: calc(33.33% - 15px);
  min-width: 120px;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  border: 1px solid rgba(76, 175, 80, 0.2);
}

.stat-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  background: rgba(0, 0, 0, 0.5);
}

.stat-icon {
  font-size: 24px;
  margin-right: 10px;
  width: 30px;
  text-align: center;
}

.stat-info {
  flex-grow: 1;
  text-align: left;
}

.stat-label {
  font-size: 12px;
  color: #aaa;
}

.stat-value {
  font-size: 16px;
  font-weight: bold;
  color: #fff;
}

.player-not-found {
  padding: 20px;
  color: #ff4444;
  font-size: 16px;
}

.rank-item {
  cursor: pointer;
}

.rank-item.highlighted {
  background: rgba(255, 204, 0, 0.3);
  transform: scale(1.02);
  box-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}

.rank-number {
  display: inline-block;
  width: 40px;
  font-weight: bold;
  color: #ffcc00;
}

.rank-name {
  display: inline-block;
  margin: 0 10px;
  font-weight: bold;
}

.rank-score {
  float: right;
  color: #4CAF50;
}

.current-player {
  background: linear-gradient(to right, rgba(255, 204, 0, 0.2), rgba(255, 204, 0, 0.05));
  border-left: 3px solid #ffcc00;
}

.top100-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 15px;
  max-height: 350px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #4CAF50 rgba(0, 0, 0, 0.2);
}

.top100-content::-webkit-scrollbar {
  width: 8px;
}

.top100-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.top100-content::-webkit-scrollbar-thumb {
  background-color: #4CAF50;
  border-radius: 10px;
}

.rank-item {
  background: rgba(0, 0, 0, 0.3);
  border-left: 3px solid #4CAF50;
  border-radius: 5px;
  padding: 10px 15px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
}

.rank-item:hover {
  background: rgba(0, 0, 0, 0.5);
  transform: translateX(5px);
}

.rank-number {
  display: inline-block;
  width: 40px;
  font-weight: bold;
  color: #ffcc00;
}

.rank-name {
  display: inline-block;
  margin: 0 10px;
  font-weight: bold;
  flex-grow: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-score {
  color: #4CAF50;
  font-weight: bold;
  text-align: right;
  min-width: 100px;
}

.current-player {
  background: linear-gradient(to right, rgba(255, 204, 0, 0.2), rgba(255, 204, 0, 0.05));
  border-left: 3px solid #ffcc00;
}

/* Responsive styles */
@media (max-width: 768px) {
  #top100-container {
    width: 100%;
    margin: 15px auto 0;
  }
  
  .top100-header h2 {
    font-size: 20px;
  }
  
  .top100-content {
    max-height: 300px;
    padding: 10px;
  }
  
  .rank-item {
    padding: 8px 12px;
  }
}

@media (max-width: 480px) {
  .top100-header h2 {
    font-size: 18px;
  }
  
  .rank-item {
    padding: 6px 10px;
    font-size: 14px;
  }
  
  .rank-number {
    width: 30px;
  }
  
  .rank-name {
    margin: 0 5px;
  }
  
  .rank-score {
    min-width: 80px;
  }
}

#mobilePage {
  width: 100%;
  height: 100vh;
  overflow-y: auto;
  background: rgba(15, 15, 15, 0.95);
  color: rgb(18, 194, 103);
  padding: 15px;
  box-sizing: border-box;
}


/* === Grades animés (fiabilisation) === */
#grade { text-align: center; margin: 8px 0 12px; }
#grade .grade-title { font-size: 1.6em; font-weight: 800; letter-spacing: 0.5px; }
#grade .grade-time { font-size: 0.9em; opacity: 0.9; margin-top: 4px; }

/* Débutant: flammes qui scintillent (orange/rouge) */
.grade-debutant {
  color: #ff7a00;
  text-shadow: 0 0 6px rgba(255, 122, 0, 0.7), 0 0 12px rgba(255, 0, 0, 0.4);
  animation: flameFlicker 1.2s ease-in-out infinite alternate;
}
@keyframes flameFlicker {
  0% { text-shadow: 0 0 4px rgba(255,122,0,0.5), 0 0 8px rgba(255,0,0,0.3); transform: translateY(0); }
  50% { text-shadow: 0 0 8px rgba(255,160,0,0.8), 0 0 16px rgba(255,40,0,0.5); }
  100% { text-shadow: 0 0 12px rgba(255,200,0,1), 0 0 20px rgba(255,60,0,0.7); transform: translateY(-0.5px); }
}

/* Fumeur Amateur: électrique cyan/bleu avec tremblement */
.grade-amateur {
  color: #00e5ff;
  text-shadow: 0 0 6px rgba(0,229,255,0.8), 0 0 14px rgba(0,128,255,0.6);
  animation: electricGlow 1.4s ease-in-out infinite, electricShake 2.2s linear infinite;
}
@keyframes electricGlow {
  0%, 100% { text-shadow: 0 0 6px rgba(0,229,255,0.8), 0 0 14px rgba(0,128,255,0.6); }
  50% { text-shadow: 0 0 10px rgba(0,255,255,1), 0 0 20px rgba(0,180,255,0.8); }
}
@keyframes electricShake {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(0.6px, -0.6px) rotate(-0.15deg); }
  50% { transform: translate(-0.6px, 0.6px) rotate(0.15deg); }
  75% { transform: translate(0.5px, 0.5px) rotate(-0.1deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

/* Pro du Joint: givre bleu glacé avec pulse */
.grade-pro {
  color: #80d8ff;
  text-shadow: 0 0 6px rgba(128,216,255,0.8), 0 0 14px rgba(176,224,255,0.6);
  animation: icePulse 1.8s ease-in-out infinite;
}
@keyframes icePulse {
  0%, 100% { text-shadow: 0 0 6px rgba(128,216,255,0.8), 0 0 14px rgba(176,224,255,0.6); }
  50% { text-shadow: 0 0 12px rgba(176,224,255,1), 0 0 22px rgba(220,240,255,0.9); }
}

/* Maître du Bong: aura sombre noir/violet */
.grade-maitre {
  color: #b388ff;
  text-shadow: 0 0 8px rgba(179,136,255,0.9), 0 0 18px rgba(102,51,153,0.8), 0 0 28px rgba(0,0,0,0.9);
  animation: darkAura 2.2s ease-in-out infinite;
}
@keyframes darkAura {
  0% { text-shadow: 0 0 6px rgba(179,136,255,0.7), 0 0 14px rgba(102,51,153,0.6), 0 0 24px rgba(0,0,0,0.7); }
  50% { text-shadow: 0 0 12px rgba(200,160,255,1), 0 0 24px rgba(128,64,192,1), 0 0 36px rgba(0,0,0,1); }
  100% { text-shadow: 0 0 8px rgba(179,136,255,0.85), 0 0 18px rgba(102,51,153,0.8), 0 0 28px rgba(0,0,0,0.9); }
}

/* Légende Verte: lumière sacrée verte qui pulse */
.grade-legende {
  color: #69f0ae;
  text-shadow: 0 0 8px rgba(105,240,174,0.9), 0 0 18px rgba(0,200,83,0.8), 0 0 28px rgba(0,255,0,0.6);
  animation: holyPulse 1.8s ease-in-out infinite;
}
@keyframes holyPulse {
  0%, 100% { text-shadow: 0 0 8px rgba(105,240,174,0.9), 0 0 18px rgba(0,200,83,0.8), 0 0 28px rgba(0,255,0,0.6); }
  50% { text-shadow: 0 0 14px rgba(129,255,197,1), 0 0 28px rgba(0,230,120,1), 0 0 40px rgba(0,255,100,0.9); }
}

.discord-content {
  padding: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
}
.discord-content iframe {
  width: 100%;
  max-width: 350px;
  height: 500px;
  border: none;
  border-radius: 8px;
}
#discord-container {
  width: 100%;
  margin: 20px auto 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.9));
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.7), 0 0 20px rgba(76, 175, 80, 0.3);
  overflow: hidden;
  position: relative;
  z-index: 10;
  border: 1px solid rgba(76, 175, 80, 0.3);
}
.top100-header {
  background: linear-gradient(45deg, #4CAF50, #2E7D32);
  padding: 18px 15px;
  text-align: center;
  position: relative;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.top100-header h2 {
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  font-size: 22px;
  margin: 0 0 10px 0;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.username-container {
  display: flex;
  justify-content: center;
  margin-top: 10px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 10px;
}

#add-username-button {
  padding: 12px 20px;
  border-radius: 25px;
  border: none;
  background: linear-gradient(45deg, #ffcc00, #ff9900);
  color: #333;
  font-weight: bold;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}

#add-username-button:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: 0.5s;
}

#add-username-button:hover {
  background: linear-gradient(45deg, #ffd700, #ffaa00);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

#add-username-button:hover:before {
  left: 100%;
}

.soon-message {
  font-size: 36px !important;
  font-weight: bold !important;
  color: #4CAF50 !important;
  text-align: center !important;
  padding: 30px !important;
  text-shadow: 0 2px 5px rgba(0,0,0,0.2) !important;
  letter-spacing: 3px !important;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 0.7; transform: scale(1); }
}

.player-stats-container {
  background: rgba(0, 0, 0, 0.5);
  padding: 15px;
  margin: 0;
  border-top: 1px solid rgba(76, 175, 80, 0.3);
  border-bottom: 1px solid rgba(76, 175, 80, 0.3);
  color: white;
  text-align: center;
  display: none;
}

.player-stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(76, 175, 80, 0.3);
  padding-bottom: 10px;
}

.player-stats-header h3 {
  margin: 0;
  font-size: 20px;
  color: #ffcc00;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.close-stats {
  font-size: 24px;
  cursor: pointer;
  color: #ff4444;
  transition: all 0.2s ease;
}

.close-stats:hover {
  transform: scale(1.2);
}

.player-stats-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
}

.stat-item {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 10px;
  width: calc(33.33% - 15px);
  min-width: 120px;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  border: 1px solid rgba(76, 175, 80, 0.2);
}

.stat-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  background: rgba(0, 0, 0, 0.5);
}

.stat-icon {
  font-size: 24px;
  margin-right: 10px;
  width: 30px;
  text-align: center;
}

.stat-info {
  flex-grow: 1;
  text-align: left;
}

.stat-label {
  font-size: 12px;
  color: #aaa;
}

.stat-value {
  font-size: 16px;
  font-weight: bold;
  color: #fff;
}

.player-not-found {
  padding: 20px;
  color: #ff4444;
  font-size: 16px;
}

.rank-item {
  cursor: pointer;
}

.rank-item.highlighted {
  background: rgba(255, 204, 0, 0.3);
  transform: scale(1.02);
  box-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}

.rank-number {
  display: inline-block;
  width: 40px;
  font-weight: bold;
  color: #ffcc00;
}

.rank-name {
  display: inline-block;
  margin: 0 10px;
  font-weight: bold;
}

.rank-score {
  float: right;
  color: #4CAF50;
}

.current-player {
  background: linear-gradient(to right, rgba(255, 204, 0, 0.2), rgba(255, 204, 0, 0.05));
  border-left: 3px solid #ffcc00;
}

.top100-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 15px;
  max-height: 350px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #4CAF50 rgba(0, 0, 0, 0.2);
}

.top100-content::-webkit-scrollbar {
  width: 8px;
}

.top100-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.top100-content::-webkit-scrollbar-thumb {
  background-color: #4CAF50;
  border-radius: 10px;
}

.rank-item {
  background: rgba(0, 0, 0, 0.3);
  border-left: 3px solid #4CAF50;
  border-radius: 5px;
  padding: 10px 15px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
}

.rank-item:hover {
  background: rgba(0, 0, 0, 0.5);
  transform: translateX(5px);
}

.rank-number {
  display: inline-block;
  width: 40px;
  font-weight: bold;
  color: #ffcc00;
}

.rank-name {
  display: inline-block;
  margin: 0 10px;
  font-weight: bold;
  flex-grow: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-score {
  color: #4CAF50;
  font-weight: bold;
  text-align: right;
  min-width: 100px;
}

.current-player {
  background: linear-gradient(to right, rgba(255, 204, 0, 0.2), rgba(255, 204, 0, 0.05));
  border-left: 3px solid #ffcc00;
}

/* Responsive styles */
@media (max-width: 768px) {
  #top100-container {
    width: 100%;
    margin: 15px auto 0;
  }
  
  .top100-header h2 {
    font-size: 20px;
  }
  
  .top100-content {
    max-height: 300px;
    padding: 10px;
  }
  
  .rank-item {
    padding: 8px 12px;
  }
}

@media (max-width: 480px) {
  .top100-header h2 {
    font-size: 18px;
  }
  
  .rank-item {
    padding: 6px 10px;
    font-size: 14px;
  }
  
  .rank-number {
    width: 30px;
  }
  
  .rank-name {
    margin: 0 5px;
  }
  
  .rank-score {
    min-width: 80px;
  }
}

#mobilePage {
  width: 100%;
  height: 100vh;
  overflow-y: auto;
  background: rgba(15, 15, 15, 0.95);
  color: rgb(18, 194, 103);
  padding: 15px;
  box-sizing: border-box;
}


/* === Grades animés (fiabilisation) === */
#grade { text-align: center; margin: 8px 0 12px; }
#grade .grade-title { font-size: 1.6em; font-weight: 800; letter-spacing: 0.5px; }
#grade .grade-time { font-size: 0.9em; opacity: 0.9; margin-top: 4px; }

/* Débutant: flammes qui scintillent (orange/rouge) */
.grade-debutant {
  color: #ff7a00;
  text-shadow: 0 0 6px rgba(255, 122, 0, 0.7), 0 0 12px rgba(255, 0, 0, 0.4);
  animation: flameFlicker 1.2s ease-in-out infinite alternate;
}
@keyframes flameFlicker {
  0% { text-shadow: 0 0 4px rgba(255,122,0,0.5), 0 0 8px rgba(255,0,0,0.3); transform: translateY(0); }
  50% { text-shadow: 0 0 8px rgba(255,160,0,0.8), 0 0 16px rgba(255,40,0,0.5); }
  100% { text-shadow: 0 0 12px rgba(255,200,0,1), 0 0 20px rgba(255,60,0,0.7); transform: translateY(-0.5px); }
}

/* Fumeur Amateur: électrique cyan/bleu avec tremblement */
.grade-amateur {
  color: #00e5ff;
  text-shadow: 0 0 6px rgba(0,229,255,0.8), 0 0 14px rgba(0,128,255,0.6);
  animation: electricGlow 1.4s ease-in-out infinite, electricShake 2.2s linear infinite;
}
@keyframes electricGlow {
  0%, 100% { text-shadow: 0 0 6px rgba(0,229,255,0.8), 0 0 14px rgba(0,128,255,0.6); }
  50% { text-shadow: 0 0 10px rgba(0,255,255,1), 0 0 20px rgba(0,180,255,0.8); }
}
@keyframes electricShake {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(0.6px, -0.6px) rotate(-0.15deg); }
  50% { transform: translate(-0.6px, 0.6px) rotate(0.15deg); }
  75% { transform: translate(0.5px, 0.5px) rotate(-0.1deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

/* Pro du Joint: givre bleu glacé avec pulse */
.grade-pro {
  color: #80d8ff;
  text-shadow: 0 0 6px rgba(128,216,255,0.8), 0 0 14px rgba(176,224,255,0.6);
  animation: icePulse 1.8s ease-in-out infinite;
}
@keyframes icePulse {
  0%, 100% { text-shadow: 0 0 6px rgba(128,216,255,0.8), 0 0 14px rgba(176,224,255,0.6); }
  50% { text-shadow: 0 0 12px rgba(176,224,255,1), 0 0 22px rgba(220,240,255,0.9); }
}

/* Maître du Bong: aura sombre noir/violet */
.grade-maitre {
  color: #b388ff;
  text-shadow: 0 0 8px rgba(179,136,255,0.9), 0 0 18px rgba(102,51,153,0.8), 0 0 28px rgba(0,0,0,0.9);
  animation: darkAura 2.2s ease-in-out infinite;
}
@keyframes darkAura {
  0% { text-shadow: 0 0 6px rgba(179,136,255,0.7), 0 0 14px rgba(102,51,153,0.6), 0 0 24px rgba(0,0,0,0.7); }
  50% { text-shadow: 0 0 12px rgba(200,160,255,1), 0 0 24px rgba(128,64,192,1), 0 0 36px rgba(0,0,0,1); }
  100% { text-shadow: 0 0 8px rgba(179,136,255,0.85), 0 0 18px rgba(102,51,153,0.8), 0 0 28px rgba(0,0,0,0.9); }
}

/* Légende Verte: lumière sacrée verte qui pulse */
.grade-legende {
  color: #69f0ae;
  text-shadow: 0 0 8px rgba(105,240,174,0.9), 0 0 18px rgba(0,200,83,0.8), 0 0 28px rgba(0,255,0,0.6);
  animation: holyPulse 1.8s ease-in-out infinite;
}
@keyframes holyPulse {
  0%, 100% { text-shadow: 0 0 8px rgba(105,240,174,0.9), 0 0 18px rgba(0,200,83,0.8), 0 0 28px rgba(0,255,0,0.6); }
  50% { text-shadow: 0 0 14px rgba(129,255,197,1), 0 0 28px rgba(0,230,120,1), 0 0 40px rgba(0,255,100,0.9); }
}

.discord-content {
  padding: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
}
.discord-content iframe {
  width: 100%;
  max-width: 350px;
  height: 500px;
  border: none;
  border-radius: 8px;
}
@media (max-width: 768px) {
  #discord-container {
    width: 100%;
    margin: 15px auto 0;
  }
  .discord-content iframe { height: 420px; max-width: 100%; }
}
@media (max-width: 480px) {
  .discord-content iframe { height: 360px; }
}

