* { margin: 0; padding: 0; box-sizing: border-box; }
body { overflow: hidden; font-family: 'Segoe UI', system-ui, sans-serif; background: #d8e8f0; }
canvas { display: block; }

/* ── Welcome Screen avec animations ── */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

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

@keyframes sparkle {
  0% { opacity: 0; transform: scale(0) rotate(0deg); }
  50% { opacity: 1; transform: scale(1) rotate(180deg); }
  100% { opacity: 0; transform: scale(0) rotate(360deg); }
}

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

#welcome-screen {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0a1628 0%, #0f2027 30%, #1a1a2e 60%, #0a1628 100%);
  color: white;
  overflow: hidden;
  font-family: 'Trebuchet MS', sans-serif;
}

/* Particules gerees par canvas JS */
#welcome-screen::before {
  display: none;
}
.logo {
  display: none; /* remplace par le nouveau design inline */
}
#welcome-screen h1 {
  display: none;
}
#welcome-screen p {
  display: none;
}
@keyframes buttonPulse {
  0%, 100% { 
    box-shadow: 0 6px 30px rgba(243, 146, 0, 0.4), 0 0 0 0 rgba(243, 146, 0, 0.4); 
  }
  50% { 
    box-shadow: 0 8px 35px rgba(243, 146, 0, 0.5), 0 0 20px 5px rgba(243, 146, 0, 0.2); 
  }
}

#enter-btn {
  padding: 1rem 3rem; font-size: 1.1rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.2em;
  border: none; border-radius: 50px; cursor: pointer;
  background: linear-gradient(135deg,#f7931e,#e94e1b);
  color: #fff;
  box-shadow: 0 6px 30px rgba(233,78,27,0.4);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
#enter-btn.disabled {
  opacity: 0.3 !important;
  pointer-events: none !important;
  cursor: not-allowed;
}
#enter-btn.enabled {
  opacity: 1 !important;
  pointer-events: auto !important;
}

#enter-btn:hover {
  transform: translateY(-3px) scale(1.02); 
  box-shadow: 0 10px 40px rgba(243, 146, 0, 0.6);
  background: linear-gradient(45deg, #ffb84d, #f5e6c8);
}

#enter-btn:active {
  transform: translateY(-1px) scale(0.98);
}

/* Effet de brillance sur le bouton */
#enter-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.6s ease;
}

#enter-btn:hover::before {
  left: 100%;
}

/* ── Fade-in Overlay ── */
#fade-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #000;
  z-index: 1000;
  opacity: 1;
  transition: opacity 1s ease;
  pointer-events: none;
}

#fade-overlay.fade-out {
  opacity: 0;
}

/* ── HUD ── */
#hud { 
  position: fixed; inset: 0; pointer-events: none; z-index: 10; 
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#hud.slide-in {
  transform: translateY(0);
  opacity: 1;
}

#crosshair {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.5);
}

#interact-prompt {
  position: absolute; bottom: 25%; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.7); color: white;
  padding: 10px 24px; border-radius: 8px;
  font-size: 0.9rem; opacity: 0; transition: opacity 0.3s;
  cursor: pointer; pointer-events: auto;
}
@media (max-width: 600px) {
  #interact-prompt { padding: 14px 32px; font-size: 1.1rem; }
}
#interact-prompt span { color: #f5e6c8; font-weight: bold; }

#stand-label {
  position: absolute; top: 15%; left: 50%; transform: translateX(-50%);
  background: rgba(255,255,255,0.95); color: #333;
  padding: 12px 28px; border-radius: 25px;
  font-size: 1.1rem; font-weight: 600; opacity: 0; 
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  max-width: 350px; text-align: center;
  border: 2px solid rgba(0,0,0,0.1);
}

#stand-label strong {
  font-size: 1.2rem;
  color: #2c3e50;
  display: block;
  margin-bottom: 4px;
}

#stand-label .stand-description {
  font-size: 0.9rem;
  color: #7f8c8d;
  font-weight: normal;
  line-height: 1.3;
}

#instructions {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: rgba(255,255,255,0.85); color: #555;
  padding: 8px 20px; border-radius: 20px;
  font-size: 0.8rem;
}

#minimap {
  position: absolute; bottom: 50px; right: 15px;
  width: 180px; height: 180px;
  border-radius: 50%; overflow: hidden;
  border: none;
  background: transparent;
}
#minimap-canvas { width: 100%; height: 100%; border-radius: 50%; }

/* ── Footer informatif ── */
#info-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 35px;
  background: linear-gradient(135deg, rgba(0,0,0,0.8) 0%, rgba(52,73,94,0.9) 100%);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255,255,255,0.2);
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
}

.footer-content {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: white;
  font-size: 0.9rem;
}

.footer-logo {
  font-weight: 900;
  color: #f5e6c8;
  text-shadow: 0 0 5px rgba(255,215,0,0.3);
  letter-spacing: 0.1em;
}

.footer-text {
  font-weight: 500;
  color: #ecf0f1;
}

.footer-highlight {
  font-weight: 700;
  color: #3498db;
  text-shadow: 0 0 3px rgba(52,152,219,0.4);
}

.footer-separator {
  color: rgba(255,255,255,0.4);
  font-weight: 300;
}

/* ── Contrôles tactiles mobile (ancien d-pad, masqué — remplacé par joystick JS) ── */
#mobile-controls {
  display: none !important;
}

@media (max-width: 768px) {
  #instructions {
    display: none;
  }
  #minimap {
    width: 100px; height: 100px;
    bottom: 130px; right: 8px;
  }
  #info-footer { height: 28px; }
  .footer-content { font-size: 0.75rem; gap: 5px; }
}

.touch-pad {
  position: absolute;
  bottom: 20px;
  left: 20px;
  width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 60px;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.touch-button {
  position: absolute;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 16px;
  user-select: none;
  cursor: pointer;
  transition: all 0.1s ease;
}

.touch-button:active {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0.95);
}

#btn-up { top: 5px; left: 40px; }
#btn-left { top: 40px; left: 5px; }
#btn-down { bottom: 5px; left: 40px; }
#btn-right { top: 40px; right: 5px; }

.interact-button {
  position: absolute;
  bottom: 60px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: rgba(243, 146, 0, 0.3);
  border: 3px solid rgba(243, 146, 0, 0.6);
  border-radius: 30px;
  font-size: 20px;
  color: #f5e6c8;
}

.interact-button:active {
  background: rgba(243, 146, 0, 0.6);
}

/* === STAND INFO MODAL === */
#stand-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.75);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease;
  pointer-events: all;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
#stand-modal-inner {
  background: #1a1a1a;
  border: 2px solid #e94e1b;
  border-radius: 12px;
  max-width: 620px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 32px 28px 24px;
  position: relative;
  color: #eee;
  font-family: 'Segoe UI', Arial, sans-serif;
}
#stand-modal-close {
  position: absolute;
  top: 10px; right: 14px;
  background: rgba(0,0,0,0.3);
  border: none;
  color: #fff;
  font-size: 28px;
  width: 44px; height: 44px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
#stand-modal-close:hover { color: #fff; }
#stand-modal-title {
  color: #e94e1b;
  font-size: 1.6em;
  margin: 0 0 16px 0;
  border-bottom: 1px solid #333;
  padding-bottom: 10px;
}
#stand-modal-body {
  font-size: 0.95em;
  line-height: 1.65;
  color: #ccc;
}
#stand-modal-body h3 {
  color: #e94e1b;
  font-size: 1.05em;
  margin: 18px 0 6px 0;
}
#stand-modal-body ul {
  padding-left: 18px;
  margin: 6px 0;
}
#stand-modal-body li {
  margin: 4px 0;
}
#stand-modal-body .stat {
  display: inline-block;
  background: #e94e1b22;
  border: 1px solid #e94e1b55;
  border-radius: 6px;
  padding: 3px 10px;
  margin: 2px 4px;
  font-size: 0.9em;
  color: #e94e1b;
}
@media (max-width: 600px) {
  #stand-modal-inner { padding: 20px 16px 16px; }
  #stand-modal-title { font-size: 1.3em; }
}
