.rl-main {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(14px, 3vh, 32px) 16px 48px;
}

.rl-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
}

/* ── Header ── */
.rl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.rl-balance { display: flex; flex-direction: column; gap: 2px; }
.rl-balance-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.rl-balance-value {
  font-size: 1.35rem;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: -0.5px;
  transition: color 0.25s;
}
.rl-balance-value.flash-win  { color: var(--green); }
.rl-balance-value.flash-lose { color: var(--red); }

.rl-claim {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s, box-shadow 0.18s, transform 0.12s;
}
.rl-claim:not(:disabled) {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(124, 109, 250, 0.3);
}
.rl-claim:not(:disabled):hover  { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(124, 109, 250, 0.45); }
.rl-claim:not(:disabled):active { transform: translateY(1px); }
.rl-claim:disabled { cursor: not-allowed; opacity: 0.75; }
.rl-claim-icon { font-size: 1rem; line-height: 1; }
.rl-claim-text { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.2px; }

/* ── Grid layout ── */
.rl-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 0;
}
.rl-stage {
  padding: 14px 16px 18px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.rl-controls {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
}

/* ── History ── */
.rl-history {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 26px;
  align-items: center;
}
.rl-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  animation: rlChipIn 0.3s ease-out;
}
.rl-chip.red   { background: #b91c1c; color: #fff; border-color: #dc2626; }
.rl-chip.black { background: #1a1a26; color: #fff; border-color: #2a2a3c; }
.rl-chip.green { background: #15803d; color: #fff; border-color: #16a34a; }
@keyframes rlChipIn {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ── Wheel ── */
.rl-wheel-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px 0 0;
}
#wheelCanvas {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.55));
}
/* Pointer arrow at 12 o'clock */
.rl-pointer {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 11px solid #f4cf63;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  z-index: 2;
}

/* ── Toolbar between wheel & board ── */
.rl-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.rl-toolbar-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 7px;
  padding: 4px 10px;
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.rl-toolbar-btn:not(:disabled):hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--surface2);
}
.rl-toolbar-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.rl-result {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.3px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
}
.rl-result.red   { color: #fff; background: #b91c1c; border-color: #dc2626; }
.rl-result.black { color: #fff; background: #1a1a26; border-color: #2a2a3c; }
.rl-result.green { color: #fff; background: #15803d; border-color: #16a34a; }

/* ── Bet board ── */
.rl-board {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  gap: 3px;
  user-select: none;
}
.rl-cell-zero {
  grid-row: 1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.2rem;
  cursor: pointer;
  position: relative;
  transition: filter 0.15s, transform 0.12s;
}
.rl-numbers {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr)) 38px;
  grid-template-rows: repeat(3, 1fr);
  gap: 3px;
  grid-row: 1;
  min-width: 0;
}
.rl-dozens {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 38px;
  gap: 3px;
}
.rl-outside {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)) 38px;
  gap: 3px;
}

.rl-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 5px;
  padding: 6px 2px;
  min-height: 30px;
  cursor: pointer;
  transition: filter 0.15s, transform 0.12s, border-color 0.15s;
  min-width: 0;
}
.rl-cell:hover { filter: brightness(1.18); border-color: var(--accent); }
.rl-cell:active { transform: translateY(1px); }

.rl-cell-num { font-family: var(--mono); font-size: 0.82rem; font-weight: 700; }
.rl-num { font-family: var(--mono); font-size: 0.95rem; font-weight: 700; }
.rl-cell-col {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  background: transparent;
}
.rl-cell-dozen, .rl-cell-outside {
  font-size: 0.7rem;
  letter-spacing: 0.3px;
}

.rl-color-red    { background: #b91c1c; color: #fff; border-color: #dc2626; }
.rl-color-red:hover { background: #dc2626; }
.rl-color-black  { background: #1a1a26; color: #fff; border-color: #2a2a3c; }
.rl-color-black:hover { background: #2a2a3c; }
.rl-color-green  { background: #15803d; color: #fff; border-color: #16a34a; }
.rl-color-green:hover { background: #16a34a; }

/* Highlighted on hover for related groups */
.rl-cell.glow { box-shadow: 0 0 0 2px var(--accent), 0 6px 14px -6px var(--accent); border-color: var(--accent); }
.rl-cell.win-pulse {
  animation: rlWin 0.7s ease-out 2;
  box-shadow: 0 0 0 2px var(--green), 0 8px 22px -8px var(--green);
}
@keyframes rlWin {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}

/* Chip stack on a bet cell */
.rl-chipstack {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0%, #ddd 18%, #ccc 35%, #777 65%);
  border: 2px dashed #fff;
  color: #1a1a2e;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  animation: rlChipPop 0.18s ease-out;
  z-index: 2;
}
@keyframes rlChipPop {
  from { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
  to   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* ── Controls aside ── */
.rl-field { display: flex; flex-direction: column; gap: 6px; }
.rl-field-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.rl-field-quick { display: inline-flex; gap: 4px; }
.rl-field-quick button {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-family: var(--mono);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.rl-field-quick button:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--surface2);
}
.rl-input-wrap {
  display: flex;
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  transition: border-color 0.15s;
}
.rl-input-wrap:focus-within { border-color: var(--accent); }
.rl-input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  padding: 10px 0;
  outline: none;
  width: 100%;
  -moz-appearance: textfield;
}
.rl-input-wrap input::-webkit-outer-spin-button,
.rl-input-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.rl-input-prefix { color: var(--muted); font-family: var(--mono); margin-right: 6px; }

.rl-chip-quick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.rl-chip-quick button {
  padding: 8px 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.rl-chip-quick button:hover { border-color: var(--accent); color: var(--accent); }
.rl-chip-quick button.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: transparent;
  color: white;
}

.rl-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.rl-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
}
.rl-info-val { color: var(--text); font-family: var(--mono); font-weight: 600; }

.rl-spin-btn {
  margin-top: auto;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(124, 109, 250, 0.32);
  transition: transform 0.12s, box-shadow 0.18s, opacity 0.18s;
}
.rl-spin-btn:not(:disabled):hover  { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(124, 109, 250, 0.45); }
.rl-spin-btn:not(:disabled):active { transform: translateY(1px); }
.rl-spin-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .rl-grid { grid-template-columns: 1fr; }
  .rl-stage {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}
@media (max-width: 600px) {
  .rl-board { grid-template-columns: 38px 1fr; gap: 3px; }
  .rl-numbers { gap: 3px; }
  .rl-dozens, .rl-outside { gap: 3px; }
  .rl-cell { font-size: 0.68rem; padding: 7px 2px; min-height: 32px; }
  .rl-num { font-size: 0.95rem; }
  .rl-cell-num { font-size: 0.78rem; }
  .rl-dozens { grid-template-columns: repeat(3, 1fr) 42px; }
  .rl-outside { grid-template-columns: repeat(6, 1fr) 42px; }
}
