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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0f0e17;
  font-family: system-ui, -apple-system, sans-serif;
  /* Respect des safe-areas iPhone/Android notch */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Canvas Phaser — plein écran sans scroll */
canvas {
  display: block;
  touch-action: none;   /* empêche scroll/zoom natif sur le canvas tactile */
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

#loader {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(ellipse at center, #1e1d2e 0%, #0f0e17 70%);
}

.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.loader-image {
  width: min(150px, 30vw);
  height: min(150px, 30vw);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(108, 99, 255, 0.4);
  animation: pulse 2s ease-in-out infinite;
}

.loader-bar-wrap {
  width: min(200px, 50vw);
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  overflow: hidden;
}

.loader {
  width: 100%;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #6c63ff, #f5a623, #6c63ff);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.loader-text {
  color: rgba(255, 255, 255, 0.45);
  font-size: clamp(11px, 2vw, 14px);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1);    box-shadow: 0 8px 32px rgba(108, 99, 255, 0.4); }
  50%       { transform: scale(1.04); box-shadow: 0 12px 40px rgba(108, 99, 255, 0.65); }
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .loader-image { width: 110px; height: 110px; }
}