/* =====================================================================
   CASINO-SLOTS.CSS — Machine à sous "Nuit d'Or" dans le casino Banasino

   Remplace ton style.css : même jeu, même disposition des éléments, mais
   habillé comme le Poker et le Blackjack (panneaux à coins coupés, cadre
   doré, boutons en parallélogramme, police Cinzel).

   Les colonnes (.cg-cols / .cg-col) viennent de css/casino-games.css.
   Tout ce qui est propre à la machine porte le préfixe "sl-".

   Sommaire :
     1. Panneaux (colonnes gauche et droite)
     2. Table des gains
     3. Machine : cadre, enseigne, série
     4. Rouleaux, manette, gain, pièces
     5. Commandes sous la machine (Stop, mise, tirer)
     6. Bilan et historique
     7. Accessibilité
   ===================================================================== */


/* ---------------------------------------------------------------------
   1. PANNEAUX
   Même habillage que les panneaux du Poker et du Blackjack.
   --------------------------------------------------------------------- */
.sl-panel {
  flex: none;
  padding: 10px 14px 12px;
  background: linear-gradient(160deg, rgba(34, 20, 62, .93), rgba(12, 8, 24, .95));
  border: 1px solid rgba(216, 168, 62, .35);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.sl-panel-title {
  margin-bottom: 8px;
  font: 800 14px "Cinzel", serif;
  letter-spacing: 1px;
  color: var(--gold-light, #ffe18a);
}

.sl-panel-grow {
  flex: 1 1 auto;
  min-height: 120px;
  display: flex;
  flex-direction: column;
}

.sl-rules {
  margin: 0;
  padding-left: 16px;
  font-size: .76rem;
  line-height: 1.4;
  color: var(--cream, #f5ead5);
}
.sl-rules li { margin-bottom: 6px; }
.sl-rules b { color: var(--gold-light, #ffe18a); }

.sl-hint { margin: 0 0 8px; font-size: .7rem; color: var(--muted, #b8aabf); }


/* ---------------------------------------------------------------------
   2. TABLE DES GAINS
   Les symboles viennent de tes emotes (ou des emojis par défaut).
   --------------------------------------------------------------------- */
.sl-paytable { width: 100%; border-collapse: collapse; font-size: .76rem; }
.sl-paytable th {
  padding: 3px 4px;
  text-align: left;
  font: 700 12px "Montserrat", sans-serif;
  letter-spacing: 1px;
  color: #b9c8ff;
  border-bottom: 1px solid rgba(216, 168, 62, .3);
}
.sl-paytable th:not(:first-child),
.sl-paytable td.mult { text-align: right; }
.sl-paytable td { padding: 4px; border-bottom: 1px solid rgba(255, 255, 255, .05); color: var(--cream, #f5ead5); }
.sl-paytable td.mult { font-weight: 800; color: var(--gold-light, #ffe18a); font-variant-numeric: tabular-nums; }
.sl-paytable .symbol-cell { display: inline-flex; align-items: center; gap: 8px; }
.sl-paytable .symbol-cell .emoji { font-size: 1.1rem; }
.sl-paytable-icon, .paytable-icon { width: 22px; height: 22px; object-fit: contain; }


/* ---------------------------------------------------------------------
   3. MACHINE : CADRE, ENSEIGNE, SÉRIE
   Le cadre est le même que celui des tapis du Poker et du Blackjack.
   --------------------------------------------------------------------- */
.sl-game-col { position: relative; }

.sl-table {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  padding: 12px 20px;
  overflow: hidden;
  border-radius: 26px;
  border: 3px solid var(--gold, #d8a83e);
  background:
    radial-gradient(ellipse at 50% 38%, rgba(110, 50, 170, .55), rgba(30, 12, 55, .94) 72%),
    linear-gradient(180deg, #2a1050, #12071f);
  box-shadow:
    0 0 0 5px rgba(9, 8, 17, .9),
    0 0 0 7px rgba(216, 168, 62, .55),
    inset 0 0 90px rgba(0, 0, 0, .55),
    0 20px 46px rgba(0, 0, 0, .55);
}

/* Enseigne */
.sl-marquee { text-align: center; }
.sl-marquee small { display: block; font: 700 12px "Montserrat", sans-serif; letter-spacing: 4px; color: #ffb3d6; }
.sl-marquee h2 {
  margin: 0;
  font: 800 30px/1.1 "Cinzel", serif;
  letter-spacing: 6px;
  color: var(--gold-light, #ffe18a);
  text-shadow: 0 0 10px rgba(255, 225, 138, .75), 0 0 26px rgba(255, 90, 160, .55);
}

/* Pastille de série : même place que dans ton jeu, entre l'enseigne et les rouleaux */
.sl-combo-row { min-height: 26px; display: flex; justify-content: center; }
.sl-combo-badge {
  padding: 3px 16px;
  font: 800 12px "Cinzel", serif;
  letter-spacing: 1px;
  color: #2a1a00;
  background: linear-gradient(180deg, #fff1b8, var(--gold, #d8a83e));
  border-radius: 999px;
  box-shadow: 0 0 14px rgba(255, 225, 138, .55);
  animation: sl-pulse 1s ease-in-out infinite;
}
.sl-combo-badge[hidden] { display: none; }
@keyframes sl-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }

.sl-message {
  min-height: 1.4em;
  margin: 0;
  text-align: center;
  font-size: .9rem;
  color: var(--muted, #b8aabf);
  text-shadow: 0 1px 4px #000;
}
.sl-message.win { color: var(--gold-light, #ffe18a); font-weight: 700; }
.sl-message.jackpot { color: #ff6fb0; font-weight: 800; text-shadow: 0 0 12px rgba(255, 90, 160, .7); }


/* ---------------------------------------------------------------------
   4. ROULEAUX, MANETTE, GAIN, PIÈCES
   --------------------------------------------------------------------- */
.sl-machine-window {
  position: relative;
  width: 680px;
  max-width: 100%;
  display: flex;
  gap: 12px;
  padding: 16px 14px;
  overflow: hidden;
  background: #0d0716;
  border: 2px solid var(--gold, #d8a83e);
  border-radius: 16px;
  box-shadow: inset 0 6px 18px rgba(0, 0, 0, .65), 0 0 22px rgba(216, 168, 62, .2);
}

/* Un rouleau : une carte carrée sombre à liseré doré */
.sl-reel {
  flex: 1;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(180deg, #1a0f2c, #0d0716);
  border-radius: 10px;
  border: 1px solid rgba(216, 168, 62, .3);
}
/* Chaque rouleau empile 2 couches .symbol (position absolute, l'une sur l'autre) :
   celle visible et celle qui arrive, parquée juste en dessous (translateY 100%).
   js/casino-slots.js fait glisser les deux ensemble vers le haut à chaque "tic" :
   la visible sort par le haut pendant que celle du dessous prend sa place, ce qui
   donne un vrai défilement façon machine à sous (avant : le symbole était juste
   remplacé d'un coup, sans aucun glissé). Le flou pendant les tics rapides et le
   petit rebond au dernier tic sont ajoutés en JS (voir slideReel()). */
.sl-reel { position: relative; }
.sl-reel .symbol {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  line-height: 1;
  will-change: transform, filter;
}
.sl-reel .symbol img {
  width: 68%;
  height: 68%;
  object-fit: contain;
  display: block;
}

/* Rouleau gagnant : le liseré s'illumine */
.sl-reel.win {
  border-color: var(--gold-light, #ffe18a);
  box-shadow: 0 0 0 2px rgba(255, 225, 138, .4), 0 0 22px rgba(255, 225, 138, .45);
}

/* Manette à droite des rouleaux (cliquable comme le bouton "Tirer la manette") */
.sl-lever-wrap { position: relative; width: 30px; flex-shrink: 0; display: flex; justify-content: center; cursor: pointer; }
.sl-lever-rail { width: 7px; height: 100%; margin: 4px 0; border-radius: 4px; background: linear-gradient(180deg, #8a7aa8, #1d1530); }
.sl-lever-knob {
  position: absolute;
  top: 2px;
  left: 50%;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle at 35% 30%, #ff9aa8, #b3131a);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .6);
  transition: top .22s cubic-bezier(.34, 1.56, .64, 1);
}
.sl-lever-wrap.pulled .sl-lever-knob { top: 68%; }

/* "+gain" qui monte au centre de la vitre */
.sl-win-popup {
  position: absolute;
  left: 50%;
  top: 44%;
  z-index: 3;
  transform: translate(-50%, -50%);
  font: 800 2rem "Cinzel", serif;
  color: var(--gold-light, #ffe18a);
  text-shadow: 0 0 16px rgba(255, 225, 138, .85), 0 2px 4px rgba(0, 0, 0, .8);
  pointer-events: none;
  opacity: 0;
}
.sl-win-popup.jackpot-text { color: #ff6fb0; text-shadow: 0 0 20px rgba(255, 90, 160, .9), 0 2px 4px rgba(0, 0, 0, .8); }
.sl-win-popup.playing { animation: sl-win-rise 1.1s ease-out forwards; }
@keyframes sl-win-rise {
  0%   { opacity: 0; transform: translate(-50%, -30%) scale(.7); }
  20%  { opacity: 1; transform: translate(-50%, -55%) scale(1.1); }
  75%  { opacity: 1; transform: translate(-50%, -70%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -90%) scale(.95); }
}

/* Pluie de pièces */
.sl-coin-layer { position: absolute; inset: 0; z-index: 2; overflow: hidden; pointer-events: none; }
.coin { position: absolute; top: -10%; font-size: 1.3rem; animation: sl-coin-fall linear forwards; }
@keyframes sl-coin-fall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(260%) rotate(360deg); opacity: 0; }
}


/* ---------------------------------------------------------------------
   5. COMMANDES SOUS LA MACHINE
   Même panneau que celui du Poker et du Blackjack (hauteur 150).
   --------------------------------------------------------------------- */
.sl-controls-panel {
  flex: none;
  height: 150px;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  border: 1px solid rgba(216, 168, 62, .35);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  background: linear-gradient(160deg, rgba(34, 20, 62, .93), rgba(12, 8, 24, .95));
}

/* Boutons Stop 1 / 2 / 3 : celui dont c'est le tour s'allume en or */
.sl-stop-row { display: flex; justify-content: center; gap: 12px; }
.sl-stop-btn {
  min-width: 130px;
  padding: 7px 20px;
  border: none;
  clip-path: polygon(9px 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
  font: 800 13px "Cinzel", serif;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--cream, #f5ead5);
  background: linear-gradient(180deg, #4a3a8a, #2a1f58);
  cursor: pointer;
}
.sl-stop-btn:disabled { opacity: .35; cursor: not-allowed; }
.sl-stop-btn.active {
  color: #2a1a00;
  background: linear-gradient(180deg, #fff1b8 0%, var(--gold, #d8a83e) 65%, #a8741f 100%);
  animation: sl-pulse-soft 1s ease-in-out infinite;
}
/* Pulsation plus douce pour les boutons Stop (ils sont proches de la ligne de mise) */
@keyframes sl-pulse-soft { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }

.sl-controls-row { display: flex; align-items: center; justify-content: center; gap: 16px; }

/* Mise : – 10 + */
.sl-bet-control {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px;
  border: 1px solid rgba(216, 168, 62, .5);
  border-radius: 8px;
  background: rgba(0, 0, 0, .35);
}
.sl-bet-control button {
  width: 30px;
  height: 30px;
  font: 800 18px "Cinzel", serif;
  color: var(--gold-light, #ffe18a);
  background: rgba(60, 40, 120, .8);
  border: 1px solid rgba(216, 168, 62, .5);
  border-radius: 6px;
  cursor: pointer;
}
@media (hover: hover) {
  /* Souris uniquement : au doigt il n'y a pas de survol, l'effet resterait "collé" après un appui */
  .sl-bet-control button:hover:not(:disabled) { background: rgba(110, 70, 190, .9); }
}
.sl-bet-control button:disabled { opacity: .35; cursor: not-allowed; }
.sl-bet-display { min-width: 56px; text-align: center; line-height: 1.1; }
.sl-bet-display small { display: block; font: 700 12px "Montserrat", sans-serif; letter-spacing: 1.5px; color: #b9c8ff; }
.sl-bet-display span { font: 800 20px "Cinzel", serif; color: var(--gold-light, #ffe18a); font-variant-numeric: tabular-nums; }

/* Boutons "Mise max" et "Tirer la manette" (mêmes formes que le Poker / Blackjack) */
.sl-btn {
  min-width: 118px;
  padding: 9px 22px;
  border: none;
  clip-path: polygon(9px 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
  font: 800 13px "Cinzel", serif;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--cream, #f5ead5);
  background: linear-gradient(180deg, #4a3a8a, #2a1f58);
  cursor: pointer;
  transition: filter .15s ease, transform .15s ease;
}
@media (hover: hover) {
  /* Souris uniquement : au doigt il n'y a pas de survol, l'effet resterait "collé" après un appui */
  .sl-btn:hover:not(:disabled) { filter: brightness(1.25); transform: translateY(-1px); }
}
.sl-btn:disabled { filter: grayscale(.9) brightness(.55); cursor: not-allowed; transform: none; }
.sl-btn-primary {
  min-width: 190px;
  color: #2a1a00;
  background: linear-gradient(180deg, #fff1b8 0%, var(--gold, #d8a83e) 65%, #a8741f 100%);
}
@media (hover: hover) {
  /* Souris uniquement : au doigt il n'y a pas de survol, l'effet resterait "collé" après un appui */
  .sl-btn-primary:hover:not(:disabled) { filter: brightness(1.15); }
}

.sl-btn:focus-visible,
.sl-stop-btn:focus-visible,
.sl-bet-control button:focus-visible { outline: 2px solid var(--gold-light, #ffe18a); outline-offset: 2px; }


/* ---------------------------------------------------------------------
   6. BILAN ET HISTORIQUE
   --------------------------------------------------------------------- */
.sl-points { text-align: center; font: 800 22px "Cinzel", serif; color: var(--gold-light, #ffe18a); }
.sl-recap { margin-top: 4px; text-align: center; font-size: .78rem; color: var(--muted, #b8aabf); }
.sl-recap b { color: var(--cream, #f5ead5); }

.sl-history {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(216, 168, 62, .5) transparent;
}
.sl-history li {
  padding: 5px 12px;
  font: 700 .8rem "Montserrat", sans-serif;
  color: var(--muted, #b8aabf);
  background: rgba(20, 14, 44, .7);
  border-left: 3px solid #ff8a9a;
}
.sl-history li.is-win { color: #7dffd0; border-left-color: #4fe0a8; }
.sl-history li.is-jackpot { color: #ff6fb0; border-left-color: #ff6fb0; text-shadow: 0 0 8px rgba(255, 90, 160, .6); }
.sl-history .sl-history-empty { border-left-color: transparent; background: none; text-align: center; font-weight: 500; color: #7c7390; }


/* ---------------------------------------------------------------------
   7. ACCESSIBILITÉ
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .sl-combo-badge,
  .sl-stop-btn.active,
  .sl-win-popup.playing { animation: none; }
  .sl-win-popup.playing { opacity: 1; }
  /* Rouleaux : plus de glissé ni de flou, le symbole change directement (voir slideReel() en JS,
     qui lit ce même réglage pour désactiver la transition et le flou). */
  .sl-reel .symbol { transition: none !important; filter: none !important; }
}
