/* ╔══════════════════════════════════════════════════════════╗
   ROUE

   Roue, flèche, bouton Tourner, résultat, confettis,
   boutons post-tirage, fin de partie et historique.
   ╚══════════════════════════════════════════════════════════╝ */

/* ─── Zone roue (mobile) ─── */
.wheel-zone {
  flex: 1 1 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* Espacements ciblés sur mobile */
.wheel-zone .btn-spin   { margin-top: 22px; }

.wheel-wrapper {
  position: relative;
  /* taille définie dans chaque media query */
}

/* Bague extérieure dorée — clippée dans le wrapper */
.wheel-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: conic-gradient(var(--gold) 0deg, var(--gold2) 60deg, var(--gold) 120deg, var(--gold2) 180deg, var(--gold) 240deg, var(--gold2) 300deg, var(--gold) 360deg);
  z-index: 1;
  box-shadow: 0 0 28px rgba(255,215,0,0.45), inset 0 0 10px rgba(0,0,0,0.4);
  pointer-events: none;
}

canvas {
  position: relative;
  z-index: 2;
  border-radius: 50%;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Flèche indicatrice */
.arrow-container {
  position: absolute;
  top: 50%;
  right: -14px;
  transform: translateY(-50%);
  z-index: 10;
}
.arrow {
  width: 0; height: 0;
  border-top: 18px solid transparent;
  border-bottom: 18px solid transparent;
  border-right: 36px solid var(--accent);
  filter: drop-shadow(0 0 10px var(--accent)) drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}

/* Centre hub */
.hub {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff8f0, var(--gold2) 50%, #b07800);
  box-shadow: 0 0 0 5px rgba(255,215,0,0.35), 0 4px 18px rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}

/* ─── Bouton Tourner ─── */
.btn-spin {
  padding: 14px 44px;
  background: linear-gradient(135deg, var(--accent) 0%, #c0006b 100%);
  border: none;
  border-radius: 50px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: #fff;
  cursor: pointer;
  letter-spacing: .05em;
  box-shadow: 0 6px 28px rgba(255,77,166,0.45);
  transition: transform .15s, box-shadow .15s, opacity .2s;
}
.btn-spin:hover:not(.spinning) { transform: translateY(-3px) scale(1.04); box-shadow: 0 10px 38px rgba(255,77,166,0.6); }
.btn-spin:active:not(.spinning) { transform: translateY(0) scale(0.98); }
.btn-spin.spinning { opacity: .45; cursor: not-allowed; }

/* ─── Résultat ─── */
.result-banner {
  display: none;
  position: relative;
  z-index: 1;
  text-align: center;
  margin-top: 22px;
}
.result-banner.visible {
  display: block;
  animation: pop-in .4s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes pop-in {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.result-value {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 2.4rem);
  color: var(--gold);
  filter: drop-shadow(0 0 16px var(--gold2));
  line-height: 1.2;
}

/* ─── Confettis ─── */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  top: -12px;
  width: 10px;
  height: 10px;
  opacity: 0;
  animation: fall var(--fall-d, 1.2s) ease-in var(--fall-delay, 0s) forwards;
  border-radius: var(--r, 0);
}
@keyframes fall {
  0%   { transform: translateY(0) rotate(0deg) translateX(0); opacity: 1; }
  100% { transform: translateY(105vh) rotate(var(--rot, 720deg)) translateX(var(--tx, 30px)); opacity: 0; }
}

/* ─── Boutons post-tirage ─── */
.btn-actions {
  display: none;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 16px;
}
.btn-actions.visible {
  display: flex;
  animation: pop-in .3s cubic-bezier(.34,1.56,.64,1) both;
}
.btn-remove, .btn-keep {
  width: 100%;
  padding: 11px 16px;
  border-radius: 50px;
  font-family: var(--font-display);
  font-size: 1rem;
  cursor: pointer;
  letter-spacing: .04em;
  transition: transform .15s, box-shadow .2s;
  border: none;
}
.btn-remove {
  background: linear-gradient(135deg, #ff4da6 0%, #c0006b 100%);
  color: #fff;
  box-shadow: 0 4px 18px rgba(255,77,166,0.3);
}
.btn-remove:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(255,77,166,0.5); }
.btn-remove:active { transform: translateY(0); }
.btn-keep {
  background: transparent;
  border: 2px solid rgba(255,215,0,0.5);
  color: var(--gold);
  box-shadow: none;
}
.btn-keep:hover {
  background: rgba(255,215,0,0.1);
  border-color: var(--gold);
  box-shadow: 0 4px 20px rgba(255,215,0,0.25);
  transform: translateY(-2px);
}
.btn-keep:active { transform: translateY(0); }

/* ─── Message fin de partie ─── */
.final-banner {
  display: none;
  text-align: center;
  margin-top: 22px;
}
.final-banner.visible {
  display: block;
  animation: pop-in .45s cubic-bezier(.34,1.56,.64,1) both;
}
.final-banner .final-emoji { font-size: 2.4rem; display: block; margin-bottom: 6px; }
.final-banner .final-text {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--accent);
  filter: drop-shadow(0 0 10px var(--accent));
}

/* ─── Historique des tirés ─── */
.history-section {
  display: none;
  width: 100%;
  margin-top: 22px;
}
.history-section.visible {
  display: block;
}
.history-title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: rgba(255,248,240,.5);
  margin-bottom: 8px;
  letter-spacing: .04em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.history-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 3px 10px 3px 6px;
  font-size: .78rem;
  color: rgba(255,248,240,.55);
  animation: pop-in .3s cubic-bezier(.34,1.56,.64,1) both;
}
.history-tag .tag-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.history-rank {
  font-weight: 800;
  font-size: .7rem;
  opacity: .6;
}

/* ─── Titre de la roue ───
   Le nom de la liste (souvent le nom de la classe) au-dessus de la roue,
   sur ordinateur et en plein écran, pour la projection. Sur mobile, le
   nom est déjà affiché dans le panneau : on garde la place pour la roue. */
.wheel-zone { --title-space: 0px; }
.wheel-title { display: none; }
@media (min-width: 820px) {
  /* Place du titre, réservée en haut ET en bas (layout.css) : la roue reste
     centrée verticalement, le titre est posé dans la marge du haut. */
  .wheel-zone.has-title { --title-space: 64px; }
  .wheel-zone.has-title .wheel-title {
    display: block;
    position: absolute;
    left: -40px;
    right: -40px;
    bottom: calc(100% + 16px);
    z-index: 3;
    text-align: center;
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 2.4vw, 2rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--gold);
    filter: drop-shadow(0 0 14px var(--gold2));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ─── Fin de partie ─── */
/* Dernier nom (roue.js) : « Tourner sans » devient « Terminer », seul. */
.btn-actions.last .btn-keep { display: none; }
.btn-restart {
  margin-top: 14px;
  padding: 11px 28px;
  border-radius: 50px;
  background: transparent;
  border: 2px solid rgba(255,215,0,0.5);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: .04em;
  cursor: pointer;
  pointer-events: auto;   /* #spinGroupD laisse passer les clics (layout.css) */
  transition: background .2s, border-color .2s, transform .15s;
}
.btn-restart:hover {
  background: rgba(255,215,0,0.1);
  border-color: var(--gold);
  transform: translateY(-2px);
}
