@font-face { font-family: Inter; font-weight: 400; src: url(fonts/inter-400.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: Inter; font-weight: 600; src: url(fonts/inter-600.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: Inter; font-weight: 800; src: url(fonts/inter-800.woff2) format('woff2'); font-display: swap; }

/* Palette « Discord » */
:root {
  --bg: #1e1f22;
  --panel: #2b2d31;
  --panel2: #313338;
  --hover: #383a40;
  --line: rgba(255, 255, 255, 0.07);
  --text: #f2f3f5;
  --muted: #b5bac1;
  --faint: #80848e;
  --blurple: #5865f2;
  --blurple-h: #4752c4;
  --green: #23a55a;
  --red: #f23f42;
  --yellow: #f0b232;
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, 'gg sans', 'Noto Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }

/* Tout tient dans la fenêtre de l'activité (sans défilement) : l'en-tête et les commandes gardent leur taille, le jeu prend le reste. */
#app { height: 100dvh; max-width: 1280px; margin: 0 auto; padding: 8px 14px 10px; display: flex; flex-direction: column; gap: 8px; }
header { flex: none; }
.view { flex: 1; min-height: 0; display: flex; }
.play { flex: 1; min-height: 0; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 208px; gap: 10px; width: 100%; }
.main { min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }

/* Classement des plus riches */
.board { align-self: start; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 10px 8px; }
.board h4 { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 4px 8px; }
.board ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.board li { position: relative; display: grid; grid-template-columns: 22px 24px minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 6px 6px; border-radius: 8px; font-size: 13px; }
.board li.me { background: rgba(88, 101, 242, 0.16); }
.board .rk { text-align: center; font-weight: 800; color: var(--muted); font-size: 13px; }
.board .nm2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.board li.gap { display: block; text-align: center; color: var(--faint); font-size: 12px; letter-spacing: .3em; padding: 0; line-height: 1; }
.board li b { font-variant-numeric: tabular-nums; color: var(--yellow); font-weight: 800; }
.board .av { box-shadow: 0 0 0 2px var(--panel); }
.board .delta { position: absolute; right: 6px; top: -7px; font-style: normal; font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 99px; animation: floaty 4s ease-out forwards; pointer-events: none; }
.board .delta.up { background: var(--green); color: #fff; }
.board .delta.down { background: var(--red); color: #fff; }
@keyframes floaty { 0% { opacity: 0; transform: translateY(6px); } 10% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-4px); } }
.fit { flex: 1; min-height: 0; container-type: size; display: grid; place-items: center; }

/* ---------- En-tête : onglets des jeux + solde ---------- */
header { display: flex; align-items: center; gap: 10px; }
.tabs { display: flex; gap: 4px; background: var(--panel); padding: 4px; border-radius: 10px; }
.tab { padding: 7px 14px; border-radius: 7px; font-weight: 600; font-size: 14px; color: var(--muted); white-space: nowrap; transition: background 0.12s, color 0.12s; }
.tab:hover { background: var(--hover); color: var(--text); }
.tab.on { background: var(--blurple); color: #fff; }
.spacer { flex: 1; }
.history { display: flex; gap: 5px; }
.volume { display: flex; align-items: center; gap: 6px; }
.iconbtn { width: 34px; height: 34px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); font-size: 16px; line-height: 1; transition: background .12s; }
.iconbtn:hover { background: var(--hover); }
#vol { width: 74px; accent-color: var(--blurple); cursor: pointer; }
@media (max-width: 560px) { #vol { display: none; } }
.history.empty { visibility: hidden; }
.dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; box-shadow: 0 0 0 2px var(--bg); }
.balance { margin-left: 0; background: var(--panel); border: 1px solid rgba(240, 178, 50, 0.35); color: var(--yellow); font-weight: 800; padding: 7px 14px; border-radius: 999px; white-space: nowrap; font-variant-numeric: tabular-nums; }


/* ---------- Boutons ---------- */
.btn { padding: 10px 18px; border-radius: 8px; font-weight: 600; font-size: 14px; background: var(--blurple); color: #fff; transition: background 0.12s, transform 0.08s, opacity 0.12s; }
.btn:not(:disabled):hover { background: var(--blurple-h); }
.btn:not(:disabled):active { transform: scale(0.97); }
.btn:disabled { opacity: 0.35; }
.btn.ghost { background: var(--panel); color: var(--muted); border: 1px solid var(--line); }
.btn.ghost:not(:disabled):hover { background: var(--hover); color: var(--text); }

/* ---------- Course : piste ---------- */
.stage { position: relative; width: min(100cqw, calc(100cqh * var(--ratio, 2.54))); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #15161a; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4); }
#track { display: block; width: 100%; aspect-ratio: 1200 / 472; }
.banner { position: absolute; left: 50%; top: 40%; width: max-content; max-width: 96%; transform: translate(-50%, -50%) scale(0.94); text-align: center; pointer-events: none; opacity: 0; transition: opacity 0.2s, transform 0.2s; }
.banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.banner b { display: block; white-space: nowrap; font-variant-numeric: tabular-nums; font-size: clamp(26px, 6vw, 56px); font-weight: 800; letter-spacing: -0.02em; text-shadow: 0 4px 24px rgba(0, 0, 0, 0.8); }
.banner span { display: block; margin-top: 4px; font-weight: 600; color: #dcdee2; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9); font-size: clamp(12px, 2vw, 16px); }

/* Résultats (course) */
.results { position: fixed; inset: 0; z-index: 15; display: grid; place-items: center; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(3px); animation: fade 0.3s ease; cursor: pointer; }
.results .card { width: min(92%, 380px); background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6); cursor: default; }
.results h3 { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.results .row { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-weight: 600; }
.results .row .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results .row .o { color: var(--muted); font-variant-numeric: tabular-nums; }
.results .mine { margin-top: 8px; text-align: center; font-weight: 800; font-size: 22px; padding: 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.05); }
.results .mine.good { background: rgba(35, 165, 90, 0.15); }
.results .mine.bad { background: rgba(242, 63, 66, 0.12); }
.results .others { margin-top: 6px; display: grid; gap: 2px; max-height: 84px; overflow: auto; }
.results .p { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.good { color: var(--green); }
.bad { color: var(--red); }
.num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--silk, #666); color: #fff; font-size: 12px; font-weight: 800; flex: none; box-shadow: 0 0 0 2px var(--panel); }

/* Course : cartes des chevaux */
.horses { flex: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.horse { text-align: left; padding: 10px 10px 9px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--silk); display: grid; gap: 6px; transition: transform 0.12s, border-color 0.15s, background 0.15s; position: relative; min-width: 0; }
.horse:not(.locked):hover { transform: translateY(-2px); background: var(--hover); }
.horse:not(.locked):active { transform: scale(0.98); }
.horse.mine { border-color: var(--silk); background: color-mix(in srgb, var(--silk) 14%, var(--panel)); }
.horse.locked { cursor: default; }
.horse.winner { box-shadow: 0 0 0 2px var(--yellow), 0 0 24px rgba(240, 178, 50, 0.3); }
.horse.winner::after { content: '🏆'; position: absolute; top: -10px; right: -6px; font-size: 20px; }
.h-head { display: flex; align-items: center; gap: 7px; min-width: 0; }
.name { font-weight: 800; font-size: 13px; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.odds { display: flex; align-items: baseline; justify-content: space-between; }
.odds b { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stars { color: var(--yellow); font-size: 10px; letter-spacing: 1px; }
.bettors { display: flex; align-items: center; min-height: 20px; }
.bettors .av { margin-right: -5px; }
.bettors .more { margin-left: 8px; font-size: 11px; color: var(--muted); font-weight: 600; }
.av { display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden; background: #4e5058; color: #fff; font-size: 10px; font-weight: 800; box-shadow: 0 0 0 2px var(--panel); flex: none; }
.av img { width: 100%; height: 100%; display: block; }
.my { font-size: 11px; font-weight: 600; color: var(--muted); min-height: 14px; font-variant-numeric: tabular-nums; }
.horse.mine .my { color: var(--text); }

.controls { flex: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; transition: opacity 0.2s; }
.controls.off { opacity: 0.45; pointer-events: none; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips .chip { display: grid; place-items: center; padding: 0; line-height: 1; white-space: nowrap; width: 52px; height: 52px; border-radius: 50%; font-weight: 800; font-size: 12px; color: #fff; border: 3px dashed rgba(255, 255, 255, 0.85); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5), inset 0 0 0 3px rgba(0, 0, 0, 0.15); transition: transform .1s, filter .15s, box-shadow .15s; font-variant-numeric: tabular-nums; }
.chips .chip.c0 { color: #1e1f22; }
.chips .chip.all { background: linear-gradient(135deg, var(--yellow), #e08a1e); color: #1e1f22; }
.chips .chip:not(:disabled):hover { transform: translateY(-3px); }
.chips .chip:not(:disabled):active { transform: scale(.94); }
.chips .chip:disabled { filter: grayscale(1) brightness(.6); }
.chips .chip.on { transform: translateY(-4px); box-shadow: 0 0 0 3px var(--blurple), 0 6px 14px rgba(0, 0, 0, 0.55); }
.controls .chips { align-items: center; }

/* Montant libre */
.amtbox { display: inline-flex; align-items: center; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.amtbox span { padding: 0 6px 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.amtbox.on { border-color: var(--blurple); box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.35); }
.amt { width: 104px; padding: 8px 10px; border-radius: 7px; border: 0; background: #1e1f22; color: var(--text); font: 800 15px Inter, sans-serif; font-variant-numeric: tabular-nums; text-align: right; outline: none; }
.amt::placeholder { color: var(--faint); font-weight: 600; }
.amt:focus { box-shadow: 0 0 0 2px var(--blurple); }
.mini { padding: 8px 10px; border-radius: 7px; background: var(--panel2); color: var(--muted); font-weight: 800; font-size: 13px; transition: background .12s, color .12s; }
.mini:not(:disabled):hover { background: var(--hover); color: var(--text); }
.mini:disabled { opacity: .35; }

/* ---------- Blackjack : la table ---------- */
.bj-table {
  --cw: 6.8cqw; /* largeur d'une carte */
  --step: 2.9cqw; /* décalage entre deux cartes d'une main */
  position: relative; container-type: inline-size; width: min(100cqw, 160cqh); aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden;
  background: radial-gradient(120% 95% at 50% 36%, #1d7a4b 0%, #146239 42%, #0b3a26 100%);
  box-shadow: inset 0 0 0 .7cqw #2b2d31, inset 0 0 0 .9cqw rgba(255, 255, 255, 0.06), 0 10px 40px rgba(0, 0, 0, 0.45);
  user-select: none;
}
.bj-table::before { content: ''; position: absolute; inset: 0; background: repeating-radial-gradient(circle at 50% 120%, transparent 0 2.6cqw, rgba(255, 255, 255, 0.025) 2.6cqw 2.7cqw); pointer-events: none; }

.shoe { position: absolute; right: 5cqw; top: 4.5cqw; width: var(--cw); height: calc(var(--cw) * 1.4); }
.shoe i { position: absolute; inset: 0; border-radius: .7cqw; background: repeating-linear-gradient(45deg, #4752c4 0 .5cqw, #5865f2 .5cqw 1cqw); border: .3cqw solid #f2f3f5; box-shadow: 0 .3cqw .6cqw rgba(0, 0, 0, 0.45); }
.shoe i:nth-child(1) { transform: translate(.9cqw, .9cqw); }
.shoe i:nth-child(2) { transform: translate(.6cqw, .6cqw); }
.shoe i:nth-child(3) { transform: translate(.3cqw, .3cqw); }

.bj-dealer { position: absolute; left: 50%; top: 3.2cqw; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: .5cqw; }
.d-label { font-size: max(9px, 1.25cqw); letter-spacing: .25em; text-transform: uppercase; font-weight: 800; color: rgba(255, 255, 255, 0.55); }
.d-total { font-size: max(10px, 1.45cqw); font-weight: 800; padding: .25cqw 1cqw; border-radius: 99px; background: rgba(0, 0, 0, 0.45); }
.d-total.lose { color: #ff8a8c; }
.d-total.bj { color: var(--yellow); }
.bj-rule { position: absolute; left: 0; right: 0; top: 18cqw; text-align: center; font-size: max(8px, 1.15cqw); letter-spacing: .22em; text-transform: uppercase; font-weight: 800; color: rgba(255, 255, 255, 0.22); pointer-events: none; }
.bj-banner { position: absolute; left: 50%; top: 24cqw; transform: translate(-50%, -50%); text-align: center; pointer-events: none; opacity: 0; transition: opacity .2s; width: 60cqw; }
.bj-banner.show { opacity: 1; }
.bj-banner b { display: block; font-size: max(13px, 2.5cqw); font-weight: 800; letter-spacing: -0.01em; text-shadow: 0 .3cqw 1.5cqw rgba(0, 0, 0, 0.7); }
.bj-banner span { display: block; margin-top: .3cqw; font-size: max(10px, 1.45cqw); font-weight: 600; color: rgba(255, 255, 255, 0.78); text-shadow: 0 .2cqw .8cqw rgba(0, 0, 0, 0.8); }

/* Cartes */
.hand { display: flex; flex-direction: column; align-items: center; gap: .6cqw; }
.cards { position: relative; width: calc(var(--cw) + var(--step) * 1.4); height: calc(var(--cw) * 1.4); }
.dealer-hand .cards { width: calc(var(--cw) + var(--step) * 1.4); }
.card { position: absolute; top: 0; left: calc(var(--step) * var(--i, 0)); width: var(--cw); height: calc(var(--cw) * 1.4); perspective: 40cqw; transition: left .3s ease; }
.card .inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.3, .7, .2, 1); transform: rotateY(180deg); }
.card.up .inner { transform: rotateY(0); }
.face { position: absolute; inset: 0; border-radius: .7cqw; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 .25cqw .7cqw rgba(0, 0, 0, 0.5); }
.face.front { background: #f8f8fa; color: #1e1f22; }
.face.front.red { color: #d92b3a; }
.face.back { transform: rotateY(180deg); background: repeating-linear-gradient(45deg, #4752c4 0 .5cqw, #5865f2 .5cqw 1cqw); border: .3cqw solid #f2f3f5; }
.corner { position: absolute; font-size: calc(var(--cw) * .27); line-height: 1.05; font-weight: 800; text-align: center; }
.corner.tl { top: .35cqw; left: .45cqw; }
.corner.br { bottom: .35cqw; right: .45cqw; transform: rotate(180deg); }
.pip { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--cw) * .62); line-height: 1; }
@keyframes dealIn {
  from { transform: translate(var(--fx, 0), var(--fy, 0)) rotate(-22deg) scale(.72); opacity: 0; }
  14% { opacity: 1; }
  to { transform: none; opacity: 1; }
}
.card.deal { animation: dealIn .5s cubic-bezier(.2, .8, .25, 1) both; }

.badge { font-size: max(9px, 1.5cqw); font-weight: 800; padding: .2cqw .9cqw; border-radius: 99px; background: rgba(0, 0, 0, 0.5); white-space: nowrap; font-variant-numeric: tabular-nums; }
.badge.none { visibility: hidden; }
.badge.win { background: var(--green); }
.badge.lose { background: var(--red); }
.badge.push { background: #5d6068; }
.badge.bj { background: var(--yellow); color: #1e1f22; }

/* Places */
.bj-seats { position: absolute; inset: 0; }
.seat { position: absolute; transform: translateX(-50%); width: 18cqw; display: flex; flex-direction: column; align-items: center; gap: .7cqw; }
.seat.s0 { left: 10%; top: 41%; }
.seat.s1 { left: 30%; top: 51%; }
.seat.s2 { left: 50%; top: 55%; }
.seat.s3 { left: 70%; top: 51%; }
.seat.s4 { left: 90%; top: 41%; }
.hands { display: flex; gap: .8cqw; align-items: flex-start; justify-content: center; min-height: calc(var(--cw) * 1.4); }
.hands.split .hand { transform: scale(.8); transform-origin: top center; margin: 0 -1.2cqw; }
.hand.active .cards { filter: drop-shadow(0 0 .6cqw #5865f2); }
.hand.doubled .cards { transform: rotate(-2deg); }
.bet { display: flex; align-items: center; gap: .6cqw; font-size: max(10px, 1.7cqw); font-weight: 800; }
.disc { width: 2.8cqw; height: 2.8cqw; border-radius: 50%; border: .35cqw dashed rgba(255, 255, 255, 0.85); box-shadow: 0 .2cqw .5cqw rgba(0, 0, 0, 0.5), inset 0 0 0 .25cqw rgba(0, 0, 0, 0.18); }
.c0 { background: #dfe1e5; } .c1 { background: #5865f2; } .c2 { background: #23a55a; } .c3 { background: #f23f42; } .c4 { background: #1e1f22; border-color: var(--yellow); }
.plate { position: relative; display: flex; align-items: center; gap: .9cqw; padding: .8cqw 1.4cqw 1cqw .8cqw; background: var(--panel); border-radius: 1.3cqw; box-shadow: 0 .3cqw 1cqw rgba(0, 0, 0, 0.45); min-width: 14.5cqw; max-width: 18cqw; overflow: hidden; transition: box-shadow .2s, transform .2s; }
.who-av .av { width: max(24px, 4cqw) !important; height: max(24px, 4cqw) !important; box-shadow: 0 0 0 .2cqw var(--panel); }
.who { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.nm { font-size: max(10px, 1.75cqw); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { font-size: max(9px, 1.35cqw); color: var(--muted); font-weight: 600; }
.sub.win { color: #57d68d; }
.sub.lose { color: #ff8a8c; }
.timer { position: absolute; left: 0; right: 0; bottom: 0; height: .35cqw; background: rgba(255, 255, 255, 0.08); }
.timer i { display: block; height: 100%; width: 0; background: var(--blurple); }
.seat.turn .plate { box-shadow: 0 0 0 .22cqw var(--blurple), 0 0 2.2cqw rgba(88, 101, 242, 0.75); transform: translateY(-.3cqw); }
.seat.me .plate { box-shadow: 0 0 0 .18cqw rgba(255, 255, 255, 0.35), 0 .3cqw 1cqw rgba(0, 0, 0, 0.45); }
.seat.me.turn .plate { box-shadow: 0 0 0 .22cqw var(--blurple), 0 0 2.2cqw rgba(88, 101, 242, 0.75); }
.seat.late .plate, .seat.away .plate { opacity: .6; }
.seat.empty .plate, .seat.empty .hands, .seat.empty .bet { display: none; }
.sit { width: 12cqw; height: 7.5cqw; border-radius: 1.4cqw; border: .3cqw dashed rgba(255, 255, 255, 0.35); color: rgba(255, 255, 255, 0.7); font-size: max(9px, 1.25cqw); font-weight: 600; line-height: 1.4; transition: background .15s, border-color .15s, transform .1s; }
.sit b { font-size: max(10px, 1.5cqw); color: #fff; }
.sit:hover { background: rgba(255, 255, 255, 0.1); border-color: #fff; }
.sit:active { transform: scale(.97); }
.seat:not(.empty) .sit { display: none; }
.seat.empty:not(.free) .sit { visibility: hidden; }

/* Commandes du blackjack */
.bj-controls { flex: none; display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: center; min-height: 58px; padding: 4px 0; }
.bj-controls .grp { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; }
.bj-controls .info { color: var(--muted); font-weight: 600; text-align: center; }
.betline { color: var(--muted); font-weight: 600; margin-right: 4px; }
.betline b { color: var(--text); font-size: 18px; margin-left: 4px; font-variant-numeric: tabular-nums; }
.bj-controls .chips { gap: 8px; flex-wrap: wrap; justify-content: center; }
.bet-main { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: center; }
@media (min-width: 1000px) { .bet-main { flex-wrap: nowrap; } }
.btn.lockbtn { background: var(--green); padding: 12px 26px; font-size: 16px; font-weight: 800; min-width: 150px; }
.btn.lockbtn:not(:disabled):hover { background: #1c8a49; }
.locked-note { display: flex; align-items: center; gap: 14px; color: var(--muted); font-weight: 600; }
.locked-note b { color: var(--green); font-size: 18px; font-variant-numeric: tabular-nums; margin-left: 4px; }
.bet.pending { opacity: .7; }
.bet.pending .disc { border-style: dotted; }
.btn.act { padding: 13px 22px; font-size: 16px; display: inline-flex; align-items: center; gap: 8px; }
.btn.act kbd { font: 700 11px Inter, sans-serif; background: rgba(0, 0, 0, 0.28); border-radius: 4px; padding: 2px 6px; opacity: .85; }
.btn.act.hit { background: var(--blurple); }
.btn.act.stand { background: var(--green); }
.btn.act.stand:not(:disabled):hover { background: #1c8a49; }
.btn.act.double { background: var(--yellow); color: #1e1f22; }
.btn.act.double:not(:disabled):hover { background: #d99d1f; }
.btn.act.split { background: #4e5058; }
.btn.act.split:not(:disabled):hover { background: #5d6068; }
.grp-act.mine .btn.act:not(:disabled) { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(88, 101, 242, 0); } 50% { box-shadow: 0 0 0 6px rgba(88, 101, 242, 0.28); } }
.leave { padding: 9px 14px; font-size: 13px; }
.bj-controls .btn.same { padding: 10px 14px; font-size: 15px; }

#toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); padding: 10px 16px; border-radius: 8px; background: #111214; border: 1px solid var(--line); font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; max-width: 90vw; z-index: 20; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { border-color: rgba(242, 63, 66, 0.7); }
#toast.good { border-color: rgba(35, 165, 90, 0.7); }

#splash { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(30, 31, 34, 0.95); font-weight: 700; color: var(--muted); text-align: center; padding: 24px; z-index: 30; transition: opacity 0.3s; white-space: pre-line; }
#splash.hidden { opacity: 0; pointer-events: none; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (max-height: 760px) {
  .horse { padding: 7px 9px 6px; gap: 3px; }
  .odds b { font-size: 18px; }
  .my { min-height: 12px; }
  .bj-controls { min-height: 50px; }
  .btn.act { padding: 10px 20px; }
  .chips .chip { width: 46px; height: 46px; }
}
@media (max-width: 900px) {
  .horses { grid-template-columns: repeat(3, 1fr); }
  .play { grid-template-columns: minmax(0, 1fr); }
  .board { display: none; }
}
@media (max-width: 560px) {
  /* téléphone en portrait : on garde le défilement, c'est plus lisible */
  html, body { overflow: auto; }
  #app { height: auto; min-height: 100dvh; padding: 8px 10px 20px; gap: 10px; }
  .view { display: grid; gap: 10px; }
  .fit { container-type: normal; display: block; }
  .stage { width: 100%; }
  .bj-table { width: 100%; }
  .tab { padding: 7px 10px; font-size: 13px; }
  .tab span { display: none; }
  .horses { grid-template-columns: repeat(2, 1fr); }
  .history { display: none; }
  .controls .chip { min-width: 52px; padding: 8px 11px; }
  .bj-table { aspect-ratio: 4 / 3.6; --cw: 8.6cqw; --step: 3.2cqw; }
  .bj-rule { top: 21cqw; }
  .bj-banner { top: 28cqw; }
  .seat { width: 19cqw; }
  .seat.s0 { left: 11%; top: 52%; }
  .seat.s1 { left: 31%; top: 61%; }
  .seat.s2 { left: 50%; top: 66%; }
  .seat.s3 { left: 69%; top: 61%; }
  .seat.s4 { left: 89%; top: 52%; }
  .plate { min-width: 15cqw; padding: 1cqw 1.4cqw 1.2cqw 1cqw; }
  .chips .chip { width: 44px; height: 44px; }
  .view { display: block; }
  .main { display: grid; gap: 10px; }
}

/* ---------- Crash ---------- */
#crashCanvas { display: block; width: 100%; aspect-ratio: 1000 / 460; }
.crash-stage { background: #0e0f14; }
.crash-hist { position: absolute; left: 10px; top: 10px; right: 10px; display: flex; gap: 6px; flex-wrap: wrap; pointer-events: none; }
.pill { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 99px; font-variant-numeric: tabular-nums; background: rgba(0, 0, 0, 0.5); }
.pill.lo { color: #ff8a8c; }
.pill.mid { color: #8ec5ff; }
.pill.hi { color: var(--yellow); box-shadow: inset 0 0 0 1px rgba(240, 178, 50, 0.5); }
.crash-controls { justify-content: center; }
.amtbox.auto span { padding: 0 4px 0 8px; }
.amtbox.auto .amt { width: 62px; }
.btn.lockbtn.mainbtn { min-width: 176px; }
.crash-controls { gap: 8px 10px; }
.crash-controls .chips { gap: 6px; }
.crash-controls .chips .chip { width: 46px; height: 46px; font-size: 11px; }
.crash-controls .amt { width: 88px; }
.crash-controls .cancel { padding: 10px 14px; }
.btn.lockbtn.cash { background: var(--green); font-size: 17px; animation: pulse 1.1s ease-in-out infinite; }
.btn.lockbtn.lost { background: #5d3033; color: #ffb4b6; opacity: 1; }
.btn.lockbtn:disabled:not(.lost) { opacity: .55; }
.feedh { margin-top: 12px !important; }
.feed { display: grid; gap: 3px; }
.feed .empty { margin: 0; padding: 4px; font-size: 12px; color: var(--faint); }
.feed .row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 4px 6px; border-radius: 7px; font-size: 12px; position: relative; }
.feed .row .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.feed .row b { font-variant-numeric: tabular-nums; color: var(--yellow); }
.feed .row i { grid-column: 2 / 4; font-style: normal; font-size: 11px; font-weight: 800; color: #57d68d; margin-top: -3px; }
.feed .row.won b { color: #57d68d; }
.feed .row.lost b { color: #ff8a8c; }
.feed .row.me { background: rgba(88, 101, 242, 0.16); }

/* ---------- Mines ---------- */
.mines-wrap { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(250px, 310px) minmax(0, 1fr); gap: 12px; }
.mines-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 11px; overflow: auto; min-height: 0; }
.mp-sec { display: grid; gap: 7px; }
.mp-sec label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 800; display: flex; justify-content: space-between; }
.mp-sec label b { color: var(--text); font-size: 13px; letter-spacing: 0; }
.mines-panel .amtbox { display: flex; }
.mines-panel .amtbox .amt { flex: 1; min-width: 0; width: auto; }
.mchips { display: flex; gap: 6px; flex-wrap: wrap; }
.mchips .chip { width: 40px; height: 40px; font-size: 10px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.seg button { padding: 7px 0; border-radius: 7px; background: var(--panel2); font-weight: 800; font-size: 12px; color: var(--muted); transition: background .12s, color .12s; }
.seg button:not(:disabled):hover { background: var(--hover); color: var(--text); }
.seg button.on { background: var(--blurple); color: #fff; }
.seg button:disabled { opacity: .45; }
.range { width: 100%; accent-color: var(--blurple); cursor: pointer; }
.mp-info { display: grid; gap: 5px; padding: 9px 10px; border-radius: 9px; background: #232428; font-size: 13px; }
.mp-info > div { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-weight: 600; }
.mp-info b { color: var(--text); font-variant-numeric: tabular-nums; }
.mp-info b.good { color: #57d68d; }
.mp-info .verdict { display: block; font-weight: 800; font-size: 15px; text-align: center; padding: 2px 0 5px; }
.mp-info.lost .verdict { color: #ff8a8c; }
.mp-info.won .verdict { color: #57d68d; }
.mines-panel .mainbtn { width: 100%; padding: 13px 14px; }
.mines-panel .mainbtn.cash { background: var(--green); animation: pulse 1.2s ease-in-out infinite; }
.mines-panel .random { width: 100%; }

.mboard { --n: 5; container-type: inline-size; display: grid; grid-template-columns: repeat(var(--n), 1fr); grid-template-rows: repeat(var(--n), 1fr); gap: clamp(4px, 1.8cqw, 12px); width: min(100cqw, 100cqh); aspect-ratio: 1; padding: clamp(6px, 2cqw, 14px); border-radius: 16px; background: #1b1c20; border: 1px solid var(--line); box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45); }
.tile { border-radius: clamp(6px, 1.6cqw, 12px); background: linear-gradient(#3d4049, #30323a); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.32), 0 2px 5px rgba(0, 0, 0, 0.35); font-size: calc(46cqw / var(--n)); line-height: 1; display: grid; place-items: center; transition: transform .1s, filter .15s, background .2s; }
.tile:not(:disabled):hover { transform: translateY(-3px); filter: brightness(1.2); }
.tile:not(:disabled):active { transform: scale(.95); }
.tile:disabled { cursor: default; }
.tile.safe { background: linear-gradient(#1f9558, #167240); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.25), 0 0 14px rgba(35, 165, 90, 0.35); }
.tile.pop { animation: pop .38s cubic-bezier(.2, .9, .3, 1.3); }
.tile.mine { background: linear-gradient(#b02a2f, #84202a); }
.tile.mine.ghost { opacity: .55; }
.tile.hit { animation: boom .55s ease-out; box-shadow: 0 0 0 3px #f23f42, 0 0 26px rgba(242, 63, 66, 0.8); }
.tile.dim { opacity: .35; }
@keyframes pop { 0% { transform: scale(.55); } 60% { transform: scale(1.14); } 100% { transform: scale(1); } }
@keyframes boom { 0% { transform: scale(.7); filter: brightness(2.2); } 40% { transform: scale(1.25); } 100% { transform: scale(1); filter: none; } }
.mboard.shake { animation: shake .55s ease-in-out; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 15% { transform: translateX(-7px); } 35% { transform: translateX(6px); } 55% { transform: translateX(-4px); } 75% { transform: translateX(3px); } }
@media (max-width: 900px) {
  .mines-wrap { grid-template-columns: 1fr; }
  .mboard { width: min(100%, 100vw); }
}
.mines-panel { overflow-x: hidden; }
.mines-panel .amtbox { flex-wrap: nowrap; gap: 3px; }
.mines-panel .mini { padding: 8px 8px; flex: none; }
.mines-panel .amt { padding: 8px 8px; font-size: 14px; }

/* correctifs Mines / fils à droite */
.mp-sec { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.mines-panel .amtbox { width: 100%; }
.mines-panel .seg { min-width: 0; }
.mp-info b { overflow-wrap: anywhere; text-align: right; }
.play { grid-template-rows: minmax(0, 1fr); }
.board { max-height: 100%; overflow-y: auto; scrollbar-width: thin; }
.feed .row { grid-template-columns: 22px minmax(0, 1fr) auto auto; }
.feed .row i { grid-column: auto; margin-top: 0; font-size: 11px; white-space: nowrap; }
.feed .row b { white-space: nowrap; }

/* ---------- Boutique ---------- */
.shop-main { overflow-y: auto; scrollbar-width: thin; padding-right: 4px; gap: 12px; }
.shop-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.sum { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; min-width: 0; }
.sum span { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.sum b { font-size: 20px; font-variant-numeric: tabular-nums; color: var(--yellow); white-space: nowrap; }
.sum i { font-style: normal; font-size: 11px; color: var(--faint); font-weight: 600; }
.sum.happy { border-color: rgba(240, 178, 50, .6); background: linear-gradient(135deg, rgba(240, 178, 50, .16), var(--panel)); }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.up { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 13px; display: grid; gap: 9px; align-content: start; min-width: 0; }
.up.maxed { border-color: rgba(35, 165, 90, .5); }
.up .uh { display: flex; gap: 10px; align-items: flex-start; }
.up .ico { font-size: 26px; line-height: 1; }
.up h3 { font-size: 15px; margin: 0; }
.up p { margin: 3px 0 0; font-size: 12px; color: var(--muted); line-height: 1.35; }
.up .stars { color: var(--yellow); letter-spacing: 3px; font-size: 15px; }
.up .rows { display: grid; gap: 4px; }
.up .rows > div { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); font-weight: 600; }
.up .rows b { color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.up .rows b.good { color: #57d68d; }
.prog { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.prog i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--blurple), #57d68d); transition: width .35s; }
.up small { font-size: 12px; color: var(--faint); font-weight: 600; min-height: 15px; }
.up .buy, .up .give { width: 100%; padding: 11px 14px; }
.up .buy:disabled { opacity: .45; }
.up.pot .donate { display: grid; gap: 8px; }
.up.pot .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.up.pot .chip { width: 42px; height: 42px; font-size: 10px; }
.up.pot .amt { width: 100%; }
.shop-hist h4 { margin: 4px 0 6px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.shop-hist .empty { margin: 0; color: var(--faint); font-size: 13px; }
.hrow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; padding: 6px 4px; font-size: 13px; border-bottom: 1px solid var(--line); }
.hrow b { color: #ff8a8c; font-variant-numeric: tabular-nums; }
.hrow i { font-style: normal; color: var(--faint); }
.up .rows > div span { white-space: nowrap; }
