/* Base Variables */
:root {
  --primary: #ffd700;
  --secondary: #c0a000;
  --bg: #0a0a14;
  --border: #3a3a2f;
  --telegram-width: 360px;
  --telegram-height: 600px;
  --error-red: #ff4444;
  --success-green: #44ff44;
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Orbitron', sans-serif;
  background: #000;
  color: var(--primary);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
}

/* Main Container */
.container {
  position: relative;
  overflow: hidden;
  width: var(--telegram-width);
  height: var(--telegram-height);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: var(--telegram-height);
  padding-bottom: 45px;
}

/* Header Section */
.header {
  height: 50px;
  padding: 0 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.8);
  border-bottom: 1px solid var(--border);
  z-index: 10;
  gap: 10px;
}

.header h1 {
  font-size: 18px;
  color: var(--primary);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-stat {
  background: rgba(255,215,0,0.1);
  padding: 4px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-stat-icon {
  font-size: 14px;
}

.header-stat-value {
  font-family: 'Orbitron', sans-serif;
  font-weight: bold;
}

.header-exp-bar {
  width: 50px;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}

.header-exp-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s ease;
}

/* Add styles for FACT counter */
.fact-points {
  position: fixed;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.8);
  border: 1px solid var(--primary);
  padding: 5px 10px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  z-index: 1000;
}

.fact-points-icon {
  color: var(--primary);
}

.fact-points-value:after {
  content: ' $FACT';
  color: var(--primary);
  opacity: 0.8;
}

/* Hide any header elements for LVL and FACT points */
#tower-level,
#fact-counter {
  display: none !important;
}

/* Remove old styles */
.player-level {
  display: none;
}

/* Tab Navigation */
.tab-bar {
  height: 42px;
  display: flex;
  background: rgba(0, 0, 0, 0.5);
  border-bottom: 3px solid var(--primary);
  z-index: 10;
  padding: 0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.tab-btn {
  flex: 1;
  border: none;
  background: linear-gradient(to bottom, rgba(20, 20, 20, 0.8), rgba(0, 0, 0, 0.6));
  color: var(--primary);
  font-family: 'Orbitron', sans-serif;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
  position: relative;
  margin: 0;
  border-radius: 4px 4px 0 0;
  text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
  box-shadow: 
    inset 0 1px 0 rgba(255, 215, 0, 0.2),
    inset 0 -5px 10px rgba(0, 0, 0, 0.3);
  /* Séparation verticale entre les onglets */
  border-right: 3px solid rgba(255, 215, 0, 0.4);
  padding: 0 1px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Ajustement spécifique pour l'onglet EXCHANGE */
.tab-btn[data-tab="exchange"] {
  font-size: 8px;
  letter-spacing: 0;
  padding: 0;
}

.tab-btn:last-child {
  border-right: none;
}

.tab-btn:before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.tab-btn:hover {
  background: linear-gradient(to bottom, rgba(50, 50, 20, 0.9), rgba(30, 30, 10, 0.7));
  box-shadow: 
    inset 0 1px 0 rgba(255, 215, 0, 0.3),
    inset 0 -5px 10px rgba(0, 0, 0, 0.4);
  transform: translateY(-1px);
}

.tab-btn.active {
  background: linear-gradient(to bottom, rgba(80, 70, 0, 0.4), rgba(50, 45, 0, 0.5));
  box-shadow: 
    0 0 10px rgba(255, 215, 0, 0.4),
    inset 0 1px 0 rgba(255, 215, 0, 0.5);
  border-bottom: 3px solid var(--primary);
  /* Pas de bordure à droite pour l'onglet actif */
  border-right-color: transparent;
  transform: translateY(-2px);
  z-index: 2;
}

.tab-btn.active:before {
  transform: scaleX(1);
}

/* Update tab bar styles */
.tab-bar.game-tabs {
  margin-top: -1px;
  border-top: none;
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 2px 0 2px;
  height: 40px;
}

.game-tabs .tab-btn {
  background: linear-gradient(to bottom, rgba(20, 20, 20, 0.8), rgba(0, 0, 0, 0.6));
  font-size: 9px;
  padding: 8px 1px;
  margin: 0 1px;
  border-radius: 6px 6px 0 0;
  border-bottom: none;
  box-shadow: 
    inset 0 1px 0 rgba(255, 215, 0, 0.2),
    inset 0 -3px 6px rgba(0, 0, 0, 0.3);
  /* Séparation verticale accentuée pour les onglets de jeu */
  border-right: 3px solid rgba(255, 215, 0, 0.4);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.game-tabs .tab-btn:last-child {
  border-right: none;
}

.game-tabs .tab-btn:hover {
  background: linear-gradient(to bottom, rgba(50, 50, 20, 0.9), rgba(30, 30, 10, 0.7));
  box-shadow: 
    inset 0 1px 0 rgba(255, 215, 0, 0.3),
    inset 0 -3px 6px rgba(0, 0, 0, 0.4);
  transform: translateY(-1px);
}

.game-tabs .tab-btn.active {
  background: linear-gradient(to bottom, rgba(80, 70, 0, 0.5), rgba(50, 45, 0, 0.6));
  box-shadow: 
    0 -3px 6px rgba(255, 215, 0, 0.3),
    inset 0 1px 0 rgba(255, 215, 0, 0.5);
  position: relative;
  z-index: 2;
  border-bottom: 3px solid var(--primary);
  /* Pas de bordure à droite pour l'onglet actif de jeu */
  border-right-color: transparent;
  transform: translateY(-2px);
}

/* Game Screen */
.game-screen {
  display: none;
  height: calc(100% - 125px);
  overflow-y: auto;
  position: relative;
  background: var(--bg);
}

.game-screen.active {
  display: block;
}

#game.game-screen {
  display: none;
  position: relative;
  height: calc(100% - 125px);
  overflow: hidden;
}

#game.game-screen.active {
  display: block;
}

#profile.game-screen {
  height: calc(100% - 90px);
  overflow-y: auto;
  padding: 0;
}

/* Energy Core and Gauge Styling - POSITION ULTRA-FIXE */
.energy-core {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  width: 120px !important;
  height: 120px !important;
  margin-top: -60px !important;
  margin-left: -60px !important;
  transform: none !important;
  animation: none !important;
  transition: none !important;
  border-radius: 50% !important;
  background: radial-gradient(circle, #ff3d71, #ff6b9d) !important;
  border: 3px solid #00e096 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-direction: column !important;
  box-shadow: 0 0 20px rgba(255, 61, 113, 0.6) !important;
  z-index: 10 !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  contain: layout style paint !important;
  isolation: isolate !important;
  will-change: auto !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
  /* NOUVELLES PROPRIÉTÉS ANTI-DÉPLACEMENT */
  top: calc(50vh - 60px) !important;
  left: calc(50vw - 60px) !important;
  margin: 0 !important;
  translate: none !important;
  scale: none !important;
  rotate: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-transform: none !important;
  -moz-transform: none !important;
  -ms-transform: none !important;
  -o-transform: none !important;
  transform-style: flat !important;
  transform-origin: center center !important;
  perspective: none !important;
  perspective-origin: center center !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
  /* BLOCAGE TOTAL DES MOUVEMENTS */
  top: 50vh !important;
  left: 50vw !important;
  margin-top: -60px !important;
  margin-left: -60px !important;
  right: auto !important;
  bottom: auto !important;
  /* STABILISATION ULTIME */
  transform: translate3d(0, 0, 0) !important;
  -webkit-transform: translate3d(0, 0, 0) !important;
}

/* RÈGLES DE NEUTRALISATION COMPLÈTE */
#energy-tap {
  position: fixed !important;
  top: calc(50vh - 60px) !important;
  left: calc(50vw - 60px) !important;
  width: 120px !important;
  height: 120px !important;
  transform: none !important;
  -webkit-transform: none !important;
  translate: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 3px solid #00e096 !important;
  border-radius: 50% !important;
  background: radial-gradient(circle, #ff3d71, #ff6b9d) !important;
  z-index: 10 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-direction: column !important;
  transition: none !important;
  animation: none !important;
  will-change: auto !important;
  contain: layout style paint !important;
  isolation: isolate !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
}

/* Supprimer COMPLÈTEMENT toutes les animations de clic */
.energy-core:active,
.energy-core:hover,
.energy-core:focus,
#energy-tap:active,
#energy-tap:hover,
#energy-tap:focus {
  position: fixed !important;
  top: calc(50vh - 60px) !important;
  left: calc(50vw - 60px) !important;
  transform: none !important;
  -webkit-transform: none !important;
  transition: none !important;
  animation: none !important;
  translate: none !important;
  scale: none !important;
  rotate: none !important;
  margin: 0 !important;
  width: 120px !important;
  height: 120px !important;
}

/* Supprimer les classes d'animation qui causent des déplacements */
.energy-core.tapping,
.energy-core.tapping-release,
#energy-tap.tapping,
#energy-tap.tapping-release,
.energy-core.pressed,
#energy-tap.pressed {
  position: fixed !important;
  top: calc(50vh - 60px) !important;
  left: calc(50vw - 60px) !important;
  transform: none !important;
  -webkit-transform: none !important;
  transition: none !important;
  animation: none !important;
  translate: none !important;
  scale: none !important;
  rotate: none !important;
  margin: 0 !important;
  width: 120px !important;
  height: 120px !important;
}

/* ANTI-WHEEL-EVENT - Neutraliser tous les effets des événements wheel */
.energy-core,
#energy-tap {
  /* Empêcher les scrolls et wheel events d'affecter la position */
  overscroll-behavior: none !important;
  scroll-behavior: auto !important;
  -webkit-overflow-scrolling: auto !important;
  overflow: hidden !important;
  touch-action: manipulation !important;
  -ms-touch-action: manipulation !important;
  -webkit-touch-callout: none !important;
  -webkit-tap-highlight-color: transparent !important;
  /* Position absolument fixe dans la viewport */
  position: fixed !important;
  top: 50vh !important;
  left: 50vw !important;
  margin-top: -60px !important;
  margin-left: -60px !important;
  transform: translate3d(0, 0, 0) !important;
  -webkit-transform: translate3d(0, 0, 0) !important;
}

/* Stabilisation absolue pour tous les enfants */
.energy-core *,
.energy-core *::before,
.energy-core *::after,
#energy-tap *,
#energy-tap *::before,
#energy-tap *::after {
  pointer-events: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  position: relative !important;
  transform: none !important;
  -webkit-transform: none !important;
  transition: none !important;
  animation: none !important;
  will-change: auto !important;
  contain: layout style paint !important;
  translate: none !important;
  scale: none !important;
  rotate: none !important;
  top: 0 !important;
  left: 0 !important;
  right: auto !important;
  bottom: auto !important;
  margin: 0 !important;
}

/* Forcer la stabilité du logo VR */
.vr-logo {
  width: 120px !important;
  height: 120px !important;
  border-radius: 50% !important;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3) !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  pointer-events: none !important;
  -webkit-tap-highlight-color: transparent !important;
  position: relative !important;
  top: 0 !important;
  left: 0 !important;
  transform: none !important;
  -webkit-transform: none !important;
  transition: none !important;
  animation: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  translate: none !important;
  scale: none !important;
  rotate: none !important;
}

/* NEUTRALISATION COMPLÈTE DES ANIMATIONS DE RECHARGE */
.energy-core.depleted,
#energy-tap.depleted {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  /* Maintenir la position fixe même en état depleted */
  position: fixed !important;
  top: calc(50vh - 60px) !important;
  left: calc(50vw - 60px) !important;
  transform: none !important;
  animation: none !important;
}

.energy-core.recharging,
#energy-tap.recharging {
  /* Supprimer l'animation de recharge qui peut causer des déplacements */
  animation: none !important;
  /* Maintenir la position fixe même en recharge */
  position: fixed !important;
  top: calc(50vh - 60px) !important;
  left: calc(50vw - 60px) !important;
  transform: none !important;
  opacity: 1 !important;
}

/* SUPPRIMER COMPLÈTEMENT L'ANIMATION RECHARGE-PULSE */
@keyframes recharge-pulse {
  0%, 100% { 
    opacity: 1 !important; 
    transform: none !important;
    position: fixed !important;
    top: calc(50vh - 60px) !important;
    left: calc(50vw - 60px) !important;
  }
  50% { 
    opacity: 1 !important; 
    transform: none !important;
    position: fixed !important;
    top: calc(50vh - 60px) !important;
    left: calc(50vw - 60px) !important;
  }
}

.energy-core.depleted {
  opacity: 0.5;
  cursor: not-allowed;
}

.energy-core.recharging {
  animation: recharge-pulse 2s ease-in-out infinite;
}

@keyframes recharge-pulse {
  0% { opacity: 0.5; }
  50% { opacity: 0.8; }
  100% { opacity: 0.5; }
}

.tap-energy-gauge {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  user-select: none;
}

.tap-energy-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.tap-energy-fill {
  height: 100%;
  background: var(--primary);
  width: 100%;
  transition: width 0.3s ease;
  position: absolute;
  left: 0;
  top: 0;
}

.tap-energy-text {
  font-size: 12px;
  color: var(--primary);
  text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.tap2earn-label {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--primary);
  font-size: 16px;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Modify energy depleted state */
.energy-core.depleted .tap-energy-fill {
  background: #ff4444;
}

.energy-core.depleted .tap-energy-text {
  color: #ff4444;
}

/* Add recharge animation */
@keyframes recharge {
  from { background-position: 0 0; }
  to { background-position: 100% 0; }
}

.energy-core.recharging .tap-energy-fill {
  background: linear-gradient(
    90deg,
    var(--primary) 0%,
    #ffeb3b 50%,
    var(--primary) 100%
  );
  background-size: 200% 100%;
  animation: recharge 2s linear infinite;
}

/* Element Tap Area */
.element-tap-area {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
  max-width: var(--telegram-width);
  max-height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.element-tap-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  background: transparent;
  border: 2px solid var(--element-color);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  cursor: pointer;
}

.element-tap-button .tap2earn-label {
  color: var(--element-color);
}

.element-tap-icon {
  font-size: 32px;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.element-tap-area[data-element="water"] .element-tap-button {
  background: linear-gradient(to bottom, 
    rgba(0, 191, 255, 0.1),
    rgba(0, 128, 255, 0.2)
  );
  overflow: hidden;
  box-shadow: 0 0 15px rgba(0, 191, 255, 0.3);
}

.element-tap-area[data-element="water"] .element-tap-button:active {
  background: linear-gradient(to bottom, 
    rgba(0, 191, 255, 0.3),
    rgba(0, 128, 255, 0.4)
  );
  box-shadow: 0 0 25px rgba(0, 191, 255, 0.5);
}

.element-tap-area[data-element="water"] .element-gauge-fill {
  background: linear-gradient(to right,
    rgba(0, 191, 255, 0.8),
    rgba(0, 128, 255, 1)
  );
}

@keyframes waterRipple {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(2.5); opacity: 0; }
}

.water-ripple {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.element-tap-area, 
.element-tap-button, 
.element-tap-icon,
.element-gauge,
.element-gauge-bar,
.element-gauge-text {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

@keyframes waterButtonPress {
  0% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 0 0 rgba(0, 255, 255, 0.4);
  }
  50% {
    transform: translate(-50%, -50%) scale(0.95);
    box-shadow: 0 0 10px 5px rgba(0, 255, 255, 0.6);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 20px 0 rgba(0, 255, 255, 0.4);
  }
}

.element-tap-area[data-element="water"] .element-tap-button.pressed {
  animation: waterButtonPress 0.3s ease-out forwards;
}

.element-gauge {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  pointer-events: none;
}

.element-gauge-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.element-gauge-fill {
  height: 100%;
  background: var(--element-color);
  transition: width 0.3s ease;
}

.element-gauge-text {
  font-size: 12px;
  color: var(--element-color);
  text-shadow: 0 0 5px var(--element-color);
}

.tap2earn-label {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--primary);
  font-size: 16px;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
  pointer-events: none;
  white-space: nowrap;
}

/* Lands Grid */
#lands-grid {
  width: 100%;
  height: calc(100% - 140px);
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  margin-top: 0;
}

.land-map-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible; /* Changer overflow:hidden à visible pour ne pas couper les marqueurs */
  touch-action: none;
  -webkit-overflow-scrolling: touch;
  z-index: 1; /* S'assurer que le conteneur de carte est derrière les marqueurs */
}

.land-map {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  z-index: 1; /* S'assurer que l'image de la carte est derrière les marqueurs */
  pointer-events: none; /* S'assurer que l'image ne bloque pas les clics sur les marqueurs */
}

.land-marker {
  cursor: pointer;
  z-index: 150;
  font-size: 16px; /* Légère augmentation pour meilleure visibilité */
  width: 30px; /* Légère augmentation pour meilleure visibilité */
  height: 30px; /* Légère augmentation pour meilleure visibilité */
  background: rgba(0,0,0,0.8);
  border: 3px solid var(--primary);
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  transition: all 0.3s;
  text-shadow: 0 0 5px #fff;
  box-shadow: 0 0 8px rgba(255,215,0,0.9);
  /* Suppression de l'animation */
}

.land-marker:hover {
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 0 12px var(--primary);
}

/* Style uniforme pour les régions spécifiques */
.land-marker[data-region="wood"] {
  border-color: #8B4513; /* Marron */
  background-color: rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 8px #8B4513;
  text-shadow: 0 0 5px #fff;
  z-index: 160;
}

.land-marker[data-region="fire"] {
  border-color: #FF4500; /* Rouge-orange */
  background-color: rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 8px #FF4500;
  text-shadow: 0 0 5px #fff;
  z-index: 160;
}

.land-marker[data-region="metal"] {
  border-color: #A9A9A9; /* Gris foncé */
  background-color: rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 8px #A9A9A9;
  text-shadow: 0 0 5px #fff;
  z-index: 160;
}

.land-marker[data-region="stone"] {
  border-color: #708090; /* Gris ardoise */
  background-color: rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 8px #708090;
  text-shadow: 0 0 5px #fff;
  z-index: 160;
}

.land-marker[data-region="water"] {
  border-color: #1E90FF; /* Bleu */
  background-color: rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 8px #1E90FF;
  text-shadow: 0 0 5px #fff;
  z-index: 160;
}

/* Autres types de terrains spécifiques */
.land-marker[data-region="cyberpunk"] {
  border-color: #ff00ff;
  background-color: rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 8px #ff00ff;
  text-shadow: 0 0 5px #fff;
}

.land-marker[data-region="futuristic"] {
  border-color: #00ffff;
  background-color: rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 8px #00ffff;
  text-shadow: 0 0 5px #fff;
}

.land-marker[data-region="historical"] {
  border-color: #ffd700;
  background-color: rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 8px #ffd700;
  text-shadow: 0 0 5px #fff;
}

.land-marker[data-region="factory_tower"] {
  border-color: gold;
  background-color: rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 10px gold;
  text-shadow: 0 0 5px #fff;
  z-index: 170;
}

.land-marker[data-region="incinerator"] {
  border-color: #ff6600;
  background-color: rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 10px #ff6600;
  text-shadow: 0 0 5px #fff;
  z-index: 160;
}

/* Suppression complète de toutes les animations */
@keyframes markerPulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes waterPulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 15px #1E90FF;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 0 30px #1E90FF;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 15px #1E90FF;
  }
}

/* Appliquer les animations */
.land-marker[data-region="wood"] {
  border-color: #8B4513; /* Marron */
  background-color: rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 8px #8B4513;
  text-shadow: 0 0 5px #fff;
  z-index: 160;
}

.land-marker[data-region="fire"] {
  border-color: #FF4500; /* Rouge-orange */
  background-color: rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 8px #FF4500;
  text-shadow: 0 0 5px #fff;
  z-index: 160;
}

.land-marker[data-region="metal"] {
  border-color: #A9A9A9; /* Gris foncé */
  background-color: rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 8px #A9A9A9;
  text-shadow: 0 0 5px #fff;
  z-index: 160;
}

.land-marker[data-region="stone"] {
  border-color: #708090; /* Gris ardoise */
  background-color: rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 8px #708090;
  text-shadow: 0 0 5px #fff;
  z-index: 160;
}

.land-marker[data-region="water"] {
  border-color: #1E90FF; /* Bleu */
  background-color: rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 8px #1E90FF;
  text-shadow: 0 0 5px #fff;
  z-index: 160;
}

.land-marker.owned {
  /* Add a subtle owned indicator */
  outline: 1px solid rgba(255, 255, 255, 0.3);
}

@keyframes markerPulse {
  0% {
    box-shadow: 0 0 5px var(--primary);
  }
  50% {
    box-shadow: 0 0 15px var(--primary);
  }
  100% {
    box-shadow: 0 0 5px var(--primary);
  }
}

/* Resource Bar */
.resource-bar {
  position: fixed;
  bottom: 45px;
  width: var(--telegram-width);
  z-index: 50;
  height: 35px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  padding: 1px;
  background: rgba(0, 0, 0, 0.8);
  border-top: 1px solid var(--border);
}

.resource {
  position: relative;
  background: rgba(0,0,0,0.8);
  border: 1px solid var(--primary);
  border-radius: 4px;
  padding: 1px;
  text-align: center;
  cursor: pointer;
}

.resource-icon {
  font-size: 14px;
  text-shadow: 0 0 5px #fff;
  margin-bottom: 1px;
}

.resource-value {
  font-size: 9px !important;
}

/* NEW: Lock stock bar items (resources) that are not acquired (mine not owned) */
.resource[data-owned="false"] {
  pointer-events: none;
  cursor: default;
  opacity: 0.5;
}

/* Modal Styles */
.modal,
.factory-info.active,
.land-config-modal,
.message-popup,
.incinerator-modal {
  z-index: 1000;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: var(--bg);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--primary);
  max-width: 90%;
  max-height: 90%;
  overflow-y: auto;
}

/* Factory Menu */
.factory-info {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 320px;
  max-height: 90vh;
  background: var(--bg);
  border: 1px solid var(--primary);
  border-radius: 8px;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.factory-info.active {
  opacity: 1;
  visibility: visible;
}

.factory-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.03);
  position: relative;
}

.close-factory-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.7;
  transition: all 0.3s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

.close-factory-btn:hover {
  opacity: 1;
  transform: rotate(90deg);
}

.factory-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.3);
}

.factory-tab {
  flex: 1;
  padding: 10px;
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-family: 'Orbitron', sans-serif;
  opacity: 0.7;
  transition: all 0.3s;
}

.factory-tab.active {
  opacity: 1;
  background: rgba(255,215,0,0.1);
  border-bottom: 2px solid var(--primary);
}

.tab-panel {
  padding: 15px;
  display: none;
  overflow-y: auto;
  max-height: calc(90vh - 140px);
}

.tab-panel.active {
  display: block;
}

.current-level-info,
.next-level-info {
  background: rgba(255,215,0,0.05);
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.modal-header {
  padding: 15px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0,0,0,0.3);
}

.bonus-list {
  list-style: none;
  padding: 0;
  margin: 10px 0;
}

.bonus-list li {
  padding: 5px 0;
  color: var(--primary);
  font-size: 14px;
}

.feature-btn {
  margin-top: 15px;
}

.tab-panel::-webkit-scrollbar {
  width: 4px;
}

.tab-panel::-webkit-scrollbar-track {
  background: rgba(255,215,0,0.1);
}

.tab-panel::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 2px;
}

/* NEW: Factory Info Modal Tab Styles for Land Improvements */
.factory-info .tabs-content {
  overflow: hidden;
  max-height: none;
}

/* Modal Header */
.modal-header {
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 2;
  padding: 15px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.modal-header h3 {
  color: var(--primary);
  margin: 0;
  font-size: 18px;
}

.close-modal-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  opacity: 0.7;
  transition: all 0.3s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  cursor: pointer;
}

.close-modal-btn:hover {
  opacity: 1;
  transform: rotate(90deg);
}

/* Upgrade Button */
.upgrade-btn {
  width: 100%;
  padding: 12px;
  margin-top: 15px;
  background: rgba(255, 215, 0, 0.2);
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Orbitron', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s;
}

.upgrade-btn:hover {
  background: rgba(255, 215, 0, 0.3);
  transform: translateY(-2px);
}

.upgrade-btn .btn-icon {
  font-size: 18px;
}

/* Error Messages */
.error-modal {
  z-index: 2000;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.9);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--error-red);
  color: var(--error-red);
  max-width: 90%;
  width: 280px;
}

.error-content {
  text-align: center;
}

.error-content h3 {
  font-size: 16px;
  margin-bottom: 10px;
}

.error-content p {
  font-size: 14px;
  margin-bottom: 10px;
  word-wrap: break-word;
}

.error-details {
  margin-top: 10px;
  padding: 10px;
  background: rgba(255,0,0,0.1);
  border-radius: 4px;
  font-size: 12px;
  text-align: left;
  white-space: pre-wrap;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 200px;
  word-break: break-word;
}

.error-content button {
  background: rgba(255,0,0,0.2);
  border: 1px solid var(--error-red);
  color: var(--error-red);
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Orbitron', sans-serif;
  margin-top: 10px;
}

.error-content button:hover {
  background: rgba(255,0,0,0.3);
}

/* Message Popup */
.message-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.9);
  border: 1px solid var(--primary);
  padding: 8px 16px;
  border-radius: 4px;
  text-align: center;
  width: auto;
  max-width: 80%;
  z-index: 10000;
  font-size: 14px;
  pointer-events: none;
  animation: messageSlideIn 0.3s ease-out;
}

.message-popup.error {
  border-color: #ff4444;
  color: #ff4444;
  background: rgba(0,0,0,0.95);
  box-shadow: 0 0 10px rgba(255,0,0,0.3);
}

.message-popup.success {
  border-color: #44ff44;
  color: #44ff44;
}

.message-popup + .message-popup {
  bottom: calc(180px + 45px);
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--primary);
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

/* Profile Screen */
.profile-container {
  padding: 10px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

.profile-container::-webkit-scrollbar {
  width: 4px;
}

.profile-container::-webkit-scrollbar-track {
  background: rgba(255,215,0,0.1);
}

.profile-container::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 2px;
}

.profile-header {
  text-align: center;
  margin-bottom: 10px;
}

.profile-photo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  margin: 0 auto 8px;
  display: block;
  object-fit: cover;
}

.profile-header h2 {
  font-size: 16px;
  margin-bottom: 4px;
}

.profile-header p {
  font-size: 12px;
  color: var(--primary);
  opacity: 0.8;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.stat-item {
  background: rgba(255,215,0,0.1);
  padding: 8px;
  border-radius: 4px;
  text-align: center;
}

.stat-item h3 {
  font-size: 12px;
  margin-bottom: 4px;
  color: var(--primary);
}

.stat-item p {
  font-size: 11px;
  color: var(--primary);
}

/* Admin section */
.admin-section {
  margin-top: 0;
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255,215,0,0.1);
}

.admin-login-btn {
  width: 100%;
  padding: 8px;
  background: rgba(255,215,0,0.2);
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Achievements list */
.achievements-list {
  margin-top: 10px;
  font-size: 12px;
}

#profile.game-screen {
  height: calc(100% - 90px);
  overflow-y: auto;
  padding: 0;
}

/* Market Screen */
#land-market {
  padding: 15px;
  height: 100%;
  overflow-y: auto;
}

.market-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.stat-card {
  background: rgba(255,215,0,0.1);
  padding: 12px;
  border-radius: 4px;
  text-align: center;
}

.stat-card h3 {
  font-size: 14px;
  margin-bottom: 5px;
  color: var(--primary);
}

.stat-card p {
  font-size: 16px;
  color: var(--primary);
}

.energy-recharge-section {
  margin-bottom: 20px;
}

.recharge-card {
  background: rgba(255,215,0,0.1);
  border: 1px solid var(--primary);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
}

.recharge-card h3 {
  font-size: 16px;
  margin-bottom: 15px;
  color: var(--primary);
  text-align: center;
}

.recharge-content {
  display: flex;
  align-items: center;
  gap: 15px;
}

.energy-icon {
  font-size: 24px;
  color: var(--primary);
}

.energy-info {
  flex: 1;
}

.energy-amount {
  font-size: 14px;
  margin-bottom: 5px;
  color: var(--primary);
}

.ads-info {
  font-size: 12px;
  color: rgba(255,215,0,0.7);
}

.cooldown-info {
  font-size: 12px;
  color: #ff4444;
  margin-top: 5px;
}

.watch-ad-btn {
  padding: 10px 15px;
  background: linear-gradient(to bottom, #ffd700, #cc9900);
  color: #000;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Orbitron', sans-serif;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.watch-ad-btn:hover:not([disabled]) {
  background: linear-gradient(to bottom, #ffec4c, #edc200);
}

.watch-ad-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  background: #666;
}

.recent-sales {
  background: rgba(255,215,0,0.1);
  border-radius: 8px;
  padding: 15px;
  margin-top: 20px;
}

.recent-sales h3 {
  font-size: 16px;
  margin-bottom: 10px;
  color: var(--primary);
}

.last-update {
  font-size: 12px;
  color: rgba(255,215,0,0.7);
  margin-bottom: 15px;
  text-align: right;
}

.sales-table {
  width: 100%;
  overflow-x: auto;
}

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

.sales-table th,
.sales-table td {
  padding: 8px;
  text-align: left;
  border-bottom: 1px solid rgba(255,215,0,0.2);
  font-size: 12px;
}

.sales-table th {
  color: var(--primary);
  font-weight: bold;
}

.land-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.land-thumbnail {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  object-fit: cover;
}

.price-info {
  color: var(--primary);
}

.date-info {
  color: rgba(255,215,0,0.7);
}

.transaction-info {
  font-size: 11px;
}

.wallet-address {
  font-family: monospace;
  color: var(--primary);
}

/* Land Configuration Modal */
.land-config-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  visibility: visible;
}

.land-config-modal.active {
  opacity: 1;
  visibility: visible;
}

.land-config-content {
  background: var(--bg);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--primary);
  width: 90%;
  max-width: 320px;
  position: relative;
  transform: none;
  opacity: 1;
}

.button-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

.feature-btn {
  flex: 1;
  background: rgba(255, 215, 0, 0.2);
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 12px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Orbitron', sans-serif;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.feature-btn:active {
  transform: scale(0.95);
  background: rgba(255, 215, 0, 0.3);
}

.btn-icon {
  font-size: 18px;
}

/* Construction Modal */
.construction-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.construction-content {
  background: var(--bg);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--primary);
  text-align: center;
  width: 80%;
  max-width: 300px;
}

.construction-progress {
  margin: 20px 0;
}

.progress-bar {
  width: 100%;
  height: 10px;
  background: rgba(255, 215, 0, 0.1);
  border-radius: 5px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: var(--primary);
  transition: width 0.3s linear;
}

.construction-animation {
  font-size: 24px;
  margin: 20px 0;
  animation: constructionBounce 1s infinite;
}

@keyframes constructionBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* NFT Cards */
.nft-card {
  background: rgba(255,215,0,0.1);
  border: 1px solid var(--primary);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.3s;
}

.nft-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 15px rgba(255,215,0,0.3);
}

.nft-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 10px;
}

/* Factory Options */
.factory-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 20px;
}

.factory-option {
  background: rgba(255,215,0,0.1);
  border: 1px solid var(--primary);
  border-radius: 8px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
}

.factory-option:hover {
  background: rgba(255,215,0,0.2);
  transform: translateY(-2px);
}

.factory-image {
  width: 60px;
  height: 60px;
  object-fit: contain;
  margin-bottom: 10px;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes ripple {
  0% {
    transform: translate(-50%, -50%) scale(0.3);
    opacity: 0.7;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0;
  }
}

@keyframes rippleWave {
  0% {
    transform: translate(-50%, -50%) scale(0.1);
    opacity: 0.7;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.8);
    opacity: 0;
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-100px);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Tap Effects and Particles */
.energy-particle {
  position: absolute;
  width: 15px;
  height: 15px;
  background: radial-gradient(circle, rgba(255,215,0,0.6) 0%, rgba(255,215,0,0) 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1000;
}

.energy-symbol {
  position: absolute;
  font-size: 12px;
  color: var(--primary);
  text-shadow: 0 0 3px var(--primary);
  pointer-events: none;
  z-index: 1001;
}

.tap-effect {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,215,0,0.3) 0%, transparent 70%);
  animation: ripple 0.5s ease-out forwards;
  pointer-events: none;
  z-index: 100;
}

.tap-ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border: 1px solid var(--primary);
  border-radius: 50%;
  animation: rippleWave 0.8s ease-out forwards;
  pointer-events: none;
  z-index: 99;
}

/* Additional styles for container to handle particle effects */
.container {
  position: relative;
  overflow: hidden;
}

/* Utility Classes */
.hidden {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Incinerator Modal Styles */
.incinerator-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.incinerator-content {
  background-color: #222;
  width: 90%;
  max-width: 450px;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 0 20px rgba(255, 0, 0, 0.3);
  border: 1px solid #ff4500;
  color: #fff;
  margin: -5px auto;
  position: relative;
}

.incinerator-header {
  position: relative;
  text-align: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ff4500;
}

.incinerator-header h3 {
  margin: 0;
  font-size: 22px;
  color: #ff4500;
}

.close-incinerator {
  position: absolute;
  top: 0;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

.resource-selection {
  margin: 10px 0;
  text-align: center;
}

.resource-selection h4 {
  display: block;
  width: 100%;
  margin: 0 0 15px 0;
  text-align: center;
  font-size: 18px;
  color: #ffcc00;
  text-shadow: 0 0 5px #ff4500;
  padding-bottom: 5px;
  border-bottom: 1px dashed #444;
}

.resource-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.resource-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background-color: #333;
  border: 1px solid #555;
  border-radius: 6px;
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.resource-btn .resource-icon {
  font-size: 20px;
  margin-bottom: 5px;
}

.resource-btn:hover {
  background-color: #444;
  transform: translateY(-2px);
}

.resource-btn.selected {
  background-color: #ff4500;
  border-color: #ff6a00;
  box-shadow: 0 0 10px rgba(255, 69, 0, 0.5);
}

.burning-controls {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.amount-slider {
  flex: 1;
  height: 10px;
  appearance: none;
  background: #444;
  border-radius: 5px;
  outline: none;
}

.amount-slider::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ff4500;
  cursor: pointer;
  border: 2px solid #ff6a00;
  box-shadow: 0 0 5px rgba(255, 69, 0, 0.5);
}

.amount-input {
  width: 80px;
  padding: 8px;
  border-radius: 5px;
  border: 1px solid #555;
  background-color: #333;
  color: white;
  text-align: center;
  font-size: 16px;
}

.conversion-rate {
  text-align: center;
  padding: 10px;
  background-color: #333;
  border-radius: 5px;
  margin: 10px 0;
  border: 1px solid #555;
}

.burn-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  width: 100%;
  background-color: #ff4500;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.burn-btn:hover:not([disabled]) {
  background-color: #ff6a00;
  transform: translateY(-2px);
}

.burn-btn[disabled] {
  background-color: #555;
  cursor: not-allowed;
  opacity: 0.7;
}

.burn-btn .burn-icon {
  font-size: 20px;
}

.resource-rate {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid #444;
}

.warning-text {
  color: #ff4500;
  text-align: center;
  margin-top: 10px;
  font-weight: bold;
}

/* Combo System Styles */
.combo-zones-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 150;
}

.combo-zone {
  position: absolute;
  width: 60px;
  height: 60px;
  background: rgba(255, 215, 0, 0.2);
  border: 2px solid var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: pointer;
  transform: translate(-50%, -50%);
  z-index: 150;
  transition: transform 0.1s ease;
}

.combo-zone:hover {
  transform: translate(-50%, -50%) scale(1.05);
  background: rgba(255, 215, 0, 0.3);
}

.combo-zone.hit {
  animation: zoneHit 0.3s ease-out forwards;
}

@keyframes zoneHit {
  0% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.2); }
  100% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
}

.combo-number {
  font-size: 18px;
  font-weight: bold;
  color: var(--primary);
  text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
  position: relative;
  z-index: 2;
}

.combo-countdown-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.combo-countdown-bg {
  stroke: rgba(255, 215, 0, 0.2);
}

.combo-countdown-progress {
  stroke: var(--primary);
  transform-origin: center;
  transform: rotate(-90deg);
  transition: stroke-dashoffset 0.1s linear;
}

.combo-ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid var(--primary);
  transform: translate(-50%, -50%);
  animation: rippleOut 0.6s ease-out forwards;
  pointer-events: none;
  z-index: 140;
}

@keyframes rippleOut {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}

.combo-explosion {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, 
    rgba(255, 215, 0, 0.8) 0%,
    rgba(255, 215, 0, 0.4) 50%,
    transparent 100%
  );
  transform: translate(-50%, -50%);
  animation: explode 0.4s ease-out forwards;
  z-index: 145;
}

@keyframes explode {
  0% { transform: translate(-50%, -50%) scale(0.8); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

.combo-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  transform: translate(-50%, -50%);
  z-index: 140;
  filter: blur(1px);
}

.combo-message {
  position: absolute;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: bold;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
  z-index: 155;
  animation: floatUp 1s ease-out forwards;
  pointer-events: none;
}

.combo-message.perfect {
  color: #ffdd00;
  font-size: 20px;
  text-shadow: 0 0 8px rgba(255, 221, 0, 0.8);
}

.combo-message.great {
  color: #00ffaa;
  font-size: 18px;
}

.combo-message.good {
  color: #00aaff;
  font-size: 16px;
}

.combo-message.fail {
  color: #ff4444;
  font-size: 18px;
  animation: failShake 0.5s ease-out forwards;
}

@keyframes failShake {
  0% { transform: translate(-50%, -50%); opacity: 1; }
  10% { transform: translate(-55%, -50%); }
  20% { transform: translate(-45%, -50%); }
  30% { transform: translate(-55%, -50%); }
  40% { transform: translate(-45%, -50%); }
  50% { transform: translate(-50%, -50%); }
  100% { transform: translate(-50%, -150%); opacity: 0; }
}

.combo-counter {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: var(--primary);
  font-size: 16px;
  font-weight: bold;
  padding: 8px 15px;
  border-radius: 20px;
  border: 2px solid var(--primary);
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  transition: opacity 0.3s ease;
}

.combo-counter.active {
  opacity: 1;
}

.combo-counter.pulse {
  animation: counterPulse 0.3s ease-out;
}

@keyframes counterPulse {
  0% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.1); }
  100% { transform: translateX(-50%) scale(1); }
}

.combo-completion {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  background: rgba(0, 0, 0, 0.8);
  border: 3px solid var(--primary);
  border-radius: 10px;
  padding: 20px 30px;
  color: var(--primary);
  text-align: center;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
}

.combo-completion.animate {
  animation: completionShow 2s ease-out forwards;
}

.combo-completion-text {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 10px;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.combo-points {
  font-size: 30px;
  font-weight: bold;
  color: #ffdd00;
  text-shadow: 0 0 15px rgba(255, 221, 0, 0.8);
}

@keyframes completionShow {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  20% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
  30% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  70% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.2); opacity: 0; }
}

.screen-shake {
  animation: screenShake 0.5s ease-out;
}

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

/* NEW: Accelerate button styles */
.accelerate-btn {
  margin-top: 5px;
  padding: 5px 10px;
  background: #ffd700;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
}
.accelerate-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.construction-progress-display {
  background: rgba(255,215,0,0.1);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.construction-progress-display h4 {
  color: var(--primary);
  margin-bottom: 10px;
  font-size: 14px;
  text-align: center;
}

.game-screen:not(.active) #energy-tap,
.game-screen:not(.active) .tap-energy-gauge {
  display: none !important;
}

.element-tap-area.hidden,
.tap-energy-gauge.hidden {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#exchange.game-screen {
  display: none;
  position: relative;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 0;
}

#exchange.game-screen.active {
  display: block;
}

#exchange.game-screen iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  margin: 0 auto;
  max-width: 100%; /* Augmentation de la largeur maximale */
  max-height: var(--telegram-height);
}

/* Styles pour le contenu de l'Exchange Center */
.exchange-center {
  padding: 15px;
  max-width: 800px; /* Augmentation de la largeur maximale */
  margin: 0 auto;
  background: linear-gradient(to bottom, rgba(5, 5, 15, 0.9), rgba(10, 10, 30, 0.8));
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.7), inset 0 0 15px rgba(255, 215, 0, 0.1);
  border: 2px solid var(--primary);
}

.exchange-center h2 {
  text-align: center;
  color: var(--primary);
  margin-bottom: 20px;
  font-size: 24px;
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
}

/* Add new CSS for casino cost display */
.casino-cost-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 15px 0;
  background: rgba(255,215,0,0.1);
  padding: 10px;
  border-radius: 8px;
}

.cost-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
  font-size: 14px;
}

.cost-item .resource-icon {
  font-size: 18px;
  text-shadow: 0 0 5px rgba(255,215,0,0.5);
}

.exchange-modal .incinerator-content {
  border: 1px solid var(--primary) !important;
}

.exchange-modal .incinerator-header {
  border-bottom: 1px solid var(--primary) !important;
}

.exchange-modal .incinerator-header h3 {
  color: var(--primary) !important;
}

.exchange-modal .close-incinerator {
  color: var(--primary) !important;
}

.exchange-modal .resource-btn,
.exchange-modal .request-btn {
  background: rgba(255, 215, 0, 0.1) !important;
  border: 1px solid var(--primary) !important;
}

.exchange-modal .resource-btn.selected,
.exchange-modal .request-btn.selected {
  background: rgba(255, 215, 0, 0.3) !important;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.5) !important;
}

.exchange-form-container {
  background: rgba(255, 215, 0, 0.1) !important;
}

/* Updated quit button styles for casino */
.quit-btn {
  position: fixed;
  top: 5px;
  right: 5px;
  background: rgba(255,69,0,0.8);
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  z-index: 1010;
  font-size: 12px;
}

.quit-btn:active,
.quit-btn:hover {
  background: #ff4500;
  transform: scale(1.05);
}

/* Updated return link styles */
.return-link {
  display: block;
  text-align: center;
  margin: 5px 0;
  color: #ffd700;
  text-decoration: underline;
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
}

/* Ajout du style pour l'avatar par défaut */
.profile-photo[src="df6f67935489dce35176eec727247c85.jpg"],
.profile-photo[src=""],
.profile-photo[src="null"],
.profile-photo[src="undefined"],
.profile-photo[alt="Profile"],
.profile-photo.error {
  border: 2px solid var(--primary);
  object-fit: cover;
  background: var(--bg);
  box-shadow: 0 0 10px rgba(255,215,0,0.3);
}

.creator-badge {
  background: rgba(255, 215, 0, 0.2);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  margin-left: 8px;
  font-style: italic;
}

.autoclick-container {
  position: fixed;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 100;
}

.autoclick-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  background: linear-gradient(45deg, #ffd700, #ff8c00);
  border: none;
  border-radius: 8px;
  color: black;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 0 5px #ffd700;
  font-family: 'Orbitron', sans-serif;
}

.autoclick-btn:hover {
  background: linear-gradient(45deg, #ffd700, #ffff00);
  transform: translateY(-2px);
  box-shadow: 0 0 10px #ffd700;
}

.autoclick-btn .tv-icon {
  font-size: 14px;
}

.autoclick-btn .resource-icon {
  font-size: 14px;
}

.autoclick-btn .autoclick-text {
  font-size: 10px;
}

.autoclick-btn:active {
  transform: translateY(1px);
}

.autoclick-container.hidden {
  display: none;
}

.element-autoclick-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  background: linear-gradient(45deg, #ffd700, #ff8c00);
  border: none;
  border-radius: 8px;
  color: black;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 0 5px #ffd700;
  font-family: 'Orbitron', sans-serif;
  z-index: 100;
}

.element-autoclick-btn:hover {
  background: linear-gradient(45deg, #ffd700, #ffff00);
  transform: translateY(-2px);
  box-shadow: 0 0 10px #ffd700;
}

.element-autoclick-btn .tv-icon {
  font-size: 14px;
}

.element-autoclick-btn .resource-icon {
  font-size: 14px;
}

.element-autoclick-btn .autoclick-text {
  font-size: 10px;
}

.element-autoclick-btn:active {
  transform: translateY(1px);
}

.autoclick-container {
  display: none !important;
}

/* Social Screen Styles */
.social-section {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.leaderboard-section, .messages-section {
  background: rgba(255,215,0,0.1);
  border-radius: 8px;
  padding: 15px;
}

.leaderboard-section h3, .messages-section h3 {
  color: var(--primary);
  font-size: 16px;
  margin-bottom: 10px;
  text-align: center;
}

.leaderboard-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
}

.leaderboard-tab {
  background: rgba(255,215,0,0.1);
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s;
}

.leaderboard-tab.active {
  background: rgba(255,215,0,0.3);
  box-shadow: 0 0 10px rgba(255,215,0,0.5);
}

.leaderboard-content {
  max-height: 300px;
  overflow-y: auto;
}

.leaderboard-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid rgba(255,215,0,0.2);
}

.leaderboard-rank {
  font-weight: bold;
  min-width: 30px;
  text-align: center;
}

.leaderboard-user {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 10px;
}

.leaderboard-points {
  color: var(--primary);
  font-weight: bold;
}

.current-user {
  background: rgba(255,215,0,0.2);
  border-radius: 4px;
}

.messages-list {
  max-height: 300px;
  overflow-y: auto;
}

.message-item {
  margin-bottom: 10px;
  padding: 10px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  border-left: 3px solid var(--primary);
}

.message-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 12px;
}

.message-sender {
  font-weight: bold;
  color: var(--primary);
}

.message-date {
  color: rgba(255,255,255,0.6);
}

.message-content {
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}

.loading-indicator {
  text-align: center;
  padding: 20px;
  color: rgba(255,215,0,0.6);
}

/* NEW: Save Status Icon Styles */
#saveStatusIndicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-left: 10px;
  background-color: transparent;
  /* Pour assurer un aspect visible dans le header */
  border: 1px solid var(--primary);
}

.save-indicator {
  position: fixed;
  bottom: 10px;
  right: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  opacity: 0.7;
  transition: all 0.3s ease;
  z-index: 9999;
}

.save-indicator.success {
  background-color: #4CAF50;
  box-shadow: 0 0 5px #4CAF50;
}

.save-indicator.error {
  background-color: #f44336;
  box-shadow: 0 0 5px #f44336;
}

.save-indicator.in-progress {
  background-color: #FFC107;
  box-shadow: 0 0 5px #FFC107;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.7;
  }
}

.save-indicator:hover::after {
  content: attr(data-status);
  position: absolute;
  bottom: 15px;
  right: 15px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 5px 10px;
  border-radius: 3px;
  font-size: 12px;
  white-space: nowrap;
}

/* Exchange Center Styles */
.exchange-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.exchange-content {
  background: var(--bg);
  width: 95%; /* Augmentation de la largeur */
  max-width: 540px; /* Augmentation de la largeur maximale */
  max-height: 95vh;
  border-radius: 12px;
  border: 1px solid #0088ff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.exchange-warning {
  background: rgba(255, 102, 0, 0.15);
  border-left: 4px solid #ff6600;
  padding: 12px;
  margin: 10px;
  border-radius: 6px;
}

.warning-text {
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
}

.exchange-tabs {
  display: flex;
  background: rgba(255, 215, 0, 0.15);
  padding: 5px;
  gap: 0;
  margin: 10px;
  border-radius: 8px;
  border: 2px solid rgba(255, 215, 0, 0.5);
  box-shadow: 
    inset 0 0 10px rgba(0, 0, 0, 0.3),
    0 2px 5px rgba(0, 0, 0, 0.2);
}

.exchange-tab {
  flex: 1;
  padding: 10px 5px; /* Réduit le padding horizontal de 10px à 5px */
  background: linear-gradient(to bottom, rgba(20, 20, 20, 0.8), rgba(0, 0, 0, 0.6));
  border: 1px solid rgba(255, 215, 0, 0.3);
  color: var(--primary);
  font-family: 'Orbitron', sans-serif;
  font-size: 11px; /* Réduit de 13px à 11px */
  cursor: pointer;
  border-radius: 0;
  transition: all 0.3s ease;
  text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
  position: relative;
  box-shadow: 
    inset 0 1px 0 rgba(255, 215, 0, 0.2),
    inset 0 -3px 6px rgba(0, 0, 0, 0.3);
  /* Séparation verticale accentuée pour les onglets d'échange */
  border-right: 3px solid rgba(255, 215, 0, 0.5);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.exchange-tab:first-child {
  border-radius: 6px 0 0 6px;
}

.exchange-tab:last-child {
  border-radius: 0 6px 6px 0;
  border-right: 1px solid rgba(255, 215, 0, 0.3);
}

.exchange-tab:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: rgba(255, 215, 0, 0.5);
}

.exchange-tab:hover {
  background: linear-gradient(to bottom, rgba(50, 50, 20, 0.9), rgba(30, 30, 10, 0.8));
  box-shadow: 
    inset 0 1px 0 rgba(255, 215, 0, 0.3),
    inset 0 -3px 6px rgba(0, 0, 0, 0.4);
  transform: translateY(-1px);
}

.exchange-tab.active {
  background: linear-gradient(to bottom, rgba(80, 70, 0, 0.7), rgba(50, 45, 0, 0.6));
  color: white;
  box-shadow: 
    0 0 10px rgba(255, 215, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  border: 1px solid var(--primary);
  border-right: 3px solid var(--primary);
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
  z-index: 1;
  transform: translateY(-2px);
}

.tab-content {
  display: none;
  padding: 20px; /* Augmentation du padding */
  overflow-y: auto;
}

.tab-content.active {
  display: block;
}

.exchange-form {
  display: flex;
  flex-direction: column;
  gap: 20px; /* Augmentation de l'espacement */
}

.form-group {
  background: rgba(255, 215, 0, 0.05);
  padding: 20px; /* Augmentation du padding */
  border-radius: 8px;
  border: 1px solid rgba(255, 215, 0, 0.2);
}

.form-group label {
  display: block;
  color: var(--primary);
  margin-bottom: 10px;
  font-size: 14px;
}

.resource-selection {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 10px;
}

.resource-selection select,
.resource-selection input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--primary);
  color: white;
  padding: 8px;
  border-radius: 6px;
  font-family: 'Orbitron', sans-serif;
  width: 100%;
}

.resource-selection input {
  text-align: center;
}

.exchange-rate {
  text-align: center;
  padding: 10px;
  background: rgba(255, 215, 0, 0.05);
  border-radius: 6px;
  margin: 10px 0;
  border: 1px solid rgba(255, 215, 0, 0.2);
}

.exchange-rate p {
  color: var(--primary);
  font-size: 14px;
}

.storage-warning {
  color: #ff6600;
  text-align: center;
  font-size: 13px;
  margin: 10px 0;
}

.create-offer-btn {
  background: linear-gradient(45deg, var(--primary), #ff8c00);
  border: none;
  color: black;
  padding: 12px;
  border-radius: 8px;
  font-family: 'Orbitron', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  font-size: 14px;
  letter-spacing: 1px;
  font-weight: bold;
}

.create-offer-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.create-offer-btn:active {
  transform: translateY(0);
}

.filter-controls {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 5px;
  margin-bottom: 15px;
  -webkit-overflow-scrolling: touch;
}

.filter-btn {
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn.active {
  background: var(--primary);
  color: black;
  font-weight: bold;
}

.offers-list {
  max-height: 300px;
  overflow-y: auto;
}

.exchange-offer {
  background: rgba(255, 215, 0, 0.05);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 8px;
  padding: 16px; /* Augmentation du padding */
  transition: all 0.3s ease;
  margin-bottom: 10px; /* Ajout d'une marge en bas */
}

.exchange-offer:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), 0 0 15px rgba(255, 215, 0, 0.1);
}

.offer-creator {
  color: var(--primary);
  font-weight: bold;
}

.exchange-arrow {
  font-size: 20px;
  color: var(--primary);
}

.accept-offer-btn,
.cancel-offer-btn {
  padding: 8px 20px;
  border-radius: 6px;
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.accept-offer-btn {
  background: linear-gradient(45deg, var(--primary), #ff8c00);
  border: none;
  color: black;
  font-weight: bold;
}

.cancel-offer-btn {
  background: linear-gradient(45deg, #ff3d00, #ff8a65);
  border: none;
  color: white;
}

.accept-offer-btn:hover,
.cancel-offer-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.accept-offer-btn:active,
.cancel-offer-btn:active {
  transform: translateY(0);
}

.no-offers {
  text-align: center;
  color: rgba(255, 215, 0, 0.6);
  padding: 20px;
  font-style: italic;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  margin: 10px 0;
}

.loading {
  text-align: center;
  color: var(--primary);
  padding: 20px;
}

/* Animation pour les transitions */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.exchange-offer {
  animation: slideIn 0.3s ease-out forwards;
}

/* Styles pour les états désactivés */
.exchange-tab[disabled],
.filter-btn[disabled],
.create-offer-btn[disabled],
.accept-offer-btn[disabled],
.cancel-offer-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Responsive design pour petits écrans */
@media (max-width: 360px) {
  .exchange-content {
    width: 100%;
    height: 100%;
    max-width: none;
    border-radius: 0;
  }
  
  .resource-selection {
    grid-template-columns: 1fr;
  }
  
  .offer-resources {
    flex-direction: column;
    gap: 10px;
  }
  
  .exchange-arrow {
    transform: rotate(90deg);
  }
}

.free-counter, .next-recharge {
  font-size: 12px;
  color: var(--primary);
  margin-top: 4px;
}

.free-counter {
  font-weight: bold;
}

.next-recharge {
  color: #ffcc00;
  margin-top: 6px;
}

.user-rank {
  background-color: var(--primary);
  color: var(--bg);
  padding: 8px 12px;
  border-radius: 4px;
  margin: 10px 0;
  font-weight: bold;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.current-player {
  background-color: rgba(255, 215, 0, 0.1);
  font-weight: bold;
}

/* Styles pour le système de combo amélioré */
#combo-display {
  position: fixed;
  top: 10px;
  right: 10px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px;
  border-radius: 8px;
  z-index: 1000;
  font-family: 'Arial', sans-serif;
  font-weight: bold;
  transition: transform 0.3s, opacity 0.3s;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  max-width: 200px;
}

.combo-counter {
  font-size: 1.2rem;
  text-align: center;
  margin-bottom: 5px;
}

.combo-progress {
  width: 100%;
  margin-top: 5px;
}

.combo-progress-label {
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 3px;
}

.combo-progress-bar {
  height: 8px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  overflow: hidden;
}

.combo-progress-fill {
  height: 100%;
  background-color: #4CAF50;
  transition: width 0.3s ease;
}

/* Classes de niveau de combo */
.combo-low .combo-progress-fill {
  background-color: #4CAF50; /* Vert */
}

.combo-medium .combo-progress-fill {
  background-color: #FFC107; /* Jaune */
}

.combo-high .combo-progress-fill {
  background-color: #FF9800; /* Orange */
}

.combo-super .combo-progress-fill {
  background-color: #F44336; /* Rouge */
  box-shadow: 0 0 10px #F44336;
}

/* Animation lors de la mise à jour */
.combo-update {
  transform: scale(1.1);
}

/* Variations de couleur basées sur le niveau de combo */
.combo-low {
  border-left: 3px solid #4CAF50;
}

.combo-medium {
  border-left: 3px solid #FFC107;
}

.combo-high {
  border-left: 3px solid #FF9800;
}

.combo-super {
  border-left: 3px solid #F44336;
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  from {
    box-shadow: 0 0 5px rgba(244, 67, 54, 0.5);
  }
  to {
    box-shadow: 0 0 15px rgba(244, 67, 54, 0.8);
  }
}

/* Animations pour les gains de ressources */
@keyframes resource-gain-pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
  }
  100% {
    transform: scale(1);
  }
}

.resource-gain-pulse {
  animation: resource-gain-pulse 0.5s ease-in-out;
}

/* Styles pour l'auto-clicker */
.auto-clicker-visual {
  backdrop-filter: blur(3px);
  transition: all 0.3s ease;
}

.auto-clicker-visual:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.auto-clicker-icon {
  font-size: 18px;
  margin-right: 5px;
  animation: float 2s ease-in-out infinite;
}

.auto-clicker-timer {
  font-family: monospace;
  font-size: 14px;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

/* Animation pour les particules de ressources */
.resource-particle {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  transition: transform 0.1s ease-out;
}

.resource-particle:first-child {
  font-weight: bold;
}

/* Styles pour les combos */
.combo-notification {
  position: fixed;
  left: 50%;
  top: 30%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 18px;
  font-weight: bold;
  z-index: 2000;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
  text-align: center;
  animation: combo-notification-fade 1.5s ease-in-out forwards;
}

@keyframes combo-notification-fade {
  0% {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  85% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
}

/* Styles pour les coups critiques */
.critical-hit {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 32px;
  font-weight: bold;
  color: #ffeb3b;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
  z-index: 9999;
  pointer-events: none;
  animation: critical-hit-anim 1s ease-out forwards;
}

@keyframes critical-hit-anim {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  25% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -70%) scale(1);
  }
}

/* Styles pour le système de combo */
.combo-counter {
  position: fixed;
  top: 10px;
  right: 10px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-weight: bold;
  z-index: 300;
  display: none;
}

.combo-counter.active {
  display: block;
}

.combo-counter.pulse {
  animation: combo-pulse 0.3s ease-in-out;
}

.combo-zone {
  position: absolute;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  z-index: 201;
}

.combo-zone .combo-number {
  font-size: 24px;
  font-weight: bold;
  color: white;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.7);
  z-index: 202;
}

.combo-zone svg {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 201;
}

.combo-zone .combo-countdown-bg {
  stroke: rgba(255, 255, 255, 0.2);
}

.combo-zone .combo-countdown-progress {
  stroke: #ffffff;
  transform-origin: center;
  transform: rotate(-90deg);
}

.combo-ripple {
  position: absolute;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0) 70%);
  transform: translate(-50%, -50%);
  animation: ripple 0.6s ease-out;
  pointer-events: none;
  z-index: 205;
}

.combo-explosion {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,204,0,0.7) 0%, rgba(255,204,0,0) 70%);
  transform: translate(-50%, -50%);
  animation: explosion 0.4s ease-out;
  pointer-events: none;
  z-index: 206;
}

.combo-message {
  position: absolute;
  color: white;
  font-size: 18px;
  font-weight: bold;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.7);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 207;
  animation: float-up 1s ease-out;
}

.combo-message.perfect {
  color: #ffcc00;
  font-size: 24px;
}

.combo-message.good {
  color: #66ff66;
  font-size: 20px;
}

.combo-message.ok {
  color: #66ccff;
}

.combo-message.last-second {
  color: #ff9966;
}

.combo-message.fail {
  color: #ff6666;
  font-size: 24px;
}

.combo-completion {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 210;
  animation: scale-in 0.5s ease-out;
}

.combo-completion-text {
  font-size: 32px;
  font-weight: bold;
  color: #ffcc00;
  text-shadow: 0 0 10px rgba(255, 204, 0, 0.7);
  margin-bottom: 10px;
}

.combo-points {
  font-size: 28px;
  font-weight: bold;
  color: white;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.7);
}

@keyframes ripple {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
  }
}

@keyframes explosion {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0;
  }
}

@keyframes float-up {
  0% {
    transform: translate(-50%, -50%);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -100%);
    opacity: 0;
  }
}

@keyframes combo-pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes scale-in {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

/* Styles pour le mode Slider */
.slider-point {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  z-index: 203;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.slider-point.start-point {
  background-color: #4CAF50;
  border: 3px solid #fff;
  animation: pulse-green 1.5s infinite;
}

.slider-point.end-point {
  background-color: #F44336;
  border: 3px solid #fff;
}

.slider-point span {
  color: white;
  font-weight: bold;
  font-size: 20px;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.7);
}

.slider-guide-line {
  position: absolute;
  height: 3px;
  background-color: rgba(255, 255, 255, 0.3);
  z-index: 202;
  pointer-events: none;
}

.slider-trail {
  z-index: 202;
}

.trail-dot {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: #ffcc00;
  opacity: 0.7;
  animation: fade-out 1s forwards;
}

@keyframes pulse-green {
  0% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
  }
}

@keyframes fade-out {
  0% {
    opacity: 0.7;
  }
  100% {
    opacity: 0;
  }
}

/* Styles pour le mode Constellation */
.constellation-point {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  z-index: 203;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.constellation-point.waiting {
  background-color: #9E9E9E;
  border: 3px solid #fff;
  opacity: 0.7;
}

.constellation-point.active {
  background-color: #2196F3;
  border: 3px solid #fff;
  animation: pulse-blue 1.5s infinite;
}

.constellation-point.completed {
  background-color: #4CAF50;
  border: 3px solid #fff;
}

.constellation-point span {
  color: white;
  font-weight: bold;
  font-size: 20px;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.7);
}

.constellation-line {
  position: absolute;
  height: 3px;
  background-color: #5c88ff;
  z-index: 202;
  pointer-events: none;
  box-shadow: 0 0 5px rgba(92, 136, 255, 0.7);
}

@keyframes pulse-blue {
  0% {
    box-shadow: 0 0 0 0 rgba(33, 150, 243, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(33, 150, 243, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(33, 150, 243, 0);
  }
}

/* Animation pour le gain de ressources */
.resource-gain-animation {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.resource-gain-icon {
  font-size: 32px;
  margin-bottom: 5px;
}

.resource-gain-amount {
  font-size: 24px;
  font-weight: bold;
  color: #FFEB3B;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.7);
}

/* Styles pour le mode Break Sphere */
.break-sphere-container {
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
  transition: transform 0.2s;
}

.break-sphere-container:active {
  transform: translate(-50%, -50%) scale(0.95);
}

.glass-sphere {
  position: relative;
  box-shadow: 
    inset 0 0 50px rgba(255, 255, 255, 0.3),
    0 0 20px rgba(100, 180, 255, 0.8),
    0 0 30px rgba(100, 180, 255, 0.3);
  transition: box-shadow 0.3s;
  cursor: pointer;
}

.glass-sphere:hover {
  box-shadow: 
    inset 0 0 60px rgba(255, 255, 255, 0.4),
    0 0 25px rgba(100, 180, 255, 0.9),
    0 0 35px rgba(100, 180, 255, 0.4);
}

.glass-sphere:active {
  box-shadow: 
    inset 0 0 40px rgba(255, 255, 255, 0.6),
    0 0 30px rgba(100, 180, 255, 1),
    0 0 40px rgba(100, 180, 255, 0.5);
}

.crack-counter {
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
  z-index: 5;
}

.sphere-crack {
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
  z-index: 2;
}

.glass-fragment {
  box-shadow: 0 0 5px rgba(100, 180, 255, 0.6);
  z-index: 2;
}

@keyframes fragmentFall {
  0% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 0.7;
  }
  100% {
    transform: translate(var(--x, 30px), var(--y, 100px)) rotate(var(--r, 180deg));
    opacity: 0;
  }
}

@keyframes explode {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
  100% {
    transform: scale(0.1);
    opacity: 0;
  }
}

/* Animation de secousse pour la sphère */
@keyframes shatterShake {
  0%, 100% {
    transform: translate(-50%, -50%);
  }
  25% {
    transform: translate(-52%, -49%);
  }
  50% {
    transform: translate(-50%, -51%);
  }
  75% {
    transform: translate(-49%, -50%);
  }
}

/* Styles pour les fissures qui apparaissent sur la sphère */
.sphere-crack {
  animation: crackAppear 0.3s forwards;
}

@keyframes crackAppear {
  0% {
    opacity: 0;
    width: 0;
  }
  100% {
    opacity: 1;
    width: var(--crack-width, 20px);
  }
}

/* Animations d'effets lumineux pour les impacts */
.impact-flash {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0) 70%);
  width: 100px;
  height: 100px;
  opacity: 0;
  z-index: 3;
  pointer-events: none;
  animation: flashImpact 0.3s forwards;
}

@keyframes flashImpact {
  0% {
    opacity: 0.7;
    transform: scale(0.2);
  }
  100% {
    opacity: 0;
    transform: scale(1);
  }
}

/* Styles améliorés pour les instructions et le timer du mode break sphere */
.combo-instruction {
  animation: glowPulse 2s infinite;
}

@keyframes glowPulse {
  0%, 100% {
    text-shadow: 0 0 10px rgba(0,100,255,0.8);
  }
  50% {
    text-shadow: 0 0 20px rgba(0,150,255,1);
  }
}

.combo-timer-bar {
  box-shadow: 0 0 10px rgba(0,100,200,0.5);
}

.combo-timer-fill {
  box-shadow: inset 0 0 5px rgba(255,255,255,0.5);
}

/* Supports pour Three.js renderer */
.break-sphere-container canvas {
  max-width: 100%;
  max-height: 100%;
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(100,180,255,0.5);
}

/* Styles pour l'écran de chargement */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #1a1a1a;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transition: opacity 0.5s ease;
}

.loading-screen-content {
  text-align: center;
  width: 90%;
  max-width: 600px;
}

.connection-status {
  margin-top: 20px;
  padding: 15px;
  background-color: #2a2a2a;
  border-radius: 8px;
  text-align: left;
  width: 100%;
}

.status-bar {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  padding: 5px;
  background-color: #333;
  border-radius: 4px;
}

.status-indicator {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
}

.connecting { background-color: #ffc107; }
.connected { background-color: #4caf50; }
.disconnected { background-color: #f44336; }

.status-text {
  flex: 1;
  font-size: 14px;
}

.retry-button,
.login-button {
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  margin-top: 10px;
  cursor: pointer;
  font-size: 16px;
}

.retry-button:hover,
.login-button:hover {
  background-color: #0069d9;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #3498db;
  border-top: 5px solid #f1c40f;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

.loading-text {
  color: #fff;
  font-size: 18px;
  text-align: center;
  max-width: 80%;
  margin-bottom: 10px;
  transition: color 0.3s ease;
}

/* Styles pour les messages d'authentification */
.auth-message {
  background-color: rgba(41, 128, 185, 0.2);
  border: 1px solid #3498db;
  border-radius: 8px;
  padding: 15px;
  margin-top: 20px;
  text-align: center;
  color: #fff;
  max-width: 80%;
}

.auth-message h3 {
  color: #3498db;
  margin-top: 0;
  margin-bottom: 10px;
}

.auth-message p {
  margin-bottom: 15px;
}

.auth-message button, 
#retry-creation {
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
}

.auth-message button:hover,
#retry-creation:hover {
  background-color: #2980b9;
}

/* Amélioration des logs de connexion */
#connection-logs {
  max-height: 250px;
  overflow-y: auto;
  font-size: 0.85rem;
  padding: 10px;
  margin-top: 10px;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Entrées de log améliorées */
.log-entry {
  margin-bottom: 6px;
  padding: 6px 8px;
  border-radius: 3px;
  font-family: monospace;
  white-space: pre-wrap;
  word-break: break-word;
  transition: background-color 0.3s ease;
  opacity: 0.85;
}

.log-entry:hover {
  opacity: 1;
}

/* Types de logs avec meilleure visibilité */
.log-entry.info {
  color: #b0c7e4;
  border-left: 3px solid #3498db;
  background-color: rgba(52, 152, 219, 0.1);
}

.log-entry.success {
  color: #a3e4b0;
  border-left: 3px solid #2ecc71;
  background-color: rgba(46, 204, 113, 0.1);
}

.log-entry.warning {
  color: #f9e7a5;
  border-left: 3px solid #f39c12;
  background-color: rgba(243, 156, 18, 0.1);
}

.log-entry.error {
  color: #f5b7b1;
  border-left: 3px solid #e74c3c;
  background-color: rgba(231, 76, 60, 0.1);
}

/* Animation pour les logs importants */
.log-entry:contains("Nouveau joueur"), 
.log-entry:contains("création"), 
.log-entry:contains("compte"), 
.log-entry:contains("Étape") {
  animation: important-log-pulse 2s infinite;
  font-weight: bold;
}

@keyframes important-log-pulse {
  0%, 100% { background-color: rgba(241, 196, 15, 0.05); }
  50% { background-color: rgba(241, 196, 15, 0.15); }
}

/* Logs avec étoile mis en évidence */
.log-entry:contains("⭐") {
  color: #f1c40f;
  font-weight: bold;
}

/* Forcer l'affichage des logs pendant la création de compte */
#connection-status:has(#connection-logs .log-entry:contains("Étape")),
#connection-status:has(#connection-logs .log-entry:contains("création")),
#connection-status:has(#connection-logs .log-entry:contains("Nouveau")) {
  display: block !important;
}

#connection-logs:has(.log-entry:contains("Étape")),
#connection-logs:has(.log-entry:contains("création")),
#connection-logs:has(.log-entry:contains("Nouveau")) {
  display: block !important;
  max-height: 250px !important;
  opacity: 1 !important;
}

/* Animation du texte de création de compte */
@keyframes account-creation-pulse {
  0%, 100% { color: #ffd700; }
  50% { color: #ffffff; }
}

/* Style spécifique pour l'écran de création de compte */
.loading-screen.account-creation .loading-text {
  animation: account-creation-pulse 2s infinite;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.loading-screen.account-creation .loading-spinner {
  border: 5px solid rgba(255, 215, 0, 0.3);
  border-top: 5px solid #ffd700;
}

/* Badge pour nouveau joueur */
.new-player-badge {
  display: inline-block;
  background-color: #ffd700;
  color: #000;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 12px;
  margin-left: 10px;
  font-weight: bold;
  text-transform: uppercase;
  animation: badge-pulse 1.5s infinite;
}

@keyframes badge-pulse {
  0%, 100% { background-color: #ffd700; }
  50% { background-color: #ff9500; }
}

.connection-logs {
  max-height: 200px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 12px;
  color: #ddd;
  padding: 10px;
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  margin-bottom: 10px;
  display: block !important; /* Toujours visible */
  min-height: 100px; /* Hauteur minimale pour assurer la visibilité */
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* S'assurer que les logs sont toujours visibles pendant le chargement */
#loading-screen .connection-logs {
  opacity: 1 !important;
  visibility: visible !important;
  max-height: 200px !important;
  overflow-y: auto !important;
}