/* ============================================================
   CoinsBase — corrections d'animations
   ============================================================ */
:root { --ease-out: cubic-bezier(.2, .8, .2, 1); --ease-pop: cubic-bezier(.2, 1.4, .4, 1); }

/* Puissance 4 / Morpion : seule la dernière pièce tombe ou apparaît */
.c4 .hole.p1::after, .c4 .hole.p2::after { animation: none; }
.c4 .hole.new::after { animation: drop .42s cubic-bezier(.45, 0, .6, 1.3); }
.ttt .cell span { animation: none; display: inline-block; }
.ttt .cell.new span { animation: pop2 .28s var(--ease-pop); }
.c4 .hole.line::after, .ttt .cell.line { animation: winPulse 1s ease-in-out infinite alternate; }
@keyframes winPulse { to { filter: brightness(1.35); } }

/* Cartes : celles déjà posées ne se redistribuent plus */
.pcard.still { animation: none !important; }
.pcard { will-change: transform; backface-visibility: hidden; }

/* Bulle de résultat : entrée et sortie propres, sans flou coûteux */
.result-pop { backdrop-filter: none; background: var(--panel2); animation: popIn .32s var(--ease-pop) both; }
@keyframes popIn { from { opacity: 0; transform: translate(-50%, -50%) scale(.7); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.result-pop.out { animation: popOut .3s ease-in forwards; }
@keyframes popOut { to { opacity: 0; transform: translate(-50%, -54%) scale(.92); } }

/* Cartes de jeux : survol sans saut, pas de double transformation */
.gimg { transform: translateZ(0); }
.gcard:hover .gimg img { transform: scale(1.05); }
@media (hover: none) { .gcard:hover .gimg, .gcard:hover .gimg img { transform: none; box-shadow: none; } }

/* Roues : rotation fluide sur la carte graphique */
.wheel-wrap canvas { will-change: transform; backface-visibility: hidden; }

/* Tuiles (Mines, Tower) : pas de saut au survol sur mobile */
@media (hover: none) { .tile:hover:not(:disabled) { transform: none; } .keno-grid button:hover { transform: none; } }

/* Pages : un seul fondu court, pas d'empilement */
.page { animation: pageIn .22s var(--ease-out) backwards; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Solde : le petit « +X » ne décale plus la barre du haut */
.bal-delta { z-index: 5; }

/* Toasts : entrée/sortie homogènes */
.toast { animation: toastIn .26s var(--ease-pop) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }

/* Fenêtres : plus de flou derrière (fluidité) */
.modal-back, .celebrate, .tuto-back, .backdrop { backdrop-filter: none !important; }

/* ============================================================
   Pages de jeu : disposition épurée et identique pour tous
   ============================================================ */
.game { --gc: #8b5cf6; grid-template-columns: 300px 1fr; border-radius: 20px; background: var(--panel); min-height: 520px; }
.game-stage { background: radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--gc) 16%, transparent), transparent 65%), var(--bg); }
.game-panel { gap: 14px; padding: 16px; background: var(--panel); }
.quickbar { display: flex; flex-direction: column; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.quickbar .btn.big { position: static !important; box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 22%, transparent); font-size: 15.5px; padding: 15px; }
.quickbar .btn.big.green { box-shadow: 0 8px 22px color-mix(in srgb, var(--win) 25%, transparent); }
.quickbar .btn.big.danger { box-shadow: none; }
.opts { display: flex; flex-direction: column; gap: 12px; }
.opts .stat { background: color-mix(in srgb, var(--bg) 70%, var(--panel)); }
.game-panel label.field { font-size: 11.5px; }
.game-panel .seg { background: var(--bg); }
.game-head { margin-bottom: 12px; }
.game-head h1 { font-size: 20px; }
.game-stage { padding: 22px; }

@media (max-width: 980px) {
  .game { grid-template-columns: 1fr; border-radius: 18px; min-height: 0; }
  .game-stage { order: 1; min-height: 320px; border-radius: 18px 18px 0 0; }
  .game-panel { order: 2; border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
  /* Barre Mise + Jouer collée en bas de l'écran, au-dessus du menu */
  .quickbar { position: fixed; left: 0; right: 0; bottom: calc(58px + env(safe-area-inset-bottom)); z-index: 64; flex-direction: row; align-items: stretch; gap: 8px; padding: 10px 12px; margin: 0; background: var(--panel); border-top: 1px solid var(--border); border-bottom: 0; box-shadow: 0 -10px 30px #0006; }
  .quickbar .qb-bet { flex: 1; min-width: 0; }
  .quickbar .qb-bet > span { display: none; }
  .quickbar .qb-bet .bet-input { height: 100%; }
  .quickbar .qb-bet .bet-input button[data-b="max"] { display: none; }
  .quickbar .btn.big { width: auto; min-width: 128px; flex: none; padding: 12px 16px; font-size: 15px; }
  .quickbar.solo .btn.big { flex: 1; }
  .page:has(.quickbar) { padding-bottom: 86px; }
  .game-panel .btn.big.primary, .game-panel .btn.big.green, .game-panel .btn.big.danger { position: static; }
}
@media (max-width: 380px) { .quickbar .btn.big { min-width: 104px; } .quickbar .qb-bet .bet-input button[data-b="half"] { display: none; } }
@media (max-height: 500px) and (orientation: landscape) { .quickbar { position: static; flex-direction: column; box-shadow: none; padding: 0 0 12px; } }

/* ---------- Bandeau des gros gains ---------- */
.ticker { height: 36px; flex: none; overflow: hidden; position: relative; background: var(--panel); border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent); mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ticker-track { display: flex; gap: 28px; width: max-content; height: 100%; align-items: center; animation: tickerMove 40s linear infinite; padding-left: 20px; }
.ticker.empty .ticker-track { animation: none; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes tickerMove { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tk-item { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; white-space: nowrap; font-weight: 600; }
.tk-item img { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; }
.tk-item svg { width: 14px; height: 14px; color: var(--accent); }
.tk-mult { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); font-weight: 800; padding: 1px 6px; border-radius: 6px; }
html.reduce .ticker-track { animation-duration: 120s !important; }

/* ---------- Jetons de mise rapide ---------- */
.qb-chips { display: flex; gap: 6px; margin-top: 2px; }
.qb-chips button { flex: 1; padding: 6px 0; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--border) 80%, transparent); background: var(--bg); font-weight: 800; font-size: 12px; color: var(--muted); cursor: pointer; transition: color .15s, border-color .15s, transform .1s; }
.qb-chips button:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.qb-chips button:active { transform: scale(.94); }
@media (max-width: 980px) { .quickbar .qb-chips { display: none; } }

/* ---------- Historique des résultats ---------- */
.res-strip { display: flex; gap: 6px; width: 100%; overflow-x: auto; scrollbar-width: none; min-height: 26px; justify-content: center; }
.res-strip::-webkit-scrollbar { display: none; }
.res-strip .pill { flex: none; font-size: 11.5px; padding: 3px 8px; animation: pop2 .25s var(--ease-pop); }
.res-strip .pill.w { color: var(--win); border-color: color-mix(in srgb, var(--win) 35%, transparent); background: color-mix(in srgb, var(--win) 10%, var(--panel2)); }
.res-strip .pill.l { color: var(--muted); }
.res-strip .pill ~ .pill { animation: none; }

/* ---------- Squelettes de chargement & page introuvable ---------- */
.skel { border-radius: 16px; background: linear-gradient(90deg, var(--panel) 0%, color-mix(in srgb, var(--panel2) 90%, var(--text) 4%) 50%, var(--panel) 100%); background-size: 200% 100%; animation: shimmer 1.2s ease-in-out infinite; }
.skel-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 18px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.skel-page { animation: none; }
.notfound { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; }
.notfound img { width: 140px; border-radius: 20px; margin-bottom: 8px; box-shadow: 0 20px 40px #0007; transform: rotate(-6deg); }

/* ---------- Partage du gain ---------- */
.cel-actions { margin-top: 18px; display: flex; justify-content: center; }
.cel-actions .btn { pointer-events: auto; }
