/* ── BEE Roulette — Premium Casino CSS ─────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold:       #c9a227;
  --gold-light: #f0d060;
  --gold-dim:   #7a5f10;
  --bg:         #040404;
  --bg2:        #080808;
  --felt:       #0b3320;
  --felt-hi:    #0d3d27;
  --red:        #c0272d;
  --black:      #111111;
  --green:      #1c7a1c;
  --text:       #d4b96a;
  --text-dim:   #7a6a3a;
  --walnut:     #2A1006;
  --walnut-hi:  #5C2A0A;
}

html, body { height: 100%; }
body {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(60,30,5,0.55) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 60%, rgba(201,162,39,0.06) 0%, transparent 50%),
    #050302;
  color: var(--text);
  font-family: 'Georgia', serif;
  min-height: 100vh;
}

/* ── Nav ─────────────────────────────────────────────────── */
.rl-nav {
  background: rgba(0,0,0,0.95);
  border-bottom: 1px solid var(--gold-dim);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(6px);
}
.rl-nav-inner {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 28px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.rl-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.rl-logo-sm {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--gold-dim);
}
.rl-brand-name {
  font-size: 17px;
  font-weight: bold;
  color: #e8e0c8;
  letter-spacing: 0.02em;
}
.rl-gold { color: var(--gold); }
.rl-brand-sub {
  font-size: 9px;
  letter-spacing: 0.25em;
  color: var(--gold-dim);
  margin-top: 1px;
}
.rl-nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.rl-balance-wrap { text-align: right; }
.rl-bal-label {
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--text-dim);
}
.rl-bal-val {
  font-size: 18px;
  font-weight: bold;
  color: var(--gold-light);
  letter-spacing: 0.04em;
}
.rl-bal-val.rl-insufficient {
  animation: rlInsufficientShake 0.5s ease;
  color: #ff5555;
}
@keyframes rlInsufficientShake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-4px); }
  40%      { transform: translateX(4px); }
  60%      { transform: translateX(-3px); }
  80%      { transform: translateX(3px); }
}
.rl-lobby-btn {
  background: transparent;
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  padding: 7px 16px;
  font-size: 13px;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.rl-lobby-btn:hover {
  background: var(--gold-dim);
  color: #fff;
}

/* ── Page ─────────────────────────────────────────────────── */
.rl-page {
  max-width: 1500px;
  margin: 0 auto;
  padding: 8px 14px 28px;
}

/* ── Table header ─────────────────────────────────────────── */
.rl-table-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 20px 0;
  flex-wrap: wrap;
}
.rl-game-logo {
  height: 72px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 20px rgba(201,162,39,0.4));
  flex-shrink: 0;
}
.rl-header-right {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rl-chip-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.rl-bet-meta {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}
.rl-meta-val { color: var(--gold); font-weight: bold; }

/* ── Table footer ─────────────────────────────────────────── */
.rl-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px 14px;
  border-top: 1px solid rgba(201,162,39,0.18);
}
.rl-footer-left {
  flex: 0 0 auto;
  max-width: 50%;
}
.rl-footer-right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ── Casino table — outer shell ──────────────────────────── */
.rl-casino-table {
  background:
    /* warm walnut wood grain on the table border */
    repeating-linear-gradient(
      92deg,
      transparent 0px, transparent 18px,
      rgba(80,30,5,0.12) 18px, rgba(80,30,5,0.12) 20px
    ),
    linear-gradient(160deg, #3A1A06 0%, #1E0A02 35%, #150802 60%, #2C1208 100%);
  border: 3px solid var(--gold);
  border-radius: 28px;
  padding: 18px;
  box-shadow:
    0 0 0 1px rgba(201,162,39,0.15),
    0 2px 0 5px #0a0500,
    0 8px 0 6px rgba(201,162,39,0.12),
    0 32px 100px rgba(0,0,0,0.95),
    0 0 80px rgba(201,162,39,0.08),
    inset 0 1px 0 rgba(255,220,100,0.18),
    inset 0 -2px 4px rgba(0,0,0,0.6);
  position: relative;
}
/* Leather stitching effect on table edge */
.rl-casino-table::before {
  content: '';
  position: absolute;
  inset: 9px;
  border-radius: 22px;
  border: 1px dashed rgba(201,162,39,0.22);
  pointer-events: none;
}

/* ── Table felt surface ───────────────────────────────────── */
.rl-table-felt {
  background:
    radial-gradient(ellipse at 30% 40%, #0f4a2e 0%, #0a3421 35%, #072318 65%, #040f09 100%);
  border-radius: 18px;
  border: 1.5px solid rgba(201,162,39,0.28);
  box-shadow:
    inset 0 0 80px rgba(0,0,0,0.55),
    inset 0 2px 12px rgba(0,0,0,0.4),
    0 0 0 1px rgba(0,0,0,0.5);
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 28px 24px 24px;
  position: relative;
}
/* Felt texture overlay */
.rl-table-felt::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background-image:
    url("data:image/svg+xml,%3Csvg width='4' height='4' viewBox='0 0 4 4' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 3L3 1M0 2L2 0M2 4L4 2' stroke='rgba(0,0,0,0.12)' stroke-width='0.5'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.6;
}

/* ── Wheel zone ───────────────────────────────────────────── */
.rl-wheel-zone {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-right: 24px;
  border-right: 1px solid rgba(201,162,39,0.18);
  position: relative;
  z-index: 1;
  /* Let canvas shadow spill without clip */
  overflow: visible;
}

/* ── 2D Canvas wheel mount ──────────────────────────────── */
#wheelMount {
  width:  520px;
  height: 520px;
  border-radius: 50%;
  overflow: visible;          /* allow canvas drop-shadow to spill out */
  flex-shrink: 0;
  position: relative;
}
#wheelMount canvas {
  display: block;
  border-radius: 50%;
}

/* ── Controls ─────────────────────────────────────────────── */
.rl-wheel-controls {
  display: flex;
  gap: 12px;
}
.rl-btn {
  padding: 10px 28px;
  border: none;
  border-radius: 5px;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: all 0.18s;
}
.rl-spin-btn {
  background: linear-gradient(145deg, #8B6010, #c9a227 40%, #f0d060 55%, #c9a227 70%, #8B6010);
  color: #000;
  min-width: 120px;
  font-size: 15px;
  box-shadow: 0 4px 18px rgba(201,162,39,0.5), inset 0 1px 0 rgba(255,255,255,0.4);
}
.rl-spin-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(201,162,39,0.65), inset 0 1px 0 rgba(255,255,255,0.4);
}
.rl-spin-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.rl-clear-btn {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--gold-dim);
  color: var(--gold-dim);
  min-width: 80px;
}
.rl-clear-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.rl-clear-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── History bar ─────────────────────────────────────────── */
.rl-history-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  max-width: 420px;
  justify-content: center;
}
.rl-hist-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-right: 4px;
}
.rl-hist-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: bold;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
}
.rl-hist-dot.red   { background: var(--red); }
.rl-hist-dot.black { background: #1a1a1a; border-color: rgba(255,255,255,0.25); }
.rl-hist-dot.green { background: var(--green); }

/* ── Result overlay ──────────────────────────────────────── */
.rl-result-wrap {
  background: rgba(0,0,0,0.88);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 14px 28px;
  text-align: center;
  box-shadow: 0 0 40px rgba(201,162,39,0.45), inset 0 1px 0 rgba(255,220,80,0.15);
  min-width: 160px;
}
.rl-result-wrap.hidden { display: none; }
.rl-result-number {
  font-size: 52px;
  font-weight: bold;
  color: var(--gold-light);
  line-height: 1;
}
.rl-result-outcome {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  margin-top: 4px;
}
.rl-result-payout {
  font-size: 18px;
  color: #4eff8c;
  margin-top: 6px;
  font-weight: bold;
}

/* ── Layout zone ─────────────────────────────────────────── */
.rl-layout-zone {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-left: 24px;
  position: relative;
  z-index: 1;
}

/* ── Felt / Betting table ────────────────────────────────── */
.rl-felt {
  flex: 1;
  position: relative;
  user-select: none;
}

/* ── Number grid wrapper ─────────────────────────────────── */
.rl-bet-grid {
  display: flex;
  gap: 0;
}
.rl-zero-wrap {
  display: flex;
  align-items: stretch;
}
.rl-nums-wrap {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(3, 1fr);
  flex: 1;
}
.rl-col-bets-wrap {
  display: flex;
  flex-direction: column;
}

/* ── Bet cells ───────────────────────────────────────────── */
.rl-cell {
  min-width: 38px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
  color: #fff;
  border: 1px solid rgba(201,162,39,0.22);
  cursor: pointer;
  position: relative;
  transition: filter 0.12s;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}
.rl-cell:hover { filter: brightness(1.4); z-index: 2; }
.rl-cell.bet-placed { box-shadow: inset 0 0 0 2px var(--gold-light); }

.rl-zero {
  background: linear-gradient(180deg, #228822, #1a6a1a, #0f4a0f);
  writing-mode: vertical-lr;
  text-orientation: upright;
  padding: 8px 0;
  font-size: 14px;
  border-radius: 6px 0 0 6px;
  min-width: 32px;
  letter-spacing: 0.12em;
  border: 1px solid rgba(201,162,39,0.35);
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.cell-red   { background: linear-gradient(160deg, #d63030 0%, #b02020 60%, #881818 100%); }
.cell-black { background: linear-gradient(160deg, #1e1e1e 0%, #111 60%, #080808 100%); }

/* ── Chip token on table ─────────────────────────────────── */
/* Specificity note: chip-system.css loads AFTER this file and its shared
   .cs-chip rule sets position:relative for drag-source tray chips. Every
   placed chip here also carries the .cs-chip class, so this rule MUST be
   at least as specific (two classes) or the later stylesheet wins the
   cascade and turns this into an in-flow element — which visually pushes
   every placed chip down to the bottom of the table regardless of which
   bet zone was clicked. */
.rl-table-chip.cs-chip {
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10;
  transform: translate(-50%, -50%);
}
.rl-table-chip .cs-chip-label { font-size: 8px; }

/* ── Outside bets ────────────────────────────────────────── */
.rl-dozens-row,
.rl-outside-row {
  display: grid;
  margin-top: 4px;
}
.rl-dozens-row { grid-template-columns: repeat(3, 1fr); }
.rl-outside-row { grid-template-columns: repeat(6, 1fr); }

.rl-ob {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(201,162,39,0.22);
  font-size: 11px;
  font-weight: bold;
  color: var(--gold-light);
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.15s, filter 0.15s;
  position: relative;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
.rl-ob:hover { background: rgba(201,162,39,0.14); filter: brightness(1.2); }
.rl-ob.bet-placed { background: rgba(201,162,39,0.1); box-shadow: inset 0 0 0 2px var(--gold); }
.rl-ob.ob-red   { background: rgba(192,39,45,0.32); color: #ff9090; }
.rl-ob.ob-black { background: rgba(0,0,0,0.5); }
.rl-ob.ob-red:hover   { background: rgba(192,39,45,0.52); }
.rl-ob.ob-black:hover { background: rgba(20,20,20,0.8); }

/* ── Street-bet tabs ─────────────────────────────────────── */
.rl-street-col {
  display: flex;
  flex-direction: column;
  width: 20px;
  margin-left: 2px;
  position: relative;
}
.rl-street-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  color: var(--text-dim);
  border: 1px solid rgba(201,162,39,0.2);
  cursor: pointer;
  writing-mode: vertical-lr;
  letter-spacing: 0.12em;
  transition: background 0.12s;
  position: relative;
}
.rl-street-tab:hover { background: rgba(201,162,39,0.14); color: var(--gold); }
.rl-street-tab.bet-placed { background: rgba(201,162,39,0.1); }

/* ── Line-bet hit zones (6 numbers, sits on street-tab boundary) ── */
.rl-line-tab {
  position: absolute;
  left: -2px;
  right: -2px;
  height: 12px;
  transform: translateY(-50%);
  cursor: pointer;
  z-index: 3;
  border-radius: 2px;
  transition: background 0.12s, box-shadow 0.12s;
}
.rl-line-tab:hover { background: rgba(240,208,96,0.35); box-shadow: 0 0 6px rgba(240,208,96,0.6); }
.rl-line-tab.bet-placed { background: rgba(201,162,39,0.28); box-shadow: inset 0 0 0 1px var(--gold); }

.rl-col-bet {
  flex: 1;
  min-width: 38px;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(201,162,39,0.22);
  font-size: 10px;
  font-weight: bold;
  color: var(--gold);
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background 0.15s;
  position: relative;
}
.rl-col-bet:hover { background: rgba(201,162,39,0.14); }
.rl-col-bet.bet-placed { background: rgba(201,162,39,0.1); box-shadow: inset 0 0 0 2px var(--gold); }

/* ── Active bet-selection highlight ─────────────────────────
   Transient click-confirmation feedback, layered on top of (and
   independent from) the persistent .bet-placed chip indicator. */
.rl-cell.active-selection,
.rl-ob.active-selection,
.rl-col-bet.active-selection,
.rl-street-tab.active-selection,
.rl-line-tab.active-selection {
  transform: scale(1.045);
  box-shadow: 0 0 14px 2px rgba(240,208,96,0.85), inset 0 0 0 2px var(--gold-light);
  outline: 1px solid var(--gold-light);
  outline-offset: 1px;
  z-index: 5;
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out, opacity 0.2s ease-out;
}
.rl-cell.dimmed,
.rl-ob.dimmed,
.rl-col-bet.dimmed,
.rl-street-tab.dimmed,
.rl-line-tab.dimmed {
  opacity: 0.55;
  transition: opacity 0.2s ease-out;
}

/* ── Win highlight ───────────────────────────────────────── */
.rl-cell.winning,
.rl-ob.winning,
.rl-col-bet.winning,
.rl-street-tab.winning,
.rl-line-tab.winning {
  animation: winPulse 0.6s ease-in-out 3;
}
@keyframes winPulse {
  0%,100% { filter: brightness(1); }
  50%      { filter: brightness(2.2) drop-shadow(0 0 8px gold); }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1100px) {
  .rl-table-felt { flex-direction: column; align-items: center; }
  .rl-wheel-zone { padding-right: 0; border-right: none; border-bottom: 1px solid rgba(201,162,39,0.18); padding-bottom: 20px; }
  .rl-layout-zone { padding-left: 0; padding-top: 16px; width: 100%; }
}
@media (max-width: 700px) {
  .rl-cell { min-width: 32px; min-height: 32px; font-size: 10px; }
  .rl-zero { min-width: 26px; }
  .rl-casino-table { padding: 10px; }
  .rl-table-felt { padding: 14px 10px; }
}
