/* ==========================================================
  Splash — ELRAYANE SOFT
========================================================== */

#splasher {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 50%, #141414 0%, #0a0a0a 70%);
  overflow: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* Masqué si déjà vu dans la session ou si l'utilisateur préfère moins d'animations */
html.splasher-skip #splasher {
  display: none;
}

/* Bloque le défilement de la page pendant le splash */
html.splasher-active {
  overflow: hidden;
}

#splasher.splasher-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#splasher-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.splasher-content {
  position: relative;
  z-index: 2;
  text-align: center;
  font-family: 'Segoe UI', Arial, sans-serif;
}

.splasher-ring {
  width: 110px;
  height: 110px;
  margin: 0 auto 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 122, 0, 0.25);
  border-top-color: #ff0000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: splasherSpin 1.4s linear infinite, splasherFadeIn 0.6s ease-out forwards;
}

.splasher-ring::after {
  content: "R";
  font-size: 26px;
  font-weight: 700;
  color: #ff7a00;
  letter-spacing: 1px;
  animation: splasherUnspin 1.4s linear infinite;
}

@keyframes splasherSpin {
  to { transform: rotate(360deg); }
}
@keyframes splasherUnspin {
  to { transform: rotate(-360deg); }
}
@keyframes splasherFadeIn {
  to { opacity: 1; }
}

.splasher-title {
  font-size: clamp(26px, 8vw, 46px);
  font-weight: 800;
  letter-spacing: clamp(2px, 1vw, 4px);
  color: #f5f5f5;
  display: flex;
  justify-content: center;
  /* Une lettre par span : on force le sens de lecture latin, même en arabe (RTL) */
  direction: ltr;
}

.splasher-title span {
  display: inline-block;
  opacity: 0;
  transform: translateY(30px);
  animation: splasherLetterUp 0.6s ease-out forwards;
}

.splasher-title span.accent {
  color: #ff0000;
}

@keyframes splasherLetterUp {
  to { opacity: 1; transform: translateY(0); }
}

.splasher-subtitle {
  margin-top: 16px;
  font-size: 13px;
  letter-spacing: 6px;
  color: #888;
  text-transform: uppercase;
  opacity: 0;
  animation: splasherFadeIn 0.6s ease-out 0.9s forwards;
}

/* L'espacement des lettres casse les liaisons de l'écriture arabe */
html[dir="rtl"] .splasher-subtitle {
  letter-spacing: 0;
  font-size: 16px;
}

.splasher-progress {
  margin: 40px auto 0;
  width: 200px;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  opacity: 0;
  animation: splasherFadeIn 0.4s ease-out 0.9s forwards;
}

.splasher-progress::after {
  content: "";
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff0000, #ee6d31);
  animation: splasherFill 0.8s ease-out 0.9s forwards;
}

@keyframes splasherFill {
  to { width: 100%; }
}

.splasher-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,122,0,0.12) 0%, transparent 70%);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  animation: splasherPulse 3s ease-in-out infinite;
}

@keyframes splasherPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
  50% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
}
