/* Styles critiques avant React — évite les <style> inline dans index.html (html-proxy Vite). */
html,
body,
#root {
  height: 100%;
  margin: 0;
  padding: 0;
  background: #0a1121;
  color-scheme: dark light;
}

body {
  -webkit-font-smoothing: antialiased;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    'Fira Sans',
    'Droid Sans',
    'Helvetica Neue',
    Arial,
    sans-serif;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.no-js {
  font: 14px system-ui, sans-serif;
  color: #fff;
  background: #1e293b;
  padding: 1rem;
  text-align: center;
}

/* ── Boot splash (hors #root — pas de flash au mount React) ── */
.app-boot-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a1121;
  opacity: 1;
  transition: opacity 0.35s ease;
}

.app-boot-splash--exit {
  opacity: 0;
  pointer-events: none;
}

.app-boot-splash__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-boot-splash__glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 11rem;
  height: 11rem;
  margin-top: -5.5rem;
  margin-left: -5.5rem;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 140, 40, 0.35) 0%,
    rgba(255, 100, 20, 0.12) 42%,
    transparent 70%
  );
  filter: blur(10px);
  animation: app-boot-glow 2.4s ease-in-out infinite;
  pointer-events: none;
}

.app-boot-splash__icon {
  position: relative;
  z-index: 1;
  width: 7.5rem;
  height: 7.5rem;
  object-fit: contain;
  opacity: 0;
  transform: scale(0.86);
  animation:
    app-boot-icon-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards,
    app-boot-icon-breathe 2.8s ease-in-out 0.7s infinite;
  filter: drop-shadow(0 0 18px rgba(255, 120, 30, 0.35));
}

.app-boot-splash__title {
  position: absolute;
  top: calc(100% + 1.15rem);
  left: 50%;
  margin: 0;
  width: max-content;
  max-width: 90vw;
  font-family: Cinzel, serif;
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  color: #efe6d8;
  opacity: 0;
  transform: translateX(-50%) translateY(0.4rem);
  transition:
    opacity 0.55s ease,
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  text-shadow: 0 0 28px rgba(239, 230, 216, 0.22);
  pointer-events: none;
}

.app-boot-splash--title-visible .app-boot-splash__title {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.app-boot-splash__hint {
  position: absolute;
  top: calc(100% + 3.4rem);
  left: 50%;
  margin: 0;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: rgba(201, 169, 110, 0.75);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/*
 * Mobile / PWA : AUCUN splash web (pas d’icône du tout).
 * Évite le double avec le splash OS (icon-192).
 */
html.boot-mobile #boot-splash,
html.boot-mobile .app-boot-splash {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

@keyframes app-boot-icon-in {
  from {
    opacity: 0;
    transform: scale(0.86);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes app-boot-icon-breathe {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 16px rgba(255, 120, 30, 0.3));
  }
  50% {
    transform: scale(1.035);
    filter: drop-shadow(0 0 28px rgba(255, 140, 40, 0.5));
  }
}

@keyframes app-boot-glow {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.95);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-boot-splash__glow,
  .app-boot-splash__icon {
    animation: none;
  }

  .app-boot-splash__icon {
    opacity: 1;
    transform: none;
  }

  .app-boot-splash__title {
    transition: opacity 0.2s ease;
  }
}
