/* =========================================================
   Jekpoti — roulette
   ========================================================= */
body[data-theme="roulette"] {
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, #1f7a3e 0%, #0d4a24 55%, #052812 100%);
}
.rl-top {
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  gap: 16px;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
}
.rl-wheelbox {
  width: clamp(200px, 32vw, 330px);
  aspect-ratio: 1;
  filter: drop-shadow(0 18px 30px rgba(0,0,0,.6));
}
.rl-wheelbox svg {
  width: 100%;
  height: 100%;
  display: block;
}
.rl-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.rl-result {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(6,3,14,.82);
  border: 2px solid rgba(255,215,94,.35);
  border-radius: 16px;
  padding: 10px 14px;
  width: fit-content;
}
.rl-result small {
  font-weight: 900;
  color: var(--muted);
  font-size: 12px;
}
.rl-result b {
  display: grid;
  place-items: center;
  min-width: 64px;
  height: 64px;
  padding: 0 8px;
  border-radius: 50%;
  font-family: 'Bungee','Noto Sans Georgian',sans-serif;
  font-weight: 400;
  font-size: 30px;
  color: #fff;
  background: #333;
  border: 3px solid #d4af37;
}
.rl-result b.red {
  background: #c8102e;
}
.rl-result b.black {
  background: #111;
}
.rl-result b.green {
  background: #0a8a3a;
}
.rl-result b.pop {
  animation: zoom .5s cubic-bezier(.2,1.6,.4,1);
}
.rl-hist {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.rl-hist span {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: 'Bungee','Noto Sans Georgian',sans-serif;
  font-size: 12px;
  color: #fff;
  border: 2px solid rgba(255,255,255,.25);
}
.rl-hist .red {
  background: #c8102e;
}
.rl-hist .black {
  background: #111;
}
.rl-hist .green {
  background: #0a8a3a;
}
.rl-hist span:first-child {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(255,209,102,.5);
}
.rl-counts {
  font-size: 12px;
  font-weight: 800;
  color: #d8f5e1;
}
.rl-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-weight: 800;
}
.rl-totals span {
  background: rgba(6,3,14,.7);
  padding: 6px 12px;
  border-radius: 999px;
}
.rl-totals b {
  color: var(--gold);
  font-family: 'Bungee','Noto Sans Georgian',sans-serif;
  font-weight: 400;
}

/* the table is laid out in "units" by JS; on narrow screens it's turned vertical like on phone casinos */
.rl-boardwrap {
  max-width: 1000px;
  margin: 12px auto 0;
}
.rl-board {
  position: relative;
  width: 100%;
  aspect-ratio: 14 / 4.6;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  background: linear-gradient(180deg,#127a3a,#0b5c2a);
  border: 6px solid #6b3f1d;
  border-radius: 14px;
  box-shadow: inset 0 0 30px rgba(0,0,0,.5), 0 14px 30px rgba(0,0,0,.5);
}
.rl-board.vert {
  aspect-ratio: 4.6 / 8.7;
  max-width: 440px;
  margin: 0 auto;
}
.rl-spot {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  font-family: 'Bungee','Noto Sans Georgian',sans-serif;
  font-size: clamp(11px,1.8vw,18px);
  border: 1px solid rgba(255,255,255,.45);
  box-sizing: border-box;
  transition: filter .15s;
}
.rl-spot.num.red {
  background: #b30d27;
}
.rl-spot.num.black {
  background: #141414;
}
.rl-spot.num.green {
  background: #0a8a3a;
}
.rl-spot.out {
  font-family: 'Nunito','Noto Sans Georgian',sans-serif;
  font-weight: 900;
  font-size: clamp(10px,1.4vw,15px);
  text-align: center;
  line-height: 1.1;
}
.rl-spot.out .dia {
  width: 1.4em;
  height: 1.4em;
  transform: rotate(45deg);
  border: 2px solid #fff;
}
.rl-spot.out .dia.red {
  background: #c8102e;
}
.rl-spot.out .dia.black {
  background: #111;
}
.rl-board.vert .rl-spot.out.side {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.rl-spot.hot {
  border: 0;
  z-index: 3;
  border-radius: 50%;
}
.rl-spot:hover,
.rl-spot.hl {
  filter: brightness(1.35);
}
.rl-spot.hot:hover {
  background: rgba(255,215,94,.45);
}
.rl-spot.hl.num {
  box-shadow: inset 0 0 0 3px var(--gold);
}
.rl-spot.win.num {
  animation: rlwin .5s ease-in-out infinite alternate;
  z-index: 2;
}
@keyframes rlwin {
  to {
    box-shadow: inset 0 0 0 4px #fff, 0 0 22px var(--gold);
    filter: brightness(1.4);
  }
}
.rl-chip {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  z-index: 4;
  pointer-events: none;
  min-width: 30px;
  height: 30px;
  padding: 0 4px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-family: 'Bungee','Noto Sans Georgian',sans-serif;
  font-size: 11px;
  color: #fff;
  writing-mode: horizontal-tb;
  background: radial-gradient(circle,#ff9f1c 0 45%,#fff 46% 52%,#ff9f1c 53%);
  border: 2px dashed #fff;
  box-shadow: 0 3px 6px rgba(0,0,0,.6);
  animation: in .15s ease;
}
.rl-chip.won {
  background: radial-gradient(circle,#2fbf5a 0 45%,#fff 46% 52%,#2fbf5a 53%);
  box-shadow: 0 0 14px #7df59a;
}
.rl-chip.lost {
  opacity: .35;
  filter: grayscale(1);
}
.rl-timer {
  grid-area: timer;
  position: relative;
  height: 24px;
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 900;
  color: var(--text);
}
.rl-timer i {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--p,0%);
  background: linear-gradient(90deg,rgba(47,191,90,.55),rgba(255,209,102,.55));
  transition: width .25s linear;
}
.rl-timer.urgent i {
  background: rgba(255,90,95,.6);
}
.rl-timer span {
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 10px;
}
.rl-bar {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  grid-template-areas: "timer" "chips" "tools";
  gap: 8px 16px;
  align-items: center;
  max-width: 1000px;
  margin: 12px auto 0;
  padding: 12px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg,rgba(24,14,46,.95),rgba(4,2,10,.96));
  border: 1px solid rgba(255,215,94,.4);
  box-shadow: 0 12px 30px rgba(0,0,0,.5);
}
.rl-chips {
  grid-area: chips;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px;
}
.rl-chips button {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-family: 'Bungee','Noto Sans Georgian',sans-serif;
  font-size: 13px;
  color: #fff;
  background: radial-gradient(circle,var(--cc) 0 50%,#fff 51% 56%,var(--cc) 57%);
  border: 3px dashed #fff;
  box-shadow: 0 4px 8px rgba(0,0,0,.5);
  transition: transform .1s;
}
.rl-chips button.on {
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 0 0 3px var(--gold), 0 8px 14px rgba(0,0,0,.6);
}
.rl-chips button.erase {
  --cc: #5a4a7a;
  font-size: 18px;
}
.rl-chips button:disabled,
.rl-tools button:disabled {
  opacity: .4;
  cursor: not-allowed;
}
.rl-tools {
  grid-area: tools;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.rl-players {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 800;
  max-height: 84px;
  overflow: auto;
}
.rl-players small {
  flex-basis: 100%;
  color: var(--muted);
}
.rl-players span {
  background: rgba(6,3,14,.7);
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.rl-players span b {
  color: var(--gold);
  font-weight: 800;
}
.rl-players span.won {
  background: rgba(91,227,125,.18);
}
.rl-players span.lost {
  opacity: .55;
}
.fair-row .red-n {
  color: #ff6b6f !important;
}
.fair-row .black-n {
  color: #e8e8e8 !important;
}
.fair-row .green-n {
  color: #5be37d !important;
}
.pt-row.rl-pt {
  grid-template-columns: minmax(120px,240px) minmax(0,1fr) 60px;
  font-size: 14px;
}
.pt-row.rl-pt b:last-child {
  color: var(--gold);
  text-align: right;
  font-family: 'Bungee','Noto Sans Georgian',sans-serif;
  font-weight: 400;
}
@media (max-width: 700px), (max-height: 500px) and (orientation: landscape) {
  body[data-theme="roulette"] {
    padding-bottom: calc(180px + env(safe-area-inset-bottom));
  }
  .rl-timer {
    height: 20px;
    font-size: 11.5px;
  }
  .rl-top {
    grid-template-columns: auto minmax(0,1fr);
    gap: 10px;
  }
  .rl-wheelbox {
    width: clamp(150px, 44vw, 220px);
  }
  .rl-result {
    padding: 6px 10px;
    gap: 8px;
  }
  .rl-result b {
    min-width: 48px;
    height: 48px;
    font-size: 22px;
  }
  .rl-result small {
    display: none;
  }
  .rl-totals {
    font-size: 12px;
    gap: 6px;
  }
  .rl-totals span {
    padding: 4px 8px;
  }
  .rl-counts {
    display: none;
  }
  .rl-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    margin: 0;
    border-radius: 18px 18px 0 0;
    border-width: 1px 0 0;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    gap: 6px 10px;
    background: linear-gradient(180deg,#1d1139,#06030e);
  }
  .rl-chips button {
    width: 40px;
    height: 40px;
    font-size: 11px;
  }
  .rl-tools {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .rl-tools button {
    padding: 6px 10px;
    font-size: 12px;
    white-space: nowrap;
  }
  .rl-chip {
    min-width: 24px;
    height: 24px;
    font-size: 9px;
  }
}
