/* La Grande Roue de Barto : chargée seulement sur /jeu/roue (src/html-jeux.js). Style Le Parc, sans lueur. */

.jeu[data-jeu="roue"] {
  gap: 0.45rem;
}

.roue-statut {
  max-width: 26rem;
  /* Deux lignes gardées : le texte change sans pousser la roue. */
  min-height: 2.8em;
  margin: 0;
  line-height: 1.4;
  font-family: var(--police);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--encre);
}

/* La roue tient dans l’écran, sans défilement, en portrait comme en paysage. */
.roue-scene {
  --reserve-roue: 15rem;
  position: relative;
  width: min(100%, calc(100dvh - var(--reserve-roue)), 24rem);
  min-width: 14rem;
  aspect-ratio: 1;
}

/* La roue tourne par une transformation CSS (le compositeur s’en charge) ;
   la flèche et les étincelles sont sur un calque fixe au-dessus. */
.toile-roue,
.roue-fleche {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.roue-fleche {
  pointer-events: none;
}

.toile-roue {
  border-radius: 50%;
  will-change: transform;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}

.toile-roue:focus-visible {
  outline: 3px solid var(--bleu-fonce);
  outline-offset: 4px;
}

.roue-barto {
  position: absolute;
  right: -0.4rem;
  bottom: 0.2rem;
  width: 4rem;
  height: auto;
  pointer-events: none;
}

.roue-tourner {
  min-height: 48px;
  width: min(100%, 20rem);
}

/* Fin du tour : un ticket posé sur la roue. */
.roue-fin {
  position: absolute;
  inset: 18% 2% auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 0.9rem 0.8rem 1rem;
  text-align: center;
  font-family: var(--police);
  color: var(--encre);
  background: var(--blanc);
  border: 4px solid var(--encre);
  border-radius: 18px;
  box-shadow: var(--ombre-carte);
}

.roue-fin-gain {
  margin: 0;
  font-family: var(--police-titre);
  font-size: 1.45rem;
  line-height: 1.2;
}

.roue-fin .ligne-boutons {
  flex-wrap: wrap;
  justify-content: center;
}

.roue-fin .bouton {
  min-height: 44px;
}

/* Les chances, écrites en clair. */
.roue-chances {
  width: min(100%, 26rem);
  margin-top: 0.6rem;
  padding: 0.8rem 1rem;
  font-family: var(--police);
  text-align: left;
  color: var(--encre);
  background: var(--blanc);
  border: 3px solid var(--encre);
  border-radius: 16px;
}

.roue-chances h3 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.roue-liste {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.2rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.roue-ligne {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.15rem 0;
  border-bottom: 2px dashed color-mix(in srgb, var(--encre) 25%, transparent);
  font-variant-numeric: tabular-nums;
}

.roue-jackpot {
  font-weight: 800;
}

@media (max-width: 720px) {
  .roue-scene {
    --reserve-roue: 20.5rem;
  }

  /* Le titre est long : il laisse la place à la bulle de discussion, en haut à gauche. */
  .jeu[data-jeu="roue"] .ligne-jeu {
    padding-left: 3.4rem;
  }
}

/* Paysage sur téléphone : la roue à gauche, le reste à droite. */
@media (orientation: landscape) and (max-height: 520px) {
  .jeu[data-jeu="roue"] {
    display: grid;
    grid-template-columns: auto minmax(10rem, 18rem);
    column-gap: 0.75rem;
    align-items: start;
    justify-content: center;
  }

  .jeu[data-jeu="roue"] > .roue-scene {
    grid-column: 1;
    grid-row: 1 / span 6;
    width: calc(100dvh - 5.5rem);
  }

  .jeu[data-jeu="roue"] > :not(.roue-scene) {
    grid-column: 2;
  }
}

/* Barto saute pour un gros lot. */
@media (prefers-reduced-motion: no-preference) {
  .roue-saut {
    animation: roue-barto-saut 0.9s ease-out 2;
  }

  @keyframes roue-barto-saut {
    0%,
    100% {
      transform: translateY(0) rotate(0);
    }

    40% {
      transform: translateY(-2.2rem) rotate(-10deg);
    }

    70% {
      transform: translateY(0) rotate(4deg);
    }
  }
}
