/* ==========================================================================
   SPRIBE MINI ROULETTE TURBO - 1:1 AUTHENTIC CASINO EXPERIENCE
   Druk Fortune Games Platform
   ========================================================================== */

:root {
  --rou-bg-dark: #0e0f11;
  --rou-panel-bg: #141518;
  --rou-card-bg: #1a1c21;
  --rou-border: rgba(255, 255, 255, 0.09);
  --rou-border-glow: rgba(255, 255, 255, 0.22);
  --rou-green: #00c853;
  --rou-green-glow: rgba(0, 200, 83, 0.45);
  --rou-red: #e53935;
  --rou-red-glow: rgba(229, 57, 53, 0.45);
  --rou-black: #1e2025;
  --rou-gold: #ffb300;
  --rou-gold-glow: rgba(255, 179, 0, 0.4);
  --rou-text-main: #ffffff;
  --rou-text-dim: #9aa0a6;
}

#viewRoulette {
  display: none;
  width: 100%;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 12%, #191c24 0%, #0d0f13 60%, #08090b 100%);
  color: var(--rou-text-main);
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-sizing: border-box;
  overflow-x: hidden;
  position: relative;
  touch-action: manipulation;
  -webkit-font-smoothing: antialiased;
}

#viewRoulette.active {
  display: flex;
  flex-direction: column;
}

/* --------------------------------------------------------------------------
   HEADER BAR
   -------------------------------------------------------------------------- */
.roulette-header {
  height: 48px;
  background: #141518;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

.roulette-hdr-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.roulette-icon-btn {
  background: #202227;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #d1d5db;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  user-select: none;
}

.roulette-icon-btn:hover {
  background: #2a2d34;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

.roulette-brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.5px;
  color: #fff;
}

.roulette-turbo-badge {
  font-size: 11px;
  background: rgba(255, 179, 0, 0.15);
  color: #ffb300;
  border: 1px solid rgba(255, 179, 0, 0.35);
  padding: 2px 7px;
  border-radius: 5px;
  font-weight: 800;
  text-transform: uppercase;
}

.roulette-hdr-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.roulette-balance-pill {
  background: #1a1c22;
  border: 1px solid rgba(0, 200, 83, 0.35);
  border-radius: 20px;
  padding: 4px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 0 12px rgba(0, 200, 83, 0.1);
}

.roulette-balance-label {
  font-size: 11px;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
}

.roulette-balance-val {
  font-size: 14px;
  font-weight: 900;
  color: #00c853;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   HISTORY RIBBON (LAST POCKETS)
   -------------------------------------------------------------------------- */
.roulette-history-bar {
  display: flex;
  align-items: center;
  background: #111317;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px 16px;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.roulette-history-bar::-webkit-scrollbar {
  display: none;
}

.roulette-history-tag {
  font-size: 11px;
  font-weight: 800;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
}

.roulette-history-list {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
}

.roulette-hist-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  flex-shrink: 0;
  transition: transform 0.2s ease;
  user-select: none;
}

.roulette-hist-badge.green {
  background: linear-gradient(135deg, #00e676, #008f39);
  border: 1px solid #69f0ae;
}

.roulette-hist-badge.red {
  background: linear-gradient(135deg, #ff5252, #c62828);
  border: 1px solid #ff8a80;
}

.roulette-hist-badge.black {
  background: linear-gradient(135deg, #374151, #111827);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.roulette-hist-badge.latest {
  transform: scale(1.15);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
  border: 2px solid #ffd700;
}

/* --------------------------------------------------------------------------
   MAIN ARENA (WHEEL + BOARD)
   -------------------------------------------------------------------------- */
.roulette-arena {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 12px 14px 24px;
  gap: 16px;
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   WHEEL CONTAINER & ANIMATION
   -------------------------------------------------------------------------- */
.roulette-wheel-container {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 4px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.roulette-wheel-outer-rim {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, #2a2d36 60%, #15171c 100%);
  border: 4px solid #4a4f5c;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8), inset 0 2px 6px rgba(255,255,255,0.2), 0 0 20px rgba(0,0,0,0.9);
}

.roulette-wheel-outer-rim::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 215, 0, 0.4);
}

.roulette-wheel-svg {
  width: 270px;
  height: 270px;
  transform-origin: 50% 50%;
  transition: transform 3.6s cubic-bezier(0.12, 0.8, 0.33, 1);
  will-change: transform;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.8));
}

.roulette-pointer {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 18px solid #ffd700;
  z-index: 10;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.8));
}

.roulette-center-hub {
  position: absolute;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: radial-gradient(circle, #3a3f4d 0%, #171920 100%);
  border: 3px solid #ffb300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.8), inset 0 2px 5px rgba(255,255,255,0.3);
  z-index: 5;
  user-select: none;
}

.roulette-hub-number {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}

.roulette-hub-sub {
  font-size: 9px;
  font-weight: 800;
  color: #9ca3af;
  text-transform: uppercase;
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   ROUND RESULT BANNER
   -------------------------------------------------------------------------- */
.roulette-result-banner {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 20px;
  border-radius: 30px;
  background: rgba(20, 22, 28, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
  font-weight: 800;
  color: #e5e7eb;
  transition: all 0.3s ease;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}

.roulette-result-banner.win {
  background: rgba(0, 200, 83, 0.16);
  border-color: #00c853;
  color: #00e676;
  box-shadow: 0 0 20px rgba(0, 200, 83, 0.3);
  transform: scale(1.03);
}

.roulette-result-banner.loss {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

/* --------------------------------------------------------------------------
   AUTHENTIC MINI ROULETTE BETTING BOARD
   -------------------------------------------------------------------------- */
.roulette-board-wrapper {
  width: 100%;
  max-width: 580px;
  background: #14161b;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
  box-sizing: border-box;
}

/* 0 (Zero) Pocket header */
.roulette-zero-cell {
  background: linear-gradient(135deg, #00b050 0%, #007a33 100%);
  border: 1px solid #2ee585;
  border-radius: 8px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  cursor: pointer;
  margin-bottom: 8px;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.roulette-zero-cell:active {
  transform: scale(0.97);
}

.roulette-zero-cell.highlight {
  box-shadow: 0 0 16px #00e676;
  border-color: #ffffff;
}

/* Main Grid: 4 Rows x 3 Cols + Row multipliers */
.roulette-grid-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr) 56px;
  gap: 7px;
  margin-bottom: 8px;
}

.roulette-cell {
  background: #20232a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  font-weight: 900;
  color: #ffffff;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

.roulette-cell:active {
  transform: scale(0.96);
}

.roulette-cell.red {
  background: linear-gradient(135deg, #d32f2f 0%, #9a1b1b 100%);
  border-color: #ef5350;
}

.roulette-cell.black {
  background: linear-gradient(135deg, #2b2e38 0%, #15171c 100%);
  border-color: rgba(255, 255, 255, 0.18);
}

.roulette-cell.street-bet {
  background: #252831;
  border: 1px dashed rgba(255, 215, 0, 0.4);
  font-size: 13px;
  font-weight: 800;
  color: #ffd700;
  letter-spacing: 0.3px;
}

.roulette-cell.highlight {
  box-shadow: 0 0 16px #ffd700;
  border-color: #ffffff !important;
  transform: scale(1.02);
}

/* Column Bets (Below grid) */
.roulette-col-bets {
  display: grid;
  grid-template-columns: repeat(3, 1fr) 56px;
  gap: 7px;
  margin-bottom: 8px;
}

.roulette-col-cell {
  background: #1b1e25;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #9ca3af;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  user-select: none;
}

.roulette-col-cell:active {
  transform: scale(0.96);
}

.roulette-col-cell.highlight {
  border-color: #ffd700;
  color: #ffd700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

/* Outside Bets (Low/High, Red/Black, Even/Odd) */
.roulette-outside-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 7px;
}

.roulette-outside-cell {
  background: #1e2128;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #d1d5db;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  user-select: none;
  gap: 6px;
}

.roulette-outside-cell:active {
  transform: scale(0.96);
}

.roulette-outside-cell.red-box {
  background: linear-gradient(135deg, rgba(211, 47, 47, 0.4), rgba(154, 27, 27, 0.4));
  border-color: #ef5350;
  color: #ff8a80;
}

.roulette-outside-cell.black-box {
  background: linear-gradient(135deg, rgba(55, 65, 81, 0.5), rgba(17, 24, 39, 0.5));
  border-color: rgba(255, 255, 255, 0.25);
  color: #e5e7eb;
}

.roulette-outside-cell.highlight {
  border-color: #ffd700;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.45);
}

.roulette-color-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

.roulette-color-swatch.red {
  background: #d32f2f;
  border: 1px solid #ef5350;
}

.roulette-color-swatch.black {
  background: #111827;
  border: 1px solid #4b5563;
}

/* --------------------------------------------------------------------------
   CHIP STACK TOKEN OVERLAY
   -------------------------------------------------------------------------- */
.roulette-chip-token {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 26px;
  height: 26px;
  padding: 0 4px;
  border-radius: 13px;
  background: radial-gradient(circle, #ffd700 30%, #d48800 100%);
  border: 2px dashed #ffffff;
  color: #000;
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  z-index: 5;
  animation: chipDrop 0.2s cubic-bezier(0.17, 0.89, 0.32, 1.28);
}

@keyframes chipDrop {
  0% { transform: translate(-50%, -80%) scale(1.3); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* --------------------------------------------------------------------------
   CHIP SELECTOR TRAY
   -------------------------------------------------------------------------- */
.roulette-chips-tray {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 580px;
  padding: 8px 0;
  overflow-x: auto;
}

.roulette-chip {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  color: #fff;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  border: 3px dashed rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
}

.roulette-chip:hover {
  transform: translateY(-3px) scale(1.05);
}

.roulette-chip.active {
  transform: translateY(-5px) scale(1.15);
  border-style: solid;
  border-color: #ffffff;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.8), 0 6px 14px rgba(0, 0, 0, 0.8);
}

.roulette-chip.chip-10 {
  background: radial-gradient(circle, #3b82f6 30%, #1d4ed8 100%);
}

.roulette-chip.chip-50 {
  background: radial-gradient(circle, #10b981 30%, #047857 100%);
}

.roulette-chip.chip-100 {
  background: radial-gradient(circle, #8b5cf6 30%, #6d28d9 100%);
}

.roulette-chip.chip-500 {
  background: radial-gradient(circle, #ef4444 30%, #b91c1c 100%);
}

.roulette-chip.chip-1000 {
  background: radial-gradient(circle, #f59e0b 30%, #b45309 100%);
  color: #000;
}

/* --------------------------------------------------------------------------
   BOTTOM CONTROLS BAR (CLEAR, 2X, REBET, SPIN)
   -------------------------------------------------------------------------- */
.roulette-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  max-width: 580px;
  box-sizing: border-box;
}

.roulette-aux-btn {
  flex: 1;
  background: #20232a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #d1d5db;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  gap: 6px;
}

.roulette-aux-btn:hover:not(:disabled) {
  background: #2b2f3a;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.roulette-aux-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.roulette-aux-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.roulette-spin-btn {
  flex: 2;
  background: linear-gradient(135deg, #00e676 0%, #009624 100%);
  border: none;
  border-radius: 10px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  color: #000;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 230, 118, 0.4);
  transition: all 0.2s ease;
  user-select: none;
  gap: 8px;
}

.roulette-spin-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 230, 118, 0.6);
}

.roulette-spin-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.roulette-spin-btn:disabled {
  background: #374151;
  color: #6b7280;
  box-shadow: none;
  cursor: not-allowed;
}

.roulette-total-bet-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 580px;
  padding: 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: #9ca3af;
}

.roulette-total-bet-display span strong {
  color: #ffd700;
  font-size: 15px;
}

/* --------------------------------------------------------------------------
   RULES / PAYOUTS MODAL
   -------------------------------------------------------------------------- */
.roulette-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.roulette-modal-overlay.active {
  display: flex;
}

.roulette-modal-card {
  background: #171920;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.9);
  padding: 20px;
  color: #d1d5db;
}

.roulette-modal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.roulette-modal-hdr h3 {
  margin: 0;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
}

.roulette-modal-close {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
}

.roulette-payout-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 13px;
}

.roulette-payout-table th,
.roulette-payout-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.roulette-payout-table th {
  color: #9ca3af;
  font-weight: 700;
}

.roulette-payout-table td strong {
  color: #00e676;
}

/* --------------------------------------------------------------------------
   RESPONSIVENESS (MOBILE FRIENDLY)
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
  .roulette-wheel-container {
    width: 230px;
    height: 230px;
  }
  .roulette-wheel-svg {
    width: 220px;
    height: 220px;
  }
  .roulette-center-hub {
    width: 56px;
    height: 56px;
  }
  .roulette-hub-number {
    font-size: 18px;
  }
  .roulette-cell {
    height: 42px;
    font-size: 17px;
  }
  .roulette-zero-cell {
    height: 38px;
    font-size: 18px;
  }
  .roulette-chip {
    width: 38px;
    height: 38px;
    font-size: 11px;
  }
  .roulette-action-bar {
    gap: 6px;
  }
  .roulette-aux-btn {
    height: 42px;
    font-size: 11px;
    padding: 0 4px;
  }
  .roulette-spin-btn {
    height: 42px;
    font-size: 14px;
  }
}
