/* ============================================================
   BETTING SIMULATOR CSS — v3 (single-card flow)
   ============================================================ */

/* ---- Card Container ---- */
.bet-card {
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  padding: 16px 14px;
  margin: 10px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.bet-section-title {
  font-size: 17px;
  font-weight: 700;
  color: #333;
  margin-bottom: 6px;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 6px;
  text-transform: uppercase ;
}
.bet-subtitle {
  font-size: 13px;
  color: #555;
  margin-bottom: 14px;
}

/* ---- Google Login ---- */
.google-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  color: #444;
  border: 2px solid #ddd;
  border-radius: 6px;
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  transition: box-shadow 0.2s, background 0.2s;
}
.google-btn:hover {
  background: #f5f5f5;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  text-decoration: none;
  color: #222;
}

/* ---- User Profile ---- */
.user-profile-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.user-avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 2px solid #1a73e8;
  object-fit: cover;
}
.user-info { flex: 1; min-width: 100px; }
.user-name  { font-weight: 700; font-size: 15px; color: #222; }
.user-email { font-size: 12px; color: #666; }
.points-badge {
  background: linear-gradient(135deg, #1a73e8, #0d47a1);
  color: #fff;
  border-radius: 20px;
  padding: 5px 14px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}
.points-value { font-size: 18px; margin-right: 2px; }
.points-label { font-size: 12px; opacity: 0.85; }
.logout-btn {
  background: #e53935; color: #fff;
  border: none; border-radius: 6px;
  padding: 6px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background 0.2s;
}
.logout-btn:hover { background: #b71c1c; }

/* ---- Round Banner ---- */
.round-banner {
  background: linear-gradient(135deg, #0d47a1, #1565c0);
  color: #fff;
  border-radius: 8px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 8px 0;
  font-size: 14px;
  font-weight: 600;
}
.round-countdown {
  background: rgba(255,255,255,0.18);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.status-badge {
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.status-active { background: #43a047; }
.status-ended  { background: #e53935; }

/* ============================================================
   BET FORM — single-card rows
   ============================================================ */

/* Each row: label + control side by side */
.bet-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.bet-row-label {
  font-size: 13px;
  font-weight: 700;
  color: #555;
  min-width: 90px;
  flex-shrink: 0;
}

/* ---- A / B / C / D buttons ---- */
.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.bet-btn {
  width: 58px; height: 58px;
  border-radius: 50%;
  border: 3px solid #1a73e8;
  background: #fff;
  color: #1a73e8;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(26,115,232,0.15);
}
.bet-btn:hover {
  background: #1a73e8; color: #fff;
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(26,115,232,0.35);
}
.bet-btn.selected {
  background: #1a73e8; color: #fff;
  transform: scale(1.12);
  box-shadow: 0 4px 14px rgba(26,115,232,0.45);
}

/* ---- Digit Side Game Buttons (LEFT/RIGHT) ---- */
.digit-game-btn.selected {
  background: #ff9800; color: #fff;
  border-color: #ff9800;
  box-shadow: 0 4px 14px rgba(255,152,0,0.45);
}
.digit-side-btn {
  width: auto; min-width: 96px; height: 42px;
  border-radius: 8px;
  border: 2px solid #9c27b0;
  background: #fff;
  color: #9c27b0;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 13px;
}
.digit-side-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex: 0 0 20px;
}
.digit-side-btn:hover {
  background: #9c27b0; color: #fff;
  transform: scale(1.05);
}
.digit-side-btn.selected {
  background: #9c27b0; color: #fff;
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(156,39,176,0.45);
}
.digit-number-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.digit-number-btn {
  width: 42px;
  height: 42px;
  border-width: 2px;
  border-color: #ff9800;
  color: #ff9800;
  font-size: 16px;
}
.digit-number-btn:hover {
  background: #ff9800;
  color: #fff;
  transform: scale(1.06);
  box-shadow: 0 4px 12px rgba(255,152,0,0.3);
}
.digit-number-btn.selected {
  background: #ff9800;
  color: #fff;
  transform: scale(1.1);
  box-shadow: 0 4px 14px rgba(255,152,0,0.45);
}

/* ---- Generic row input ---- */
.bet-row-input {
  height: 40px;
  border: 2px solid #bdbdbd;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  padding: 0 10px;
  color: #222;
  outline: none;
  transition: border-color 0.15s;
  width: 130px;
}
.bet-row-input:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26,115,232,0.15);
}

/* Wider amount input + clear button group */
.amount-input-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.amount-input {
  width: 110px;
}
.clear-amount-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: #eeeeee;
  color: #666;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.clear-amount-btn:hover { background: #ffcdd2; color: #c62828; }

/* ---- Quick-add chips row ---- */
.add-chips-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.add-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.add-chip {
  padding: 5px 12px;
  border: 2px solid #1a73e8;
  border-radius: 20px;
  background: #fff;
  color: #1a73e8;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.13s ease;
  white-space: nowrap;
}
.add-chip:hover {
  background: #1a73e8;
  color: #fff;
  transform: scale(1.06);
}
.add-chip:active {
  transform: scale(0.97);
}

/* ---- Digit Game Chips ---- */
.digit-add-chip {
  padding: 5px 12px;
  border: 2px solid #ff9800;
  border-radius: 20px;
  background: #fff;
  color: #ff9800;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.13s ease;
  white-space: nowrap;
}
.digit-add-chip:hover {
  background: #ff9800;
  color: #fff;
  transform: scale(1.06);
}
.digit-add-chip:active {
  transform: scale(0.97);
}

/* ---- Live Win Preview ---- */
.win-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: linear-gradient(90deg, #e8f5e9, #f1f8e9);
  border: 1.5px solid #66bb6a;
  border-radius: 8px;
  padding: 9px 14px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}
.preview-item { display: flex; align-items: center; gap: 5px; }
.preview-win  { color: #2e7d32; font-weight: 800; }
.preview-lose { color: #c62828; font-weight: 800; }

/* ---- Place Bet button ---- */
.place-bet-btn {
  display: block;
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #43a047, #2e7d32);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: opacity 0.2s, transform 0.15s;
  margin-top: 4px;
}
.place-bet-btn:hover  { opacity: 0.92; transform: translateY(-1px); }
.place-bet-btn:active { transform: translateY(0); }
.place-bet-btn:disabled {
  background: #aaa;
  cursor: not-allowed;
  transform: none;
}

/* ---- Validation / Feedback ---- */
.validation-msg {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #e53935;
  padding: 7px 10px;
  background: #ffebee;
  border-radius: 6px;
  border-left: 3px solid #e53935;
}
.bet-success-msg {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #2e7d32;
  padding: 8px 12px;
  background: #e8f5e9;
  border-radius: 6px;
  border-left: 4px solid #43a047;
}
.bet-error-msg {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #c62828;
  padding: 8px 12px;
  background: #ffebee;
  border-radius: 6px;
  border-left: 4px solid #e53935;
}

/* ---- Pending Bets List ---- */
.bet-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #fafafa;
  flex-wrap: wrap;
}
.bet-item-button {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #1a73e8;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.bet-item-details { flex: 1; font-size: 14px; font-weight: 600; color: #333; }
.bet-item-sub { font-size: 12px; color: #777; font-weight: 400; }
.bet-item-result {
  font-size: 13px; font-weight: 700;
  padding: 4px 10px; border-radius: 12px;
}
.result-pending { background: #fff9c4; color: #f57f17; }
.result-won     { background: #e8f5e9; color: #2e7d32; }
.result-lost    { background: #ffebee; color: #c62828; }

/* ---- History List ---- */
.history-item {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: #fafafa;
}
.history-round    { font-size: 13px; font-weight: 700; color: #1a73e8; margin-bottom: 4px; }
.history-bet-line { font-size: 14px; font-weight: 600; color: #333; }
.history-result-line { font-size: 14px; font-weight: 700; margin-top: 4px; }
.history-time  { font-size: 11px; color: #999; margin-top: 3px; }
.won-text  { color: #2e7d32; }
.lost-text { color: #c62828; }

.history-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.history-page-btn {
  border: 1px solid #cfd8dc;
  background: #fff;
  color: #1a73e8;
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.history-page-btn:disabled {
  color: #9e9e9e;
  background: #f5f5f5;
  cursor: not-allowed;
}
.history-page-info {
  font-size: 12px;
  color: #666;
  font-weight: 600;
}

.no-bets-msg {
  font-size: 13px; color: #999;
  text-align: center; padding: 14px 0; margin: 0;
}

/* ---- Spinner ---- */
.loading-spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 3px solid rgba(26,115,232,0.3);
  border-top-color: #1a73e8;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.bet-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;

  padding:14px 16px;
  border-radius:18px;

  background:#ffffff;
  border:1px solid #ece8df;
}

.bet-left{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}

.bet-badge{
  width:42px;
  height:42px;
  border-radius:50%;

  display:flex;
  align-items:center;
  justify-content:center;

  background:#f6efe2;
  color:#b7791f;

  font-size:18px;
  font-weight:700;

  flex-shrink:0;
}

.bet-content{
  min-width:0;
}

.bet-main{
  font-size:15px;
  font-weight:600;
  color:#1f2937;

  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.bet-meta{
  display:flex;
  align-items:center;
  gap:8px;

  margin-top:4px;

  font-size:13px;
  color:#6b7280;
}

.bet-multiplier{
  padding:2px 8px;
  border-radius:999px;

  background:#f8f5ee;
  color:#b7791f;

  font-weight:600;
  font-size:12px;
}

.bet-status{
  flex-shrink:0;

  padding:7px 12px;
  border-radius:999px;

  font-size:12px;
  font-weight:600;
}

.result-waiting{
  background:#f8f5ee;
  color:#b7791f;
}

.result-win{
  background:#ecfdf3;
  color:#15803d;
}

.result-loss{
  background:#fef2f2;
  color:#dc2626;
}
.history-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;

  padding:16px 18px;

  background:#fff;
}

.history-left{
  display:flex;
  align-items:center;
  gap:14px;

  min-width:0;
  flex:1;
}

.history-icon{
  width:42px;
  height:42px;
  border-radius:14px;

  display:flex;
  align-items:center;
  justify-content:center;

  flex-shrink:0;
}

.history-icon svg{
  width:18px;
  height:18px;
}

.history-content{
  min-width:0;
  flex:1;
}

.history-top{
  display:flex;
  align-items:center;
  gap:8px;
}

.history-amount{
  font-size:17px;
  font-weight:700;

  letter-spacing:-0.02em;

  color:#111827;
}

.history-status{
  padding:3px 8px;
  border-radius:999px;

  font-size:11px;
  font-weight:600;

  text-transform:capitalize;
}

.history-status.won{
  background:#edf8f1;
  color:#1f8f55;
}

.history-status.lost{
  background:#fff1f1;
  color:#d14343;
}

.history-meta{
  margin-top:5px;

  font-size:13px;
  font-weight:600;

  color:#4b5563;

  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.history-sub{
  margin-top:3px;

  font-size:12px;
  color:#9ca3af;

  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.history-right{
  flex-shrink:0;

  text-align:right;
}

.history-time{
  font-size:12px;
  font-weight:600;

  color:#6b7280;
}

.history-date{
  margin-top:3px;

  font-size:11px;
  color:#b0b4be;
}

.history-item.won .history-icon{
  background:#edf8f1;
  color:#1f8f55;
}

.history-item.lost .history-icon{
  background:#fff1f1;
  color:#d14343;
}
