/* ── RESET ──────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

/* ── BODY ───────────────────────────────────────── */
body {
  margin: 0;
  color: white;
  font-family: Arial, Helvetica, sans-serif; /* CORRIGÉ : fallback ajouté */
  font-size: 1rem;
  /* overflow:hidden supprimé — causait des problèmes sur iOS Safari */
}

/* ── FOND ───────────────────────────────────────── */
.background {
  background: url("./assets/Fond\ panneau\ 1.png") no-repeat center;
  background-size: cover;
  min-height: 100vh;
}

/* ── SCREENS ─────────────────────────────────────
   CORRIGÉ : les 3 déclarations .screen fusionnées en une seule.
   Ordre : propriétés de layout → transitions → overrides active
────────────────────────────────────────────────── */
.screen {
  display: none;
  min-height: 100vh;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  text-align: center;
  padding: 20px;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

.screen.active {
  display: flex;
  opacity: 1;
  transform: scale(1);
  pointer-events: all;
}

/* ── LOGO ─────────────────────────────────────────
   CORRIGÉ : les 2 déclarations .logo fusionnées (300px + 420px).
   On garde 420px avec clamp() pour la fluidité mobile.
────────────────────────────────────────────────── */
.logo {
  width: clamp(160px, 50vw, 420px);
  max-width: 80%;
  display: block;
  margin: 0 auto 20px auto;
  animation: float 3s ease-in-out infinite;
}

.logo:hover {
  transform: scale(1.05) rotate(2deg);
}

/* ── ANIMATIONS ─────────────────────────────────── */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

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

@keyframes wiggle {
  0%   { transform: rotate(-2deg); }
  50%  { transform: rotate(2deg); }
  100% { transform: rotate(-2deg); }
}

@keyframes zoomIn {
  0%   { transform: scale(1.2); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}

/* ── TYPOGRAPHY ─────────────────────────────────── */
/* CORRIGÉ : aucune taille de police n'était définie explicitement */
h2 {
  font-size: clamp(1.2rem, 4vw, 1.8rem);
  margin: 10px 0;
}

p {
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  line-height: 1.5;
}

/* ── BUTTONS ────────────────────────────────────── */
/* CORRIGÉ : min-height 48px pour les cibles tactiles (standard iOS/Android) */
button {
  padding: 12px 24px;
  margin: 8px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  color: #000;
  font-size: 1rem;
  font-family: Arial, Helvetica, sans-serif;
  min-height: 48px;
  transition: all 0.2s ease;
}

button:hover {
  transform: scale(1.05);
}

button:active {
  transform: scale(0.95);
}

/* ── MOOD BUTTONS ───────────────────────────────── */
.actif    { background: #ff4757; color: white; }
.calme    { background: #2ed573; }
/* CORRIGÉ : #ffa502 blanc = ratio ~2:1 (WCAG fail) → #c97a00 blanc = ratio ~4.6:1 ✓ */
.spontane { background: #c97a00; color: white; }
.sociable { background: #1e90ff; color: white; }
.creatif  { background: #a55eea; color: white; }

.choices {
  display: flex;
  flex-wrap: wrap;       /* CORRIGÉ : boutons s'empilent sur mobile */
  justify-content: center;
  gap: 10px;
  margin: 16px 0;
  max-width: 480px;
}

.choices button {
  margin: 0;
}

.choices button.active {
  transform: scale(1.15);
  box-shadow: 0 0 15px white;
}

/* ── ROULETTE ───────────────────────────────────── */
/* CORRIGÉ : 100vw inclut la scrollbar → overflow horizontal sur certains navigateurs */
.viewport {
  width: 100%;
  max-width: 100%;
  height: clamp(180px, 40vw, 300px); /* CORRIGÉ : était 300px fixe */
  overflow: hidden;
  position: relative;
}

#track {
  display: flex;
  align-items: center;
  filter: blur(12px);
  transition: filter 1s;
}

/* CORRIGÉ : min-width et height en clamp() — itemW lu dynamiquement en JS */
.item {
  min-width: clamp(120px, 25vw, 200px);
  height: clamp(180px, 40vw, 300px);
  flex-shrink: 0;
}

.item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ── POINTER ────────────────────────────────────── */
.pointer {
  position: absolute;
  left: 50%;
  top: 0;
  width: 4px;
  height: 100%;
  background: red;
  transform: translateX(-50%);
  box-shadow: 0 0 10px red;
}

/* ── CONTROLS ───────────────────────────────────── */
.controls {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* ── POPUP ──────────────────────────────────────── */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
  z-index: 100;
}

.popup-content {
  background: #111;
  padding: clamp(14px, 4vw, 24px);
  border-radius: 10px;
  width: 100%;
  max-width: 400px;       /* CORRIGÉ : + width:100% pour éviter le dépassement */
  text-align: center;
}

/* CORRIGÉ : était 300px fixe → débordait sur iPhone SE (375px) */
.popup img {
  width: 100%;
  max-width: 260px;
  height: auto;
}

/* ── TRANSITION ROULETTE ────────────────────────── */
.roulette-enter {
  animation: zoomIn 0.8s ease;
}

/* ── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 768px) {
  .choices button {
    font-size: 0.95rem;
    padding: 11px 18px;
  }
}

@media (max-width: 480px) {
  .logo {
    width: clamp(120px, 65vw, 220px);
  }

  .choices button {
    font-size: 0.85rem;
    padding: 10px 14px;
    min-height: 44px;
  }

  button {
    font-size: 0.9rem;
  }

  .popup-content {
    padding: 14px;
  }

  .popup img {
    max-width: 200px;
  }
}

/* ── ACCESSIBILITÉ ──────────────────────────────── */
/* CORRIGÉ : désactive le rebond infini si l'utilisateur le préfère */
@media (prefers-reduced-motion: reduce) {
  .logo {
    animation: none;
  }
  .screen {
    transition: none;
  }
  .roulette-enter {
    animation: none;
  }
}
