*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --primary: #0a6ebd;
  --primary-dark: #084f8c;
  --primary-light: #e8f4fd;
  --accent: #f07a1a;
  --accent-dark: #d4610a;
  --success: #1a9e5c;
  --success-dark: #137a45;
  --danger: #d12121;
  --text-main: #1a1a2e;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --bg: #f8fafc;
  --bg-history: #f0f1f2;
  --bg-card: #ffffff;
  --border: #e5e7eb;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.18);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font-display: "Lora", Georgia, serif;
  --font-body: "Open Sans", sans-serif;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html,
body {
  min-height: 100vh;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  position: relative;
  background-color: var(--bg);
  font-family: var(--font-body);
  font-optical-sizing: auto;
  font-weight: 400;
  color: var(--text-main);
  user-select: none;
  -webkit-user-select: none;
}

img {
  image-rendering: auto;
}

input,
textarea,
select {
    font-size: 16px;
}

button,
input,
textarea,
select,
a,
div {
    touch-action: manipulation;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* ===== HEADER ===== */
header {
  width: 100%;
  position: fixed;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 100;
  background: linear-gradient(135deg, #0a1628 0%, #0f2044 100%);
}

.principalheader {
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 8px clamp(12px, 3vw, 48px);
  gap: clamp(8px, 2vw, 40px);
  color: white;
  transition:
    color var(--transition),
    border-color var(--transition);
}

.logo {
  width: clamp(80px, 9vw, 180px);
  height: auto;
  cursor: pointer;
  transition:
    transform var(--transition),
    opacity var(--transition);
  flex-shrink: 0;
}
.logo:hover {
  transform: scale(1.04);
  opacity: 0.9;
}

/* Search */
.barre-de-recherche {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 1;
  max-width: 480px;
  position: relative;
}

.barre-de-recherche img {
  width: clamp(14px, 1.4vw, 22px);
  aspect-ratio: 1/1;
  flex-shrink: 0;
  opacity: 0.85;
  transition: opacity var(--transition);
}

.recherche {
  outline: none;
  border: none;
  text-align: center;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.7);
  background: transparent;
  color: white;
  font-family: var(--font-body);
  font-size: clamp(12px, 1vw, 15px);
  width: clamp(100px, 20vw, 200px);
  padding: 4px 0;
  transition:
    width 0.4s ease,
    border-color var(--transition),
    color var(--transition);
}
.recherche::placeholder {
  color: rgba(255, 255, 255, 0.7);
  transition: color var(--transition);
}
.recherche.debut {
  color: var(--text-main);
  border-color: var(--border);
}
.recherche.debut::placeholder {
  color: var(--text-light);
}
.recherche.active {
  width: clamp(100px, 25vw, 250px);
}
.recherche:focus {
  border-color: var(--primary);
}
.recherche.debut:focus {
  border-color: var(--primary);
}

/* Compte */
.compte {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-shrink: 0;
}

.information {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-lg);
  transition: background var(--transition);
}
.information:hover {
  background: rgba(255, 255, 255, 0.15);
}

.compte img {
  width: clamp(18px, 1.6vw, 26px);
  aspect-ratio: 1/1;
  transition: filter var(--transition);
}

.compte p {
  font-size: clamp(11px, 1.1vw, 15px);
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Boutons Connecter / S'inscrire du header */
.auth-buttons {
  display: flex;
  gap: clamp(4px, 1vw, 8px);
  align-items: center;
  flex-wrap: nowrap;
  min-width: 0;
}
.auth-btn {
  border: none;
  border-radius: 50px;
  padding: clamp(5px, 0.8vw, 7px) clamp(9px, 2vw, 16px);
  font-family: "Open Sans", sans-serif;
  font-size: clamp(10px, 2.6vw, 14px);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
  transition: all var(--transition);
}
.auth-btn-connexion {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}
.auth-btn-connexion:hover {
  background: rgba(255, 255, 255, 0.28);
}
.auth-btn-inscription {
  background: #fff;
  color: var(--primary-dark, var(--primary));
}
.auth-btn-inscription:hover {
  opacity: 0.88;
}

/* Filter bar */
.filter {
  width: 100%;
  display: none;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 8px clamp(12px, 3vw, 48px);
  gap: 6px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  z-index: 99;
}

.item-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 14px;
  border: 1.5px solid var(--border);
  border-radius: 99px;
  background: white;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}
.item-filter:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.item-filter:active {
  transform: translateY(0);
}
.item-filter a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 600;
  font-size: clamp(10px, 1vw, 13px);
  letter-spacing: 0.01em;
}
.item-filter img {
  height: 14px;
  width: auto;
}

/* ===== HERO ===== */
.imggrand {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: white;
}

.imgdebut {
  width: 100%;
  aspect-ratio: 16/7;
  object-fit: cover;
  display: block;
}

.imggrand::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(10, 30, 60, 0.72) 0%,
    rgba(0, 0, 0, 0.38) 100%
  );
  pointer-events: none;
  z-index: 1;
}

.hero {
  position: absolute;
  z-index: 2;
  color: white;
  text-align: center;
  padding: clamp(24px, 5vw, 80px) clamp(16px, 5vw, 60px);
  max-width: 700px;
  animation: heroFadeIn 1.1s ease both;
}

@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(22px, 4.5vw, 62px);
  font-weight: 700;
  margin: 0 0 14px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.hero p {
  font-size: clamp(13px, 1.5vw, 19px);
  margin: 0 0 28px;
  opacity: 0.92;
  font-weight: 400;
  line-height: 1.6;
}

.hero button {
  padding: 13px 32px;
  border: none;
  border-radius: 99px;
  font-size: clamp(13px, 1.2vw, 16px);
  font-weight: 700;
  font-family: var(--font-body);
  background: var(--accent);
  color: white;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 6px 24px rgba(240, 122, 26, 0.4);
  letter-spacing: 0.03em;
}
.hero button:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(240, 122, 26, 0.5);
}

/* ===== PRODUCT GRID ===== */
#list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: clamp(12px, 2vw, 24px);
  width: 100%;
  max-width: 1400px;
  margin: clamp(20px, 3vw, 40px) auto;
  padding: 0 clamp(12px, 3vw, 40px);
}

.image-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-card);
  width: calc(50% - 12px);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  transition:
    transform var(--transition),
    box-shadow var(--transition);
  position: relative;
}
.image-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.image-item a {
  text-decoration: none;
  color: inherit;
  width: 100%;
  display: block;
  overflow: hidden;
  height: clamp(100px, 15vw, 200px);
}

.imgprt {
  width: 150px;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  padding: 5px;
  transition: transform 0.5s ease;
}
.image-item:hover .imgprt {
  transform: scale(1.1);
}

.text-wrapper {
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5px;
  gap: 5px;
}

.text-wrapper .text0 {
  font-size: clamp(14px, 1.5vw, 18px);
  color: #ffffff;
  background: var(--primary-dark);
  width: 100%;
  text-align: center;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: 0.05em;
  box-shadow: 0 4px 12px rgba(10, 110, 189, 0.25);
}

.text-wrapper .text1 {
  font-size: clamp(11px, 1vw, 14px);
  color: var(--text-main);
  width: 100%;
  font-weight: 600;
  line-height: 1.4;
}

.text-wrapper .text2 {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.text2 .quantite {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
  transition: border-color var(--transition);
}
.quantite:hover {
  border-color: var(--primary);
}

.text2 .quantite .moins,
.text2 .quantite .plus {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 28px;
  height: 28px;
  background: white;
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
  color: var(--text-main);
  flex-shrink: 0;
  transition:
    background var(--transition),
    color var(--transition);
}
.text2 .quantite .moins:hover {
  background: #ffeaea;
  color: var(--danger);
}
.text2 .quantite .plus:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.text2 .quantite .tv {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  padding: 0 4px;
  gap: 3px;
}

.text2 .quantite .valeur {
  margin: 0;
  padding: 0;
  text-align: center;
  border: none;
  outline: none;
  font-weight: 700;
  font-size: clamp(11px, 1vw, 14px);
  width: 32px;
  min-width: 20px;
  color: var(--text-main);
}

.text2 .quantite .vlp {
  margin: 0;
  font-size: 0.78em;
  color: var(--text-light);
}

.text2 .commander {
  width: 100%;
  background: var(--success);
  color: white;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 8px 10px;
  transition:
    background var(--transition),
    transform var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  font-family: var(--font-body);
}
.text2 .commander:hover {
  background: var(--success-dark);
  transform: scale(1.02);
}
.text2 .commander:active {
  transform: scale(0.98);
}
.text2 .commander p {
  margin: 0;
  font-size: clamp(10px, 0.9vw, 13px);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.text2 .commander::before {
  content: "🛒";
  font-size: 13px;
}

@media (min-width: 640px) {
  .image-item {
    width: calc(33.33% - 16px);
  }
}
@media (min-width: 1024px) {
  .image-item {
    width: calc(20% - 20px);
  }
}
@media (min-width: 1400px) {
  .image-item {
    width: calc(16.66% - 20px);
  }
}

.text-wrapper .text3 {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.text3 .miser{
  border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    font-family: var(--font-body);
    border: #d4610a 1px solid;
    transition: background 0.3s ease, transform 0.3s ease;
    background: linear-gradient(
    135deg,
    rgba(255, 165, 0, 0.45),
    rgba(255, 69, 0, 0.35)
);
}

.text3 .miser:hover {
    background: linear-gradient(
        135deg,
        rgba(220, 120, 0, 0.50),
        rgba(200, 40, 0, 0.45)
    );

    transform: scale(1.02);
}

.text3 .miser p {
    margin: 0;
    font-size: clamp(10px, 0.9vw, 13px);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  
}

/* ===== MISER — carte agrandie au centre ===== */

/* fond sombre derrière la carte ouverte */
.miser-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 30, 0.6);
  backdrop-filter: blur(6px);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.miser-backdrop.actif {
  opacity: 1;
  pointer-events: auto;
}

/* espace réservé dans la grille pendant que la carte est détachée */
.image-item-placeholder {
  visibility: hidden;
}

/* la carte agrandie : plus de largeur que de hauteur (surtout gauche/droite) */
.image-item.ouvert {
  z-index: 950;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  transition:
    top 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    left 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.5s ease;
}

/* le prix, les contrôles et l'image s'effacent progressivement */
.image-item.ouvert .text0,
.image-item.ouvert .text2,
.image-item.ouvert .img-wrapper {
  opacity: 0;
  max-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    max-height 0.35s ease 0.05s,
    margin 0.35s ease 0.05s,
    padding 0.35s ease 0.05s;
}

/* ── Roulette (x1 / x0) affichée sous le nom du produit ──
   Une fenêtre à largeur fixe (overflow hidden) laisse défiler une bande de
   cases de la gauche vers la droite ; un repère central indique la case
   gagnante une fois la roulette arrêtée. */
.mise-resultat-wrap {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 64px;
  border: 3px solid var(--border);
  border-radius: var(--radius-md);
  box-sizing: border-box;
  background: var(--bg);
  transition: border-color 0.3s ease;
}
.mise-resultat-wrap.mise-gagne {
  border-color: var(--success);
}
.mise-resultat-wrap.mise-perdu {
  border-color: var(--danger);
}

/* repère central : matérialise la case retenue au milieu de la fenêtre */
.mise-repere {
  position: absolute;
  inset: 0 auto 0 50%;
  width: 2px;
  background: var(--border);
  transform: translateX(-50%);
  opacity: 0.6;
  z-index: 2;
  pointer-events: none;
}
.mise-repere::before,
.mise-repere::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
}
.mise-repere::before {
  top: -1px;
  border-top: none;
  border-bottom-color: var(--primary);
}
.mise-repere::after {
  bottom: -1px;
  border-bottom: none;
  border-top-color: var(--primary);
}

/* la bande qui glisse horizontalement pendant le lancer */
.mise-track {
  display: flex;
  height: 100%;
  will-change: transform;
}

.mise-carte {
  flex: 0 0 84px;
  width: 84px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(16px, 1.6vw, 22px);
  opacity: 0.4;
  transform: scale(0.86);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.mise-carte.actif {
  opacity: 1;
  transform: scale(1);
}
.mise-carte[data-symbole="x1"] {
  color: var(--success);
}
.mise-carte[data-symbole="x0"] {
  color: var(--danger);
}

/* Affichage du solde, entre la roulette et le bloc de mise */
.mise-solde {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #eaf6f0, #d7f0e2);
  border: 1.5px solid var(--success);
}
.mise-solde-icone {
  font-size: 18px;
  line-height: 1;
}
.mise-solde-texte {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
}
.mise-solde-label {
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--success-dark);
}
.mise-solde-montant {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(14px, 1.4vw, 17px);
  color: var(--success-dark);
}
.mise-solde-msg {
  width: 100%;
  text-align: center;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--danger);
  margin-top: 4px;
}

/* Prix du produit : mis en avant comme une étiquette de prix, bien visible */
.mise-prix {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(255, 165, 0, 0.16), rgba(255, 69, 0, 0.12));
  border: 1.5px solid var(--accent-dark);
}
.mise-prix-icone {
  font-size: 22px;
  line-height: 1;
}
.mise-prix-texte {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}
.mise-prix-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-dark);
}
.mise-prix-valeur {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(20px, 2.2vw, 26px);
  color: var(--accent-dark);
}

/* Message en direct : met en valeur l'écart entre la mise et le prix produit */
.mise-hint {
  width: 100%;
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--success);
  line-height: 1.3;
}
.mise-hint.mise-hint-neutre {
  color: var(--text-muted);
  font-weight: 600;
}

/* ── Validation de la mise : erreur + proposition d'arrondi ── */

.mise-erreur {
  color: #c0392b;
  background: #fdecea;
  border: 1px solid #f5b7b1;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  margin-top: 6px;
  line-height: 1.4;
}

.mise-suggestion {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 10px;
  background: #fff8e6;
  border: 1px solid #f0d693;
  border-radius: 8px;
}

.mise-suggestion-texte {
  font-size: 13px;
  color: #7a5c00;
  flex: 1 1 100%;
}

.mise-suggestion-btn {
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  background: #2ecc71;
  color: #fff;
  transition: background 0.2s ease;
}

.mise-suggestion-btn:hover {
  background: #27ae60;
}

.mise-suggestion-btn-secondaire {
  background: #eaeaea;
  color: #333;
}

.mise-suggestion-btn-secondaire:hover {
  background: #d5d5d5;
}

.mise-input-erreur {
  border-color: #c0392b !important;
  animation: mise-shake 0.4s ease;
}

@keyframes mise-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* text3 devient une rangée : bloc de mise à gauche, bouton miser à droite */
.image-item.ouvert .text3 {
  flex-direction: row;
  align-items: stretch;
  gap: 8px;
  position: relative;
}

.image-item.ouvert .miser {
  flex: 1;
}

.mise-bloc {
  display: none;
  flex-direction: column;
  gap: 6px;
  flex: 1.3;
}
.image-item.ouvert .mise-bloc {
  display: flex;
  opacity: 0;
  transform: translateX(-8px);
  animation: miseBlocIn 0.35s ease 0.22s forwards;
}
@keyframes miseBlocIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.mise-input {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(11px, 1vw, 14px);
  text-align: center;
  color: var(--text-main);
  outline: none;
  transition: border-color var(--transition);
}
.mise-input:focus {
  border-color: var(--primary);
}
.mise-input.mise-input-erreur {
  border-color: var(--danger);
  animation: miseInputSecoue 0.4s ease;
}
@keyframes miseInputSecoue {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.mise-presets {
  display: flex;
  gap: 4px;
}
.mise-preset {
  flex: 1;
  border: 1.5px solid var(--border);
  background: white;
  border-radius: var(--radius-sm);
  padding: 5px 2px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(9px, 0.85vw, 12px);
  color: var(--text-main);
  cursor: pointer;
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition);
}
.mise-preset:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.miser:disabled,
.miser.en-attente {
  cursor: not-allowed;
  opacity: 0.55;
  filter: grayscale(40%);
  pointer-events: none;
}

.miser.en-attente {
  position: relative;
  color: transparent;
}

.miser.en-attente::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: miser-spin 0.7s linear infinite;
}

@keyframes miser-spin {
  to { transform: rotate(360deg); }
}

.miser-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  background: white;
  color: var(--text-main);
  font-size: 16px;
  box-shadow: var(--shadow-lg);
  z-index: 960;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.miser-close.actif {
  opacity: 1;
  pointer-events: auto;
}

/* ===== Popup de gain (résultat x1) ===== */
.gain-popup-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 30, 0.65);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.gain-popup-backdrop.actif {
  opacity: 1;
  pointer-events: auto;
}

.gain-popup {
  background: white;
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  max-width: min(90vw, 340px);
  text-align: center;
  box-shadow: var(--shadow-lg);
  transform: scale(0.85);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.gain-popup-backdrop.actif .gain-popup {
  transform: scale(1);
}

.gain-popup-emoji {
  font-size: 42px;
  line-height: 1;
  margin-bottom: 8px;
}
.gain-popup-titre {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  color: var(--success);
  margin-bottom: 6px;
}
.gain-popup-produit {
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 18px;
}
.gain-popup-fermer {
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 24px;
  background: linear-gradient(135deg, rgba(255, 165, 0, 0.9), rgba(255, 69, 0, 0.85));
  color: white;
  font-family: var(--font-body);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.gain-popup-fermer:hover {
  transform: scale(1.04);
}



/* ===== CART BUBBLE ===== */
.paniercorps {
  touch-action: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: grab;
  box-shadow: 0 4px 20px rgba(10, 110, 189, 0.45);
  z-index: 700;
  user-select: none;
  padding: 6px;
  transition:
    box-shadow var(--transition),
    transform var(--transition);
}
.paniercorps:hover {
  box-shadow: 0 8px 28px rgba(10, 110, 189, 0.55);
  transform: scale(1.06);
}
.paniercorps:active {
  cursor: grabbing;
}

.panier {
  pointer-events: none;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.paniercorps img {
  width: clamp(20px, 2.5vw, 30px);
  aspect-ratio: 1/1;
}

.paniercorps strong {
  font-weight: 800;
  font-family: var(--font-body);
  margin: 0;
  top: -2px;
  right: -2px;
  font-size: clamp(9px, 0.8vw, 12px);
  position: absolute;
  background: var(--accent);
  color: white;
  min-width: 18px;
  height: 18px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  line-height: 1;
}

/* ===== CART PANEL (BPANIER) ===== */
.bpanier {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 30, 0.55);
  backdrop-filter: blur(3px);
  display: none;
  z-index: 999;
  animation: fadeInOverlay 0.25s ease both;
}
@keyframes fadeInOverlay {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.contpanier {
  position: fixed;
  top: 0;
  right: 0;
  background: white;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: clamp(280px, 420px, 92vw);
  box-shadow: var(--shadow-xl);
  animation: slideInPanel 0.32s cubic-bezier(0.4, 0, 0.2, 1) both;
  z-index: 501;
}
@keyframes slideInPanel {
  from {
    transform: translateX(100%);
    opacity: 0.5;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Cart header */
.tete {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.tete .pan,
.tete .historique,
.tete .casino-tab {
  display: flex;
  flex: 1;
  width: auto;
  justify-content: center;
  align-items: center;
  flex-direction: row;
  gap: 8px;
  cursor: pointer;
  padding: 14px 10px;
  border-bottom: 3px solid transparent;
  transition: all var(--transition);
  color: var(--text-muted);
}
.tete .pan:hover,
.tete .historique:hover,
.tete .casino-tab:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.tete .pan.active,
.tete .historique.active,
.tete .casino-tab.active {
  border-bottom-color: var(--primary);
  color: var(--primary);
  background: white;
}
.tete .logocasino {
  display: flex;
  align-items: center;
  gap: 7px;
}
.casino-tab-icone {
  font-size: 16px;
  line-height: 1;
}

.tete .logopanier,
.tete .logohistorique {
  display: flex;
  align-items: center;
  gap: 7px;
  width: auto;
}

.tete .logopanier img,
.tete .logohistorique img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.tete .quantproduit,
.tete .quanthistorique {
  display: flex;
  align-items: center;
}

.tete p {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.tete .pan strong,
.tete .historique p:last-child {
  background: var(--primary);
  color: white;
  border-radius: 99px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Cart body */
.corps {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  overflow-y: auto;
  flex: 1;
  height: 100%;
}

.scrollcorps {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px;
}

/* Cart item */
.produitpanier {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow var(--transition);
  animation: slideInItem 0.3s ease both;
}
@keyframes slideInItem {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.produitpanier:hover {
  box-shadow: var(--shadow-md);
}

.teteproduitpanier {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.ecritteteproduitpanier {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.contenueproduitpanier {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.produitpanier .imgprt {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.scrollcorps .quantite {
  display: flex;
  flex-direction: row;
  flex: 1;
  gap: 30px;
  padding: 0;
  height: 30px;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.scrollcorps .quantite .tv {
  display: flex;
  text-align: center;
  justify-content: center;
  gap: 10px;
  align-items: center;
}
.scrollcorps .quantite p {
  margin: 0;
}

.scrollcorps .totalproduitpanier {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
  gap: 2px;
}

.scrollcorps .totalproduitpanier .detailtotalpanier {
  margin: 0;
  color: var(--danger);
  font-weight: 700;
  font-size: 14px;
}

.scrollcorps .totalproduitpanier .detailtotalpanier::after {
  content: " Ar";
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
}

#scrollcorpshistorique {
  gap: 30px;
}

.imgproduitpanier {
  width: 22px !important;
  height: 22px !important;
  aspect-ratio: 1/1;
  cursor: pointer;
  opacity: 0.45;
  transition:
    opacity var(--transition),
    transform var(--transition);
  flex-shrink: 0;
  border-radius: 4px;
  padding: 2px;
}
.imgproduitpanier:hover {
  opacity: 1;
  background: #ffeaea;
  transform: scale(1.1);
}

/* Panier footer */
.payement {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.payement-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

.payement-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0 4px;
  border-top: 1px dashed var(--border);
}

.payement-total span:first-child {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.tot {
  font-size: 18px;
  font-weight: 800;
  color: var(--danger);
  margin: 0;
}
.tot::after {
  content: " Ar";
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.validpayement {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--success), var(--success-dark));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow: 0 4px 14px rgba(26, 158, 92, 0.35);
}
.validpayement:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(26, 158, 92, 0.45);
}
.validpayement:disabled {
  background: var(--border);
  color: var(--text-light);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Empty cart */
.pvide {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(14px, 1.2vw, 18px);
  color: var(--text-light);
  pointer-events: none;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.pvide::before {
  content: "🛒";
  font-size: 42px;
  opacity: 0.4;
}

/* ===== HISTORIQUE ===== */
.feuillefacture {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: slideInItem 0.3s ease both;
}

.produitfacture {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.produitfacture p {
  margin: 0;
  font-size: 16px;
}

.validstatut {
  background: #ff8585;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: var(--radius-md);
  padding: 5px;
  margin-bottom: 20px;
}

.validstatut.valide {
  background: #55c96b;
  color: white;
}

.validstatut p {
  margin: 0;
}

.majeur {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.majeur .nomprfacture {
  font-weight: 600;
  font-size: 17px;
  color: var(--text-main);
}

.mineur {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mineur1 {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 11px;
}

.mineur2 {
  display: flex;
  justify-content: center;
  align-items: center;
}

.mineur2 .totalprixprfacture {
  font-weight: 700;
  color: var(--danger);
  font-size: 17px;
}

.tout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.texttotfacture {
  font-weight: 700;
  font-size: 17px;
  color: var(--text-main);
}
.totfacture {
  font-weight: 800;
  color: var(--danger);
  font-size: 15px;
}

.ayer {
  width: 100%;
  display: flex;
  align-items: center;
}
.payer {
  width: 60%;
  display: flex;
  align-items: center;
  background-color: #5ab7ff;
  border-radius: var(--radius-lg);
  padding: 5px;
  justify-content: center;
}
.ppayer {
  margin: 0;
  font-size: clamp(14px, 1vw, 50px);
}

.dialog {
  position: fixed;
  display: none;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  padding: 10px;
  background: rgba(10, 15, 30, 0.6);
  backdrop-filter: blur(6px);
  inset: 0;
  z-index: 600;
}

.inter {
  position: relative;
  display: flex;
  gap: 16px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(24px, 4vw, 48px);
  border-radius: var(--radius-xl);
  background: white;
  box-shadow: var(--shadow-xl);
  width: clamp(280px, 80vw, 800px);
  margin: auto;
  animation: modalPop 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.inter .close {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 16px;
  transition: background var(--transition);
}
.inter .close:hover {
  background: var(--border);
}
.inter strong {
  white-space: nowrap;
}

.connexion-title,
.inscription-title {
  cursor: pointer;
  background: var(--text-main);
  color: white;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  text-align: center;
  width: 100%;
  transition: background var(--transition);
  font-weight: 600;
  font-size: 14px;
}
.connexion-title:hover,
.inscription-title:hover {
  background: var(--primary);
}
.connexion-title p,
.inscription-title p {
  margin: 0;
}

.connexion,
.inscription {
  max-height: 0;
  overflow: hidden;
  width: 100%;
  transition: max-height 0.45s ease;
}
.connexion.open,
.inscription.open {
  max-height: 400px;
}

/* Form elements */
.form-group {
  display: flex;
  flex-direction: column;
  text-align: center;
  gap: 4px;
  width: 100%;
  padding: 6px 0;
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-main);
  outline: none;
  transition: border-color var(--transition);
}
.form-group input:focus {
  border-color: var(--primary);
}

.btn-primary {
  width: 100%;
  padding: 11px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.04em;
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* ===== FOOTER ===== */
.fin {
  margin-top: clamp(30px, 4vw, 80px);
  width: 100%;
  background: linear-gradient(135deg, #0a1628 0%, #0f2044 100%);
  color: white;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-around;
  padding: clamp(24px, 4vw, 56px) clamp(16px, 5vw, 64px);
  gap: clamp(16px, 3vw, 40px);
  flex-wrap: wrap;
}

.fin div {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-direction: column;
}

.fin strong {
  font-size: clamp(11px, 1.1vw, 15px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  font-weight: 700;
}

.fin .detail {
  gap: clamp(8px, 1.2vw, 20px);
  align-items: flex-start;
}
.fin .detail .num {
  flex-direction: column;
  align-items: flex-start;
}
.fin .detail .numero,
.fin .detail .whatsapp {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
}

.fin .detail p,
.fin .location p {
  margin: 0 0 3px;
  font-size: clamp(10px, 0.9vw, 13px);
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.6;
}

.fin .detail div,
.fin .location div {
  flex-direction: column;
  width: auto;
}

.fin .detail img,
.fin .location img {
  width: clamp(14px, 1.3vw, 20px);
  aspect-ratio: 1/1;
  opacity: 0.85;
  margin-top: 3px;
}

.fin .loc {
  gap: 8px;
  flex-direction: row;
  align-items: flex-start;
  cursor: pointer;
  transition: opacity var(--transition);
}
.fin .loc:hover {
  opacity: 0.8;
}

.fin .imgres {
  flex-direction: row;
  gap: 10px;
}
.fin .imgres img {
  width: clamp(28px, 2.5vw, 38px);
  aspect-ratio: 1/1;
  border-radius: 8px;
  cursor: pointer;
}

.fin .imgpayement {
  flex-direction: row;
  gap: clamp(8px, 1.5vw, 20px);
  align-items: center;
}

.fin .imgpayement div {
  background: white;
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  width: auto;
  flex-direction: row;
}

.fin .imgpayement img {
  width: clamp(36px, 3.5vw, 56px);
  height: auto;
}

/* Footer mobile */
@media (max-width: 640px) {
  .fin {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }
  .fin > div {
    width: 100%;
  }
  .principalheader {
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .barre-de-recherche {
    gap: 6px;
  }
  .information {
    padding: 4px 8px;
  }
}

/* Bannières injectées en JS dans le header (installation PWA, activer
   les notifications) : elles ajoutent leur propre hauteur au-dessus du
   reste — on les compresse aussi sur mobile (voir pwa.js/notifications.js
   pour les styles de base, appliqués en JS). */
@media (max-width: 640px) {
  #mickael-pwa-install {
    padding: calc(7px + env(safe-area-inset-top)) 14px 7px !important;
    font-size: 13px !important;
  }
  #mickael-push-toggle {
    padding: 6px 14px !important;
    font-size: 11.5px !important;
  }
}

/* Valeur contenteditable */
.valeur[contenteditable="true"]:focus {
  outline: none;
}

/* Loading popup */
#loading-popup {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 30, 0.55);
  backdrop-filter: blur(3px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}
#loading-popup > div {
  background: white;
  padding: 20px 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 12px;
}
#loading-popup > div::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 2.5px solid var(--primary);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Alt text fallback */
.alt-text {
  display: none;
  font-size: 100px;
  color: var(--text-light);
}

.phone-text,
.phone-btn,
.phone-input {
  font-size: clamp(10px, 2.5vw, 14px);
}
.phone-input {
  width: clamp(90px, 15vw, 110px);
  padding: 2px;
}
.phone-input[readonly] {
  opacity: 0.7;
}
.phone-btn {
  padding: 2px 5px;
  cursor: pointer;
}

/* Phone Account Form Elements */
#phone_display {
  display: flex;
  gap: 10px;
  align-items: center;
}
.phone-form {
  display: flex;
  gap: 5px;
  margin: 0;
  align-items: center;
  flex-direction: column;
}
#phone_edit_form {
  display: none;
}
.phone-text {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 2px 10px;
  border-radius: 50px;
  font-size: clamp(10px, 2vw, 14px);
  font-weight: 500;
  box-shadow: 0 0 10px rgba(245, 245, 245, 0.5);
  white-space: nowrap;
  cursor: pointer;
}
.phone-text.editable {
  cursor: pointer;
  text-decoration: underline dotted;
}
.phone-btn-off {
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.phone-btn-off:hover {
  background: #b91c1c;
}
.pin-input {
  width: 40px;
  text-align: center;
}
.pin-message-success {
  color: #a7f3d0;
  font-size: 13px;
  margin-top: 3px;
  font-weight: bold;
  text-align: center;
}
.pin-message-error {
  color: #ffcccc;
  font-size: 11px;
  margin-top: 3px;
  font-weight: bold;
  text-align: center;
}
.pin-message-info {
  color: #ffffff;
  font-size: 11px;
  margin-top: 3px;
  text-align: center;
}
.generated-pin {
  color: var(--danger);
  font-size: 13px;
  margin-top: 3px;
  font-weight: bold;
  text-align: center;
}

/* Bonus Badge */
.bonus-badge {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: clamp(10px, 2vw, 14px);
  font-weight: 800;
  box-shadow: 0 0 10px rgba(240, 122, 26, 0.5);
  animation: pulseBonus 2s infinite ease-in-out;
  white-space: nowrap;
  cursor: pointer;
}
@keyframes pulseBonus {
  0% {
    transform: scale(1);
    box-shadow: 0 0 8px rgba(240, 122, 26, 0.4);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 16px rgba(240, 122, 26, 0.8);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 8px rgba(240, 122, 26, 0.4);
  }
}

/* Bonus Modal */
#bonus_modal .connexion-title {
  margin-bottom: 10px;
}
#bonus_modal .bonus-desc {
  font-size: 14px;
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2px;
}
#bonus_modal form {
  width: 100%;
}
#bonus_modal input {
  text-align: center;
}
#bonus_modal .btn-primary {
  margin-top: 10px;
}

/* Bonus History */
.bonus-history {
  width: 100%;
  margin-top: 24px;
}
.bonus-history h4 {
  text-align: center;
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--text-main);
}
.bonus-history table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.bonus-history thead tr {
  font-size: 14px;
  border-bottom: 1.5px solid var(--border);
  background: var(--primary-light);
  color: var(--text-muted);
}
.bonus-history th {
  background: var(--bg);
  font-size: 13px;
}
.bonus-history th,
.bonus-history td {
  text-align: center;
  padding: 8px;
}
.bonus-history th {
  font-weight: 600;
}
.bonus-history tbody tr:nth-child(even) {
  background: var(--bg-history);
}
.bonus-history tbody tr {
  border-bottom: 1px dashed var(--border);
}
.bonus-history td:first-child {
  color: var(--text-main);
}
.bonus-history td:last-child {
  color: var(--danger);
  font-weight: 700;
}
.credit-montant-box.info {
  background: rgba(10, 110, 189, 0.08);
  color: var(--primary-dark);
}

/* Solde Badge (indépendant du bonus) */
.solde-badge {
  background: linear-gradient(135deg, #1a7f4b, #0e5c34);
  color: white;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: clamp(10px, 2vw, 14px);
  font-weight: 800;
  box-shadow: 0 0 10px rgba(26, 127, 75, 0.5);
  white-space: nowrap;
  cursor: pointer;
  margin-left: 6px;
}

/* Solde Modal (réutilise la structure du modal bonus) */
#solde_modal .connexion-title {
  margin-bottom: 10px;
  background: #0e5c34;
}
#solde_modal .connexion-title:hover {
  background: #1a7f4b;
}
#solde_modal .bonus-desc {
  font-size: 14px;
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2px;
}
#solde_modal form {
  width: 100%;
}
#solde_modal input {
  text-align: center;
}
#solde_modal .btn-primary {
  margin-top: 10px;
}
.solde-tabs {
  display: flex;
  width: 100%;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 4px;
}
.solde-tab {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.solde-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.solde-tab-panel {
  width: 100%;
}
.solde-separateur {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  margin: 14px 0;
}
.solde-separateur::before,
.solde-separateur::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--border);
}
.solde-separateur span {
  padding: 0 10px;
}
.bonus-solde-box {
  width: 100%;
  background: linear-gradient(135deg, #fff7ec, #ffedd2);
  border: 1px solid #f0c98a;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.bonus-solde-box-label {
  font-size: 12px;
  color: #8a5a10;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.bonus-solde-box-montant {
  font-size: 28px;
  font-weight: 800;
  color: #b5620c;
  margin: 4px 0 8px;
}
.bonus-solde-box .bonus-desc {
  color: #8a5a10;
}
.bonus-solde-box form {
  margin-top: 6px;
}

/* ===== HISTORIQUE CASINO ===== */
.casino-carte {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: slideInItem 0.3s ease both;
}
.casino-carte-entete {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.casino-carte-produit {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  color: var(--text-main);
  line-height: 1.25;
}
.casino-carte-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap;
}
.casino-carte-badge.gagne {
  background: rgba(26, 158, 92, 0.12);
  color: var(--success-dark);
  border: 1px solid var(--success);
}
.casino-carte-badge.en_cours {
  background: rgba(240, 122, 26, 0.12);
  color: var(--accent-dark);
  border: 1px solid var(--accent);
}
.casino-carte-corps {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.casino-carte-montant {
  font-weight: 800;
  color: var(--danger);
  font-size: 18px;
}
.casino-carte-montant::after {
  content: " Ar";
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}
.casino-carte-detail {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Bannière de parrainage ─────────────────────────────────── */
.parrainage-banner {
    background: linear-gradient(90deg, #084f8c, #0a63b0);
    color: #ffffff;
    text-align: center;
    padding: 12px 16px;
    font-family: 'Open Sans', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
    user-select: none;
}

.parrainage-banner:hover {
    opacity: 0.9;
}

/* ── Popup parrainage ───────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-box {
    background: #ffffff;
    border-radius: 10px;
    padding: 28px 24px;
    max-width: 420px;
    width: 100%;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    font-family: 'Open Sans', sans-serif;
    text-align: center;
}

.modal-box h3 {
    margin: 0 0 12px 0;
    color: #084f8c;
    font-family: 'Lora', serif;
    font-size: 20px;
}

.modal-box p {
    color: #444;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 18px;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    cursor: pointer;
    font-size: 18px;
    color: #888;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #f07a1a;
}

.parrainage-lien-box {
    display: flex;
    align-items: stretch;
    border: 1px solid #ccc;
    border-radius: 6px;
    overflow: hidden;
}

.parrainage-lien-box input {
    flex: 1;
    border: none;
    padding: 10px 12px;
    font-size: 13px;
    color: #333;
    background: #f7f7f7;
    outline: none;
}

.parrainage-lien-box button {
    background: #f07a1a;
    color: #ffffff;
    border: none;
    padding: 0 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.parrainage-lien-box button:hover {
    background: #d9690f;
}

#parrainage_copie_msg {
    display: block;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
}

/* ── Responsive mobile ──────────────────────────────────────── */
@media (max-width: 480px) {
    .parrainage-banner {
        font-size: 13px;
        padding: 10px 12px;
    }

    .modal-box {
        padding: 22px 18px;
    }

    .parrainage-lien-box {
        flex-direction: column;
    }

    .parrainage-lien-box input {
        border-bottom: 1px solid #ccc;
    }

    .parrainage-lien-box button {
        padding: 10px;
    }
}



.historique-tabs {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #e0e0e0;
}
.historique-tab {
  cursor: pointer;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 14px;
  background: #f2f2f2;
  color: #555;
}
.historique-tab.active {
  background: #084f8c;
  color: #fff;
}
.historique-tab-count {
  margin-left: 4px;
  opacity: 0.8;
}

.credit-solde-block-hist {
  margin-top: 12px;
  padding: 14px 16px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #eee;
}

.credit-progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: #f0f0f0;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 12px;
}

.credit-progress-bar {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #ff9800, #ffb74d);
  transition: width 0.4s ease;
}

.feuille-credit.credit-solde .credit-progress-bar {
  background: linear-gradient(90deg, #4caf50, #66bb6a);
}

.credit-montants-row {
  display: flex;
  gap: 10px;
}

.credit-montant-box {
  flex: 1;
  padding: 10px 12px;
  border-radius: 6px;
  text-align: center;
}

.credit-montant-box .label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.75;
  margin-bottom: 4px;
}

.credit-montant-box .valeur {
  display: block;
  font-size: 18px;
  font-weight: 700;
  font-family: var(--mono, monospace);
}

.credit-montant-box.regle {
  background: rgba(76, 175, 80, 0.1);
  color: #2e7d32;
}

.credit-montant-box.restant {
  background: rgba(255, 152, 0, 0.12);
  color: #e65100;
}

.feuille-credit.credit-solde .credit-montant-box.restant {
  background: rgba(76, 175, 80, 0.1);
  color: #2e7d32;
}

.validstatut.credit-attente {
  background: rgba(255, 152, 0, 0.12);
  color: #e65100;
  border: 1px solid rgba(255, 152, 0, 0.3);
}

.feuille-credit.credit-en-cours {
  border-left: 4px solid #ff9800;
  box-shadow: 0 0 0 1px rgba(255, 152, 0, 0.1);
}

.feuille-credit.credit-solde {
  border-left: 4px solid #4caf50;
  box-shadow: 0 0 0 1px rgba(76, 175, 80, 0.1);
}

.credit-montant-box-full {
  flex: 1;
}





.market-switch {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 99;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px;
    background: rgba(10,22,40,.94);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 50px;
    box-shadow: 0 8px 25px rgba(0,0,0,.22),0 2px 8px rgba(0,0,0,.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.market-switch-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 105px;
    height: 38px;
    padding: 0 15px;
    border-radius: 40px;
    color: rgba(255,255,255,.72);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: background .25s ease,color .25s ease,transform .25s ease,box-shadow .25s ease;
}

.market-switch-item:hover {
    color: white;
    background: rgba(255,255,255,.08);
}

.market-switch-item.active {
    color: white;
    background: linear-gradient(135deg,var(--primary),var(--primary-dark));
    box-shadow: 0 4px 12px rgba(10,110,189,.35);
}

.market-switch-icon {
    font-size: 15px;
    line-height: 1;
}

@media (max-width:600px) {
    .market-switch {
        bottom: 18px;
        padding: 4px;
    }

    .market-switch-item {
        min-width: 90px;
        height: 35px;
        padding: 0 12px;
        font-size: 11px;
    }

    .market-switch-icon {
        font-size: 14px;
    }
}


/* ── Transition couleur bleu ↔ orange, interpolation réelle ── */
@property --mp-mix {
  syntax: '<percentage>';
  inherits: true;
  initial-value: 0%;
}

#mpOverlay,
#mp-page-transition {
  position: fixed;
  inset: 0;
  z-index: 999999;
  pointer-events: none;
  --mp-mix: 0%;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, #081522, #2a1204 var(--mp-mix)) 0%,
    color-mix(in srgb, #0f2044, #5c2707 var(--mp-mix)) 55%,
    color-mix(in srgb, #0b4f91, #d8660b var(--mp-mix)) 100%
  );
  opacity: 1;
  transition:
    --mp-mix 0.7s cubic-bezier(.4, 0, .2, 1),
    opacity 0.35s ease;
}

#mpOverlay.no-color-anim,
#mp-page-transition.no-color-anim {
  transition: opacity 0.35s ease;
}

#mpOverlay.transparent,
#mp-page-transition.transparent,
#mpOverlay:not(.visible) {
  opacity: 0;
}
#mpOverlay.visible {
  opacity: 1;
  pointer-events: auto;
}
html.mp-incoming #mpOverlay {
  opacity: 1;
  pointer-events: auto;
}

#mpOverlay.vers-market,
#mp-page-transition.vers-market {
  --mp-mix: 100%;
}
#mpOverlay.vers-ecommerce,
#mp-page-transition.vers-ecommerce {
  --mp-mix: 0%;
}