/* Deep Dive : thème « ponton de pêche ». Une seule matière pour toute l'interface : teck goudronné et laiton patiné
   (le sondeur de la scène est le seul écran). Lac turquoise puis noir des abysses dans la scène, émail pour les boutons. */
:root {
  --bb-tar: #150d07;
  --bb-teak: #26180d;
  --bb-teak-2: #37240f;
  --bb-rim: #5b4320;
  --bb-brass: #c9a04e;
  --bb-brass-hi: #f1d68a;
  --bb-brass-lo: #7a5a22;
  --bb-cream: #f6ead2;
  --bb-muted: #b79f7c;
  --bb-foam: #e9fbff;
  --bb-teal: #58dff0;
  --bb-amber: #ffa23c;
  --bb-display: Poppins, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --bb-serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* planches : joints horizontaux, fil du bois, vernis sombre */
  --bb-wood:
    linear-gradient(180deg, rgba(255,214,160,.05), rgba(0,0,0,.2)),
    repeating-linear-gradient(180deg, rgba(0,0,0,0) 0 45px, rgba(0,0,0,.42) 45px 46.5px, rgba(255,214,160,.06) 46.5px 47.5px),
    repeating-linear-gradient(179.3deg, rgba(255,200,140,.04) 0 1.5px, rgba(0,0,0,0) 1.5px 6px, rgba(0,0,0,.07) 6px 7.5px, rgba(0,0,0,0) 7.5px 13px),
    linear-gradient(180deg, #2e1d10, #1b1109);
  --bb-brass-grad: linear-gradient(180deg, #f6de96 0%, #c9a04e 46%, #8a6628 100%);
  /* variables communes (barre du haut, menu, fenêtres) ramenées dans la palette */
  --bg: #090c0d;
  --panel: #21150c;
  --panel-2: #170f08;
  --panel-3: #110a05;
  --border: #46311c;
  --border-light: #6a4c2a;
  --muted: #b79f7c;
  --accent: #c9a04e;
  --green: #4fd08a;
  --stage-bg: #06303c;
}
body { --page-bg: radial-gradient(1200px 520px at 50% -10%, #12313a 0%, #0b1518 46%, var(--bg) 78%); color: var(--bb-cream); }
.topbar { background: linear-gradient(180deg, #24170d, #170f08); border-bottom-color: #000; }
.logo { color: var(--bb-brass-hi); font-family: var(--bb-display); gap: 8px; text-shadow: 0 1px 0 rgba(0,0,0,.6); }
.hub-link { border-color: var(--border); }
button:focus-visible, input:focus-visible, .bb-sw input:focus-visible + .trk { outline: 2px solid var(--bb-brass-hi); outline-offset: 2px; }
kbd { font: 700 10px/1 var(--font); padding: 3px 5px; border-radius: 4px; background: rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.28); letter-spacing: .02em; }
@media (hover: none), (pointer: coarse) { kbd, .bb-keys { display: none !important; } }

/* ========= Scène ========= */
.bb-stage { border-color: var(--bb-rim); box-shadow: inset 0 0 0 1px #000, 0 0 0 1px rgba(241,214,138,.12), 0 12px 40px rgba(0,0,0,.5); }
.bb-stage .stage-footer { background: #170f08; border-top-color: var(--border); color: var(--bb-muted); }
.bb-stage .stage-footer .pf svg { color: var(--bb-brass); }
.bb-stage .stage-footer .pf b, .side-footer b { color: var(--bb-brass-hi); }
.bb-stage .stage-footer .hash { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; opacity: .8; }
.bb-stage .stage-footer .brand { font-weight: 600; letter-spacing: 0; }

/* attente : plaquette de teck, anneau du compte à rebours */
.bb-wait { justify-content: flex-end; padding-bottom: 6.5%; }
.bb-wait-card { display: flex; align-items: center; gap: 12px; padding: 8px 20px 8px 9px; border-radius: 30px; background: var(--bb-wood); border: 1px solid var(--bb-rim); box-shadow: inset 0 1px 0 rgba(255,226,170,.22), 0 0 0 1px #000, 0 10px 26px rgba(0,0,0,.5); animation: bbUp .28s cubic-bezier(.2,.9,.3,1.2); }
.bb-count { position: relative; width: 46px; height: 46px; flex: 0 0 auto; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #0e2a33, #04141a); box-shadow: inset 0 2px 5px rgba(0,0,0,.7), 0 0 0 2px var(--bb-brass-lo); }
.bb-count svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.bb-count circle { fill: none; stroke-width: 3.4; }
.bb-count .trk { stroke: rgba(255,255,255,.1); }
.bb-count .arc { stroke: var(--bb-brass-hi); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 0; }
@keyframes bbCount { to { stroke-dashoffset: 100; } }
.bb-count b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 800 20px/1 var(--bb-display); color: var(--bb-foam); font-variant-numeric: tabular-nums; }
.bb-count.beat b { animation: bbBeat .36s cubic-bezier(.3,1.7,.5,1); }
@keyframes bbBeat { 0% { transform: scale(1.5); } 100% { transform: none; } }
.bb-wait-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bb-wait-txt b { font: 800 17px/1.15 var(--bb-display); color: var(--bb-cream); letter-spacing: .01em; white-space: nowrap; }
.bb-wait-txt span { font: italic 400 13px/1.2 var(--bb-serif); color: var(--bb-muted); white-space: nowrap; }
.bb-wait.ready .bb-wait-txt b { color: #8ff0b6; }
@keyframes bbUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* palier franchi : multiplicateur et nom de la strate */
.bb-mile { position: absolute; top: 10px; left: 50%; z-index: 4; display: flex; align-items: baseline; gap: 9px; padding: 6px 15px 7px; border-radius: 20px; white-space: nowrap; pointer-events: none; background: rgba(4,20,27,.86); border: 1px solid rgba(143,233,220,.55); box-shadow: 0 6px 18px rgba(0,0,0,.45); transform: translateX(-50%); opacity: 0; }
.bb-mile b { font: 800 17px/1 var(--bb-display); color: #9ff3e6; font-variant-numeric: tabular-nums; }
.bb-mile span { font: italic 400 14px/1 var(--bb-serif); color: var(--bb-cream); }
.bb-mile.gold { border-color: var(--bb-brass); }
.bb-mile.gold b { color: #ffd45e; }
.bb-mile.in { animation: bbMileIn .3s cubic-bezier(.2,1.5,.4,1) forwards; }
.bb-mile.out { animation: bbMileOut .24s ease-in forwards; }
@keyframes bbMileIn { from { opacity: 0; transform: translate(-50%, -12px) scale(.9); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes bbMileOut { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, -8px); } }

/* prise remontée : la pesée */
.bb-catch { position: absolute; right: 62px; bottom: 9%; z-index: 4; width: 250px; display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border-radius: 14px; pointer-events: none; background: var(--bb-wood); border: 1px solid var(--bb-brass-lo); box-shadow: inset 0 1px 0 rgba(255,226,170,.22), 0 0 0 1px #000, 0 12px 30px rgba(0,0,0,.55); opacity: 0; }
.bb-catch-fish { flex: 0 0 92px; height: 58px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 40%, #1c5f6e, #062430 78%); box-shadow: inset 0 2px 6px rgba(0,0,0,.6), 0 0 0 1px var(--bb-brass-lo); overflow: hidden; }
.bb-catch-fish img { width: 100%; height: auto; display: block; }
.bb-catch-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.bb-catch-top { display: flex; align-items: center; gap: 6px; font: 600 10.5px/1.2 var(--font); color: var(--bb-muted); white-space: nowrap; }
.bb-catch-top em { position: absolute; right: 10px; top: -15px; font-style: normal; font-weight: 800; color: #2a1600; background: var(--bb-brass-grad); border: 1px solid #4a3410; border-radius: 9px; padding: 3px 8px; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.bb-catch-body > b { font: italic 700 16px/1.15 var(--bb-serif); color: var(--bb-cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-catch-row { display: flex; align-items: center; gap: 8px; font: 700 11.5px/1.2 var(--font); color: var(--bb-foam); font-variant-numeric: tabular-nums; }
.bb-scale { display: inline-flex; align-items: center; gap: 4px; color: var(--bb-brass-hi); }
.bb-scale svg { width: 15px; height: 15px; }
.bb-scale i { font-style: normal; color: var(--bb-cream); }
.bb-scale .ndl { transform-origin: 10px 10px; }
.bb-catch.in .bb-scale .ndl { animation: bbNeedle .9s cubic-bezier(.3,1.6,.5,1) .12s both; }
@keyframes bbNeedle { 0% { transform: rotate(-110deg); } 60% { transform: rotate(18deg); } 100% { transform: none; } }
.bb-catch-win { font: 800 19px/1.1 var(--bb-display); color: #ffd45e; font-variant-numeric: tabular-nums; text-shadow: 0 1px 0 rgba(0,0,0,.6); }
.bb-catch.half { border-color: #1c8b98; }
.bb-catch.half .bb-catch-win { color: var(--bb-teal); }
.bb-catch.in { animation: bbCatchIn .32s cubic-bezier(.2,1.4,.4,1) forwards; }
.bb-catch.out { animation: bbCatchOut .24s ease-in forwards; }
@keyframes bbCatchIn { from { opacity: 0; transform: translateX(26px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes bbCatchOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-10px); } }

/* la ligne a cassé : profondeur finale, ce qu'il est advenu de ma mise, prochain lancer */
.bb-end { position: absolute; left: 50%; bottom: 6.5%; z-index: 4; min-width: 230px; max-width: min(84%, 440px); padding: 10px 18px 11px; border-radius: 14px; text-align: center; pointer-events: none; background: linear-gradient(180deg, rgba(60,16,16,.94), rgba(26,8,8,.95)); border: 1px solid #8a3a34; box-shadow: inset 0 1px 0 rgba(255,190,180,.18), 0 0 0 1px #000, 0 12px 30px rgba(0,0,0,.55); transform: translateX(-50%); opacity: 0; }
.bb-end-title { font: 800 19px/1.2 var(--bb-display); color: #ffc2c2; letter-spacing: .01em; }
.bb-end-sub { font: italic 400 13px/1.3 var(--bb-serif); color: var(--bb-cream); opacity: .85; }
.bb-end-mine { margin-top: 5px; font: 600 12.5px/1.3 var(--font); color: var(--bb-cream); }
.bb-end-mine.won { color: #8ff0b6; }
.bb-end-mine.lost { color: #ffb3a8; }
.bb-end-next { margin-top: 5px; font: 500 11.5px/1.2 var(--font); color: var(--bb-muted); }
.bb-end-next b { color: var(--bb-cream); font-variant-numeric: tabular-nums; }
.bb-end.in { animation: bbEndIn .26s cubic-bezier(.2,1.4,.4,1) forwards; }
@keyframes bbEndIn { from { opacity: 0; transform: translate(-50%, 12px) scale(.94); } to { opacity: 1; transform: translate(-50%, 0); } }

/* carnet de pêche : accès depuis la scène */
.bb-logbtn { position: absolute; left: 10px; bottom: 10px; z-index: 4; height: 36px; min-width: 36px; padding: 0 12px 0 10px; display: inline-flex; align-items: center; gap: 6px; border-radius: 18px; color: #2a1600; background: var(--bb-brass-grad); border: 1px solid #4a3410; box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 4px 12px rgba(0,0,0,.5); font: 800 12px/1 var(--bb-display); font-variant-numeric: tabular-nums; }
.bb-logbtn:hover { filter: brightness(1.08); }
.bb-logbtn.ping { animation: bbPing .5s ease-out 3; }
@keyframes bbPing { 50% { transform: scale(1.14); } }
.bb-tip { position: fixed; z-index: 60; padding: 5px 9px; border-radius: 7px; pointer-events: none; white-space: nowrap; background: #0b1d24; border: 1px solid var(--bb-brass-lo); color: var(--bb-cream); font: 600 11px/1.2 var(--font); font-variant-numeric: tabular-nums; box-shadow: 0 6px 16px rgba(0,0,0,.5); }

/* toasts (messages du jeu) */
.toast.info { background: #21150c; border-color: var(--bb-rim); }
.toast.error { background: #3a1210; border-color: #a8443c; }
.toasts { top: 46px; }

/* ========= Historique : tendance façon sondeur, plaquettes ========= */
.history-bar { gap: 8px; }
.bb-trend { align-self: flex-start; flex: 0 0 auto; height: 28px; margin-top: 1px; padding: 0 3px; display: flex; align-items: flex-start; gap: 2px; border-top: 2px solid rgba(233,251,255,.7); }
.bb-trend .b { position: relative; flex: 0 0 4px; width: 4px; min-height: 2px; padding: 0; border: 0; border-radius: 0 0 2px 2px; background: #4a97a3; cursor: pointer; }
.bb-trend .b::before { content: ""; position: absolute; left: -1px; right: -1px; top: 0; height: 28px; }
.bb-trend .b:hover { background: var(--bb-foam); }
.bb-trend .b.now { background: var(--bb-brass-hi); }
.bb-trend .b.over::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; border-radius: 1px; background: #ffd45e; }
.bb-trend .b.ghost { height: 5px; background: rgba(233,251,255,.16); cursor: default; }
.chip { background: #0f0905; border: 1px solid #33241a; line-height: 16px; font-variant-numeric: tabular-nums; }
/* paliers des plaquettes : une seule teinte en deux pas pour moins de 2x puis 2x à 10x ; l'or (et son liseré) est réservé à 10x et plus */
.chip.lo { color: #6fb3bd; }
.chip.mid { color: #b9f7ee; }
.chip.hi { color: #ffd45e; border-color: var(--bb-brass-lo); }
.chip.inplay { color: var(--bb-amber); border-color: #6a4418; animation: bbPulse 1.2s ease-in-out infinite; }
@keyframes bbPulse { 50% { opacity: .55; } }
.history-toggle { background: var(--panel); border-color: var(--bb-rim); color: var(--bb-brass); gap: 3px; }
.history-toggle .chev { transition: transform .15s; }
.history-expanded { background: var(--bb-wood); border-color: var(--bb-rim); }

/* ========= Panneau latéral ========= */
.bb-side { background: var(--bb-wood); border: 1px solid var(--bb-rim); box-shadow: inset 0 1px 0 rgba(255,226,170,.12); }
.bb-tabs { display: grid; grid-template-columns: minmax(min-content, 1fr) minmax(min-content, 1.25fr) minmax(min-content, .8fr) minmax(min-content, 1fr); gap: 3px; width: calc(100% - 16px); margin: 8px 8px 6px; padding: 3px; border-radius: 12px; background: rgba(0,0,0,.42); box-shadow: inset 0 1px 3px rgba(0,0,0,.6); }
.bb-tabs .tab { min-height: 36px; padding: 0 6px; border-radius: 9px; font: 700 12px/1.1 var(--font); color: var(--bb-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-tabs .tab:hover { color: var(--bb-cream); }
.bb-tabs .tab.active { color: #2a1600; background: var(--bb-brass-grad); box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 1px 3px rgba(0,0,0,.5); }
.bets-title { color: var(--bb-muted); font-size: 11.5px; letter-spacing: 0; }
.bets-count { font: 800 20px/1.1 var(--bb-display); color: var(--bb-cream); font-variant-numeric: tabular-nums; }
.bb-players { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--bb-muted); background: rgba(0,0,0,.4); border: 1px solid #3a2a18; border-radius: 14px; padding: 5px 10px; }
.bb-players svg { color: var(--bb-brass); }
.bb-players b { color: var(--bb-cream); font-size: 12px; font-variant-numeric: tabular-nums; }
.bets-live b { color: var(--bb-cream); }
.bets-live .up { color: #8ff0b6; }
.bets-live .down { color: #ff9f94; }
.bets-table-head { color: var(--bb-muted); }
.bet-row { background: rgba(0,0,0,.36); border-color: rgba(255,214,160,.05); font-variant-numeric: tabular-nums; }
.bet-row .u img { box-shadow: 0 0 0 1px rgba(201,160,78,.45); }
.bet-row .u span { color: #cdb894; }
.bet-row.cashed { background: linear-gradient(90deg, rgba(31,120,78,.5), rgba(18,70,48,.42)); border-color: rgba(120,224,160,.36); }
.bet-row.lost { background: rgba(70,20,18,.5); border-color: rgba(170,70,60,.36); }
.bet-row.lost .w { color: #ff9f94; }
.bet-row.me { background: rgba(88,62,18,.5); border-color: var(--bb-brass); }
.bet-row.me.cashed { background: linear-gradient(90deg, rgba(31,120,78,.6), rgba(18,70,48,.5)); border-color: var(--bb-brass-hi); }
.bet-row.rowme .u span { color: #fff; font-weight: 700; }
.bet-row .u .dt { color: var(--bb-muted); font-size: 11px; }
.bet-row .w small { color: var(--bb-teal); font-weight: 700; margin-left: 4px; }
.mult-chip { background: rgba(0,0,0,.55); }
.mult-chip.lo { color: #8cc6cf; }
.mult-chip.mid { color: #b9f7ee; }
.mult-chip.hi { color: #ffd45e; box-shadow: inset 0 0 0 1px var(--bb-brass-lo); }
.mult-chip.half { color: var(--bb-teal); }
.side-footer { border-top-color: rgba(0,0,0,.5); box-shadow: inset 0 1px 0 rgba(255,214,160,.06); color: var(--bb-muted); }
.side-footer b.neg { color: #ff9f94; }
.empty { color: var(--bb-muted); font: italic 400 13px/1.4 var(--bb-serif); }

/* ========= Carnet de pêche ========= */
.bb-log-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.bb-log { padding: 4px 8px 10px; }
.modal-body .bb-log { padding: 0; }
.bb-log-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bb-log-stats .st { min-width: 0; padding: 7px 9px 8px; border-radius: 9px; background: rgba(0,0,0,.4); border: 1px solid rgba(255,214,160,.07); display: flex; flex-direction: column; gap: 2px; }
.bb-log-stats .st span { font: 500 10.5px/1.2 var(--font); color: var(--bb-muted); }
.bb-log-stats .st b { font: 800 14px/1.2 var(--bb-display); color: var(--bb-cream); font-variant-numeric: tabular-nums; text-wrap: balance; }
.bb-log-stats .st i { font: italic 400 11px/1.1 var(--bb-serif); color: var(--bb-muted); }
.bb-log-meter { height: 6px; margin: 9px 1px 8px; border-radius: 3px; background: rgba(0,0,0,.5); box-shadow: inset 0 1px 2px rgba(0,0,0,.6); overflow: hidden; }
.bb-log-meter i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #c9a04e, #f1d68a); transform-origin: 0 50%; transition: transform .5s cubic-bezier(.2,.9,.3,1); }
.bb-log-empty { margin: 0 2px 8px; font: italic 400 13px/1.35 var(--bb-serif); color: var(--bb-cream); }
.bb-log-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.modal-body .bb-log-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bb-log .sp { min-width: 0; padding: 5px 5px 7px; border-radius: 10px; text-align: center; background: radial-gradient(120% 90% at 50% 20%, #1a5564, #071f2a 80%); border: 1px solid var(--bb-brass-lo); box-shadow: inset 0 1px 0 rgba(255,255,255,.1); display: flex; flex-direction: column; align-items: center; gap: 1px; }
.bb-log .sp img { width: 100%; max-width: 104px; height: auto; aspect-ratio: 104 / 56; display: block; }
.bb-log .sp b { max-width: 100%; min-height: 2.3em; display: flex; align-items: center; justify-content: center; font: italic 700 12.5px/1.15 var(--bb-serif); color: var(--bb-cream); text-wrap: balance; overflow-wrap: anywhere; }
.bb-log .sp span { font: 600 10.5px/1.1 var(--font); color: var(--bb-brass-hi); font-variant-numeric: tabular-nums; }
.bb-log .sp.no { background: rgba(0,0,0,.36); border: 1px dashed #4a3a26; box-shadow: none; }
.bb-log .sp.no b { color: #6f5c44; font-style: normal; }
.bb-log .sp.no span { color: #8b7558; }
.bb-log .sp.rare.got { border-color: #ffd45e; box-shadow: inset 0 0 14px rgba(255,212,94,.25); }
.bb-log-session { display: flex; align-items: baseline; gap: 10px; margin: 10px 2px 0; padding-top: 8px; border-top: 1px solid rgba(255,214,160,.1); font: 500 11.5px/1.2 var(--font); color: var(--bb-muted); font-variant-numeric: tabular-nums; }
.bb-log-session b { color: var(--bb-cream); font-weight: 700; }
.bb-log-session b:last-child { margin-left: auto; }
.bb-log-session b.pos { color: #8ff0b6; }
.bb-log-session b.neg { color: #ff9f94; }
.bb-log-note { margin: 8px 2px 0; font: italic 400 11.5px/1.35 var(--bb-serif); color: var(--bb-muted); }

/* ========= Pont de mise ========= */
.bb-betbox { position: relative; display: grid; grid-template-columns: minmax(236px, 290px) minmax(0, 1fr) minmax(250px, 300px); gap: 14px; align-items: stretch; padding: 12px 14px 12px; border-radius: var(--radius); background: var(--bb-wood); border: 1px solid var(--bb-rim); box-shadow: inset 0 1px 0 rgba(255,226,170,.14), inset 0 0 0 1px rgba(0,0,0,.5); }
/* cordage en tête du pont */
.bb-betbox::before { content: ""; position: absolute; left: 12px; right: 12px; top: -3px; height: 5px; border-radius: 3px; background: repeating-linear-gradient(115deg, #e0c592 0 3px, #a5855a 3px 6px); box-shadow: 0 1px 2px rgba(0,0,0,.6); }
.bb-betbox[data-state="active"] { border-color: var(--bb-brass); }
.bb-zone-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; margin-bottom: 6px; font: 600 11.5px/1 var(--font); color: var(--bb-muted); }
.bb-stake { min-width: 0; display: flex; flex-direction: column; }
.bb-same { display: inline-flex; align-items: center; gap: 5px; height: 36px; margin: -8px 0 -6px; padding: 0 10px; border-radius: 18px; background: rgba(0,0,0,.4); border: 1px solid var(--bb-brass-lo); color: var(--bb-brass-hi); font: 700 11.5px/1 var(--font); white-space: nowrap; }
.bb-same b { color: var(--bb-cream); font-variant-numeric: tabular-nums; }
.bb-same:hover { border-color: var(--bb-brass); background: rgba(0,0,0,.55); }
.bb-amount-row { display: flex; align-items: center; gap: 6px; }
.bb-step { flex: 0 0 42px; width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #2a1600; background: var(--bb-brass-grad); border: 1px solid #4a3410; box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 2px 5px rgba(0,0,0,.5); }
.bb-step:hover { filter: brightness(1.08); }
.bb-amount-well { flex: 1; min-width: 0; height: 42px; display: flex; align-items: center; padding: 0 12px; border-radius: 21px; background: #0d0805; border: 1px solid var(--bb-rim); box-shadow: inset 0 2px 5px rgba(0,0,0,.75); }
.bb-amount-well .amount-input { font: 800 20px/1 var(--bb-display); color: var(--bb-cream); font-variant-numeric: tabular-nums; }
.bb-amount-well .cur { font: 600 10.5px/1 var(--font); color: var(--bb-muted); }
.bb-chips { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 7px; }
.bb-chips button { height: 36px; border-radius: 9px; background: rgba(0,0,0,.42); border: 1px solid #3f2d19; color: var(--bb-cream); font: 700 12.5px/1 var(--font); font-variant-numeric: tabular-nums; box-shadow: inset 0 1px 0 rgba(255,226,170,.08); }
.bb-chips button:hover { border-color: var(--bb-brass); background: rgba(0,0,0,.6); }
.bb-chips button.alt { color: var(--bb-brass-hi); border-color: #5b4320; }
.bb-betbox.locked .bb-stake { opacity: .5; pointer-events: none; }

.bb-actions { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.bb-btns { display: flex; gap: 8px; min-height: 74px; flex: 1; }
.bb-main, .bb-half { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 0 10px; border-radius: 16px; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.45); transition: filter .12s; }
.bb-main { flex: 1 1 60%; }
.bb-half { flex: 1 1 40%; }
.bb-main .lbl, .bb-half .lbl { font: 800 13px/1.1 var(--bb-display); letter-spacing: .09em; white-space: nowrap; }
.bb-main .amt, .bb-half .amt { font: 800 25px/1.1 var(--bb-display); font-variant-numeric: tabular-nums; }
.bb-half .lbl { font-size: 11.5px; letter-spacing: .06em; }
.bb-half .amt { font-size: 20px; }
.bb-main .amt:empty, .bb-half .amt:empty { display: none; }
.bb-main kbd, .bb-half kbd { position: absolute; right: 9px; top: 8px; color: inherit; opacity: .85; text-shadow: none; }
/* émail : vert pour miser, rouge pour annuler, or pour retirer, bleu canard pour la moitié ; liseré de laiton */
.bb-main.bet { background: linear-gradient(180deg, #3fcf82 0%, #1f9b57 52%, #14763f 100%); border: 1px solid #0b4424; box-shadow: inset 0 1px 0 rgba(255,255,255,.5), inset 0 -4px 0 rgba(0,0,0,.22), 0 0 0 2px var(--bb-brass-lo), 0 6px 14px rgba(0,0,0,.45); }
.bb-main.cancel { background: linear-gradient(180deg, #ee5a4c 0%, #c52c26 52%, #981a18 100%); border: 1px solid #5a0e0c; box-shadow: inset 0 1px 0 rgba(255,255,255,.42), inset 0 -4px 0 rgba(0,0,0,.24), 0 0 0 2px var(--bb-brass-lo), 0 6px 14px rgba(0,0,0,.45); }
.bb-main.cashout { color: #2a1600; text-shadow: 0 1px 0 rgba(255,255,255,.4); background: linear-gradient(180deg, #ffe07a 0%, #f6b426 52%, #d48508 100%); border: 1px solid #6a3c00; box-shadow: inset 0 1px 0 rgba(255,255,255,.7), inset 0 -4px 0 rgba(120,60,0,.28), 0 0 0 2px var(--bb-brass-hi), 0 6px 18px rgba(246,180,38,.35); }
.bb-main.cashout::after { content: ""; position: absolute; inset: -5px; border-radius: 20px; border: 2px solid rgba(255,212,94,.7); opacity: 0; pointer-events: none; animation: bbHalo 1.1s ease-out infinite; }
@keyframes bbHalo { 0% { opacity: .9; transform: scale(.97); } 100% { opacity: 0; transform: scale(1.05); } }
.bb-half { background: linear-gradient(180deg, #46d6e2 0%, #1799a8 52%, #0c6e7b 100%); border: 1px solid #06404a; box-shadow: inset 0 1px 0 rgba(255,255,255,.5), inset 0 -4px 0 rgba(0,0,0,.22), 0 0 0 2px var(--bb-brass-lo), 0 6px 14px rgba(0,0,0,.45); }
.bb-main:hover, .bb-half:hover { filter: brightness(1.07); }
.bb-main:active, .bb-half:active { filter: brightness(.94); }
.bb-main.flash, .bb-half.flash { animation: flash .5s ease-out; }
.bb-halfdone { flex: 1 1 40%; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 0 8px; border-radius: 16px; background: rgba(6,48,58,.6); border: 1px dashed #1c8b98; text-align: center; }
.bb-halfdone span { font: 600 11px/1.1 var(--font); color: var(--bb-teal); }
.bb-halfdone b { font: 800 13.5px/1.1 var(--bb-display); color: var(--bb-foam); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bb-actions .bet-note { visibility: visible; height: auto; min-height: 16px; margin: 6px 0 -2px; font: italic 400 12.5px/1.25 var(--bb-serif); color: var(--bb-muted); opacity: 0; }
.bb-actions .bet-note.show { opacity: 1; }

.bb-auto { min-width: 0; display: flex; flex-direction: column; }
.bb-auto-rows { display: flex; flex-direction: column; gap: 6px; flex: 1; justify-content: center; }
.bb-auto-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 2px 4px 2px 6px; border-radius: 12px; background: rgba(0,0,0,.3); border: 1px solid rgba(255,214,160,.07); }
.bb-auto-item.on { border-color: var(--bb-amber); background: rgba(60,34,6,.45); }
.bb-auto-item.half.on { border-color: #1c8b98; background: rgba(6,48,58,.45); }
.bb-sw { display: flex; align-items: center; gap: 8px; min-height: 36px; cursor: pointer; flex: 1 1 auto; min-width: 0; }
.bb-sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bb-sw .trk { position: relative; flex: 0 0 44px; width: 44px; height: 26px; border-radius: 13px; background: #0d0805; border: 1px solid var(--bb-rim); box-shadow: inset 0 2px 4px rgba(0,0,0,.7); transition: background .15s, border-color .15s; }
.bb-sw .trk i { position: absolute; left: 2px; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: linear-gradient(180deg, #d9c8a8, #8f7d5e); box-shadow: 0 1px 3px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.6); transition: transform .16s cubic-bezier(.3,1.4,.5,1); }
.bb-sw input:checked + .trk { background: linear-gradient(180deg, #b86a10, #ffa23c); border-color: #ffd7a8; }
.bb-auto-item.half .bb-sw input:checked + .trk { background: linear-gradient(180deg, #0f7482, #46d6e2); border-color: #b8f2f8; }
.bb-sw input:checked + .trk i { transform: translateX(18px); background: linear-gradient(180deg, #fff, #e9dcc0); }
.bb-sw .tx { font: 600 12px/1.15 var(--font); color: var(--bb-cream); white-space: nowrap; }
.bb-num { flex: 0 0 auto; display: flex; align-items: center; height: 36px; border-radius: 10px; background: #0d0805; border: 1px solid var(--bb-rim); box-shadow: inset 0 2px 4px rgba(0,0,0,.7); }
.bb-num .st { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; color: var(--bb-brass-hi); }
.bb-num .st:hover { color: #fff; }
.bb-num .auto-co-input { width: 50px; font: 800 14px/1 var(--bb-display); color: var(--bb-cream); text-align: right; font-variant-numeric: tabular-nums; }
.bb-num .x { margin: 0 2px 0 1px; color: var(--bb-muted); font: 700 12px/1 var(--font); }

/* ========= Fenêtres ========= */
.modal { background: var(--bb-wood); border-color: var(--bb-rim); }
.modal-head { background: linear-gradient(180deg, #3a2616, #26180d); border-bottom: 1px solid var(--bb-rim); }
.modal-title { font: 800 16px/1.2 var(--bb-display); color: var(--bb-brass-hi); letter-spacing: .01em; }
.modal-body { color: #e4d6ba; }
.modal-body h4 { color: var(--bb-brass-hi); font-weight: 700; }
.modal-body code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--bb-foam); background: #0d0805; border-radius: 5px; padding: 2px 5px; }
.modal-body b { color: var(--bb-cream); }
.kv .v { background: #0d0805; color: var(--bb-foam); }
.bb-res { color: var(--bb-brass-hi) !important; }
.bb-res small { font: italic 400 12px/1 var(--bb-serif); color: var(--bb-muted); margin-left: 6px; }
.limits .row, .stat { background: rgba(0,0,0,.4); border: 1px solid rgba(255,214,160,.07); }
.stat .k { color: var(--bb-muted); }
.stat .v { color: var(--bb-cream); font-family: var(--bb-display); font-variant-numeric: tabular-nums; }
.stat .v.pos { color: #8ff0b6; }
.stat .v.neg { color: #ff9f94; }
.btn { background: #3a2616; border: 1px solid var(--bb-rim); color: var(--bb-cream); min-height: 34px; }
.btn.primary { background: var(--bb-brass-grad); border-color: #4a3410; color: #2a1600; font-weight: 800; }
.fair-input input, .profile-field input { background: #0d0805; border-color: var(--bb-rim); color: var(--bb-cream); }
.mybets-table th { color: var(--bb-muted); border-bottom-color: var(--border); }
.mybets-table td { border-bottom-color: rgba(255,214,160,.07); font-variant-numeric: tabular-nums; }
.mybets-table tr.won td { color: #a8f2c6; }
.avatar-grid button.active { border-color: var(--bb-brass-hi); }
.profile-head img { border-color: var(--bb-brass); }
/* tutoriel : quatre étapes dessinées */
.bb-how { list-style: none; margin: 0; padding: 0; counter-reset: how; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bb-how li { counter-increment: how; position: relative; display: flex; gap: 12px; align-items: flex-start; margin: 0; padding: 12px; border-radius: 12px; background: rgba(0,0,0,.36); border: 1px solid rgba(255,214,160,.08); }
.bb-how li::before { content: counter(how); position: absolute; left: 6px; top: 6px; width: 19px; height: 19px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--bb-brass-grad); color: #2a1600; font: 800 11px/1 var(--bb-display); box-shadow: 0 1px 3px rgba(0,0,0,.5); }
.bb-how .ico { flex: 0 0 60px; width: 60px; height: 60px; border-radius: 50%; background: radial-gradient(circle at 50% 30%, #1c6272, #062430 76%); box-shadow: inset 0 2px 6px rgba(0,0,0,.6), 0 0 0 2px var(--bb-brass-lo); display: flex; align-items: center; justify-content: center; }
.bb-how .ico svg { width: 44px; height: 44px; }
.bb-how li b { display: block; margin-bottom: 3px; font: 800 14px/1.2 var(--bb-display); color: var(--bb-cream); }
.bb-how li span { font-size: 12.5px; line-height: 1.4; color: #d3c3a4; }
.bb-keys { margin: 12px 0 0 !important; padding-top: 10px; border-top: 1px solid rgba(255,214,160,.1); font: italic 400 12.5px/1.4 var(--bb-serif); color: var(--bb-muted); }

/* ========= Écrans intermédiaires : le retrait automatique passe sous la mise et les boutons ========= */
@media (max-width: 1239px) {
  .bb-betbox { grid-template-columns: minmax(230px, 300px) minmax(0, 1fr); row-gap: 10px; }
  .bb-auto { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 12px; padding-top: 9px; border-top: 1px solid rgba(0,0,0,.5); box-shadow: inset 0 1px 0 rgba(255,214,160,.06); }
  .bb-auto .bb-zone-head { margin: 0; flex: 0 0 auto; }
  .bb-auto-rows { flex-direction: row; gap: 8px; justify-content: flex-start; }
  .bb-auto-item { flex: 1 1 0; max-width: 300px; }
}

/* ========= Téléphone portrait : scène, puis le pont tient sous le pouce ========= */
@media (max-width: 1000px) {
  .bb-stage { height: clamp(260px, calc(100dvh - 392px), 520px); min-height: 0; max-height: none; }
  .bb-side { min-height: 380px; }
}
@media (max-width: 640px) {
  .logo { font-size: 16px; }
  .bb-stage { height: clamp(250px, calc(100dvh - 382px), 480px); }
  .bb-stage .stage-footer { display: none; }
  .bb-betbox { grid-template-columns: 1fr; gap: 8px; padding: 10px 9px 9px; }
  .bb-betbox::before { left: 8px; right: 8px; }
  .bb-zone-head { margin-bottom: 4px; min-height: 18px; }
  .bb-stake .bb-zone-head > span:first-child { display: none; }
  .bb-stake .bb-zone-head { position: absolute; right: 54px; top: -40px; z-index: 5; min-height: 0; margin: 0; }
  .bb-same { margin: 0; background: var(--bb-wood); box-shadow: 0 0 0 1px #000, 0 4px 12px rgba(0,0,0,.5); }
  .bb-chips { margin-top: 6px; }
  .bb-chips button { height: 38px; }
  .bb-btns { min-height: 64px; }
  .bb-main .amt { font-size: 23px; }
  .bb-half .lbl { font-size: 10.5px; letter-spacing: .03em; }
  .bb-half .amt { font-size: 18px; }
  .bb-actions .bet-note { margin: 4px 0 -3px; min-height: 15px; font-size: 12px; }
  .bb-auto { flex-direction: column; align-items: stretch; gap: 4px; padding-top: 6px; }
  .bb-auto .bb-zone-head { min-height: 0; margin: 0 2px; font-size: 11px; }
  .bb-auto-rows { width: 100%; gap: 6px; }
  .bb-auto-item { padding: 2px 3px 2px 5px; gap: 4px; max-width: none; }
  .bb-sw { gap: 6px; }
  .bb-sw .tx { font-size: 11.5px; }
  .bb-num .st { display: none; }
  .bb-num { padding: 0 6px 0 4px; }
  .bb-num .auto-co-input { width: 46px; }
  .bb-wait { padding-bottom: 54px; }
  .bb-wait-card { padding: 6px 16px 6px 7px; gap: 9px; }
  .bb-count { width: 40px; height: 40px; }
  .bb-count b { font-size: 18px; }
  .bb-wait-txt b { font-size: 15px; }
  .bb-wait-txt span { font-size: 12px; }
  .bb-end { bottom: 54px; padding: 8px 14px 9px; }
  .bb-end-title { font-size: 16px; }
  .bb-catch { right: 46px; bottom: 54px; width: 208px; gap: 8px; padding: 6px 9px 6px 6px; }
  .bb-catch-fish { flex-basis: 70px; height: 46px; }
  .bb-catch-body > b { font-size: 14px; }
  .bb-catch-win { font-size: 16px; }
  .bb-mile { top: 8px; padding: 5px 12px 6px; gap: 7px; }
  .bb-mile b { font-size: 15px; }
  .bb-mile span { font-size: 12.5px; }
  .toasts { top: 40px; }
  .bb-how { grid-template-columns: 1fr; }
  .modal-body .bb-log-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ========= Téléphone paysage : scène à gauche, pont de mise à droite ========= */
@media (orientation: landscape) and (max-height: 520px) {
  .bb-stage { height: auto; min-height: 0; max-height: none; }
  .bb-stage .stage-footer { display: none; }
  .bb-betbox { grid-column: 2; grid-row: 1 / span 2; grid-template-columns: 1fr; grid-template-rows: auto minmax(64px, 1fr) auto; gap: 6px; min-height: 0; overflow-y: auto; padding: 9px 8px 8px; }
  .bb-betbox::before { left: 8px; right: 8px; top: 0; height: 4px; }
  .bb-zone-head { min-height: 0; margin-bottom: 3px; font-size: 11px; }
  .bb-stake .bb-zone-head > span:first-child { display: none; }
  .bb-stake .bb-zone-head { position: static; order: 9; margin: 0; justify-content: flex-end; }
  .bb-same { margin: 5px 0 0; height: 36px; background: rgba(0,0,0,.4); box-shadow: none; }
  .bb-step { flex-basis: 38px; width: 38px; height: 38px; }
  .bb-amount-well { height: 38px; }
  .bb-amount-well .amount-input { font-size: 17px; }
  .bb-chips { margin-top: 5px; gap: 3px; }
  .bb-chips button { height: 36px; font-size: 11.5px; }
  .bb-btns { min-height: 58px; max-height: 104px; gap: 6px; }
  .bb-main, .bb-half, .bb-halfdone { border-radius: 13px; }
  .bb-main .lbl { font-size: 12px; }
  .bb-main .amt { font-size: 20px; }
  .bb-half .lbl { font-size: 10px; letter-spacing: .02em; }
  .bb-half .amt { font-size: 16px; }
  .bb-actions .bet-note { margin: 3px 0 -3px; min-height: 14px; font-size: 11.5px; }
  .bb-auto { grid-column: auto; flex-direction: column; align-items: stretch; gap: 3px; padding-top: 5px; }
  .bb-auto .bb-zone-head { min-height: 0; margin: 0 2px; font-size: 10.5px; }
  .bb-auto-rows { flex-direction: column; gap: 4px; }
  .bb-auto-item { max-width: none; min-height: 38px; flex: 0 0 auto; }
  .bb-num .auto-co-input { width: 44px; }
  .bb-wait { padding-bottom: 50px; }
  .bb-wait-card { padding: 5px 14px 5px 6px; gap: 8px; }
  .bb-count { width: 38px; height: 38px; }
  .bb-count b { font-size: 17px; }
  .bb-wait-txt b { font-size: 14px; }
  .bb-wait-txt span { font-size: 12px; }
  .bb-end { bottom: 8px; padding: 7px 14px 8px; }
  .bb-end-title { font-size: 15px; }
  .bb-end-sub { font-size: 12px; }
  .bb-end-mine, .bb-end-next { margin-top: 3px; }
  .bb-catch { right: 50px; bottom: 8px; width: 214px; gap: 8px; padding: 6px 9px 6px 6px; }
  .bb-catch-fish { flex-basis: 70px; height: 46px; }
  .bb-catch-body > b { font-size: 14px; }
  .bb-catch-win { font-size: 16px; }
  .bb-mile { top: 6px; }
  .bb-side { min-height: 300px; }
  .toasts { top: 36px; }
}

/* ========= Animations réduites ========= */
@media (prefers-reduced-motion: reduce) {
  .bb-main.cashout::after, .chip.inplay, .bb-logbtn.ping, .bb-count.beat b, .bb-catch.in .bb-scale .ndl { animation: none; }
  .bb-wait-card { animation: none; }
  .bb-mile.in, .bb-catch.in, .bb-end.in { animation-duration: .01s; }
  .bb-mile.out, .bb-catch.out { animation-duration: .01s; }
  .bb-sw .trk i, .bb-log-meter i { transition: none; }
}
