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

body {
  font-family: 'Poppins', sans-serif;
  background: #1a1a2e;
  overflow: hidden;
  width: 100%;
  height: 100vh;
}

#gameContainer {
  width: 100%;
  height: 100vh;
}

/* Écran de démarrage */
.start-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  pointer-events: auto;
}

.start-screen.hidden {
  display: none;
}

.start-content {
  text-align: center;
  color: white;
  animation: fadeIn 0.6s ease-out;
}

.start-content h1 {
  font-size: 4rem;
  margin-bottom: 20px;
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
  animation: slideDown 0.8s ease-out;
}

.start-content p {
  font-size: 1.3rem;
  margin-bottom: 40px;
  opacity: 0.9;
  animation: slideUp 0.8s ease-out 0.2s both;
}

.play-button {
  padding: 18px 50px;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
  animation: slideUp 0.8s ease-out 0.4s both;
}

.play-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(102, 126, 234, 0.6);
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.play-button:active {
  transform: translateY(-1px);
}

.credits {
  margin-top: 60px;
  font-size: 0.9rem;
  opacity: 0.6;
  animation: slideUp 0.8s ease-out 0.6s both;
}

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

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

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

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.ui-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 100;
}

.header {
  text-align: center;
  margin-top: 20px;
  color: white;
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
}

.header h1 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 15px;
  letter-spacing: 2px;
  animation: slideDown 0.6s ease-out;
}

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

.stats {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stat-box {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
  padding: 12px 25px;
  border-radius: 12px;
  min-width: 110px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-box .label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: 5px;
  letter-spacing: 1px;
}

.stat-box .value {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: #FFD700;
}

.footer {
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.game-over-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  z-index: 200;
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease-out;
}

.game-over-screen.hidden {
  display: none;
}

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

.game-over-content {
  text-align: center;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.95) 0%, rgba(118, 75, 162, 0.95) 100%);
  padding: 40px 50px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.2);
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.game-over-content h2 {
  font-size: 48px;
  color: #FFD700;
  margin-bottom: 20px;
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.game-over-content p {
  font-size: 24px;
  color: white;
  margin: 15px 0;
}

.game-over-content button {
  margin-top: 30px;
  padding: 15px 50px;
  font-size: 18px;
  font-weight: 700;
  color: #1a1a2e;
  background: linear-gradient(135deg, #FFD700 0%, #FFC700 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(255, 215, 0, 0.4);
  transition: all 0.3s ease;
  pointer-events: auto;
}

.game-over-content button:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(255, 215, 0, 0.6);
}

@media (max-width: 768px) {
  .header h1 {
    font-size: 28px;
  }
  
  .stat-box {
    min-width: 90px;
    padding: 10px 15px;
  }
  
  .stat-box .value {
    font-size: 22px;
  }
}
