/* Drop (dossier plinko) : machine à billes néon devant une ville de nuit.
   La scène est faite de calques : décor et machine dessinés une fois dans deux canvas, ambiance animée en CSS pur
   (transform et opacity seulement), billes et effets dans un troisième canvas qui ne tourne que pendant le jeu.
   La palette suit le niveau de risque choisi : lagon calme (Low), crépuscule synthwave (Medium), fournaise (High). */
:root {
  --bg: #0b0718; --panel: #15112a; --panel-2: #0f0c20; --panel-3: #0b0918; --border: #2a2347; --border-light: #4a3f7a;
  --muted: #a69fc9; --accent: #e50539; --pink: #ff3aa6; --blue: #2d8cff; --purple: #8a3bff;
  --n1: #ff3ad0; --n2: #b98aff; --n3: #35e0ff;             /* tube néon de la machine : gauche, milieu, droite */
  --neon: #c43bff; --neon-2: #35e0ff; --stage-bg: #140733; --win: #6cf59a; --gold: #ffd45e;
  --rc: #ffc425; --rc-hi: #fff7c2; --rc-lo: #d98500;       /* bille du niveau de risque (chrome doré = moyen) */
  --b0: #d373ff; --b1: #9d38f8; --b2: #5b17ca; --b3: #3d0c9c; --bs: #2a0875; --bg-rgb: 196,59,255; --bd0: #4d3aa8; --bd1: #23166a; --bd2: #0d0632;
  --pg-a: rgba(196,59,255,.22); --pg-b: rgba(53,224,255,.10); --pg-0: #160b3c;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
body[data-risk="low"] {
  --bg: #050d18; --panel: #0e1b2e; --panel-2: #0a1424; --panel-3: #07101d; --border: #1c3350; --border-light: #2f5a80; --muted: #9db8d4;
  --n1: #1ff0c4; --n2: #62d2ff; --n3: #4f8dff; --neon: #22c8e8; --neon-2: #5df2d6; --stage-bg: #06203b;
  --rc: #39d5ff; --rc-hi: #f2fffd; --rc-lo: #0a5fae;
  --b0: #8df4ff; --b1: #1fb6e8; --b2: #0d6fc4; --b3: #0a3f8c; --bs: #062a66; --bg-rgb: 40,190,240; --bd0: #2a6fa8; --bd1: #103a6a; --bd2: #041428;
  --pg-a: rgba(31,240,196,.14); --pg-b: rgba(79,141,255,.14); --pg-0: #081c33;
}
body[data-risk="high"] {
  --bg: #0d0508; --panel: #23101a; --panel-2: #190a12; --panel-3: #12070d; --border: #45202c; --border-light: #7a3a44; --muted: #d4a9ae;
  --n1: #ff2e3e; --n2: #ff7a1a; --n3: #ffc22e; --neon: #ff5a2a; --neon-2: #ffc22e; --stage-bg: #2a0510;
  --rc: #ff3a4e; --rc-hi: #fff3e0; --rc-lo: #a00d2c;
  --b0: #ffb37a; --b1: #ff4d2e; --b2: #c81a1e; --b3: #7a0a16; --bs: #4a0610; --bg-rgb: 255,80,40; --bd0: #a8443a; --bd1: #5a1418; --bd2: #1a0406;
  --pg-a: rgba(255,60,40,.20); --pg-b: rgba(255,170,40,.10); --pg-0: #2a0a10;
}
body {
  font-family: var(--font);
  --page-bg:
    radial-gradient(70% 50% at 12% 0%, var(--pg-a), transparent 70%),
    radial-gradient(60% 50% at 100% 28%, var(--pg-b), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Cpath d='M0 28L28 0l28 28-28 28z' fill='none' stroke='%23ffffff' stroke-opacity='.035'/%3E%3C/svg%3E"),
    linear-gradient(180deg, var(--pg-0) 0%, var(--bg) 62%);
}
.logo { color: #fff; font-style: normal; gap: 6px; letter-spacing: -.3px; }
.logo > span:first-child { background: linear-gradient(180deg, #fff 30%, color-mix(in srgb, var(--n2) 70%, #fff)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
kbd { font: 800 9px/1 var(--font); letter-spacing: .3px; padding: 2px 4px 3px; border-radius: 4px; background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.2); border-bottom-width: 2px; color: #d8d0f8; }

/* ===== disposition ===== */
.pk { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "scene panel" "bottom panel"; gap: 8px; padding: 8px; height: calc(100vh - var(--topbar-h)); height: calc(100dvh - var(--topbar-h)); min-height: 0; }
.pk-scene { grid-area: scene; position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; }
.pk-panel { grid-area: panel; }
.pk-bottom { grid-area: bottom; }

/* ===== historique des multiplicateurs ===== */
.pk-history .history-bar { height: 36px; gap: 8px; padding: 0 5px 0 10px; border-radius: 12px; background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 90%, #fff), var(--panel-2)); border: 1px solid var(--border); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.pk-history .history-chips { gap: 5px; align-items: center; }
.pk-history .history-bar .history-chips { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
.pk-history .hint { font-size: 11.5px; letter-spacing: .2px; white-space: nowrap; }
.pk-history .history-toggle { height: 26px; border-radius: 9px; background: var(--panel-3); border-color: var(--border-light); gap: 4px; }
.pk-history .history-toggle .chev { transition: transform .2s; }
.pk-history .history-expanded { top: 42px; border-radius: 12px; background: var(--panel); border-color: var(--border-light); }
.pk-history .history-expanded-title { font-weight: 800; letter-spacing: 1.2px; color: var(--neon-2); }
/* pastille : même échelle de couleurs que les cases (bleu sous 1x, violet, rose, orange, or dès 100x) */
.pk-chip { --c: #8a3bff; --t: #fff; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 76%, #fff), var(--c) 52%, color-mix(in srgb, var(--c) 82%, #000)); color: var(--t); border-radius: 7px; padding: 2px 8px; font-size: 11.5px; font-weight: 800; letter-spacing: .2px; font-variant-numeric: tabular-nums; box-shadow: inset 0 1px 0 rgba(255,255,255,.42), inset 0 -2px 0 rgba(0,0,0,.2), 0 0 10px color-mix(in srgb, var(--c) 42%, transparent); }
.pk-chip:hover { outline: 1px solid rgba(255,255,255,.6); }
.pk-history .history-bar .pk-chip:first-child { font-size: 12.5px; padding: 3px 10px; animation: pkChipIn .36s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes pkChipIn { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }

/* ===== scène : calques ===== */
.pk-stage { position: relative; flex: 1; min-height: 240px; border-radius: 16px; overflow: hidden; background: var(--stage-bg); border: 1px solid color-mix(in srgb, var(--n2) 34%, #000); box-shadow: 0 10px 30px rgba(0,0,0,.45); isolation: isolate; }
.pk-stage > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#bgCanvas { z-index: 0; }
.pk-amb { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
#boardCanvas { z-index: 2; pointer-events: none; }
#fadeCanvas { z-index: 3; opacity: 0; pointer-events: none; }
#fadeCanvas.out { animation: pkFade .6s ease-out both; }
.pk-bulbs { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
#gameCanvas { z-index: 5; touch-action: manipulation; }
.pk-stage::after { content: ""; position: absolute; inset: 0; z-index: 12; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--n2) 22%, transparent), inset 0 0 50px rgba(4,1,14,.55); }
@keyframes pkFade { from { opacity: 1; } to { opacity: 0; } }

/* --- ambiance (aucun JavaScript : tout tourne en transform / opacity) --- */
.pk-amb > * { position: absolute; }
.pk-halo { border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--n1) 30%, transparent), transparent 62%); animation: pkHalo 6.5s ease-in-out infinite; }
.pk-beam { transform-origin: 50% 100%; transform: translate(-50%, -100%) rotate(var(--a)); opacity: .5; background: linear-gradient(0deg, color-mix(in srgb, var(--n2) 32%, transparent), transparent 80%); -webkit-clip-path: polygon(46% 100%, 54% 100%, 100% 0, 0 0); clip-path: polygon(46% 100%, 54% 100%, 100% 0, 0 0); animation: pkBeam 12s ease-in-out infinite alternate; }
.pk-beam.b1 { background: linear-gradient(0deg, color-mix(in srgb, var(--n1) 26%, transparent), transparent 80%); }
.pk-tw { transform: translate(-50%, -50%); background: radial-gradient(closest-side, #fff, rgba(255,255,255,0)) center / 100% 12% no-repeat, radial-gradient(closest-side, #fff, rgba(255,255,255,0)) center / 12% 100% no-repeat; animation: pkTw 3s ease-in-out infinite; }
.pk-shoot { height: 2px; border-radius: 2px; opacity: 0; transform-origin: 0 50%; background: linear-gradient(90deg, rgba(255,255,255,0), #fff); }
.pk-shoot.s1 { animation: pkShoot 13s linear 4s infinite; }
.pk-shoot.s2 { animation: pkShoot 19s linear 10s infinite; }
.pk-mast { border-radius: 50%; background: #ff4660; box-shadow: 0 0 6px 1px #ff4660; transform: translate(-50%, -50%); animation: pkMast 2.6s linear infinite; }
.pk-sign { --sc: var(--n1); transform: translateX(-50%); padding: .3em .36em; border-radius: .34em; font-weight: 900; line-height: 1.04; text-align: center; color: #fff; text-shadow: 0 0 3px var(--sc), 0 0 9px var(--sc); border: 1px solid color-mix(in srgb, var(--sc) 70%, #fff); background: rgba(0,0,0,.4); box-shadow: 0 0 10px color-mix(in srgb, var(--sc) 60%, transparent), inset 0 0 6px color-mix(in srgb, var(--sc) 40%, transparent); animation: pkSign 7s linear infinite; }
.pk-sign.c1 { --sc: var(--n3); animation-duration: 11s; }
.pk-win { left: 0; width: 100%; animation: pkWin 8s ease-in-out infinite alternate; }
.pk-win.w2 { animation-duration: 13s; animation-delay: -5s; }
.pk-haze { left: 0; right: 0; background: linear-gradient(0deg, color-mix(in srgb, var(--n1) 24%, transparent), transparent); animation: pkHaze 7s ease-in-out infinite alternate; }
.pk-floor { left: 0; right: 0; bottom: 0; overflow: hidden; perspective: 150px; perspective-origin: 50% 0; -webkit-mask-image: linear-gradient(180deg, transparent, #000 60%); mask-image: linear-gradient(180deg, transparent, #000 60%); }
.pk-floor i { position: absolute; left: -70%; right: -70%; top: 0; height: 640px; transform-origin: 50% 0; transform: rotateX(74deg); background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--n1) 60%, transparent) 0 1.5px, transparent 1.5px var(--cell)), repeating-linear-gradient(0deg, color-mix(in srgb, var(--n1) 60%, transparent) 0 1.5px, transparent 1.5px var(--cell)); animation: pkFloor 1.7s linear infinite; }
.pk-ember { display: none; width: 3px; height: 3px; border-radius: 50%; background: #ffc27a; box-shadow: 0 0 6px 1px #ff7a1a; opacity: 0; animation: pkEmber 7s linear infinite; }
body[data-risk="high"] .pk-ember { display: block; }
.pk-aurora { display: none; left: -20%; width: 140%; background: radial-gradient(60% 50% at 30% 50%, rgba(60,255,200,.17), transparent 70%), radial-gradient(50% 60% at 72% 40%, rgba(90,160,255,.15), transparent 70%); animation: pkAurora 19s ease-in-out infinite alternate; }
.pk-aurora.a2 { animation-duration: 27s; animation-direction: alternate-reverse; }
body[data-risk="low"] .pk-aurora { display: block; }
@keyframes pkHalo { 0%, 100% { opacity: .35; transform: scale(.94); } 50% { opacity: .95; transform: scale(1.05); } }
@keyframes pkBeam { from { transform: translate(-50%, -100%) rotate(calc(var(--a) - 9deg)); } to { transform: translate(-50%, -100%) rotate(calc(var(--a) + 9deg)); } }
@keyframes pkTw { 0%, 100% { opacity: .12; transform: translate(-50%, -50%) scale(.55); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } }
@keyframes pkShoot { 0%, 93% { opacity: 0; transform: rotate(157deg) translateX(0); } 94% { opacity: 1; transform: rotate(157deg) translateX(0); } 99% { opacity: .9; } 100% { opacity: 0; transform: rotate(157deg) translateX(42vmin); } }
@keyframes pkMast { 0%, 14% { opacity: 1; } 15%, 100% { opacity: 0; } }
@keyframes pkSign { 0%, 40%, 43%, 46%, 77%, 81%, 100% { opacity: 1; } 41% { opacity: .3; } 44% { opacity: .5; } 78% { opacity: .25; } }
@keyframes pkWin { from { opacity: 0; } to { opacity: 1; } }
@keyframes pkHaze { from { opacity: .25; } to { opacity: .95; } }
@keyframes pkFloor { from { transform: rotateX(74deg) translateY(0); } to { transform: rotateX(74deg) translateY(var(--cell)); } }
@keyframes pkEmber { 0% { opacity: 0; transform: none; } 10% { opacity: .9; } 80% { opacity: .5; } 100% { opacity: 0; transform: translate(var(--w), var(--h)) scale(.4); } }
@keyframes pkAurora { from { transform: translateX(-7%) skewX(-8deg); opacity: .5; } to { transform: translateX(7%) skewX(8deg); opacity: 1; } }
/* ampoules du cadre : trois groupes qui se relaient ; elles clignotent toutes sur un gros gain */
.pk-bulbs i { position: absolute; inset: 0; animation: pkChase 1.8s linear infinite; }
.pk-bulbs .g1 { animation-delay: -.6s; }
.pk-bulbs .g2 { animation-delay: -1.2s; }
.pk-bulbs.party i { animation: pkParty .24s steps(1) infinite; }
.pk-bulbs.party .g1 { animation-delay: -.08s; }
.pk-bulbs.party .g2 { animation-delay: -.16s; }
@keyframes pkChase { 0%, 100% { opacity: 1; } 34%, 66% { opacity: .16; } }
@keyframes pkParty { 0% { opacity: 1; } 50% { opacity: .12; } }

/* --- tension : la lumière monte du côté où une bille dérive réellement --- */
.pk-tense { position: absolute; top: 0; bottom: 0; width: 36%; z-index: 6; opacity: 0; pointer-events: none; transition: opacity .14s linear; }
.pk-tense.l { left: 0; background: radial-gradient(95% 62% at 0% 80%, color-mix(in srgb, var(--n1) 62%, transparent), transparent 70%); }
.pk-tense.r { right: 0; background: radial-gradient(95% 62% at 100% 80%, color-mix(in srgb, var(--n3) 62%, transparent), transparent 70%); }
.pk-stage::before { content: ""; position: absolute; inset: 0; z-index: 6; pointer-events: none; opacity: 0; box-shadow: inset 0 0 110px 34px rgba(0,0,0,.62); }
.pk-stage.pk-slow::before { animation: pkSlow 1.6s ease-out both; }
.pk-stage.pk-hit { animation: pkShake .34s ease-out; }
.pk-stage.pk-jackpot { animation: pkShake2 .7s ease-out; }
@keyframes pkSlow { 0% { opacity: 0; } 18%, 78% { opacity: 1; } 100% { opacity: 0; } }
@keyframes pkShake { 0%, 100% { transform: none; } 20% { transform: translate(-3px, 2px); } 45% { transform: translate(3px, -2px); } 70% { transform: translate(-2px, 1px); } }
@keyframes pkShake2 { 0%, 100% { transform: none; } 10% { transform: translate(-6px, 3px) rotate(-.3deg); } 25% { transform: translate(6px, -4px) rotate(.3deg); } 40% { transform: translate(-5px, 2px); } 55% { transform: translate(4px, -2px); } 75% { transform: translate(-2px, 1px); } }

/* --- afficheur « mise totale » encastré dans le socle (position fournie par le rendu) --- */
.pk-totalbet { position: absolute; z-index: 7; left: 50%; top: var(--pk-disp-y, calc(100% - 20px)); transform: translate(-50%, -50%); max-width: calc(var(--pk-disp-w, 100%) - 40px); display: flex; align-items: center; gap: 5px; white-space: nowrap; padding: 4px 12px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--n3) 40%, transparent); background: linear-gradient(180deg, #04020f, #0c0726); font-size: 11px; font-weight: 800; letter-spacing: .5px; color: #cfc6f5; font-variant-numeric: tabular-nums; pointer-events: none; box-shadow: inset 0 2px 6px rgba(0,0,0,.9), 0 1px 0 rgba(255,255,255,.16); }
.pk-totalbet b { color: var(--n3); text-shadow: 0 0 8px color-mix(in srgb, var(--n3) 60%, transparent); }
.pk-totalbet #tbTotal { color: #fff; text-shadow: 0 0 8px rgba(255,255,255,.45); }
.pk-totalbet .sep, .pk-totalbet .cur { color: var(--muted); font-weight: 700; }
.pk-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; background: radial-gradient(circle at 35% 30%, var(--rc-hi), var(--rc) 50%, var(--rc-lo)); box-shadow: 0 0 6px var(--rc); margin: 0 1px; }

/* --- outils de la scène, bulle d'une case, record --- */
.pk-tools { position: absolute; top: 10px; right: 10px; z-index: 8; display: flex; gap: 6px; }
.pk-tool { position: relative; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #e9e4ff; background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 92%, #fff), var(--panel-3)); border: 1px solid var(--border-light); box-shadow: 0 4px 10px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.12); transition: color .15s, background .15s, box-shadow .15s; }
.pk-tool:hover { color: #fff; border-color: #fff; }
.pk-tool.on { color: #04141a; background: linear-gradient(180deg, color-mix(in srgb, var(--n3) 70%, #fff), var(--n3)); border-color: #fff; box-shadow: 0 0 16px color-mix(in srgb, var(--n3) 60%, transparent), inset 0 1px 0 rgba(255,255,255,.5); }
.pk-tool kbd { position: absolute; right: -5px; bottom: -6px; display: none; }
.pk-tool-bets { display: none; }
.pk-legend { position: absolute; top: 54px; right: 10px; z-index: 8; display: flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 9px; background: rgba(8,5,22,.8); border: 1px solid var(--border-light); font-size: 10px; font-weight: 700; color: #e9e4ff; white-space: nowrap; pointer-events: none; }
.pk-legend i { flex: none; display: block; }
.pk-legend i.t { width: 14px; height: 9px; border-top: 2px solid #fff; background: linear-gradient(180deg, color-mix(in srgb, var(--n2) 60%, transparent), transparent); }
.pk-legend i.m { width: 5px; height: 11px; margin-left: 6px; background: #fff; }
.pk-stage .toasts { top: 10px; left: 10px; right: auto; align-items: flex-start; z-index: 10; }
.pk-stage .toast { border-radius: 12px; border-color: var(--border-light); background: rgba(12,8,30,.92); font-weight: 700; }
.pk-stage .toast.win { border-color: var(--gold); background: linear-gradient(180deg, rgba(64,44,4,.95), rgba(22,15,3,.95)); color: #ffe9a8; }
.pk-stage .toast.win .l, .pk-stage .toast.info .l { padding: 7px 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pk-stage .toast.error { background: rgba(58,11,18,.95); border-color: #ff4d5e; }
.pk-tip { position: absolute; left: 0; top: 0; z-index: 9; min-width: 172px; padding: 9px 11px 7px; border-radius: 12px; background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 96%, #fff), var(--panel-3)); border: 1px solid var(--border-light); box-shadow: 0 12px 28px rgba(0,0,0,.6); pointer-events: none; font-variant-numeric: tabular-nums; }
.pk-tip::after { content: ""; position: absolute; left: var(--ax, 50%); bottom: -6px; width: 10px; height: 10px; margin-left: -5px; transform: rotate(45deg); background: var(--panel-3); border-right: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light); }
.pk-tip .hd { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 5px; }
.pk-tip .hd b { font-size: 21px; line-height: 1; font-weight: 900; text-shadow: 0 0 12px currentColor; }
.pk-tip .hd span { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.pk-tip .rw { display: grid; grid-template-columns: 1fr auto; column-gap: 14px; align-items: baseline; padding: 4px 0 3px; border-top: 1px solid rgba(255,255,255,.08); font-size: 11.5px; }
.pk-tip .rw span { color: var(--muted); }
.pk-tip .rw b { text-align: right; font-weight: 800; color: #fff; }
.pk-tip .rw b.up { color: var(--win); }
.pk-tip .rw b.dn { color: #b9b3d6; }
.pk-tip .rw small { grid-column: 1 / -1; text-align: right; font-size: 10px; line-height: 1.1; color: var(--muted); }
.pk-crown { width: 13px; height: 10px; display: inline-block; background: var(--gold); -webkit-clip-path: polygon(0 100%, 0 12%, 26% 55%, 50% 0, 74% 55%, 100% 12%, 100% 100%); clip-path: polygon(0 100%, 0 12%, 26% 55%, 50% 0, 74% 55%, 100% 12%, 100% 100%); }
.pk-callout { position: absolute; left: 0; top: 0; z-index: 9; pointer-events: none; }
.pk-callout .in { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 9px; border-radius: 99px; white-space: nowrap; background: linear-gradient(180deg, rgba(70,48,4,.97), rgba(22,15,3,.97)); border: 1.5px solid var(--gold); box-shadow: 0 6px 18px rgba(0,0,0,.5), 0 0 18px rgba(255,212,94,.35); }
.pk-callout small { font-size: 9px; font-weight: 900; letter-spacing: 1.3px; color: #ffe9a8; }
.pk-callout b { font-size: 15px; line-height: 1; font-weight: 900; text-shadow: 0 0 10px currentColor; }
.pk-callout.show .in { animation: pkCall 2.6s cubic-bezier(.2, .9, .25, 1) both; }
@keyframes pkCall { 0% { opacity: 0; transform: translateY(10px) scale(.6); } 9% { opacity: 1; transform: scale(1.08); } 15% { transform: none; } 86% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-10px); } }

/* ===== barre solde / gain / session ===== */
.pk-bottom { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 8px; flex: none; }
.pk-pill { --a: var(--n3); position: relative; height: 58px; padding: 0 12px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--a) 26%, var(--border)); background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 88%, #fff), var(--panel-2)); display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; justify-content: center; align-content: center; column-gap: 12px; row-gap: 3px; overflow: hidden; text-align: left; color: inherit; font-family: inherit; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 6px 18px rgba(0,0,0,.35); transition: border-color .25s, box-shadow .25s, background .25s; }
.pk-pill::before { content: ""; grid-row: 1 / 3; align-self: center; width: 34px; height: 34px; border-radius: 11px; border: 1px solid color-mix(in srgb, var(--a) 36%, transparent); background-color: color-mix(in srgb, var(--a) 14%, transparent); }
.pk-pill::after { content: ""; position: absolute; left: 20%; right: 20%; top: 0; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--a), transparent); opacity: .75; }
.pk-pill.bal::before { background: color-mix(in srgb, var(--a) 14%, transparent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7.5A2.5 2.5 0 0 1 5.5 5H17v3M3 7.5V17a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7a2 2 0 0 0-2-2H5.5A2.5 2.5 0 0 1 3 7.5z'/%3E%3Ccircle cx='16.6' cy='13.5' r='1.2' fill='%23ffffff'/%3E%3C/svg%3E") center / 20px 20px no-repeat; }
.pk-pill.win::before { background: color-mix(in srgb, var(--a) 14%, transparent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 4h10v5a5 5 0 0 1-10 0V4zM7 6H4v1a3 3 0 0 0 3 3M17 6h3v1a3 3 0 0 1-3 3M12 14v4M8.5 20h7'/%3E%3C/svg%3E") center / 20px 20px no-repeat; }
.pk-pill.ses::before { background: color-mix(in srgb, var(--a) 14%, transparent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M5 20v-6M10 20V9M15 20v-9M20 20V5'/%3E%3C/svg%3E") center / 20px 20px no-repeat; }
.pk-pill small { grid-column: 2; display: flex; align-items: baseline; gap: 6px; font-size: 10px; line-height: 1; letter-spacing: 1.4px; font-weight: 800; color: var(--a); text-transform: uppercase; white-space: nowrap; }
.pk-pill small em { font-style: normal; letter-spacing: .2px; text-transform: none; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.pk-pill b { grid-column: 2; font-size: 20px; line-height: 1.1; font-weight: 900; color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums; transition: color .2s; }
.pk-pill b .cur { font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: .5px; }
.pk-pill.win { --a: var(--win); }
.pk-pill.win.pos b { color: #fff; }
.pk-pill.win.up { border-color: var(--win); background: linear-gradient(180deg, #17402f, #0f2327); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 6px 18px rgba(0,0,0,.35), 0 0 20px rgba(108,245,154,.25); }
.pk-pill.win.up b { color: var(--win); text-shadow: 0 0 12px rgba(108,245,154,.5); }
.pk-pill.win.up b .cur { color: #a9e8c0; }
.pk-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.06); }
.pk-prog u { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--n1), var(--n3)); transition: transform .18s linear; }
.pk-pill.ses { --a: var(--n2); cursor: pointer; }
.pk-pill.ses:hover { border-color: var(--a); }
.pk-pill.ses.pos b { color: var(--win); }
.pk-pill.ses.neg b { color: #cfc6e6; }

/* ===== panneau de commandes ===== */
.pk-panel { display: flex; flex-direction: column; gap: 8px; min-height: 0; min-width: 0; }
.pk-controls { position: relative; overflow: hidden; flex: none; display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 12px; border-radius: 16px; border: 1px solid var(--border); background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 94%, #fff), var(--panel-2)); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 10px 24px rgba(0,0,0,.3); }
.pk-controls::before { content: ""; position: absolute; left: 14px; right: 14px; top: 0; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--n1), var(--n2), var(--n3)); opacity: .9; box-shadow: 0 0 12px var(--n2); }
.pk-controls h5 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 10.5px; line-height: 1; font-weight: 800; letter-spacing: 1.3px; text-transform: uppercase; color: var(--neon-2); }
.pk-controls h5 span { white-space: nowrap; }
.pk-controls h5::after { content: ""; order: 1; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-light), transparent); }
.pk-controls h5 small { order: 2; font-size: 10px; font-weight: 700; letter-spacing: .3px; text-transform: none; color: var(--muted); font-variant-numeric: tabular-nums; }
.pk-field, .pk-opt { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.pk-opts { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* --- gros bouton d'arcade : collerette à anneau néon, dôme bombé qui s'enfonce, bille qui tombe, libellé --- */
.pk-hero { --hy: 50%; position: relative; display: grid; place-items: center; padding: 26px 0 16px; }   /* marge haute : laisse la place au bandeau « combo » commun */
.pk-hero::before { content: ""; position: absolute; inset: 0 -12px -4px; pointer-events: none; background: radial-gradient(circle at 50% var(--hy), rgba(var(--bg-rgb), .30), rgba(var(--bg-rgb), 0) 58%), repeating-radial-gradient(circle at 50% var(--hy), rgba(var(--bg-rgb), 0) 0 17px, rgba(var(--bg-rgb), .10) 17px 18px); -webkit-mask-image: radial-gradient(circle at 50% var(--hy), #000 36%, transparent 72%); mask-image: radial-gradient(circle at 50% var(--hy), #000 36%, transparent 72%); }
.pk-drop { --d: 134px; position: relative; display: block; flex: none; width: var(--d); height: var(--d); border-radius: 50%; color: #fff; background: radial-gradient(circle at 50% 20%, var(--bd0) 0, var(--bd1) 48%, var(--bd2) 100%); box-shadow: 0 0 0 2px #06021a, 0 0 0 5px rgb(var(--bg-rgb)), 0 0 0 6px rgba(255,255,255,.22), 0 0 26px rgba(var(--bg-rgb), .55), 0 14px 22px rgba(0,0,0,.55), inset 0 2px 1px rgba(255,255,255,.28), inset 0 -10px 18px rgba(0,0,0,.6); transition: box-shadow .2s; -webkit-user-select: none; user-select: none; touch-action: none; outline-offset: calc(var(--d) * .12); }
.pk-drop::before { content: ""; position: absolute; inset: -5px; border-radius: 50%; pointer-events: none; box-shadow: 0 0 30px 6px rgba(var(--bg-rgb), .5); animation: pkGlow 3.2s ease-in-out infinite; }
.pk-drop::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid #fff; opacity: 0; pointer-events: none; }
.pk-drop .cap { position: absolute; inset: calc(var(--d) * .09); border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--d) * .014); background: radial-gradient(circle at 50% 30%, var(--b0) 0, var(--b1) 42%, var(--b2) 78%, var(--b3) 100%); box-shadow: 0 calc(var(--d) * .05) 0 var(--bs), 0 calc(var(--d) * .08) calc(var(--d) * .09) rgba(0,0,0,.65), inset 0 2px 1px rgba(255,255,255,.55), inset 0 calc(var(--d) * -.07) calc(var(--d) * .12) rgba(0,0,0,.42); transform: translateY(calc(var(--d) * -.025)); transition: transform .06s ease-out, box-shadow .06s ease-out; }
.pk-drop .cap::before { content: ""; position: absolute; left: 13%; right: 13%; top: 3.5%; height: 40%; border-radius: 50%; background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,0)); pointer-events: none; }
.pk-drop .cap::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: rgba(255,255,255,.13); opacity: 0; transition: opacity .15s; pointer-events: none; }
.pk-drop .cap > * { position: relative; z-index: 1; }
/* icône : une bille (matière du risque) qui tombe, avec ses traits de vitesse */
.pk-drop .ico { width: calc(var(--d) * .2); height: calc(var(--d) * .25); }
.pk-drop .ico::before { content: ""; position: absolute; left: 50%; top: 0; width: 58%; height: 44%; transform: translateX(-50%); opacity: .9; background: linear-gradient(#fff, #fff) 0 100% / 2px 55% no-repeat, linear-gradient(#fff, #fff) 50% 100% / 2px 100% no-repeat, linear-gradient(#fff, #fff) 100% 100% / 2px 55% no-repeat; -webkit-mask-image: linear-gradient(180deg, transparent, #000); mask-image: linear-gradient(180deg, transparent, #000); }
.pk-drop .ico i { position: absolute; left: 50%; bottom: 0; width: 54%; aspect-ratio: 1; margin-left: -27%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0, var(--rc-hi) 14%, var(--rc) 52%, var(--rc-lo) 100%); box-shadow: 0 0 calc(var(--d) * .06) var(--rc), inset 0 0 0 1px rgba(30,0,60,.35); animation: pkBob 1.9s ease-in-out infinite; }
.pk-drop .ico i + i { opacity: 0; animation: none; }
.pk-drop .lbl { font-size: calc(var(--d) * .175); line-height: 1; font-weight: 900; letter-spacing: .06em; text-shadow: 0 2px 0 rgba(0,0,0,.45), 0 0 14px rgba(255,255,255,.35); }
html[lang="fr"] .pk-drop .lbl { font-size: calc(var(--d) * .14); letter-spacing: .03em; }
.pk-drop .sub { max-width: 82%; font-size: max(8px, calc(var(--d) * .06)); line-height: 1.15; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; text-align: center; color: rgba(255,255,255,.88); text-shadow: 0 1px 0 rgba(0,0,0,.4); }
.pk-drop .s-held, .pk-drop .s-poor { display: none; }
.pk-key-space { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); display: none; }
.pk-key-space kbd { padding: 2px 9px 3px; letter-spacing: 1.4px; text-transform: uppercase; }
/* anneau de progression : visible pendant le maintien, un tour = délai avant la série suivante */
.pk-drop-ring { position: absolute; left: calc(var(--d) * -.1); top: calc(var(--d) * -.1); width: calc(var(--d) * 1.2); height: calc(var(--d) * 1.2); transform: rotate(-90deg); pointer-events: none; opacity: 0; transition: opacity .2s; overflow: visible; }
.pk-drop-ring circle { fill: none; }
.pk-drop-ring .trk { stroke: color-mix(in srgb, var(--n3) 24%, transparent); stroke-width: 3; }
.pk-drop-ring .prg { stroke: var(--n3); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.pk-drop:hover { box-shadow: 0 0 0 2px #06021a, 0 0 0 5px color-mix(in srgb, rgb(var(--bg-rgb)) 70%, #fff), 0 0 0 6px rgba(255,255,255,.3), 0 0 36px rgba(var(--bg-rgb), .8), 0 14px 22px rgba(0,0,0,.55), inset 0 2px 1px rgba(255,255,255,.28), inset 0 -10px 18px rgba(0,0,0,.6); }
.pk-drop:hover .cap::after { opacity: 1; }
.pk-drop:active .cap, .pk-drop.held .cap { transform: translateY(calc(var(--d) * .02)); box-shadow: 0 calc(var(--d) * .008) 0 var(--bs), 0 calc(var(--d) * .02) calc(var(--d) * .04) rgba(0,0,0,.6), inset 0 2px 1px rgba(255,255,255,.4), inset 0 calc(var(--d) * -.04) calc(var(--d) * .1) rgba(0,0,0,.5); }
.pk-drop:focus-visible { outline: 2px solid var(--n3); }
.pk-drop.held { box-shadow: 0 0 0 2px #06021a, 0 0 0 5px #fff, 0 0 0 6px rgba(255,255,255,.3), 0 0 40px rgba(var(--bg-rgb), .9), 0 14px 22px rgba(0,0,0,.55), inset 0 2px 1px rgba(255,255,255,.28), inset 0 -10px 18px rgba(0,0,0,.6); }
.pk-drop.held .pk-drop-ring { opacity: 1; }
.pk-drop.held.cyc-a .prg { animation: pkRingA var(--hold-ms, .6s) linear both; }
.pk-drop.held.cyc-b .prg { animation: pkRingB var(--hold-ms, .6s) linear both; }
.pk-drop.held .ico::before { opacity: .45; }
.pk-drop.held .ico i, .pk-drop.held .ico i + i { opacity: 1; animation: pkStream .6s linear infinite; }
.pk-drop.held .ico i:nth-child(2) { animation-delay: -.2s; }
.pk-drop.held .ico i:nth-child(3) { animation-delay: -.4s; }
.pk-drop.held .s-idle { display: none; }
.pk-drop.held .s-held { display: block; padding: 1px 8px; border-radius: 99px; color: #062a33; background: #fff; text-shadow: none; box-shadow: 0 0 10px rgba(255,255,255,.7); }
.pk-drop.pop::after { animation: pkRipple .5s ease-out; }
.pk-drop.pop:not(.held) .cap { animation: pkPress .3s ease-out; }
.pk-drop.nope { animation: pkNope .3s ease-out; }
/* solde insuffisant : bouton éteint et message explicite */
.pk-drop.poor { cursor: not-allowed; background: radial-gradient(circle at 50% 20%, #3c385a 0, #24213d 48%, #100e22 100%); box-shadow: 0 0 0 2px #06021a, 0 0 0 5px #3c3660, 0 14px 22px rgba(0,0,0,.55), inset 0 2px 1px rgba(255,255,255,.16), inset 0 -10px 18px rgba(0,0,0,.6); }
.pk-drop.poor::before { display: none; }
.pk-drop.poor .cap { background: radial-gradient(circle at 50% 30%, #77739a 0, #524d78 42%, #35314f 78%, #24213a 100%); box-shadow: 0 calc(var(--d) * .05) 0 #17152a, 0 calc(var(--d) * .08) calc(var(--d) * .09) rgba(0,0,0,.65), inset 0 2px 1px rgba(255,255,255,.3), inset 0 calc(var(--d) * -.07) calc(var(--d) * .12) rgba(10,8,30,.6); }
.pk-drop.poor .cap::before { opacity: .45; }
.pk-drop.poor .cap::after { display: none; }
.pk-drop.poor .ico { display: none; }
.pk-drop.poor .lbl { color: rgba(255,255,255,.5); text-shadow: 0 2px 0 rgba(10,8,30,.6); }
.pk-drop.poor .s-idle, .pk-drop.poor .s-held { display: none; }
.pk-drop.poor .s-poor { display: block; padding: 0; background: none; box-shadow: none; color: #ffb3c0; }
@keyframes pkGlow { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@keyframes pkBob { 0%, 100% { transform: translateY(-34%); } 55% { transform: none; } }
@keyframes pkStream { 0% { transform: translateY(-250%) scale(.7); opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(45%) scale(.7); opacity: 0; } }
@keyframes pkRingA { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes pkRingB { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes pkRipple { from { opacity: .85; transform: none; } to { opacity: 0; transform: scale(1.2); } }
@keyframes pkPress { 0% { transform: translateY(calc(var(--d) * .02)); } 55% { transform: translateY(calc(var(--d) * -.04)); } 100% { transform: translateY(calc(var(--d) * -.025)); } }
@keyframes pkNope { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 55% { transform: translateX(5px); } 80% { transform: translateX(-3px); } }

/* --- mise par bille --- */
.pk-bet { display: grid; grid-template-columns: 46px 1fr 46px; gap: 8px; width: 100%; align-items: center; }
.pk-step { height: 44px; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(180deg, color-mix(in srgb, var(--border-light) 80%, #fff 6%), var(--border)); border: 1px solid var(--border-light); color: #fff; box-shadow: 0 3px 0 rgba(0,0,0,.55), 0 6px 12px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.2); transition: transform .07s, box-shadow .07s, filter .15s; }
.pk-step:hover { filter: brightness(1.2); }
.pk-step:active, .pk-step.kb { transform: translateY(3px); box-shadow: 0 0 0 rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.12); }
.pk-step.kb { animation: pkKb .16s ease-out; }
@keyframes pkKb { from { transform: translateY(3px); } to { transform: none; } }
.pk-bet-val { height: 44px; border-radius: 13px; background: #05030f; border: 1px solid var(--border-light); display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 12px; box-shadow: inset 0 3px 8px rgba(0,0,0,.85), 0 1px 0 rgba(255,255,255,.06); transition: border-color .15s, box-shadow .15s; }
.pk-bet-val:focus-within { border-color: var(--n3); box-shadow: inset 0 3px 8px rgba(0,0,0,.85), 0 0 0 3px color-mix(in srgb, var(--n3) 22%, transparent); }
.pk-bet-val input { width: 100%; min-width: 0; background: transparent; border: 0; outline: none; color: #fff; font-weight: 900; font-size: 22px; letter-spacing: .3px; text-align: center; font-variant-numeric: tabular-nums; }
.pk-bet-val small { color: var(--neon-2); font-size: 10px; font-weight: 800; letter-spacing: .8px; opacity: .85; }
.pk-ops, .pk-quick { display: grid; gap: 5px; width: 100%; }
.pk-ops { grid-template-columns: 1fr 1fr 1fr 1.5fr; }
.pk-quick { grid-template-columns: repeat(6, 1fr); }
.pk-ops button, .pk-quick button { height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; background: var(--panel-3); border: 1px solid var(--border); color: var(--muted); font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; transition: color .12s, border-color .12s, background .12s, transform .07s; }
.pk-ops button { color: #e9e4ff; border-color: var(--border-light); background: linear-gradient(180deg, color-mix(in srgb, var(--border) 80%, #fff 5%), var(--panel-3)); }
.pk-ops button:hover:not(:disabled), .pk-quick button:hover { color: #fff; border-color: color-mix(in srgb, var(--n3) 60%, var(--border-light)); }
.pk-ops button:active:not(:disabled), .pk-quick button:active { transform: translateY(1px); }
.pk-ops button:disabled { opacity: .38; }
.pk-quick button.active { color: #fff; background: color-mix(in srgb, var(--n3) 16%, transparent); border-color: color-mix(in srgb, var(--n3) 70%, transparent); box-shadow: 0 0 10px color-mix(in srgb, var(--n3) 22%, transparent); }

/* --- nombre de billes par lâcher --- */
.pk-amount { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pk-amt-btn { position: relative; height: 38px; border-radius: 11px; border: 1px solid var(--border); background: var(--panel-3); color: var(--muted); font-size: 15px; font-weight: 900; font-variant-numeric: tabular-nums; display: flex; align-items: center; justify-content: center; gap: 6px; transition: color .12s, border-color .12s, background .12s, box-shadow .12s; }
.pk-amt-btn::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; opacity: .5; background: radial-gradient(circle at 35% 30%, var(--rc-hi), var(--rc) 50%, var(--rc-lo)); }
.pk-amt-btn:hover { color: #fff; border-color: var(--border-light); }
.pk-amt-btn.active { color: #fff; border-color: rgb(var(--bg-rgb)); background: linear-gradient(180deg, rgba(var(--bg-rgb), .4), rgba(var(--bg-rgb), .12)); box-shadow: 0 0 14px rgba(var(--bg-rgb), .35), inset 0 1px 0 rgba(255,255,255,.2); }
.pk-amt-btn.active::before { opacity: 1; box-shadow: 0 0 6px var(--rc); }
.pk-amt-btn kbd, .pk-risk-btn kbd { position: absolute; right: 3px; top: 3px; display: none; opacity: .75; }

/* --- niveau de risque : bille du niveau, bande aux couleurs des 17 cases, multiplicateur maximal --- */
.pk-risk { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.pk-risk-btn { --c: #ffc425; --hi: #fff7c2; --lo: #d98500; position: relative; min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "ball name" "strip strip" "max max"; align-items: center; column-gap: 6px; row-gap: 6px; padding: 8px 8px 7px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel-3); color: var(--muted); text-align: left; transition: color .12s, border-color .12s, background .12s, box-shadow .12s, opacity .2s; }
.pk-risk-btn.low { --c: #39d5ff; --hi: #f2fffd; --lo: #0a5fae; }
.pk-risk-btn.high { --c: #ff3a4e; --hi: #fff3e0; --lo: #a00d2c; }
.pk-risk-btn i { grid-area: ball; width: 13px; height: 13px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--hi), var(--c) 50%, var(--lo)); box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.pk-risk-btn span { grid-area: name; font-size: 11.5px; line-height: 1.3; font-weight: 900; letter-spacing: .5px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-risk-btn em { grid-area: strip; height: 7px; border-radius: 4px; opacity: .8; box-shadow: inset 0 0 0 1px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.3); }
.pk-risk-btn small { grid-area: max; display: flex; align-items: baseline; justify-content: space-between; font-size: 9.5px; line-height: 1; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.pk-risk-btn small b { font-size: 12px; font-weight: 900; letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; }
.pk-risk-btn:hover { color: #fff; border-color: var(--border-light); }
.pk-risk-btn.active { color: #fff; border-color: var(--c); background: linear-gradient(180deg, color-mix(in srgb, var(--c) 24%, var(--panel-3)), color-mix(in srgb, var(--c) 7%, var(--panel-3))); box-shadow: 0 0 14px color-mix(in srgb, var(--c) 34%, transparent), inset 0 1px 0 rgba(255,255,255,.16); }
.pk-risk-btn.active i { box-shadow: 0 0 8px var(--c), inset 0 0 0 1px rgba(0,0,0,.25); }
.pk-risk-btn.active em { opacity: 1; }
.pk-risk.locked .pk-risk-btn:not(.active) { opacity: .42; cursor: not-allowed; }
.pk-risk.nope { animation: pkNope .3s ease-out; }
#riskNote { color: var(--gold); }

/* ===== listes : mes mises / top gains / session ===== */
.pk-lists { flex: 1; min-height: 120px; display: flex; flex-direction: column; overflow: hidden; border-radius: 16px; border: 1px solid var(--border); background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 96%, #fff), var(--panel-2)); box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
.pk-lists-head { display: flex; align-items: center; gap: 6px; margin: 8px 8px 6px; }
.pk-lists .tabs { flex: 1; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 3px; width: auto; padding: 3px; border-radius: 12px; background: var(--panel-3); border: 1px solid var(--border); }
.pk-lists .tab { padding: 7px 0; border-radius: 9px; font-size: 11px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; color: var(--muted); white-space: nowrap; transition: color .15s, background .15s; }
.pk-lists .tab:hover { color: #fff; }
.pk-lists .tab.active { color: #fff; background: linear-gradient(180deg, color-mix(in srgb, rgb(var(--bg-rgb)) 80%, #fff 8%), color-mix(in srgb, rgb(var(--bg-rgb)) 62%, #000)); box-shadow: 0 2px 10px rgba(var(--bg-rgb), .4), inset 0 1px 0 rgba(255,255,255,.25); }
.pk-lists-close { display: none; }
.pk-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 8px; scrollbar-width: thin; scrollbar-color: var(--border-light) transparent; }
.pk-row { display: grid; grid-template-columns: 50px minmax(0, 1fr) 64px 70px; align-items: center; gap: 4px; width: 100%; min-height: 32px; padding: 3px 8px; margin-bottom: 3px; border-radius: 9px; border: 1px solid transparent; background: rgba(255,255,255,.03); color: inherit; font-family: inherit; font-size: 12px; text-align: left; font-variant-numeric: tabular-nums; }
button.pk-row { cursor: pointer; transition: border-color .12s, background .12s; }
button.pk-row:hover { border-color: var(--border-light); background: rgba(255,255,255,.07); }
.pk-row.head { position: sticky; top: 0; z-index: 1; min-height: 24px; margin: 0 -8px 5px; padding: 0 17px; width: auto; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: var(--panel); color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; }
.pk-row .d { color: var(--muted); }
.pk-row .r { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.pk-row .m { text-align: left; }
.pk-row .m .chip { font-size: 10.5px; padding: 1px 7px; cursor: inherit; box-shadow: inset 0 1px 0 rgba(255,255,255,.42), inset 0 -2px 0 rgba(0,0,0,.2); }
.pk-row .w { text-align: right; font-weight: 800; color: var(--muted); }
.pk-row.won { background: linear-gradient(90deg, rgba(108,245,154,.11), rgba(108,245,154,.02)); box-shadow: inset 2px 0 0 var(--win); }
.pk-row.won .w { color: var(--win); }
.pk-row.top { grid-template-columns: minmax(0, 1fr) 60px 56px 70px; min-height: 40px; }
.pk-row.top.me { border-color: #7a6400; background: linear-gradient(90deg, rgba(255,212,94,.16), rgba(255,212,94,.04)); }
.pk-row .u { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pk-row .u img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 1px var(--border-light); }
.pk-row .u > span { display: flex; flex-direction: column; min-width: 0; }
.pk-row .u b { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-row .u small { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-row.top .w { color: var(--win); }
#listTop { counter-reset: pkrank; }
.pk-row.top:not(.head) { counter-increment: pkrank; }
.pk-row.top:not(.head) .u::before { content: counter(pkrank); flex: none; width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center; font-size: 10px; font-weight: 900; color: var(--muted); background: rgba(255,255,255,.07); }
.pk-row.top:nth-child(2) .u::before { color: #2a1a00; background: linear-gradient(180deg, #ffe58a, #e0a100); }
.pk-row.top:nth-child(3) .u::before { color: #1c2230; background: linear-gradient(180deg, #eef2f8, #9aa6b8); }
.pk-row.top:nth-child(4) .u::before { color: #2a1200; background: linear-gradient(180deg, #f0b07a, #b0672a); }
.pk-rdot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.pk-row.head span:last-child, .pk-row.head .w { text-align: right; }
.pk-list .empty { padding: 26px 10px; font-size: 12px; }
.pk-list .empty::before { content: ""; display: block; width: 30px; height: 30px; margin: 0 auto 10px; border-radius: 50%; border: 2px dashed var(--border-light); opacity: .8; }
.pk-sheet-back { position: fixed; inset: 0; z-index: 45; background: rgba(0,0,0,.55); }

/* --- session et carte de chaleur --- */
.pk-sess { padding-top: 4px; }
@media (min-width: 1001px) { .pk-sess .pk-stats .stat:nth-child(n+4), .pk-sess > .hint { display: none; } }
.pk-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin-bottom: 10px; }
.pk-stats .stat { padding: 7px 8px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-3); min-width: 0; }
.pk-stats .stat .k { display: flex; align-items: center; gap: 5px; font-size: 9.5px; letter-spacing: .3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-stats .stat .v { display: flex; align-items: center; gap: 6px; min-height: 20px; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pk-stats .stat .v small { font-size: 10.5px; font-weight: 700; color: var(--muted); }
.pk-stats .stat .v.pos { color: var(--win); }
.pk-stats .stat .v.neg { color: #cfc6e6; }
.pk-heat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 0 6px; }
.pk-heat-head b { font-size: 11px; letter-spacing: .6px; text-transform: uppercase; color: #fff; }
.pk-seg { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--panel-3); border: 1px solid var(--border); }
.pk-seg button { padding: 3px 8px; border-radius: 6px; font-size: 10px; font-weight: 800; letter-spacing: .3px; color: var(--muted); }
.pk-seg button.on { color: #fff; background: var(--border-light); }
.pk-heat { display: grid; grid-template-columns: repeat(17, minmax(0, 1fr)); gap: 2px; padding: 8px 6px 6px; border-radius: 12px; border: 1px solid var(--border); background: linear-gradient(180deg, #05030f, var(--panel-3)); }
.pk-heat .col { --c: #8a3bff; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.pk-heat .col em { height: 10px; font-style: normal; font-size: 8px; line-height: 10px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.pk-heat .bar { position: relative; width: 100%; height: 62px; border-radius: 3px 3px 0 0; background: rgba(255,255,255,.04); overflow: hidden; }
.pk-heat .bar i { position: absolute; inset: 0; transform-origin: 50% 100%; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 70%, #fff), var(--c)); transition: transform .25s ease-out; }
.pk-heat .bar u { position: absolute; left: 0; right: 0; height: 2px; margin-bottom: -1px; background: #fff; box-shadow: 0 0 4px rgba(255,255,255,.8); }
.pk-heat .col b { width: 100%; padding: 2px 0; border-radius: 3px; text-align: center; font-size: 7.5px; line-height: 1; font-weight: 900; letter-spacing: -.3px; color: #fff; background: var(--c); overflow: hidden; }
.pk-heat-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 7px; font-size: 11px; color: var(--muted); }
.pk-heat-foot > span { display: inline-flex; align-items: center; gap: 6px; }
.pk-sess .hint { margin: 6px 0 0; }

/* ===== fenêtres ===== */
.modal { border-color: var(--border-light); }
.modal-head { background: linear-gradient(180deg, var(--border-light), var(--border)); }
.modal-body h4.first { margin-top: 0; }
.pk-tables { display: flex; flex-direction: column; gap: 8px; }
.pk-table b { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #fff; margin-bottom: 4px; }
.pk-cells { display: grid; grid-template-columns: repeat(17, minmax(0, 1fr)); gap: 2px; }
.pk-cells span { --c: #8a3bff; --t: #fff; background: var(--c); color: var(--t); font-size: 9.5px; line-height: 1; font-weight: 800; letter-spacing: -.2px; padding: 4px 0; border-radius: 4px; text-align: center; white-space: nowrap; overflow: hidden; box-shadow: inset 0 1px 0 rgba(255,255,255,.35); }
.pk-cells.prob span { background: var(--panel-3); color: #d8d0f8; border: 1px solid var(--border); box-shadow: none; font-weight: 700; font-size: 8.5px; }
.pk-scroll { overflow-x: auto; }
.modal-body .fair-input { flex-wrap: wrap; }
.modal-body .fair-input input { min-width: 150px; }
.modal-body .fair-input .btn, .modal-body .profile-actions .btn { white-space: nowrap; }
.pk-fair td, .pk-fair th { white-space: nowrap; }
.pk-fair .mono, .mono { font-family: ui-monospace, Menlo, monospace; font-size: 11px; }
.mybets-table td.win { font-weight: 700; }
.mybets-table td .pk-rdot { margin-right: 5px; }
.mybets-table .btn.small { padding: 3px 8px; }
/* tutoriel : trois vignettes animées */
.pk-how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pk-how-step { position: relative; padding: 10px 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel-2); text-align: center; }
.pk-how-step small { position: absolute; left: 8px; top: 8px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 900; color: #06131a; background: var(--n3); }
.pk-how-step b { display: block; margin: 8px 0 3px; color: #fff; font-size: 13px; }
.pk-how-step span { font-size: 11.5px; line-height: 1.35; color: var(--muted); }
.pk-how-art { position: relative; height: 84px; border-radius: 10px; overflow: hidden; background: radial-gradient(80% 90% at 50% 100%, color-mix(in srgb, var(--n1) 24%, transparent), transparent 70%), linear-gradient(180deg, #0a0620, #05030f); }
.pk-how-art.a1 { display: flex; align-items: center; justify-content: center; gap: 7px; }
.pk-how-art.a1 b { margin: 0; min-width: 62px; padding: 6px 0; border-radius: 8px; background: #000; border: 1px solid var(--border-light); font-size: 17px; font-weight: 900; }
.pk-how-art .k { width: 24px; height: 24px; border-radius: 7px; background: var(--border-light); box-shadow: 0 2px 0 rgba(0,0,0,.6); position: relative; }
.pk-how-art .k::before, .pk-how-art .k.plus::after { content: ""; position: absolute; left: 6px; right: 6px; top: 11px; height: 2.5px; border-radius: 2px; background: #fff; }
.pk-how-art .k.plus::after { transform: rotate(90deg); }
.pk-how-art .k.plus { animation: pkHowTap 2.4s ease-in-out infinite; }
.pk-how-art .dots { position: absolute; left: 0; right: 0; bottom: 9px; display: flex; justify-content: center; gap: 5px; }
.pk-how-art .dots u { width: 8px; height: 8px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--rc-hi), var(--rc) 55%, var(--rc-lo)); animation: pkHowDot 2.4s ease-in-out infinite; }
.pk-how-art .dots u:nth-child(2) { animation-delay: .15s; }
.pk-how-art .dots u:nth-child(3) { animation-delay: .3s; }
.pk-how-art.a2 .btn { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; padding: 0; border-radius: 50%; background: radial-gradient(circle at 50% 30%, var(--b0), var(--b1) 45%, var(--b3)); box-shadow: 0 4px 0 var(--bs), 0 0 0 3px rgb(var(--bg-rgb)); animation: pkHowPress 2.2s ease-in-out infinite; }
.pk-how-art.a2 .ring { position: absolute; left: 50%; top: 50%; width: 62px; height: 62px; margin: -31px 0 0 -31px; border-radius: 50%; border: 2px solid var(--n3); animation: pkHowRing 2.2s ease-out infinite; }
.pk-how-art.a2 u { position: absolute; left: 16%; top: -10px; width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--rc-hi), var(--rc) 55%, var(--rc-lo)); animation: pkHowFall 2.2s linear infinite; }
.pk-how-art.a2 u.b2 { left: 80%; animation-delay: .25s; }
.pk-how-art.a2 u.b3 { left: 88%; animation-delay: .5s; }
.pk-how-art.a3 .pg { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #d6caff; box-shadow: 0 0 5px var(--n2); }
.pk-how-art.a3 .p1 { left: 44%; top: 14px; } .pk-how-art.a3 .p2 { left: 36%; top: 34px; } .pk-how-art.a3 .p3 { left: 52%; top: 34px; }
.pk-how-art.a3 .ball { position: absolute; left: 44%; top: -8px; width: 10px; height: 10px; margin-left: -2px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--rc-hi), var(--rc) 55%, var(--rc-lo)); animation: pkHowBall 2.6s linear infinite; }
.pk-how-art.a3 .sl { position: absolute; left: 12%; right: 12%; bottom: 8px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.pk-how-art.a3 .sl i { height: 14px; border-radius: 4px; background: #6c54ff; }
.pk-how-art.a3 .sl i:first-child, .pk-how-art.a3 .sl i:last-child { background: #ff7030; }
.pk-how-art.a3 .sl i.hit { background: #f03abe; animation: pkHowHit 2.6s linear infinite; }
.pk-how-art.a3 em { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); font-style: normal; font-size: 12px; font-weight: 900; color: #ffe36b; text-shadow: 0 1px 3px #000; opacity: 0; animation: pkHowWin 2.6s linear infinite; }
@keyframes pkHowTap { 0%, 60%, 100% { transform: none; } 70% { transform: translateY(2px) scale(.94); } }
@keyframes pkHowDot { 0%, 100% { opacity: .35; transform: none; } 50% { opacity: 1; transform: translateY(-3px); } }
@keyframes pkHowPress { 0%, 30%, 100% { transform: none; } 40%, 80% { transform: translateY(3px); } }
@keyframes pkHowRing { 0%, 35% { opacity: 0; transform: scale(.8); } 45% { opacity: 1; } 100% { opacity: 0; transform: scale(1.3); } }
@keyframes pkHowFall { 0%, 38% { opacity: 0; transform: none; } 42% { opacity: 1; } 100% { opacity: 1; transform: translateY(100px); } }
@keyframes pkHowBall { 0% { transform: none; } 14% { transform: translate(0, 14px); } 22% { transform: translate(6px, 8px); } 36% { transform: translate(10px, 32px); } 46% { transform: translate(6px, 26px); } 62%, 100% { transform: translate(2px, 62px); } 80%, 100% { opacity: 0; } 63% { opacity: 1; } }
@keyframes pkHowHit { 0%, 60%, 100% { transform: none; filter: none; } 64% { transform: translateY(3px); filter: brightness(1.8); } 74% { transform: none; filter: brightness(1.2); } }
@keyframes pkHowWin { 0%, 62% { opacity: 0; transform: translate(-50%, 4px); } 68% { opacity: 1; transform: translate(-50%, 0); } 90% { opacity: 1; transform: translate(-50%, -8px); } 100% { opacity: 0; transform: translate(-50%, -12px); } }
.pk-how-tip { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-2); color: #e9e4ff; font-size: 12px; }
.pk-how-tip svg { flex: none; color: var(--n3); }
.pk-keys { display: none; margin-top: 4px; }
.pk-keys .rw { display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--border); font-size: 12px; }
.pk-keys .kk { display: flex; gap: 4px; }
.pk-keys kbd { font-size: 10px; padding: 3px 6px 4px; }
/* une bille en détail */
.pk-ball { display: grid; grid-template-columns: minmax(0, 228px) minmax(0, 1fr); gap: 14px; align-items: center; margin-bottom: 10px; }
.pk-ball-svg { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--border); background: linear-gradient(180deg, #0a0620, #05030f); }
.pk-ball-info .hd { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.pk-ball-info .hd .chip { font-size: 14px; padding: 3px 10px; cursor: default; }
.pk-ball-info .hd b { font-size: 17px; color: #fff; font-variant-numeric: tabular-nums; }
.pk-ball-info .rw { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px solid var(--border); font-size: 12px; }
.pk-ball-info .rw span { color: var(--muted); }
.pk-ball-info .rw b { display: inline-flex; align-items: center; gap: 6px; color: #fff; }
.pk-bits { display: grid; grid-template-columns: repeat(16, 1fr); gap: 2px; margin-top: 8px; }
.pk-bits i { font-style: normal; font-size: 8.5px; line-height: 1; font-weight: 900; text-align: center; padding: 3px 0; border-radius: 3px; background: color-mix(in srgb, var(--n1) 30%, #000); color: #fff; }
.pk-bits i.r { background: color-mix(in srgb, var(--n3) 34%, #000); }
.pk-check { display: flex; align-items: flex-start; gap: 8px; margin-top: 6px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel-2); font-size: 12px; line-height: 1.35; }
.pk-check i { flex: none; width: 16px; height: 16px; margin-top: 1px; border-radius: 50%; background: var(--border-light); position: relative; }
.pk-check.ok { border-color: rgba(108,245,154,.5); color: #d9ffe6; }
.pk-check.ok i { background: var(--win); }
.pk-check.ok i::after { content: ""; position: absolute; left: 5px; top: 2.5px; width: 4px; height: 8px; border: solid #05240f; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.pk-check.ko { border-color: #ff4d5e; color: #ffd0d5; }
.pk-check.ko i { background: #ff4d5e; }
.pk-check.wait i::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--panel-2); }

/* ===== raccourcis affichés : ordinateur avec souris seulement ===== */
@media (hover: hover) and (pointer: fine) and (min-width: 1001px) {
  .pk-tool kbd, .pk-amt-btn kbd, .pk-risk-btn kbd { display: block; }
  .pk-risk-btn span { font-size: 11px; letter-spacing: .2px; }
  .pk-risk-btn { padding-right: 6px; }
  .pk-key-space { display: block; }
  .pk-keys { display: block; }
}

/* ===== ordinateur peu haut : bouton un peu plus petit pour garder la liste visible ===== */
@media (min-width: 1001px) and (max-height: 780px) {
  .pk-drop { --d: 112px; }
  .pk-hero { padding: 20px 0 14px; }
  .pk-controls { gap: 9px; }
  .pk-opts { gap: 9px; }
  .pk-quick { display: none; }
}

/* ===== téléphone en portrait et tablettes : la pyramide d'abord, les commandes en console sous le pouce ===== */
@media (max-width: 1000px) {
  .pk { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "scene" "panel"; padding: 4px; gap: 4px; overflow: hidden; }
  .pk-scene { gap: 0; }
  .pk-stage { min-height: 200px; border-radius: 14px; }
  /* historique et outils dans les coins libres du ciel, au-dessus de la pyramide */
  .pk-history { position: absolute; top: 6px; left: 6px; width: calc(50% - 52px); z-index: 14; }
  .pk-history .history-bar { height: 28px; padding: 0 3px 0 6px; border-radius: 10px; gap: 4px; background: rgba(8,5,22,.78); }
  .pk-history .chip, .pk-history .history-bar .pk-chip:first-child { font-size: 10.5px; padding: 1px 6px; line-height: 17px; }
  .pk-history .history-toggle { height: 20px; padding: 0 5px; border-radius: 7px; }
  .pk-history .history-expanded { top: 32px; width: calc(100vw - 20px); }
  .pk-history .hint { font-size: 10px; }
  .pk-tools { top: 6px; right: 6px; gap: 5px; }
  .pk-tool { width: 30px; height: 30px; border-radius: 10px; background: rgba(8,5,22,.78); }
  .pk-tool-bets { display: grid; }
  .pk-legend { top: auto; bottom: calc(100% - var(--pk-hz, 80%) + 34px); right: 50%; transform: translateX(50%); display: none; }
  .pk-stage .toasts { top: 102px; left: 6px; }
  /* gain de la série et session : deux plaquettes dans les coins, sous l'historique et les outils */
  .pk-bottom { grid-area: scene; align-self: start; z-index: 13; margin: 40px 6px 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 0; pointer-events: none; }
  .pk-pill.bal { display: none; }
  .pk-pill { height: auto; min-width: 92px; max-width: 34vw; padding: 5px 9px 7px; display: flex; flex-direction: column; justify-content: center; row-gap: 2px; border-radius: 12px; background: rgba(8,5,22,.78); box-shadow: 0 4px 12px rgba(0,0,0,.35); pointer-events: auto; }
  .pk-pill::before { display: none; }
  .pk-pill::after { left: 12px; right: 12px; }
  .pk-pill small { font-size: 8.5px; letter-spacing: 1px; flex-direction: column; align-items: flex-start; gap: 2px; }
  .pk-pill small em { font-size: 8.5px; min-height: 9px; }
  .pk-pill b { font-size: 15px; order: -1; }
  .pk-pill b .cur { display: none; }
  .pk-pill.win small { order: 0; }
  .pk-pill.ses { align-items: flex-end; text-align: right; }
  .pk-pill.ses small { align-items: flex-end; }
  .pk-totalbet { font-size: 10px; padding: 3px 9px; gap: 4px; max-width: calc(var(--pk-disp-w, 100%) - 24px); }
  /* console : mise et raccourcis à gauche, DROP à droite sous le pouce, billes, risque */
  .pk-panel { gap: 0; }
  .pk-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "bet drop" "balls drop" "risk risk"; align-items: center; column-gap: 10px; row-gap: 7px; padding: 10px 10px 9px; border-radius: 14px; }
  .pk-hero { grid-area: drop; --hy: 50%; padding: 6px 6px 8px; }
  .pk-hero::before { inset: -8px; }
  .pk-drop { --d: 100px; }
  .pk-field { grid-area: bet; gap: 6px; }
  .pk-field h5, .pk-quick { display: none; }
  .pk-bet { grid-template-columns: 40px 1fr 40px; gap: 6px; }
  .pk-step, .pk-bet-val { height: 40px; border-radius: 12px; }
  .pk-bet-val input { font-size: 20px; }
  .pk-ops button { height: 26px; }
  .pk-opts { display: contents; }
  .pk-opt-amount { grid-area: balls; }
  .pk-opt-risk { grid-area: risk; }
  .pk-opt h5 { display: none; }
  .pk-amt-btn { height: 34px; }
  .pk-risk-btn { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "ball name name" "strip strip max"; padding: 7px 8px 6px; column-gap: 6px; row-gap: 5px; }
  .pk-risk-btn small { font-size: 0; justify-content: flex-end; }
  .pk-risk-btn small b { font-size: 11.5px; line-height: 7px; }
  /* les listes deviennent une feuille qui monte du bas */
  .pk-lists { position: fixed; left: 0; right: 0; bottom: 0; z-index: 46; flex: none; height: min(74dvh, 580px); border-radius: 18px 18px 0 0; border-color: var(--border-light); box-shadow: 0 -18px 50px rgba(0,0,0,.6); transform: translateY(104%); visibility: hidden; transition: transform .28s cubic-bezier(.2, .9, .25, 1), visibility 0s .28s; padding-bottom: env(safe-area-inset-bottom, 0); }
  .pk-lists.open { transform: none; visibility: visible; transition-delay: 0s; }
  .pk-lists-close { display: grid; place-items: center; width: 34px; height: 34px; flex: none; }
  .pk-heat .bar { height: 78px; }
}
/* portrait avec de la hauteur : la console respire (libellés, mises rapides, bouton plus grand) */
@media (max-width: 1000px) and (min-height: 780px) and (orientation: portrait) {
  .pk-controls { row-gap: 9px; padding: 12px 10px 11px; }
  .pk-drop { --d: 112px; }
  .pk-quick { display: grid; }
  .pk-quick button { height: 24px; }
  .pk-amt-btn { height: 38px; }
  .pk-risk-btn { padding: 9px 8px 8px; }
}
@media (max-width: 420px) {
  .pk-bet-val { padding: 0 8px; gap: 4px; }
  .pk-bet-val input { font-size: 19px; letter-spacing: 0; }
  .pk-ops, .pk-quick { gap: 4px; }
  .pk-ops button { font-size: 10.5px; }
  .pk-quick button { font-size: 10px; }
  .pk-risk-btn span { font-size: 10.5px; letter-spacing: .2px; }
  .pk-row { grid-template-columns: 42px minmax(0, 1fr) 58px 64px; font-size: 11px; }
  .pk-row.top { grid-template-columns: minmax(0, 1fr) 52px 52px 64px; }
  .pk-how { grid-template-columns: 1fr; }
  .pk-how-step { display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: 10px; text-align: left; align-items: center; }
  .pk-how-art { grid-row: 1 / 3; height: 70px; }
  .pk-how-art.a1 { gap: 4px; }
  .pk-how-art.a1 b { min-width: 42px; padding: 5px 0; font-size: 13px; }
  .pk-how-art .k { width: 18px; height: 18px; border-radius: 6px; }
  .pk-how-art .k::before, .pk-how-art .k.plus::after { left: 4px; right: 4px; top: 8px; height: 2px; }
  .pk-how-art .dots { bottom: 6px; }
  .pk-how-art.a3 .sl { left: 8%; right: 8%; bottom: 6px; }
  .pk-how-art.a3 .p1 { top: 8px; } .pk-how-art.a3 .p2, .pk-how-art.a3 .p3 { top: 24px; }
  .pk-how-step b { margin: 0; align-self: end; }
  .pk-how-step span { align-self: start; }
  .pk-ball { grid-template-columns: 1fr; }
  .pk-fair th:nth-child(4), .pk-fair td:nth-child(4), .pk-fair th:nth-child(5), .pk-fair td:nth-child(5) { display: none; }
  .pk-ball-svg { max-width: 240px; margin: 0 auto; }
  .pk-cells span { font-size: 7.5px; padding: 4px 0; }
  .pk-cells.prob span { font-size: 6.5px; }
}
@media (max-width: 370px) {
  .pk-bet-val small { display: none; }
  .pk-drop { --d: 90px; }
  .pk-totalbet span[data-i18n] { display: none; }
  .pk-risk-btn i { display: none; }
  .pk-risk-btn { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name max" "strip strip"; }
}

/* ===== téléphone en paysage : machine à gauche (pleine hauteur), console compacte à droite ===== */
@media (orientation: landscape) and (max-height: 520px) {
  :root { --topbar-h: 40px; }
  .topbar { padding: 0 8px; }
  .logo { font-size: 16px; }
  .balance { font-size: 13px; }
  .icon-btn, .friends-btn, .avatar-btn { width: 30px; height: 30px; }
  .pk { grid-template-columns: minmax(0, 1fr) min(42vw, 310px); grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "scene panel" "scene bottom"; padding: 4px; gap: 4px; }
  .pk-stage { min-height: 0; border-radius: 12px; }
  .pk-history { top: 5px; left: 5px; width: min(30%, 170px); }
  .pk-history .history-bar { height: 24px; border-radius: 9px; }
  .pk-history .chip, .pk-history .history-bar .pk-chip:first-child { font-size: 10px; padding: 1px 5px; line-height: 16px; }
  .pk-history .history-toggle { height: 18px; }
  .pk-history .history-expanded { top: 28px; width: 46vw; }
  .pk-tools { top: 5px; right: 5px; }
  .pk-tool { width: 28px; height: 28px; border-radius: 9px; }
  .pk-stage .toasts { top: 32px; left: 5px; }
  .pk-bottom { grid-area: bottom; align-self: auto; margin: 0; display: grid; grid-template-columns: 1.2fr 1fr; gap: 4px; pointer-events: auto; }
  .pk-pill { min-width: 0; max-width: none; height: 40px; padding: 0 10px; border-radius: 11px; flex-direction: row; align-items: center; justify-content: space-between; column-gap: 8px; background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 88%, #fff), var(--panel-2)); }
  .pk-pill b { font-size: 15px; order: 1; }
  .pk-pill small, .pk-pill.ses small { font-size: 8.5px; align-items: flex-start; }
  .pk-pill small em { font-size: 8.5px; }
  .pk-pill.ses { align-items: center; text-align: left; }
  .pk-totalbet { left: 5px; right: auto; top: auto; bottom: 5px; transform: none; max-width: 30%; font-size: 9px; padding: 3px 7px; gap: 3px; background: rgba(6,3,20,.88); }
  .pk-totalbet span[data-i18n], .pk-totalbet .cur { display: none; }
  .pk-panel { min-height: 0; overflow: hidden; }
  .pk-controls { flex: 1; min-height: 0; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto auto; grid-template-areas: "drop bet" "balls balls" "risk risk"; align-content: space-between; column-gap: 8px; row-gap: 6px; padding: 10px 8px 8px; border-radius: 12px; }
  .pk-hero { padding: 7px 8px 9px; }
  .pk-drop { --d: 100px; }
  .pk-drop .sub { max-width: 94%; letter-spacing: .04em; }
  .pk-field { gap: 5px; }
  .pk-bet { grid-template-columns: 34px 1fr 34px; gap: 4px; }
  .pk-step, .pk-bet-val { height: 36px; border-radius: 10px; }
  .pk-bet-val { padding: 0 4px; gap: 0; }
  .pk-bet-val input { font-size: 16px; }
  .pk-bet-val small { display: none; }
  .pk-ops { gap: 3px; }
  .pk-ops button { height: 24px; font-size: 10px; border-radius: 7px; }
  .pk-quick { display: grid; gap: 3px; }
  .pk-quick button { height: 22px; font-size: 10px; border-radius: 7px; }
  .pk-amt-btn { height: 36px; font-size: 14px; border-radius: 10px; }
  .pk-risk-btn { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "ball name" "strip strip" "max max"; padding: 7px 7px 6px; row-gap: 5px; border-radius: 10px; }
  .pk-risk-btn small { font-size: 9px; justify-content: space-between; }
  .pk-risk-btn span { font-size: 10.5px; letter-spacing: .3px; }
  .pk-risk-btn em { height: 6px; }
  .pk-lists { left: auto; right: 0; top: 0; bottom: 0; width: min(64vw, 440px); height: auto; border-radius: 16px 0 0 16px; transform: translateX(104%); }
  .pk-heat .bar { height: 54px; }
  .modal-backdrop { padding: 6px; align-items: center; }
  .modal { max-height: calc(100dvh - 12px); border-radius: 12px; }
}
/* paysage très bas (petits téléphones) : bouton réduit, groupes resserrés */
@media (orientation: landscape) and (max-height: 350px) {
  .pk-controls { padding: 7px 6px 6px; row-gap: 5px; column-gap: 6px; }
  .pk-drop { --d: 74px; }
  .pk-hero { padding: 5px 6px 6px; }
  .pk-quick { display: none; }
  .pk-pill { height: 32px; }
  .pk-bet { grid-template-columns: 28px 1fr 28px; gap: 3px; }
  .pk-step, .pk-bet-val { height: 30px; }
  .pk-bet-val input { font-size: 14px; letter-spacing: 0; }
  .pk-ops button { height: 20px; font-size: 9px; }
  .pk-amt-btn { height: 28px; font-size: 13px; }
  .pk-risk-btn { padding: 5px 5px 4px; row-gap: 4px; }
  .pk-risk-btn span { font-size: 9.5px; letter-spacing: 0; }
  .pk-risk-btn small { font-size: 0; justify-content: center; }
  .pk-risk-btn small b { font-size: 10.5px; }
}
@media (orientation: landscape) and (max-height: 520px) and (max-width: 700px) {
  .pk-risk-btn i { display: none; }
  .pk-risk-btn { grid-template-columns: minmax(0, 1fr); grid-template-areas: "name" "strip" "max"; }
}

/* ===== animations réduites (réglage du système, ou « Animation » coupé dans le menu) ===== */
.pk-calm .pk-amb *, .pk-calm .pk-bulbs i, .pk-calm.pk-hit, .pk-calm.pk-jackpot, .pk-calm.pk-slow::before { animation: none !important; }
.pk-calm-on .pk-drop::before, .pk-calm-on .pk-drop .ico i, .pk-calm-on .pk-callout.show .in, .pk-calm-on .pk-how-art * { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .pk-amb *, .pk-bulbs i, .pk-stage, .pk-stage::before, #fadeCanvas.out, .pk-callout.show .in, .pk-how-art *, .pk-step.kb, .pk-drop.nope, .pk-risk.nope { animation: none !important; }
  .pk-drop::before, .pk-drop .ico i, .pk-drop.held .ico i, .pk-drop.held .ico i + i, .pk-drop.pop::after, .pk-drop.pop:not(.held) .cap, .pk-history .history-bar .pk-chip:first-child { animation: none; }
  .pk-drop::before { opacity: .7; }
  .pk-drop.held .ico i + i { opacity: 0; }
  .pk-drop.held .prg, .pk-drop.held.cyc-a .prg, .pk-drop.held.cyc-b .prg { animation: none; stroke-dashoffset: 0; }
  .pk-lists, .pk-prog u, .pk-heat .bar i { transition: none; }
}
