.wheelWrap {
  width: min(980px, 94vw);
}

.wheelShell {
  display: grid;
  grid-template-columns: 1fr 280px; /* roue large à gauche, historique étroit à droite */
  grid-template-areas: "main history"; /* force la position indépendamment de l’ordre HTML */
  gap: 16px;
  align-items: start;
}

.wheelMain {
  grid-area: main;
}

.wheelHistory {
  grid-area: history;
}

@media (min-width: 861px) {
  .wheelHistory {
    position: sticky;
    top: 230px;
  }
}

.wheelCard {
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.18);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  padding: 14px;
}

.wheelCardTitle {
  font-weight: 900;
  letter-spacing: 0.2px;
  margin-bottom: 10px;
  opacity: 0.95;
}

.wheelTop {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.wheelBrands,
.wheelModes {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.wheelPill {
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.86);
  font-weight: 800;
  cursor: pointer;
}
.wheelPill.is-active {
  background: rgba(140, 90, 255, 0.2);
  border-color: rgba(140, 90, 255, 0.35);
  color: rgba(255, 255, 255, 0.98);
}
.wheelPill.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.wheelMode {
  flex: 1 1 260px;
  border-radius: 18px;
  padding: 12px 14px;
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 900;
  cursor: pointer;
}
.wheelMode small {
  display: block;
  font-weight: 700;
  color: rgba(184, 195, 214, 0.92);
  margin-top: 4px;
}
.wheelMode.is-active {
  background: rgba(140, 90, 255, 0.16);
  border-color: rgba(140, 90, 255, 0.35);
}

.wheelInputsRow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.wheelLabel {
  font-weight: 800;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.86);
}
.wheelInput {
  margin-top: 8px;
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.22);
  color: rgba(255, 255, 255, 0.96);
  outline: none;
}
.wheelHint {
  margin-top: 10px;
  color: rgba(184, 195, 214, 0.92);
  font-size: 12.5px;
}

.wheelCenter {
  text-align: center;
  margin-top: 10px;
}

.wheelCanvasWrap {
  position: relative;
  width: min(420px, 86vw);
  margin: 0 auto 14px;
  aspect-ratio: 1;
}
#wheelCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.wheelPointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 24px solid rgba(255, 255, 255, 0.92);
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.45));
}

.wheelSpinBtn {
  max-width: 420px;
  margin: 0 auto;
}

.wheelCooldown {
  margin-top: 10px;
  font-size: 13px;
  color: rgba(184, 195, 214, 0.92);
  min-height: 18px;
}

.wheelHistoryList {
  display: flex;
  flex-direction: column;
  gap: 8px;

  /* 7 items + demi du 8e : on fixe une hauteur stable */
  max-height: calc((56px * 7) + (56px * 0.5) + (8px * 7));
  overflow: hidden;

  /* option : un peu d’espace pour scroll si tu veux plus tard */
  padding-right: 4px;
}
.wheelHistoryItem {
  padding: 10px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.9);
  min-height: 56px;
}
.wheelHistoryItem > div {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wheelHistoryItem small {
  display: block;
  color: rgba(184, 195, 214, 0.92);
  margin-top: 4px;
}

.wheelHistoryMobile {
  display: none;
  margin-top: 10px;
}

@media (max-width: 860px) {
  .wheelShell {
    grid-template-columns: 1fr;
  }
  .wheelHistory {
    display: none;
  }
  .wheelHistoryMobile {
    display: block;
  }
  .wheelInputsRow {
    grid-template-columns: 1fr;
  }
}

/* Modal */
.wheelModal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.wheelModal.is-open {
  display: flex;
}
.wheelModalBox {
  width: min(520px, 92vw);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(10, 12, 18, 0.92);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);
  padding: 16px;
}
.wheelModalTitle {
  font-weight: 950;
  font-size: 18px;
  margin-bottom: 8px;
}
.wheelModalBody {
  color: rgba(184, 195, 214, 0.95);
  font-size: 14px;
  line-height: 1.4;
}
.wheelModalBtn {
  margin-top: 14px;
}

.wheelHistoryItem.is-win {
  border-color: rgba(120, 255, 160, 0.22);
}
.wheelHistoryItem.is-lose {
  border-color: rgba(255, 120, 120, 0.18);
  opacity: 0.92;
}

/* Pointer tick animation */
.wheelPointer.is-tick {
  animation: wheelTick 90ms ease-out;
  transform: translateX(-50%) rotate(-10deg);
  transform-origin: 50% 10%;
}

@keyframes wheelTick {
  0% {
    transform: translateX(-50%) rotate(0deg) scale(1);
  }
  40% {
    transform: translateX(-50%) rotate(-10deg) scale(1.02);
  }
  100% {
    transform: translateX(-50%) rotate(0deg) scale(1);
  }
}

/* ============================= */
/* Bouton info (i) */
/* ============================= */

.wheelInfoBtn {
  position: absolute;
  top: 18px;
  right: 18px;

  width: 28px;
  height: 28px;

  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);

  color: #fff;
  font-weight: 900;
  font-size: 14px;
  line-height: 1;

  cursor: pointer;

  display: none; /* caché par défaut */
  align-items: center;
  justify-content: center;

  z-index: 20;
  transition:
    background 0.15s ease,
    transform 0.15s ease;
}

.wheelInfoBtn:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.05);
}

/* visible uniquement quand JS ajoute la classe */
.wheelInfoBtn.is-visible {
  display: flex;
}

/* ============================= */
/* Pop-up probabilités */
/* ============================= */

.wheelPopover {
  position: absolute;
  top: 54px;
  right: 18px;

  width: 260px;
  padding: 14px;

  background: rgba(12, 14, 22, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;

  font-size: 13px;
  color: #fff;

  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);

  display: none; /* caché par défaut */
  z-index: 30;
}

.wheelPopover.is-open {
  display: block;
}

/* ============================= */
/* Contenu pop-up */
/* ============================= */

.wheelPopoverTitle {
  font-weight: 900;
  font-size: 14px;
  margin-bottom: 8px;
}

.wheelPopoverSection {
  margin-top: 10px;
}

.wheelPopoverSection strong {
  font-weight: 800;
}

.wheelPopoverSection ul {
  margin: 6px 0 0;
  padding-left: 16px;
}

.wheelPopoverSection li {
  margin-bottom: 4px;
  opacity: 0.95;
}

/* IMPORTANT: pour que le bouton i / popover se positionne par rapport à la carte roue */
.wheelCenter {
  position: relative;
}

/* Popover : liste sans puces */
.wheelPopoverSection ul {
  list-style: none;
  padding-left: 0;
  margin: 10px 0 0;
}

.wheelPopoverSection li {
  margin: 6px 0;
}

/* Alignement label gauche / % droite */
.wheelProbaList li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.wheelProbaList .lbl {
  text-align: left;
  opacity: 0.95;
}

.wheelProbaList .pct {
  text-align: right;
  font-variant-numeric: tabular-nums; /* chiffres alignés */
  opacity: 0.9;
}

.wheelHintLink {
  color: #8b5cf6; /* violet Zartex */
  font-weight: 800;
  text-decoration: none;
  margin-left: 6px;
}

.wheelHintLink:hover {
  text-decoration: underline;
}
