/* Reset de base */
html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  width: 100%;
  height: 100%;
}

body {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  background: #fff;
}

/* ===== STYLES CRITIQUES POUR LE LOADER (chargés en premier) ===== */
.app-loading-indicator {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: #ffffff !important;
  z-index: 999999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-direction: column !important;
}

.app-loading-indicator .loader {
  width: 60px !important;
  height: 60px !important;
  border: 4px solid #f3f3f3 !important;
  border-top: 4px solid #667eea !important;
  border-radius: 50% !important;
  animation: spin 0.8s linear infinite !important;
}

.app-loading-indicator p {
  margin-top: 20px !important;
  color: #667eea !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  font-family: 'Poppins', sans-serif !important;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}



@media (max-width: 600px) {
  .app-loading-indicator {
    background: #f8f9fa !important;
  }
  
  .app-loading-indicator .loader {
    width: 50px !important;
    height: 50px !important;
    border-width: 3px !important;
  }
  
  .app-loading-indicator p {
    font-size: 14px !important;
  }
}

/* ===== PERMIS DUELS PLUGIN STYLES ===== */

/* ===== Conteneur principal ===== */
.sg-wrapper {
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
  padding-bottom: 0;
  padding-top: 0;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media (max-width: 600px) {
  .sg-instructions { font-size: 14px; }
  .sg-nav-button { padding: 10px 15px; font-size: 14px; }
  .sg-card-front, .sg-card-back {
    padding: 15px;
    font-size: 14px;
  }
  /* Ajustement de l'effet glassmorphism sur mobile */
  .sg-card-front::before {
    backdrop-filter: blur(6px) contrast(0.9);
    -webkit-backdrop-filter: blur(6px) contrast(0.9);
  }
  .sg-card-front img {
    max-width: 150px; /* Plus petit sur mobile */
  }
  .cours-header { font-size: 20px; }
  .video-title { font-size: 14px; }
  /* Wrapper plein écran, sans padding inutile */
  .sg-wrapper {
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    padding-top: 0;
    height: 100vh; /* Hauteur fixe sur mobile */
    height: 100dvh; /* Dynamic viewport height pour mobile */
    min-height: -webkit-fill-available; /* Pour Safari iOS */
  }
  /* Conteneur pleine largeur, sans bordure multicolore */
  .sg-container {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: #fff !important;
    background-image: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    animation: none !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important; /* Prend toute la hauteur du wrapper */
    overflow: visible !important; /* Permet au dropdown de sortir */
  }
}

.sg-container {
  margin: 0 auto;
  background: #fff;
  padding: 0; /* Reset padding pour la nouvelle structure */
  border-radius: 12px;
  border: 4px solid transparent;
  background-image:
    linear-gradient(white, white),
    linear-gradient(98deg, #ff9800 5%, #f96031 22%, #cc2cf4 44%, #704ee8 73%, #170e44 99%);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 6px 25px rgba(0,0,0,0.15);
  max-width: 600px;
  width: 100%;
  text-align: center;
  position: relative;
  overflow: visible; /* Changé pour permettre au dropdown de sortir */
  flex: 1;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

@media (min-width: 600px) {
  .sg-container {
    animation: none; /* Suppression de l'animation rotateBorder qui causait des problèmes */
    height: 95vh; /* Hauteur fixe sur PC pour éviter le petit scroll */
    overflow: hidden; /* Empêcher le scroll sur le conteneur */
  }
}

/* Suppression de l'animation qui causait des problèmes */
/*
@keyframes rotateBorder {
  0% {
    background-image:
      linear-gradient(white, white),
      linear-gradient(98deg, #ff9800 5%, #f96031 22%, #cc2cf4 44%, #704ee8 73%, #170e44 99%);
  }
  100% {
    background-image:
      linear-gradient(white, white),
      linear-gradient(458deg, #ff9800 5%, #f96031 22%, #cc2cf4 44%, #704ee8 73%, #170e44 99%);
  }
}
*/

/* Ajuster le padding quand le clavier est ouvert */
body.keyboard-open .sg-container {
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

/* ===== BARRE D'AUTHENTIFICATION MODERNE (FULL WIDTH, FIXED, GLASS) ===== */
.auth-bar {
  position: fixed; /* Changé de relative à fixed pour PC */
  top: 0; left: 0; right: 0;
  width: 100%;
  max-width: 100%;
  /* Fond bleu foncé cohérent avec le thème */
  background: #100f5b;
  /* Suppression du backdrop-filter pour un fond opaque */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  /* Suppression de toutes les bordures */
  border: none;
  box-shadow: none;
  z-index: 2000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  /* animation: slideDownFade 0.4s; */ /* Désactivé pour stabilité au chargement */
  margin: 0;
  border-radius: 0; /* Suppression des arrondis */
  padding-top: calc(8px + env(safe-area-inset-top));
  box-sizing: border-box;
  flex-shrink: 0; /* Empêcher la barre de rétrécir */
  overflow: visible; /* Pour permettre au dropdown de sortir */
}

/* Sur mobile, la barre reste relative dans le flow */
@media (max-width: 600px) {
  .auth-bar {
    position: relative;
  }
}

@keyframes slideDownFade {
  from { opacity: 0; transform: translateY(-24px);}
  to { opacity: 1; transform: translateY(0);}
}
.auth-info {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: visible; /* Pour que le dropdown puisse sortir */
  z-index: 9996; /* Pour assurer la priorité du dropdown */
  height: 38px; /* Hauteur fixe pour éviter tout décalage */
  position: relative;
}
.auth-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}
.auth-avatar-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(102,126,234,0.2);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
  outline: none;
  overflow: hidden;
  position: relative;
}
.auth-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1em;
  overflow: hidden;
  line-height: 1;
  cursor: pointer;
}
.auth-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  display: block;
}
.auth-avatar-wrapper:hover {
  background: rgba(102,126,234,0.1);
  border-color: rgba(102,126,234,0.3);
  box-shadow: 0 2px 8px rgba(102,126,234,0.15);
  transform: scale(1.05);
}
.auth-avatar-dropdown {
  position: absolute;
  min-width: 160px;
  right: 10px;
  top: 60px;
  /* Style harmonisé avec liquidglass */
  background: 
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.1) 0%,
      rgba(255, 255, 255, 0.15) 100%
    );
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  border-radius: 20px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.04),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.45);
  padding: 10px 0;
  z-index: 10000; /* Augmenté pour cohérence */
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  /* animation: fadeInScale 0.25s; */ /* Désactivé pour stabilité au chargement */
}
.auth-avatar-dropdown button {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  width: 100%;
  text-align: left;
  padding: 10px 18px;
  font-size: 15px;
  color: #296cd1;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
}
.auth-avatar-dropdown button:hover {
  background: rgba(41, 108, 209, 0.15);
  color: #296cd1;
  transform: translateX(4px);
}
@media (max-width: 600px) {
  .auth-bar {
    padding: 6px 12px;
    font-size: 14px;
    height: 50px;
    border-radius: 0; /* Pas d'arrondi sur mobile pour plein écran */
    /* Maintien de l'effet liquidglass sur mobile */
    background: 
      linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.15) 100%
      );
    backdrop-filter: blur(20px) saturate(120%);
    -webkit-backdrop-filter: blur(20px) saturate(120%);
    border-bottom: none; /* Fusion avec tab-menu */
  }
  
  .auth-info {
    min-width: auto; /* Pas de largeur minimum sur mobile */
    height: auto; /* Hauteur flexible sur mobile */
  }
  .tab-menu-container {
    top: 0 !important; /* Plus besoin de calcul car relative */
    position: relative !important;
  }
  .auth-avatar {
    width: 32px;
    height: 32px;
    font-size: 1.2em;
  }
  .auth-avatar-dropdown {
    min-width: 120px;
    right: 2px;
    top: 48px;
    font-size: 13px;
  }
  .auth-avatar-dropdown button {
    font-size: 13px;
    padding: 8px 12px;
  }
}

.sync-status {
  font-size: 10px;
  opacity: 0.8;
}

.sync-status.syncing {
  animation: pulse 1s infinite;
}

/* ===== Sélecteur de catégorie moderne avec dropdown custom ===== */
.category-dropdown {
  display: inline-block; /* inline-block au lieu de flex pour éviter les problèmes de largeur */
  position: relative;
  z-index: 99998; /* Force le contexte au-dessus du menu */
  width: 220px; /* Largeur fixe dès le départ */
  opacity: 1;
}

/* Pas d'animation au premier affichage pour éviter les décalages */

/* État normal du dropdown */
.category-dropdown {
  position: relative;
  visibility: visible;
  opacity: 1;
}

/* État caché - vraiment caché pour ne pas prendre de place */
.category-dropdown.hidden,
#examProgress.hidden,
#chatInput.hidden,
#parcoursStats.hidden {
  display: none !important;
}

/* Select wrapper pour le custom dropdown */
.select-wrapper {
  position: relative;
  display: block; /* block pour prendre toute la largeur du parent */
  width: 100%; /* Prendre toute la largeur du parent */
  overflow: visible; /* Pour que le dropdown puisse sortir du conteneur */
  z-index: 99997; /* Force le wrapper au-dessus du menu */
}

@keyframes fadeInScale {
  from { 
    opacity: 0; 
    transform: translateY(-10px) scale(0.95);
  }
  to { 
    opacity: 1; 
    transform: translateY(0) scale(1);
  }
}

#categorySelect {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  /* Style harmonisé avec liquidglass */
  background-color: rgba(255, 255, 255, 0.9);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg width='14' height='8' viewBox='0 0 14 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M1 1L7 7L13 1' stroke='%23296cd1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  border: 1px solid rgba(41, 108, 209, 0.2);
  border-radius: 20px;
  padding: 8px 45px 8px 16px; /* Plus d'espace à droite pour la flèche */
  font-size: 14px;
  font-weight: 600;
  color: #296cd1;
  cursor: pointer;
  /* Transition seulement sur les propriétés qui doivent être animées */
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
  position: relative;
  width: 100%; /* Prendre toute la largeur du wrapper */
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  white-space: nowrap; /* Empêcher le retour à la ligne */
  text-overflow: ellipsis; /* Points de suspension si trop long */
  overflow: hidden; /* Cacher le débordement */
}

#categorySelect:hover {
  background-color: rgba(41, 108, 209, 0.1);
  color: #296cd1; /* Garde le texte bleu pour la visibilité */
  border-color: #296cd1;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(41, 108, 209, 0.15);
}

#categorySelect:focus {
  outline: none;
  border-color: #296cd1;
  background-color: rgba(41, 108, 209, 0.08);
  color: #296cd1; /* Texte bleu pour la visibilité */
  box-shadow: 0 0 0 3px rgba(41, 108, 209, 0.1), 0 4px 16px rgba(41, 108, 209, 0.15);
}

/* Custom dropdown container (pour simuler l'effet glassmorphisme) */
.custom-dropdown {
  position: absolute; /* Comme le menu avatar */
  /* Effet liquidglass moderne */
  background: 
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.1) 0%,
      rgba(255, 255, 255, 0.15) 100%
    );
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.06),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.45);
  padding: 8px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 10000; /* Au-dessus de tout comme l'autre dropdown */
  min-width: 180px;
  /* animation: fadeInScale 0.25s; */ /* Désactivé pour stabilité au chargement */
}

/* Style du select quand le dropdown est ouvert */
.category-dropdown.open #categorySelect {
  background-color: rgba(41, 108, 209, 0.1);
  color: #296cd1;
  border-color: #296cd1;
  box-shadow: 0 0 0 3px rgba(41, 108, 209, 0.1), 0 4px 16px rgba(41, 108, 209, 0.15);
}

/* Options du dropdown custom */
.custom-option {
  padding: 10px 16px;
  margin: 2px 0;
  border-radius: 12px;
  color: #296cd1;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.1);
}

.custom-option:hover {
  background: rgba(41, 108, 209, 0.15);
  transform: translateX(4px);
  color: #296cd1;
}

.custom-option.selected {
  background: radial-gradient(circle at bottom left, #296cd1 17%, #100f5b 81%);
  color: white;
  font-weight: 600;
}

/* Scrollbar personnalisée pour le dropdown */
.custom-dropdown::-webkit-scrollbar {
  width: 6px;
}

.custom-dropdown::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.custom-dropdown::-webkit-scrollbar-thumb {
  background: rgba(41, 108, 209, 0.3);
  border-radius: 3px;
  transition: background 0.2s;
}

.custom-dropdown::-webkit-scrollbar-thumb:hover {
  background: rgba(41, 108, 209, 0.5);
}

/* Style natif des options (fallback) */
#categorySelect option {
  background: white;
  color: #296cd1;
  padding: 8px;
  font-weight: 500;
}

/* Animation au changement */
#categorySelect:active {
  transform: translateY(0) scale(0.98);
  color: #296cd1; /* Garde le texte bleu */
  background-color: rgba(41, 108, 209, 0.08);
}

@media (max-width: 600px) {
  .category-dropdown {
    width: 160px; /* Largeur fixe sur mobile */
  }
  
  .select-wrapper {
    width: 100%; /* Prendre toute la largeur du parent */
  }
  
  #categorySelect {
    width: 100%; /* Prendre toute la largeur du wrapper */
    font-size: 13px;
    padding: 6px 38px 6px 12px; /* Plus d'espace pour la flèche */
  }
  
  .custom-dropdown {
    max-height: 250px;
  }
  
  .custom-option {
    font-size: 13px;
    padding: 8px 12px;
  }
}

/* ===== Barre de stats du parcours ===== */
.parcours-stats {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.parcours-stats .stats-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 8px 16px;
  border: 1px solid rgba(41, 108, 209, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.parcours-stats .stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #296cd1;
  white-space: nowrap;
}

.parcours-stats .stat-item i {
  font-size: 16px;
  color: #667eea;
}

/* Icône spéciale pour le streak */
.parcours-stats .stat-item .fa-fire {
  color: #ff6b6b;
}

/* Icône spéciale pour les pièces */
.parcours-stats .stat-item .fa-coins {
  color: #ffd93d;
}

@media (max-width: 600px) {
  .parcours-stats {
    margin-left: 10px;
  }
  
  .parcours-stats .stats-wrapper {
    gap: 8px;
    padding: 6px 12px;
  }
  
  .parcours-stats .stat-item {
    font-size: 12px;
    gap: 4px;
  }
  
  .parcours-stats .stat-item i {
    font-size: 14px;
  }
}

/* ===== Modales d'authentification ===== */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.auth-modal.show {
  display: flex;
}

.auth-modal-content {
  background: white;
  padding: 30px;
  border-radius: 16px;
  width: 90%;
  max-width: 460px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  position: relative;
}

.auth-modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
}

.auth-modal h3 {
  margin: 0 0 20px 0;
  color: #333;
  text-align: center;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.auth-input {
  padding: 12px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.auth-input:focus {
  outline: none;
  border-color: #667eea;
}

.auth-submit {
  background: radial-gradient(circle at bottom left, #296cd1 17%, #100f5b 81%);
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(41, 108, 209, 0.4);
  transition: all 0.3s;
  width: 100%;
}

.auth-submit:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 6px 30px rgba(41, 108, 209, 0.5);
}

.auth-submit:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-switch {
  text-align: center;
  margin-top: 15px;
  color: #666;
  font-size: 13px;
}

.auth-switch a {
  color: #667eea;
  text-decoration: none;
  cursor: pointer;
}

.auth-error {
  background: #ffe6e6;
  color: #d63031;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 15px;
  display: none;
}

.auth-success {
  background: #e6f7e6;
  color: #00b894;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 15px;
  display: none;
}

/* ===== Onglets scrollables + fade conditionnel ===== */
/* Reset de base */
html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  width: 100%;
  height: 100%;
}

body {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  background: #fff;
}

/* ===== STYLES CRITIQUES POUR LE LOADER (chargés en premier) ===== */
.app-loading-indicator {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: #ffffff !important;
  z-index: 999999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-direction: column !important;
}

.app-loading-indicator .loader {
  width: 60px !important;
  height: 60px !important;
  border: 4px solid #f3f3f3 !important;
  border-top: 4px solid #667eea !important;
  border-radius: 50% !important;
  animation: spin 0.8s linear infinite !important;
}

.app-loading-indicator p {
  margin-top: 20px !important;
  color: #667eea !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  font-family: 'Poppins', sans-serif !important;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}



@media (max-width: 600px) {
  .app-loading-indicator {
    background: #f8f9fa !important;
  }
  
  .app-loading-indicator .loader {
    width: 50px !important;
    height: 50px !important;
    border-width: 3px !important;
  }
  
  .app-loading-indicator p {
    font-size: 14px !important;
  }
}

/* ===== PERMIS DUELS PLUGIN STYLES ===== */

/* ===== Conteneur principal ===== */
.sg-wrapper {
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
  padding-bottom: 0;
  padding-top: 0;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media (max-width: 600px) {
  .sg-instructions { font-size: 14px; }
  .sg-nav-button { padding: 10px 15px; font-size: 14px; }
  .sg-card-front, .sg-card-back {
    padding: 15px;
    font-size: 14px;
  }
  /* Ajustement de l'effet glassmorphism sur mobile */
  .sg-card-front::before {
    backdrop-filter: blur(6px) contrast(0.9);
    -webkit-backdrop-filter: blur(6px) contrast(0.9);
  }
  .sg-card-front img {
    max-width: 150px; /* Plus petit sur mobile */
  }
  .cours-header { font-size: 20px; }
  .video-title { font-size: 14px; }
  /* Wrapper plein écran, sans padding inutile */
  .sg-wrapper {
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    padding-top: 0;
    height: 100vh; /* Hauteur fixe sur mobile */
    height: 100dvh; /* Dynamic viewport height pour mobile */
    min-height: -webkit-fill-available; /* Pour Safari iOS */
  }
  /* Conteneur pleine largeur, sans bordure multicolore */
  .sg-container {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: #fff !important;
    background-image: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    animation: none !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important; /* Prend toute la hauteur du wrapper */
    overflow: visible !important; /* Permet au dropdown de sortir */
  }
}

.sg-container {
  margin: 0 auto;
  background: #fff;
  padding: 0; /* Reset padding pour la nouvelle structure */
  border-radius: 12px;
  border: 4px solid transparent;
  background-image:
    linear-gradient(white, white),
    linear-gradient(98deg, #ff9800 5%, #f96031 22%, #cc2cf4 44%, #704ee8 73%, #170e44 99%);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 6px 25px rgba(0,0,0,0.15);
  max-width: 600px;
  width: 100%;
  text-align: center;
  position: relative;
  overflow: visible; /* Changé pour permettre au dropdown de sortir */
  flex: 1;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

@media (min-width: 600px) {
  .sg-container {
    animation: none; /* Suppression de l'animation rotateBorder qui causait des problèmes */
    height: 95vh; /* Hauteur fixe sur PC pour éviter le petit scroll */
    overflow: hidden; /* Empêcher le scroll sur le conteneur */
  }
}

/* Suppression de l'animation qui causait des problèmes */
/*
@keyframes rotateBorder {
  0% {
    background-image:
      linear-gradient(white, white),
      linear-gradient(98deg, #ff9800 5%, #f96031 22%, #cc2cf4 44%, #704ee8 73%, #170e44 99%);
  }
  100% {
    background-image:
      linear-gradient(white, white),
      linear-gradient(458deg, #ff9800 5%, #f96031 22%, #cc2cf4 44%, #704ee8 73%, #170e44 99%);
  }
}
*/

/* Ajuster le padding quand le clavier est ouvert */
body.keyboard-open .sg-container {
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

/* ===== BARRE D'AUTHENTIFICATION MODERNE (FULL WIDTH, FIXED, GLASS) ===== */
.auth-bar {
  position: fixed; /* Changé de relative à fixed pour PC */
  top: 0; left: 0; right: 0;
  width: 100%;
  max-width: 100%;
  /* Fond bleu foncé cohérent avec le thème */
  background: #100f5b;
  /* Suppression du backdrop-filter pour un fond opaque */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  /* Suppression de toutes les bordures */
  border: none;
  box-shadow: none;
  z-index: 2000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  /* animation: slideDownFade 0.4s; */ /* Désactivé pour stabilité au chargement */
  margin: 0;
  border-radius: 0; /* Suppression des arrondis */
  padding-top: calc(8px + env(safe-area-inset-top));
  box-sizing: border-box;
  flex-shrink: 0; /* Empêcher la barre de rétrécir */
  overflow: visible; /* Pour permettre au dropdown de sortir */
}

/* Sur mobile, la barre reste relative dans le flow */
@media (max-width: 600px) {
  .auth-bar {
    position: relative;
  }
}

@keyframes slideDownFade {
  from { opacity: 0; transform: translateY(-24px);}
  to { opacity: 1; transform: translateY(0);}
}
.auth-info {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: visible; /* Pour que le dropdown puisse sortir */
  z-index: 9996; /* Pour assurer la priorité du dropdown */
  height: 38px; /* Hauteur fixe pour éviter tout décalage */
  position: relative;
}
.auth-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}
.auth-avatar-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(102,126,234,0.2);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
  outline: none;
  overflow: hidden;
  position: relative;
}
.auth-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1em;
  overflow: hidden;
  line-height: 1;
  cursor: pointer;
}
.auth-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  display: block;
}
.auth-avatar-wrapper:hover {
  background: rgba(102,126,234,0.1);
  border-color: rgba(102,126,234,0.3);
  box-shadow: 0 2px 8px rgba(102,126,234,0.15);
  transform: scale(1.05);
}
.auth-avatar-dropdown {
  position: absolute;
  min-width: 160px;
  right: 10px;
  top: 60px;
  /* Style harmonisé avec liquidglass */
  background: 
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.1) 0%,
      rgba(255, 255, 255, 0.15) 100%
    );
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  border-radius: 20px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.04),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.45);
  padding: 10px 0;
  z-index: 10000; /* Augmenté pour cohérence */
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  /* animation: fadeInScale 0.25s; */ /* Désactivé pour stabilité au chargement */
}
.auth-avatar-dropdown button {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  width: 100%;
  text-align: left;
  padding: 10px 18px;
  font-size: 15px;
  color: #296cd1;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
}
.auth-avatar-dropdown button:hover {
  background: rgba(41, 108, 209, 0.15);
  color: #296cd1;
  transform: translateX(4px);
}
@media (max-width: 600px) {
  .auth-bar {
    padding: 6px 12px;
    font-size: 14px;
    height: 50px;
    border-radius: 0; /* Pas d'arrondi sur mobile pour plein écran */
    /* Maintien de l'effet liquidglass sur mobile */
    background: 
      linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.15) 100%
      );
    backdrop-filter: blur(20px) saturate(120%);
    -webkit-backdrop-filter: blur(20px) saturate(120%);
    border-bottom: none; /* Fusion avec tab-menu */
  }
  
  .auth-info {
    min-width: auto; /* Pas de largeur minimum sur mobile */
    height: auto; /* Hauteur flexible sur mobile */
  }
  .tab-menu-container {
    top: 0 !important; /* Plus besoin de calcul car relative */
    position: relative !important;
  }
  .auth-avatar {
    width: 32px;
    height: 32px;
    font-size: 1.2em;
  }
  .auth-avatar-dropdown {
    min-width: 120px;
    right: 2px;
    top: 48px;
    font-size: 13px;
  }
  .auth-avatar-dropdown button {
    font-size: 13px;
    padding: 8px 12px;
  }
}

.sync-status {
  font-size: 10px;
  opacity: 0.8;
}

.sync-status.syncing {
  animation: pulse 1s infinite;
}

/* ===== Sélecteur de catégorie moderne avec dropdown custom ===== */
.category-dropdown {
  display: inline-block; /* inline-block au lieu de flex pour éviter les problèmes de largeur */
  position: relative;
  z-index: 99998; /* Force le contexte au-dessus du menu */
  width: 220px; /* Largeur fixe dès le départ */
  opacity: 1;
}

/* Pas d'animation au premier affichage pour éviter les décalages */

/* État normal du dropdown */
.category-dropdown {
  position: relative;
  visibility: visible;
  opacity: 1;
}

/* État caché - vraiment caché pour ne pas prendre de place */
.category-dropdown.hidden,
#examProgress.hidden,
#chatInput.hidden,
#parcoursStats.hidden {
  display: none !important;
}

/* Select wrapper pour le custom dropdown */
.select-wrapper {
  position: relative;
  display: block; /* block pour prendre toute la largeur du parent */
  width: 100%; /* Prendre toute la largeur du parent */
  overflow: visible; /* Pour que le dropdown puisse sortir du conteneur */
  z-index: 99997; /* Force le wrapper au-dessus du menu */
}

@keyframes fadeInScale {
  from { 
    opacity: 0; 
    transform: translateY(-10px) scale(0.95);
  }
  to { 
    opacity: 1; 
    transform: translateY(0) scale(1);
  }
}

#categorySelect {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  /* Style harmonisé avec liquidglass */
  background-color: rgba(255, 255, 255, 0.9);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg width='14' height='8' viewBox='0 0 14 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M1 1L7 7L13 1' stroke='%23296cd1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  border: 1px solid rgba(41, 108, 209, 0.2);
  border-radius: 20px;
  padding: 8px 45px 8px 16px; /* Plus d'espace à droite pour la flèche */
  font-size: 14px;
  font-weight: 600;
  color: #296cd1;
  cursor: pointer;
  /* Transition seulement sur les propriétés qui doivent être animées */
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
  position: relative;
  width: 100%; /* Prendre toute la largeur du wrapper */
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  white-space: nowrap; /* Empêcher le retour à la ligne */
  text-overflow: ellipsis; /* Points de suspension si trop long */
  overflow: hidden; /* Cacher le débordement */
}

#categorySelect:hover {
  background-color: rgba(41, 108, 209, 0.1);
  color: #296cd1; /* Garde le texte bleu pour la visibilité */
  border-color: #296cd1;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(41, 108, 209, 0.15);
}

#categorySelect:focus {
  outline: none;
  border-color: #296cd1;
  background-color: rgba(41, 108, 209, 0.08);
  color: #296cd1; /* Texte bleu pour la visibilité */
  box-shadow: 0 0 0 3px rgba(41, 108, 209, 0.1), 0 4px 16px rgba(41, 108, 209, 0.15);
}

/* Custom dropdown container (pour simuler l'effet glassmorphisme) */
.custom-dropdown {
  position: absolute; /* Comme le menu avatar */
  /* Effet liquidglass moderne */
  background: 
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.1) 0%,
      rgba(255, 255, 255, 0.15) 100%
    );
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.06),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.45);
  padding: 8px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 10000; /* Au-dessus de tout comme l'autre dropdown */
  min-width: 180px;
  /* animation: fadeInScale 0.25s; */ /* Désactivé pour stabilité au chargement */
}

/* Style du select quand le dropdown est ouvert */
.category-dropdown.open #categorySelect {
  background-color: rgba(41, 108, 209, 0.1);
  color: #296cd1;
  border-color: #296cd1;
  box-shadow: 0 0 0 3px rgba(41, 108, 209, 0.1), 0 4px 16px rgba(41, 108, 209, 0.15);
}

/* Options du dropdown custom */
.custom-option {
  padding: 10px 16px;
  margin: 2px 0;
  border-radius: 12px;
  color: #296cd1;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.1);
}

.custom-option:hover {
  background: rgba(41, 108, 209, 0.15);
  transform: translateX(4px);
  color: #296cd1;
}

.custom-option.selected {
  background: radial-gradient(circle at bottom left, #296cd1 17%, #100f5b 81%);
  color: white;
  font-weight: 600;
}

/* Scrollbar personnalisée pour le dropdown */
.custom-dropdown::-webkit-scrollbar {
  width: 6px;
}

.custom-dropdown::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.custom-dropdown::-webkit-scrollbar-thumb {
  background: rgba(41, 108, 209, 0.3);
  border-radius: 3px;
  transition: background 0.2s;
}

.custom-dropdown::-webkit-scrollbar-thumb:hover {
  background: rgba(41, 108, 209, 0.5);
}

/* Style natif des options (fallback) */
#categorySelect option {
  background: white;
  color: #296cd1;
  padding: 8px;
  font-weight: 500;
}

/* Animation au changement */
#categorySelect:active {
  transform: translateY(0) scale(0.98);
  color: #296cd1; /* Garde le texte bleu */
  background-color: rgba(41, 108, 209, 0.08);
}

@media (max-width: 600px) {
  .category-dropdown {
    width: 160px; /* Largeur fixe sur mobile */
  }
  
  .select-wrapper {
    width: 100%; /* Prendre toute la largeur du parent */
  }
  
  #categorySelect {
    width: 100%; /* Prendre toute la largeur du wrapper */
    font-size: 13px;
    padding: 6px 38px 6px 12px; /* Plus d'espace pour la flèche */
  }
  
  .custom-dropdown {
    max-height: 250px;
  }
  
  .custom-option {
    font-size: 13px;
    padding: 8px 12px;
  }
}

/* ===== Barre de stats du parcours ===== */
.parcours-stats {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.parcours-stats .stats-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 8px 16px;
  border: 1px solid rgba(41, 108, 209, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.parcours-stats .stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #296cd1;
  white-space: nowrap;
}

.parcours-stats .stat-item i {
  font-size: 16px;
  color: #667eea;
}

/* Icône spéciale pour le streak */
.parcours-stats .stat-item .fa-fire {
  color: #ff6b6b;
}

/* Icône spéciale pour les pièces */
.parcours-stats .stat-item .fa-coins {
  color: #ffd93d;
}

@media (max-width: 600px) {
  .parcours-stats {
    margin-left: 10px;
  }
  
  .parcours-stats .stats-wrapper {
    gap: 8px;
    padding: 6px 12px;
  }
  
  .parcours-stats .stat-item {
    font-size: 12px;
    gap: 4px;
  }
  
  .parcours-stats .stat-item i {
    font-size: 14px;
  }
}

/* ===== Modales d'authentification ===== */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.auth-modal.show {
  display: flex;
}

.auth-modal-content {
  background: white;
  padding: 30px;
  border-radius: 16px;
  width: 90%;
  max-width: 460px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  position: relative;
}

.auth-modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
}

.auth-modal h3 {
  margin: 0 0 20px 0;
  color: #333;
  text-align: center;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.auth-input {
  padding: 12px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.auth-input:focus {
  outline: none;
  border-color: #667eea;
}

.auth-submit {
  background: radial-gradient(circle at bottom left, #296cd1 17%, #100f5b 81%);
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(41, 108, 209, 0.4);
  transition: all 0.3s;
  width: 100%;
}

.auth-submit:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 6px 30px rgba(41, 108, 209, 0.5);
}

.auth-submit:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-switch {
  text-align: center;
  margin-top: 15px;
  color: #666;
  font-size: 13px;
}

.auth-switch a {
  color: #667eea;
  text-decoration: none;
  cursor: pointer;
}

.auth-error {
  background: #ffe6e6;
  color: #d63031;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 15px;
  display: none;
}

.auth-success {
  background: #e6f7e6;
  color: #00b894;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 15px;
  display: none;
}

/* ===== Onglets scrollables + fade conditionnel ===== */
.tab-menu-container {
  position: fixed; /* Changé de relative à fixed pour PC */
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  /* Même effet liquidglass que auth-bar pour harmonisation */
  background: 
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.1) 0%,
      rgba(255, 255, 255, 0.15) 100%
    );
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  /* Bordure harmonisée */
  border: none;
  box-shadow: 
    /* Continuation de l'effet glass */
    0 8px 32px rgba(0, 0, 0, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.04),
    /* Reflets internes */
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.45);
  z-index: 1500; /* Réduit pour permettre au dropdown de passer au-dessus */
  padding: 8px 15px 6px 15px; /* Réduit le padding du bas */
  box-sizing: border-box;
  overflow: visible;
  flex-shrink: 0; /* Empêcher le menu de rétrécir */
  border-radius: 0; /* Suppression des arrondis */
}

@media (min-width: 600px) {
  .tab-menu-container {
    padding: 10px 20px 8px 20px; /* Réduit le padding du bas */
    top: 0; /* Fusion directe avec auth-bar sur PC */
    /* Maintien du même style liquidglass sur PC */
    background: 
      linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.15) 100%
      );
    backdrop-filter: blur(20px) saturate(120%);
    -webkit-backdrop-filter: blur(20px) saturate(120%);
    border: none;
    box-shadow: 
      0 8px 32px rgba(0, 0, 0, 0.1),
      0 2px 8px rgba(0, 0, 0, 0.04),
      inset 0 1px 1px 0 rgba(255, 255, 255, 0.45);
  }
}

@media (max-width: 600px) {
  .tab-menu-container {
    padding: 6px 10px 4px 10px; /* Réduit le padding du bas */
  }
}

.tab-menu {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  gap: 8px;
  padding: 2px 0; /* Padding pour éviter la coupure du hover */
  scrollbar-width: none;
  cursor: grab;
  margin: 0;
}

.tab-menu::-webkit-scrollbar { display: none; }

.tab-link {
  flex: 0 0 auto;
  scroll-snap-align: start;
  /* Style harmonisé avec liquidglass */
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(41, 108, 209, 0.2);
  outline: none;
  cursor: pointer;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 20px;
  color: #296cd1;
  transition: all 0.3s ease;
  position: relative; /* Pour éviter la coupure */
  z-index: 1;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tab-link:hover:not(.active) {
  background: rgba(41, 108, 209, 0.1);
  border-color: #296cd1;
  /* transform: translateY(-2px); - Supprimé pour éviter le déplacement */
  box-shadow: 0 4px 12px rgba(41, 108, 209, 0.15);
  z-index: 10; /* S'assurer que le hover est au-dessus */
}

.tab-link.active {
  background: linear-gradient(135deg, #ff9800 0%, #f96031 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.25);
  transform: translateY(-1px);
}

/* Suppression des effets de fade pour un look plus moderne */
.tab-menu-container.fade-left::before,
.tab-menu-container.fade-right::after {
  display: none;
}

/* Effet d'ombre supprimé pour une meilleure intégration avec l'effet liquidglass */

/* Animation smooth pour les onglets */
@media (min-width: 601px) {
  .tab-link {
    font-size: 15px;
    padding: 10px 20px;
  }
}

/* Indicateur de scroll sur mobile */
@media (max-width: 600px) {
  .tab-menu-container {
    position: relative;
  }
  
  .tab-menu-container::before {
    content: '→';
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(0,0,0,0.3);
    font-size: 18px;
    pointer-events: none;
    animation: scrollHint 2s ease-in-out infinite;
    z-index: 10;
  }
  
  @keyframes scrollHint {
    0%, 100% { opacity: 0.3; transform: translateY(-50%) translateX(0); }
    50% { opacity: 0.8; transform: translateY(-50%) translateX(3px); }
  }
  
  .tab-menu-container.scrolled::before {
    display: none;
  }
}

/* ===== Contenu des onglets ===== */
.tab-pane { 
  display: none; 
  padding-top: 10px;
}
.tab-pane.active { display: block; }

/* CORRECTION : S'assurer que Battle Royale est caché par défaut */
.br-screen {
  display: none !important;
}

.br-screen.active {
  display: block !important;
}

/* S'assurer que seul le contenu de l'onglet actif est visible */
.battle-royale-container {
  display: none;
}

.tab-pane.active .battle-royale-container {
  display: block;
}

/* Ajustement du contenu pour le menu fixe */
@media (max-width: 600px) {
  .tab-pane {
    padding: 0 10px; /* Padding horizontal uniforme */
    margin: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  /* Forcer tous les éléments enfants à respecter la largeur */
  .tab-pane > * {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
  }
  
  /* Styles spécifiques pour les éléments qui doivent être centrés */
  .sg-card,
  .duel-section,
  .profile-form,
  .player-info-bar,
  .matchmaking-compact,
  .battle-header-compact,
  .leaderboard,
  .video-container,
  #po-hacks,
  #po-hacks .gdg-card {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
  }
  
  /* Ajustements spécifiques pour po-hacks */
  #po-hacks .gdg-question,
  #po-hacks .gdg-answer-wrapper,
  #po-hacks .btn-base {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
  }
}

/* ===== Styles Flashcards ===== */
.sg-instructions {
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: bold;
  background: linear-gradient(90deg,#296cd1,#100f5b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===== Toggle Switch pour révision rapide ===== */
.sg-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 10px;
}

/* ===== Toggle Switch avec Tooltip ===== */
.toggle-container {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #333;
  position: relative;
}

.toggle-label {
  cursor: pointer;
  position: relative;
}

.toggle-switch {
  position: relative;
  width: 50px;
  height: 26px;
  background: #ccc;
  border-radius: 34px;
  cursor: pointer;
  transition: background 0.3s;
  border: none;
  outline: none;
}

.toggle-switch.active {
  background: #007BFF;
}

.toggle-slider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch.active .toggle-slider {
  transform: translateX(24px);
}

/* ===== Container pour les boutons d'options ===== */
.sg-options-container {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 12px auto 0;
  width: 100%;
  max-width: 400px;
}

/* ===== Style commun pour les boutons d'options ===== */
.sg-option-button {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #666;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: none;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: center;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.sg-option-button:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sg-option-button:active {
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.7);
}

/* ===== Bouton révision rapide ===== */
.sg-rapid-button {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #666;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: none;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: center;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.sg-rapid-button:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sg-rapid-button:active {
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.7);
}

.sg-rapid-button.active {
  background: rgba(255, 122, 0, 0.1);
  color: #ff7a00;
  border-color: rgba(255, 122, 0, 0.3);
}

  .sg-rapid-button .sg-rapid-button-icon {
    font-size: 20px;
  }
  
  @media (max-width: 600px) {
    .sg-options-container {
      gap: 6px;
      margin: 10px auto 0;
    }
    
    .sg-option-button,
    .sg-rapid-button,
    .sg-review-btn {
      font-size: 12px;
      padding: 6px 12px;
      gap: 4px;
    }
    
    .sg-rapid-button .sg-rapid-button-icon {
      font-size: 14px;
    }
    
    .sg-review-count {
      font-size: 10px;
      padding: 1px 5px;
    }
  }

/* ===== Section révision rapide moderne ===== */
.sg-rapid-section {
  margin: 12px auto 16px;
  padding: 16px 20px;
  background: radial-gradient(circle at 20% 50%, #f8e7ff 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, #ffd1aa 0%, transparent 50%),
              radial-gradient(circle at 50% 10%, #f9f2ff 0%, transparent 60%),
              radial-gradient(circle at 10% 90%, #d9e4ff 0%, transparent 40%),
              radial-gradient(circle at 90% 20%, #fdf2e7 0%, transparent 45%),
              radial-gradient(circle at 60% 60%, #e8e8ff 0%, transparent 70%);
  border-radius: 24px;
  position: relative;
  overflow: visible;
  width: 100%;
  max-width: 100%;
  transition: all 0.5s ease;
  box-shadow: 0 12px 32px rgba(215, 199, 248, 0.2),
              0 0 80px rgba(255, 234, 191, 0.15) inset;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background-clip: padding-box;
  display: none;
  min-height: 200px;
  z-index: 100;
  opacity: 0;
  transform: translateY(-20px) scale(0.95);
}

.sg-rapid-section.visible {
  display: block;
  animation: smoothFadeIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes smoothFadeIn {
  0% {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  70% {
    transform: translateY(5px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Bouton de fermeture - EN HAUT À DROITE */
.sg-rapid-close {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
  font-size: 18px;
  color: #666;
  line-height: 1;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-weight: 400;
}

.sg-rapid-close:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  color: #dc2626;
}

.sg-rapid-close:active {
  transform: scale(0.95);
}

.sg-rapid-section.difficult-mode .sg-rapid-close {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.1);
  color: #666;
}

.sg-rapid-section.difficult-mode .sg-rapid-close:hover {
  background: rgba(255, 255, 255, 1);
  color: #dc2626;
}

/* Cacher le bouton révision rapide quand la section est visible */
.sg-rapid-button.hidden {
  display: none;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sg-rapid-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(30px) saturate(120%);
  -webkit-backdrop-filter: blur(30px) saturate(120%);
  border-radius: 24px;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.5) inset,
              0 0 40px rgba(215, 199, 248, 0.1) inset,
              0 0 40px rgba(255, 234, 191, 0.1) inset;
}

.sg-rapid-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' /%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23noise)' opacity='0.02'/%3E%3C/svg%3E");
  border-radius: 24px;
  z-index: 1;
  opacity: 0.4;
  mix-blend-mode: soft-light;
}

.sg-rapid-section > * {
  position: relative;
  z-index: 2;
}

@keyframes border-glow {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  }
  50% {
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.08);
  }
}

.sg-rapid-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-top: 0;
  margin-top: 0;
  position: relative;
}

.sg-rapid-title-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
}

.sg-rapid-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  align-items: center;
}

.sg-rapid-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, #ff7a00 0%, #ffb347 100%);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: visible;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 6px 20px rgba(255, 122, 0, 0.3);
  white-space: nowrap;
  width: 100%;
  max-width: 220px;
  margin: 0 auto;
  display: block;
  transform: translateY(0);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5px;
}

.sg-rapid-toggle::before {
  display: none;
}

.sg-rapid-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(255, 122, 0, 0.4);
}

.sg-rapid-toggle:hover::after {
  opacity: 0.4;
}

.sg-rapid-toggle:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(255, 122, 0, 0.3);
}

.sg-rapid-toggle:active::after {
  opacity: 0.5;
}

.sg-rapid-toggle.active {
  background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
}

.sg-rapid-icon {
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff7a00;
  transition: all 0.5s ease;
  line-height: 1;
  margin: 0;
  padding: 0;
  transform: translateY(-7px);
}

.sg-rapid-icon:empty {
  display: none;
}

.sg-rapid-toggle.active .sg-rapid-icon {
  display: none;
}

.sg-rapid-title {
  font-size: 24px;
  font-weight: 700;
  color: #112244;
  margin: 0;
  letter-spacing: -0.5px;
  transition: all 0.5s ease;
  line-height: 1;
  display: flex;
  align-items: center;
}

.sg-rapid-counter {
  font-size: 18px;
  font-weight: 600;
  color: #ff7a00;
  margin-left: 12px;
  background: rgba(255, 122, 0, 0.1);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 122, 0, 0.2);
}

.sg-rapid-text {
  font-size: 18px;
  font-weight: 600;
  color: white;
  transition: color 0.2s ease;
  position: relative;
  z-index: 1;
}

.sg-rapid-toggle.active .sg-rapid-text {
  color: white;
}

.sg-rapid-toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sg-rapid-toggle:disabled:hover {
  transform: none;
  box-shadow: none;
}

.sg-rapid-slider:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sg-rapid-slider:disabled::-webkit-slider-thumb,
.sg-rapid-slider:disabled::-moz-range-thumb {
  cursor: not-allowed;
}

.sg-rapid-description {
  font-size: 12px;
  color: #666;
  line-height: 1.3;
  opacity: 0.9;
}

/* Curseur de sélection du nombre de cartes */
.sg-rapid-slider-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  align-items: center;
  margin-bottom: 16px;
}

.sg-rapid-slider-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: auto;
}

.sg-rapid-slider-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  transition: all 0.3s ease;
  opacity: 1;
  transform: translateY(0);
}

.sg-rapid-section.active .sg-rapid-slider-container {
  display: none;
}

/* Cacher la croix en mode révision actif - on utilise le bouton "Quitter la révision" à la place */
.sg-rapid-section.active .sg-rapid-close {
  display: none !important;
}

.sg-rapid-section.difficult-mode.active .sg-rapid-close {
  display: none !important;
}

.sg-rapid-section.active .sg-difficulty-container {
  display: none;
}

/* Cacher le header du slider en mode actif */
.sg-rapid-section.active .sg-rapid-slider-header {
  display: none;
}

.sg-rapid-slider-label {
  font-size: 16px;
  color: #445566;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.5s ease;
  flex: 0 0 auto;
}

.sg-rapid-slider-value {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: transparent;
  border-radius: 50%;
  font-weight: 700;
  color: #ff7a00;
  font-size: 20px;
  box-shadow: none;
  transition: all 0.5s ease;
  flex: 0 0 auto;
}

.sg-rapid-slider {
  flex: 0 1 200px;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  outline: none;
  transition: all 0.5s ease;
  position: relative;
  overflow: visible;
  margin: 0;
  box-shadow: none;
  z-index: 1;
}

.sg-rapid-slider::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: var(--progress, 30%);
  background: #ff7a00;
  border-radius: 3px;
  pointer-events: none;
  transition: width 0.2s ease;
}

.sg-rapid-slider:hover {
  background: rgba(255, 255, 255, 0.9);
}

.sg-rapid-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #ff7a00;
  border-radius: 50%;
  cursor: grab;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 1),
              0 2px 8px rgba(0, 0, 0, 0.15) inset,
              0 4px 12px rgba(255, 122, 0, 0.3);
  transition: all 0.2s ease;
  position: relative;
  z-index: 10;
  border: none;
}

.sg-rapid-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 1),
              0 2px 8px rgba(0, 0, 0, 0.15) inset,
              0 6px 16px rgba(255, 122, 0, 0.4);
  cursor: grab;
}

.sg-rapid-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(0.95);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 1),
              0 2px 8px rgba(0, 0, 0, 0.2) inset,
              0 2px 8px rgba(255, 122, 0, 0.3);
}

.sg-rapid-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #ff7a00;
  border-radius: 50%;
  cursor: grab;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 1),
              0 2px 8px rgba(0, 0, 0, 0.15) inset,
              0 4px 12px rgba(255, 122, 0, 0.3);
  border: none;
  transition: all 0.2s ease;
  position: relative;
  z-index: 10;
}

.sg-rapid-slider::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 1),
              0 2px 8px rgba(0, 0, 0, 0.15) inset,
              0 6px 16px rgba(255, 122, 0, 0.4);
  cursor: grab;
}

.sg-rapid-slider::-moz-range-thumb:active {
  cursor: grabbing;
  transform: scale(0.95);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 1),
              0 2px 8px rgba(0, 0, 0, 0.2) inset,
              0 2px 8px rgba(255, 122, 0, 0.3);
}

.sg-rapid-section.active .sg-rapid-slider {
  background: rgba(255, 255, 255, 0.3);
}

/* Media query pour desktop */
@media (min-width: 601px) {
  .sg-rapid-section {
    padding: 16px 20px;
    width: 100%;
    max-width: 400px;
    margin: 12px auto 16px;
    box-sizing: border-box;
  }
  
  .sg-rapid-slider-container {
    max-width: none;
    width: 100%;
  }
  
  .sg-rapid-toggle {
    align-self: auto;
  }
  
  .sg-rapid-section.difficult-mode {
    padding: 16px 20px;
    margin: 12px auto 16px;
  }
  
  .sg-rapid-close {
    top: 12px;
    right: 12px;
  }
}

/* Popup de résultat pour le mode rapide */
.sg-rapid-result-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sg-rapid-result-overlay.show {
  opacity: 1;
}

.sg-rapid-result-popup {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  max-width: 450px;
  width: 90%;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.2),
              0 10px 25px rgba(0, 0, 0, 0.15),
              inset 0 0 1px rgba(255, 255, 255, 0.9);
  position: relative;
  overflow: hidden;
}

.sg-rapid-result-popup::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 20%, rgba(255, 107, 53, 0.08), transparent 50%),
              radial-gradient(circle at 70% 80%, rgba(247, 147, 30, 0.08), transparent 50%);
  pointer-events: none;
}

.sg-rapid-result-overlay.show .sg-rapid-result-popup {
  transform: scale(1) translateY(0);
}

.sg-rapid-result-content {
  padding: 45px 35px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.sg-rapid-result-content h3 {
  margin: 0 0 25px 0;
  font-size: 32px;
  color: #1a1a1a;
  font-weight: 800;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  letter-spacing: -0.5px;
}

.sg-rapid-final-emoji {
  font-size: 90px;
  margin-bottom: 25px;
  animation: bounce-in 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.15));
  display: inline-block;
  position: relative;
}

.sg-rapid-final-emoji::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 20px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.1) 0%, transparent 70%);
  filter: blur(8px);
}

@keyframes bounce-in {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.sg-rapid-score-detail {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
  margin: 30px 0;
  padding: 25px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05),
              inset 0 0 1px rgba(255, 255, 255, 0.8);
}

.sg-rapid-score-main {
  font-size: 42px;
  font-weight: 800;
  color: #1a1a1a;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sg-rapid-score-percentage {
  font-size: 32px;
  font-weight: 700;
  padding: 10px 24px;
  background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
  color: white;
  border-radius: 30px;
  box-shadow: 0 5px 15px rgba(255, 107, 53, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
  animation: pulse-glow 2s ease-in-out infinite;
}

.sg-rapid-score-percentage::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shine 3s infinite;
}

@keyframes shine {
  0% { left: -100%; }
  100% { left: 100%; }
}

@keyframes pulse-glow {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }
  50% { 
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }
}

.sg-rapid-final-text {
  color: #4a5568;
  font-size: 17px;
  margin: 20px 0 30px; /* Réduit la marge du bas de 55px à 30px */
  opacity: 0.9;
  line-height: 1.4;
}

.sg-rapid-final-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.sg-rapid-retry,
.sg-rapid-exit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.sg-rapid-retry span:first-child,
.sg-rapid-exit span:first-child {
  font-size: 18px;
}

.sg-rapid-retry {
  background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.sg-rapid-retry:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.sg-rapid-exit {
  background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.sg-rapid-exit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

@media (max-width: 600px) {
  .sg-rapid-result-popup {
    width: 95%;
    max-width: 400px;
  }
  
  .sg-rapid-result-content {
    padding: 30px 20px;
  }
  
  .sg-rapid-result-content h3 {
    font-size: 24px;
  }
  
  .sg-rapid-final-emoji {
    font-size: 60px;
    margin-bottom: 15px;
  }
  
  .sg-rapid-score-main {
    font-size: 28px;
  }
  
  .sg-rapid-score-percentage {
    font-size: 22px;
    padding: 6px 16px;
  }
  
  .sg-rapid-final-text {
    font-size: 15px;
    margin: 15px 0 20px; /* Encore plus réduit pour mobile */
  }
  
  .sg-rapid-final-actions {
    gap: 10px;
  }
  
  .sg-rapid-retry,
  .sg-rapid-exit {
    font-size: 14px;
    padding: 10px 20px;
  }
  
  .sg-rapid-retry span:first-child,
  .sg-rapid-exit span:first-child {
    font-size: 16px;
  }
  
  /* Bouton quitter le mode révision sur mobile */
  #sg-back-to-all {
    top: 8px; /* Réduit l'espace en haut sur mobile */
    font-size: 14px;
    padding: 10px 18px;
    max-width: 250px;
  }
}

/* Boutons de validation pour mode rapide */
.sg-rapid-validation {
  display: none;
  flex-direction: row;
  gap: 15px;
  justify-content: center;
  margin-top: 15px;
  align-items: center;
  width: 100%;
  flex-wrap: nowrap;
}

.sg-rapid-validation.active {
  display: flex;
}

.sg-validation-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  flex-shrink: 0;
}

.sg-validation-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.sg-validation-btn.correct {
  color: #059669;
}

.sg-validation-btn.correct:hover {
  background: rgba(5, 150, 105, 0.1);
  border-color: rgba(5, 150, 105, 0.3);
}

.sg-validation-btn.incorrect {
  color: #dc2626;
}

.sg-validation-btn.incorrect:hover {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.3);
}

/* Bouton statistiques */
.sg-stats-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 16px;
  width: 40px;
  height: 40px;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08),
              0 4px 16px rgba(0, 0, 0, 0.06),
              inset 0 1px 0 rgba(255, 255, 255, 0.8);
  z-index: 10;
}

.sg-stats-btn::before {
  content: '';
  position: relative;
  width: 16px;
  height: 14px;
  background: 
    linear-gradient(to right, #ff6b35 0px, #ff6b35 16px, transparent 16px) 0px 0px / 16px 2px no-repeat,
    linear-gradient(to right, #3b82f6 0px, #3b82f6 12px, transparent 12px) 0px 6px / 12px 2px no-repeat,
    linear-gradient(to right, #1e3a8a 0px, #1e3a8a 8px, transparent 8px) 0px 12px / 8px 2px no-repeat;
  border-radius: 1px;
}

.sg-stats-btn.visible {
  display: flex;
}

.sg-stats-btn:hover {
  transform: translateY(-2px) scale(1.05);
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12),
              0 8px 24px rgba(0, 0, 0, 0.08),
              inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.15);
}

.sg-stats-btn:hover::before {
  background: 
    linear-gradient(to right, #ff6b35 0px, #ff6b35 16px, transparent 16px) 0px 0px / 16px 2px no-repeat,
    linear-gradient(to right, #3b82f6 0px, #3b82f6 12px, transparent 12px) 0px 6px / 12px 2px no-repeat,
    linear-gradient(to right, #1e3a8a 0px, #1e3a8a 8px, transparent 8px) 0px 12px / 8px 2px no-repeat;
  filter: brightness(1.1);
}

.sg-stats-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1),
              inset 0 0 1px rgba(255, 255, 255, 0.6);
}

/* Popup statistiques */
.sg-stats-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15),
              0 10px 25px rgba(0, 0, 0, 0.1),
              inset 0 0 1px rgba(255, 255, 255, 0.8);
  max-width: 550px;
  width: 90%;
  max-height: 85vh;
  overflow: hidden;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sg-stats-popup.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.sg-stats-header {
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.7) 0%, 
    rgba(255, 255, 255, 0.4) 50%,
    rgba(255, 255, 255, 0.6) 100%);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  color: #1a1a1a;
  padding: 28px 24px;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08),
              0 1px 0 rgba(255, 255, 255, 0.9) inset,
              0 -1px 0 rgba(0, 0, 0, 0.03) inset;
  overflow: hidden;
}

.sg-stats-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 20% 80%, 
    rgba(255, 107, 53, 0.15) 0%, 
    transparent 50%),
    radial-gradient(circle at 80% 20%, 
    rgba(41, 108, 209, 0.1) 0%, 
    transparent 50%),
    radial-gradient(circle at 40% 40%, 
    rgba(255, 255, 255, 0.3) 0%, 
    transparent 50%);
  animation: liquidMove 20s ease-in-out infinite;
  pointer-events: none;
}

@keyframes liquidMove {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-30px, -30px) scale(1.1); }
  66% { transform: translate(30px, -30px) scale(0.9); }
}

.sg-stats-header h3 {
  margin: 0;
  color: #1a1a1a;
  font-size: 21px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  z-index: 1;
  text-align: center;
}

.sg-stats-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(0, 0, 0, 0.08);
  border: none;
  color: #555;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 1;
}

.sg-stats-close:hover {
  background: rgba(255, 107, 53, 0.1);
  color: #ff6b35;
  transform: rotate(90deg);
}

.sg-stats-body {
  padding: 25px;
  overflow-y: auto;
  max-height: calc(85vh - 100px);
  background: rgba(255, 255, 255, 0.3);
}

.sg-stats-current {
  display: none;
}

.sg-stats-current h4 {
  margin: 0 0 10px 0;
  color: #ff6b35;
  font-size: 16px;
}

.sg-stats-progress {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-bottom: 10px;
}

.sg-progress-bar {
  flex: 1;
  height: 8px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.sg-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #059669 0%, #10b981 100%);
  transition: width 0.3s ease;
}

.sg-stats-score {
  font-weight: 600;
  color: #333;
}

/* Graphique de progression */
.sg-stats-chart-container {
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05),
              inset 0 0 1px rgba(255, 255, 255, 0.8);
}

.sg-stats-chart-title {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sg-stats-chart {
  width: 100%;
  height: 200px;
  position: relative;
}

.sg-stats-chart canvas {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

.sg-stats-history {
  margin-top: 30px;
}

.sg-stats-history h4 {
  margin: 0 0 16px 0;
  color: #1a1a1a;
  font-size: 17px;
  font-weight: 700;
}

.sg-stats-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  margin-bottom: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.sg-stats-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.7);
}

.sg-stats-date {
  color: #555;
  font-size: 14px;
  font-weight: 500;
}

.sg-stats-result {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sg-stats-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

.sg-stats-badge.good {
  background: rgba(5, 150, 105, 0.15);
  color: #059669;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.2);
}

.sg-stats-badge.bad {
  background: rgba(220, 38, 38, 0.15);
  color: #dc2626;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}

.sg-stats-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.sg-stats-overlay.active {
  opacity: 1;
  visibility: visible;
}



/* Media query mobile pour révision rapide */
@media (max-width: 600px) {
  .sg-rapid-section {
    margin: 12px auto 16px;
    padding: 14px 16px;
    width: 100%;
    max-width: 400px;
    min-height: 180px;
  }
  
  .sg-rapid-header {
    flex-direction: column;
    gap: 12px;
    align-items: center;
    justify-content: center;
  }
  
  .sg-rapid-title-group {
    width: 100%;
    justify-content: center;
  }
  
  .sg-rapid-title {
    font-size: 20px;
  }
  
  .sg-rapid-counter {
    font-size: 14px;
    padding: 3px 10px;
    margin-left: 8px;
  }
  
  .sg-rapid-icon {
    font-size: 20px;
    transform: translateY(-6px);
  }
  
  .sg-rapid-controls {
    width: 100%;
  }
  
  .sg-rapid-toggle {
    width: 100%;
    flex: 1;
    padding: 10px 20px;
    font-size: 15px;
    max-width: 180px;
    margin: 0 auto;
    display: block;
  }
  
  .sg-rapid-text {
    font-size: 15px;
  }
  
  .sg-rapid-slider-container {
    width: 100%;
    max-width: 100%;
    flex-direction: row;
    justify-content: center;
    gap: 10px;
  }
  
  .sg-rapid-slider-label {
    font-size: 14px;
  }
  
  .sg-rapid-slider-value {
    font-size: 16px;
    width: 36px;
    height: 36px;
  }
  
  .sg-rapid-slider {
    width: auto;
    flex: 0 1 150px;
  }
  
  .sg-rapid-slider::-webkit-slider-thumb,
  .sg-rapid-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
  }
  
  .sg-stats-btn {
    bottom: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  
  .sg-stats-popup {
    width: 95%;
    max-width: 350px;
  }
}

/* ===== Timer pour révision rapide ===== */
.sg-timer {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
  backdrop-filter: blur(10px);
  color: #296cd1;
  padding: 8px 16px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  display: none;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.sg-card-front .sg-timer {
  background: rgba(255, 255, 255, 0.9);
  color: #007BFF;
}

.sg-card.flipped .sg-timer {
  background: rgba(0, 123, 255, 0.1);
  color: #007BFF;
}

.sg-timer.active {
  display: block;
  animation: timer-glow 2s ease-in-out infinite;
}

@keyframes timer-glow {
  0%, 100% { 
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }
  50% { 
    box-shadow: 0 4px 20px rgba(41, 108, 209, 0.3);
  }
}

/* ===== Toggle Switch Normal/Difficile ===== */
.sg-difficulty-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.sg-difficulty-label {
  font-size: 14px;
  color: #445566;
  font-weight: 600;
  white-space: nowrap;
}

.sg-rapid-section.difficult-mode .sg-difficulty-label {
  color: #ffffff;
}

.sg-difficulty-switch {
  position: relative;
  width: 56px;
  height: 28px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 34px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sg-difficulty-switch.active {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  border-color: rgba(220, 38, 38, 0.3);
  box-shadow: 0 0 20px rgba(220, 38, 38, 0.2);
}

.sg-difficulty-slider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.sg-difficulty-switch.active .sg-difficulty-slider {
  transform: translateX(28px);
}

/* Container pour le toggle switch centré */
.sg-difficulty-container {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 8px;
  margin-bottom: 4px;
}



/* ===== Mode difficile (mode sombre) pour révision rapide ===== */
.sg-rapid-section.difficult-mode {
  background: linear-gradient(135deg, #0e0f2b, #241744, #360b25);
  box-shadow: 0 0 40px rgba(0, 140, 255, 0.3),
              0 0 60px rgba(255, 122, 0, 0.15),
              0 0 80px rgba(255, 122, 0, 0.1) inset;
  border: 1px solid rgba(97, 211, 255, 0.3);
  overflow: hidden;
  min-height: 200px;
  /* Mêmes dimensions que le mode normal */
  padding: 16px 20px;
  margin: 12px auto 16px;
}

.sg-rapid-section.difficult-mode::before {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 20px rgba(0, 140, 255, 0.2) inset,
              0 0 10px rgba(255, 255, 255, 0.05) inset;
}

.sg-rapid-section.difficult-mode::after {
  opacity: 0.6;
  mix-blend-mode: overlay;
}

/* Animation de scan pour le mode difficile */
@keyframes difficultScan {
  0% {
    transform: translateY(-100%) scaleX(0.8);
    opacity: 0;
  }
  5% {
    opacity: 0.2;
  }
  15% {
    opacity: 0.4;
    transform: translateY(-80%) scaleX(1);
  }
  85% {
    opacity: 0.4;
    transform: translateY(80%) scaleX(1);
  }
  95% {
    opacity: 0.2;
  }
  100% {
    transform: translateY(100%) scaleX(0.8);
    opacity: 0;
  }
}

.sg-rapid-section.difficult-mode .sg-scan-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(97, 211, 255, 0.6) 20%,
    rgba(97, 211, 255, 0.8) 50%, 
    rgba(97, 211, 255, 0.6) 80%,
    transparent 100%);
  box-shadow: 0 0 8px rgba(97, 211, 255, 0.5),
              0 0 16px rgba(97, 211, 255, 0.3),
              0 0 24px rgba(97, 211, 255, 0.2);
  animation: difficultScan 5s ease-in-out infinite;
  pointer-events: none;
  z-index: 3;
}

.sg-rapid-section.difficult-mode .sg-scan-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: inherit;
  box-shadow: inherit;
  animation: difficultScan 5s ease-in-out infinite;
  animation-delay: 2.5s;
}

.sg-rapid-section.difficult-mode .sg-rapid-header {
  margin-bottom: 12px;
  padding-top: 0;
  margin-top: 0;
}

.sg-rapid-section.difficult-mode .sg-rapid-icon {
  color: #ff6600;
  filter: drop-shadow(0 0 4px #ff6600);
}

.sg-rapid-section.difficult-mode .sg-rapid-title {
  color: #61d3ff;
  font-weight: 700;
  text-shadow: 0 0 5px rgba(97, 211, 255, 0.3);
  /* Mêmes propriétés que le mode normal */
  font-size: 24px;
  line-height: 1;
  margin: 0;
  letter-spacing: -0.5px;
}

.sg-rapid-section.difficult-mode .sg-rapid-slider-label {
  color: #7aa0c5;
  /* Mêmes propriétés que le mode normal */
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.sg-rapid-section.difficult-mode .sg-rapid-slider-value {
  /* Mêmes propriétés que le mode normal mais avec couleur adaptée */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  font-weight: 700;
  color: #ff911c;
  font-size: 20px;
  box-shadow: 0 0 8px rgba(255, 145, 28, 0.4);
  transition: all 0.5s ease;
  flex: 0 0 auto;
}

.sg-rapid-section.difficult-mode .sg-rapid-slider {
  background: rgba(255, 255, 255, 0.2);
  height: 6px;
  border-radius: 3px;
  /* Mêmes propriétés que le mode normal */
  flex: 0 1 200px;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  position: relative;
  overflow: visible;
  margin: 0;
  box-shadow: none;
}

.sg-rapid-section.difficult-mode .sg-rapid-slider::before {
  background: #ff7a00;
  box-shadow: 0 0 6px rgba(255, 122, 0, 0.6);
}

.sg-rapid-section.difficult-mode .sg-rapid-slider::-webkit-slider-thumb {
  background: #ff7a00;
  border: none;
  width: 20px;
  height: 20px;
  box-shadow: 0 0 0 3px #1a1a1a,
              0 0 10px rgba(255, 122, 0, 0.6);
}

.sg-rapid-section.difficult-mode .sg-rapid-slider::-moz-range-thumb {
  background: #ff7a00;
  border: none;
  width: 20px;
  height: 20px;
  box-shadow: 0 0 0 3px #1a1a1a,
              0 0 10px rgba(255, 122, 0, 0.6);
}

.sg-rapid-section.difficult-mode .sg-rapid-toggle {
  /* Exactement les mêmes dimensions que le mode normal */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ff3e3e, #ff9e2c);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: visible;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 6px 20px rgba(255, 62, 62, 0.3);
  white-space: nowrap;
  width: 100%;
  max-width: 220px;
  margin: 0 auto;
  display: block;
  transform: translateY(0);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5px;
  box-sizing: border-box;
}

.sg-rapid-section.difficult-mode .sg-rapid-toggle:hover {
  transform: scale(1.03) translateY(-2px);
  box-shadow: 0 0 20px rgba(255, 100, 0, 0.5),
              inset 0 -2px 8px rgba(255, 255, 255, 0.1);
}

.sg-rapid-section.difficult-mode .sg-rapid-toggle:active {
  transform: scale(1.01) translateY(0);
  box-shadow: 0 0 15px rgba(255, 62, 62, 0.4),
              inset 0 -1px 4px rgba(255, 255, 255, 0.1);
}

.sg-rapid-section.difficult-mode .sg-rapid-toggle.active {
  background: linear-gradient(135deg, #4a4a4a, #2a2a2a);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2) inset;
}

.sg-rapid-section.difficult-mode .sg-stats-btn {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(97, 211, 255, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3),
              0 0 20px rgba(0, 140, 255, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.sg-rapid-section.difficult-mode .sg-stats-btn::before {
  background: 
    linear-gradient(to right, #ff6600 0px, #ff6600 16px, transparent 16px) 0px 0px / 16px 2px no-repeat,
    linear-gradient(to right, #61d3ff 0px, #61d3ff 12px, transparent 12px) 0px 6px / 12px 2px no-repeat,
    linear-gradient(to right, #ff911c 0px, #ff911c 8px, transparent 8px) 0px 12px / 8px 2px no-repeat;
  filter: brightness(1.2) saturate(1.3);
}

.sg-rapid-section.difficult-mode .sg-stats-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4),
              0 0 30px rgba(0, 140, 255, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transform: translateY(-2px) scale(1.05);
  border-color: rgba(97, 211, 255, 0.5);
}

.sg-rapid-section.difficult-mode .sg-rapid-slider:hover {
  background: #3a3a4a;
}

.sg-rapid-section.difficult-mode .sg-rapid-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 0 0 3px #1a1a1a,
              0 0 15px rgba(255, 122, 0, 0.8);
}

.sg-rapid-section.difficult-mode .sg-rapid-slider::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 0 0 3px #1a1a1a,
              0 0 15px rgba(255, 122, 0, 0.8);
}

/* Media query mobile pour Mode difficile */
@media (max-width: 600px) {
  .sg-difficulty-toggle {
    gap: 8px;
  }
  
  .sg-difficulty-label {
    font-size: 13px;
  }
  
  .sg-difficulty-switch {
    width: 48px;
    height: 24px;
  }
  
  .sg-difficulty-slider {
    width: 18px;
    height: 18px;
  }
  
  .sg-difficulty-switch.active .sg-difficulty-slider {
    transform: translateX(24px);
  }
  
  .sg-difficulty-container {
    margin-top: 10px;
  }
  
  .sg-rapid-close {
    width: 28px;
    height: 28px;
    top: 4px;
    right: 4px;
    font-size: 16px;
  }
  
  .sg-rapid-section.difficult-mode .sg-rapid-slider-value {
    font-size: 16px;
    padding: 1px 6px;
  }
  
  .sg-rapid-section.difficult-mode {
    padding: 14px 16px;
    min-height: 180px;
  }
  
  .sg-rapid-section.difficult-mode .sg-scan-line {
    height: 1.5px;
  }
  
  .sg-rapid-section.difficult-mode .sg-rapid-toggle {
    /* Exactement les mêmes dimensions que le mode normal sur mobile */
    padding: 10px 20px;
    font-size: 15px;
    max-width: 180px;
    width: 100%;
    margin: 0 auto;
    display: block;
  }
  
  .sg-rapid-section.difficult-mode .sg-rapid-slider-value {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  
  .sg-rapid-section.difficult-mode .sg-rapid-slider {
    flex: 0 1 150px;
  }
  
  .sg-rapid-section.difficult-mode .sg-rapid-title {
    font-size: 20px;
  }
  
  .sg-rapid-section.difficult-mode .sg-rapid-slider-label {
    font-size: 14px;
  }
  
  /* Fix pour le curseur du slider sur mobile */
  .sg-rapid-slider {
    overflow: visible !important;
    z-index: 1;
  }
  
  .sg-rapid-slider-container {
    overflow: visible !important;
  }
  
  .sg-rapid-slider::-webkit-slider-thumb,
  .sg-rapid-slider::-moz-range-thumb {
    z-index: 20 !important;
    position: relative;
  }
}

/* ===== Bouton favoris sur les cartes ===== */
.sg-favorite-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  /* Fond avec effet glassmorphism */
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.2) 0%,
    rgba(255, 255, 255, 0.1) 100%
  );
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.3s;
  z-index: 10;
  /* Ombre plus subtile */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sg-favorite-btn:hover {
  transform: scale(1.1);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.25) 0%,
    rgba(255, 255, 255, 0.15) 100%
  );
}

.sg-favorite-btn.active {
  /* Fond dégradé bleu assorti au thème de l'app */
  background: linear-gradient(135deg, #296cd1 17%, #100f5b 81%);
  color: white;
}

/* ===== Bouton "Mes cartes à revoir" ===== */
.sg-review-btn {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #666;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: none;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: center;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.sg-review-btn:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sg-review-btn:disabled {
  background: #ddd;
  cursor: not-allowed;
  box-shadow: none;
}

.sg-review-count {
  background: rgba(0, 0, 0, 0.1);
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}

/* Bouton quitter le mode révision */
#sg-back-to-all {
  /* Même style que sg-rapid-toggle mais en gris */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: visible;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 6px 20px rgba(107, 114, 128, 0.3);
  white-space: nowrap;
  width: 100%;
  max-width: 220px;
  margin: 15px auto;
  display: block;
  transform: translateY(0);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5px;
  box-sizing: border-box;
}

/* Bouton quitter la révision rapide */
#sg-rapid-quit {
  /* Même style que sg-rapid-toggle mais en gris */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: visible;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 6px 20px rgba(107, 114, 128, 0.3);
  white-space: nowrap;
  width: 100%;
  max-width: 220px;
  margin: 20px auto 15px; /* Plus d'espace en haut pour séparer des boutons de validation */
  display: block;
  transform: translateY(0);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5px;
  box-sizing: border-box;
}

#sg-back-to-all:hover,
#sg-rapid-quit:hover {
  transform: scale(1.03) translateY(-2px);
  box-shadow: 0 8px 25px rgba(107, 114, 128, 0.4);
  background: linear-gradient(135deg, #5a606d 0%, #3a4149 100%);
}

#sg-back-to-all:active,
#sg-rapid-quit:active {
  transform: scale(1.01) translateY(0);
  box-shadow: 0 4px 15px rgba(107, 114, 128, 0.3);
}

@media (max-width: 600px) {
  #sg-back-to-all {
    /* Même style que sg-rapid-toggle sur mobile */
    padding: 10px 20px;
    font-size: 15px;
    max-width: 180px;
    margin: 10px auto;
  }
  
  #sg-rapid-quit {
    /* Même style que sg-rapid-toggle sur mobile */
    padding: 10px 20px;
    font-size: 15px;
    max-width: 180px;
    margin: 15px auto 10px; /* Plus d'espace en haut sur mobile aussi */
  }
}

/* Popup d'authentification unifié */
.auth-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.auth-popup-overlay.show {
  opacity: 1;
}

.auth-popup-content {
  background: white;
  padding: 30px;
  border-radius: 16px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transform: translateY(20px);
  transition: transform 0.3s ease;
  position: relative;
}

.auth-popup-overlay.show .auth-popup-content {
  transform: translateY(0);
}

.auth-popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  padding: 5px 10px;
  transition: color 0.2s;
}

.auth-popup-close:hover {
  color: #333;
}

.auth-popup-content h3 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 1.5em;
}

.auth-popup-content p {
  margin: 0 0 20px 0;
  color: #666;
  line-height: 1.5;
}

.auth-popup-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.auth-popup-btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 16px;
  border: none;
}

.auth-popup-btn.primary {
  background: radial-gradient(circle at bottom left, #296cd1 17%, #100f5b 81%);
  color: white;
}

.auth-popup-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(41, 108, 209, 0.3);
}

.auth-popup-btn.secondary {
  background: rgba(41, 108, 209, 0.1);
  color: #296cd1;
  border: 2px solid #296cd1;
}

.auth-popup-btn.secondary:hover {
  background: rgba(41, 108, 209, 0.15);
  transform: translateY(-2px);
}

/* Message informatif pour les cartes vides */
.info-message {
  margin: 20px 0;
  animation: slideInFade 0.5s ease-out;
}

@keyframes slideInFade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Message moderne "Aucune carte à revoir" */
.sg-no-cards-message {
  position: relative;
  margin: 20px auto;
  max-width: 500px;
  animation: slideInUp 0.4s ease-out;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sg-no-cards-box {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border: 2px solid #e8e8e8;
  border-radius: 16px;
  padding: 40px 30px;
  text-align: center;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.sg-no-cards-box:hover {
  box-shadow: 0 15px 40px rgba(108, 92, 231, 0.15);
  border-color: #e0d9ff;
}

.sg-no-cards-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 36px;
  height: 36px;
  border: none;
  background: #f0f0f0;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  color: #666;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.sg-no-cards-close:hover {
  background: #6c5ce7;
  color: white;
  transform: rotate(90deg);
}

.sg-no-cards-icon {
  margin: 0 auto 20px;
  width: 48px;
  height: 48px;
  position: relative;
}

.sg-no-cards-icon svg {
  width: 100%;
  height: 100%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.sg-no-cards-title {
  font-size: 24px;
  font-weight: 700;
  color: #2c3e50;
  margin: 0 0 10px 0;
  letter-spacing: -0.5px;
}

.sg-no-cards-category {
  font-size: 16px;
  color: #7f8c8d;
  margin: 0 0 20px 0;
}

.sg-no-cards-category strong {
  color: #6c5ce7;
  font-weight: 600;
}

.sg-no-cards-text {
  font-size: 15px;
  color: #555;
  line-height: 1.6;
  margin: 0;
}

.sg-no-cards-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: #6c5ce7;
  color: white;
  border-radius: 6px;
  font-size: 16px;
  margin: 0 4px;
  vertical-align: middle;
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}

/* Icône de succès pour la liste vidée */
.sg-no-cards-box svg path[stroke="#4ade80"] {
  stroke: #4ade80;
}

/* Animation shake pour éviter les duplicatas */
.sg-shake {
  animation: shake 0.6s ease-in-out;
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-10px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(10px);
  }
}

/* Bouton en cours de traitement */
.sg-review-btn.sg-processing {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Responsive pour la boîte "Aucune carte" */
@media (max-width: 600px) {
  .sg-no-cards-box {
    padding: 30px 20px;
  }
  
  .sg-no-cards-title {
    font-size: 20px;
  }
  
  .sg-no-cards-close {
    width: 32px;
    height: 32px;
    font-size: 20px;
    top: 10px;
    right: 10px;
  }
}

/* Responsive pour le popup */
@media (max-width: 600px) {
  .auth-popup-content {
    padding: 20px;
    margin: 10px;
  }
  
  .auth-popup-content h3 {
    font-size: 1.3em;
  }
  
  .auth-popup-buttons {
    flex-direction: column;
  }
  
  .auth-popup-btn {
    width: 100%;
  }
}

.sg-progress-bar {
  position: relative;
  height: 12px;
  background-color: #e0e0e0;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 20px;
}

.sg-progress-inner {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #0062ff, #0050cc);
  transition: width 0.6s ease;
  position: relative;
}

.sg-progress-inner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255,255,255,.05) 0, rgba(255,255,255,.35) 50%, rgba(255,255,255,.05) 100%);
  background-size: 250% 100%;
  animation: progress-shine 3.5s linear infinite;
  mix-blend-mode: overlay;
}

@keyframes progress-shine {
  0% { background-position: 250% 0; }
  100% { background-position: -250% 0; }
}

#sg-restart { display: none; }

.sg-card {
  width: 100%;
  min-height: 220px;
  height: 220px; /* Hauteur équilibrée */
  perspective: 1000px;
  cursor: pointer;
  margin-bottom: 10px; /* Marge réduite pour rapprocher les boutons */
  border-radius: 20px;
  overflow: visible;
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
  contain: layout style; /* Optimisation du rendu pour réduire le CLS */
}



.sg-card-inner {
  position: relative;
  width: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  border-radius: 20px;
}

.sg-card.flipped .sg-card-inner {
  transform: rotateY(180deg);
}



.sg-card-front,
.sg-card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%; /* Hauteur 100% du parent */
  min-height: 220px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  -moz-backface-visibility: hidden;
  border-radius: 20px;
  padding: 20px; /* Padding restauré */
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Fix spécifique Firefox pour éviter que le contenu apparaisse au dos */
@-moz-document url-prefix() {
  .sg-card.flipped .sg-card-front {
    visibility: hidden;
  }
}

.sg-card-front {
  position: relative;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  overflow: hidden;
  background-image: url('../Flashcards%20background/Background%20Flashcard.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

}

/* Effet glassmorphism overlay - Version améliorée */
.sg-card-front::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  backdrop-filter: blur(6px) contrast(0.9);
  -webkit-filter: blur(0.3px);
}

/* S'assurer que le contenu est au-dessus du glassmorphism */
.sg-card-front > * {
  position: relative;
  z-index: 2;
}

/* Support fallback pour les navigateurs qui ne supportent pas backdrop-filter */
@supports not (backdrop-filter: blur(1px)) {
  .sg-card-front::before {
    background: 
      linear-gradient(
        to bottom,
        rgba(0, 123, 255, 0.6) 0%,
        rgba(0, 123, 255, 0.7) 50%,
        rgba(0, 0, 0, 0.85) 100%
      ),
      rgba(255, 255, 255, 0.3);
  }
}

/* Amélioration de la lisibilité du texte */
.sg-card-front p,
.sg-card-front span,
.sg-card-front div {
  font-weight: 600;
}

/* Style du timer sur les flashcards */
.sg-card-front .sg-timer {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.sg-card-front img {
  max-width: 180px;
  max-height: 150px; /* Hauteur ajustée */
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0; /* Suppression de la marge pour éviter la zone cliquable vide */
  display: block;
  /* Animation d'entrée pour l'image du panneau */
  animation: fadeInScale 0.5s ease-out;
  /* Fix pour Firefox - empêche l'image de rester visible au dos */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  -moz-backface-visibility: hidden;
  will-change: transform; /* Optimisation GPU */
  pointer-events: none; /* L'image elle-même n'est pas cliquable */
}

/* Réinitialiser les styles supplémentaires de .sg-card-front */
.sg-card-front {
  width: 100%; /* S'assurer que le conteneur prend toute la largeur pour le centrage flex */
}

/* Ajustements mobile */
@media (max-width: 600px) {
  .sg-card {
    min-height: 200px;
    height: 200px;
  }
  
  .sg-card-front,
  .sg-card-back {
    min-height: 200px;
    padding: 15px;
  }
  
  .sg-card-front img {
    max-width: 150px;
    max-height: 130px;
  }
  
  .sg-card-back {
    font-size: 14px;
  }
}

.sg-card-back {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(248, 249, 250, 0.95) 100%
  );
  color: #333;
  transform: rotateY(180deg);
  font-size: 15px; /* Taille de police légèrement réduite */
  text-align: center;
  padding: 20px; /* Padding aligné avec .sg-card-front */
  border: 2px solid rgba(0, 123, 255, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow-y: auto; /* Au cas où le texte est trop long */
  line-height: 1.5; /* Meilleure lisibilité */
}

@keyframes slideOutLeft  { from{transform:translateX(0);opacity:1;} to{transform:translateX(-100%);opacity:0;} }
@keyframes slideInRight { from{transform:translateX(100%);opacity:0;} to{transform:translateX(0);opacity:1;} }
@keyframes slideOutRight{ from{transform:translateX(0);opacity:1;} to{transform:translateX(100%);opacity:0;} }
@keyframes slideInLeft  { from{transform:translateX(-100%);opacity:0;} to{transform:translateX(0);opacity:1;} }

.sg-card.slide-out-left   { animation: slideOutLeft 0.3s forwards; }
.sg-card.slide-in-right  { animation: slideInRight 0.3s forwards; }
.sg-card.slide-out-right { animation: slideOutRight 0.3s forwards; }
.sg-card.slide-in-left   { animation: slideInLeft 0.3s forwards; }

.sg-navigation {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 5px; /* Marge réduite pour rapprocher des cartes */
  position: relative;
  z-index: 10;
}

.sg-nav-button {
  background: radial-gradient(circle at bottom left, #296cd1 17%, #100f5b 81%);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.sg-nav-button:disabled {
  background: #ccc;
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.6;
}

.sg-nav-button:hover:not(:disabled) {
  transform: translateY(-3px);
}

/* ===== Styles pour le lecteur vidéo SIMPLE ===== */
.video-container {
  width: 100%;
  margin: 20px 0;
}

.video-wrapper {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
  background: #f0f0f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 12px;
}

.cours-header {
  color: #007BFF;
  margin-bottom: 20px;
  font-size: 24px;
  font-weight: 700;
}

.cours-intro {
  text-align: left;
  line-height: 1.6;
  color: #333;
  margin-bottom: 25px;
  padding: 0 10px;
}

/* ===== Styles pour les Duels ===== */
.duel-section {
  padding: 20px 0;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Profile Creation */
.profile-form {
  max-width: 400px;
  margin: 0 auto;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #333;
}

.form-group input {
  width: 100%;
  padding: 10px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
}

.avatar-selection {
  margin-top: 20px;
}

.avatar-selection label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  color: #333;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  margin-top: 20px;
  background: #f8f9fa;
  padding: 15px;
  border-radius: 12px;
}

@media (max-width: 600px) {
  .avatar-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.avatar-option {
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid #e9ecef;
  background: white;
  border-radius: 8px;
  font-size: 28px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

.avatar-option:hover {
  border-color: #667eea;
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(102,126,234,0.15);
}

.avatar-option.selected {
  border-color: #667eea;
  background: #667eea;
  color: white;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.create-profile-btn {
  width: 100%;
  padding: 14px 20px;
  background: radial-gradient(circle at bottom left, #296cd1 17%, #100f5b 81%);
  color: white;
  border: none;
  border-radius: 50px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(41, 108, 209, 0.4);
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.create-profile-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 6px 30px rgba(41, 108, 209, 0.5);
}

.create-profile-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Player Info Bar */
.player-info-bar {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.2fr;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 20px;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.3) inset;
  position: relative;
  overflow: hidden;
}

@media (max-width: 600px) {
  .player-info-bar {
    grid-template-columns: 1fr 1.2fr 1.2fr;
    gap: 8px;
    padding: 14px 8px;
    margin-bottom: 16px;
  }
}

.player-profile-col1 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.player-profile-col2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.player-profile-col3 {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
}

.player-name-display {
  font-size: 1.25em;
  font-weight: 700;
  color: #222;
  margin-bottom: 4px;
  text-align: center;
}

@media (max-width: 600px) {
  .player-name-display {
    font-size: 1.1em;
  }
}

.player-avatar-display {
  margin: 0 auto 0 auto;
  font-size: 34px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
  padding: 8px;
  border-radius: 12px;
  position: relative;
}

.player-avatar-display:hover {
  transform: scale(1.15);
  background: rgba(102, 126, 234, 0.1);
}

.player-avatar-display::after {
  content: '✏️';
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: #667eea;
  color: white;
  font-size: 14px;
  width: 22px;
  height: 22px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease;
}

.player-avatar-display:hover::after {
  opacity: 1;
  transform: scale(1);
}

/* Reset de base */
html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  width: 100%;
  height: 100%;
}

body {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  background: #fff;
}

/* ===== STYLES CRITIQUES POUR LE LOADER (chargés en premier) ===== */
.app-loading-indicator {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: #ffffff !important;
  z-index: 999999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-direction: column !important;
}

.app-loading-indicator .loader {
  width: 60px !important;
  height: 60px !important;
  border: 4px solid #f3f3f3 !important;
  border-top: 4px solid #667eea !important;
  border-radius: 50% !important;
  animation: spin 0.8s linear infinite !important;
}

.app-loading-indicator p {
  margin-top: 20px !important;
  color: #667eea !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  font-family: 'Poppins', sans-serif !important;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}



@media (max-width: 600px) {
  .app-loading-indicator {
    background: #f8f9fa !important;
  }
  
  .app-loading-indicator .loader {
    width: 50px !important;
    height: 50px !important;
    border-width: 3px !important;
  }
  
  .app-loading-indicator p {
    font-size: 14px !important;
  }
}

/* ===== PERMIS DUELS PLUGIN STYLES ===== */

/* ===== Conteneur principal ===== */
.sg-wrapper {
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
  padding-bottom: 0;
  padding-top: 0;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media (max-width: 600px) {
  .sg-instructions { font-size: 14px; }
  .sg-nav-button { padding: 10px 15px; font-size: 14px; }
  .sg-card-front, .sg-card-back {
    padding: 15px;
    font-size: 14px;
  }
  /* Ajustement de l'effet glassmorphism sur mobile */
  .sg-card-front::before {
    backdrop-filter: blur(6px) contrast(0.9);
    -webkit-backdrop-filter: blur(6px) contrast(0.9);
  }
  .sg-card-front img {
    max-width: 150px; /* Plus petit sur mobile */
  }
  .cours-header { font-size: 20px; }
  .video-title { font-size: 14px; }
  /* Wrapper plein écran, sans padding inutile */
  .sg-wrapper {
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    padding-top: 0;
    height: 100vh; /* Hauteur fixe sur mobile */
    height: 100dvh; /* Dynamic viewport height pour mobile */
    min-height: -webkit-fill-available; /* Pour Safari iOS */
  }
  /* Conteneur pleine largeur, sans bordure multicolore */
  .sg-container {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: #fff !important;
    background-image: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    animation: none !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important; /* Prend toute la hauteur du wrapper */
    overflow: visible !important; /* Permet au dropdown de sortir */
  }
}

.sg-container {
  margin: 0 auto;
  background: #fff;
  padding: 0; /* Reset padding pour la nouvelle structure */
  border-radius: 12px;
  border: 4px solid transparent;
  background-image:
    linear-gradient(white, white),
    linear-gradient(98deg, #ff9800 5%, #f96031 22%, #cc2cf4 44%, #704ee8 73%, #170e44 99%);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 6px 25px rgba(0,0,0,0.15);
  max-width: 600px;
  width: 100%;
  text-align: center;
  position: relative;
  overflow: visible; /* Changé pour permettre au dropdown de sortir */
  flex: 1;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

@media (min-width: 600px) {
  .sg-container {
    animation: none; /* Suppression de l'animation rotateBorder qui causait des problèmes */
    height: 95vh; /* Hauteur fixe sur PC pour éviter le petit scroll */
    overflow: hidden; /* Empêcher le scroll sur le conteneur */
  }
}

/* Suppression de l'animation qui causait des problèmes */
/*
@keyframes rotateBorder {
  0% {
    background-image:
      linear-gradient(white, white),
      linear-gradient(98deg, #ff9800 5%, #f96031 22%, #cc2cf4 44%, #704ee8 73%, #170e44 99%);
  }
  100% {
    background-image:
      linear-gradient(white, white),
      linear-gradient(458deg, #ff9800 5%, #f96031 22%, #cc2cf4 44%, #704ee8 73%, #170e44 99%);
  }
}
*/

/* Ajuster le padding quand le clavier est ouvert */
body.keyboard-open .sg-container {
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

/* ===== BARRE D'AUTHENTIFICATION MODERNE (FULL WIDTH, FIXED, GLASS) ===== */
.auth-bar {
  position: fixed; /* Changé de relative à fixed pour PC */
  top: 0; left: 0; right: 0;
  width: 100%;
  max-width: 100%;
  /* Fond bleu foncé cohérent avec le thème */
  background: #100f5b;
  /* Suppression du backdrop-filter pour un fond opaque */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  /* Suppression de toutes les bordures */
  border: none;
  box-shadow: none;
  z-index: 2000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  /* animation: slideDownFade 0.4s; */ /* Désactivé pour stabilité au chargement */
  margin: 0;
  border-radius: 0; /* Suppression des arrondis */
  padding-top: calc(8px + env(safe-area-inset-top));
  box-sizing: border-box;
  flex-shrink: 0; /* Empêcher la barre de rétrécir */
  overflow: visible; /* Pour permettre au dropdown de sortir */
}

/* Sur mobile, la barre reste relative dans le flow */
@media (max-width: 600px) {
  .auth-bar {
    position: relative;
  }
}

@keyframes slideDownFade {
  from { opacity: 0; transform: translateY(-24px);}
  to { opacity: 1; transform: translateY(0);}
}
.auth-info {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: visible; /* Pour que le dropdown puisse sortir */
  z-index: 9996; /* Pour assurer la priorité du dropdown */
  height: 38px; /* Hauteur fixe pour éviter tout décalage */
  position: relative;
}
.auth-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}
.auth-avatar-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(102,126,234,0.2);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
  outline: none;
  overflow: hidden;
  position: relative;
}
.auth-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1em;
  overflow: hidden;
  line-height: 1;
  cursor: pointer;
}
.auth-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  display: block;
}
.auth-avatar-wrapper:hover {
  background: rgba(102,126,234,0.1);
  border-color: rgba(102,126,234,0.3);
  box-shadow: 0 2px 8px rgba(102,126,234,0.15);
  transform: scale(1.05);
}
.auth-avatar-dropdown {
  position: absolute;
  min-width: 160px;
  right: 10px;
  top: 60px;
  /* Style harmonisé avec liquidglass */
  background: 
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.1) 0%,
      rgba(255, 255, 255, 0.15) 100%
    );
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  border-radius: 20px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.04),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.45);
  padding: 10px 0;
  z-index: 10000; /* Augmenté pour cohérence */
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  /* animation: fadeInScale 0.25s; */ /* Désactivé pour stabilité au chargement */
}
.auth-avatar-dropdown button {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  width: 100%;
  text-align: left;
  padding: 10px 18px;
  font-size: 15px;
  color: #296cd1;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
}
.auth-avatar-dropdown button:hover {
  background: rgba(41, 108, 209, 0.15);
  color: #296cd1;
  transform: translateX(4px);
}
@media (max-width: 600px) {
  .auth-bar {
    padding: 6px 12px;
    font-size: 14px;
    height: 50px;
    border-radius: 0; /* Pas d'arrondi sur mobile pour plein écran */
    /* Maintien de l'effet liquidglass sur mobile */
    background: 
      linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.15) 100%
      );
    backdrop-filter: blur(20px) saturate(120%);
    -webkit-backdrop-filter: blur(20px) saturate(120%);
    border-bottom: none; /* Fusion avec tab-menu */
  }
  
  .auth-info {
    min-width: auto; /* Pas de largeur minimum sur mobile */
    height: auto; /* Hauteur flexible sur mobile */
  }
  .tab-menu-container {
    top: 0 !important; /* Plus besoin de calcul car relative */
    position: relative !important;
  }
  .auth-avatar {
    width: 32px;
    height: 32px;
    font-size: 1.2em;
  }
  .auth-avatar-dropdown {
    min-width: 120px;
    right: 2px;
    top: 48px;
    font-size: 13px;
  }
  .auth-avatar-dropdown button {
    font-size: 13px;
    padding: 8px 12px;
  }
}

.sync-status {
  font-size: 10px;
  opacity: 0.8;
}

.sync-status.syncing {
  animation: pulse 1s infinite;
}

/* ===== Sélecteur de catégorie moderne avec dropdown custom ===== */
.category-dropdown {
  display: inline-block; /* inline-block au lieu de flex pour éviter les problèmes de largeur */
  position: relative;
  z-index: 99998; /* Force le contexte au-dessus du menu */
  width: 220px; /* Largeur fixe dès le départ */
  opacity: 1;
}

/* Pas d'animation au premier affichage pour éviter les décalages */

/* État normal du dropdown */
.category-dropdown {
  position: relative;
  visibility: visible;
  opacity: 1;
}

/* État caché - vraiment caché pour ne pas prendre de place */
.category-dropdown.hidden,
#examProgress.hidden,
#chatInput.hidden,
#parcoursStats.hidden {
  display: none !important;
}

/* Select wrapper pour le custom dropdown */
.select-wrapper {
  position: relative;
  display: block; /* block pour prendre toute la largeur du parent */
  width: 100%; /* Prendre toute la largeur du parent */
  overflow: visible; /* Pour que le dropdown puisse sortir du conteneur */
  z-index: 99997; /* Force le wrapper au-dessus du menu */
}

@keyframes fadeInScale {
  from { 
    opacity: 0; 
    transform: translateY(-10px) scale(0.95);
  }
  to { 
    opacity: 1; 
    transform: translateY(0) scale(1);
  }
}

#categorySelect {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  /* Style harmonisé avec liquidglass */
  background-color: rgba(255, 255, 255, 0.9);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg width='14' height='8' viewBox='0 0 14 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M1 1L7 7L13 1' stroke='%23296cd1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  border: 1px solid rgba(41, 108, 209, 0.2);
  border-radius: 20px;
  padding: 8px 45px 8px 16px; /* Plus d'espace à droite pour la flèche */
  font-size: 14px;
  font-weight: 600;
  color: #296cd1;
  cursor: pointer;
  /* Transition seulement sur les propriétés qui doivent être animées */
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
  position: relative;
  width: 100%; /* Prendre toute la largeur du wrapper */
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  white-space: nowrap; /* Empêcher le retour à la ligne */
  text-overflow: ellipsis; /* Points de suspension si trop long */
  overflow: hidden; /* Cacher le débordement */
}

#categorySelect:hover {
  background-color: rgba(41, 108, 209, 0.1);
  color: #296cd1; /* Garde le texte bleu pour la visibilité */
  border-color: #296cd1;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(41, 108, 209, 0.15);
}

#categorySelect:focus {
  outline: none;
  border-color: #296cd1;
  background-color: rgba(41, 108, 209, 0.08);
  color: #296cd1; /* Texte bleu pour la visibilité */
  box-shadow: 0 0 0 3px rgba(41, 108, 209, 0.1), 0 4px 16px rgba(41, 108, 209, 0.15);
}

/* Custom dropdown container (pour simuler l'effet glassmorphisme) */
.custom-dropdown {
  position: absolute; /* Comme le menu avatar */
  /* Effet liquidglass moderne */
  background: 
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.1) 0%,
      rgba(255, 255, 255, 0.15) 100%
    );
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.06),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.45);
  padding: 8px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 10000; /* Au-dessus de tout comme l'autre dropdown */
  min-width: 180px;
  /* animation: fadeInScale 0.25s; */ /* Désactivé pour stabilité au chargement */
}

/* Style du select quand le dropdown est ouvert */
.category-dropdown.open #categorySelect {
  background-color: rgba(41, 108, 209, 0.1);
  color: #296cd1;
  border-color: #296cd1;
  box-shadow: 0 0 0 3px rgba(41, 108, 209, 0.1), 0 4px 16px rgba(41, 108, 209, 0.15);
}

/* Options du dropdown custom */
.custom-option {
  padding: 10px 16px;
  margin: 2px 0;
  border-radius: 12px;
  color: #296cd1;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.1);
}

.custom-option:hover {
  background: rgba(41, 108, 209, 0.15);
  transform: translateX(4px);
  color: #296cd1;
}

.custom-option.selected {
  background: radial-gradient(circle at bottom left, #296cd1 17%, #100f5b 81%);
  color: white;
  font-weight: 600;
}

/* Scrollbar personnalisée pour le dropdown */
.custom-dropdown::-webkit-scrollbar {
  width: 6px;
}

.custom-dropdown::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.custom-dropdown::-webkit-scrollbar-thumb {
  background: rgba(41, 108, 209, 0.3);
  border-radius: 3px;
  transition: background 0.2s;
}

.custom-dropdown::-webkit-scrollbar-thumb:hover {
  background: rgba(41, 108, 209, 0.5);
}

/* Style natif des options (fallback) */
#categorySelect option {
  background: white;
  color: #296cd1;
  padding: 8px;
  font-weight: 500;
}

/* Animation au changement */
#categorySelect:active {
  transform: translateY(0) scale(0.98);
  color: #296cd1; /* Garde le texte bleu */
  background-color: rgba(41, 108, 209, 0.08);
}

@media (max-width: 600px) {
  .category-dropdown {
    width: 160px; /* Largeur fixe sur mobile */
  }
  
  .select-wrapper {
    width: 100%; /* Prendre toute la largeur du parent */
  }
  
  #categorySelect {
    width: 100%; /* Prendre toute la largeur du wrapper */
    font-size: 13px;
    padding: 6px 38px 6px 12px; /* Plus d'espace pour la flèche */
  }
  
  .custom-dropdown {
    max-height: 250px;
  }
  
  .custom-option {
    font-size: 13px;
    padding: 8px 12px;
  }
}

/* ===== Barre de stats du parcours ===== */
.parcours-stats {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.parcours-stats .stats-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 8px 16px;
  border: 1px solid rgba(41, 108, 209, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.parcours-stats .stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #296cd1;
  white-space: nowrap;
}

.parcours-stats .stat-item i {
  font-size: 16px;
  color: #667eea;
}

/* Icône spéciale pour le streak */
.parcours-stats .stat-item .fa-fire {
  color: #ff6b6b;
}

/* Icône spéciale pour les pièces */
.parcours-stats .stat-item .fa-coins {
  color: #ffd93d;
}

@media (max-width: 600px) {
  .parcours-stats {
    margin-left: 10px;
  }
  
  .parcours-stats .stats-wrapper {
    gap: 8px;
    padding: 6px 12px;
  }
  
  .parcours-stats .stat-item {
    font-size: 12px;
    gap: 4px;
  }
  
  .parcours-stats .stat-item i {
    font-size: 14px;
  }
}

/* ===== Modales d'authentification ===== */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.auth-modal.show {
  display: flex;
}

.auth-modal-content {
  background: white;
  padding: 30px;
  border-radius: 16px;
  width: 90%;
  max-width: 460px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  position: relative;
}

.auth-modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
}

.auth-modal h3 {
  margin: 0 0 20px 0;
  color: #333;
  text-align: center;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.auth-input {
  padding: 12px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.auth-input:focus {
  outline: none;
  border-color: #667eea;
}

.auth-submit {
  background: radial-gradient(circle at bottom left, #296cd1 17%, #100f5b 81%);
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(41, 108, 209, 0.4);
  transition: all 0.3s;
  width: 100%;
}

.auth-submit:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 6px 30px rgba(41, 108, 209, 0.5);
}

.auth-submit:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-switch {
  text-align: center;
  margin-top: 15px;
  color: #666;
  font-size: 13px;
}

.auth-switch a {
  color: #667eea;
  text-decoration: none;
  cursor: pointer;
}

.auth-error {
  background: #ffe6e6;
  color: #d63031;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 15px;
  display: none;
}

.auth-success {
  background: #e6f7e6;
  color: #00b894;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 15px;
  display: none;
}

/* ===== Onglets scrollables + fade conditionnel ===== */
.tab-menu-container {
  position: fixed; /* Changé de relative à fixed pour PC */
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  /* Même effet liquidglass que auth-bar pour harmonisation */
  background: #100f5b;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  /* Suppression de toutes les bordures */
  border: none;
  box-shadow: none;
  z-index: 1500; /* Réduit pour permettre au dropdown de passer au-dessus */
  padding: 8px 15px 6px 15px; /* Réduit le padding du bas */
  box-sizing: border-box;
  overflow: visible;
  flex-shrink: 0; /* Empêcher le menu de rétrécir */
  border-radius: 0; /* Suppression des arrondis */
}

@media (min-width: 600px) {
  .tab-menu-container {
    padding: 10px 20px 8px 20px; /* Réduit le padding du bas */
    top: 0; /* Fusion directe avec auth-bar sur PC */
    /* Maintien du même style liquidglass sur PC */
    background: #100f5b;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: 
      0 8px 32px rgba(0, 0, 0, 0.1),
      0 2px 8px rgba(0, 0, 0, 0.04),
      inset 0 1px 1px 0 rgba(255, 255, 255, 0.45);
  }
}

@media (max-width: 600px) {
  .tab-menu-container {
    padding: 6px 10px 4px 10px; /* Réduit le padding du bas */
  }
}

.tab-menu {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  gap: 8px;
  padding: 2px 0; /* Padding pour éviter la coupure du hover */
  scrollbar-width: none;
  cursor: grab;
  margin: 0;
}

.tab-menu::-webkit-scrollbar { display: none; }

.tab-link {
  flex: 0 0 auto;
  scroll-snap-align: start;
  /* Style harmonisé avec liquidglass */
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(41, 108, 209, 0.2);
  outline: none;
  cursor: pointer;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 20px;
  color: #296cd1;
  transition: all 0.3s ease;
  position: relative; /* Pour éviter la coupure */
  z-index: 1;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tab-link:hover:not(.active) {
  background: rgba(41, 108, 209, 0.1);
  border-color: #296cd1;
  /* transform: translateY(-2px); - Supprimé pour éviter le déplacement */
  box-shadow: 0 4px 12px rgba(41, 108, 209, 0.15);
  z-index: 10; /* S'assurer que le hover est au-dessus */
}

.tab-link.active {
  background: linear-gradient(135deg, #ff9800 0%, #f96031 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.25);
  /* transform: translateY(-1px); - Supprimé pour éviter le déplacement */
}

/* Suppression des effets de fade pour un look plus moderne */
.tab-menu-container.fade-left::before,
.tab-menu-container.fade-right::after {
  display: none;
}

/* Effet d'ombre supprimé pour une meilleure intégration avec l'effet liquidglass */

/* Animation smooth pour les onglets */
@media (min-width: 601px) {
  .tab-link {
    font-size: 15px;
    padding: 10px 20px;
  }
}

/* Indicateur de scroll sur mobile */
@media (max-width: 600px) {
  .tab-menu-container {
    position: relative;
  }
  
  .tab-menu-container::before {
    content: '→';
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(0,0,0,0.3);
    font-size: 18px;
    pointer-events: none;
    animation: scrollHint 2s ease-in-out infinite;
    z-index: 10;
  }
  
  @keyframes scrollHint {
    0%, 100% { opacity: 0.3; transform: translateY(-50%) translateX(0); }
    50% { opacity: 0.8; transform: translateY(-50%) translateX(3px); }
  }
  
  .tab-menu-container.scrolled::before {
    display: none;
  }
}

/* ===== Contenu des onglets ===== */
.tab-pane { 
  display: none; 
  padding-top: 10px;
}
.tab-pane.active { display: block; }

/* CORRECTION : S'assurer que Battle Royale est caché par défaut */
.br-screen {
  display: none !important;
}

.br-screen.active {
  display: block !important;
}

/* S'assurer que seul le contenu de l'onglet actif est visible */
.battle-royale-container {
  display: none;
}

.tab-pane.active .battle-royale-container {
  display: block;
}

/* Ajustement du contenu pour le menu fixe */
@media (max-width: 600px) {
  .tab-pane {
    padding: 0 10px; /* Padding horizontal uniforme */
    margin: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  /* Forcer tous les éléments enfants à respecter la largeur */
  .tab-pane > * {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
  }
  
  /* Styles spécifiques pour les éléments qui doivent être centrés */
  .sg-card,
  .duel-section,
  .profile-form,
  .player-info-bar,
  .matchmaking-compact,
  .battle-header-compact,
  .leaderboard,
  .video-container,
  #po-hacks,
  #po-hacks .gdg-card {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
  }
  
  /* Ajustements spécifiques pour po-hacks */
  #po-hacks .gdg-question,
  #po-hacks .gdg-answer-wrapper,
  #po-hacks .btn-base {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
  }
}

/* ===== Styles Flashcards ===== */
.sg-instructions {
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: bold;
  background: linear-gradient(90deg,#296cd1,#100f5b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===== Toggle Switch pour révision rapide ===== */
.sg-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 10px;
}

/* ===== Toggle Switch avec Tooltip ===== */
.toggle-container {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #333;
  position: relative;
}

.toggle-label {
  cursor: pointer;
  position: relative;
}

.toggle-switch {
  position: relative;
  width: 50px;
  height: 26px;
  background: #ccc;
  border-radius: 34px;
  cursor: pointer;
  transition: background 0.3s;
  border: none;
  outline: none;
}

.toggle-switch.active {
  background: #007BFF;
}

.toggle-slider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch.active .toggle-slider {
  transform: translateX(24px);
}

/* ===== Container pour les boutons d'options ===== */
.sg-options-container {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 12px auto 0;
  width: 100%;
  max-width: 400px;
}

/* ===== Style commun pour les boutons d'options ===== */
.sg-option-button {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #666;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: none;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: center;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.sg-option-button:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sg-option-button:active {
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.7);
}

/* ===== Bouton révision rapide ===== */
.sg-rapid-button {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #666;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: none;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: center;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.sg-rapid-button:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sg-rapid-button:active {
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.7);
}

.sg-rapid-button.active {
  background: rgba(255, 122, 0, 0.1);
  color: #ff7a00;
  border-color: rgba(255, 122, 0, 0.3);
}

  .sg-rapid-button .sg-rapid-button-icon {
    font-size: 20px;
  }
  
  @media (max-width: 600px) {
    .sg-options-container {
      gap: 6px;
      margin: 10px auto 0;
    }
    
    .sg-option-button,
    .sg-rapid-button,
    .sg-review-btn {
      font-size: 12px;
      padding: 6px 12px;
      gap: 4px;
    }
    
    .sg-rapid-button .sg-rapid-button-icon {
      font-size: 14px;
    }
    
    .sg-review-count {
      font-size: 10px;
      padding: 1px 5px;
    }
  }

/* ===== Section révision rapide moderne ===== */
.sg-rapid-section {
  margin: 12px auto 16px;
  padding: 16px 20px;
  background: radial-gradient(circle at 20% 50%, #f8e7ff 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, #ffd1aa 0%, transparent 50%),
              radial-gradient(circle at 50% 10%, #f9f2ff 0%, transparent 60%),
              radial-gradient(circle at 10% 90%, #d9e4ff 0%, transparent 40%),
              radial-gradient(circle at 90% 20%, #fdf2e7 0%, transparent 45%),
              radial-gradient(circle at 60% 60%, #e8e8ff 0%, transparent 70%);
  border-radius: 24px;
  position: relative;
  overflow: visible;
  width: 100%;
  max-width: 100%;
  transition: all 0.5s ease;
  box-shadow: 0 12px 32px rgba(215, 199, 248, 0.2),
              0 0 80px rgba(255, 234, 191, 0.15) inset;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background-clip: padding-box;
  display: none;
  min-height: 200px;
  z-index: 100;
  opacity: 0;
  transform: translateY(-20px) scale(0.95);
}

.sg-rapid-section.visible {
  display: block;
  animation: smoothFadeIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes smoothFadeIn {
  0% {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  70% {
    transform: translateY(5px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Bouton de fermeture - EN HAUT À DROITE */
.sg-rapid-close {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
  font-size: 18px;
  color: #666;
  line-height: 1;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-weight: 400;
}

.sg-rapid-close:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  color: #dc2626;
}

.sg-rapid-close:active {
  transform: scale(0.95);
}

.sg-rapid-section.difficult-mode .sg-rapid-close {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.1);
  color: #666;
}

.sg-rapid-section.difficult-mode .sg-rapid-close:hover {
  background: rgba(255, 255, 255, 1);
  color: #dc2626;
}

/* Cacher le bouton révision rapide quand la section est visible */
.sg-rapid-button.hidden {
  display: none;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sg-rapid-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(30px) saturate(120%);
  -webkit-backdrop-filter: blur(30px) saturate(120%);
  border-radius: 24px;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.5) inset,
              0 0 40px rgba(215, 199, 248, 0.1) inset,
              0 0 40px rgba(255, 234, 191, 0.1) inset;
}

.sg-rapid-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' /%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23noise)' opacity='0.02'/%3E%3C/svg%3E");
  border-radius: 24px;
  z-index: 1;
  opacity: 0.4;
  mix-blend-mode: soft-light;
}

.sg-rapid-section > * {
  position: relative;
  z-index: 2;
}

@keyframes border-glow {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  }
  50% {
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.08);
  }
}

.sg-rapid-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-top: 0;
  margin-top: 0;
  position: relative;
}

.sg-rapid-title-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
}

.sg-rapid-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  align-items: center;
}

.sg-rapid-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, #ff7a00 0%, #ffb347 100%);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: visible;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 6px 20px rgba(255, 122, 0, 0.3);
  white-space: nowrap;
  width: 100%;
  max-width: 220px;
  margin: 0 auto;
  display: block;
  transform: translateY(0);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5px;
}

.sg-rapid-toggle::before {
  display: none;
}

.sg-rapid-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(255, 122, 0, 0.4);
}

.sg-rapid-toggle:hover::after {
  opacity: 0.4;
}

.sg-rapid-toggle:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(255, 122, 0, 0.3);
}

.sg-rapid-toggle:active::after {
  opacity: 0.5;
}

.sg-rapid-toggle.active {
  background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
}

.sg-rapid-icon {
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff7a00;
  transition: all 0.5s ease;
  line-height: 1;
  margin: 0;
  padding: 0;
  transform: translateY(-7px);
}

.sg-rapid-icon:empty {
  display: none;
}

.sg-rapid-toggle.active .sg-rapid-icon {
  display: none;
}

.sg-rapid-title {
  font-size: 24px;
  font-weight: 700;
  color: #112244;
  margin: 0;
  letter-spacing: -0.5px;
  transition: all 0.5s ease;
  line-height: 1;
  display: flex;
  align-items: center;
}

.sg-rapid-counter {
  font-size: 18px;
  font-weight: 600;
  color: #ff7a00;
  margin-left: 12px;
  background: rgba(255, 122, 0, 0.1);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 122, 0, 0.2);
}

.sg-rapid-text {
  font-size: 18px;
  font-weight: 600;
  color: white;
  transition: color 0.2s ease;
  position: relative;
  z-index: 1;
}

.sg-rapid-toggle.active .sg-rapid-text {
  color: white;
}

.sg-rapid-toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sg-rapid-toggle:disabled:hover {
  transform: none;
  box-shadow: none;
}

.sg-rapid-slider:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sg-rapid-slider:disabled::-webkit-slider-thumb,
.sg-rapid-slider:disabled::-moz-range-thumb {
  cursor: not-allowed;
}

.sg-rapid-description {
  font-size: 12px;
  color: #666;
  line-height: 1.3;
  opacity: 0.9;
}

/* Curseur de sélection du nombre de cartes */
.sg-rapid-slider-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  align-items: center;
  margin-bottom: 16px;
}

.sg-rapid-slider-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: auto;
}

.sg-rapid-slider-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  transition: all 0.3s ease;
  opacity: 1;
  transform: translateY(0);
}

.sg-rapid-section.active .sg-rapid-slider-container {
  display: none;
}

/* Cacher la croix en mode révision actif - on utilise le bouton "Quitter la révision" à la place */
.sg-rapid-section.active .sg-rapid-close {
  display: none !important;
}

.sg-rapid-section.difficult-mode.active .sg-rapid-close {
  display: none !important;
}

.sg-rapid-section.active .sg-difficulty-container {
  display: none;
}

/* Cacher le header du slider en mode actif */
.sg-rapid-section.active .sg-rapid-slider-header {
  display: none;
}

.sg-rapid-slider-label {
  font-size: 16px;
  color: #445566;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.5s ease;
  flex: 0 0 auto;
}

.sg-rapid-slider-value {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: transparent;
  border-radius: 50%;
  font-weight: 700;
  color: #ff7a00;
  font-size: 20px;
  box-shadow: none;
  transition: all 0.5s ease;
  flex: 0 0 auto;
}

.sg-rapid-slider {
  flex: 0 1 200px;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  outline: none;
  transition: all 0.5s ease;
  position: relative;
  overflow: visible;
  margin: 0;
  box-shadow: none;
  z-index: 1;
}

.sg-rapid-slider::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: var(--progress, 30%);
  background: #ff7a00;
  border-radius: 3px;
  pointer-events: none;
  transition: width 0.2s ease;
}

.sg-rapid-slider:hover {
  background: rgba(255, 255, 255, 0.9);
}

.sg-rapid-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #ff7a00;
  border-radius: 50%;
  cursor: grab;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 1),
              0 2px 8px rgba(0, 0, 0, 0.15) inset,
              0 4px 12px rgba(255, 122, 0, 0.3);
  transition: all 0.2s ease;
  position: relative;
  z-index: 10;
  border: none;
}

.sg-rapid-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 1),
              0 2px 8px rgba(0, 0, 0, 0.15) inset,
              0 6px 16px rgba(255, 122, 0, 0.4);
  cursor: grab;
}

.sg-rapid-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(0.95);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 1),
              0 2px 8px rgba(0, 0, 0, 0.2) inset,
              0 2px 8px rgba(255, 122, 0, 0.3);
}

.sg-rapid-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #ff7a00;
  border-radius: 50%;
  cursor: grab;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 1),
              0 2px 8px rgba(0, 0, 0, 0.15) inset,
              0 4px 12px rgba(255, 122, 0, 0.3);
  border: none;
  transition: all 0.2s ease;
  position: relative;
  z-index: 10;
}

.sg-rapid-slider::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 1),
              0 2px 8px rgba(0, 0, 0, 0.15) inset,
              0 6px 16px rgba(255, 122, 0, 0.4);
  cursor: grab;
}

.sg-rapid-slider::-moz-range-thumb:active {
  cursor: grabbing;
  transform: scale(0.95);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 1),
              0 2px 8px rgba(0, 0, 0, 0.2) inset,
              0 2px 8px rgba(255, 122, 0, 0.3);
}

.sg-rapid-section.active .sg-rapid-slider {
  background: rgba(255, 255, 255, 0.3);
}

/* Media query pour desktop */
@media (min-width: 600px) {
  .sg-rapid-section {
    padding: 16px 20px;
    width: 100%;
    max-width: 400px;
    margin: 12px auto 16px;
    box-sizing: border-box;
  }
  
  .sg-rapid-slider-container {
    max-width: none;
    width: 100%;
  }
  
  .sg-rapid-toggle {
    align-self: auto;
  }
  
  .sg-rapid-section.difficult-mode {
    padding: 16px 20px;
    margin: 12px auto 16px;
  }
  
  .sg-rapid-close {
    top: 12px;
    right: 12px;
  }
}

/* Popup de résultat pour le mode rapide */
.sg-rapid-result-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sg-rapid-result-overlay.show {
  opacity: 1;
}

.sg-rapid-result-popup {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  max-width: 450px;
  width: 90%;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.2),
              0 10px 25px rgba(0, 0, 0, 0.15),
              inset 0 0 1px rgba(255, 255, 255, 0.9);
  position: relative;
  overflow: hidden;
}

.sg-rapid-result-popup::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 20%, rgba(255, 107, 53, 0.08), transparent 50%),
              radial-gradient(circle at 70% 80%, rgba(247, 147, 30, 0.08), transparent 50%);
  pointer-events: none;
}

.sg-rapid-result-overlay.show .sg-rapid-result-popup {
  transform: scale(1) translateY(0);
}

.sg-rapid-result-content {
  padding: 45px 35px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.sg-rapid-result-content h3 {
  margin: 0 0 25px 0;
  font-size: 32px;
  color: #1a1a1a;
  font-weight: 800;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  letter-spacing: -0.5px;
}

.sg-rapid-final-emoji {
  font-size: 90px;
  margin-bottom: 25px;
  animation: bounce-in 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.15));
  display: inline-block;
  position: relative;
}

.sg-rapid-final-emoji::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 20px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.1) 0%, transparent 70%);
  filter: blur(8px);
}

@keyframes bounce-in {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.sg-rapid-score-detail {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
  margin: 30px 0;
  padding: 25px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05),
              inset 0 0 1px rgba(255, 255, 255, 0.8);
}

.sg-rapid-score-main {
  font-size: 42px;
  font-weight: 800;
  color: #1a1a1a;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sg-rapid-score-percentage {
  font-size: 32px;
  font-weight: 700;
  padding: 10px 24px;
  background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
  color: white;
  border-radius: 30px;
  box-shadow: 0 5px 15px rgba(255, 107, 53, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
  animation: pulse-glow 2s ease-in-out infinite;
}

.sg-rapid-score-percentage::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shine 3s infinite;
}

@keyframes shine {
  0% { left: -100%; }
  100% { left: 100%; }
}

@keyframes pulse-glow {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }
  50% { 
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }
}

.sg-rapid-final-text {
  color: #4a5568;
  font-size: 17px;
  margin: 20px 0 30px; /* Réduit la marge du bas de 55px à 30px */
  opacity: 0.9;
  line-height: 1.4;
}

.sg-rapid-final-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.sg-rapid-retry,
.sg-rapid-exit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.sg-rapid-retry span:first-child,
.sg-rapid-exit span:first-child {
  font-size: 18px;
}

.sg-rapid-retry {
  background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.sg-rapid-retry:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.sg-rapid-exit {
  background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.sg-rapid-exit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

@media (max-width: 600px) {
  .sg-rapid-result-popup {
    width: 95%;
    max-width: 400px;
  }
  
  .sg-rapid-result-content {
    padding: 30px 20px;
  }
  
  .sg-rapid-result-content h3 {
    font-size: 24px;
  }
  
  .sg-rapid-final-emoji {
    font-size: 60px;
    margin-bottom: 15px;
  }
  
  .sg-rapid-score-main {
    font-size: 28px;
  }
  
  .sg-rapid-score-percentage {
    font-size: 22px;
    padding: 6px 16px;
  }
  
  .sg-rapid-final-text {
    font-size: 15px;
    margin: 15px 0 20px; /* Encore plus réduit pour mobile */
  }
  
  .sg-rapid-final-actions {
    gap: 10px;
  }
  
  .sg-rapid-retry,
  .sg-rapid-exit {
    font-size: 14px;
    padding: 10px 20px;
  }
  
  .sg-rapid-retry span:first-child,
  .sg-rapid-exit span:first-child {
    font-size: 16px;
  }
  
  /* Bouton quitter le mode révision sur mobile */
  #sg-back-to-all {
    top: 8px; /* Réduit l'espace en haut sur mobile */
    font-size: 14px;
    padding: 10px 18px;
    max-width: 250px;
  }
}

/* Boutons de validation pour mode rapide */
.sg-rapid-validation {
  display: none;
  flex-direction: row;
  gap: 15px;
  justify-content: center;
  margin-top: 15px;
  align-items: center;
  width: 100%;
  flex-wrap: nowrap;
}

.sg-rapid-validation.active {
  display: flex;
}

.sg-validation-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  flex-shrink: 0;
}

.sg-validation-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.sg-validation-btn.correct {
  color: #059669;
}

.sg-validation-btn.correct:hover {
  background: rgba(5, 150, 105, 0.1);
  border-color: rgba(5, 150, 105, 0.3);
}

.sg-validation-btn.incorrect {
  color: #dc2626;
}

.sg-validation-btn.incorrect:hover {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.3);
}

/* Bouton statistiques */
.sg-stats-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 16px;
  width: 40px;
  height: 40px;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08),
              0 4px 16px rgba(0, 0, 0, 0.06),
              inset 0 1px 0 rgba(255, 255, 255, 0.8);
  z-index: 10;
}

.sg-stats-btn::before {
  content: '';
  position: relative;
  width: 16px;
  height: 14px;
  background: 
    linear-gradient(to right, #ff6b35 0px, #ff6b35 16px, transparent 16px) 0px 0px / 16px 2px no-repeat,
    linear-gradient(to right, #3b82f6 0px, #3b82f6 12px, transparent 12px) 0px 6px / 12px 2px no-repeat,
    linear-gradient(to right, #1e3a8a 0px, #1e3a8a 8px, transparent 8px) 0px 12px / 8px 2px no-repeat;
  border-radius: 1px;
}

.sg-stats-btn.visible {
  display: flex;
}

.sg-stats-btn:hover {
  transform: translateY(-2px) scale(1.05);
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12),
              0 8px 24px rgba(0, 0, 0, 0.08),
              inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.15);
}

.sg-stats-btn:hover::before {
  background: 
    linear-gradient(to right, #ff6b35 0px, #ff6b35 16px, transparent 16px) 0px 0px / 16px 2px no-repeat,
    linear-gradient(to right, #3b82f6 0px, #3b82f6 12px, transparent 12px) 0px 6px / 12px 2px no-repeat,
    linear-gradient(to right, #1e3a8a 0px, #1e3a8a 8px, transparent 8px) 0px 12px / 8px 2px no-repeat;
  filter: brightness(1.1);
}

.sg-stats-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1),
              inset 0 0 1px rgba(255, 255, 255, 0.6);
}

/* Popup statistiques */
.sg-stats-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15),
              0 10px 25px rgba(0, 0, 0, 0.1),
              inset 0 0 1px rgba(255, 255, 255, 0.8);
  max-width: 550px;
  width: 90%;
  max-height: 85vh;
  overflow: hidden;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sg-stats-popup.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.sg-stats-header {
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.7) 0%, 
    rgba(255, 255, 255, 0.4) 50%,
    rgba(255, 255, 255, 0.6) 100%);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  color: #1a1a1a;
  padding: 28px 24px;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08),
              0 1px 0 rgba(255, 255, 255, 0.9) inset,
              0 -1px 0 rgba(0, 0, 0, 0.03) inset;
  overflow: hidden;
}

.sg-stats-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 20% 80%, 
    rgba(255, 107, 53, 0.15) 0%, 
    transparent 50%),
    radial-gradient(circle at 80% 20%, 
    rgba(41, 108, 209, 0.1) 0%, 
    transparent 50%),
    radial-gradient(circle at 40% 40%, 
    rgba(255, 255, 255, 0.3) 0%, 
    transparent 50%);
  animation: liquidMove 20s ease-in-out infinite;
  pointer-events: none;
}

@keyframes liquidMove {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-30px, -30px) scale(1.1); }
  66% { transform: translate(30px, -30px) scale(0.9); }
}

.sg-stats-header h3 {
  margin: 0;
  color: #1a1a1a;
  font-size: 21px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  z-index: 1;
  text-align: center;
}

.sg-stats-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(0, 0, 0, 0.08);
  border: none;
  color: #555;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 1;
}

.sg-stats-close:hover {
  background: rgba(255, 107, 53, 0.1);
  color: #ff6b35;
  transform: rotate(90deg);
}

.sg-stats-body {
  padding: 25px;
  overflow-y: auto;
  max-height: calc(85vh - 100px);
  background: rgba(255, 255, 255, 0.3);
}

.sg-stats-current {
  display: none;
}

.sg-stats-current h4 {
  margin: 0 0 10px 0;
  color: #ff6b35;
  font-size: 16px;
}

.sg-stats-progress {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-bottom: 10px;
}

.sg-progress-bar {
  flex: 1;
  height: 8px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.sg-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #059669 0%, #10b981 100%);
  transition: width 0.3s ease;
}

.sg-stats-score {
  font-weight: 600;
  color: #333;
}

/* Graphique de progression */
.sg-stats-chart-container {
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05),
              inset 0 0 1px rgba(255, 255, 255, 0.8);
}

.sg-stats-chart-title {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sg-stats-chart {
  width: 100%;
  height: 200px;
  position: relative;
}

.sg-stats-chart canvas {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

.sg-stats-history {
  margin-top: 30px;
}

.sg-stats-history h4 {
  margin: 0 0 16px 0;
  color: #1a1a1a;
  font-size: 17px;
  font-weight: 700;
}

.sg-stats-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  margin-bottom: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.sg-stats-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.7);
}

.sg-stats-date {
  color: #555;
  font-size: 14px;
  font-weight: 500;
}

.sg-stats-result {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sg-stats-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

.sg-stats-badge.good {
  background: rgba(5, 150, 105, 0.15);
  color: #059669;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.2);
}

.sg-stats-badge.bad {
  background: rgba(220, 38, 38, 0.15);
  color: #dc2626;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}

.sg-stats-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.sg-stats-overlay.active {
  opacity: 1;
  visibility: visible;
}



/* Media query mobile pour révision rapide */
@media (max-width: 600px) {
  .sg-rapid-section {
    margin: 12px auto 16px;
    padding: 14px 16px;
    width: 100%;
    max-width: 400px;
    min-height: 180px;
  }
  
  .sg-rapid-header {
    flex-direction: column;
    gap: 12px;
    align-items: center;
    justify-content: center;
  }
  
  .sg-rapid-title-group {
    width: 100%;
    justify-content: center;
  }
  
  .sg-rapid-title {
    font-size: 20px;
  }
  
  .sg-rapid-counter {
    font-size: 14px;
    padding: 3px 10px;
    margin-left: 8px;
  }
  
  .sg-rapid-icon {
    font-size: 20px;
    transform: translateY(-6px);
  }
  
  .sg-rapid-controls {
    width: 100%;
  }
  
  .sg-rapid-toggle {
    width: 100%;
    flex: 1;
    padding: 10px 20px;
    font-size: 15px;
    max-width: 180px;
    margin: 0 auto;
    display: block;
  }
  
  .sg-rapid-text {
    font-size: 15px;
  }
  
  .sg-rapid-slider-container {
    width: 100%;
    max-width: 100%;
    flex-direction: row;
    justify-content: center;
    gap: 10px;
  }
  
  .sg-rapid-slider-label {
    font-size: 14px;
  }
  
  .sg-rapid-slider-value {
    font-size: 16px;
    width: 36px;
    height: 36px;
  }
  
  .sg-rapid-slider {
    width: auto;
    flex: 0 1 150px;
  }
  
  .sg-rapid-slider::-webkit-slider-thumb,
  .sg-rapid-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
  }
  
  .sg-stats-btn {
    bottom: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  
  .sg-stats-popup {
    width: 95%;
    max-width: 350px;
  }
}

/* ===== Timer pour révision rapide ===== */
.sg-timer {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
  backdrop-filter: blur(10px);
  color: #296cd1;
  padding: 8px 16px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  display: none;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.sg-card-front .sg-timer {
  background: rgba(255, 255, 255, 0.9);
  color: #007BFF;
}

.sg-card.flipped .sg-timer {
  background: rgba(0, 123, 255, 0.1);
  color: #007BFF;
}

.sg-timer.active {
  display: block;
  animation: timer-glow 2s ease-in-out infinite;
}

@keyframes timer-glow {
  0%, 100% { 
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }
  50% { 
    box-shadow: 0 4px 20px rgba(41, 108, 209, 0.3);
  }
}

/* ===== Toggle Switch Normal/Difficile ===== */
.sg-difficulty-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.sg-difficulty-label {
  font-size: 14px;
  color: #445566;
  font-weight: 600;
  white-space: nowrap;
}

.sg-rapid-section.difficult-mode .sg-difficulty-label {
  color: #ffffff;
}

.sg-difficulty-switch {
  position: relative;
  width: 56px;
  height: 28px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 34px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sg-difficulty-switch.active {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  border-color: rgba(220, 38, 38, 0.3);
  box-shadow: 0 0 20px rgba(220, 38, 38, 0.2);
}

.sg-difficulty-slider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.sg-difficulty-switch.active .sg-difficulty-slider {
  transform: translateX(28px);
}

/* Container pour le toggle switch centré */
.sg-difficulty-container {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 8px;
  margin-bottom: 4px;
}



/* ===== Mode difficile (mode sombre) pour révision rapide ===== */
.sg-rapid-section.difficult-mode {
  background: linear-gradient(135deg, #0e0f2b, #241744, #360b25);
  box-shadow: 0 0 40px rgba(0, 140, 255, 0.3),
              0 0 60px rgba(255, 122, 0, 0.15),
              0 0 80px rgba(255, 122, 0, 0.1) inset;
  border: 1px solid rgba(97, 211, 255, 0.3);
  overflow: hidden;
  min-height: 200px;
  /* Mêmes dimensions que le mode normal */
  padding: 16px 20px;
  margin: 12px auto 16px;
}

.sg-rapid-section.difficult-mode::before {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 20px rgba(0, 140, 255, 0.2) inset,
              0 0 10px rgba(255, 255, 255, 0.05) inset;
}

.sg-rapid-section.difficult-mode::after {
  opacity: 0.6;
  mix-blend-mode: overlay;
}

/* Animation de scan pour le mode difficile */
@keyframes difficultScan {
  0% {
    transform: translateY(-100%) scaleX(0.8);
    opacity: 0;
  }
  5% {
    opacity: 0.2;
  }
  15% {
    opacity: 0.4;
    transform: translateY(-80%) scaleX(1);
  }
  85% {
    opacity: 0.4;
    transform: translateY(80%) scaleX(1);
  }
  95% {
    opacity: 0.2;
  }
  100% {
    transform: translateY(100%) scaleX(0.8);
    opacity: 0;
  }
}

.sg-rapid-section.difficult-mode .sg-scan-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(97, 211, 255, 0.6) 20%,
    rgba(97, 211, 255, 0.8) 50%, 
    rgba(97, 211, 255, 0.6) 80%,
    transparent 100%);
  box-shadow: 0 0 8px rgba(97, 211, 255, 0.5),
              0 0 16px rgba(97, 211, 255, 0.3),
              0 0 24px rgba(97, 211, 255, 0.2);
  animation: difficultScan 5s ease-in-out infinite;
  pointer-events: none;
  z-index: 3;
}

.sg-rapid-section.difficult-mode .sg-scan-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: inherit;
  box-shadow: inherit;
  animation: difficultScan 5s ease-in-out infinite;
  animation-delay: 2.5s;
}

.sg-rapid-section.difficult-mode .sg-rapid-header {
  margin-bottom: 12px;
  padding-top: 0;
  margin-top: 0;
}

.sg-rapid-section.difficult-mode .sg-rapid-icon {
  color: #ff6600;
  filter: drop-shadow(0 0 4px #ff6600);
}

.sg-rapid-section.difficult-mode .sg-rapid-title {
  color: #61d3ff;
  font-weight: 700;
  text-shadow: 0 0 5px rgba(97, 211, 255, 0.3);
  /* Mêmes propriétés que le mode normal */
  font-size: 24px;
  line-height: 1;
  margin: 0;
  letter-spacing: -0.5px;
}

.sg-rapid-section.difficult-mode .sg-rapid-slider-label {
  color: #7aa0c5;
  /* Mêmes propriétés que le mode normal */
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.sg-rapid-section.difficult-mode .sg-rapid-slider-value {
  /* Mêmes propriétés que le mode normal mais avec couleur adaptée */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  font-weight: 700;
  color: #ff911c;
  font-size: 20px;
  box-shadow: 0 0 8px rgba(255, 145, 28, 0.4);
  transition: all 0.5s ease;
  flex: 0 0 auto;
}

.sg-rapid-section.difficult-mode .sg-rapid-slider {
  background: rgba(255, 255, 255, 0.2);
  height: 6px;
  border-radius: 3px;
  /* Mêmes propriétés que le mode normal */
  flex: 0 1 200px;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  position: relative;
  overflow: visible;
  margin: 0;
  box-shadow: none;
}

.sg-rapid-section.difficult-mode .sg-rapid-slider::before {
  background: #ff7a00;
  box-shadow: 0 0 6px rgba(255, 122, 0, 0.6);
}

.sg-rapid-section.difficult-mode .sg-rapid-slider::-webkit-slider-thumb {
  background: #ff7a00;
  border: none;
  width: 20px;
  height: 20px;
  box-shadow: 0 0 0 3px #1a1a1a,
              0 0 10px rgba(255, 122, 0, 0.6);
}

.sg-rapid-section.difficult-mode .sg-rapid-slider::-moz-range-thumb {
  background: #ff7a00;
  border: none;
  width: 20px;
  height: 20px;
  box-shadow: 0 0 0 3px #1a1a1a,
              0 0 10px rgba(255, 122, 0, 0.6);
}

.sg-rapid-section.difficult-mode .sg-rapid-toggle {
  /* Exactement les mêmes dimensions que le mode normal */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ff3e3e, #ff9e2c);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: visible;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 6px 20px rgba(255, 62, 62, 0.3);
  white-space: nowrap;
  width: 100%;
  max-width: 220px;
  margin: 0 auto;
  display: block;
  transform: translateY(0);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5px;
  box-sizing: border-box;
}

.sg-rapid-section.difficult-mode .sg-rapid-toggle:hover {
  transform: scale(1.03) translateY(-2px);
  box-shadow: 0 0 20px rgba(255, 100, 0, 0.5),
              inset 0 -2px 8px rgba(255, 255, 255, 0.1);
}

.sg-rapid-section.difficult-mode .sg-rapid-toggle:active {
  transform: scale(1.01) translateY(0);
  box-shadow: 0 0 15px rgba(255, 62, 62, 0.4),
              inset 0 -1px 4px rgba(255, 255, 255, 0.1);
}

.sg-rapid-section.difficult-mode .sg-rapid-toggle.active {
  background: linear-gradient(135deg, #4a4a4a, #2a2a2a);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2) inset;
}

.sg-rapid-section.difficult-mode .sg-stats-btn {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(97, 211, 255, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3),
              0 0 20px rgba(0, 140, 255, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.sg-rapid-section.difficult-mode .sg-stats-btn::before {
  background: 
    linear-gradient(to right, #ff6600 0px, #ff6600 16px, transparent 16px) 0px 0px / 16px 2px no-repeat,
    linear-gradient(to right, #61d3ff 0px, #61d3ff 12px, transparent 12px) 0px 6px / 12px 2px no-repeat,
    linear-gradient(to right, #ff911c 0px, #ff911c 8px, transparent 8px) 0px 12px / 8px 2px no-repeat;
  filter: brightness(1.2) saturate(1.3);
}

.sg-rapid-section.difficult-mode .sg-stats-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4),
              0 0 30px rgba(0, 140, 255, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transform: translateY(-2px) scale(1.05);
  border-color: rgba(97, 211, 255, 0.5);
}

.sg-rapid-section.difficult-mode .sg-rapid-slider:hover {
  background: #3a3a4a;
}

.sg-rapid-section.difficult-mode .sg-rapid-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 0 0 3px #1a1a1a,
              0 0 15px rgba(255, 122, 0, 0.8);
}

.sg-rapid-section.difficult-mode .sg-rapid-slider::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 0 0 3px #1a1a1a,
              0 0 15px rgba(255, 122, 0, 0.8);
}

/* Media query mobile pour Mode difficile */
@media (max-width: 600px) {
  .sg-difficulty-toggle {
    gap: 8px;
  }
  
  .sg-difficulty-label {
    font-size: 13px;
  }
  
  .sg-difficulty-switch {
    width: 48px;
    height: 24px;
  }
  
  .sg-difficulty-slider {
    width: 18px;
    height: 18px;
  }
  
  .sg-difficulty-switch.active .sg-difficulty-slider {
    transform: translateX(24px);
  }
  
  .sg-difficulty-container {
    margin-top: 10px;
  }
  
  .sg-rapid-close {
    width: 28px;
    height: 28px;
    top: 4px;
    right: 4px;
    font-size: 16px;
  }
  
  .sg-rapid-section.difficult-mode .sg-rapid-slider-value {
    font-size: 16px;
    padding: 1px 6px;
  }
  
  .sg-rapid-section.difficult-mode {
    padding: 14px 16px;
    min-height: 180px;
  }
  
  .sg-rapid-section.difficult-mode .sg-scan-line {
    height: 1.5px;
  }
  
  .sg-rapid-section.difficult-mode .sg-rapid-toggle {
    /* Exactement les mêmes dimensions que le mode normal sur mobile */
    padding: 10px 20px;
    font-size: 15px;
    max-width: 180px;
    width: 100%;
    margin: 0 auto;
    display: block;
  }
  
  .sg-rapid-section.difficult-mode .sg-rapid-slider-value {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  
  .sg-rapid-section.difficult-mode .sg-rapid-slider {
    flex: 0 1 150px;
  }
  
  .sg-rapid-section.difficult-mode .sg-rapid-title {
    font-size: 20px;
  }
  
  .sg-rapid-section.difficult-mode .sg-rapid-slider-label {
    font-size: 14px;
  }
  
  /* Fix pour le curseur du slider sur mobile */
  .sg-rapid-slider {
    overflow: visible !important;
    z-index: 1;
  }
  
  .sg-rapid-slider-container {
    overflow: visible !important;
  }
  
  .sg-rapid-slider::-webkit-slider-thumb,
  .sg-rapid-slider::-moz-range-thumb {
    z-index: 20 !important;
    position: relative;
  }
}

/* ===== Bouton favoris sur les cartes ===== */
.sg-favorite-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  /* Fond avec effet glassmorphism */
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.2) 0%,
    rgba(255, 255, 255, 0.1) 100%
  );
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.3s;
  z-index: 10;
  /* Ombre plus subtile */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sg-favorite-btn:hover {
  transform: scale(1.1);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.25) 0%,
    rgba(255, 255, 255, 0.15) 100%
  );
}

.sg-favorite-btn.active {
  /* Fond dégradé bleu assorti au thème de l'app */
  background: linear-gradient(135deg, #296cd1 17%, #100f5b 81%);
  color: white;
}

/* ===== Bouton "Mes cartes à revoir" ===== */
.sg-review-btn {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #666;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: none;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: center;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.sg-review-btn:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sg-review-btn:disabled {
  background: #ddd;
  cursor: not-allowed;
  box-shadow: none;
}

.sg-review-count {
  background: rgba(0, 0, 0, 0.1);
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}

/* Bouton quitter le mode révision */
#sg-back-to-all {
  /* Même style que sg-rapid-toggle mais en gris */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: visible;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 6px 20px rgba(107, 114, 128, 0.3);
  white-space: nowrap;
  width: 100%;
  max-width: 220px;
  margin: 15px auto;
  display: block;
  transform: translateY(0);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5px;
  box-sizing: border-box;
}

/* Bouton quitter la révision rapide */
#sg-rapid-quit {
  /* Même style que sg-rapid-toggle mais en gris */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: visible;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 6px 20px rgba(107, 114, 128, 0.3);
  white-space: nowrap;
  width: 100%;
  max-width: 220px;
  margin: 20px auto 15px; /* Plus d'espace en haut pour séparer des boutons de validation */
  display: block;
  transform: translateY(0);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.5px;
  box-sizing: border-box;
}

#sg-back-to-all:hover,
#sg-rapid-quit:hover {
  transform: scale(1.03) translateY(-2px);
  box-shadow: 0 8px 25px rgba(107, 114, 128, 0.4);
  background: linear-gradient(135deg, #5a606d 0%, #3a4149 100%);
}

#sg-back-to-all:active,
#sg-rapid-quit:active {
  transform: scale(1.01) translateY(0);
  box-shadow: 0 4px 15px rgba(107, 114, 128, 0.3);
}

@media (max-width: 600px) {
  #sg-back-to-all {
    /* Même style que sg-rapid-toggle sur mobile */
    padding: 10px 20px;
    font-size: 15px;
    max-width: 180px;
    margin: 10px auto;
  }
  
  #sg-rapid-quit {
    /* Même style que sg-rapid-toggle sur mobile */
    padding: 10px 20px;
    font-size: 15px;
    max-width: 180px;
    margin: 15px auto 10px; /* Plus d'espace en haut sur mobile aussi */
  }
}

/* Popup d'authentification unifié */
.auth-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.auth-popup-overlay.show {
  opacity: 1;
}

.auth-popup-content {
  background: white;
  padding: 30px;
  border-radius: 16px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transform: translateY(20px);
  transition: transform 0.3s ease;
  position: relative;
}

.auth-popup-overlay.show .auth-popup-content {
  transform: translateY(0);
}

.auth-popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  padding: 5px 10px;
  transition: color 0.2s;
}

.auth-popup-close:hover {
  color: #333;
}

.auth-popup-content h3 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 1.5em;
}

.auth-popup-content p {
  margin: 0 0 20px 0;
  color: #666;
  line-height: 1.5;
}

.auth-popup-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.auth-popup-btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 16px;
  border: none;
}

.auth-popup-btn.primary {
  background: radial-gradient(circle at bottom left, #296cd1 17%, #100f5b 81%);
  color: white;
}

.auth-popup-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(41, 108, 209, 0.3);
}

.auth-popup-btn.secondary {
  background: rgba(41, 108, 209, 0.1);
  color: #296cd1;
  border: 2px solid #296cd1;
}

.auth-popup-btn.secondary:hover {
  background: rgba(41, 108, 209, 0.15);
  transform: translateY(-2px);
}

/* Message informatif pour les cartes vides */
.info-message {
  margin: 20px 0;
  animation: slideInFade 0.5s ease-out;
}

@keyframes slideInFade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Message moderne "Aucune carte à revoir" */
.sg-no-cards-message {
  position: relative;
  margin: 20px auto;
  max-width: 500px;
  animation: slideInUp 0.4s ease-out;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sg-no-cards-box {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border: 2px solid #e8e8e8;
  border-radius: 16px;
  padding: 40px 30px;
  text-align: center;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.sg-no-cards-box:hover {
  box-shadow: 0 15px 40px rgba(108, 92, 231, 0.15);
  border-color: #e0d9ff;
}

.sg-no-cards-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 36px;
  height: 36px;
  border: none;
  background: #f0f0f0;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  color: #666;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.sg-no-cards-close:hover {
  background: #6c5ce7;
  color: white;
  transform: rotate(90deg);
}

.sg-no-cards-icon {
  margin: 0 auto 20px;
  width: 48px;
  height: 48px;
  position: relative;
}

.sg-no-cards-icon svg {
  width: 100%;
  height: 100%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.sg-no-cards-title {
  font-size: 24px;
  font-weight: 700;
  color: #2c3e50;
  margin: 0 0 10px 0;
  letter-spacing: -0.5px;
}

.sg-no-cards-category {
  font-size: 16px;
  color: #7f8c8d;
  margin: 0 0 20px 0;
}

.sg-no-cards-category strong {
  color: #6c5ce7;
  font-weight: 600;
}

.sg-no-cards-text {
  font-size: 15px;
  color: #555;
  line-height: 1.6;
  margin: 0;
}

.sg-no-cards-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: #6c5ce7;
  color: white;
  border-radius: 6px;
  font-size: 16px;
  margin: 0 4px;
  vertical-align: middle;
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}

/* Icône de succès pour la liste vidée */
.sg-no-cards-box svg path[stroke="#4ade80"] {
  stroke: #4ade80;
}

/* Animation shake pour éviter les duplicatas */
.sg-shake {
  animation: shake 0.6s ease-in-out;
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-10px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(10px);
  }
}

/* Bouton en cours de traitement */
.sg-review-btn.sg-processing {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Responsive pour la boîte "Aucune carte" */
@media (max-width: 600px) {
  .sg-no-cards-box {
    padding: 30px 20px;
  }
  
  .sg-no-cards-title {
    font-size: 20px;
  }
  
  .sg-no-cards-close {
    width: 32px;
    height: 32px;
    font-size: 20px;
    top: 10px;
    right: 10px;
  }
}

/* Responsive pour le popup */
@media (max-width: 600px) {
  .auth-popup-content {
    padding: 20px;
    margin: 10px;
  }
  
  .auth-popup-content h3 {
    font-size: 1.3em;
  }
  
  .auth-popup-buttons {
    flex-direction: column;
  }
  
  .auth-popup-btn {
    width: 100%;
  }
}

.sg-progress-bar {
  position: relative;
  height: 12px;
  background-color: #e0e0e0;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 20px;
}

.sg-progress-inner {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #0062ff, #0050cc);
  transition: width 0.6s ease;
  position: relative;
}

.sg-progress-inner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255,255,255,.05) 0, rgba(255,255,255,.35) 50%, rgba(255,255,255,.05) 100%);
  background-size: 250% 100%;
  animation: progress-shine 3.5s linear infinite;
  mix-blend-mode: overlay;
}

@keyframes progress-shine {
  0% { background-position: 250% 0; }
  100% { background-position: -250% 0; }
}

#sg-restart { display: none; }

.sg-card {
  width: 100%;
  min-height: 220px;
  height: 220px; /* Hauteur équilibrée */
  perspective: 1000px;
  cursor: pointer;
  margin-bottom: 10px; /* Marge réduite pour rapprocher les boutons */
  border-radius: 20px;
  overflow: visible;
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
  contain: layout style; /* Optimisation du rendu pour réduire le CLS */
}



.sg-card-inner {
  position: relative;
  width: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  border-radius: 20px;
}

.sg-card.flipped .sg-card-inner {
  transform: rotateY(180deg);
}



.sg-card-front,
.sg-card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%; /* Hauteur 100% du parent */
  min-height: 220px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  -moz-backface-visibility: hidden;
  border-radius: 20px;
  padding: 20px; /* Padding restauré */
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Fix spécifique Firefox pour éviter que le contenu apparaisse au dos */
@-moz-document url-prefix() {
  .sg-card.flipped .sg-card-front {
    visibility: hidden;
  }
}

.sg-card-front {
  position: relative;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  overflow: hidden;
  background-image: url('../Flashcards%20background/Background%20Flashcard.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

}

/* Effet glassmorphism overlay - Version améliorée */
.sg-card-front::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  backdrop-filter: blur(6px) contrast(0.9);
  -webkit-filter: blur(0.3px);
}

/* S'assurer que le contenu est au-dessus du glassmorphism */
.sg-card-front > * {
  position: relative;
  z-index: 2;
}

/* Support fallback pour les navigateurs qui ne supportent pas backdrop-filter */
@supports not (backdrop-filter: blur(1px)) {
  .sg-card-front::before {
    background: 
      linear-gradient(
        to bottom,
        rgba(0, 123, 255, 0.6) 0%,
        rgba(0, 123, 255, 0.7) 50%,
        rgba(0, 0, 0, 0.85) 100%
      ),
      rgba(255, 255, 255, 0.3);
  }
}

/* Amélioration de la lisibilité du texte */
.sg-card-front p,
.sg-card-front span,
.sg-card-front div {
  font-weight: 600;
}

/* Style du timer sur les flashcards */
.sg-card-front .sg-timer {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.sg-card-front img {
  max-width: 180px;
  max-height: 150px; /* Hauteur ajustée */
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0; /* Suppression de la marge pour éviter la zone cliquable vide */
  display: block;
  /* Animation d'entrée pour l'image du panneau */
  animation: fadeInScale 0.5s ease-out;
  /* Fix pour Firefox - empêche l'image de rester visible au dos */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  -moz-backface-visibility: hidden;
  will-change: transform; /* Optimisation GPU */
  pointer-events: none; /* L'image elle-même n'est pas cliquable */
}

/* Réinitialiser les styles supplémentaires de .sg-card-front */
.sg-card-front {
  width: 100%; /* S'assurer que le conteneur prend toute la largeur pour le centrage flex */
}

/* Ajustements mobile */
@media (max-width: 600px) {
  .sg-card {
    min-height: 200px;
    height: 200px;
  }
  
  .sg-card-front,
  .sg-card-back {
    min-height: 200px;
    padding: 15px;
  }
  
  .sg-card-front img {
    max-width: 150px;
    max-height: 130px;
  }
  
  .sg-card-back {
    font-size: 14px;
  }
}

.sg-card-back {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(248, 249, 250, 0.95) 100%
  );
  color: #333;
  transform: rotateY(180deg);
  font-size: 15px; /* Taille de police légèrement réduite */
  text-align: center;
  padding: 20px; /* Padding aligné avec .sg-card-front */
  border: 2px solid rgba(0, 123, 255, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow-y: auto; /* Au cas où le texte est trop long */
  line-height: 1.5; /* Meilleure lisibilité */
}

@keyframes slideOutLeft  { from{transform:translateX(0);opacity:1;} to{transform:translateX(-100%);opacity:0;} }
@keyframes slideInRight { from{transform:translateX(100%);opacity:0;} to{transform:translateX(0);opacity:1;} }
@keyframes slideOutRight{ from{transform:translateX(0);opacity:1;} to{transform:translateX(100%);opacity:0;} }
@keyframes slideInLeft  { from{transform:translateX(-100%);opacity:0;} to{transform:translateX(0);opacity:1;} }

.sg-card.slide-out-left   { animation: slideOutLeft 0.3s forwards; }
.sg-card.slide-in-right  { animation: slideInRight 0.3s forwards; }
.sg-card.slide-out-right { animation: slideOutRight 0.3s forwards; }
.sg-card.slide-in-left   { animation: slideInLeft 0.3s forwards; }

.sg-navigation {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 5px; /* Marge réduite pour rapprocher des cartes */
  position: relative;
  z-index: 10;
}

.sg-nav-button {
  background: radial-gradient(circle at bottom left, #296cd1 17%, #100f5b 81%);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.sg-nav-button:disabled {
  background: #ccc;
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.6;
}

.sg-nav-button:hover:not(:disabled) {
  transform: translateY(-3px);
}

/* ===== Styles pour le lecteur vidéo SIMPLE ===== */
.video-container {
  width: 100%;
  margin: 20px 0;
}

.video-wrapper {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
  background: #f0f0f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 12px;
}

.cours-header {
  color: #007BFF;
  margin-bottom: 20px;
  font-size: 24px;
  font-weight: 700;
}

.cours-intro {
  text-align: left;
  line-height: 1.6;
  color: #333;
  margin-bottom: 25px;
  padding: 0 10px;
}

/* ===== Styles pour les Duels ===== */
.duel-section {
  padding: 20px 0;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Profile Creation */
.profile-form {
  max-width: 400px;
  margin: 0 auto;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #333;
}

.form-group input {
  width: 100%;
  padding: 10px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
}

.avatar-selection {
  margin-top: 20px;
}

.avatar-selection label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  color: #333;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  margin-top: 20px;
  background: #f8f9fa;
  padding: 15px;
  border-radius: 12px;
}

@media (max-width: 600px) {
  .avatar-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.avatar-option {
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid #e9ecef;
  background: white;
  border-radius: 8px;
  font-size: 28px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

.avatar-option:hover {
  border-color: #667eea;
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(102,126,234,0.15);
}

.avatar-option.selected {
  border-color: #667eea;
  background: #667eea;
  color: white;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.create-profile-btn {
  width: 100%;
  padding: 14px 20px;
  background: radial-gradient(circle at bottom left, #296cd1 17%, #100f5b 81%);
  color: white;
  border: none;
  border-radius: 50px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(41, 108, 209, 0.4);
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.create-profile-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 6px 30px rgba(41, 108, 209, 0.5);
}

.create-profile-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Player Info Bar */
.player-info-bar {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.2fr;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 20px;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.3) inset;
  position: relative;
  overflow: hidden;
}

@media (max-width: 600px) {
  .player-info-bar {
    grid-template-columns: 1fr 1.2fr 1.2fr;
    gap: 8px;
    padding: 14px 8px;
    margin-bottom: 16px;
  }
}

.player-profile-col1 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.player-profile-col2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.player-profile-col3 {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
}

.player-name-display {
  font-size: 1.25em;
  font-weight: 700;
  color: #222;
  margin-bottom: 4px;
  text-align: center;
}

@media (max-width: 600px) {
  .player-name-display {
    font-size: 1.1em;
  }
}

.player-avatar-display {
  margin: 0 auto 0 auto;
  font-size: 34px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
  padding: 8px;
  border-radius: 12px;
  position: relative;
}

.player-avatar-display:hover {
  transform: scale(1.15);
  background: rgba(102, 126, 234, 0.1);
}

.player-avatar-display::after {
  content: '✏️';
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: #667eea;
  color: white;
  font-size: 14px;
  width: 22px;
  height: 22px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease;
}

.player-avatar-display:hover::after {
  opacity: 1;
  transform: scale(1);
}

/* Style pour les visiteurs non connectés */
.player-avatar-display.visitor {
  cursor: default !important;
  opacity: 0.7;
  background: rgba(0, 0, 0, 0.05);
}

.player-avatar-display.visitor:hover {
  background: rgba(41, 108, 209, 0.1);
  transform: scale(1.05);
}

.player-avatar-display.visitor::after {
  display: none; /* Pas de crayon pour les visiteurs */
}

.player-ranking-motiv {
  text-align: center;
  margin-bottom: 4px;
}

.ranking-label {
  font-size: 1.1em;
  font-weight: 700;
  color: #667eea;
}

.ranking-motivation {
  font-size: 1em;
  color: #28a745;
  font-weight: 600;
  margin-top: 2px;
}

.player-stats {
  display: flex;
  flex-direction: row;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  font-size: 1em;
}

@media (max-width: 600px) {
  .player-stats {
    font-size: 0.95em;
    gap: 6px;
  }
}

#deleteProfile:hover {
  color: #dc3545 !important;
  transform: scale(1.1);
}

/* Upcoming Features */
.upcoming-features {
  /* background, padding et border-radius supprimés pour un rendu plus large */
}

.upcoming-features h4 {
  color: #333;
  margin-bottom: 10px;
}

.upcoming-features ul {
  text-align: left;
  color: #666;
  margin: 0;
  padding-left: 20px;
}

/* Matchmaking Compact */
.matchmaking-compact {
  text-align: center;
  padding: 40px 36px;
  background-color: transparent; /* Pas de fond coloré initial */
  background-image: url('../Duels/background - recherche adversaire.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 20px;
  border: 2px solid transparent;
  background-clip: padding-box;
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.35),
    0 8px 16px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  animation: fadeInScale 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 380px;
  margin: 0 auto;
}

/* Belle bordure animée - SUPPRIMÉE pour éviter le fond mauve */
/* La bordure blanche est maintenant gérée directement dans .matchmaking-compact */

/* Animation borderGradient supprimée - plus utilisée */

/* Glassmorphism overlay amélioré */
.matchmaking-compact > .glass-overlay {
  content: '';
  position: absolute;
  inset: 0;
  /* Pas de background - seulement le backdrop-filter pour éviter le fond mauve */
  backdrop-filter: blur(16px) brightness(1.05) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) brightness(1.05) saturate(1.2);
  z-index: 0;
  pointer-events: none;
  border-radius: 18px;
}

/* Ensure all content is above the glassmorphism layer */
.matchmaking-compact > *:not(.glass-overlay) {
  position: relative;
  z-index: 5;
}





body.duel-fullscreen-active {
  overflow: hidden;
  touch-action: none;
}

body.duel-active .auth-bar,
body.duel-active .tab-menu-container,
body.duel-active #globalTabMenu,
body.duel-active #bottomNavigation,
body.duel-active .modern-bottom-nav,
body.duel-active .modern-top-nav {
  display: none !important;
}

body.duel-active .sg-instructions {
  display: none !important;
}

.duel-fullscreen-layer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  padding: calc(env(safe-area-inset-top, 0px) + 24px)
           clamp(18px, 4vw, 40px)
           calc(env(safe-area-inset-bottom, 0px) + 32px);
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  overflow: hidden;
  z-index: 10050;
}

.duel-fullscreen-layer.is-visible {
  display: flex !important;
}

.duel-fullscreen-content {
  width: min(1024px, 100%);
  max-height: calc(100vh - (env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px) + 56px));
  background: #ffffff;
  border-radius: 28px;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.18);
  padding: clamp(20px, 3vw, 32px);
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3vw, 28px);
  overflow-y: auto;
}

.duel-fullscreen-content > * {
  width: 100%;
}

.duel-fullscreen-content > *:last-child {
  margin-bottom: 0;
}

.duel-fullscreen-layer .abandon-button-wrapper {
  display: flex;
  justify-content: center;
}

@media (max-width: 1024px) {
  .duel-fullscreen-layer {
    padding: calc(env(safe-area-inset-top, 0px) + 18px)
             clamp(12px, 5vw, 28px)
             calc(env(safe-area-inset-bottom, 0px) + 24px);
  }

  .duel-fullscreen-content {
    border-radius: 22px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.16);
  }
}

@media (max-width: 768px) {
  .duel-fullscreen-layer {
    padding: calc(env(safe-area-inset-top, 0px) + 12px)
             clamp(10px, 5vw, 20px)
             calc(env(safe-area-inset-bottom, 0px) + 20px);
    background: #ffffff;
  }

  .duel-fullscreen-content {
    width: 100%;
    max-height: none;
    min-height: calc(100vh - (env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px) + 32px));
    border-radius: 18px;
    box-shadow: none;
    overflow-y: auto;
  }
}

/* Loader moderne */
.matchmaking-loader {
  margin: 24px auto 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 70px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  width: 70px;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.15),
    inset 0 2px 4px rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 5;
}

.loader-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(102, 126, 234, 0.3);
  border-top: 3px solid #667eea;
  border-radius: 50%;
  animation: spin 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
  position: relative;
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
  z-index: 1;
}

.loader-spinner::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 3px solid transparent;
  border-top: 3px solid #764ba2;
  border-radius: 50%;
  animation: spin 2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite reverse;
}

.loader-spinner::after {
  content: '';
  position: absolute;
  inset: 11px;
  border: 3px solid transparent;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  animation: spin 3s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}



/* Titre de recherche amélioré */
.matchmaking-title {
  font-size: 21px;
  font-weight: 700;
  color: #212529;
  text-align: center;
  margin: 0 0 20px 0;
  letter-spacing: -0.3px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 5;
}

  /* Battle Header Compact */
.battle-header-compact {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 20px;
  /* L'image de fond est maintenant définie inline dans le HTML pour garantir le bon chemin */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 20px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 8px 32px rgba(44, 62, 80, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.2);
}

/* Glassmorphism overlay avec ton gris pour la lisibilité pendant le duel */
.battle-header-compact::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, 
    rgba(44, 62, 80, 0.5) 0%, 
    rgba(52, 73, 94, 0.45) 50%, 
    rgba(65, 81, 108, 0.5) 100%);
  backdrop-filter: blur(4px) saturate(180%);
  -webkit-backdrop-filter: blur(4px) saturate(180%);
  pointer-events: none;
  z-index: 0;
}

/* S'assurer que tout le contenu est au-dessus du glassmorphism */
.battle-header-compact > * {
  position: relative;
  z-index: 1;
}

.player-vs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 10px;
}

.player-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  min-width: 110px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.player-badge .player-name {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
  text-align: center;
  letter-spacing: 0.3px;
}

.player-badge .player-avatar {
  font-size: 34px;
}

.player-score-line {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.player-score {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.vs-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  position: relative;
}

.vs-center::before,
.vs-center::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.vs-center::before {
  left: 0;
}

.vs-center::after {
  right: 0;
}

.vs-text {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: -2px; /* Rapprocher du timer */
  opacity: 0.7;
}

.timer-compact {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(26, 26, 26, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 16px;
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
  color: #27ae60;
  text-shadow: 0 0 10px rgba(39, 174, 96, 0.5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 0 0 3px rgba(255, 255, 255, 0.2),
    0 4px 12px rgba(0, 0, 0, 0.4),
    inset 0 2px 4px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(3px);
}

.timer-compact::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: radial-gradient(circle at center, currentColor 0%, transparent 70%);
  opacity: 0.2;
  transition: all 0.3s;
}

.timer-compact::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 30%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), transparent);
  border-radius: 50%;
  opacity: 0.6;
}

.timer-compact.warning {
  color: #f39c12;
  text-shadow: 0 0 12px rgba(243, 156, 18, 0.8);
  box-shadow: 
    0 0 0 3px rgba(243, 156, 18, 0.2),
    0 4px 12px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(243, 156, 18, 0.4),
    inset 0 2px 4px rgba(0, 0, 0, 0.3);
  animation: none;
}

.timer-compact.warning::before {
  opacity: 0.3;
}

.timer-compact.danger {
  color: #e74c3c;
  text-shadow: 0 0 15px rgba(231, 76, 60, 1);
  box-shadow: 
    0 0 0 3px rgba(231, 76, 60, 0.3),
    0 4px 12px rgba(0, 0, 0, 0.4),
    0 0 25px rgba(231, 76, 60, 0.5),
    inset 0 2px 4px rgba(0, 0, 0, 0.3);
  animation: pulse-timer 0.5s infinite, timer-danger-pulse 1s infinite;
}

.timer-compact.danger::before {
  opacity: 0.4;
  animation: pulse-glow 0.5s infinite;
}

@keyframes timer-danger-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.6; }
}

/* Bouton d'abandon de duel moderne */
.abandon-button-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 40px; /* Marge importante pour éviter les clics accidentels */
  margin-bottom: 20px;
}

.abandon-duel-btn {
  background: #dc3545;
  color: white;
  border: none;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
  display: inline-block;
}

.abandon-duel-btn:hover {
  background: #c82333;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.abandon-duel-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
}

@media (max-width: 600px) {
  .abandon-button-wrapper {
    margin-top: 30px; /* Un peu moins sur mobile mais toujours suffisant */
    margin-bottom: 15px;
  }
  
  .abandon-duel-btn {
    padding: 8px 20px;
    font-size: 13px;
  }
  
  .player-badge .player-name {
    font-size: 12px;
    max-width: 80px;
  }
  
  .player-score {
    font-size: 16px;
  }
  
  .player-badge .player-avatar {
    font-size: 28px;
  }
  
  .vs-text {
    font-size: 10px;
    letter-spacing: 1.5px;
  }
  
  .timer-compact {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  
  .timer-compact::after {
    width: 50%;
    height: 25%;
  }
  
  .player-vs {
    padding: 0 5px;
  }
  
  .vs-center {
    padding: 0 10px;
  }
  
  .vs-center::before,
  .vs-center::after {
    height: 30px;
  }
  
  /* Avatar adversaire responsive */
  .battle-option.opponent-selected .opponent-avatar-img,
  .battle-option.opponent-selected .battle-option-avatar-emoji {
    width: 32px;
    height: 32px;
    bottom: 6px;
    right: 6px;
    font-size: 18px;
  }
}

/* Question Compact */
.question-compact {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 10px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 12px;
}

.question-counter {
  font-weight: 600;
  color: #667eea;
  white-space: nowrap;
}

.question-image-compact {
  max-height: 80px;
  max-width: 150px;
  object-fit: contain;
  margin: 0 auto;
  display: block;
}

/* Opponent Status Compact */
.opponent-status-compact {
  text-align: center;
  color: #666;
  font-style: italic;
  font-size: 14px;
  min-height: 20px;
  margin-bottom: 10px;
}

/* Battle Options Compact */
.battle-options-compact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 4px;
}

.battle-options-compact .battle-option {
  padding: 16px 20px;
  font-size: 15px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Results Compact */
.result-title-compact {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 15px;
  text-align: center;
}

.result-summary {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  margin-bottom: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 12px;
}

.final-score {
  font-size: 24px;
  font-weight: 800;
  color: #333;
}

.xp-gained {
  font-size: 20px;
  font-weight: 600;
  color: #28a745;
}

.result-actions-compact {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-menu {
  background: #6c757d;
  color: white;
}

.btn-menu:hover {
  background: #5a6268;
}

/* Animation d'entrée pour les options */
@keyframes slideInOption {
  from { 
    opacity: 0;
    transform: translateY(20px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

.battle-option {
  padding: 18px 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border: 1px solid rgba(102, 126, 234, 0.1);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  font-weight: 600;
  font-size: 15px;
  position: relative;
  overflow: visible;
  animation: slideInOption 0.3s ease-out backwards;
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.04),
    0 4px 8px rgba(0, 0, 0, 0.06);
  min-height: 65px;
  display: flex;
  align-items: center;
}

.battle-option:nth-child(1) { animation-delay: 0.1s; }
.battle-option:nth-child(2) { animation-delay: 0.2s; }
.battle-option:nth-child(3) { animation-delay: 0.3s; }
.battle-option:nth-child(4) { animation-delay: 0.4s; }

.battle-option:hover {
  background: linear-gradient(135deg, #ffffff 0%, #f0f2ff 100%);
  border-color: rgba(102, 126, 234, 0.3);
  transform: translateY(-3px);
  box-shadow: 
    0 4px 8px rgba(102, 126, 234, 0.15),
    0 8px 16px rgba(102, 126, 234, 0.1);
}

.battle-option[style*="pointer-events: none"] {
  cursor: not-allowed;
  opacity: 0.8;
}

.battle-option.selected {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
  box-shadow: 
    0 4px 12px rgba(102, 126, 234, 0.3),
    0 8px 24px rgba(102, 126, 234, 0.2);
}

.battle-option.correct {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  border-color: transparent;
  box-shadow: 
    0 4px 12px rgba(40, 167, 69, 0.3),
    0 8px 24px rgba(40, 167, 69, 0.2);
  animation: correctPulse 0.5s ease-out;
}

.battle-option.wrong {
  background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
  color: white;
  border-color: transparent;
  box-shadow: 
    0 4px 12px rgba(220, 53, 69, 0.3),
    0 8px 24px rgba(220, 53, 69, 0.2);
  animation: wrongShake 0.5s ease-out;
}

@keyframes correctPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes wrongShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-3px); }
  40%, 80% { transform: translateX(3px); }
}

/* Pour les avatars emoji - on les gère maintenant dans un span interne */
.battle-option.opponent-selected[data-opponent-avatar]:not([data-opponent-avatar*=".png"]):not([data-opponent-avatar*=".jpg"]):not([data-opponent-avatar*=".jpeg"]) .battle-option-avatar-emoji {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  
  /* Liquid glass moderne */
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.6));
  backdrop-filter: blur(8px) saturate(150%);
  -webkit-backdrop-filter: blur(8px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.3) inset;
  
  /* Animation d'apparition */
  animation: avatarSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 10;
}

/* Pour les avatars image - on utilise un élément supplémentaire via JavaScript */
.battle-option.opponent-selected .opponent-avatar-img {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  z-index: 10;
  
  /* Liquid glass moderne */
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.6));
  backdrop-filter: blur(8px) saturate(150%);
  -webkit-backdrop-filter: blur(8px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.3) inset;
  
  /* Animation d'apparition */
  animation: avatarSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  
  /* Effet de brillance */
  overflow: hidden;
}

/* Supprimé les effets de brillance complexes pour plus de simplicité */

/* Animation d'apparition moderne */
@keyframes avatarSlideIn {
  0% {
    transform: translateX(10px) scale(0.8);
    opacity: 0;
  }
  100% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

/* Supprimé les effets de pulsation pour plus de simplicité */

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}

@keyframes pulse-timer {
  0% { 
    transform: scale(1);
  }
  50% { 
    transform: scale(1.08);
  }
  100% { 
    transform: scale(1);
  }
}

/* Animation subtile du timer seulement quand pas en warning/danger */
.timer-compact:not(.warning):not(.danger) {
  animation: timer-subtle-glow 3s ease-in-out infinite;
}

@keyframes timer-subtle-glow {
  0%, 100% {
    box-shadow: 
      0 0 0 3px rgba(255, 255, 255, 0.1),
      0 4px 12px rgba(0, 0, 0, 0.4),
      inset 0 2px 4px rgba(0, 0, 0, 0.3);
  }
  50% {
    box-shadow: 
      0 0 0 3px rgba(255, 255, 255, 0.15),
      0 4px 14px rgba(0, 0, 0, 0.5),
      inset 0 2px 4px rgba(0, 0, 0, 0.3);
  }
}

.matchmaking-dots {
  display: inline-block;
  position: relative;
  z-index: 5;
}

.matchmaking-dots::after {
  content: '';
  animation: dots 1.5s steps(4, end) infinite;
}

.matchmaking-spinner {
  width: 120px;
  height: 120px;
  position: relative;
  margin: 30px auto;
  background: radial-gradient(circle at center, #1a1a2e 0%, #0f0f1e 40%, transparent 40%);
  border-radius: 50%;
  box-shadow: 
    0 0 0 8px rgba(255, 255, 255, 0.05),
    0 0 0 16px rgba(255, 255, 255, 0.02),
    inset 0 0 30px rgba(0, 0, 0, 0.5),
    0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Graduations du compteur */
.matchmaking-spinner::before {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: 
    conic-gradient(
      from -45deg,
      transparent 0deg,
      rgba(102, 126, 234, 0.1) 45deg,
      rgba(102, 126, 234, 0.3) 90deg,
      rgba(243, 156, 18, 0.3) 135deg,
      rgba(231, 76, 60, 0.3) 180deg,
      rgba(231, 76, 60, 0.5) 225deg,
      transparent 270deg
    );
  mask: radial-gradient(circle at center, transparent 65%, black 65%, black 85%, transparent 85%);
  -webkit-mask: radial-gradient(circle at center, transparent 65%, black 65%, black 85%, transparent 85%);
}

/* Aiguille du compteur */
.matchmaking-spinner::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 40px;
  background: linear-gradient(to top, #e74c3c 0%, #ff6b6b 100%);
  transform-origin: bottom center;
  transform: translate(-50%, -100%) rotate(-45deg);
  animation: speedNeedle 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(231, 76, 60, 0.8);
}

/* Centre de l'aiguille */
.matchmaking-spinner-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  background: radial-gradient(circle, #2c3e50 0%, #1a1a2e 100%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 
    0 2px 10px rgba(0, 0, 0, 0.5),
    inset 0 -1px 2px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

/* Vitesse numérique */
.matchmaking-speed {
  position: absolute;
  top: 65%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 10px rgba(102, 126, 234, 0.8);
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
  z-index: 3;
}

.matchmaking-speed span {
  font-size: 12px;
  opacity: 0.7;
  margin-left: 2px;
}

@keyframes speedNeedle {
  0% { transform: translate(-50%, -100%) rotate(-45deg); }
  20% { transform: translate(-50%, -100%) rotate(0deg); }
  40% { transform: translate(-50%, -100%) rotate(45deg); }
  60% { transform: translate(-50%, -100%) rotate(90deg); }
  80% { transform: translate(-50%, -100%) rotate(135deg); }
  100% { transform: translate(-50%, -100%) rotate(-45deg); }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Tips mis en avant */
.matchmaking-tips {
  margin: 20px auto;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 8px 24px rgba(102, 126, 234, 0.15),
    0 3px 10px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transform: scale(1);
  transition: transform 0.3s ease;
}

/* Pulsation légère au repos */
.matchmaking-tips:not(.tip-changing) {
  animation: tipsPulse 6s ease-in-out infinite;
}

@keyframes tipsPulse {
  0%, 100% { box-shadow: 
    0 8px 24px rgba(102, 126, 234, 0.15),
    0 3px 10px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.5); 
  }
  50% { box-shadow: 
    0 12px 32px rgba(102, 126, 234, 0.2),
    0 4px 12px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.6); 
  }
}

/* Effet de shine qui passe régulièrement */
.matchmaking-tips::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -100%;
  width: 100%;
  height: 200%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4) 50%,
    transparent
  );
  transform: skewX(-25deg);
  animation: tipShine 3s ease-in-out infinite;
}

@keyframes tipShine {
  0% { left: -100%; }
  100% { left: 200%; }
}

/* Effet de scan sur les bords */
.matchmaking-tips::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
  background-size: 200% 200%;
  animation: scanEffect 4s linear infinite;
  opacity: 0.6;
  pointer-events: none;
}

@keyframes scanEffect {
  0% { background-position: 200% 200%; }
  100% { background-position: -200% -200%; }
}



.tip-icon {
  font-size: 20px;
  margin-right: 12px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
  position: relative;
  z-index: 3;
  color: #667eea;
}

.tip-text {
  font-size: 15px;
  color: #333333;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  animation: tipFadeIn 0.5s ease-out forwards;
  position: relative;
  z-index: 3;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.2px;
  line-height: 1.4;
}

@keyframes tipFadeIn {
  0% { 
    opacity: 0;
    transform: translateY(10px);
  }
  100% { 
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animation de changement de tip */
.matchmaking-tips.tip-changing {
  animation: tipChange 0.5s ease;
}

@keyframes tipChange {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.05); filter: brightness(1.2); }
}

@keyframes iconSpin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.2); }
  100% { transform: rotate(360deg) scale(1); }
}



/* Pas d'effets de lumière pour rester sobre */
.matchmaking-lights {
  display: none;
}

/* Animation spéciale au succès */
@keyframes matchmakingSuccess {
  0% { 
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    box-shadow: 
      0 30px 60px rgba(102, 126, 234, 0.3),
      0 10px 20px rgba(102, 126, 234, 0.2),
      0 0 0 2px rgba(102, 126, 234, 0.5) inset;
  }
  100% {
    transform: scale(0.95);
    opacity: 0;
  }
}

/* Responsive */
@media (max-width: 600px) {
  .matchmaking-compact {
    padding: 32px 20px;
    margin: 0 10px;
    border-radius: 16px;
    max-width: 340px;
  }
  
  /* .matchmaking-compact::before supprimé - plus de dégradé mauve */
  
  .matchmaking-compact > .glass-overlay {
    /* Pas de background - seulement le backdrop-filter pour éviter le fond mauve */
    backdrop-filter: blur(14px) brightness(1.05) saturate(1.15);
    -webkit-backdrop-filter: blur(14px) brightness(1.05) saturate(1.15);
    border-radius: 14px;
  }
  
  .matchmaking-loader {
    margin: 20px auto 16px;
    height: 58px;
    width: 58px;
  }
  
  .loader-spinner {
    width: 42px;
    height: 42px;
  }
  
  .loader-spinner::before {
    inset: 4px;
  }
  
  .loader-spinner::after {
    inset: 10px;
  }
  
  .matchmaking-title {
    font-size: 20px;
    margin: 0 0 20px 0;
  }
  
  .matchmaking-tips {
    padding: 14px 18px;
    margin: 16px auto;
    min-height: 50px;
    border-radius: 12px;
  }
  
  .tip-text {
    font-size: 13px;
  }
  
  .tip-icon {
    font-size: 16px;
    margin-right: 8px;
  }
  
  .cancel-btn {
    padding: 8px 20px;
    font-size: 14px;
    margin-top: 16px;
    position: relative;
    z-index: 10;
  }
}

/* Cancel button styling for matchmaking - REMOVED duplicate definition */

.result-victory {
  color: #28a745;
}

.result-defeat {
  color: #dc3545;
}

.result-draw {
  color: #ff9800;
}

.result-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-rematch {
  background: #667eea;
  color: white;
}

.btn-rematch:hover {
  background: #5a67d8;
  transform: translateY(-2px);
}

/* Launch Duel Button */
.launch-duel-btn {
  background-image: radial-gradient(circle at bottom left, #296cd1 17%, #100f5b 81%);
  color: white;
  border: none;
  padding: 18px 36px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 
    0 4px 15px rgba(41, 108, 209, 0.3),
    0 1px 3px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0 auto 20px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.launch-duel-btn::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: left 0.5s;
}

.launch-duel-btn:hover {
  background-image: radial-gradient(circle at bottom left, #1f5db1 17%, #0a0947 81%);
  transform: translateY(-3px);
  box-shadow: 
    0 6px 20px rgba(41, 108, 209, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.1);
}

.launch-duel-btn:hover::before {
  left: 100%;
}

.launch-duel-btn:active {
  transform: translateY(-1px);
  box-shadow: 
    0 3px 10px rgba(41, 108, 209, 0.3),
    0 1px 2px rgba(0, 0, 0, 0.1);
}

.launch-duel-btn .emoji {
  font-size: 20px;
}

/* Animations additionnelles */
.player-score.update {
  animation: scoreUpdate 0.5s ease-out;
}

@keyframes celebrate {
  0% { 
    transform: translate(-50%, -50%) scale(0) rotate(0deg);
    opacity: 0;
  }
  50% { 
    transform: translate(-50%, -50%) scale(1.5) rotate(180deg);
    opacity: 1;
  }
  100% { 
    transform: translate(-50%, -50%) scale(2) rotate(360deg);
    opacity: 0;
  }
}

@keyframes fadeUp {
  from { 
    opacity: 1;
    transform: translateY(0);
  }
  to { 
    opacity: 0;
    transform: translateY(-30px);
  }
}

@keyframes scoreUpdate {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* Animation de mise à jour du MMR */
.mmr-updating {
    animation: mmrUpdate 2s ease-out;
    color: #28a745 !important;
    font-weight: bold;
}

@keyframes mmrUpdate {
    0% {
        transform: scale(1);
        color: inherit;
    }
    20% {
        transform: scale(1.3);
        color: #28a745;
        text-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
    }
    40% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        color: #28a745;
    }
}

/* ===== MINI-APP HACKS STYLES ===== */
#po-hacks{font-family:'Segoe UI',sans-serif;width:100%;margin:0 auto}
#po-hacks{--glass-bg:rgba(255,255,255,.15);--glass-border:rgba(255,255,255,.35);
  --accent-start:#0062ff;--accent-end:#0050cc;--accent-green:#28a745;--accent-green-end:#218838;
  --text:rgba(0,0,0,.78)}

/* -------- carte -------- */
#po-hacks .gdg-card{position:relative;padding:1.2rem;border-radius:16px;overflow:visible;
background:var(--glass-bg);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);
border:1.5px solid var(--glass-border);box-shadow:0 12px 32px rgba(0,0,0,.08);margin-bottom:1.5rem;width:100%;box-sizing:border-box;}
#po-hacks .gdg-progress{position:relative;top:0;left:0;transform:none;width:100%;height:12px;
  background:#e0e0e0;border-radius:999px;overflow:hidden;margin-bottom:0}
#po-hacks .gdg-bar{height:100%;width:0;transform-origin:left;
  background:linear-gradient(90deg,#0062ff,#0050cc);
  transition:width 0.6s ease;position:relative}
#po-hacks .gdg-bar::after{content:'';position:absolute;inset:0;
  background:linear-gradient(120deg,rgba(255,255,255,.05) 0,rgba(255,255,255,.35) 50%,rgba(255,255,255,.05) 100%);
  background-size:250% 100%;animation:progress-shine 3.5s linear infinite;mix-blend-mode:overlay}

/* -------- contenu -------- */
#po-hacks .gdg-question{font-size:1.1rem;color:var(--accent-start);font-weight:800;margin:0 0 1rem 0;line-height:1.4;}
#po-hacks .gdg-answer-wrapper{position:relative;background:rgba(255,255,255,.12);
backdrop-filter:blur(8px);border-radius:10px;padding:1.2rem;margin:0 0 1rem 0;text-align:center;min-height:60px;display:flex;align-items:center;justify-content:center;}
#po-hacks .gdg-answer{color:var(--text);filter:blur(8px)}
@keyframes po-wow{0%{transform:scale(.8);opacity:.5}50%{transform:scale(1.15);opacity:1}100%{transform:scale(1);opacity:1}}
#po-hacks .gdg-answer.po-wow{animation:po-wow .6s ease-out}

/* -------- tags -------- */
#po-hacks .answer-tag{display:inline-block;font-weight:700;font-size:.85rem;padding:3px 8px;border-radius:6px;margin-bottom:.4rem;color:#fff}
#po-hacks .answer-tag.astuce{background:var(--accent-start)}
#po-hacks .answer-tag.exam{background:var(--accent-green-end)}

/* -------- overlay & bouton -------- */
#po-hacks .gdg-blur{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  background:repeating-linear-gradient(135deg,#0004ff08 0 20px,#ffffff54 20px 40px);
  cursor:pointer;border:1px solid #007BFF;border-radius:12px;transition:.6s}
#po-hacks .gdg-blur.hidden{opacity:0;pointer-events:none}
#po-hacks .gdg-blur-btn{position:relative;display:flex;align-items:center;gap:.55rem;
  padding:.9rem 2.1rem;font-size:1rem;font-weight:800;text-transform:uppercase;color:#000;
  background:rgb(255 255 255 / 60%);border:2px solid #ffc200;border-radius:18px;
  backdrop-filter:blur(8px);cursor:pointer;
  transition:transform .2s,box-shadow .2s,background .25s}
#po-hacks .gdg-blur-btn::before{content:'';position:absolute;inset:0;border-radius:inherit;
  background:linear-gradient(135deg,rgba(255,255,255,.35),transparent 70%);opacity:.25}
#po-hacks .gdg-blur-btn:hover{background:rgba(255,255,255,.38);transform:translateY(-2px);}
#po-hacks .gdg-blur-btn:active{transform:translateY(0) scale(.96)}
#po-hacks .gdg-blur-btn .emoji{font-size:1.25em;line-height:0}

/* -------- navigation -------- */
#po-hacks .btn-base{width:100%;margin:0;border:none;padding:.8rem;border-radius:999px;font-size:1rem;font-weight:600;cursor:pointer;}
#po-hacks .gdg-next{display:none;background:linear-gradient(90deg,var(--accent-start),var(--accent-end));color:#fff}
#po-hacks .gdg-next.show{display:block}
#po-hacks .gdg-restart{display:none;background:linear-gradient(90deg,var(--accent-green),var(--accent-green-end));color:#fff}
#po-hacks .gdg-restart.show{display:block}

/* -------- lottie placeholders -------- */
#po-hacks .lottie-holder{position:absolute;pointer-events:none}
#po-hacks #miniLottie{width:180px;height:180px;top:50%;left:50%;transform:translate(-50%,-50%);z-index:10}
#po-hacks #successLottie{width:140px;height:140px;bottom:120px;left:50%;transform:translateX(-50%);z-index:9}

/* -------- responsive -------- */
@media(max-width:600px){
  #po-hacks .gdg-question{font-size:1rem}
  #po-hacks .gdg-answer{font-size:.9rem}
  #po-hacks .gdg-blur-btn{font-size:.95rem;padding:.8rem 1.8rem}
  /* Les marges sont déjà gérées par le système global */
}

/* Leaderboard */
.leaderboard {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 24px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.3) inset;
  margin: 24px auto 0 auto;
  width: 98%;
  max-width: 900px;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.25);
  position: relative;
}

.leaderboard-header {
  display: grid;
  grid-template-columns: 44px 1.5fr 1fr 0.7fr 0.7fr;
  gap: 8px;
  padding: 16px 20px;
  background: rgba(102, 126, 234, 0.1);
  font-weight: 700;
  color: #2c3e50;
  border-bottom: 1px solid rgba(102, 126, 234, 0.2);
  font-size: 1.08em;
  backdrop-filter: blur(10px);
  position: relative;
}

.leaderboard-content {
  max-height: 340px;
  overflow-y: auto;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 44px 1.5fr 1fr 0.7fr 0.7fr;
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  align-items: center;
  transition: all 0.3s ease;
  font-size: 1.04em;
  min-width: 420px;
  position: relative;
}

.leaderboard-row:last-child {
  border-bottom: none;
}

.leaderboard-row.current-user {
  background: rgba(102, 126, 234, 0.15);
  border-left: 3px solid #667eea;
  padding-left: 17px;
}

.leaderboard-row:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.rank {
  font-weight: 700;
  color: #667eea;
  font-size: 1.1em;
}

.player {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.player-avatar {
  font-size: 22px;
}

.score {
  font-weight: 700;
  color: #100f5b;
  font-size: 1.08em;
}

.wins {
  color: #28a745;
  font-weight: 700;
  font-size: 1.08em;
}

.losses {
  color: #dc3545;
  font-weight: 700;
  font-size: 1.08em;
}

@media (max-width: 700px) {
  .leaderboard {
    width: 100%;
    margin: 12px 0 0 0;
    border-radius: 12px;
    min-width: 0;
  }
  .leaderboard-header, .leaderboard-row {
    padding: 10px 6px;
    font-size: 0.98em;
    gap: 5px;
  }
  .leaderboard-header {
    grid-template-columns: 32px 1.2fr 0.8fr 0.6fr 0.6fr;
  }
  .leaderboard-row {
    grid-template-columns: 32px 1.2fr 0.8fr 0.6fr 0.6fr;
    min-width: 340px;
  }
  .player-avatar {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .leaderboard-header, .leaderboard-row {
    font-size: 0.93em;
    padding: 8px 2px;
    gap: 3px;
  }
  .leaderboard-header {
    grid-template-columns: 22px 1fr 0.7fr 0.5fr 0.5fr;
  }
  .leaderboard-row {
    grid-template-columns: 22px 1fr 0.7fr 0.5fr 0.5fr;
    min-width: 260px;
  }
  .player-avatar {
    font-size: 15px;
  }
}

/* Messages d'état du leaderboard */
.no-data, .error-message {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.error-message {
    color: #dc3545;
}

/* Animation de chargement pour le matchmaking */
@keyframes matchmaking-pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

.cancel-btn {
  background: rgba(255, 255, 255, 0.8);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.3);
  padding: 12px 24px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(4px);
  position: relative;
  z-index: 10;
}

.cancel-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  border-color: rgba(231, 76, 60, 0.5);
}

.cancel-btn:active {
  transform: translateY(0);
  box-shadow: 
    0 2px 6px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* État de désactivation des boutons pendant le duel */
.battle-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Indicateur de chargement pour le leaderboard */
.leaderboard-loading {
    padding: 20px;
    text-align: center;
    color: #666;
}

.leaderboard-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #667eea;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

/* ----------- SALLE DE PRÉPARATION DE DUEL (MATCHUP) ----------- */
#matchup {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  width: 100%;
  position: relative;
  text-align: center;
}

.matchup-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 28px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.3) inset;
  padding: 32px 36px 28px 36px;
  min-width: 320px;
  max-width: 420px;
  width: 98%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  position: relative;
  overflow: hidden;
  animation: fadeInScale 0.4s ease-out;
  transition: all 0.3s ease;
}

.matchup-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, rgba(102, 126, 234, 0.05), transparent 70%);
  pointer-events: none;
}

.matchup-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.matchup-title {
  font-size: 1.25em;
  font-weight: 700;
  color: #2c3e50;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Timer dans la zone de préparation avec le même style que pendant les questions */
.matchup-header {
  position: relative; /* Important pour le positionnement absolu du timer */
}

.matchup-header .timer-compact {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.matchup-players {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  width: 100%;
}

.matchup-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: 90px;
}

.matchup-avatar {
  width: 120px;
  height: 120px;
  font-size: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  overflow: hidden;
  line-height: 1;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.5);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.matchup-avatar:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.battle-avatar {
  width: 46px;
  height: 46px;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
  line-height: 1;
  background: #fff;
}

@media (max-width: 600px) {
  .matchup-avatar {
    width: 90px;
    height: 90px;
    font-size: 42px;
  }
  
  .battle-avatar {
    width: 38px;
    height: 38px;
    font-size: 26px;
  }
}

.matchup-name {
  font-weight: 700;
  color: #2c3e50;
  font-size: 1.08em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.3px;
}

.matchup-mmr {
  color: #28a745;
  font-weight: 600;
  font-size: 1em;
  background: rgba(40, 167, 69, 0.1);
  padding: 4px 12px;
  border-radius: 15px;
  margin-top: 4px;
  border: 1px solid rgba(40, 167, 69, 0.2);
}

.matchup-wins {
  color: #28a745;
  font-weight: 600;
  font-size: 1em;
}

.matchup-vs {
  font-size: 1.5em;
  font-weight: 800;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 20px;
  letter-spacing: 2px;
  text-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
  position: relative;
}

.matchup-vs::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #667eea, transparent);
}

/* Animations pour matchup */
.matchup-player:first-child {
  animation: slideInFromLeft 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.matchup-player:last-child {
  animation: slideInFromRight 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.matchup-vs {
  animation: scaleIn 0.6s 0.5s ease-out backwards;
}

.matchup-countdown {
  animation: fadeIn 1s 1s ease-out backwards;
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 600px) {
  .matchup-card {
    padding: 18px 6px 16px 6px;
    min-width: 0;
    max-width: 99vw;
  }
  .matchup-header {
    margin-bottom: 14px;
  }
  .matchup-players {
    gap: 12px;
  }
  .matchup-title {
    font-size: 1.08em;
  }
  .matchup-header .timer-compact {
    right: 10px;
  }
}



.avatar-preview {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(102,126,234,0.08);
  display: inline-block;
  vertical-align: middle;
  border: none;
}

@media (max-width: 600px) {
  .avatar-preview {
    width: 44px;
    height: 44px;
  }
}

.player-ranking {
  margin-top: 4px;
  font-size: 15px;
  color: #ff9800;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.leaderboard-title {
  text-align: center;
  color: #170e44;
  font-size: 1.18em;
  font-weight: 700;
  margin-bottom: 8px;
  margin-top: 8px;
  letter-spacing: 0.5px;
}





.leaderboard .avatar-preview, .leaderboard .player-avatar-display, .leaderboard .player-avatar-display img {
  width: 24px !important;
  height: 24px !important;
  font-size: 24px !important;
  min-width: 24px;
  min-height: 24px;
  max-width: 24px;
  max-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  object-fit: cover;
  margin-right: 8px;
  margin-left: 0;
  vertical-align: middle;
  background: transparent !important;
  box-sizing: border-box;
  border: none !important;
}

.leaderboard .avatar-preview {
  border: 2px solid #e9ecef;
}

.leaderboard .player-avatar-display {
  border: none;
  background: none;
  padding: 0;
}

.battle-avatar {
  font-size: 28px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  line-height: 1;
}

.battle-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
  display: block;
}

/* Pour la salle de préparation (matchup) et le duel */
.battle-header-compact .player-badge,
#matchup .player-badge {
  font-size: 34px;
}

@media (max-width: 600px) {
  .player-badge .player-avatar,
  .player-avatar-display {
    font-size: 28px;
  }
  .battle-header-compact .player-badge,
  #matchup .player-badge {
    font-size: 28px;
  }
}

/* ===== STYLES DU MENU NAVIGATION ROUTE ===== */

/* Menu Navigation Principal */
.modern-bottom-nav {
  display: flex;
  gap: 10px;
  padding: 10px 16px; /* Réduit la hauteur */
  width: 680px;
  max-width: 95%;
  align-items: center; /* Force le centrage vertical des éléments */
  /* Rétablissement de l'effet glassmorphism */
  background: 
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.1) 0%,
      rgba(255, 255, 255, 0.15) 100%
    );
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  border-radius: 0; /* Suppression des arrondis */
  /* Suppression de toutes les bordures */
  border: none;
  box-shadow: 
    /* Ombres pour effet glass moderne */
    0 8px 32px rgba(0, 0, 0, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.04),
    /* Reflets internes */
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.45);
  position: absolute;
  overflow: visible;
  transition: all 0.3s ease;
  margin: 0 auto 10px auto; /* Remonté de 10px */
  bottom: 10px; /* Remonté du bas */
  left: 0;
  right: 0;
  z-index: 100;
  flex-shrink: 0;
  box-sizing: border-box;
  /* padding-bottom supprimé ici, sera géré par les media queries */
}



/* ===== ÉLÉMENTS DÉCORATIFS ===== */

/* Lignes de route supprimées pour un design plus épuré */

/* Feux de signalisation */
.traffic-lights {
  position: absolute;
  top: -10px; /* Réduit de 12px à 10px */
  right: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: #ffffff; /* Fond blanc pur */
  backdrop-filter: none;
  border-radius: 20px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.05);
}

.traffic-light {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
  transition: all 0.3s ease;
}

.traffic-light.red {
  background: #dc2626;
  opacity: 0.3;
}

.traffic-light.yellow {
  background: #f59e0b;
  opacity: 0.3;
}

.traffic-light.green {
  background: #10b981;
  opacity: 1;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.8);
}

/* ===== ITEMS DE NAVIGATION ===== */

/* Items de navigation */
.modern-nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 24px; /* Réduit la hauteur */
  text-decoration: none;
  color: #4a5568; /* Couleur plus foncée pour meilleure lisibilité sur fond blanc */
  border-radius: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  flex: 1;
  background: rgba(255, 255, 255, 0.9); /* Fond plus opaque */
  border: 1px solid rgba(0, 0, 0, 0.1); /* Bordure plus visible */
  overflow: hidden;
  z-index: 1;
  /* Suppression du text-shadow pour meilleure lisibilité */
  text-shadow: none;
}

/* Effet hover gradient */
.modern-nav-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, 
    rgba(102, 126, 234, 0) 0%, 
    rgba(102, 126, 234, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

/* État hover */
.modern-nav-item:hover::before {
  opacity: 1;
}

.modern-nav-item:hover:not(.active) {
  background: rgba(240, 244, 255, 1); /* Fond bleuté clair */
  border-color: rgba(102, 126, 234, 0.3);
  color: #667eea;
  /* transform: translateY(-2px); - Supprimé pour éviter le déplacement */
  box-shadow: 
    0 8px 20px rgba(102, 126, 234, 0.15),
    0 0 0 1px rgba(102, 126, 234, 0.1) inset;
}

/* État actif */
.modern-nav-item.active {
  background-image: radial-gradient(circle at bottom left, #296cd1 17%, #100f5b 81%);
  color: #ffffff;
  border: 1px solid transparent;
  box-shadow: 
    0 6px 20px rgba(41, 108, 209, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.2);
  transform: none; /* Suppression de la surélévation permanente */
  position: relative;
  overflow: hidden;
}

/* Panneau directionnel "Actif" */
.direction-sign {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  background: #1a1a1a;
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.direction-sign::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid #1a1a1a;
}

.modern-nav-item.active .direction-sign {
  transform: translateX(-50%) scale(1);
  opacity: 1;
}



/* ===== ICÔNES ET LABELS ===== */

/* Icônes */
.modern-nav-icon {
  width: 24px;
  height: 24px;
  margin-bottom: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
  /* Suppression du filter drop-shadow pour plus de clarté */
  filter: none;
  color: #4a5568; /* Couleur foncée pour meilleure visibilité */
}

/* Cacher les icônes sur mobile */
@media (max-width: 600px) {
  .modern-nav-icon {
    display: none !important;
  }
}

.modern-nav-item:hover .modern-nav-icon {
  /* transform: scale(1.1); - Supprimé pour éviter l'agrandissement */
  opacity: 1;
  color: #667eea; /* Bleu au survol */
}

.modern-nav-item.active .modern-nav-icon {
  /* transform: scale(1.05); - Supprimé pour éviter l'agrandissement */
  opacity: 1;
  filter: none;
  color: #ffffff; /* Blanc sur fond actif */
}

/* Labels */
.modern-nav-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
  /* Suppression du text-shadow pour meilleure lisibilité */
  text-shadow: none;
  color: #4a5568; /* Couleur foncée pour meilleure visibilité */
}

.modern-nav-item:hover .modern-nav-label {
  /* letter-spacing: 0.8px; - Supprimé pour éviter l'agrandissement du texte */
  letter-spacing: inherit; /* Utilise le letter-spacing défini pour chaque media query */
  opacity: 1;
  color: #667eea; /* Bleu au survol */
}

.modern-nav-item.active .modern-nav-label {
  font-weight: 600; /* Même poids que l'état normal */
  letter-spacing: inherit; /* Utilise le letter-spacing défini pour chaque media query */
  opacity: 1;
  color: #ffffff; /* Blanc sur fond actif */
  text-shadow: none;
}

/* ===== NOTIFICATION DOT ===== */

.notification-dot {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 6px;
  height: 6px;
  background: #ef4444;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s ease;
}

.modern-nav-item.has-notification .notification-dot {
  opacity: 1;
  transform: scale(1);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { 
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% { 
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
  .modern-bottom-nav {
    width: calc(100% - 20px);
    gap: 8px;
    padding: 10px;
  }
  
  .traffic-lights {
    gap: 6px;
    padding: 4px 8px;
    display: flex;
    top: -12px; /* Ajusté pour mieux s'aligner avec le menu */
    right: 20px;
    background: #ffffff; /* Fond blanc pur */
    backdrop-filter: none;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 
      0 2px 8px rgba(0, 0, 0, 0.06),
      0 1px 3px rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    opacity: 1;
    transform: translateY(0);
  }
  
  .traffic-light {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
  }
  
  .traffic-light.red {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
  }
  
  .traffic-light.yellow {
    background: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
  }
  
  .traffic-light.green {
    background: #10b981; /* Vert original */
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
  }
  
  .modern-nav-item {
    padding: 8px 12px; /* Padding réduit pour mobile sans icônes */
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.95); /* Fond plus opaque */
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: #4a5568; /* Couleur foncée */
  }
  
  .modern-nav-item.active {
    background-image: radial-gradient(circle at bottom left, #296cd1 17%, #100f5b 81%);
    border-color: transparent;
    color: #ffffff;
    transform: none; /* Suppression de la surélévation permanente */
    box-shadow: 0 4px 12px rgba(41, 108, 209, 0.25);
  }
  
  .modern-nav-label {
    font-size: 11px;
    font-weight: 600; /* Même poids que l'état normal pour éviter l'effet d'agrandissement */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #4a5568; /* Couleur foncée */
  }
  
  .modern-nav-icon {
    width: 22px;
    height: 22px;
    color: #4a5568; /* Couleur foncée */
  }
}

@media (max-width: 480px) {
  .modern-bottom-nav {
    padding: 10px;
    gap: 6px;
  }
  
  .traffic-lights {
    display: flex; /* Garder visible sur mobile */
    gap: 6px;
    padding: 4px 8px;
    top: -8px;
    right: 15px;
  }
  
  .modern-nav-item {
    padding: 6px 8px; /* Padding uniforme et réduit pour mobile */
    flex-direction: column;
    gap: 0; /* Pas de gap sans icônes */
    border-radius: 14px;
    min-width: 0;
    flex: 1;
  }
  
  .direction-sign {
    display: none;
  }
  
  .modern-nav-label {
    font-size: 10px;
    letter-spacing: 0;
    font-weight: 600;
  }
  
  .modern-nav-icon {
    width: 20px;
    height: 20px;
    margin-bottom: 4px;
  }
  
  .notification-dot {
    top: 6px;
    right: 6px;
    width: 5px;
    height: 5px;
  }
}

/* ===== RESPONSIVE MENU ADJUSTMENTS ===== */
/* Ajustements UNIQUEMENT pour le menu du bas sur petits écrans */

@media (max-width: 480px) {
  /* Menu du bas - réduire le texte et l'espacement */
  .modern-nav-label {
    font-size: 9px !important;
    letter-spacing: 0 !important;
  }
  
  .modern-nav-item {
    padding: 5px 6px !important;
    gap: 0 !important;
  }
  
  .modern-bottom-nav {
    gap: 4px !important;
    padding: 8px !important;
  }
}

@media (max-width: 360px) {
  /* Pour les très petits écrans */
  .modern-nav-label {
    font-size: 8px !important;
  }
  
  .modern-nav-item {
    padding: 4px 5px !important;
  }
  
  .modern-bottom-nav {
    gap: 3px !important;
    padding: 6px !important;
  }
}

/* Ajustements pour le menu du haut (tab-menu) sur petits écrans */
@media (max-width: 480px) {
  .tab-link {
    font-size: 11px !important;
    padding: 6px 10px !important;
  }
  
  .tab-menu {
    gap: 4px !important;
  }
  
  .tab-menu-container {
    padding: 4px 8px !important;
  }
}

@media (max-width: 360px) {
  .tab-link {
    font-size: 10px !important;
    padding: 5px 8px !important;
  }
  
  .tab-menu {
    gap: 3px !important;
  }
}

@media (max-width: 600px) {
  .modern-bottom-nav {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    padding: 10px; /* Padding uniforme sur tous les côtés */
    padding-bottom: calc(10px + env(safe-area-inset-bottom)); /* Safe area ajouté au padding bottom */
    border-radius: 20px; /* Arrondi complet sur mobile aussi */
    left: 10px; right: 10px; 
    bottom: 10px; /* Remonté sur mobile aussi */
    margin: 0;
    position: fixed; /* Fixed pour rester en bas de l'écran */
    /* Rétablissement de l'effet glassmorphism */
    background: 
      linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.15) 100%
      );
    backdrop-filter: blur(20px) saturate(120%);
    -webkit-backdrop-filter: blur(20px) saturate(120%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 
      0 8px 32px rgba(0, 0, 0, 0.1),
      0 2px 8px rgba(0, 0, 0, 0.04),
      inset 0 1px 1px 0 rgba(255, 255, 255, 0.45);
    z-index: 100;
  }
}

@media (min-width: 600px) {
  .modern-bottom-nav {
    position: absolute;
    bottom: 10px;
    margin-bottom: 0;
    width: 95%;
    max-width: 95%;
    left: 2.5%; 
    right: 2.5%;
    margin-left: auto;
    margin-right: auto;
    border-radius: 50px; /* Border-radius augmenté pour un look moderne */
    /* Rétablissement de l'effet glassmorphism */
    background: 
      linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.15) 100%
      );
    backdrop-filter: blur(20px) saturate(120%);
    -webkit-backdrop-filter: blur(20px) saturate(120%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    background-clip: padding-box;
    box-shadow: 
      0 8px 32px rgba(0, 0, 0, 0.1),
      0 2px 8px rgba(0, 0, 0, 0.04),
      inset 0 1px 1px 0 rgba(255, 255, 255, 0.45);
    z-index: 100;
    padding: 14px 20px 14px 20px;
  }
  
  /* Afficher les icônes sur PC */
  .modern-nav-icon {
    display: block !important;
    width: 24px;
    height: 24px;
    margin-bottom: 6px;
    color: #4a5568; /* Couleur foncée */
    filter: none;
  }
  
  .modern-nav-item {
    background: rgba(255, 255, 255, 0.95); /* Fond plus opaque */
    border: 1px solid rgba(0, 0, 0, 0.1); /* Bordure visible */
    padding: 12px 24px;
    border-radius: 50px; /* Border-radius augmenté pour cohérence */
    color: #4a5568; /* Couleur foncée */
  }
  
  .modern-nav-item.active {
    background-image: radial-gradient(circle at bottom left, #296cd1 17%, #100f5b 81%);
    border-color: transparent;
  }
  
  .modern-nav-item.active .modern-nav-icon,
  .modern-nav-item.active .modern-nav-label {
    color: #ffffff; /* Blanc sur fond actif */
  }
  
  .modern-nav-label {
    color: #4a5568; /* Couleur foncée */
    text-shadow: none;
  }
}

/* Animations */
@keyframes shimmer {
  0% { transform: translateX(-100px); }
  100% { transform: translateX(100px); }
}

/* Masquer l'ancien onglet communauté dans le menu entrainement */
#section-entrainement .tab-link[data-tab="tab-community"] {
  display: none;
}

body {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

body.keyboard-open .modern-bottom-nav {
  opacity: 0;
  pointer-events: none;
  transform: translateY(100%);
}

/* ===== Sections principales ===== */
.main-section {
    display: none;
}

.main-section.active {
    display: block;
}

/* Nouveau conteneur pour le contenu scrollable */
.content-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    position: relative;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling sur iOS */
    /* Réduire le CLS en définissant des dimensions stables */
    will-change: transform;
    contain: layout style paint;
    padding: 0; /* Aucun padding */
    margin: 0;
    width: 100%;
    /* Masquer les barres de scroll */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

/* Masquer la barre de scroll pour Chrome/Safari */
.content-wrapper::-webkit-scrollbar {
    display: none;
}

@media (min-width: 600px) {
  .content-wrapper {
    padding: 0 0 20px 0; /* Petit padding bottom pour le scroll */
  }
  
  /* Feux de signalisation sur PC - même style que mobile */
  .traffic-lights {
    display: flex !important;
    gap: 6px;
    padding: 4px 8px;
    top: -8px; /* Aligné avec la version mobile */
    right: 40px;
    background: #ffffff; /* Fond blanc pur comme demandé */
    backdrop-filter: none;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 
      0 2px 8px rgba(0, 0, 0, 0.06),
      0 1px 3px rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    opacity: 1;
    transform: translateY(0);
    position: absolute;
    z-index: 10;
  }
  
  .traffic-light {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
  }
  
  .traffic-light.red {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
  }
  
  .traffic-light.yellow {
    background: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
  }
  
  .traffic-light.green {
    background: #10b981; /* Vert original */
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
  }
}

/* Supprimé - géré dans la section universelle plus bas */

/* Ajuster la largeur du contenu dans tous les onglets */
.tab-pane {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 0 10px; /* Padding horizontal fixe de 10px de chaque côté */
}

.main-section {
  width: 100%;
}

/* Styles spécifiques pour augmenter la largeur du contenu */
.sg-card,
.duel-section,
.profile-form,
.player-info-bar,
.matchmaking-compact,
.battle-header-compact,
.leaderboard,
.video-container,
#po-hacks {
  width: 100%;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

/* Ajustements spécifiques pour les cartes flashcards */
.sg-card {
  max-width: 400px;
  margin: 0 auto;
}

/* Styles pour les états vides */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  min-height: 200px;
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.7;
}

.empty-state h3 {
  margin: 0 0 8px 0;
  font-size: 20px;
  color: #333;
  font-weight: 600;
}

.empty-state p {
  margin: 0;
  color: #666;
  font-size: 14px;
}



/* ===== Boutons d'authentification (connexion/inscription) ===== */
.auth-btn {
  display: inline-block;
  /* Style harmonisé avec l'effet liquidglass */
  background: rgba(255, 255, 255, 0.9);
  color: #296cd1;
  border: 1px solid rgba(41, 108, 209, 0.2);
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 15px;
  font-weight: 600;
  margin: 0 6px 0 0;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(10px);
  outline: none;
  vertical-align: middle;
  white-space: nowrap;
}
.auth-btn:last-child { margin-right: 0; }
.auth-btn:hover, .auth-btn:focus {
  background: radial-gradient(circle at bottom left, #296cd1 17%, #100f5b 81%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(41, 108, 209, 0.25);
  transform: translateY(-2px);
}
.auth-buttons {
  display: flex;
  align-items: center;
  gap: 0;
}
@media (max-width: 600px) {
  .auth-btn {
    font-size: 13px;
    padding: 7px 12px;
    border-radius: 7px;
  }
}

/* ===== INDICATEUR DE CHARGEMENT (styles supplémentaires) ===== */
.app-loading-indicator.fade-out {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* ===== MOBILE FIXES PRIORITAIRES ===== */
@media (max-width: 600px) {
  /* Force reset pour mobile */
  * {
    box-sizing: border-box !important;
  }
  
  html, body {
    width: 100% !important;
    overflow-x: hidden !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  /* Force la mise en page correcte */
  .sg-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    height: 100vh !important;
    position: relative !important; /* Relative au lieu de fixed pour PWA */
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }
  
  .sg-container {
    width: 100% !important;
    max-width: 100% !important;
    border: none !important;
    border-radius: 0 !important;
    animation: none !important;
    background-image: none !important;
    position: relative !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  
  /* Auth bar fix */
  .auth-bar {
    width: 100% !important;
    max-width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    position: relative !important;
    flex-shrink: 0 !important;
  }
  
  /* Bottom nav fix */
  .modern-bottom-nav {
    width: calc(100% - 20px) !important;
    left: 10px !important;
    right: 10px !important;
    position: fixed !important;
    bottom: 10px !important; /* Espace en bas */
    z-index: 100 !important;
    flex-shrink: 0 !important;
    border-radius: 20px !important; /* Arrondi complet */
  }
  
  /* Content wrapper ajusté pour le menu fixe */
  /* Supprimé - géré dans le système universel */
  
  /* Forcer position fixed sur Firefox mobile */
  body.firefox-mobile .modern-bottom-nav {
    position: fixed !important;
    bottom: calc(10px + env(safe-area-inset-bottom)) !important;
    width: calc(100% - 20px) !important;
    left: 10px !important;
    right: 10px !important;
    margin: 0 !important;
    transform: translateX(0) !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 10px 16px !important;
    height: auto !important;
  }
  
  /* Tab menu fix */
  .tab-menu {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* Force les nouveaux styles d'onglets sur mobile */
  .tab-menu-container {
    position: relative !important;
    top: 0 !important;
    /* Effet liquidglass unifié sur mobile */
    background: 
      linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.15) 100%
      ) !important;
    backdrop-filter: blur(20px) saturate(120%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(120%) !important;
    box-shadow: 
      0 8px 32px rgba(0, 0, 0, 0.1),
      0 2px 8px rgba(0, 0, 0, 0.04),
      inset 0 1px 1px 0 rgba(255, 255, 255, 0.45) !important;
    border-top: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18) !important;
    z-index: 1500 !important; /* Réduit pour le dropdown */
    padding: 6px 10px !important;
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    flex-shrink: 0 !important;
  }
  
  .tab-link {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(41, 108, 209, 0.2) !important;
    padding: 8px 16px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: 20px !important;
    color: #296cd1 !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    outline: none !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
  }
  
  .tab-link:hover:not(.active) {
    background: rgba(41, 108, 209, 0.1) !important;
    border-color: #296cd1 !important;
    /* transform: translateY(-1px) !important; - Supprimé pour éviter le déplacement */
    box-shadow: 0 2px 8px rgba(41, 108, 209, 0.15) !important;
  }
  
  .tab-link.active {
    background: linear-gradient(135deg, #ff9800 0%, #f96031 100%) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.25) !important;
    /* transform: translateY(-1px) !important; - Supprimé pour éviter le déplacement */
  }
  
  /* Modal fix */
  .auth-modal-content {
    width: 90% !important;
    max-width: 90% !important;
    padding: 20px 15px !important;
  }
  
  /* Padding pour le contenu - Appliqué via la largeur 95% définie globalement */
  
  /* Fix pour les cartes */
  .sg-card {
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 400px !important; /* Limite max pour ne pas être trop large sur tablette */
  }
  

}

@media (min-width: 601px) {
  .auth-bar {
    max-width: 600px;
    margin: 0 auto;
    left: 0;
    right: 0;
    border-radius: 24px 24px 0 0; /* Arrondi plus moderne */
    position: relative;
    border-bottom: none;
    /* Maintien de l'effet liquidglass sur PC */
    background: 
      linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.15) 100%
      );
    backdrop-filter: blur(20px) saturate(120%);
    -webkit-backdrop-filter: blur(20px) saturate(120%);
    box-shadow: none; /* Suppression de l'ombre sous auth-bar */
    overflow: hidden; /* Pour que le border-radius fonctionne */
  }
  .tab-menu-container {
    max-width: 600px;
    margin: 0 auto;
    left: 0;
    right: 0;
    position: relative;
    top: 0;
    border-radius: 0 0 24px 24px; /* Arrondi en bas seulement */
    border-top: none; /* Fusion avec auth-bar */
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    /* Même effet liquidglass */
    background: 
      linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.15) 100%
      );
    backdrop-filter: blur(20px) saturate(120%);
    -webkit-backdrop-filter: blur(20px) saturate(120%);
    box-shadow: 
      0 8px 32px rgba(0, 0, 0, 0.1),
      0 2px 8px rgba(0, 0, 0, 0.04),
      inset 0 1px 1px 0 rgba(255, 255, 255, 0.45);
  }
  /* Menu moderne pour écrans moyens */
  .modern-bottom-nav {
    position: absolute;
    bottom: 10px;
    margin-bottom: 0;
    width: 95%;
    max-width: 95%;
    left: 2.5%; 
    right: 2.5%;
    margin-left: auto;
    margin-right: auto;
    border-radius: 50px; /* Border-radius augmenté */
    /* Effet glassmorphism raffiné */
    background: 
      radial-gradient(
        ellipse at 30% 0%,
        rgba(99, 102, 241, 0.02) 0%,
        transparent 50%
      ),
      radial-gradient(
        ellipse at 70% 100%,
        rgba(236, 72, 153, 0.02) 0%,
        transparent 50%
      ),
      linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.12) 0%,
        rgba(255, 255, 255, 0.15) 100%
      );
    backdrop-filter: blur(15px) saturate(120%);
    -webkit-backdrop-filter: blur(15px) saturate(120%);
    border: 1px solid rgba(0, 0, 0, 0.2);
    background-clip: padding-box;
    box-shadow: 
      0 8px 32px rgba(0, 0, 0, 0.06),
      inset 0 1px 0 0 rgba(255, 255, 255, 0.3);
    z-index: 100;
    padding: 14px 20px 14px 20px;
  }
  
  /* Afficher les icônes sur écrans moyens */
  .modern-nav-icon {
    display: block !important;
    width: 24px;
    height: 24px;
    margin-bottom: 6px;
    color: #4a5568; /* Couleur foncée */
    filter: none;
  }
  
  .modern-nav-item {
    background: rgba(255, 255, 255, 0.95); /* Fond plus opaque */
    border: 1px solid rgba(0, 0, 0, 0.1); /* Bordure visible */
    padding: 12px 24px;
    border-radius: 50px; /* Border-radius augmenté pour cohérence */
    color: #4a5568; /* Couleur foncée */
  }
  
  .modern-nav-item.active {
    background-image: radial-gradient(circle at bottom left, #296cd1 17%, #100f5b 81%);
    border-color: transparent;
  }
  
  .modern-nav-item.active .modern-nav-icon,
  .modern-nav-item.active .modern-nav-label {
    color: #ffffff; /* Blanc sur fond actif */
  }
  
  .modern-nav-label {
    color: #4a5568; /* Couleur foncée */
    text-shadow: none;
  }
  
  .sg-wrapper {
    max-width: 600px;
    min-height: 400px; /* Hauteur minimale */
    max-height: 90vh; /* Hauteur maximale */
    height: auto; /* Hauteur adaptative */
    margin: 20px auto;
    padding-top: 0;
    overflow: visible; /* Changé pour voir la bordure */
    display: flex;
    flex-direction: column;
  }
  .sg-container {
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    height: auto; /* Hauteur adaptative */
    min-height: 400px; /* Hauteur minimale */
    padding: 0;
    overflow: visible; /* Changé pour voir la bordure */
    position: relative; /* Pour permettre le positionnement absolu du menu */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1); /* Ombre pour mieux voir les bords */
    background: #ffffff; /* Fond blanc pour voir les coins arrondis */
    border: 2px solid transparent;
    background-clip: padding-box;
  }
  
  .sg-container::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 20px;
    background: radial-gradient(circle at bottom left, #296cd1 17%, #100f5b 81%);
    z-index: -1;
    opacity: 1;
  }
  

  /* Structure interne du conteneur */
  .sg-container > .auth-bar {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 2000;
    /* Fusion visuelle avec tab-menu */
    margin-bottom: -1px; /* Supprime l'espace entre les deux */
  }
  .sg-container > .tab-menu-container {
    flex-shrink: 0;
    position: sticky;
    top: 50px;
    z-index: 1900;
    /* Ombre combinée pour l'ensemble auth-bar + tab-menu */
    box-shadow: 
      0 12px 40px rgba(0, 0, 0, 0.12),
      0 4px 12px rgba(0, 0, 0, 0.06),
      inset 0 1px 1px 0 rgba(255, 255, 255, 0.45);
  }
  /* Contenu principal scrollable */
  .main-section {
    flex: 1 1 auto; /* Permet au contenu de grandir et rétrécir */
    overflow-y: auto;
    min-height: 200px; /* Hauteur minimale du contenu */
    /* Padding pour éviter que le contenu soit caché sous le menu */
    padding-bottom: 100px; /* Augmenté pour tenir compte du menu décalé */
  }
  .content-wrapper {
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  /* Supprimé - le style du menu est défini plus haut */
}




  
/* Styles spécifiques PWA pour gérer les barres système */
@media (display-mode: standalone) {
  /* PWA : Mode normal avec barres systèmes */
  @supports (padding: env(safe-area-inset-top)) {
    /* iOS avec safe areas */
    .sg-wrapper {
      padding-top: env(safe-area-inset-top);
      height: 100vh;
      box-sizing: border-box;
    }
    
    .auth-bar {
      padding-top: calc(8px + env(safe-area-inset-top));
    }
    
    .modern-bottom-nav {
      padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }
  }
  
  /* Android et autres */
  .sg-wrapper {
    height: 100vh;
    padding-top: 0; /* Les barres systèmes sont gérées par l'OS */
  }
  

}

/* Gestion spécifique iOS Safari */
@supports (padding: env(safe-area-inset-top)) {
  /* iOS Safari - Mode normal */
  .sg-wrapper {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
  
  /* Ajuster la barre auth sur iOS */
  .auth-bar {
    padding-top: env(safe-area-inset-top);
  }
}
  
  /* Fix spécifique pour Firefox mobile */
  body.firefox-mobile .sg-wrapper {
    height: 100vh !important; /* Utiliser toute la hauteur */
    overflow: hidden !important;
    padding-bottom: 40px !important; /* Ajouter un padding au lieu de réduire la hauteur */
    box-sizing: border-box !important;
  }
  
  body.firefox-mobile .sg-container {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding-bottom: 40px !important; /* Espace pour les boutons de navigation Firefox */
    box-sizing: border-box !important;
  }
  
  body.firefox-mobile .auth-bar,
  body.firefox-mobile .tab-menu-container {
    flex-shrink: 0 !important;
  }
  
  /* Fix pour le menu du bas qui passe derrière les boutons de navigation Firefox */
  body.firefox-mobile .modern-bottom-nav {
    flex-shrink: 0 !important;
    padding-bottom: calc(8px + env(safe-area-inset-bottom)) !important;
    margin-bottom: 0 !important;
    position: fixed !important;
    bottom: 10px !important;
    z-index: 9999 !important;
    width: calc(100% - 20px) !important;
    left: 10px !important;
    right: 10px !important;
  }
  
  /* Fix pour forcer le cache des sections non actives sur Firefox */
  body.firefox-mobile .main-section {
    display: none !important;
    flex: 1 !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
  
  body.firefox-mobile .main-section.active {
    display: flex !important;
    flex-direction: column !important;
  }
  
  body.firefox-mobile .content-wrapper {
    flex: 1 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
  }
  
  /* Force le reset du menu après sortie du fullscreen Firefox */
  body.firefox-mobile:not(:-moz-full-screen):not(.firefox-fullscreen) .modern-bottom-nav {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    height: auto !important;
    padding: 10px !important;
    padding-bottom: calc(10px + env(safe-area-inset-bottom)) !important;
  }
  
  /* S'assurer que les nav items sont toujours centrés sur Firefox mobile */
  body.firefox-mobile .modern-nav-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
  }

/* ===== FIX GLOBAL FIREFOX MOBILE ===== */
@media (max-width: 600px) {
  body.firefox-mobile {
    /* Forcer le comportement des sections principales */
  }
  
  body.firefox-mobile .main-section:not(.active) {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important;
  }
  
  body.firefox-mobile .main-section.active {
    display: flex !important;
    visibility: visible !important;
    position: relative !important;
    left: auto !important;
    flex-direction: column !important;
  }
}

/* ===== FIX FIREFOX MOBILE FULLSCREEN ===== */
/* Détection du mode fullscreen */
body.firefox-mobile:-moz-full-screen .sg-wrapper,
body.firefox-mobile:-webkit-full-screen .sg-wrapper,
body.firefox-mobile:fullscreen .sg-wrapper,
body.firefox-mobile.firefox-fullscreen .sg-wrapper {
  padding-bottom: 0 !important;
  height: 100vh !important; /* Prendre toute la hauteur en fullscreen */
}

body.firefox-mobile:-moz-full-screen .sg-container,
body.firefox-mobile:-webkit-full-screen .sg-container,
body.firefox-mobile:fullscreen .sg-container,
body.firefox-mobile.firefox-fullscreen .sg-container {
  padding-bottom: 0 !important;
  height: 100% !important;
}

/* Ajuster le bottom-nav en fullscreen */
body.firefox-mobile:-moz-full-screen .modern-bottom-nav,
body.firefox-mobile:-webkit-full-screen .modern-bottom-nav,
body.firefox-mobile:fullscreen .modern-bottom-nav,
body.firefox-mobile.firefox-fullscreen .modern-bottom-nav {
  position: absolute !important; /* Absolute au lieu de fixed */
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: translateY(0) !important;
  z-index: 99999 !important;
  width: 100% !important;
}

/* S'assurer que le wrapper a la bonne position en fullscreen */
body.firefox-mobile:-moz-full-screen .sg-wrapper,
body.firefox-mobile:-webkit-full-screen .sg-wrapper,
body.firefox-mobile:fullscreen .sg-wrapper,
body.firefox-mobile.firefox-fullscreen .sg-wrapper {
  position: relative !important; /* Pour que absolute fonctionne */
  padding-bottom: 0 !important;
  height: 100vh !important;
  overflow: hidden !important;
}

/* Forcer la structure en fullscreen */
body.firefox-mobile:-moz-full-screen .sg-container,
body.firefox-mobile:-webkit-full-screen .sg-container,
body.firefox-mobile:fullscreen .sg-container,
body.firefox-mobile.firefox-fullscreen .sg-container {
  padding-bottom: 60px !important; /* Espace pour le bottom-nav */
  height: 100% !important;
  position: relative !important;
  box-sizing: border-box !important;
}

/* S'assurer que le main-section ne pousse pas le menu */
body.firefox-mobile:-moz-full-screen .main-section.active,
body.firefox-mobile:-webkit-full-screen .main-section.active,
body.firefox-mobile:fullscreen .main-section.active,
body.firefox-mobile.firefox-fullscreen .main-section.active {
  height: calc(100% - 60px) !important; /* Moins la hauteur du bottom-nav */
  padding-bottom: 0 !important;
  box-sizing: border-box !important;
}

  /* Hack spécifique Firefox mobile fullscreen - approche agressive */
  @-moz-document url-prefix() {
    /* Seulement pour Firefox */
    body.firefox-mobile.firefox-fullscreen .modern-bottom-nav {
      position: fixed !important;
      bottom: 10px !important;
      left: 2.5% !important;
      right: 2.5% !important;
      top: auto !important;
      margin: 0 auto !important;
      padding: 10px !important;
      padding-bottom: calc(10px + env(safe-area-inset-bottom)) !important;
      transform: translateY(0) translateZ(0) !important;
      z-index: 2147483647 !important; /* Maximum z-index */
      width: 95% !important;
      max-width: 95% !important;
      height: auto !important;
      border-radius: 20px !important;
      /* Effet glassmorphism identique aux autres versions */
      background: 
        linear-gradient(
          135deg,
          rgba(255, 255, 255, 0.1) 0%,
          rgba(255, 255, 255, 0.15) 100%
        ) !important;
      backdrop-filter: blur(20px) saturate(120%) !important;
      -webkit-backdrop-filter: blur(20px) saturate(120%) !important;
      border: 1px solid rgba(255, 255, 255, 0.18) !important;
      box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 1px 0 rgba(255, 255, 255, 0.45) !important;
      display: flex !important;
      gap: 10px !important;
      align-items: center !important;
      justify-content: center !important;
    }
  
  /* Forcer le container parent */
  body.firefox-mobile.firefox-fullscreen .sg-wrapper {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  body.firefox-mobile.firefox-fullscreen .sg-container {
    height: 100% !important;
    padding-bottom: 60px !important;
    box-sizing: border-box !important;
  }
    }

/* Fallback pour tous les navigateurs */
body.firefox-mobile:-moz-full-screen .modern-bottom-nav,
body.firefox-mobile:-webkit-full-screen .modern-bottom-nav,
body.firefox-mobile:fullscreen .modern-bottom-nav,
body.firefox-mobile.firefox-fullscreen .modern-bottom-nav {
  position: fixed !important;
  bottom: 10px !important;
  top: auto !important;
  left: 2.5% !important;
  right: 2.5% !important;
  margin: 0 auto !important;
  padding: 10px !important;
  padding-bottom: calc(10px + env(safe-area-inset-bottom)) !important;
  transform: translateY(0) translateZ(0) !important; /* Force GPU acceleration */
  z-index: 2147483647 !important;
  width: 95% !important;
  max-width: 95% !important;
  height: auto !important;
  will-change: transform !important;
  border-radius: 20px !important;
  /* Effet glassmorphism identique aux autres versions */
  background: 
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.1) 0%,
      rgba(255, 255, 255, 0.15) 100%
    ) !important;
  backdrop-filter: blur(20px) saturate(120%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(120%) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  background-clip: padding-box !important;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.04),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.45) !important;
  display: flex !important;
  gap: 10px !important;
  align-items: center !important;
  justify-content: center !important;
}

@media (max-width: 600px) {
  .modern-bottom-nav {
    width: 95% !important;
    max-width: 95% !important;
    left: 2.5% !important;
    right: 2.5% !important;
    position: fixed !important;
    bottom: 10px !important;
    z-index: 100 !important;
    flex-shrink: 0 !important;
    border-radius: 28px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    /* Rétablissement de l'effet glassmorphism */
    background: 
      linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.15) 100%
      );
    backdrop-filter: blur(20px) saturate(120%);
    -webkit-backdrop-filter: blur(20px) saturate(120%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    background-clip: padding-box;
    position: relative;
  }
  
  /* Suppression de l'effet ::after pour un design plus simple */
  
  .modern-bottom-nav {
    box-shadow: 
      0 12px 40px rgba(0, 0, 0, 0.1),
      0 2px 8px rgba(0, 0, 0, 0.04),
      inset 0 1px 1px 0 rgba(255, 255, 255, 0.45);
    padding: 10px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    margin: 0 auto;
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .modern-nav-item {
    padding: 10px 20px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.95); /* Fond plus opaque */
    border: 1px solid rgba(0, 0, 0, 0.1); /* Bordure visible */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
    color: #4a5568; /* Couleur foncée */
  }

  .modern-nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
      135deg,
      rgba(102, 126, 234, 0.1) 0%,
      transparent 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .modern-nav-item:hover::before {
    opacity: 1;
  }

  .modern-nav-item.active {
    background-image: radial-gradient(circle at bottom left, #296cd1 17%, #100f5b 81%);
    border-color: transparent;
    box-shadow: 
      0 4px 16px rgba(41, 108, 209, 0.3),
      inset 0 1px 0 0 rgba(255, 255, 255, 0.2);
    /* transform: translateY(-2px); - Supprimé pour éviter le déplacement */
  }

  .modern-nav-item:hover:not(.active) {
    background: rgba(240, 244, 255, 1); /* Fond bleuté clair au survol */
    /* transform: translateY(-1px); - Supprimé pour éviter le déplacement */
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.2);
  }

  .modern-nav-label {
    color: #4a5568; /* Couleur foncée */
    text-shadow: none;
    font-weight: 600;
  }

  .modern-nav-icon {
    color: #4a5568; /* Couleur foncée */
    filter: none;
  }

  .modern-nav-item.active .modern-nav-label,
  .modern-nav-item.active .modern-nav-icon {
    color: #ffffff; /* Blanc sur fond actif */
  }

  .modern-nav-item:hover:not(.active) .modern-nav-label,
  .modern-nav-item:hover:not(.active) .modern-nav-icon {
    color: #667eea; /* Bleu au survol */
  }
}

/* ===== MODAL DE COMPTE MODERNISÉ ===== */
.modern-account-modal {
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modern-account-modal h3 {
  text-align: center;
  color: #296cd1;
  font-size: 1.5em;
  margin-bottom: 30px;
  font-weight: 700;
}

/* Section Avatar */
.account-avatar-section {
  margin-bottom: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.section-label {
  display: block;
  font-weight: 600;
  color: #444;
  margin-bottom: 15px;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.current-avatar-wrapper {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: center;
  margin-bottom: 20px;
}

.current-avatar {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.95) 100%);
  border: 3px solid #296cd1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3em;
  box-shadow: 0 4px 20px rgba(41, 108, 209, 0.2);
  transition: all 0.3s ease;
  overflow: hidden;
}

.change-avatar-btn {
  background: radial-gradient(circle at bottom left, #296cd1 17%, #100f5b 81%);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 10px rgba(41, 108, 209, 0.3);
}

.change-avatar-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(41, 108, 209, 0.4);
}

/* Grille d'emojis dans le modal */
.account-emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  margin-top: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 12px;
  animation: fadeIn 0.3s ease-out;
}

@media (max-width: 500px) {
  .account-emoji-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.emoji-choice {
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid #e9ecef;
  background: white;
  border-radius: 8px;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

.emoji-choice:hover {
  border-color: #667eea;
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.emoji-choice.selected {
  border-color: #296cd1;
  background: #296cd1;
  color: white;
  box-shadow: 0 0 0 3px rgba(41, 108, 209, 0.2);
}

/* Section Informations */
.account-info-section {
  margin-bottom: 30px;
}

.modern-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

@media (max-width: 400px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.modern-input {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(41, 108, 209, 0.2);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 15px;
  transition: all 0.3s;
}

.modern-input:focus {
  border-color: #296cd1;
  background: white;
  box-shadow: 0 0 0 3px rgba(41, 108, 209, 0.1);
}

.modern-input[readonly] {
  background: #f5f5f5;
  cursor: not-allowed;
  opacity: 0.7;
}

.modern-submit {
  background: radial-gradient(circle at bottom left, #296cd1 17%, #100f5b 81%);
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(41, 108, 209, 0.4);
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.modern-submit:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 6px 30px rgba(41, 108, 209, 0.5);
}

.modern-submit:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Danger Zone */
.danger-zone {
  text-align: center;
  padding-top: 20px;
  border-top: 2px solid #fee;
}

.danger-btn {
  background: transparent;
  color: #dc3545;
  border: 2px solid #dc3545;
  padding: 10px 20px;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.danger-btn:hover {
  background: #dc3545;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(220, 53, 69, 0.3);
}

.btn-icon {
  font-size: 1.1em;
}

.btn-text {
  font-size: 0.95em;
}

/* ===== ÉTAPES D'INSCRIPTION ===== */
.register-step {
  animation: fadeIn 0.3s ease-out;
}

.auth-modal-content h3 {
  text-align: center;
  margin-bottom: 20px;
}

.sg-rapid-section.difficult-mode .sg-stats-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4),
              0 0 30px rgba(0, 140, 255, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transform: translateY(-2px) scale(1.05);
  border-color: rgba(97, 211, 255, 0.5);
}

.sg-rapid-section.difficult-mode .sg-stats-btn:hover::before {
  background: 
    linear-gradient(to right, #ff6600 0px, #ff6600 16px, transparent 16px) 0px 0px / 16px 2px no-repeat,
    linear-gradient(to right, #61d3ff 0px, #61d3ff 12px, transparent 12px) 0px 6px / 12px 2px no-repeat,
    linear-gradient(to right, #ff911c 0px, #ff911c 8px, transparent 8px) 0px 12px / 8px 2px no-repeat;
  filter: brightness(1.4) saturate(1.5);
}

/* ===== STYLES POUR LES IMAGES AVATAR ===== */
.auth-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  display: block;
}

.auth-avatar-img.avatar-small {
  width: 100%;
  height: 100%;
}

.auth-avatar-img.avatar-large {
  width: 60px;
  height: 60px;
}

.avatar-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.emoji-choice img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  padding: 4px;
}

.player-avatar-display img,
#playerAvatarDisplay img {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  object-fit: cover;
}

.matchup-avatar img,
#matchupPlayerAvatar img,
#matchupOpponentAvatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.current-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

#battlePlayerAvatar img,
#opponentAvatar img {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  object-fit: cover;
}

/* Ajustement des conteneurs d'avatar existants */
.avatar-option {
  overflow: hidden;
  padding: 4px;
}

/* Styles pour la sélection d'avatar avec images */
.avatar-option.selected img {
  transform: scale(0.9);
  box-shadow: 0 0 0 3px #667eea inset;
}

/* Animation au survol pour les images */
.avatar-option:hover img {
  transform: scale(1.05);
}

.emoji-choice:hover img {
  transform: scale(1.05);
}

/* Fix pour l'affichage dans la barre d'auth */
.auth-avatar-wrapper img {
  display: block;
}

/* ===== POPUP DE CONFIRMATION D'ABANDON ===== */
.abandon-confirm-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

@keyframes liquidGlass {
  0%, 100% {
    background-position: 0% 50%;
    filter: hue-rotate(0deg) blur(20px);
  }
  25% {
    background-position: 50% 0%;
    filter: hue-rotate(20deg) blur(25px);
  }
  50% {
    background-position: 100% 50%;
    filter: hue-rotate(40deg) blur(20px);
  }
  75% {
    background-position: 50% 100%;
    filter: hue-rotate(20deg) blur(25px);
  }
}

/* Overlay avec effet liquidglass */
.abandon-popup-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(220, 53, 69, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 193, 7, 0.2) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(0, 123, 255, 0.2) 0%, transparent 50%),
    radial-gradient(circle at 90% 90%, rgba(40, 167, 69, 0.15) 0%, transparent 50%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: liquidGlass 12s ease-in-out infinite;
  background-size: 150% 150%;
}

/* Contenu du popup */
.abandon-popup-content {
  position: relative;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 24px;
  padding: 36px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: 
    0 24px 48px rgba(0, 0, 0, 0.12),
    0 0 80px rgba(220, 53, 69, 0.15),
    inset 0 0 120px rgba(255, 255, 255, 0.5);
  animation: slideUp 0.4s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.abandon-popup-content::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.1) 35%,
    rgba(255, 255, 255, 0.1) 65%,
    transparent 70%
  );
  animation: shimmer 3s linear infinite;
  pointer-events: none;
}

.abandon-popup-icon {
  font-size: 56px;
  margin-bottom: 20px;
  animation: pulse 2s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(255, 193, 7, 0.4));
}

.abandon-popup-title {
  font-size: 26px;
  font-weight: 700;
  color: #333;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.abandon-popup-message {
  font-size: 16px;
  color: #555;
  line-height: 1.6;
  margin-bottom: 12px;
}

.abandon-popup-message strong {
  color: #dc3545;
  font-weight: 700;
  font-size: 17px;
}

.abandon-popup-warning {
  font-size: 14px;
  color: #dc3545;
  font-style: italic;
  margin-bottom: 28px;
  opacity: 0.9;
}

.abandon-popup-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.abandon-popup-btn {
  padding: 14px 28px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 150px;
  position: relative;
  overflow: hidden;
}

.abandon-popup-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.abandon-popup-btn:active::before {
  width: 300px;
  height: 300px;
}

.abandon-popup-cancel {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  color: #333;
  border: 1px solid #dee2e6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.abandon-popup-cancel:hover {
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.abandon-popup-confirm {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.35);
}

.abandon-popup-confirm:hover {
  background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(220, 53, 69, 0.45);
}

/* Mobile responsive */
@media (max-width: 480px) {
  .abandon-popup-content {
    padding: 28px 20px;
    width: 94%;
  }
  
  .abandon-popup-icon {
    font-size: 48px;
  }
  
  .abandon-popup-title {
    font-size: 22px;
  }
  
  .abandon-popup-actions {
    flex-direction: column;
  }
  
  .abandon-popup-btn {
    width: 100%;
  }
}

/* ===== PAGINATION DU CLASSEMENT ===== */
.leaderboard-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 16px;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.3) inset;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.pagination-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.pagination-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.pagination-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.pagination-info {
  font-size: 1.05em;
  font-weight: 600;
  color: #2c3e50;
  padding: 8px 16px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 8px;
}

@media (max-width: 600px) {
  .leaderboard-pagination {
    gap: 12px;
    padding: 12px;
  }
  
  .pagination-btn {
    padding: 8px 16px;
    font-size: 0.95em;
  }
  
  .pagination-info {
    font-size: 0.95em;
    padding: 6px 12px;
  }
}

/* Indicateur de chargement pour la pagination */
.leaderboard-content.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.leaderboard-content.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 4px solid rgba(102, 126, 234, 0.2);
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spinLoader 1s linear infinite;
}

@keyframes spinLoader {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ===== YOUTUBE LAZY LOADING ===== */
.youtube-lazy {
  position: relative;
  padding-bottom: 56.25%; /* Ratio 16:9 */
  height: 0;
  overflow: hidden;
  background: #000;
  cursor: pointer;
  max-width: 100%;
}

.youtube-lazy img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.youtube-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 48px;
  background: rgba(255, 0, 0, 0.8);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 1;
}

.youtube-lazy:hover .youtube-play-button {
  background: rgba(255, 0, 0, 0.95);
  transform: translate(-50%, -50%) scale(1.1);
}

/* Responsive sur mobile */
@media (max-width: 600px) {
  .youtube-lazy {
    max-width: 100%;
    width: 100%;
  }
  
  /* Conteneur avec padding - forcer la largeur correcte */
  div[style*="max-width"] .youtube-lazy {
    margin-left: -5px;
    margin-right: -5px;
    width: calc(100% + 10px);
  }
}

/* ===== FIN YOUTUBE LAZY LOADING =====*/

/* ===== CORRECTIONS PARCOURS V1.26.0 =====*/

/* Centrage de l'app sur PC */
@media (min-width: 1024px) {
  #permis-app-container {
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.1);
  }
}

/* Correction largeur 100% pour tab-pane - UNIQUEMENT PARCOURS */
#section-parcours .tab-pane {
  padding: 0 !important;
  width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

/* Autres sections gardent leur padding normal */
#section-revisions .tab-pane,
#section-multijoueurs .tab-pane {
  padding: 10px;
}

/* Masquer complètement le menu à onglets dans le parcours */
body.on-parcours .tab-menu-container {
  display: none !important;
}

/* Masquer aussi quand la section parcours est active */
#section-parcours.active ~ .tab-menu-container,
#section-parcours.active + .tab-menu-container {
  display: none !important;
}

/* Supprimer l'espace blanc parasite au-dessus du parcours */
body.on-parcours .auth-bar {
  position: fixed !important;
  top: 0 !important;
  margin-bottom: 0 !important;
}

body.on-parcours #parcours-container {
  padding-top: 0 !important; /* Le contenu passe sous les éléments fixes */
}

/* Supprimé - géré dans le système universel */

/* Supprimer le dégradé semi-transparent quand le parcours est actif */
body.on-parcours .sg-container::before {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* Parcours container 100% hauteur */
#parcours-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: #ffffff; /* Fond blanc uni */
}

/* Route parcours ajustée - SUPPRIMÉ pour éviter conflit avec parcours.css */
/* Les styles de .parcours-route sont gérés dans parcours.css */

/* Décor simple en haut - SUPPRIMÉ */
.parcours-route::before {
  display: none !important;
}

/* Correction du scroll indésirable */
.main-section {
  overflow-x: hidden !important;
}

/* S'assurer que le contenu passe sous les menus avec glassmorphism */
#parcours-container {
  padding-top: 0;
}

/* ===== FIN CORRECTIONS PARCOURS V1.26.0 ===== */

/* ===== SYSTÈME D'AFFICHAGE MOBILE UNIVERSEL V1.40.35 ===== */
/* Solution propre et universelle pour l'affichage mobile sur tous les navigateurs */

/* 1. Structure de base mobile */
@media (max-width: 600px) {
  /* Conteneur principal - hauteur viewport dynamique */
  .sg-wrapper {
    height: 100vh;
    height: 100dvh; /* Hauteur dynamique pour mobile */
    min-height: -webkit-fill-available; /* Pour Safari iOS */
    overflow: hidden;
    position: relative;
    padding: 0;
    margin: 0;
  }
  
  /* Container avec flexbox pour la mise en page */
  .sg-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  
  /* Sections principales - structure flex */
  .main-section {
    display: none;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }
  
  .main-section.active {
    display: flex;
    flex-direction: column;
  }
  
  /* Content wrapper - zone scrollable */
  .content-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    
    /* Padding minimal pour scroll naturel sous le menu */
    padding: 0 0 20px 0;
    margin: 0;
    
    /* Pleine largeur */
    width: 100%;
    max-width: 100%;
  }
  
  /* Tab pane - contenu des onglets */
  .tab-pane {
    width: 100%;
    max-width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
  }
  
  /* Espace de scroll supplémentaire pour éviter que le contenu soit caché sous le menu */
  .tab-pane::after {
    content: '';
    display: block;
    height: 65px; /* Hauteur du menu + marge de sécurité */
    width: 100%;
  }
}

/* 2. Parcours - cas spécial avec position absolute */
#parcours-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 20px;
  box-sizing: border-box;
}

/* Espace de scroll pour le parcours */
#parcours-container::after {
  content: '';
  display: block;
  height: 65px;
  width: 100%;
}

/* 3. Garage fullscreen */
.garage-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100vh;
  height: 100dvh;
}

.garage-fullscreen-content {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.garage-body {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 20px;
}

/* Espace de scroll pour le garage */
.garage-body::after {
  content: '';
  display: block;
  height: 65px;
  width: 100%;
}

/* 4. Ajustements pour Firefox mobile */
@media (max-width: 600px) {
  body.firefox-mobile .sg-wrapper,
  body.firefox-mobile .sg-container {
    /* Firefox a des problèmes avec les paddings fantômes */
    padding-bottom: 0 !important;
  }
  
  /* Menu spécifique Firefox */
  body.firefox-mobile .modern-bottom-nav {
    bottom: 10px;
    margin-bottom: 0;
  }
}

/* 5. Ajustements pour PWA */
@media (display-mode: standalone) and (max-width: 600px) {
  /* Gestion des safe areas iOS */
  .sg-wrapper {
    padding-top: env(safe-area-inset-top);
    padding-bottom: 0;
  }
  
  .modern-bottom-nav {
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
  
  .garage-fullscreen {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* 6. Nettoyage - suppression des marges parasites */
@media (max-width: 600px) {
  .content-wrapper {
    margin-bottom: 0 !important;
  }
  
  /* Éviter les rectangles blancs */
  body, 
  .main-section,
  #section-parcours,
  #section-revisions,
  #section-multijoueurs,
  #section-boutique {
    background-color: transparent;
  }
  
  /* Espace de scroll pour les conteneurs spécifiques avec boutons */
  .quiz-content::after,
  .flashcards-section::after,
  .shop-section::after,
  .battle-royale-container::after,
  .garage-content::after,
  #section-boutique .tab-content::after,
  #section-boutique .shop-content::after,
  #section-boutique .shop-pane::after {
    content: '';
    display: block;
    height: 65px;
    width: 100%;
  }
}

/* ===== FIN SYSTÈME D'AFFICHAGE MOBILE UNIVERSEL ===== */

/* ... rest of the code ... */

.br-final-actions button {
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.button-primary {
  background: #667eea;
  color: white;
  border: none;
}

.button-secondary {
  background: #f8f9fa;
  color: #333;
  border: 1px solid #ddd;
}

/* Masquer temporairement les avatars au chargement pour éviter le flash de code SVG */
body:not(.app-loaded) .auth-avatar-wrapper {
    opacity: 0;
    transition: opacity 0.3s ease;
}

body.app-loaded .auth-avatar-wrapper {
    opacity: 1;
}

/* Protection contre l'affichage de code SVG brut */
.auth-avatar svg {
    display: inline-block;
    vertical-align: middle;
}

/* S'assurer que les SVG sont bien rendus */
.auth-avatar-wrapper:empty {
    min-width: 40px;
    min-height: 40px;
}

/* Masquer temporairement les messages avec SVG au chargement */
.sg-no-cards-message {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sg-no-cards-message.ready {
    opacity: 1;
}

/* Masquer temporairement les icônes SVG au chargement */
.sg-no-cards-icon:empty {
    min-width: 48px;
    min-height: 48px;
    display: block;
}

/* ===== CENTRAGE PC VERSION 1.26.11 ===== */
@media (min-width: 1024px) and (max-width: 1024px) {
  /* Ancien centrage désactivé pour le nouveau layout 3 colonnes */
  .auth-bar,
  .tab-menu-container,
  .parcours-stats-zone {
    position: fixed !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 600px !important;
    max-width: 600px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    right: auto !important;
  }
  
  /* Position spécifique pour chaque élément */
  .auth-bar {
    top: 0 !important;
  }
  
  .parcours-stats-zone {
    top: 70px !important; /* 60px auth + 10px espace */
  }
  
  .tab-menu-container {
    top: 60px !important; /* Directement sous auth-bar */
  }
}


/* ===== FIN LANDING PAGE PC (DÉSACTIVÉE) ===== */

/* ===== INTERFACE MOBILE UNIVERSELLE SUR PC ===== */
/* Centrage et adaptation de l'interface mobile sur grand écran */
@media (min-width: 1025px) {
  /* Container principal centré avec max-width mobile */
  body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
  }

  #permis-app-container {
    max-width: 600px !important;
    margin: 0 auto !important;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
    position: relative;
    min-height: 100vh;
  }

  .sg-wrapper {
    max-width: 600px !important;
    margin: 0 auto !important;
    width: 600px !important;
  }

  .sg-container {
    max-width: 600px !important;
    width: 100% !important;
  }

  /* Centrage des éléments fixes */
  .auth-bar {
    max-width: 600px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    right: auto !important;
  }

  .modern-bottom-nav {
    max-width: 600px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    right: auto !important;
  }

  /* Ajustement de la barre de stats du parcours */
  .parcours-stats-zone {
    max-width: 600px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    right: auto !important;
  }

  /* Tab menu centré */
  .tab-menu-container {
    max-width: 600px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    right: auto !important;
  }

  /* Forcer tout le contenu à rester dans les 600px */
  .main-section,
  .tab-pane,
  .content-wrapper,
  #parcours-container {
    max-width: 600px !important;
    width: 100% !important;
    overflow-x: hidden !important;
  }

  /* Correction du classement - supprimer les backgrounds bizarres */
  .leaderboard-row {
    background: transparent !important;
  }

  .leaderboard-row .player-avatar,
  .leaderboard-row .player-avatar img,
  .leaderboard .player-avatar,
  .leaderboard .player-avatar img,
  .leaderboard .avatar-preview,
  .leaderboard .player-avatar-display,
  .leaderboard .player-avatar-display img {
    background: transparent !important;
    box-shadow: none !important;
  }

  /* S'assurer que le classement reste dans les 600px */
  .leaderboard,
  .leaderboard-container {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  /* S'assurer que rien ne dépasse sur PC */
  @media (min-width: 1025px) {
    body * {
      max-width: 100%;
    }

    .sg-wrapper,
    .sg-container,
    #permis-app-container {
      overflow-x: hidden !important;
    }
  }
}

/* ===== FULLSCREEN CHROME MOBILE FIX ===== */
/* Fix pour Chrome mobile et PWA en mode fullscreen */
body.fullscreen-active,
body.chrome-mobile-fullscreen {
  /* Prendre toute la hauteur disponible sans zone noire */
  height: 100% !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  overflow: hidden !important;
  background: var(--bg-color, #ffffff) !important; /* Utiliser la couleur de fond de l'app */
}

/* Forcer le contenu à commencer tout en haut en fullscreen */
body.fullscreen-active > *:first-child,
body.chrome-mobile-fullscreen > *:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

body.fullscreen-active .sg-wrapper,
body.chrome-mobile-fullscreen .sg-wrapper {
  height: 100% !important;
  width: 100% !important;
  position: relative !important;
  overflow: auto !important;
  -webkit-overflow-scrolling: touch !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}

/* S'assurer que le contenu prend toute la hauteur */
body.fullscreen-active .content-wrapper,
body.chrome-mobile-fullscreen .content-wrapper {
  min-height: 100% !important;
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* Forcer le sg-wrapper à prendre toute la hauteur en fullscreen */
body.fullscreen-active .sg-wrapper,
body.chrome-mobile-fullscreen .sg-wrapper {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

/* Ajustements pour la barre de navigation en fullscreen */
body.fullscreen-active .modern-bottom-nav,
body.chrome-mobile-fullscreen .modern-bottom-nav {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 9999 !important;
}

/* Éliminer tout espace vide en haut */
body.fullscreen-active .auth-bar,
body.chrome-mobile-fullscreen .auth-bar {
  margin-top: 0 !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
}

/* Enlever tout padding/margin du wrapper en mode fullscreen */
body.fullscreen-active .sg-wrapper > *:first-child,
body.chrome-mobile-fullscreen .sg-wrapper > *:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Fix pour les safe areas sur iOS en fullscreen - sans padding top */
@supports (padding: max(0px)) {
  body.fullscreen-active,
  body.chrome-mobile-fullscreen {
    padding-top: 0 !important; /* Pas de padding en haut */
    padding-bottom: 0 !important;
  }
  
  body.fullscreen-active .modern-bottom-nav,
  body.chrome-mobile-fullscreen .modern-bottom-nav {
    padding-bottom: env(safe-area-inset-bottom) !important;
  }
}

/* Optimisations pour PWA en mode fullscreen */
@media (display-mode: fullscreen) {
  body {
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
  }
  
  .sg-wrapper {
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

/* Fix spécifique pour Chrome Android */
@media screen and (max-width: 768px) {
  body.fullscreen-active,
  body.chrome-mobile-fullscreen {
    /* Utiliser toute la hauteur disponible sans zone noire */
    height: 100vh !important;
    height: -webkit-fill-available !important;
    background: #ffffff !important;
  }
  
  /* S'assurer que le contenu commence tout en haut */
  body.fullscreen-active .sg-wrapper,
  body.chrome-mobile-fullscreen .sg-wrapper {
    padding-top: 0 !important;
    margin-top: 0 !important;
  }
  
  /* Forcer le premier élément à commencer en haut */
  body.fullscreen-active .auth-bar:first-child,
  body.chrome-mobile-fullscreen .auth-bar:first-child {
    margin-top: 0 !important;
    padding-top: 10px !important; /* Juste un petit padding pour l'esthétique */
  }
}

/* Utiliser la hauteur calculée dynamiquement sur Chrome mobile */
body.chrome-mobile-fullscreen {
  height: 100vh !important;
  height: calc(var(--vh, 1vh) * 100) !important; /* Fallback avec la valeur calculée */
}

body.chrome-mobile-fullscreen .sg-wrapper {
  height: 100% !important;
  max-height: calc(var(--vh, 1vh) * 100) !important;
}

/* Masquer tout overflow en mode fullscreen */
body.fullscreen-active {
  overflow: hidden !important;
}

html:fullscreen,
html:-webkit-full-screen,
html:-moz-full-screen,
html:-ms-fullscreen {
  background: var(--bg-color, #ffffff) !important;
}





/* Forcer la suppression de la zone noire */
::backdrop {
  background: #f8f9fa !important;
}

:fullscreen::backdrop {
  background: #f8f9fa !important;
}

:-webkit-full-screen::backdrop {
  background: #f8f9fa !important;
}

:-moz-full-screen::backdrop {
  background: #f8f9fa !important;
}

:-ms-fullscreen::backdrop {
  background: #f8f9fa !important;
}

/* ===== FIN FULLSCREEN CHROME MOBILE FIX =====*/

/* ===== STYLES POUR FOND BLANC ===== */
/* Texte sombre dans la auth-bar */
.auth-bar,
.auth-bar * {
  color: #333333 !important;
}

.auth-bar .auth-user-name,
.auth-bar .auth-xp,
.auth-bar .dropdown-toggle,
.auth-bar .auth-avatar-wrapper {
  color: #333333 !important;
}

.auth-bar svg {
  fill: #333333 !important;
}

/* Fond blanc simple et propre */
.auth-bar {
  background: #ffffff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Réduire la hauteur de la auth-bar et la garder cohérente dans tous les menus */
.auth-bar {
  padding: 8px 16px !important; /* Hauteur uniforme */
  height: 60px !important; /* Hauteur fixe */
}

/* S'assurer que l'auth-bar a la même hauteur partout */
body.on-parcours .auth-bar,
#section-parcours .auth-bar {
  padding: 8px 16px !important;
  height: 60px !important;
}

@media (max-width: 600px) {
  .auth-bar {
    padding: 6px 12px !important;
    height: 50px !important;
  }
  
  body.on-parcours .auth-bar,
  #section-parcours .auth-bar {
    padding: 6px 12px !important;
    height: 50px !important;
  }
}

/* Réduire la largeur du dropdown d'authentification */
.auth-avatar-dropdown {
  min-width: 140px !important;
}

@media (max-width: 600px) {
  .auth-avatar-dropdown {
    min-width: 100px !important;
  }
}

/* Supprimer toutes les bordures externes de l'app */
.sg-wrapper,
.sg-container,
.auth-bar,
.tab-menu-container,
.modern-bottom-nav,
.content-wrapper {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Supprimer les bordures sur tous les éléments principaux */
html, body {
  border: none !important;
  outline: none !important;
}

/* Supprimer spécifiquement les bordures en bas de l'app */
.sg-wrapper,
.sg-container,
.modern-bottom-nav,
.content-wrapper,
.main-section,
.tab-pane {
  border-bottom: none !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
}

/* Supprimer les bordures sur les éléments de navigation */
.modern-nav-item,
.tab-link,
.auth-avatar-wrapper {
  border: none !important;
  outline: none !important;
}

/* Supprimer les bordures sur les éléments de contenu */
.sg-card,
.sg-card-front,
.sg-card-back {
  border: none !important;
  outline: none !important;
}

/* Améliorer la compatibilité avec les barres système */
@media (display-mode: standalone) {
  .auth-bar {
    /* Assurer que le fond blanc fonctionne en PWA */
    -webkit-appearance: none;
  }
}
/* ===== FIN STYLES FOND BLANC =====*/

/* Bouton inventaire dans la barre d'authentification */
.inventory-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 20px;
    color: #667eea;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 12px;
}

.inventory-button:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.inventory-button.hidden {
    display: none;
}

.inventory-icon {
    font-size: 16px;
}

.inventory-label {
    white-space: nowrap;
}

/* Responsive pour mobile */
@media (max-width: 600px) {
    .inventory-button {
        padding: 5px 10px;
        font-size: 12px;
        margin-left: 8px;
    }
    
    .inventory-icon {
        font-size: 14px;
    }
    
    /* Masquer le label sur très petit écran */
    @media (max-width: 380px) {
        .inventory-label {
            display: none;
        }
    }
}
/* ===== Système de popup personnalisé ===== */
.permis-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 20px;
    min-width: 300px;
    max-width: 400px;
    transform: translateX(420px);
    transition: all 0.3s ease-out;
    z-index: 10000;
    
    /* Effet liquid glass comme le menu du bas */
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08),
                0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.permis-notification.show {
    transform: translateX(0);
}

.permis-notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.permis-notification-icon {
    font-size: 20px;
    line-height: 1;
}

.permis-notification-message {
    flex: 1;
    color: #1a1a1a;
    font-size: 15px;
    line-height: 1.4;
    font-weight: 500;
}

/* Types de notifications - plus d'arrière-plans colorés */
.permis-notification.success .permis-notification-icon {
    filter: drop-shadow(0 0 8px rgba(76, 175, 80, 0.3));
}

.permis-notification.error .permis-notification-icon {
    filter: drop-shadow(0 0 8px rgba(244, 67, 54, 0.3));
}

.permis-notification.warning .permis-notification-icon {
    filter: drop-shadow(0 0 8px rgba(255, 152, 0, 0.3));
}

/* Mobile responsive pour les notifications liquid glass */
@media (max-width: 768px) {
    .permis-notification {
        position: fixed;
        left: 16px;
        right: 16px;
        top: auto;
        bottom: 80px; /* Remonté plus haut, au-dessus du menu */
        transform: translateY(120px);
        min-width: auto;
        max-width: none;
        text-align: center;
        justify-content: center;
    }
    
    .permis-notification.show {
        transform: translateY(0);
    }
}

.permis-notification.info {
    border-left: 4px solid #2196F3;
}

/* Popup de confirmation avec effet liquidglass */
.permis-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease, backdrop-filter 0.3s ease;
}

.permis-popup-overlay.show {
    opacity: 1;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.permis-popup {
    background: #ffffff;
    backdrop-filter: blur(20px) saturate(120%);
    -webkit-backdrop-filter: blur(20px) saturate(120%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12),
                inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    width: 90%;
    max-width: 360px;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.permis-popup-overlay.show .permis-popup {
    transform: translateY(0) scale(1);
}

.permis-popup-header {
    padding: 20px 24px 16px;
    text-align: center;
    position: relative;
}

.permis-popup-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1a1a1a;
    font-weight: 700;
}

.permis-popup-body {
    padding: 16px 24px 20px;
}

.permis-popup-body p {
    margin: 0;
    color: #4a4a4a;
    font-size: 14px;
    line-height: 1.4;
}

.permis-popup-footer {
    padding: 0 24px 20px;
    display: flex;
    gap: 8px;
    justify-content: center;
}

.permis-popup-btn {
    flex: 1;
    padding: 10px 18px;
    border: none;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    max-width: 140px;
}

.permis-popup-btn.primary {
    background: rgba(102, 126, 234, 0.9);
    color: white;
    border: 1px solid rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.permis-popup-btn.primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.permis-popup-btn.primary:hover {
    background: rgba(79, 70, 229, 0.95);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.permis-popup-btn.primary:hover::before {
    width: 300px;
    height: 300px;
}

.permis-popup-btn.secondary {
    background: rgba(229, 231, 235, 0.8);
    color: #374151;
    border: 1px solid rgba(156, 163, 175, 0.2);
}

.permis-popup-btn.secondary:hover {
    background: rgba(209, 213, 219, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Responsive */
@media (max-width: 480px) {
    .permis-notification {
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }
    
    .permis-popup {
        width: 95%;
        margin: 0 10px;
    }
}

/* ===== PORTAIL D'EXAMEN V2 PRO (CSS complet moderne) ===== */
.exam-portal-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* Bloc de route en arrière-plan */
.exam-road-block {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
        rgba(33, 150, 243, 0.05) 0%,
        rgba(33, 150, 243, 0.02) 50%,
        rgba(156, 39, 176, 0.03) 100%
    );
    border-radius: 12px;
    z-index: 1;
    pointer-events: none;
}

/* Barrières gauche et droite avec rayures */
.exam-barrier {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: calc(50% - 100px); /* Du bord jusqu'au badge (100px de marge pour le badge) */
    height: 12px;
    background: linear-gradient(90deg,
        rgba(255, 193, 7, 0.3),
        rgba(255, 193, 7, 0.9),
        rgba(255, 193, 7, 0.3)
    );
    border-radius: 6px;
    box-shadow:
        0 3px 12px rgba(255, 193, 7, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    pointer-events: auto;
    z-index: 8;
    overflow: hidden;
}

/* Rayures diagonales (comme barrière de chantier) */
.barrier-stripes {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(0, 0, 0, 0.15) 10px,
        rgba(0, 0, 0, 0.15) 20px
    );
    animation: barrierMove 20s linear infinite;
}

@keyframes barrierMove {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.exam-barrier::before,
.exam-barrier::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #FFC107, #FF9800);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.25),
        inset 0 2px 4px rgba(255, 255, 255, 0.5);
    z-index: 2;
}

.exam-barrier-left {
    left: 0;
}

.exam-barrier-left::after {
    right: -8px;
}

.exam-barrier-left::before {
    left: -8px;
}

.exam-barrier-right {
    right: 0;
}

.exam-barrier-right::before {
    left: -8px;
}

.exam-barrier-right::after {
    right: -8px;
}

/* Badge central avec effet glow */
.exam-badge {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 28px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(25px) saturate(200%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    border-radius: 20px;
    border: 3px solid rgba(255, 193, 7, 0.6);
    box-shadow:
        0 10px 40px rgba(31, 38, 135, 0.2),
        0 4px 12px rgba(255, 193, 7, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.9);
    z-index: 10;
    min-width: 160px;
    pointer-events: auto;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
}

.exam-badge::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(135deg,
        rgba(255, 193, 7, 0.3),
        rgba(255, 152, 0, 0.2),
        rgba(255, 193, 7, 0.3)
    );
    border-radius: 20px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.exam-badge:hover::before {
    opacity: 1;
}

.exam-badge:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow:
        0 16px 56px rgba(31, 38, 135, 0.25),
        0 6px 20px rgba(255, 193, 7, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 193, 7, 0.9);
}

/* Effet de lueur qui pulse */
.exam-badge-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(255, 193, 7, 0.15), transparent 70%);
    border-radius: 50%;
    animation: badgeGlow 3s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes badgeGlow {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.1); }
}

/* Icône Font Awesome */
.exam-icon {
    font-size: 36px;
    margin-bottom: 8px;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.15));
    line-height: 1;
    color: #FF9800;
    transition: all 0.3s ease;
}

.exam-badge:hover .exam-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 4px 10px rgba(255, 152, 0, 0.4));
}

/* Texte de statut */
.exam-status-text {
    font-size: 15px;
    font-weight: 700;
    color: #FF9800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Numéro de chapitre */
.exam-chapter-number {
    font-size: 12px;
    font-weight: 600;
    color: #999;
    opacity: 0.8;
    margin-top: 2px;
}

/* Mini indicateur de progression */
.exam-progress-mini {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    opacity: 0.75;
    background: rgba(255, 193, 7, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 4px;
}

/* Tooltip contextuel qui apparaît au hover */
.exam-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(33, 33, 33, 0.96);
    color: #fff;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.6;
    white-space: normal; /* Permet le retour à la ligne */
    max-width: 320px;
    min-width: 250px;
    text-align: left;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 100;
}

.exam-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: rgba(33, 33, 33, 0.95);
}

/* Flèche du tooltip (si div séparée) */
.tooltip-arrow {
    display: none; /* On utilise ::after à la place */
}

.exam-tooltip p {
    margin: 0;
    white-space: normal;
    font-size: 13px;
    line-height: 1.6;
}

/* Responsive pour mobile : tooltip plus compact */
@media (max-width: 768px) {
    .exam-tooltip {
        max-width: 280px;
        min-width: 220px;
        font-size: 12px;
        padding: 12px 16px;
    }
}

.exam-badge:hover .exam-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-12px);
}

/* Particules décoratives flottantes */
.exam-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.exam-particles span {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(255, 193, 7, 0.4);
    border-radius: 50%;
    animation: particleFloat 4s ease-in-out infinite;
}

.exam-particles span:nth-child(1) {
    top: 20%;
    left: 15%;
    animation-delay: 0s;
}

.exam-particles span:nth-child(2) {
    top: 60%;
    left: 80%;
    animation-delay: 1s;
}

.exam-particles span:nth-child(3) {
    top: 80%;
    left: 30%;
    animation-delay: 2s;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-20px) scale(1.2);
        opacity: 0.6;
    }
}

/* ===== États du portail (locked, unlocked, completed) ===== */

/* État COMPLETED (vert) */
.center-exam-transition.completed .exam-badge {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(76, 175, 80, 0.08));
    border-color: rgba(76, 175, 80, 0.7);
}

.center-exam-transition.completed .exam-badge::before {
    background: linear-gradient(135deg,
        rgba(76, 175, 80, 0.3),
        rgba(129, 199, 132, 0.2)
    );
}

.center-exam-transition.completed .exam-icon {
    color: #4CAF50;
}

.center-exam-transition.completed .exam-status-text {
    color: #4CAF50;
}

.center-exam-transition.completed .exam-progress-mini {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.center-exam-transition.completed .exam-barrier {
    background: linear-gradient(90deg,
        rgba(76, 175, 80, 0.3),
        rgba(76, 175, 80, 0.8),
        rgba(76, 175, 80, 0.3)
    );
    box-shadow: 0 3px 12px rgba(76, 175, 80, 0.4);
}

.center-exam-transition.completed .exam-barrier::before,
.center-exam-transition.completed .exam-barrier::after {
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
}

.center-exam-transition.completed .exam-road-block {
    background: linear-gradient(135deg,
        rgba(76, 175, 80, 0.08) 0%,
        rgba(76, 175, 80, 0.04) 50%,
        rgba(129, 199, 132, 0.05) 100%
    );
}

/* État LOCKED (gris) */
.center-exam-transition.locked .exam-badge {
    background: rgba(220, 220, 220, 0.95);
    border-color: rgba(158, 158, 158, 0.6);
    opacity: 0.75;
}

.center-exam-transition.locked .exam-icon {
    color: #757575;
}

.center-exam-transition.locked .exam-status-text {
    color: #757575;
}

.center-exam-transition.locked .exam-progress-mini {
    background: rgba(0, 0, 0, 0.08);
    color: #999;
}

.center-exam-transition.locked .exam-barrier {
    background: linear-gradient(90deg,
        rgba(158, 158, 158, 0.3),
        rgba(158, 158, 158, 0.7),
        rgba(158, 158, 158, 0.3)
    );
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
}

.center-exam-transition.locked .exam-barrier::before,
.center-exam-transition.locked .exam-barrier::after {
    background: linear-gradient(135deg, #9E9E9E, #BDBDBD);
}

.center-exam-transition.locked .exam-road-block {
    background: linear-gradient(135deg,
        rgba(158, 158, 158, 0.05) 0%,
        rgba(158, 158, 158, 0.02) 50%,
        rgba(189, 189, 189, 0.03) 100%
    );
}

.center-exam-transition.locked .exam-badge:hover {
    transform: scale(1);
    cursor: not-allowed;
}

/* Tooltip visible sur TOUS les états au hover */
.center-exam-transition .exam-badge:hover .exam-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-12px);
}

/* Animation pulse pour l'examen actif (unlocked) */
.center-exam-transition.active-lesson .exam-badge {
    animation: examPulse 2.5s ease-in-out infinite;
}

@keyframes examPulse {
    0%, 100% {
        box-shadow:
            0 10px 40px rgba(31, 38, 135, 0.2),
            0 4px 12px rgba(255, 193, 7, 0.3),
            inset 0 2px 0 rgba(255, 255, 255, 0.9);
    }
    50% {
        box-shadow:
            0 14px 56px rgba(31, 38, 135, 0.3),
            0 6px 20px rgba(255, 193, 7, 0.5),
            inset 0 2px 0 rgba(255, 255, 255, 0.9);
    }
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .exam-badge {
        padding: 16px 24px;
        min-width: 140px;
    }

    .exam-icon {
        font-size: 30px;
    }

    .exam-status-text {
        font-size: 13px;
    }

    .exam-progress-mini {
        font-size: 10px;
    }

    .exam-barrier {
        height: 10px;
    }

    .exam-barrier::before,
    .exam-barrier::after {
        width: 14px;
        height: 14px;
    }

    .exam-tooltip {
        max-width: 250px;
        font-size: 12px;
        padding: 10px 14px;
    }
}

