/* =====================================================
   GAME.CSS — Global Shared Styles for All Games
   Color Prediction | Dice | Digit (3D Lottery)
   Theme: Vibrant Purple/Violet Gambling App
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Nunito:wght@400;500;600;700;800&display=swap');

/* ───── CSS Variables ───── */
:root {
  --primary:        #7c3aed;
  --primary-light:  #a855f7;
  --primary-dark:   #5b21b6;
  --primary-glow:   rgba(124, 58, 237, 0.35);
  --accent:         #f59e0b;
  --accent-light:   #fcd34d;
  --success:        #22c55e;
  --danger:         #ef4444;
  --danger-dark:    #dc2626;
  --bg:             #f5f3ff;
  --bg-card:        #ffffff;
  --bg-light:       #f8f9fa;
  --border:         #e5e7eb;
  --text:           #1f2937;
  --text-muted:     #6b7280;
  --text-light:     #9ca3af;
  --radius:         12px;
  --radius-lg:      20px;
  --shadow:         0 4px 20px rgba(124, 58, 237, 0.12);
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.08);
  --transition:     0.25s ease;
  --font-main:      'Nunito', sans-serif;
  --font-display:   'Rajdhani', sans-serif;
}

/* ───── Reset & Base ───── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  font-family: var(--font-main);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ───── App Container ───── */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-card);
  min-height: 100vh;
  position: relative;
  padding-bottom: 20px;
  box-shadow: 0 0 40px rgba(0,0,0,0.10);
  overflow: hidden;
}

/* ───── Header ───── */
.game-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.game-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
}

.header-back-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--bg-light);
  border: none;
  cursor: pointer;
  transition: background var(--transition);
}
.header-back-btn:hover { background: #e9d5ff; }

.header-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text);
}

.header-balance {
  text-align: right;
}
.header-balance .label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.header-balance .amount {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Sound Toggle Button */
.sound-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--bg-light);
  border: none;
  cursor: pointer;
  color: var(--primary);
  transition: all var(--transition);
}
.sound-btn:hover { background: #e9d5ff; }
.sound-btn.muted { color: var(--text-muted); }

/* ───── Time Slot Tabs ───── */
.time-slot-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  background: #fff;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border);
}
.time-slot-tabs::-webkit-scrollbar { display: none; }

.tab-slot {
  flex: 0 0 auto;
  min-width: 70px;
  background: var(--bg-light);
  border: 2px solid transparent;
  border-radius: var(--radius);
  border-top-right-radius: 16px;
  padding: 8px 10px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  opacity: 0.7;
}
.tab-slot img { margin: 0 auto 4px; }
.tab-slot .slot-label { font-size: 12px; font-weight: 700; color: var(--text); }

.tab-slot.active {
  background: #ede9fe;
  border-color: var(--primary-light);
  opacity: 1;
  box-shadow: 0 0 0 2px var(--primary-glow);
}
.tab-slot.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(1);
  pointer-events: none;
}

/* ───── Game Banner / Timer Bar ───── */
.game-banner {
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid var(--primary-light);
}

.banner-period-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.banner-period-id {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.timer-section { text-align: right; }
.timer-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.timer-display {
  display: flex;
  align-items: center;
  gap: 3px;
  justify-content: flex-end;
}
.timer-digit {
  background: #fff;
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  width: 32px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid #ddd6fe;
  transition: background 0.15s, color 0.15s;
}
.timer-digit.warning { background: var(--accent); color: #fff; }
.timer-digit.danger  { background: var(--danger); color: #fff; animation: timerPulse 0.4s infinite; }

.timer-sep {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  padding-bottom: 4px;
}

@keyframes timerPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.05); }
}

/* ───── Category Tabs (Sum/Triple/Double/Single) ───── */
.cat-tabs {
  display: flex;
  background: var(--bg-light);
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
  flex: 1;
  min-width: 70px;
  padding: 12px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.cat-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: #ede9fe;
}

/* ───── Game Content Area ───── */
.game-content { display: none; padding: 12px; }
.game-content.active { display: block; }

/* ───── Betting Grids ───── */
.bet-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.dice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.bet-item {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.bet-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--primary-glow);
  opacity: 0;
  transition: opacity var(--transition);
}
.bet-item:hover { border-color: var(--primary-light); transform: translateY(-2px); box-shadow: var(--shadow); }
.bet-item:hover::before { opacity: 1; }
.bet-item:active { transform: scale(0.97); }

.bet-item .bet-img { width: 52px; height: 52px; object-fit: contain; margin: 0 auto 4px; }

.bet-item .odds {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 4px;
  background: #ede9fe;
  border-radius: 20px;
  padding: 2px 8px;
  display: inline-block;
}

/* Dice images */
.dice-triple { width: 42px; height: 42px; object-fit: contain; }
.dice-double { width: 45px; height: 45px; object-fit: contain; }
.dice-single { width: 50px; height: 50px; object-fit: contain; }

.dice-container { padding: 8px 0; }

/* ───── Game Disabled Overlay ───── */
.game-disabled {
  filter: grayscale(0.6);
  opacity: 0.6;
  pointer-events: none;
  cursor: not-allowed;
  position: relative;
}
.game-disabled::after {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(124, 58, 237, 0.9);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  z-index: 10;
  white-space: nowrap;
  pointer-events: none;
}

/* ───── Bet Modal (Bottom Sheet) ───── */
.modal.bottom .modal-dialog {
  position: fixed;
  margin: 0;
  width: 100%;
  max-width: 480px;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  bottom: 0;
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}
.modal.bottom.show .modal-dialog { transform: translateX(-50%) translateY(0); }

.modal-content {
  border-radius: 24px 24px 0 0 !important;
  border: none !important;
  max-height: 88vh;
  overflow-y: auto;
}

.modal-drag-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px auto 0;
}

.bet-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.bet-modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.bet-preview-area {
  background: linear-gradient(135deg, #fffbeb, #fef9c3);
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  margin: 16px 20px;
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
}

.modal-dice-img { width: 56px; height: 56px; object-fit: contain; }

/* Amount Selector */
.amount-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 20px;
  margin-bottom: 16px;
}
.amt-btn {
  background: var(--bg-light);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
}
.amt-btn.active, .amt-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Multiplier Row */
.multiplier-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  margin-bottom: 12px;
}
.multiplier-label { font-size: 14px; font-weight: 700; }

.multiplier-stepper {
  display: flex;
  align-items: center;
  border: 2px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.mult-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-light);
  border: none;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  color: var(--primary);
  transition: background var(--transition);
}
.mult-btn:hover { background: #ede9fe; }
.mult-input {
  width: 56px;
  text-align: center;
  font-weight: 700;
  font-size: 16px;
  border: none;
  outline: none;
  background: #fff;
}

/* Quick Multiplier */
.quick-mult-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 20px;
  margin-bottom: 16px;
}
.qm-btn {
  background: var(--bg-light);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}
.qm-btn.active, .qm-btn:hover {
  background: #f3e8ff;
  color: var(--primary-dark);
  border-color: var(--primary-light);
}

/* Confirm Bet Button */
.confirm-bet-btn {
  margin: 0 20px 20px;
  width: calc(100% - 40px);
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border: none;
  border-radius: 30px;
  padding: 14px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 20px var(--primary-glow);
  transition: all var(--transition);
  font-family: var(--font-display);
  letter-spacing: 0.5px;
}
.confirm-bet-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px var(--primary-glow); }
.confirm-bet-btn:disabled { background: #9ca3af; box-shadow: none; cursor: not-allowed; transform: none; }

/* ───── History Section ───── */
.history-section { background: #fff; margin-top: 8px; }

.history-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.history-tabs::-webkit-scrollbar { display: none; }

.h-tab {
  flex: 1;
  min-width: 80px;
  padding: 12px 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}
.h-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ───── History Table ───── */
.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.history-table thead tr {
  background: #f8f5ff;
  border-bottom: 2px solid var(--border);
}
.history-table th {
  padding: 10px 12px;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.history-table tbody tr {
  border-bottom: 1px solid #f3f4f6;
  transition: background var(--transition);
}
.history-table tbody tr:hover { background: #faf9ff; }
.history-table td {
  padding: 10px 12px;
  vertical-align: middle;
}

/* ───── Pagination ───── */
.pagination-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f8f5ff;
  border-top: 1px solid var(--border);
}
.page-total { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.page-controls { display: flex; align-items: center; gap: 4px; }
.page-num {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: #fff;
  transition: all var(--transition);
}
.page-num.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-num:hover:not(.active) { border-color: var(--primary-light); color: var(--primary); }
.page-nav-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-light);
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all var(--transition);
}
.page-nav-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-nav-btn.disabled { opacity: 0.4; pointer-events: none; }

/* ───── Winner Row ───── */
.winner-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.winner-row:hover { background: #faf9ff; }
.winner-avatar { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--border); object-fit: cover; }
.winner-name { font-size: 13px; font-weight: 600; color: var(--text); }
.winner-amount { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--success); }

.rank-badge {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px;
  background: var(--bg-light); color: var(--text-muted);
}
.rank-1 { background: linear-gradient(135deg, #ffd700, #f59e0b); color: #fff; box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4); }
.rank-2 { background: linear-gradient(135deg, #d1d5db, #9ca3af); color: #fff; }
.rank-3 { background: linear-gradient(135deg, #cd7f32, #a0522d); color: #fff; }

/* ───── Color Prediction Buttons ───── */
.color-btn-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 14px;
}

.bet-btn {
  border: none;
  border-radius: 14px;
  padding: 14px 8px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.5px;
  font-family: var(--font-display);
  box-shadow: var(--shadow-sm);
}
.bet-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.bet-btn:active { transform: scale(0.97); }

.btn-green { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; }
.btn-red   { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }
.btn-violet{ background: linear-gradient(135deg, #a855f7, #7c3aed); color: #fff; }

/* ───── Color Balls ───── */
.ball-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  padding: 12px 14px;
  background: #f8f5ff;
}
.ball-container {
  position: relative;
  cursor: pointer;
  transition: transform var(--transition);
}
.ball-container:hover { transform: scale(1.08); }
.ball-img { width: 52px; height: 52px; object-fit: contain; margin: 0 auto; }
.ball-num {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 900;
  font-size: 17px;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
  color: #fff;
  pointer-events: none;
}

/* Color dot indicators */
.dot {
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 50%;
  vertical-align: middle;
}
.dot-red      { background: var(--danger-dark); }
.dot-green    { background: var(--success); }
.dot-violet   { background: var(--primary); }
.dot-red-violet    { background: linear-gradient(to right, var(--danger-dark) 50%, var(--primary) 50%); }
.dot-green-violet  { background: linear-gradient(to right, var(--success) 50%, var(--primary) 50%); }

/* ───── Order Card ───── */
.order-card {
  background: #fff;
  border-radius: 0;
  border-bottom: 8px solid var(--bg);
  overflow: hidden;
}

.order-header-strip {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
}

.draw-results-area {
  background: #f8f5ff;
  padding: 14px 16px;
  border-bottom: 1px dashed var(--border);
}
.draw-section-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-bottom: 10px; }
.draw-boxes { display: flex; gap: 8px; }
.draw-box {
  flex: 1;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 6px;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.draw-box-label { font-size: 10px; color: var(--text-muted); font-weight: 600; }

.order-meta { padding: 12px 16px; }
.order-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.order-game-name { font-size: 15px; font-weight: 700; }
.order-amount { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--text); }
.order-win-amount { font-size: 13px; color: var(--success); font-weight: 700; }
.order-loss-amount { font-size: 13px; color: var(--danger); font-weight: 600; }
.order-pending { font-size: 13px; color: var(--accent); font-weight: 600; }

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.status-win       { background: #dcfce7; color: #16a34a; }
.status-loss      { background: #fee2e2; color: #dc2626; }
.status-pending   { background: #fef9c3; color: #b45309; }

/* ───── Notification Bar ───── */
.notif-bar {
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  padding: 7px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #92400e;
}
.notif-bar i { flex-shrink: 0; color: #b45309; }

/* ───── Dice Result Header ───── */
.dice-result-header {
  background: var(--primary-dark);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.dice-result-header img { width: 28px; height: 28px; object-fit: contain; }

.sum-badge-wrapper {
  position: relative;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-dark);
  border-radius: 8px;
}
.sum-badge-wrapper img { width: 28px; }
.sum-badge-val {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 900;
  font-size: 13px;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
  z-index: 2;
}

.size-type-wrapper {
  background: var(--primary-dark);
  border-radius: 8px;
  padding: 4px 8px;
  display: flex;
  gap: 6px;
}
.size-type-wrapper img { width: 28px; }

/* Dice rolling animation */


/* ───── Color Prediction Last Result ───── */
.last-result-ball {
  position: relative;
  cursor: default;
}
.animating-pulse { animation: ballPulse 0.2s infinite ease-in-out; }
@keyframes ballPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.2); }
}

/* ───── 3D Digit Lottery ───── */
.input-num {
  width: 44px; height: 44px;
  border: 2px solid var(--border);
  text-align: center;
  border-radius: 10px;
  font-weight: 800;
  font-size: 20px;
  outline: none;
  transition: border-color var(--transition);
  font-family: var(--font-display);
}
.input-num:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

.ball-a { background: var(--danger-dark); }
.ball-b { background: #f59e0b; }
.ball-c { background: #3b82f6; }

.win-badge {
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  margin-left: 8px;
}

.qty-stepper {
  background: var(--bg-light);
  border-radius: 20px;
  display: flex;
  align-items: center;
  padding: 2px 4px;
  width: 96px;
  justify-content: space-between;
  visibility: hidden;
  border: 1px solid var(--border);
}
.step-btn {
  border: none;
  background: var(--border);
  color: var(--text);
  width: 26px; height: 26px;
  border-radius: 50%;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.step-btn:hover { background: var(--primary-light); color: #fff; }
.qty-val { font-size: 13px; font-weight: 700; min-width: 20px; text-align: center; }

.btn-add {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all var(--transition);
}
.btn-add:hover { background: var(--primary-dark); transform: translateY(-1px); }

.btn-quick {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-quick:hover { border-color: var(--primary); color: var(--primary); }

/* ───── Checkout Bar (Digit Game) ───── */
.checkout-bar {
  position: fixed;
  bottom: 0;
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-top: 2px solid var(--border);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}
.checkout-info { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.checkout-basket {
  background: var(--primary);
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.checkout-total {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}
.checkout-count { font-size: 11px; color: var(--text-muted); }
.pay-btn {
  background: #d1d5db;
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 30px;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-display);
}
.pay-btn.active { background: linear-gradient(135deg, var(--primary), var(--primary-light)); box-shadow: 0 4px 16px var(--primary-glow); }
.pay-btn:hover.active { transform: translateY(-2px); }

/* ───── No Data Placeholder ───── */
.no-data {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  color: var(--text-light);
  gap: 12px;
}
.no-data i { opacity: 0.3; }
.no-data p { font-size: 14px; font-weight: 600; }

/* ───── Result Win/Loss Popup ───── */
.result-win-header {
  background: linear-gradient(135deg, #ffd700, #f59e0b);
  color: #fff;
  padding: 28px 20px;
  text-align: center;
}
.result-loss-header {
  background: linear-gradient(135deg, #9ca3af, #6b7280);
  color: #fff;
  padding: 28px 20px;
  text-align: center;
}
.result-win-amount {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  color: #fbbf24;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* ───── Utility ───── */
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-accent  { color: var(--accent) !important; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fs-14 { font-size: 14px; }
.font-display { font-family: var(--font-display); }

/* ───── Animations ───── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.3s ease both; }

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.shimmer {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

/* ───── Responsive ───── */
@media (max-width: 360px) {
  .bet-grid       { grid-template-columns: repeat(3, 1fr); }
  .timer-digit    { width: 28px; font-size: 18px; }
  .ball-img       { width: 44px; height: 44px; }
}

/* =====================================================
   DICE.CSS — Original Dice Game Styles (preserved exactly)
   ===================================================== */

/* Fix body moving/shifting when modal opens */
html, body { overflow-x: hidden; width: 100%; position: relative; }
body { padding-right: 0 !important; }
.modal-open { overflow: hidden !important; padding-right: 0 !important; }

.tab-btn {
    background: white; border-radius: 4px; border-top-right-radius: 16px;
    border: 1px solid #dee2e6; min-height: 70px; width: 100%;
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; opacity: 0.6; transition: 0.3s;
}
.tab-active {
    background: #e9d5ff !important; border: 2px solid #a855f7 !important;
    opacity: 1 !important; position: relative;
}
.timer-box {
    background: #fff; color: #7c3aed; padding: 4px 8px; border-radius: 4px;
    font-weight: bold; font-size: 18px; box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.timer-separator { color: #7c3aed; font-size: 24px; font-weight: bold; padding-bottom: 5px; }
.game-disabled { filter: grayscale(1); opacity: 0.5; pointer-events: none; cursor: not-allowed; }
.dice-triple, .dice-double, .dice-single { width: 45px; height: 45px; object-fit: contain; }
.bet-item { cursor: pointer; }

/* Bottom Sheet Modal */
.modal.bottom .modal-dialog {
    position: fixed; margin: auto; width: 100%; height: auto;
    bottom: 0; left: 0; right: 0;
    transform: translate3d(0, 100%, 0); transition: transform 0.3s ease-out;
}
.modal.bottom.show .modal-dialog { transform: translate3d(0, 0, 0); }
.modal-content { border-radius: 24px 24px 0 0 !important; border: none; max-height: 90vh; overflow-x: hidden; }
.bet-modal-header {
    background: #fff; border: none; padding: 20px;
    display: flex; align-items: center; justify-content: space-between;
}
.bet-preview-area {
    background: #fffff0; padding: 20px; border-radius: 12px; margin-bottom: 15px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 100%; min-height: 120px;
}
.modal-dice-img { width: 50px; height: 50px; object-fit: contain; }
.amount-selector .btn {
    background: #f3f4f6; border: none; font-weight: bold;
    padding: 10px; color: #333; border-radius: 8px; font-size: 14px;
}
.amount-selector .btn.active { background: #a855f7; color: #fff; }
.multiplier-box { background: #f3f4f6; border: none; width: 60px; text-align: center; font-weight: bold; height: 38px; }
.quick-multiplier .btn {
    background: #f3f4f6; border: none; font-size: 12px; padding: 6px 12px; margin: 2px; border-radius: 6px;
}
.quick-multiplier .btn.active { background: #f0abfc; color: #701a75; border: 1px solid #701a75; }
.total-pay-btn {
    background: #a855f7; color: #fff; border: none; border-radius: 30px;
    font-weight: bold; padding: 12px; width: 100%; font-size: 16px;
    box-shadow: 0 4px 10px rgba(168, 85, 247, 0.3);
}

/* Dice Header Result row */
.header-dice-box { display: flex; align-items: center; justify-content: center; }
.header-sum-txt {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    color: black; margin-top: -1px; font-weight: 900; font-size: 14px;
}

/* Dice rolling animation — on images and number span inside purple boxes */
.dice-rolling {
    animation: diceRoll 0.4s infinite linear;
}
@keyframes diceRoll {
    0%   { opacity: 0.5; }
    50%  { opacity: 1;   }
    100% { opacity: 0.5; }
}

/* Winner row (dice) */
.winner-avatar { width: 35px; height: 35px; border-radius: 50%; object-fit: cover; border: 1px solid #eee; }
.rank-badge { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 5px; font-weight: bold; font-size: 12px; color: #777; background: #eee; }
.rank-1 { background: linear-gradient(135deg, #ffd700, #ffae00); color: #fff; }
.rank-2 { background: linear-gradient(135deg, #c0c0c0, #8e8e8e); color: #fff; }
.rank-3 { background: linear-gradient(135deg, #cd7f32, #a0522d); color: #fff; }

/* Pagination (dice) */
.pagination-container { display: flex; align-items: center; justify-content: center; gap: 15px; padding: 20px; background: #fff; border-top: 1px solid #eee; }
.page-link { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 4px; color: #666; cursor: pointer; border: 1px solid #eee; }
.page-link.active { font-weight: bold; color: #fff; background: #7c3aed; border-color: #7c3aed; }
.page-nav { background: #f3f4f6; color: #9ca3af; width: 35px; height: 35px; border-radius: 4px; display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* Draw Result (order card - dice) */
.draw-results-header { background: #f8f9fa; border-radius: 8px; }
.section-title { font-size: 13px; font-weight: bold; margin-bottom: 8px; color: #333; }
.draw-label { font-size: 10px; color: #666; display: block; margin-bottom: 2px; }
.draw-box { background: #fff; border: 1px solid #eee; border-radius: 4px; padding: 5px; min-height: 38px; display: flex; align-items: center; justify-content: center; position: relative; }
.point-badge-img { width: 26px; height: 26px; }
.status-bar { background: #7c3aed; color: #fff; padding: 5px 12px; font-size: 11px; font-weight: bold; }

/* Dice result header purple boxes */
.dice-result-purple-wrap {
    display: flex; padding: 6px 8px; gap: 4px;
    background: purple; border-radius: 3px; align-items: center;
}
.dice-result-purple-wrap img { width: 27px; height: 27px; object-fit: contain; }

/* Sum badge inside purple box */
.sum-purple-box {
    background: purple; border-radius: 3px;
    width: 35px; height: 35px;
    display: flex; align-items: center; justify-content: center; position: relative;
}
.sum-purple-box img { width: 27px; position: relative; z-index: 1; }
.sum-purple-box .sum-val {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: #fff; font-weight: 900; font-size: 12px; z-index: 2;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}

/* Size+Type purple box */
.sizetype-purple-box {
    background: purple; border-radius: 3px;
    display: flex; gap: 4px; padding: 4px 6px; align-items: center;
}
.sizetype-purple-box img { width: 27px; height: 27px; object-fit: contain; }

/* =====================================================
   CPG.CSS — Original Color Prediction Styles (preserved exactly)
   ===================================================== */

html, body { overflow-x: hidden; width: 100%; position: relative; }
body { font-family: 'Arial', sans-serif; background-color: #f3f4f6; padding-right: 0 !important; }
.modal-open { overflow: hidden !important; padding-right: 0 !important; }

.main-wrapper { max-width: 448px; margin: 0 auto; background: white; min-height: 100vh; padding-bottom: 40px; }

/* Ball containers */
.ball-container {
    position: relative; width: 56px; height: 56px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto; cursor: pointer; transition: transform 0.1s;
}
.ball-img { width: 100%; height: 100%; object-fit: contain; }
.ball-num {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: white; color: black; width: 27px; height: 27px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 14px; box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

/* Action Buttons */
.bet-btn { text-transform: uppercase; font-weight: bold; border-radius: 10px; border: none; padding: 10px 0; width: 100%; color: white; }
.btn-green  { background-color: #22c55e; }
.btn-violet { background-color: #9333ea; }
.btn-red    { background-color: #dc2626; }
.bg-light2  { background-image: linear-gradient(rgb(214, 202, 250), rgb(230, 214, 255)); }

/* History tab */
.history-tab { font-size: 14px; color: #444; position: relative; padding: 12px 0; flex: 1; text-align: center; cursor: pointer; }
.history-tab.active { color: #a855f7; }
.history-tab.active::after {
    content: ''; position: absolute; bottom: 0px; left: 25%; width: 50%;
    height: 3px; background: #a855f7; border-radius: 4px;
}
.tab-content-panel { display: none; padding: 10px; min-height: 200px; }
.tab-content-panel.active { display: block; }

.history-table thead { background-color: #f0f1ff; }
.history-table th { font-size: 11px; color: #6b7280; text-transform: uppercase; border: none; padding: 10px 15px; }
.history-table td { font-size: 13px; border: none; padding: 12px 15px; vertical-align: middle; }

.dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.dot-green  { background-color: #22c55e; }
.dot-red    { background-color: #dc2626; }
.dot-violet { background-color: #9333ea; }
.dot-red-violet   { background: linear-gradient(to right, #dc2626 50%, #9333ea 50%); }
.dot-green-violet { background: linear-gradient(to right, #22c55e 50%, #9333ea 50%); }

/* Modal */
.modal.fade .modal-dialog {
    transform: translateY(100%); transition: transform 0.3s ease-out;
    margin: 0 auto; display: flex; align-items: flex-end; height: 100%;
}
.modal.show .modal-dialog { transform: translateY(0); }
.modal-content { border-radius: 24px 24px 0 0; border: none; max-width: 448px; max-height: 90vh; overflow-y: auto; }

.bet-display-area { padding: 15px 0; text-align: center; background-color: #fffdec; display: flex; justify-content: center; }
.modal-color-circle {
    width: 70px; height: 70px; border-radius: 50%; color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-size: 12px; text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.modal-ball-style { width: 75px; height: 75px; position: relative; display: inline-flex; align-items: center; justify-content: center; }
.modal-ball-num {
    position: absolute; background: white; color: black; width: 37px; height: 37px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 18px; box-shadow: 0 3px 6px rgba(0,0,0,0.2);
}

.amount-btn { border: 1px solid #eee; background: #f8f9fa; padding: 8px; width: 100%; border-radius: 8px; font-weight: bold; color: #666; font-size: 13px; }
.amount-btn.active { background: #a855f7; color: white; border-color: #a855f7; }

.stepper { background: #f3f4f6; border-radius: 6px; display: flex; align-items: center; }
.stepper button { border: none; background: #e5e7eb; width: 40px; height: 36px; font-size: 18px; font-weight: bold; }
.stepper input { border: none; background: transparent; width: 50px; text-align: center; font-weight: bold; outline: none; }

.multiplier-grid button { border: 1px solid transparent; background: #fdf4ff; color: #444; padding: 6px; font-size: 11px; border-radius: 4px; font-weight: bold; width: 100%; }
.multiplier-grid button.active { background: #f3e8ff; border: 1px solid #a855f7; color: #a855f7; }
.btn-confirm { background: #9333ea; color: white; width: 100%; padding: 12px; border-radius: 40px; border: none; font-weight: 800; font-size: 16px; margin-top: 5px; }
.btn-confirm:disabled { background-color: #9ca3af !important; cursor: not-allowed; opacity: 0.7; }

/* Winners (CPG) */
.winner-item { display: flex; align-items: center; padding: 12px 15px; border-bottom: 1px solid #f1f1f1; background: white; }
.rank-box { width: 30px; display: flex; justify-content: center; margin-right: 10px; }
.rank-number { width: 24px; height: 24px; background: #e5e7eb; color: #9ca3af; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: bold; }
.winner-info { flex-grow: 1; font-size: 14px; color: #444; font-weight: 500; }
.win-amount { text-align: right; font-size: 14px; font-weight: 800; color: #333; }

/* Analyze table */
.analyze-table { width: 100%; border-collapse: collapse; }
.analyze-table thead { background-color: #f0f1ff; }
.analyze-table th { font-size: 12px; color: #6b7280; text-transform: uppercase; padding: 12px 15px; border: none; }
.analyze-table td { padding: 10px 5px; border-bottom: 1px solid #f8fafc; vertical-align: middle; }
.period-text { font-size: 13px; color: #4b5563; padding-left: 15px; }
.analyze-num-grid { display: flex; justify-content: space-around; align-items: center; padding-right: 10px; }
.num-circle { width: 22px; height: 22px; border-radius: 50%; border: 1px solid #d1d5db; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: #374151; }
.num-win-red       { background: #dc2626; color: white; border-color: #dc2626; }
.num-win-green     { background: #22c55e; color: white; border-color: #22c55e; }
.num-win-red-violet  { background: linear-gradient(135deg, #dc2626 50%, #9333ea 50%); color: white; border-color: #9333ea; }
.num-win-green-violet{ background: linear-gradient(135deg, #22c55e 50%, #9333ea 50%); color: white; border-color: #22c55e; }
.num-win-mixed { background: linear-gradient(135deg, #dc2626 50%, #9333ea 50%); color: white; border-color: #9333ea; }

/* Order status */
.status-badge { border-radius: 20px; font-size: 12px; font-weight: 500; padding: 3px 15px; }
.status-win       { background: #e8fcf0; color: #10b981; }
.status-no-win    { background: #fee2e2; color: #ef4444; }
.status-processing{ background: #fef3c7; color: #d97706; }
.text-purple-msg  { color: #bc39fd; font-family: sans-serif; }
.detail-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 15px; color: #6c757d; border-bottom: 1px solid #f8f8f8; }
.detail-value { color: #212529; font-weight: 600; }
.bet-color-shade  { width: 60px; padding: 3px 0; text-align: center; border-radius: 4px; color: #fff; font-weight: bold; font-size: 11px; }
.shade-green  { background: linear-gradient(135deg, #22c55e, #16a34a); }
.shade-red    { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.shade-violet { background: linear-gradient(135deg, #9333ea, #7c3aed); }

/* Result Popup */
.win-header  { background: linear-gradient(135deg, #FFD700, #FFA500); color: #fff; padding: 30px; text-align: center; }
.loss-header { background: linear-gradient(135deg, #9ca3af, #4b5563); color: #fff; padding: 30px; text-align: center; }

/* Res ball (color history) */
.res-ball { width: 25px; height: 25px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 900; font-size: 12px; margin: 0 2px; }
.ball-0   { background: linear-gradient(to bottom, #dc2626 50%, #9333ea 50%); }
.ball-5   { background: linear-gradient(to bottom, #22c55e 50%, #9333ea 50%); }
.ball-green  { background-color: #22c55e; }
.ball-red    { background-color: #dc2626; }
.ball-violet { background-color: #9333ea; }

/* Timer square (cpg) */
.timer-square {
    background: #fff; color: #7c3aed; padding: 4px 8px; border-radius: 4px;
    font-weight: bold; font-size: 18px; box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}