/* American roulette: lobby, table, betting layout (js/roulette.js) */
/* ===================== WHICH SCREEN ===================== */
body:not([data-game="roulette"]) .rl-only,body.in-games .rl-only{display:none !important}
body[data-game="roulette"] .bj-only{display:none !important}
body:not(.rl-table) .rl-stage{display:none}
body.rl-table #menu{display:none}

/* ===================== LOBBY ===================== */
.rl-mini{
  position:relative;aspect-ratio:16/9;padding:9px;border-radius:16px;flex:none;
  background:
    linear-gradient(180deg,rgba(255,220,170,.28),transparent 30%,rgba(0,0,0,.45)),
    repeating-linear-gradient(96deg,#5c3318 0 6px,#4a2711 6px 9px,#6f3f1e 9px 15px,#3e200e 15px 17px);
  box-shadow:0 0 0 1px #1d0e05,0 0 0 3px var(--gold-lo),0 14px 26px rgba(0,0,0,.55);
}
.tcard.wide .rl-mini{width:360px}
.rl-mini-felt{
  position:absolute;inset:9px;border-radius:10px;overflow:hidden;display:flex;align-items:center;gap:6%;padding:0 6%;
  background:var(--noise),radial-gradient(ellipse at 50% 40%,var(--felt),var(--felt-deep));background-size:180px 180px,100% 100%;
  box-shadow:inset 0 0 0 1.5px rgba(228,195,116,.35),inset 0 10px 24px rgba(0,0,0,.5);
}
.rl-mini-wheel{width:38%;flex:none;display:flex}
.rl-mini-wheel .wheel{width:100%;height:auto}
.rl-mini-grid{flex:1;display:grid;grid-template-columns:repeat(6,1fr);grid-template-rows:repeat(3,1fr);gap:2px;aspect-ratio:2/1;position:relative;padding-left:14%}
.rl-mini-grid b{position:absolute;left:0;top:0;bottom:0;width:12%;background:#0f7a45;border-radius:2px}
.rl-mini-grid i{border-radius:2px;background:#151012;box-shadow:inset 0 0 0 1px rgba(228,195,116,.35)}
.rl-mini-grid i.r{background:#b5182a}
.rl-mini .lock{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:34px;z-index:1;background:rgba(0,0,0,.45);border-radius:inherit}
.tcard.locked .rl-mini-felt{filter:grayscale(.7) brightness(.6)}
.rl-gain{color:var(--win);font-weight:600}

/* ===================== TABLE ===================== */
.rl-stage{position:relative;max-width:1240px;margin:0 auto;padding:6px 16px 18px}
.rl-top{display:flex;align-items:center;gap:16px;margin:4px 0 12px}
.rl-top .games-back{position:static;flex:none}
.rl-title{min-width:0}
.rl-title b{display:block;font-family:Cinzel,serif;font-weight:800;letter-spacing:3px;color:var(--gold-hi);font-size:18px}
.rl-title span{font-size:12px;color:var(--muted)}

.rl-board{
  display:grid;grid-template-columns:minmax(220px,300px) 1fr;gap:18px;align-items:center;padding:16px;border-radius:24px;
  background:
    linear-gradient(180deg,rgba(255,220,170,.22),transparent 20%,rgba(0,0,0,.45)),
    repeating-linear-gradient(96deg,#5c3318 0 7px,#4a2711 7px 10px,#6f3f1e 10px 17px,#3e200e 17px 19px);
  box-shadow:0 0 0 1px #1d0e05,0 0 0 3px var(--gold-lo),0 24px 50px rgba(0,0,0,.6);
}
.rl-side,.rl-felt{
  border-radius:16px;
  background:var(--noise),radial-gradient(ellipse 80% 70% at 50% 40%,var(--felt-mid,#0a5634),var(--felt-deep,#04331f));background-size:180px 180px,100% 100%;
  box-shadow:inset 0 0 0 1.5px rgba(228,195,116,.35),inset 0 12px 30px rgba(0,0,0,.5);
}
.rl-side{display:flex;flex-direction:column;align-items:center;gap:12px;padding:16px 14px;align-self:stretch;justify-content:center}
.rl-wheel{width:100%;max-width:270px;display:flex}
.rl-wheel .wheel{width:100%;height:auto}
.rl-history{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px;padding:10px 14px;border-radius:14px;
  background:rgba(0,0,0,.32);box-shadow:inset 0 0 0 1px rgba(228,195,116,.25)}
.rl-history small{font-family:Cinzel,serif;font-weight:800;font-size:10px;letter-spacing:3px;color:rgba(228,195,116,.75)}
.rl-last{min-height:24px;display:flex;flex-wrap:wrap;gap:4px;font-size:12px;color:var(--muted);flex:1;min-width:200px}
.rl-main{display:flex;flex-direction:column;gap:12px;min-width:0}
.rl-felt{padding:12px;min-width:0}
.rl-svg{display:block;width:100%;height:auto;touch-action:manipulation;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;cursor:pointer}

/* the layout */
.rl-cell rect,.rl-o rect{stroke:rgba(255,240,191,.7);stroke-width:1.5;transition:filter .12s,stroke .12s}
.rl-cell.r rect{fill:#b5182a}
.rl-cell.n rect{fill:#151012}
.rl-cell.z rect{fill:#0f7a45}
.rl-o rect{fill:rgba(0,0,0,.12)}
.rl-num{fill:#fffdf7;font:800 22px Cinzel,serif;text-anchor:middle;dominant-baseline:central;pointer-events:none}
.rl-out{fill:var(--gold-hi);font:800 15px Cinzel,serif;letter-spacing:2px;text-anchor:middle;dominant-baseline:central;pointer-events:none}
.rl-diamond{stroke:var(--gold-hi);stroke-width:1.5}
.rl-diamond.r{fill:#b5182a}
.rl-diamond.n{fill:#151012}
.rl-cell.hl rect,.rl-o.hl rect{stroke:var(--gold-hi);stroke-width:4;filter:brightness(1.45)}
.rl-o.hl rect{fill:rgba(255,240,191,.16)}

/* chips on the layout (colors from the chip classes of css/chips.css) */
#rl-chips{pointer-events:none}
.rl-stack{filter:drop-shadow(0 3px 2px rgba(0,0,0,.55))}
.rl-stack .rl-c{fill:var(--c);stroke:var(--e);stroke-width:3.5;stroke-dasharray:6.5 4.6}
.rl-stack .rl-ring{fill:none;stroke:rgba(255,255,255,.55);stroke-width:1;stroke-dasharray:2 2}
.rl-amt{fill:var(--t);font:800 11px Inter,system-ui,sans-serif;text-anchor:middle;dominant-baseline:central}

/* the bubble under the pointer */
.rl-tip{position:absolute;z-index:20;pointer-events:none;padding:6px 10px;border-radius:10px;font-size:12.5px;white-space:nowrap;
  background:rgba(12,7,5,.94);border:1px solid var(--gold-dim);box-shadow:0 8px 18px rgba(0,0,0,.5);color:var(--ink)}
.rl-tip b{color:var(--gold-hi)}
.rl-tip em{color:var(--win);font-style:normal}

/* chips tray + buttons */
.rl-controls{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px 18px;margin-top:14px}
.rl-info{display:flex;flex-direction:column;gap:3px;min-width:200px;flex:1}
.rl-staked{font-size:13px;color:var(--muted);letter-spacing:1px;text-transform:uppercase}
.rl-staked b{font-size:18px;color:var(--gold-hi);letter-spacing:0;text-transform:none;margin-left:6px}
.rl-msg{font-size:13px;color:var(--ink);min-height:18px}
.rl-msg.err{color:var(--lose);font-weight:700}
.rl-tray{flex:none}
.rl-tray .chip.sel{transform:translateY(-7px);box-shadow:0 0 0 3px var(--gold-hi),0 0 18px rgba(255,240,191,.55),0 8px 14px rgba(0,0,0,.5)}
.rl-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}
.rl-actions .btn.ghost{padding:10px 14px;font-size:13px}
.rl-spin{min-width:170px}

/* ===================== CROUPIER, WHEEL, HISTORY (step 2) ===================== */
.rl-croupier{position:relative;width:100%;display:flex;justify-content:center;margin-bottom:-18px;z-index:1}
.rl-dealer{width:150px;cursor:default;margin:0}
.rl-bubble{
  position:absolute;right:-4px;top:-6px;max-width:150px;padding:7px 11px;border-radius:12px 12px 4px 12px;z-index:3;
  background:linear-gradient(180deg,#fffaf0,#efe2c4);color:#2a1a0c;font-weight:700;font-size:12.5px;line-height:1.3;
  border:1px solid var(--gold-lo);box-shadow:0 8px 18px rgba(0,0,0,.45);
}
.rl-bubble:empty{display:none}
.rl-bubble.pop{animation:bubble .35s cubic-bezier(.2,1.5,.4,1)}
.rl-wheel .wr-spin{transition:none}
.rl-wheel .wheel{transition:width .4s}
.rl-last{gap:4px}
.rl-h{display:inline-grid;place-items:center;min-width:24px;height:24px;padding:0 4px;border-radius:6px;font:800 12px Inter,system-ui,sans-serif;font-style:normal;color:#fff;
  box-shadow:inset 0 0 0 1px rgba(255,240,191,.35)}
.rl-h.r{background:#b5182a}.rl-h.n{background:#151012}.rl-h.v{background:#0f7a45}
.rl-h.fresh{animation:rlFresh .9s cubic-bezier(.2,1.4,.4,1);box-shadow:0 0 0 2px var(--gold-hi),0 0 14px rgba(255,240,191,.6)}
@keyframes rlFresh{from{transform:scale(1.8);opacity:0}}
.rl-stats{display:flex;flex-wrap:wrap;gap:5px 14px;align-items:center;font-size:12px;color:var(--muted)}
.rl-stats:empty{display:none}
.rl-stats span{display:flex;flex-wrap:wrap;gap:4px 6px;align-items:center}
.rl-stats .rl-h{min-width:20px;height:20px;font-size:10.5px}
.rl-stats .rr{color:#ff7d86}.rl-stats .nn{color:#cfc6b3}.rl-stats .vv{color:#4ee08a}
.rl-msg.ok{color:var(--win);font-weight:700}

/* the round on the layout: marker, swept chips, winning chips */
.rl-cell.win rect{stroke:var(--gold-hi);stroke-width:5;filter:brightness(1.5)}
.rl-dolly-shadow{fill:rgba(0,0,0,.45)}
.rl-dolly-body{fill:#f4efe2;stroke:#9b7426;stroke-width:1.5}
.rl-dolly-top{fill:#e4c374;stroke:#9b7426;stroke-width:1}
.rl-dollyg{animation:rlDrop .45s cubic-bezier(.3,1.5,.5,1)}
@keyframes rlDrop{from{transform:translateY(-40px);opacity:0}}
.rl-stack.lose .rl-chipg{animation:rlSweep .55s ease-in forwards}
@keyframes rlSweep{to{transform:translate(0,-60px) scale(.5);opacity:0}}
.rl-stack.win .rl-chipg{animation:rlWin .45s ease-in-out 4 alternate}
@keyframes rlWin{to{transform:scale(1.2)}}
.rl-plus{fill:var(--win);font:800 14px Inter,system-ui,sans-serif;text-anchor:middle;paint-order:stroke;stroke:rgba(0,0,0,.7);stroke-width:3px;animation:rlFresh .5s}
@media (prefers-reduced-motion:reduce){
  .rl-dollyg,.rl-stack.win .rl-chipg,.rl-h.fresh,.rl-plus{animation:none}
  .rl-stack.lose .rl-chipg{animation-duration:.01s}
}

/* ===================== PHONES IN PORTRAIT: vertical layout, chips always at hand ===================== */
/* (landscape phones have their own layout in css/landscape.css) */
@media (max-width:760px) and (orientation:portrait),(max-width:760px) and (min-height:501px){
  .tcard.wide .rl-mini{width:100%}
  .rl-stage{padding:4px 8px 0}
  .rl-top{gap:10px;margin-bottom:8px}
  .rl-title b{font-size:15px;letter-spacing:2px}
  .rl-title span{font-size:11px}
  .rl-board{grid-template-columns:1fr;gap:10px;padding:10px;border-radius:18px}
  .rl-side{flex-direction:row-reverse;align-items:center;justify-content:space-between;padding:10px 12px;gap:10px}
  .rl-croupier{flex:1;justify-content:flex-start;margin:0;align-items:center;gap:8px;min-width:0}
  .rl-dealer{width:78px;flex:none}
  .rl-bubble{position:static;max-width:none;flex:1;min-width:0;font-size:12px;border-radius:12px 12px 12px 4px}
  .rl-wheel{width:128px;flex:none}
  .rl-main{gap:10px}
  .rl-history{order:-1;padding:8px 10px;gap:6px 10px}
  .rl-last{min-width:0;max-height:24px;overflow:hidden}
  /* while the ball turns: the wheel big in the middle */
  .rl-stage.spinning .rl-side{flex-direction:column}
  .rl-stage.spinning .rl-wheel{width:min(300px,78vw)}
  .rl-stage.spinning .rl-croupier{justify-content:center;width:100%}
  .rl-felt{padding:8px;max-width:420px;width:100%;justify-self:center}
  .rl-controls{
    position:sticky;bottom:0;z-index:30;margin:10px -8px 0;padding:10px 10px calc(10px + var(--sa-b));gap:8px;
    background:linear-gradient(180deg,rgba(11,4,6,.86),rgba(11,4,6,.97));border-top:1px solid rgba(228,195,116,.25);
    -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);
  }
  .rl-info{min-width:0;flex-basis:100%;flex-direction:row;align-items:baseline;gap:10px}
  .rl-msg{font-size:12px;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .rl-tray{width:100%;justify-content:center}
  .rl-actions{width:100%;justify-content:center;gap:6px}
  .rl-actions .btn.ghost{padding:9px 10px;font-size:12px;flex:1}
  .rl-spin{flex-basis:100%;min-width:0}
}

/* ===================== ROULETTE À PLUSIEURS (js/roulette-multi.js) ===================== */
.rm-list .mpt-seats{grid-template-columns:repeat(5,minmax(0,1fr))}
.rm-list .mp-seat .pav{width:56px}
.rm-card .mpt-phase{display:inline-flex;align-items:center;gap:6px}
.rm-card .mpt-phase .rl-h{min-width:22px;height:22px;font-size:11px}
.rm-login{margin-top:6px}
/* the players around the table */
.rm-seats{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin:0 0 12px}
.rm-seat{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:4px;min-height:96px;padding:6px 4px 8px;
  border-radius:12px;background:rgba(0,0,0,.3);box-shadow:inset 0 -3px 0 var(--sc)}
.rm-seat .pav{width:62px}
.rm-seat.me{background:rgba(228,195,116,.1);box-shadow:inset 0 0 0 1px rgba(228,195,116,.45),inset 0 -3px 0 var(--sc)}
.rm-seat.away{opacity:.55}
.rm-seat.ready{box-shadow:inset 0 0 0 1.5px var(--win),inset 0 -3px 0 var(--sc)}
.rm-name{display:flex;align-items:center;gap:5px;max-width:100%;font-size:12px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rm-name i{flex:none;width:9px;height:9px;border-radius:50%;background:var(--sc)}
.rm-staked{font-size:12px;color:var(--gold-hi);font-weight:700}
.rm-staked b{color:var(--win)}
.rm-seat.free{justify-content:center;color:var(--muted);font-size:11px;letter-spacing:1px;text-transform:uppercase}
.rm-chair{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;border:1.5px dashed var(--sc);color:var(--sc);font-weight:800}
.rm-inv{padding:6px 10px;font-size:11.5px;text-transform:none;letter-spacing:0}
/* the other players' chips on the layout */
.rl-other circle{fill:var(--sc);stroke:rgba(0,0,0,.55);stroke-width:1.5;stroke-dasharray:4 3}
.rl-other text{fill:#1a1206;font:800 8.5px Inter,system-ui,sans-serif;text-anchor:middle;dominant-baseline:central}
.rl-other.lose .rl-chipg{animation:rlSweep .55s ease-in forwards}
.rl-other.win .rl-chipg{animation:rlWin .45s ease-in-out 4 alternate}
/* the countdown */
.rm-timer{font-size:13px;font-weight:800;color:var(--gold-hi);letter-spacing:.5px}
.rm-timer:empty{display:none}
.rm-timer.hurry{color:var(--lose)}
body.rl-multi .rl-spin{min-width:130px}
@media (max-width:760px) and (orientation:portrait),(max-width:760px) and (min-height:501px){
  .rm-seats{gap:4px;margin-bottom:8px}
  .rm-seat{min-height:78px;padding:4px 2px 6px}
  .rm-seat .pav{width:44px}
  .rm-name{font-size:10.5px}
  .rm-staked{font-size:11px}
  .rm-inv{padding:5px 4px;font-size:10.5px;max-width:100%;white-space:nowrap}
  .rl-staked{white-space:nowrap}
  .rm-list .mp-seat .pav{width:40px}
  .rm-list .mp-seat .btn{font-size:11px;padding:6px 4px}
  .rl-info .rm-timer{order:-1;width:100%}
}
/* reactions at a shared roulette (js/roulette-multi.js) */
body.rl-multi .rm-react{display:flex;position:absolute;top:6px;right:16px;left:auto;z-index:25;flex-direction:row-reverse;align-items:flex-start}
body.rl-multi .rm-react .react-bar{position:absolute;top:48px;right:0}
.rm-seat .sp-emoji{top:-4px}
@media (orientation:landscape) and (max-height:500px){ body.rl-multi .rm-react{top:2px;right:calc(128px + max(6px,var(--sa-r)))} }
