/* Ruleta: the players' plates; a line with the small wheel, the last numbers and the clock; the status; the
   betting table (vertical: zero on top, dozens and even-money bets on the left, 2:1 at the bottom); the chips
   and the buttons. While the ball rolls the wheel grows over the table (.rl.big). */
.rl{
  --rl-felt:#0d5a36;--rl-felt2:#0a4529;--rl-line:rgba(255,255,255,.62);
  --rl-red:#c8302c;--rl-black:#1c1c1f;--rl-green:#138a4b;
  position:absolute;inset:0;margin:0 auto;max-width:480px;
  display:grid;grid-template-columns:minmax(0,1fr);
  grid-template-rows:auto auto auto minmax(0,1fr) auto;
  overflow:hidden;padding:0 8px 6px;
}
.rl [hidden]{display:none!important}
.c-red{background:var(--rl-red)}.c-black{background:var(--rl-black)}.c-green{background:var(--rl-green)}

/* ── plates ──────────────────────────────────────────────────────────── */
.rl-plates{display:flex;justify-content:center;gap:5px;padding:6px 0 11px}
.rl-plate{
  --pc:#ffc65c;position:relative;
  display:flex;align-items:center;gap:6px;flex:0 1 190px;min-width:0;min-height:40px;padding:3px 9px 3px 4px;
  border:1.5px solid var(--line);border-radius:999px;background:rgba(0,0,0,.22);
  transition:border-color .2s,background-color .2s,opacity .2s;
}
.rl-plate .ava{width:30px;height:30px;font-size:.88rem;flex:none;box-shadow:0 0 0 2px var(--pc)}
.rl-who{display:grid;line-height:1.15;min-width:0;flex:1}
.rl-who .nm{font-weight:600;font-size:.82rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rl-st{display:flex;align-items:center;gap:4px;font-size:.84rem;font-weight:700;color:var(--gold);font-variant-numeric:tabular-nums;white-space:nowrap}
.rl-coin{width:.8em;height:.8em;border-radius:50%;flex:none;background:radial-gradient(circle at 35% 35%,#fff3c4,#e0b453 55%,#8a6420);box-shadow:0 0 0 1px rgba(0,0,0,.3)}
.rl-pp{
  position:absolute;bottom:-12px;right:8px;z-index:1;padding:0 .45em;border-radius:999px;
  font:700 .64rem/1.5 var(--ui,system-ui),sans-serif;background:#16241b;border:1px solid var(--line);white-space:nowrap;
}
.rl-pp .rl-on{color:var(--gold)}
.rl-pp .rl-sub{color:var(--mist);font-weight:600}
.rl-net{font-weight:800}.rl-net.up{color:#7ee08a}.rl-net.down{color:#ff8f86}
.rl-plate.turn{border-color:var(--pc);background:rgba(255,255,255,.07)}
.rl-plate.out{opacity:.5}
.rl-plates[data-n="3"] .rl-plate,.rl-plates[data-n="4"] .rl-plate{flex:1 1 0;padding-right:5px;gap:4px}
@media (max-width:520px){
  .rl-plates[data-n="3"] .ava,.rl-plates[data-n="4"] .ava{width:24px;height:24px;font-size:.72rem}
  .rl-plates[data-n="3"] .rl-who .nm,.rl-plates[data-n="4"] .rl-who .nm{font-size:.7rem}
  .rl-plates[data-n="3"] .rl-st,.rl-plates[data-n="4"] .rl-st{font-size:.74rem}
  .rl-plates[data-n="4"] .rl-plate{padding-left:3px}
  .rl-plates[data-n="3"] .rl-pp,.rl-plates[data-n="4"] .rl-pp{right:50%;transform:translateX(50%)}
}

/* ── the line with the small wheel, the last numbers and the clock ─────── */
.rl-info{display:flex;align-items:center;gap:7px;min-height:36px;padding:4px 0 0}
.rl-mini{width:34px;height:34px;flex:none}
.rl-hist{flex:1;min-width:0;display:flex;gap:3px;overflow:hidden;align-items:center;
  -webkit-mask-image:linear-gradient(90deg,#000 80%,transparent);mask-image:linear-gradient(90deg,#000 80%,transparent)}
.rl-h{flex:none;width:23px;height:23px;border-radius:50%;display:grid;place-items:center;font-size:.7rem;font-weight:800;color:#fff;
  box-shadow:inset 0 0 0 1.5px rgba(255,255,255,.35);font-variant-numeric:tabular-nums}
.rl-h.last{width:27px;height:27px;font-size:.8rem;box-shadow:inset 0 0 0 2px var(--gold)}
.rl-hnone{font-size:.74rem;color:var(--mist)}
.rl-clock{display:flex;align-items:center;gap:5px;flex:none;width:76px}
.rl-cbar{flex:1;height:4px;border-radius:3px;background:rgba(255,255,255,.14);overflow:hidden}
.rl-cbar i{display:block;height:100%;background:var(--gold);transform-origin:left;transition:transform .2s linear}
.rl-clock b{font-size:.75rem;min-width:1.4em;text-align:right;font-variant-numeric:tabular-nums;color:var(--mist)}
.rl-clock.low .rl-cbar i{background:var(--cherry)}
.rl-clock.low b{color:var(--cherry)}

.rl-mid{display:grid;place-items:center;min-height:38px;padding:2px 0 3px}
.rl-status{margin:0;padding:.3em .9em;font-size:.86rem;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ── the table ───────────────────────────────────────────────────────── */
.rl-tablewrap{position:relative;min-height:0;display:flex;justify-content:center}
.rl-table{
  position:relative;height:100%;width:100%;max-width:420px;max-height:560px;
  display:grid;grid-template-columns:1fr 1fr 2fr 2fr 2fr;grid-template-rows:1.15fr repeat(12,1fr) .9fr;
  border-radius:10px;overflow:hidden;touch-action:none;user-select:none;-webkit-user-select:none;
  background:radial-gradient(130% 90% at 50% 0%,var(--rl-felt),var(--rl-felt2));
  box-shadow:inset 0 0 0 2px rgba(255,214,120,.55),0 8px 18px -12px rgba(0,0,0,.9);
}
.rl-table>div{box-shadow:inset 0 0 0 .5px var(--rl-line);display:grid;place-items:center;min-height:0;position:relative}
.rl-corner{grid-row:1;grid-column:1 / span 2}
.rl-foot{grid-row:14;grid-column:1 / span 2}
.rl-zero{grid-row:1;grid-column:3 / span 3;border-radius:0}
.rl-n b{font:700 clamp(.8rem,3.6vw,1.05rem)/1 var(--ui,system-ui),sans-serif;color:#fff;
  min-width:1.9em;padding:.12em .1em;border-radius:999px;text-align:center;pointer-events:none}
.rl-n{background:transparent!important}
.rl-n.c-red b{background:var(--rl-red)}.rl-n.c-black b{background:var(--rl-black)}
.rl-zero.c-green{background:var(--rl-green)!important}.rl-zero b{background:none}
.rl-o span{font:700 clamp(.6rem,2.6vw,.74rem)/1.1 var(--ui,system-ui),sans-serif;color:#f4efe3;letter-spacing:.02em;pointer-events:none;text-align:center}
.rl-dz span{writing-mode:vertical-rl;transform:rotate(180deg);font-size:clamp(.66rem,2.9vw,.8rem)}
.rl-em span{writing-mode:vertical-rl;transform:rotate(180deg)}
.rl-dia{width:58%;height:40%;max-width:22px;max-height:30px;pointer-events:none;clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%)}
.rl-dia-red{background:var(--rl-red)}.rl-dia-black{background:var(--rl-black);outline:1px solid #fff}
.rl-table .hl{background:rgba(255,214,120,.38)!important}
.rl-n.hl b{box-shadow:0 0 0 2px #ffe08a}
.rl-n.win b,.rl-zero.win{animation:rl-glow 1.1s ease-in-out infinite alternate}
.rl-n.win b{box-shadow:0 0 0 2.5px #fff,0 0 14px 4px rgba(255,224,138,.9)}
.rl-zero.win{box-shadow:inset 0 0 0 3px #fff}
@keyframes rl-glow{from{filter:brightness(1)}to{filter:brightness(1.45)}}

/* chips: positioned at the point of their bet (left/top in px of the table) */
.rl-table>.rl-layer{position:absolute;inset:0;pointer-events:none;box-shadow:none;display:block;z-index:2}
.rl-chip{
  position:absolute;left:0;top:0;transform:translate(calc(var(--x) - 50%),calc(var(--y) - 50%));
  min-width:21px;height:21px;padding:0 3px;border-radius:999px;display:grid;place-items:center;
  font:800 .6rem/1 var(--ui,system-ui),sans-serif;font-style:normal;color:#1d1608;font-variant-numeric:tabular-nums;
  background:var(--c);border:2px dashed rgba(255,255,255,.85);box-shadow:0 2px 3px rgba(0,0,0,.55);
  transition:opacity .4s,transform .4s;
}
.rl-chip:not(.me){min-width:17px;height:17px;font-size:.52rem;border-width:1.5px;opacity:.92}
.rl-chip.me{z-index:2}
.rl-chip.lost{opacity:.28}
.rl-chip.won{z-index:3;box-shadow:0 0 0 2px #fff,0 0 12px 3px rgba(255,224,138,.95);animation:rl-pulse .8s ease-in-out infinite alternate}
@keyframes rl-pulse{from{filter:brightness(1)}to{filter:brightness(1.3)}}

.rl-tip{
  position:absolute;left:50%;top:0;z-index:6;transform:translate(-50%,var(--y,0));pointer-events:none;max-width:96%;overflow:hidden;text-overflow:ellipsis;
  padding:.3em .8em;border-radius:999px;background:rgba(10,16,12,.92);border:1px solid var(--gold);
  font-size:.8rem;font-weight:700;color:#fff;white-space:nowrap;
}
.rl-banner{
  display:flex;align-items:center;gap:8px;padding:3px 14px 3px 3px;border-radius:999px;max-width:100%;
  background:rgba(10,16,12,.9);border:1.5px solid var(--gold);box-shadow:0 6px 16px -6px #000;
  font-weight:700;font-size:.92rem;white-space:nowrap;overflow:hidden;animation:rl-in .35s ease-out;
}
.rl-banner span{display:flex;gap:8px;align-items:baseline}
.rl-banner em{font-style:normal;font-weight:800}
.rl-banner em.up{color:#7ee08a}.rl-banner em.down{color:#ff8f86}
.rl-ball{flex:none;width:28px;height:28px;border-radius:50%;display:grid;place-items:center;font-size:.95rem;font-weight:800;color:#fff;box-shadow:inset 0 0 0 2px rgba(255,255,255,.5)}
@keyframes rl-in{from{opacity:0;transform:scale(.85)}to{opacity:1;transform:none}}

/* ── chips and buttons ───────────────────────────────────────────────── */
.rl-bar{display:grid;gap:5px;padding-top:6px}
.rl-bar.none{display:none}
.rl-chips{display:flex;align-items:center;justify-content:center;gap:6px}
.rl-cvs{display:flex;gap:6px}
.rl-cv{
  --cc:#f3efe6;--ci:#1d1608;
  width:46px;height:46px;border-radius:50%;padding:0;cursor:pointer;display:grid;place-items:center;
  background:repeating-conic-gradient(var(--cc) 0 22.5deg,#fff 22.5deg 30deg);border:none;
  box-shadow:0 3px 5px rgba(0,0,0,.5);transition:transform .15s,box-shadow .15s;
}
.rl-cv span{width:70%;height:70%;border-radius:50%;display:grid;place-items:center;background:var(--cc);color:var(--ci);
  font:800 .74rem/1 var(--ui,system-ui),sans-serif;box-shadow:inset 0 0 0 1.5px rgba(255,255,255,.7)}
.rl-cv.k1{--cc:#c8302c;--ci:#fff}.rl-cv.k2{--cc:#1f8a4c;--ci:#fff}.rl-cv.k3{--cc:#24242a;--ci:#ffd57a}
.rl-cv.on{transform:translateY(-4px);box-shadow:0 0 0 2.5px var(--gold),0 6px 8px rgba(0,0,0,.5)}
.rl-cv:disabled{opacity:.35;cursor:default;transform:none}
.rl-chips.off .rl-cv{opacity:.35}
.rl-ic{width:40px;height:40px;border-radius:50%;border:1.5px solid var(--line);background:rgba(0,0,0,.25);color:var(--ivory);
  font-size:1.1rem;font-weight:700;cursor:pointer;display:grid;place-items:center;padding:0}
.rl-ic:disabled{opacity:.3;cursor:default}
.rl-acts{display:flex;gap:6px;justify-content:center;align-items:center;min-height:44px}
.rl-acts .btn{min-height:44px}
.rl-rep{flex:1 1 0;max-width:130px}.rl-dbl{flex:0 0 54px}.rl-done{flex:1.4 1 0;max-width:180px}.rl-next{flex:1;max-width:260px}
.rl-wait{font-size:.86rem;color:var(--mist)}

/* ── the wheel ───────────────────────────────────────────────────────── */
.rl-wheel{
  position:absolute;left:0;top:0;z-index:8;transform-origin:0 0;pointer-events:none;
  border-radius:50%;transition:transform .5s cubic-bezier(.3,.7,.2,1);
}
.rl-wheel canvas{display:block;border-radius:50%;box-shadow:0 10px 30px -8px rgba(0,0,0,.9)}
.rl-veil{position:absolute;inset:0;z-index:7;background:rgba(4,10,6,.62);opacity:0;pointer-events:none;transition:opacity .4s}
.rl.big .rl-veil{opacity:1}
.rl.big .rl-status{visibility:hidden}
.rl-hub{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);animation:rl-pop .45s ease-out}
.rl-hub b{display:grid;place-items:center;width:4.2rem;height:4.2rem;border-radius:50%;font-size:2rem;font-weight:800;color:#fff;
  box-shadow:0 0 0 3px #fff,0 0 22px 6px rgba(255,224,138,.8)}
@keyframes rl-pop{from{transform:translate(-50%,-50%) scale(.3);opacity:0}to{transform:translate(-50%,-50%) scale(1);opacity:1}}
.rl-closed{
  position:absolute;left:50%;top:-6px;transform:translate(-50%,-100%);opacity:0;
  padding:.3em 1em;border-radius:999px;background:rgba(10,16,12,.92);border:1.5px solid var(--gold);
  font:700 .95rem/1.2 var(--ui,system-ui),sans-serif;color:#fff;white-space:nowrap;
}
.rl-closed.go{animation:rl-closed 2.2s ease-out forwards}
@keyframes rl-closed{0%{opacity:0}12%{opacity:1}75%{opacity:1}100%{opacity:0}}
.rl:not(.big) .rl-closed{display:none}

@media (prefers-reduced-motion:reduce){
  .rl-wheel,.rl-veil,.rl-chip{transition:none}
  .rl-n.win b,.rl-zero.win,.rl-chip.won{animation:none}
}
