/* ========================================
   VARIABLES CSS
======================================== */
:root {
  /* Couleurs principales */
  --primary: #667eea;
  --primary-dark: #5568d3;
  --secondary: #764ba2;
  --accent-pink: #f093fb;
  --accent-red: #f5576c;
  --success: #51cf66;
  --success-dark: #40c057;
  --danger: #ff6b6b;
  --danger-dark: #ee5a6f;

  /* Couleurs neutres */
  --white: #ffffff;
  --light-gray: #f8f9fa;
  --gray: #dfe6e9;
  --medium-gray: #b2bec3;
  --dark-gray: #636e72;
  --darker-gray: #2d3436;
  --disabled: #adb5bd;

  /* Effets */
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.3);
  --shadow-primary: 0 4px 15px rgba(102, 126, 234, 0.3);
  --shadow-success: 0 4px 15px rgba(81, 207, 102, 0.3);
  --shadow-danger: 0 10px 30px rgba(238, 90, 111, 0.4);

  /* Bordures et rayons */
  --border: 3px solid var(--gray);
  --border-hover: 3px solid var(--medium-gray);
  --border-selected: 3px solid var(--primary);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 50%;

  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.2s ease;

  /* Espacements */
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 20px;
  --space-lg: 30px;
  --space-xl: 40px;
}

/* ========================================
   RESET & BASE
======================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  overflow-x: hidden;
}

/* ========================================
   MENU PRINCIPAL (TOP)
======================================== */
#menuOptions {
  position: fixed;
  top: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-lg);
  padding: var(--space-xs);
  box-shadow: var(--shadow);
}

#menuOptions button {
  background: var(--white);
  border: 2px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 10px var(--space-md);
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

#menuOptions button:hover {
  background: var(--light-gray);
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary);
}

#menuOptions button:active {
  transform: translateY(0);
}

#fullscreenBtn {
  min-width: 50px;
}

/* ========================================
   MENU PARAMÈTRES
======================================== */
#menuOptions {
  position: fixed;
  top: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-lg);
  padding: var(--space-xs);
  box-shadow: var(--shadow);
}

#menuOptions button {
  background: var(--white);
  border: 2px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 10px var(--space-md);
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

#menuOptions button:hover {
  background: linear-gradient(135deg,
      var(--primary) 15 0%,
      var(--secondary) 15 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary);
}

#menuOptions button:active {
  transform: translateY(0);
}

#fullscreenBtn {
  min-width: 50px;
}

/* ========================================
   MENU PARAMÈTRES
======================================== */

#menuParams {
  position: fixed;
  top: 80px;
  right: 20px;
  width: 320px;
  max-height: 75vh;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border: 2px solid var(--gray);
  border-radius: 30px 0px 0px 30px;
  padding: var(--space-lg);
  z-index: 20;
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.3s ease-out;

  /* Scrollbar stylisée pour Webkit (Chrome, Safari, Edge) */
  scrollbar-width: thin;
  /* Pour Firefox */
  scrollbar-color: var(--primary) var(--light-gray);
}

/* Scrollbar pour Webkit (Chrome, Safari, Edge) */
#menuParams::-webkit-scrollbar {
  width: 12px;
}

#menuParams::-webkit-scrollbar-track {
  background: var(--light-gray);
  border-radius: 10px;
  margin: 8px 0;
  border: 2px solid transparent;
  background-clip: padding-box;
}

#menuParams::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: padding-box;
  transition: var(--transition);
}

#menuParams::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg,
      var(--primary-dark) 0%,
      var(--secondary) 100%);
  box-shadow: 0 0 8px rgba(102, 126, 234, 0.4);
}

#menuParams::-webkit-scrollbar-thumb:active {
  background: linear-gradient(135deg,
      var(--primary) 0%,
      var(--accent-pink) 100%);
}

#menuParams::-webkit-scrollbar-button {
  display: none;
  /* Cache les flèches */
}

/* Pour Firefox */
@supports (scrollbar-color: auto) {
  #menuParams {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--light-gray);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#menuParams h3 {
  margin: 0 0 var(--space-md) 0;
  font-size: 22px;
  color: var(--darker-gray);
  text-align: center;
  border-bottom: 2px solid var(--primary);
  padding-bottom: var(--space-sm);
  font-weight: 700;
}

/* Groupes de paramètres */
.param-group {
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  background: var(--light-gray);
  border-radius: var(--radius-lg);
  border: 2px solid var(--gray);
}

.param-group:last-child {
  margin-bottom: 0;
}

.param-group label {
  display: block;
  margin-bottom: var(--space-sm);
  font-size: 16px;
  font-weight: 600;
  color: var(--darker-gray);
}

.param-group p {
  font-size: 14px;
  color: var(--dark-gray);
  margin-bottom: var(--space-md);
  line-height: 1.5;
}

/* Options radio */
.radio-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.radio-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--white);
  border: 2px solid var(--gray);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
  color: var(--darker-gray);
}

.radio-label:hover {
  border-color: var(--medium-gray);
  background: var(--light-gray);
  transform: translateX(5px);
}

.radio-label input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--medium-gray);
  border-radius: var(--radius-full);
  margin: 0;
  cursor: pointer;
  position: relative;
  transition: var(--transition-fast);
}

.radio-label input[type="radio"]:checked {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.radio-label input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: var(--white);
  border-radius: var(--radius-full);
}

.radio-label input[type="radio"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* Boutons d'action */
.param-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.param-actions button {
  flex: 1;
  padding: var(--space-sm);
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#applyBtn {
  background: linear-gradient(135deg,
      var(--success) 0%,
      var(--success-dark) 100%);
  color: var(--white);
}

#applyBtn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-success);
}

#cancelBtn {
  background: var(--light-gray);
  border: 2px solid var(--gray);
  color: var(--darker-gray);
}

#cancelBtn:hover {
  background: var(--gray);
  border-color: var(--medium-gray);
}

/* Séparateurs */
#menuParams hr {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gray), transparent);
  margin: var(--space-lg) 0;
}

/* Badges pour options */
.option-badge {
  display: inline-block;
  padding: 4px 10px;
  background: linear-gradient(135deg,
      var(--primary) 15 0%,
      var(--secondary) 15 100%);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: var(--space-sm);
}

/* Description sous les options */
.option-description {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  margin-left: auto;
}

/* Style spécifique pour les options sélectionnées */
.radio-label.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg,
      var(--primary) 10 0%,
      var(--secondary) 10 100%);
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

/* Indicateur de statut */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  margin-left: auto;
}

.status-indicator::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--success);
}

.status-indicator.inactive::before {
  background: var(--danger);
}

/* Animation pour le menu */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

#menuParams.show {
  animation: slideInRight 0.3s ease-out;
}

/* Overlay pour mobile */
.menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  z-index: 19;
}

.menu-overlay.show {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

/* ========================================
   CONTENEUR PRINCIPAL
======================================== */
.symbol-selection {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  box-shadow: var(--shadow-lg);
  max-width: 900px;
  width: 100%;
  animation: slideIn 0.5s ease-out;
  margin-top: 20px;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   HEADER SECTION
======================================== */
h1 {
  text-align: center;
  color: var(--darker-gray);
  margin-bottom: 8px;
  font-size: 32px;
  font-weight: 800;
}

.subtitle {
  text-align: center;
  color: var(--dark-gray);
  margin-bottom: var(--space-lg);
  font-size: 14px;
  font-weight: 400;
}

/* ========================================
   PLAYERS CONTAINER
======================================== */
.players-container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-md);
  align-items: start;
  margin-bottom: var(--space-lg);
}

/* ========================================
   PLAYER SECTION COMPACT
======================================== */
.player-section {
  background: var(--light-gray);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  position: relative;
  transition: var(--transition);
  border: 3px solid transparent;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.player-section.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.player-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.player-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

.player1 .player-icon {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.player2 .player-icon {
  background: linear-gradient(135deg,
      var(--accent-pink) 0%,
      var(--accent-red) 100%);
}

.player-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--darker-gray);
}

/* ========================================
   SYMBOL GRID COMPACT
======================================== */
.symbol-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: var(--space-sm);
  /*flex-grow: 1;*/
}

.symbol-option {
  aspect-ratio: 1;
  border: var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  cursor: pointer;
  transition: var(--transition);
  background: var(--white);
  min-height: 60px;
}

.symbol-option:hover:not(.disabled) {
  transform: scale(1.05);
  border-color: var(--medium-gray);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.symbol-option.selected {
  border-color: var(--primary);
  transform: scale(1.03);
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
}

.symbol-option.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(1);
}

/* ========================================
   CUSTOM SYMBOL COMPACT
======================================== */
.custom-symbol {
  grid-column: span 4;
  padding: var(--space-sm);
  background: var(--white);
  border: 2px dashed var(--gray);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: var(--space-sm);
}

.custom-symbol:hover {
  border-color: var(--primary);
  background: var(--light-gray);
}

.custom-symbol span {
  font-weight: 600;
  color: var(--darker-gray);
  font-size: 14px;
}

.custom-symbol p {
  font-size: 11px;
  color: var(--dark-gray);
  margin-top: 4px;
}

.custom-symbol input[type="file"] {
  display: none;
}

.custom-preview {
  width: 50px;
  height: 50px;
  margin: 8px auto;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: none;
  border: 2px solid var(--gray);
}

.custom-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.custom-preview.show {
  display: block;
}

/* ========================================
   SELECTED DISPLAY COMPACT
======================================== */
.selected-display {
  margin-top: auto;
  padding: var(--space-sm);
  background: var(--white);
  border-radius: var(--radius-sm);
  text-align: center;
  border: 2px solid var(--gray);
}

.selected-display .preview {
  font-size: 36px;
  margin-bottom: 4px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.selected-display .label {
  font-size: 12px;
  font-weight: 500;
  color: var(--dark-gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ========================================
   VS DIVIDER COMPACT
======================================== */
.vs-divider {
  display: flex;
  justify-content: center;
  /* Centrage horizontal */
  align-items: center;
  /* Centrage vertical */
  height: 50vh;
  /* Optionnel : hauteur totale de l'écran */
}

.vs-circle {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg,
      var(--danger) 0%,
      var(--danger-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: var(--white);
  box-shadow: var(--shadow-danger);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

/* ========================================
   START BUTTON COMPACT
======================================== */
.start-button {
  margin-top: var(--space-lg);
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg,
      var(--success) 0%,
      var(--success-dark) 100%);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-success);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.start-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(81, 207, 102, 0.4);
}

.start-button:active:not(:disabled) {
  transform: translateY(0);
}

.start-button:disabled {
  background: var(--disabled);
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.6;
}

/* ========================================
   RESPONSIVE DESIGN
======================================== */
@media (max-aspect-ratio: 1/1) {
  :root {
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
  }

  html,
  body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    /* Ou ta couleur de fond */
  }

  .symbol-selection {
    height: auto;
    max-height: 95vh;
    /* Limite la hauteur globale */
    width: 95%;
    margin: 2.5vh auto;
    overflow-y: auto;
    /* Active le scroll interne */

    display: flex;
    flex-direction: column;

    /* Le secret est ici : */
    padding: var(--space-md);
    padding-bottom: 10px;
    /* Le bouton s'arrêtera pile à 10px du bord blanc */
    box-sizing: border-box;

    position: relative;
    /* Référentiel pour le sticky */
  }

  h1 {
    font-size: 1.5rem;
    margin-bottom: 5px;
  }

  .subtitle {
    font-size: 1rem;
    margin-bottom: var(--space-md);
    text-align: center;
  }

  .players-container {
    display: flex;
    flex-direction: column;
    /* Empile les joueurs verticalement */
    width: 100%;
    gap: 10px;
  }

  .player-section {
    width: 100%;
    padding: var(--space-sm);
    border: 1px solid #eee;
    border-radius: 10px;
  }

  .player-section:first-child {
    order: 1;
  }

  .player-section:last-child {
    order: 3;
  }

  .player-icon {
    width: 12vw;
    max-width: 50px;
    height: 12vw;
    max-height: 50px;
    font-size: 3vw;
  }

  .player-header h2 {
    font-size: 3vw;
  }

  .symbol-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 10px 0;
  }

  .symbol-option {
    font-size: clamp(16px, 12vw, 60px);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    border-radius: 8px;
  }

  .custom-symbol {
    padding: 10px;
  }

  .custom-symbol span {
    font-size: 2.8vw;
  }

  .custom-symbol p {
    font-size: 2.6vw;
  }

  .custom-preview {
    width: 80px;
    height: 80px;
    margin: 5px auto;
  }

  .selected-display {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
  }

  .selected-display .preview {
    font-size: 2rem;
  }

  .selected-display .label {
    font-size: 2.6vw;
  }

  .vs-divider {
    display: none;
  }

  .start-button {
    font-size: 3vw;
    width: 100%;
    padding: 15px;
    margin-top: 20px;
    position: sticky;
    bottom: 0;
    /* Colle au bas du scroll */
    z-index: 10;
  }

  .param-group {
    padding: 20px;
    margin-bottom: var(--space-md);
  }

  .radio-label {
    padding: 8px 10px;
  }

  .param-actions {
    position: sticky;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 0;
    margin-top: var(--space-md);
    backdrop-filter: blur(10px);
  }

  #menuOptions {
    top: 10px;
    padding: 6px;
    gap: 6px;
    width: calc(100% - 5vw);
    justify-content: center;
  }

  #menuOptions button {
    width: 100%;
    padding: 8px 12px;
    font-size: 3vw;
    flex: 1;
    min-width: 0;
  }

  #fullscreenBtn {
    min-width: 40px;
    flex: 0 0 auto;
  }

  #menuParams {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    margin: 0;
    padding: 80px 20px 30px;
    max-height: 100vh;
    z-index: 1000;
  }

  #menuParams h3 {
    font-size: 3.2vw;
    margin-bottom: var(--space-lg);
  }

  #menuParams label,
  #menuParams p {
    font-size: 30px;
  }

  #menuParams span {
    font-size: 2.8vw;
  }

  #menuParams button {
    font-size: 30px;
    padding: 30px;
    margin-top: var(--space-md);
  }

  #menuParams .radio-label {
    font-size: 24px;
    padding: 16px 20px;
  }
}

/* ========================================
   UTILITAIRES
======================================== */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mt-1 {
  margin-top: var(--space-xs);
}

.mt-2 {
  margin-top: var(--space-sm);
}

.mt-3 {
  margin-top: var(--space-md);
}

.mt-4 {
  margin-top: var(--space-lg);
}

.mt-5 {
  margin-top: var(--space-xl);
}

.mb-1 {
  margin-bottom: var(--space-xs);
}

.mb-2 {
  margin-bottom: var(--space-sm);
}

.mb-3 {
  margin-bottom: var(--space-md);
}

.mb-4 {
  margin-bottom: var(--space-lg);
}

.mb-5 {
  margin-bottom: var(--space-xl);
}

.p-1 {
  padding: var(--space-xs);
}

.p-2 {
  padding: var(--space-sm);
}

.p-3 {
  padding: var(--space-md);
}

.p-4 {
  padding: var(--space-lg);
}

.p-5 {
  padding: var(--space-xl);
}

/* ========================================
   ANIMATIONS SUPPLÉMENTAIRES
======================================== */
@keyframes bounce {

  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-10px);
  }

  60% {
    transform: translateY(-5px);
  }
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-2px);
  }

  20%,
  40%,
  60%,
  80% {
    transform: translateX(2px);
  }
}

/* Classes d'animation */
.animate-bounce {
  animation: bounce 1s ease infinite;
}

.animate-shake {
  animation: shake 0.5s ease-in-out;
}

/* ========================================
   ÉTATS DE CHARGEMENT
======================================== */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.3),
      transparent);
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

/* ========================================
   ACCESSIBILITÉ
======================================== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus visible pour navigation au clavier */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ========================================
   SCROLLBAR GLOBALE
======================================== */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--light-gray);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: var(--radius-sm);
  border: 2px solid var(--light-gray);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg,
      var(--primary-dark) 0%,
      var(--secondary) 100%);
}