/* BUT IT'S MATH — passe PEAUFINAGE (13/10) : transitions d'écran, états des cartes, fonds animés par section, jus des manches
   (js/juice.js), lisibilité du panneau de probabilité, toasts qui évitent SIGMA, thèmes. Rien ici ne touche à la logique. */

/* ---------- SYSTÈME DE MOUVEMENT (CASINO 3, 13/10) : une seule famille de durées / courbes pour tous les jeux ----------
   transform / opacity uniquement ; --m-out = sortie douce, --m-spring = léger dépassement (rebond), --m-in = entrée accélérée */
:root { --m-fast: .14s; --m-med: .26s; --m-slow: .45s; --m-out: cubic-bezier(.2,.8,.3,1); --m-spring: cubic-bezier(.2,1.5,.4,1); --m-in: cubic-bezier(.5,0,.75,0); }
@media (prefers-reduced-motion: reduce) { :root { --m-fast: 0s; --m-med: 0s; --m-slow: 0s; } }

/* ---------- toasts / badges : ne couvrent plus SIGMA dans son coin (data-sc posé par js/mascot.js) ---------- */
#stage[data-sc="tl"] #toasts { left: 148px; width: 560px; transform: none; }
#stage[data-sc="tr"] #toasts { left: 12px; width: 560px; transform: none; }
#stage[data-sc="tl"] .toast, #stage[data-sc="tr"] .toast { padding: 12px 16px; }

/* ---------- transitions d'écran : fondu + léger glissé (200 ms) ---------- */
@keyframes scrIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
#hub:not(.hidden), #game:not(.hidden), #arcade:not(.hidden), #soundlab:not(.hidden), #beatlab:not(.hidden), #prizes:not(.hidden) { animation: scrIn .2s cubic-bezier(.2,.8,.3,1); }
@media (prefers-reduced-motion: reduce) { #hub, #game, #arcade, #soundlab, #beatlab, #prizes { animation: none !important; } }

/* ---------- hub : cartes (survol, appui, lueur), titre du DAILY sur une ligne ---------- */
.gcard { position: relative; transition: transform .16s cubic-bezier(.2,.9,.3,1.2), box-shadow .2s, border-color .2s, background-color .2s; }
.gcard .gplay { transition: transform .16s, filter .2s; }
@media (hover: hover) {
  button.gcard:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--cyan) 70%, transparent); box-shadow: 0 8px 26px rgba(0,0,0,.42), 0 0 22px color-mix(in srgb, var(--cyan) 22%, transparent); }
  button.gcard:hover .gplay { transform: scale(1.06); filter: brightness(1.1); }
}
button.gcard:active { transform: scale(.975); }
button.gcard:active .gplay { transform: scale(.94); }
button.gcard:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
/* reflet qui traverse la carte au toucher */
.gcard::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.14) 50%, transparent 65%); background-size: 250% 100%; background-position: 130% 0; }
button.gcard:active::after { opacity: 1; background-position: -30% 0; transition: background-position .35s ease-out, opacity .1s; }
.gcard.daily .gtxt b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; font-size: 24px !important; }
.gcard .gtxt { min-width: 0; flex: 1; }

/* badge NEW : seulement pour les jeux récents que le joueur n'a pas encore ouverts (js/juice.js) */
.newbadge { display: inline-block; margin-left: 10px; padding: 3px 8px 2px; border-radius: 6px; font: 900 13px/1 Montserrat; letter-spacing: 1px; color: #1a0e00; background: linear-gradient(#ffe27a, #ffb52e); vertical-align: 4px; box-shadow: 0 0 12px rgba(255,200,60,.55); animation: nbPulse 1.8s ease-in-out infinite; }
@keyframes nbPulse { 50% { box-shadow: 0 0 20px rgba(255,200,60,.9); transform: scale(1.06); } }

/* ---------- hub : fond animé par section (tapis du casino, CRT de l'arcade, onde du studio) ---------- */
.hubscroll .glist { isolation: isolate; }
.hubscroll .glist::before { content: ""; position: absolute; z-index: -1; inset: -12px -34px; border-radius: 22px; pointer-events: none; }
.hubscroll .glist:not(.arlist):not(.stlist)::before { background: radial-gradient(ellipse 70% 40% at 30% 0%, color-mix(in srgb, var(--cyan) 7%, transparent), transparent 70%), radial-gradient(ellipse 60% 50% at 80% 100%, color-mix(in srgb, var(--pink) 6%, transparent), transparent 70%); background-size: 200% 200%, 200% 200%; animation: feltShimmer 14s ease-in-out infinite alternate; }
@keyframes feltShimmer { from { background-position: 0% 0%, 100% 100%; } to { background-position: 100% 60%, 0% 20%; } }
.hubscroll .arlist::before { background: repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 2px, transparent 2px 5px), radial-gradient(ellipse 80% 60% at 50% 50%, color-mix(in srgb, var(--cyan) 6%, transparent), transparent 75%); animation: crtRoll 7s linear infinite; background-size: 100% 5px, 100% 100%; }
@keyframes crtRoll { to { background-position: 0 40px, 0 0; } }
.hubscroll .stlist::before { background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--gold) 10%, transparent), transparent); background-size: 60% 100%; background-repeat: no-repeat; animation: waveSweep 5s ease-in-out infinite alternate; -webkit-mask-image: repeating-linear-gradient(90deg, #000 0 3px, transparent 3px 7px); mask-image: repeating-linear-gradient(90deg, #000 0 3px, transparent 3px 7px); }
@keyframes waveSweep { from { background-position: -20% 0; } to { background-position: 120% 0; } }
/* en-têtes de section : trait lumineux de chaque côté */
.soonlab { display: flex; align-items: center; justify-content: center; gap: 14px; }
.soonlab::before, .soonlab::after { content: ""; flex: 0 1 70px; height: 1px; background: linear-gradient(90deg, transparent, currentColor); opacity: .5; }
.soonlab::after { transform: scaleX(-1); }
@media (prefers-reduced-motion: reduce) { .hubscroll .glist::before { animation: none !important; } }

/* ---------- boutons : appui net, reflet ---------- */
.btn { transition: transform .12s cubic-bezier(.2,.9,.3,1.3), filter .15s, box-shadow .2s; }
@media (hover: hover) { .btn:not([disabled]):hover { filter: brightness(1.08); } }
.btn:not([disabled]):active { filter: brightness(.94); }
.chip:active { transform: scale(.9); }
.round { transition: transform .12s, background-color .2s, border-color .2s; }
.round:active { transform: scale(.9); }

/* ---------- jus des manches (js/juice.js) : lueur des bords + pièces ---------- */
#edgeGlow { position: absolute; inset: 0; z-index: 70; pointer-events: none; opacity: 0; box-shadow: inset 0 0 110px 28px var(--eg, transparent); }
#edgeGlow.on { animation: egl 1.1s ease-out; }
@keyframes egl { 0% { opacity: 0; } 14% { opacity: 1; } 100% { opacity: 0; } }
.coinb { position: absolute; z-index: 72; left: 50%; top: 58%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; pointer-events: none; display: flex; align-items: center; justify-content: center; font: 900 15px/1 Montserrat; color: #7a5206;
  background: radial-gradient(circle at 35% 30%, #fff1b0, #ffcf3d 55%, #b9810a); box-shadow: 0 0 10px rgba(255,207,61,.6), inset 0 -2px 0 rgba(0,0,0,.2); animation: coinFly var(--d, 1.1s) cubic-bezier(.3,.6,.5,1) forwards; }
.coinb::after { content: "Σ"; }
@keyframes coinFly {
  0% { transform: translate(0, 0) scale(.3) rotateY(0); opacity: 0; }
  12% { opacity: 1; }
  45% { transform: translate(var(--dx), var(--dy)) scale(1) rotateY(540deg); }
  100% { transform: translate(calc(var(--dx) * 1.35), calc(var(--dy) + 520px)) scale(.9) rotateY(1080deg); opacity: .9; }
}
@media (prefers-reduced-motion: reduce) { .coinb { display: none; } }

/* ---------- panneau de probabilité : plus lisible ---------- */
#hudR .pct { text-shadow: 0 0 22px currentColor, 0 2px 0 rgba(0,0,0,.55); font-size: 54px; letter-spacing: -.5px; }
#hudR .pctlab { color: var(--ink); text-shadow: 0 1px 6px rgba(0,0,0,.6); font-size: 21px; }
#hudR .tiny { color: color-mix(in srgb, var(--ink) 66%, transparent); font-size: 15px; font-weight: 600; }
#hudR .stat2 { color: color-mix(in srgb, var(--ink) 78%, transparent); font-size: 16px; }
#hudR .stat2 b { color: var(--ink); }
#hudR { padding: 8px 4px 10px; border-radius: 14px; background: linear-gradient(rgba(0,0,0,.28), rgba(0,0,0,.12)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); }
body[data-theme="paper"] #hudR { background: linear-gradient(rgba(255,255,255,.7), rgba(255,255,255,.4)); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
body[data-theme="paper"] #hudR .pct { text-shadow: 0 0 14px rgba(255,255,255,.9); }
body[data-theme="paper"] #hudR .pctlab { text-shadow: none; }
body[data-theme="paper"] .mathsays, body[data-theme="paper"] .mathsays span { color: rgba(30,30,30,.72); }
body[data-theme="paper"] .mathsays b { color: #111; }
body[data-theme="paper"] .mathsays.ok, body[data-theme="paper"] .mathsays.ok b { color: #0d8a3e; }
body[data-theme="paper"] .tiny { color: rgba(30,30,30,.62); }
body[data-theme="paper"] .toast { background: linear-gradient(#fffdf4, #f1ecda); border-color: #b88600; }
body[data-theme="paper"] .ttxt b { color: #1a1a1a; }
body[data-theme="paper"] .ttxt span { color: #8a6300; }
body[data-theme="paper"] .toast.level { background: linear-gradient(#fff4cf, #f4e2a0); }
body[data-theme="paper"] .pbar { background: rgba(255,255,255,.82); border-color: rgba(0,0,0,.18); color: #1a1a1a; }
body[data-theme="paper"] .pxp span, body[data-theme="paper"] .pxp small { color: rgba(30,30,30,.7); }
body[data-theme="paper"] .pchip { background: rgba(0,0,0,.06); }
body[data-theme="paper"] .pxpbar { background: rgba(0,0,0,.1); }
body[data-theme="paper"] .round { background: rgba(255,255,255,.8); color: #1a1a1a; border-color: rgba(0,0,0,.18); }
body[data-theme="paper"] .ptab, body[data-theme="paper"] .shopbox { color: #1a1a1a; }

/* ---------- boutique : titres longs sur deux lignes au lieu de « … » ---------- */
.shhead h3 { white-space: normal; font-size: 28px; line-height: 1.08; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- MONO : le jus reste lisible (bords blancs) ---------- */
body[data-theme="mono"] #edgeGlow { box-shadow: inset 0 0 0 6px var(--eg, transparent); }
