/* mtt-roulette.css — fenêtre « Roulette » de mtt/library.html (voir mtt-roulette.js).

   Les couleurs viennent des variables de library.html (--accent, --gold…), et
   la fenêtre réutilise .modal-overlay / .modal-box / .trophy-bar de la page.
   Animation : seul le `transform` de la bande bouge, plus un halo sur la
   jaquette gagnante. Ni filter: blur() ni backdrop-filter (tablette). */

/* L'attribut hidden doit gagner sur les display: flex ci-dessous. */
.roulette-box [hidden] { display: none !important; }

.roulette-box { max-width: 760px; }
.roulette-entete { display: flex; align-items: center; gap: 8px; }
.roulette-son {
  background: none; border: 1px solid var(--border); border-radius: 4px;
  color: var(--text-dim); font-size: 15px; line-height: 1; padding: 5px 8px; cursor: pointer;
}
.roulette-son:hover { color: #fff; border-color: var(--accent); }

.roulette-regle { margin: 10px 0 14px; font-size: 14px; line-height: 1.4; color: var(--text-dim); }
.roulette-regle strong { color: var(--gold); }
.roulette-message { margin: 0; padding: 28px 0; text-align: center; font-style: italic; color: var(--text-dim); }

/* Connexion obligatoire : le défi est enregistré dans le compte (mtt-roulette-compte.js). */
.roulette-connexion {
  display: flex; align-items: center; justify-content: center;
  width: 100%; max-width: 360px; margin: -8px auto 16px; padding: 12px 20px; font-size: 15px;
}
.roulette-connexion:disabled { opacity: 0.6; cursor: default; }
.roulette-alerte { margin: 12px 0 0; text-align: center; font-size: 13px; color: #f0a35e; }
.roulette-qui { margin: 14px 0 0; text-align: center; font-size: 11px; color: var(--text-dim); overflow-wrap: anywhere; }

/* --- Choix des plateformes --- */
.roulette-filtres { display: flex; flex-direction: column; gap: 10px; }
.roulette-puces { display: flex; flex-wrap: wrap; gap: 8px; }
.roulette-puce {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  font-family: "Orbitron", "Segoe UI", Arial, sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--text); background: var(--panel-2); border: 1px solid var(--border);
  transition: border-color 150ms, background-color 150ms;
}
.roulette-puce span {
  font-family: "Rajdhani", "Segoe UI", Arial, sans-serif; font-size: 12px; font-weight: 600; color: var(--text-dim);
}
.roulette-puce:hover:not(:disabled) { border-color: var(--accent); }
.roulette-puce.is-active {
  color: #fff; border-color: var(--accent-2);
  background: linear-gradient(135deg, var(--accent), #9c0f22);
  box-shadow: 0 0 10px rgba(230,40,63,0.45);
}
.roulette-puce.is-active span { color: rgba(255,255,255,0.8); }
.roulette-puce:disabled { opacity: 0.55; cursor: default; }
.roulette-option { font-size: 13px; }
.roulette-compte { font-size: 13px; color: var(--text-dim); }
.roulette-compte strong { color: var(--text); font-size: 15px; }
.roulette-lien {
  background: none; border: none; padding: 0; cursor: pointer;
  font: inherit; color: var(--accent-2); text-decoration: underline;
}
.roulette-lien:disabled { opacity: 0.5; cursor: default; }

/* --- La bande de jaquettes --- */
.roulette-fenetre {
  position: relative; height: 176px; margin: 14px 0; overflow: hidden;
  border-radius: 8px; border: 1px solid var(--border);
  background: radial-gradient(ellipse at center, #2a0b0f 0%, #0d0606 70%);
}
/* Bords assombris : la bande semble sortir de l'ombre. Simples dégradés. */
.roulette-fenetre::before,
.roulette-fenetre::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 16%; z-index: 2; pointer-events: none;
}
.roulette-fenetre::before { left: 0; background: linear-gradient(90deg, #0a0505, rgba(10,5,5,0)); }
.roulette-fenetre::after { right: 0; background: linear-gradient(270deg, #0a0505, rgba(10,5,5,0)); }
.roulette-bande {
  position: absolute; top: 14px; bottom: 14px; left: 0;
  display: flex; gap: 10px; will-change: transform;
}
.roulette-tuile {
  flex: none; position: relative; width: 150px; height: 100%; overflow: hidden;
  border-radius: 6px; border: 1px solid rgba(255,255,255,0.07);
  background: #241012 center / cover no-repeat;
}
.roulette-tuile__plateformes {
  position: absolute; top: 6px; left: 6px; max-width: calc(100% - 12px);
  padding: 2px 6px; border-radius: 3px; background: rgba(0,0,0,0.75);
  font-size: 10px; font-weight: 700; letter-spacing: 0.03em; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.roulette-tuile__nom {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 22px 8px 7px; font-size: 12px; font-weight: 700; line-height: 1.15; color: #fff;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,0.9));
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* Pas de jaquette connue (titre PS3/Vita) : le nom au milieu de la tuile. */
.roulette-tuile.sans-image .roulette-tuile__nom {
  top: 0; display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 26px 10px 10px; font-size: 14px; background: none;
}
.roulette-tuile.is-gagnant { border-color: var(--gold); animation: roulette-halo 1.1s ease-in-out infinite alternate; }
@keyframes roulette-halo {
  from { box-shadow: 0 0 0 2px var(--gold), 0 0 8px rgba(230,198,107,0.3); }
  to { box-shadow: 0 0 0 2px var(--gold), 0 0 22px rgba(230,198,107,0.75); }
}
/* Le curseur : un trait rouge avec une pointe en haut et en bas. */
.roulette-curseur {
  position: absolute; top: 0; bottom: 0; left: 50%; z-index: 3; width: 3px; margin-left: -1.5px;
  background: var(--accent-2); box-shadow: 0 0 10px var(--accent), 0 0 2px #fff;
  transform-origin: 50% 0; pointer-events: none;
}
.roulette-curseur::before,
.roulette-curseur::after {
  content: ""; position: absolute; left: 50%; margin-left: -9px; border: 9px solid transparent;
}
.roulette-curseur::before { top: 0; border-top-color: var(--accent-2); border-bottom-width: 0; }
.roulette-curseur::after { bottom: 0; border-bottom-color: var(--accent-2); border-top-width: 0; }

.roulette-lancer {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px 20px; font-size: 15px;
}
.roulette-lancer:disabled { opacity: 0.6; cursor: default; filter: none; }

/* --- Le défi --- */
.roulette-carte { display: flex; align-items: stretch; gap: 16px; margin-top: 6px; }
.roulette-carte__jaquette {
  flex: none; width: 150px; aspect-ratio: 1 / 1; border-radius: 8px;
  background: #241012 center / cover no-repeat;
  border: 2px solid var(--gold); box-shadow: 0 0 18px rgba(230,198,107,0.35);
}
.roulette-carte__infos { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.roulette-carte__surtitre {
  font-family: "Orbitron", "Segoe UI", Arial, sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold);
}
.roulette-carte__nom {
  margin: 0; font-family: "Orbitron", "Segoe UI", Arial, sans-serif; font-size: 20px; line-height: 1.2;
  color: #fff; overflow-wrap: anywhere;
}
.roulette-carte__plateformes { display: flex; flex-wrap: wrap; gap: 4px; }
.roulette-carte__plateformes:empty { display: none; }
.roulette-carte__consigne { margin: 2px 0 0; font-size: 14px; line-height: 1.4; color: var(--text); }
/* Dernière partie avant le tirage. */
.roulette-carte__derniere { font-size: 13px; color: var(--text); }
.roulette-carte__ilya { color: var(--text-dim); }

.roulette-chrono {
  margin: 16px 0 12px; padding: 14px 16px 16px; text-align: center;
  border: 1px solid var(--border); border-radius: 8px; background: var(--panel);
}
.roulette-chrono__temps {
  font-family: "Orbitron", "Segoe UI", Arial, sans-serif; font-size: 42px; font-weight: 800; line-height: 1.1;
  letter-spacing: 0.04em; font-variant-numeric: tabular-nums; color: #fff;
}
.roulette-chrono.is-en-marche .roulette-chrono__temps { color: var(--gold); }
.roulette-chrono__label {
  margin: 2px 0 12px; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim);
}
.roulette-actions { display: flex; gap: 10px; }
.roulette-actions .nav-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 13px 16px; font-size: 14px; }
.roulette-synchro { margin: 10px 0 0; text-align: center; font-size: 13px; color: #8fd18f; }
.roulette-note { margin: 10px 0 0; text-align: center; font-size: 12px; font-style: italic; color: var(--text-dim); }
.roulette-secondaires { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-top: 14px; font-size: 13px; }
.roulette-secondaires button {
  background: none; border: none; padding: 6px 0; cursor: pointer;
  font: inherit; color: var(--text-dim); text-decoration: underline;
}
.roulette-secondaires button:hover { color: #fff; }
.roulette-secondaires [data-action="abandonner"]:hover { color: var(--accent-2); }

/* --- Le prochain jeu (tiré pendant le défi, pour le télécharger en avance) --- */
.roulette-prochain {
  display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 12px 14px;
  border: 1px dashed var(--border); border-radius: 8px; background: var(--panel);
}
.roulette-prochain.is-vide { flex-direction: column; gap: 6px; text-align: center; }
.roulette-prochain.is-vide .nav-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 16px; }
.roulette-prochain.is-vide .nav-btn:disabled { opacity: 0.6; cursor: default; }
.roulette-prochain__jaquette {
  flex: none; width: 76px; aspect-ratio: 1 / 1; border-radius: 6px;
  background: #241012 center / cover no-repeat; border: 1px solid var(--gold);
}
.roulette-prochain__infos { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.roulette-prochain__surtitre {
  font-family: "Orbitron", "Segoe UI", Arial, sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold);
}
.roulette-prochain__nom { font-weight: 700; font-size: 15px; color: #fff; overflow-wrap: anywhere; }
.roulette-prochain__aide { margin: 0; font-size: 12px; line-height: 1.4; color: var(--text-dim); }

.roulette-reussi { text-align: center; padding: 8px 0 4px; }
.roulette-reussi__icone { font-size: 56px; line-height: 1; animation: roulette-saut 0.9s cubic-bezier(.3,1.6,.5,1); }
.roulette-reussi h3 { margin: 8px 0 6px; font-family: "Orbitron", "Segoe UI", Arial, sans-serif; font-size: 22px; color: var(--gold); }
.roulette-reussi p { margin: 0 0 16px; line-height: 1.4; color: var(--text); }
@keyframes roulette-saut {
  from { transform: scale(0.3) rotate(-20deg); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* --- Derniers défis --- */
.roulette-historique { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border); }
.roulette-historique:empty { display: none; }
.roulette-historique__titre {
  margin-bottom: 6px; font-family: "Orbitron", "Segoe UI", Arial, sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-2);
}
.roulette-historique ul { list-style: none; margin: 0; padding: 0; }
.roulette-historique li {
  display: flex; align-items: baseline; gap: 8px; padding: 5px 0; font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.roulette-historique .nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roulette-historique .date { flex: none; font-size: 12px; color: var(--text-dim); }
.roulette-historique li.is-abandon .nom { color: var(--text-dim); }

/* --- Bouton de l'en-tête --- */
.hn-roulette .roulette-btn-texte { font-variant-numeric: tabular-nums; }
.hn-roulette.is-actif { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 12px rgba(230,198,107,0.35); }
.hn-roulette.is-reussi { border-color: var(--gold); color: #2a1a00; background: linear-gradient(135deg, #ffe08a, #c99a00); }

/* --- Téléphone --- */
@media (max-width: 700px) {
  /* Pleine largeur juste sous le profil (même `order` que lui, placé après
     dans la page) : la grille de 2 colonnes de l'en-tête reste sans trou. */
  .header-nav .hn-roulette { grid-column: 1 / -1; order: 1; }
  .roulette-regle { font-size: 13px; }
  .roulette-puce { padding: 7px 12px; }
  .roulette-fenetre { height: 144px; }
  .roulette-bande { top: 12px; bottom: 12px; gap: 8px; }
  .roulette-tuile { width: 112px; }
  .roulette-tuile__nom { font-size: 11px; }
  .roulette-carte { gap: 12px; }
  .roulette-carte__jaquette { width: 92px; }
  .roulette-carte__nom { font-size: 16px; }
  .roulette-carte__consigne { font-size: 13px; }
  .roulette-chrono__temps { font-size: 36px; }
  .roulette-actions { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .roulette-tuile.is-gagnant { animation: none; box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(230,198,107,0.6); }
  .roulette-reussi__icone { animation: none; }
}
