/* ── Layout ── */
.rl-screen {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 12px calc(24px + env(safe-area-inset-bottom));
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
}

/* ── Header ── */
.rl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.rl-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
}

.rl-balance {
  font-size: 20px;
  font-weight: 800;
  color: #FBBF24;
  background: rgba(251,191,36,0.1);
  padding: 6px 14px;
  border-radius: 20px;
}

/* ── Stats ── */
.rl-stats-row {
  display: flex;
  gap: 8px;
}

.rl-stat {
  flex: 1;
  background: var(--bg-surface);
  border-radius: 12px;
  padding: 8px;
  text-align: center;
}

.rl-stat-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.rl-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Wheel ── */
.rl-wheel-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px 0;
}

.rl-wheel-wrap svg {
  filter: drop-shadow(0 4px 20px rgba(0,0,0,0.5));
  border-radius: 50%;
}

.rl-wheel-rim {
  fill: #1A1F2E;
  stroke: var(--rl-rim, #7C6AEF);
  stroke-width: 4;
}

.rl-slice--red   { fill: var(--rl-red, #DC2626); }
.rl-slice--black { fill: var(--rl-black, #111827); }
.rl-slice--green { fill: #10B981; }

.rl-slice-sep {
  stroke: #1A1F2E;
  stroke-width: 0.8;
}

.rl-slice-num {
  fill: #fff;
  font-size: 5.5px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
  user-select: none;
}

.rl-hub {
  fill: #0A0E1A;
  stroke: #FBBF24;
  stroke-width: 2;
}

.rl-ball {
  fill: #F8FAFC;
  filter: drop-shadow(0 0 3px rgba(255,255,255,0.9));
}

.rl-pointer {
  fill: #FBBF24;
  filter: drop-shadow(0 0 4px rgba(251,191,36,0.8));
}

/* ── Chip selector ── */
.rl-chips {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 4px 0;
}

.rl-chip-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid var(--chip-color, #6B7280);
  background: rgba(0,0,0,0.3);
  color: var(--chip-color, #6B7280);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  display: grid;
  place-items: center;
}

.rl-chip-btn.active {
  background: var(--chip-color, #6B7280);
  color: #0A0E1A;
  transform: scale(1.18);
  box-shadow: 0 0 12px var(--chip-color, #6B7280);
}

.rl-chip-btn:active { transform: scale(0.95); }

/* ── Table ── */
.rl-table-wrap {
  overflow-x: auto;
  padding: 2px 0;
}

.rl-table {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 320px;
  user-select: none;
}

.rl-grid-outer {
  display: flex;
  gap: 3px;
}

.rl-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 3px;
  flex: 1;
}

.rl-col-bets {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 38px;
  flex-shrink: 0;
}

/* ── Cell base ── */
.rl-cell,
.rl-outside-btn {
  position: relative;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.1s, transform 0.1s;
  overflow: visible;
}

.rl-cell:active,
.rl-outside-btn:active { transform: scale(0.94); }

.rl-cell:disabled,
.rl-outside-btn:disabled { opacity: 0.5; pointer-events: none; }

.rl-cell {
  aspect-ratio: 1 / 1.15;
}

.rl-cell--red   { background: #B91C1C; }
.rl-cell--black { background: #1F2937; }
.rl-cell--green { background: #059669; }

.rl-cell--zero {
  writing-mode: vertical-rl;
  aspect-ratio: unset;
  width: 30px;
  min-height: 100%;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}

.rl-cell-label {
  font-size: clamp(9px, 2.4vw, 13px);
  font-weight: 700;
  color: #fff;
  pointer-events: none;
  line-height: 1;
}

/* ── Chip overlay on cell ── */
.rl-chip {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: #FBBF24;
  color: #0A0E1A;
  font-size: 9px;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  z-index: 5;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.rl-chip.active {
  display: flex;
}

/* ── Dozen row ── */
.rl-dozen-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 3px;
  padding-right: 41px; /* align with grid (not col-bets) */
}

/* ── Outside bets ── */
.rl-outside-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 3px;
  padding-right: 41px;
}

.rl-outside-btn {
  height: 32px;
  border-radius: 6px;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.08);
}

.rl-outside-btn--red   { background: #B91C1C; }
.rl-outside-btn--black { background: #1F2937; border: 1px solid rgba(255,255,255,0.15); }
.rl-outside--red   { background: #B91C1C !important; }
.rl-outside--black { background: #1F2937 !important; border: 1px solid rgba(255,255,255,0.15) !important; }

.rl-outside-label {
  font-size: clamp(8px, 2vw, 11px);
  font-weight: 700;
  color: var(--text-secondary);
  pointer-events: none;
  white-space: nowrap;
}

.rl-outside--red .rl-outside-label,
.rl-outside--black .rl-outside-label {
  color: #fff;
}

.rl-col-bets .rl-outside-btn {
  height: auto;
  flex: 1;
  font-size: 9px;
}

/* ── Winner highlight ── */
.rl-cell--winner {
  animation: rl-winner-pulse 0.6s ease infinite;
  z-index: 2;
}

@keyframes rl-winner-pulse {
  0%, 100% { box-shadow: 0 0 0 0 #FBBF24; transform: scale(1); }
  50%       { box-shadow: 0 0 0 6px rgba(251,191,36,0.3); transform: scale(1.12); }
}

/* ── Action bar ── */
.rl-action-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}

.rl-bet-label {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.rl-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

/* ── Buttons ── */
.rl-btn {
  border: none;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.rl-btn:active { transform: scale(0.96); opacity: 0.85; }
.rl-btn:disabled { opacity: 0.35; pointer-events: none; }

.rl-btn--ghost   { background: var(--bg-elevated); color: var(--text-secondary); }
.rl-btn--primary { background: var(--accent-primary); color: #fff; }
.rl-btn--accent  { background: var(--accent-primary); color: #fff; }

.rl-btn--spin {
  background: linear-gradient(135deg, #EF4444, #FBBF24);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  padding: 14px;
  border-radius: 14px;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 16px rgba(239,68,68,0.4);
}

.rl-btn--spin:not(:disabled):hover {
  box-shadow: 0 6px 22px rgba(239,68,68,0.6);
}

/* ── Modal ── */
.rl-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 400;
  padding: 20px;
}

.rl-modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  padding: 28px 20px 20px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.rl-modal-num {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  animation: rl-modal-pop 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

.rl-modal-num--red   { background: #DC2626; box-shadow: 0 0 20px rgba(220,38,38,0.5); }
.rl-modal-num--black { background: #1F2937; box-shadow: 0 0 20px rgba(0,0,0,0.8); border: 2px solid rgba(255,255,255,0.15); }
.rl-modal-num--green { background: #10B981; box-shadow: 0 0 20px rgba(16,185,129,0.5); }

@keyframes rl-modal-pop {
  0%   { transform: scale(0.3); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}

.rl-modal-num-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: -6px;
}

.rl-modal-result {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.rl-modal-result--win  { color: #34D399; }
.rl-modal-result--lose { color: #F87171; }

.rl-modal-breakdown {
  background: var(--bg-surface);
  border-radius: 12px;
  padding: 10px 14px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rl-modal-hit {
  font-size: 13px;
  color: #34D399;
  font-weight: 600;
}

.rl-modal-balance {
  font-size: 20px;
  font-weight: 800;
  color: #FBBF24;
}

.rl-modal-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}

.rl-modal-desc {
  font-size: 14px;
  color: var(--text-muted);
}

.rl-modal-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}
