/* Capobi French Roulette – table, wheel, racetrack */
.hint{color:var(--muted);font-weight:400;font-size:.85em;text-transform:none;letter-spacing:0}
.table-panel{padding:16px clamp(10px,2vw,22px)}
/* layout: wheel + play controls side by side on top, table (felt) below */
.table-panel{display:grid;grid-template-columns:minmax(200px,270px) minmax(0,1fr) minmax(210px,270px);
  grid-template-areas:"wheel play stats" "felt felt felt" "rt rt rt" "lim lim lim";column-gap:18px;align-items:center}
.table-panel>.wheel-wrap{grid-area:wheel}.play-col{grid-area:play;min-width:0;display:flex;flex-direction:column}
.play-col .status-line{margin:0 0 8px;text-align:center}.table-panel>.stats{grid-area:stats;align-self:start}
.table-panel>.layout-wrap{grid-area:felt;margin-top:12px}.table-panel>.racetrack-wrap{grid-area:rt}.table-panel>.limits{grid-area:lim}
.wheel-wrap{position:relative;max-width:270px;width:100%;margin:0 auto}
.wheel{width:100%;height:auto;display:block;filter:drop-shadow(0 14px 30px #000a)}
.wheel .wn{fill:#fff;font-size:15px;font-weight:800;text-anchor:middle;dominant-baseline:central;font-family:system-ui,sans-serif}
.result-badge{position:absolute;left:35%;top:35%;width:30%;aspect-ratio:1;border-radius:50%;display:grid;place-content:center;text-align:center;
  border:4px solid #ffe083;box-shadow:0 0 30px #ffc83d99;animation:pop .5s cubic-bezier(.2,1.6,.4,1);color:#fff}
.result-badge b{font-size:clamp(1.6rem,6vw,2.6rem);line-height:1}
.result-badge small{font-size:.75rem;text-transform:uppercase;letter-spacing:.08em}
.result-badge.rouge{background:#d7263d}.result-badge.noir{background:#15121f}.result-badge.vert{background:#0f9d58}
.stats{min-width:0}
.stats .section-title{margin:10px 0 6px}
.status-line{font-size:1.35rem;font-weight:800;font-style:italic;color:var(--accent);letter-spacing:.02em}
.last-numbers{display:flex;flex-wrap:wrap;gap:5px}
.ball{display:inline-grid;place-items:center;min-width:28px;height:28px;border-radius:50%;font-weight:800;font-size:.8rem;color:#fff;border:2px solid #ffffff33;padding:0 3px}
.ball.rouge{background:#d7263d}.ball.noir{background:#15121f}.ball.vert{background:#0f9d58}
.ball.latest{transform:scale(1.2);border-color:#ffe083;box-shadow:0 0 12px #ffc83d88;margin-right:4px}
.ball.sm{min-width:22px;height:22px;font-size:.7rem}
.hotcold{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.hotcold .nums{display:flex;flex-wrap:wrap;gap:3px;align-items:center}
.hotcold sub{font-size:.65rem;color:var(--muted);margin-right:4px}
.dist{margin-top:10px}
.bar3{display:flex;height:22px;border-radius:8px;overflow:hidden;font-size:.7rem;font-weight:700}
.bar3 span{display:grid;place-items:center;white-space:nowrap;overflow:hidden;transition:flex .5s}
.bar3 .r{background:#d7263d}.bar3 .n{background:#15121f}.bar3 .z{background:#0f9d58}
.dist p{margin:6px 0 0}

.win-bar{margin:10px auto 0;text-align:center;min-height:2.6em;font-size:1.05rem;display:flex;align-items:center;justify-content:center;flex-direction:column}
.win-bar .big{font-size:1.5rem;font-weight:900;color:var(--accent);text-shadow:0 0 18px #ffc83d88}
.win-bar .sub{font-size:.85rem;color:var(--muted)}

/* felt */
.layout-wrap{width:100%;margin:0 auto}
.felt{position:relative;width:100%;background:radial-gradient(ellipse at center,#1f7a4d,#0e4a2e);border-radius:16px;border:6px solid #6b3e12;
  box-shadow:inset 0 0 40px #0008,0 10px 30px #0007;user-select:none;-webkit-user-select:none;touch-action:manipulation}
.felt.vert{max-width:420px;margin:0 auto}
.felt .cell{position:absolute;display:flex;flex-direction:column;align-items:center;justify-content:center;border:1px solid #e9dfb399;color:#fff;cursor:pointer;
  font-weight:800;transition:background .15s,box-shadow .15s;text-align:center;line-height:1.1;overflow:hidden}
.felt .num span{display:grid;place-items:center;width:72%;max-width:44px;aspect-ratio:1;border-radius:50%;font-size:clamp(.72rem,1.6vw,1.05rem)}
.felt .num.rouge span{background:#d7263d}.felt .num.noir span{background:#15121f}
.felt .zero{background:#0f9d58aa;border-radius:40px 0 0 40px}
.felt.vert .zero{border-radius:40px 40px 0 0}
.felt .zero span{font-size:1.4rem}
.felt .out b{font-size:clamp(.72rem,1.5vw,1rem)}
.felt .out small{font-size:clamp(.55rem,1.1vw,.72rem);font-weight:500;color:#e9f5ec;opacity:.85}
.felt .dia{display:inline-block;width:26px;height:26px;transform:rotate(45deg) scaleX(.7);border:2px solid #fff8}
.felt .dia.r{background:#d7263d}.felt .dia.n{background:#15121f}
.felt .cell.hl{background:#ffffff26;box-shadow:inset 0 0 0 2px #ffe08399}
.felt .cell.winning{background:#ffc83d55;box-shadow:inset 0 0 0 3px #ffe083,0 0 22px #ffc83d;animation:glow 1s ease-in-out infinite alternate;z-index:1}
@keyframes glow{from{opacity:.75}to{opacity:1}}
.felt .zone{position:absolute;z-index:3;cursor:pointer;border-radius:6px}
.felt .zone.hl{background:#ffe08355;box-shadow:0 0 0 1px #ffe083}
@media (hover:hover){.felt .cell:hover{background:#ffffff26;box-shadow:inset 0 0 0 2px #ffe08399}.felt .zone:hover{background:#ffe08355;box-shadow:0 0 0 1px #ffe083}}
.chips-layer{position:absolute;inset:0;pointer-events:none;z-index:4}
.chipmark{position:absolute;transform:translate(-50%,-50%);min-width:26px;height:26px;border-radius:50%;display:grid;place-items:center;font-size:.68rem;font-weight:900;color:#fff;
  border:3px dashed #fffa;box-shadow:0 3px 6px #000a;animation:chipin .2s ease-out;padding:0 2px}
@keyframes chipin{from{transform:translate(-50%,-120%) scale(1.4);opacity:0}}
.chipmark.hit{box-shadow:0 0 0 3px #ffe083,0 0 16px #ffc83d;animation:winpulse .7s ease-in-out infinite alternate}
.chipmark.partage{box-shadow:0 0 0 3px #7dd3fc}
.chipmark.lost{opacity:.4;filter:grayscale(.6)}
@keyframes winpulse{from{transform:translate(-50%,-50%) scale(1)}to{transform:translate(-50%,-50%) scale(1.15)}}
.c2{background:#8b8b9e}.c10{background:#2563eb}.c20{background:#16a34a}.c50{background:#d97706}.c100{background:#111;color:#ffe083}

/* racetrack */
.racetrack-wrap{margin-top:14px}
.rt-head{display:flex;justify-content:space-between;align-items:flex-end;flex-wrap:wrap;gap:8px}
.rt-head .section-title{margin:6px 0}
.rt-nb .seg button{min-width:40px;padding:5px 8px;font-size:.85rem}
.racetrack{width:100%;height:auto;display:block;max-width:860px;margin:6px auto 0;user-select:none}
.rt-bg{fill:#0e4a2e;stroke:#6b3e12;stroke-width:8}
.rt-sec{fill:#1f7a4d;stroke:#e9dfb3aa;stroke-width:2;cursor:pointer;transition:fill .15s}
.rt-sec:hover{fill:#2f9a63}
.rt-sec.zero{fill:#137a45}
.rt-lbl{fill:#fff;font-size:28px;font-weight:800;text-anchor:middle;pointer-events:none;font-family:system-ui,sans-serif}
.rt-lbl.sm{font-size:20px}
.rt-sub{fill:#e9f5ec;font-size:17px;text-anchor:middle;pointer-events:none;opacity:.8;font-family:system-ui,sans-serif}
.rt-num{cursor:pointer}
.rt-num circle{stroke:#e9dfb3;stroke-width:2;transition:stroke-width .1s}
.rt-num.rouge circle{fill:#d7263d}.rt-num.noir circle{fill:#15121f}.rt-num.vert circle{fill:#0f9d58}
.rt-num text{fill:#fff;font-size:20px;font-weight:800;text-anchor:middle;dominant-baseline:central;pointer-events:none;font-family:system-ui,sans-serif}
.rt-num:hover circle,.rt-num:focus circle{stroke:#ffe083;stroke-width:5;outline:none}
.rt-num.winning circle{stroke:#ffe083;stroke-width:6}

/* controls: chip + total + buttons on the left, SPIN (largest button) on the right, next to the wheel */
.controls-slot{min-width:0}
.controls{display:grid;grid-template-columns:minmax(0,auto) auto;grid-template-areas:"chips spin" "total spin" "btns btns";
  gap:10px 16px;align-items:center;justify-content:center;background:rgba(10,5,30,.35);border:1px solid var(--panel-b);border-radius:14px;padding:12px 14px}
.ctrl{display:flex;flex-direction:column;gap:5px}
.chip-ctrl{grid-area:chips}.controls .total{grid-area:total;flex-direction:row;align-items:baseline;flex-wrap:wrap;gap:4px 8px}
.controls .ctrl-buttons{grid-area:btns;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.controls .ctrl-buttons .btn{padding:8px 6px;font-size:.86rem;white-space:nowrap}
.spin-slot{grid-area:spin;display:grid;place-items:center}
.chips{display:flex;gap:6px}
.chip{width:46px;height:46px;border-radius:50%;border:4px dashed #fffc;color:#fff;font:inherit;font-weight:900;cursor:pointer;box-shadow:0 4px 10px #0008;transition:transform .12s}
.chip[aria-checked=true]{transform:translateY(-5px) scale(1.08);box-shadow:0 0 0 3px var(--accent),0 8px 18px #000a}
.total strong{font-size:1.2rem;color:var(--accent)}
.controls .btn.spin{width:112px;height:112px;font-size:1.6rem;letter-spacing:.08em;border-width:5px;
  box-shadow:0 0 0 4px #ffc83d55,0 0 28px #ffc83d88,0 10px 24px #000a}
.controls .btn.spin:not(:disabled){animation:spinglow 1.8s ease-in-out infinite alternate}
@keyframes spinglow{from{box-shadow:0 0 0 4px #ffc83d44,0 0 18px #ffc83d66,0 10px 24px #000a}to{box-shadow:0 0 0 6px #ffc83d77,0 0 36px #ffc83dbb,0 10px 24px #000a}}
.play-col .insufficient{margin:8px 0 0;text-align:center}
.limits{text-align:center;margin:8px 0 0}
body.busy .felt .zone,body.busy .felt .cell,body.busy .rt-num,body.busy .rt-sec{cursor:wait}

.ratios{width:100%;border-collapse:collapse;font-size:.8rem}
.ratios th,.ratios td{padding:4px 5px;border-bottom:1px solid #ffffff14;text-align:left;vertical-align:top}
.ratios td:nth-child(2),.ratios td:nth-child(3),.ratios th:nth-child(2),.ratios th:nth-child(3){text-align:right;white-space:nowrap}
.rules.sub{margin:4px 0 6px 16px}
.rules{margin-bottom:6px}

/* desktop: keep wheel, SPIN and the whole table inside one screen height where possible */
@media (min-width:1001px){.felt.horiz{max-width:max(600px,calc((100vh - 545px) * 2.33));margin:0 auto}}
/* medium widths: stats go under the table so wheel, SPIN and table stay together */
@media (max-width:1359px){
  .table-panel{grid-template-columns:minmax(200px,270px) minmax(0,1fr);grid-template-areas:"wheel play" "felt felt" "stats stats" "rt rt" "lim lim"}
  .table-panel>.stats{margin-top:6px}
}
/* phones and narrow tablets: wheel, SPIN directly under it, then the rest */
@media (max-width:760px){
  .table-panel{grid-template-columns:minmax(0,1fr);grid-template-areas:"wheel" "play" "felt" "stats" "rt" "lim"}
  .wheel-wrap{max-width:260px}
  .play-col{margin-top:10px}
  .play-col .status-line{order:2;margin:10px 0 0}.play-col .win-bar{order:3}.play-col .insufficient{order:4}
  .controls{grid-template-columns:minmax(0,1fr);grid-template-areas:"spin" "chips" "total" "btns";justify-items:center;padding:10px}
  .controls .total{justify-content:center}
  .chip-ctrl{align-items:center}
}
@media (max-width:640px){
  .table-panel{padding:12px 6px}
  .status-line{font-size:1.1rem;text-align:center}
  .chip{width:42px;height:42px}
  .controls .btn.spin{width:96px;height:96px;font-size:1.4rem}
  .controls .ctrl-buttons{width:100%}
  .controls .ctrl-buttons .btn{padding:8px 2px;font-size:.8rem}
  .felt .num span{font-size:.85rem}
  .chipmark{min-width:22px;height:22px;font-size:.6rem;border-width:2px}
}
/* phones: once the controls under the wheel scroll out of view they dock as a compact bar at the bottom (chip picker, total, SPIN) */
body.controls-docked .controls{position:fixed;left:0;right:0;bottom:0;z-index:30;margin:0;border-radius:16px 16px 0 0;border-bottom:none;
  background:rgba(20,10,50,.94);backdrop-filter:blur(8px);box-shadow:0 -8px 24px #0009;
  grid-template-columns:auto minmax(0,1fr) auto;grid-template-areas:"chips total spin";gap:8px;padding:8px 10px calc(8px + env(safe-area-inset-bottom));justify-items:stretch;
  animation:dockin .18s ease-out}
body.controls-docked .controls .ctrl-buttons,body.controls-docked .controls .ctrl-label{display:none}
body.controls-docked .controls .chips{gap:4px}
body.controls-docked .controls .chip{width:38px;height:38px;border-width:3px;font-size:.78rem}
body.controls-docked .controls .chip[aria-checked=true]{transform:translateY(-3px) scale(1.06)}
body.controls-docked .controls .total{flex-direction:column;align-items:center;gap:0;text-align:center}
body.controls-docked .controls .total strong{font-size:.95rem;white-space:nowrap}
body.controls-docked .controls .total .small{font-size:.66rem}
body.controls-docked .controls .btn.spin{width:66px;height:66px;font-size:1.05rem;border-width:3px}
body.controls-docked .toasts{bottom:96px}
@keyframes dockin{from{transform:translateY(100%)}}
@media (max-width:640px){.top-actions{gap:5px;flex-wrap:nowrap;width:100%;justify-content:space-between}.icon-btn{padding:6px 7px;font-size:.9rem}.balance{padding:3px 8px}.balance-dbv{font-size:1rem}.balance-local{font-size:.66rem}.value-in select{padding:6px;max-width:76px}}
/* result banner over the wheel (js/result-banner.js + css/result-banner.css) */
.wheel-wrap .rb-live{width:min(100%,300px)}
.rb-num{display:flex;flex-direction:column;align-items:center;gap:5px}
.rb-ball{display:grid;place-items:center;width:64px;height:64px;border-radius:50%;font-size:2rem;font-weight:900;color:#fff;border:3px solid #ffe7a3;box-shadow:0 4px 14px #0009,inset 0 -4px 8px #0006}
.rb-ball.rouge{background:#d7263d}.rb-ball.noir{background:#15121f}.rb-ball.vert{background:#0f9d58}
.rb-attrs{font-size:.8rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:#f4f1ff}
.wheel-wrap .rb-card{padding:12px 12px 8px}
.wheel-wrap{container-type:inline-size}
.wheel-wrap .rb-win .rb-title{font-size:clamp(1.1rem,9.2cqi,1.9rem)}
.wheel-wrap .rb-push .rb-title{font-size:clamp(1rem,7.4cqi,1.45rem)}
.wheel-wrap .rb-ball{width:clamp(48px,24cqi,64px);height:clamp(48px,24cqi,64px);font-size:clamp(1.5rem,12cqi,2rem)}
