/* ═══════════════════════════════════════════════
   LIMBO — Stake-style UI
   ═══════════════════════════════════════════════ */

.limbo-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  align-items: start;
  padding: 16px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ─── Left panel ────────────────────────────── */
.limbo-panel {
  background: #1a1f2e;
  border-radius: 14px;
  border: 1px solid #2d3748;
  overflow: hidden;
  position: sticky;
  top: 16px;
}

.panel-tabs {
  display: flex;
  border-bottom: 1px solid #2d3748;
}

.panel-tab {
  flex: 1;
  padding: 14px 8px;
  background: none;
  border: none;
  color: #64748b;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.panel-tab.active {
  color: #f1f5f9;
  background: #232938;
  border-bottom: 2px solid #3b82f6;
}

.panel-tab:hover:not(.active) { color: #94a3b8; background: #1e2433; }

.panel-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }

/* Tab content */
.tab-content { display: none; }
.tab-content.active { display: flex; flex-direction: column; gap: 14px; }

/* ─── Input fields ──────────────────────────── */
.field-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 5px;
}

.field-row {
  display: flex;
  align-items: center;
  background: #0f1419;
  border: 1px solid #2d3748;
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.field-row:focus-within { border-color: #3b82f6; }

.field-input {
  flex: 1;
  background: none;
  border: none;
  color: #f1f5f9;
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 10px 12px;
  outline: none;
  width: 0;
}

.field-icon {
  padding: 0 10px;
  color: #ffd700;
  font-size: 1rem;
}

.field-btn {
  padding: 8px 10px;
  background: #232938;
  border: none;
  border-left: 1px solid #2d3748;
  color: #94a3b8;
  cursor: pointer;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.15s;
  white-space: nowrap;
}
.field-btn:hover { background: #2d3748; color: #f1f5f9; }

/* Multiplier display row */
.multiplier-field { position: relative; }
.multiplier-field .field-suffix {
  padding: 0 12px;
  color: #94a3b8;
  font-weight: 700;
  font-size: 1.05rem;
}

/* Win chance display */
.win-chance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #0f1419;
  border: 1px solid #2d3748;
  border-radius: 8px;
}
.win-chance-label { font-size: 0.8rem; color: #64748b; font-weight: 600; text-transform: uppercase; }
.win-chance-value { font-size: 1rem; font-weight: 700; color: #00d4ff; }

/* ─── Bet button ────────────────────────────── */
.bet-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #16a34a, #15803d);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}
.bet-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.15s;
}
.bet-btn:hover::after { background: rgba(255,255,255,0.08); }
.bet-btn:active { transform: scale(0.98); }
.bet-btn:disabled {
  background: linear-gradient(135deg, #374151, #1f2937);
  cursor: not-allowed;
  opacity: 0.6;
}
.bet-btn.speed-active { background: linear-gradient(135deg, #7c3aed, #5b21b6); }

/* ─── Speed / Auto toggles ──────────────────── */
.toggles-row {
  display: flex;
  gap: 8px;
}
.toggle-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  background: #0f1419;
  border: 1px solid #2d3748;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  transition: all 0.2s;
  user-select: none;
}
.toggle-pill.on {
  background: #1e3a5f;
  border-color: #3b82f6;
  color: #60a5fa;
}
.toggle-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #374151;
  transition: background 0.2s;
}
.toggle-pill.on .dot { background: #3b82f6; box-shadow: 0 0 6px #3b82f6; }

/* ─── Auto bet options ──────────────────────── */
.auto-options { display: flex; flex-direction: column; gap: 10px; }

.auto-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.auto-row .auto-label {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}
.auto-row .field-row { flex: 1; }

.auto-row-select {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.on-event-group { display: flex; flex-direction: column; gap: 6px; }
.on-event-label { font-size: 0.75rem; color: #475569; font-weight: 600; text-transform: uppercase; }

.on-event-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.event-select {
  flex: 0 0 auto;
  background: #0f1419;
  border: 1px solid #2d3748;
  border-radius: 6px;
  color: #f1f5f9;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 8px;
  outline: none;
  cursor: pointer;
}
.event-select:focus { border-color: #3b82f6; }

.event-input {
  flex: 1;
  background: #0f1419;
  border: 1px solid #2d3748;
  border-radius: 6px;
  color: #f1f5f9;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 8px;
  outline: none;
  width: 0;
  min-width: 0;
}
.event-input:focus { border-color: #3b82f6; }
.event-input[disabled] { opacity: 0.4; cursor: not-allowed; }

.event-suffix { font-size: 0.8rem; color: #475569; font-weight: 600; }

/* Stop conditions */
.stop-group { display: flex; flex-direction: column; gap: 8px; }
.stop-label  { font-size: 0.75rem; color: #475569; font-weight: 600; text-transform: uppercase; }
.stop-row    { display: flex; align-items: center; gap: 8px; }
.stop-row .field-row { flex: 1; }
.stop-check-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #94a3b8;
  cursor: pointer;
  white-space: nowrap;
}
.stop-check-label input[type=checkbox] { accent-color: #3b82f6; }

/* Auto counter */
.auto-counter {
  text-align: center;
  padding: 8px;
  background: #0f1419;
  border-radius: 8px;
  border: 1px solid #2d3748;
  font-size: 0.85rem;
  color: #64748b;
}
.auto-counter span { color: #60a5fa; font-weight: 700; }

/* Stop auto button */
.stop-auto-btn {
  width: 100%;
  padding: 11px;
  background: linear-gradient(135deg, #dc2626, #991b1b);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: none;
}
.stop-auto-btn.visible { display: block; }
.stop-auto-btn:hover { opacity: 0.85; }

/* ─── Right — Game area ─────────────────────── */
.limbo-game-area {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Main display */
.limbo-display {
  background: #1a1f2e;
  border-radius: 14px;
  border: 1px solid #2d3748;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 30px;
}

/* Stars / particle bg */
.limbo-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.limbo-star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
  animation: twinkle 3s infinite ease-in-out;
}
@keyframes twinkle {
  0%,100% { opacity: 0.2; transform: scale(1); }
  50%      { opacity: 0.8; transform: scale(1.5); }
}

/* Rocket */
.limbo-rocket {
  font-size: 4rem;
  filter: drop-shadow(0 0 20px rgba(59,130,246,0.5));
  transition: transform 0.3s ease;
  position: relative;
  z-index: 2;
  animation: rocketFloat 2s ease-in-out infinite;
}
@keyframes rocketFloat {
  0%,100% { transform: translateY(0) rotate(-5deg); }
  50%      { transform: translateY(-12px) rotate(5deg); }
}
.limbo-rocket.flying {
  animation: rocketFly 0.6s ease-out forwards;
}
@keyframes rocketFly {
  0%   { transform: translateY(0) scale(1); }
  50%  { transform: translateY(-60px) scale(1.2); }
  100% { transform: translateY(-20px) scale(1.1); }
}
.limbo-rocket.crash {
  animation: rocketCrash 0.5s ease-in forwards;
}
@keyframes rocketCrash {
  0%   { transform: translateY(0) scale(1) rotate(0); }
  100% { transform: translateY(40px) scale(0.7) rotate(45deg); opacity: 0.5; }
}

/* Multiplier counter */
.limbo-multiplier {
  font-family: 'Orbitron', sans-serif;
  font-size: 5.5rem;
  font-weight: 900;
  color: #f1f5f9;
  text-shadow: 0 0 30px rgba(255,255,255,0.2);
  letter-spacing: -2px;
  position: relative;
  z-index: 2;
  transition: color 0.3s, text-shadow 0.3s;
  line-height: 1;
  margin-top: 10px;
}

.limbo-multiplier.rolling {
  color: #60a5fa;
  text-shadow: 0 0 40px rgba(96,165,250,0.8), 0 0 80px rgba(96,165,250,0.4);
  animation: countPulse 0.05s ease-in-out infinite;
}
@keyframes countPulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.02); }
}

.limbo-multiplier.win {
  color: #4ade80;
  text-shadow: 0 0 40px rgba(74,222,128,0.9), 0 0 80px rgba(74,222,128,0.5);
  animation: winPop 0.5s cubic-bezier(0.175,0.885,0.32,1.275);
}
@keyframes winPop {
  0%   { transform: scale(0.7); }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.limbo-multiplier.lose {
  color: #f87171;
  text-shadow: 0 0 30px rgba(248,113,113,0.7);
  animation: losePop 0.3s ease-out;
}
@keyframes losePop {
  0%   { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.limbo-x {
  font-size: 2.5rem;
  opacity: 0.7;
  margin-left: 4px;
}

/* Target display line */
.limbo-target-line {
  position: relative;
  z-index: 2;
  margin-top: 14px;
  padding: 8px 20px;
  background: rgba(255,255,255,0.05);
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 0.9rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 1px;
}
.limbo-target-line .target-val { color: #fbbf24; }

/* Streak indicators */
.limbo-streak {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 4px;
  z-index: 3;
}
.streak-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #374151;
  transition: all 0.2s;
}
.streak-dot.win-dot  { background: #4ade80; box-shadow: 0 0 8px #4ade80; }
.streak-dot.lose-dot { background: #f87171; box-shadow: 0 0 8px #f87171; }

/* ─── History table ─────────────────────────── */
.limbo-history {
  background: #1a1f2e;
  border-radius: 14px;
  border: 1px solid #2d3748;
  overflow: hidden;
}

.history-header {
  padding: 14px 18px;
  border-bottom: 1px solid #2d3748;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.history-title { font-size: 0.85rem; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.8px; }

.history-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.history-table th {
  padding: 8px 14px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #2d3748;
  background: #161b27;
}
.history-table td { padding: 9px 14px; border-bottom: 1px solid #1e2433; }
.history-table tr:last-child td { border-bottom: none; }
.history-table tr:hover td { background: rgba(255,255,255,0.02); }

.hist-mult.win  { color: #4ade80; font-weight: 700; }
.hist-mult.lose { color: #f87171; font-weight: 700; }
.hist-payout.win  { color: #4ade80; font-weight: 600; }
.hist-payout.lose { color: #f87171; opacity: 0.7; }

.no-history { text-align: center; padding: 30px; color: #475569; font-size: 0.9rem; }

/* ─── Toast notification ────────────────────── */
.limbo-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: #1e2433;
  border: 1px solid #2d3748;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #f1f5f9;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: all 0.3s;
  white-space: nowrap;
}
.limbo-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.limbo-toast.toast-win   { border-color: #4ade80; color: #4ade80; }
.limbo-toast.toast-lose  { border-color: #f87171; color: #f87171; }
.limbo-toast.toast-info  { border-color: #60a5fa; color: #60a5fa; }
.limbo-toast.toast-error { border-color: #f97316; color: #f97316; }

/* ─── Responsive ────────────────────────────── */
@media (max-width: 900px) {
  .limbo-layout {
    grid-template-columns: 1fr;
  }
  .limbo-panel { position: static; }
  .limbo-multiplier { font-size: 3.5rem; }
}

/* ─── Provably fair link ────────────────────── */
.fair-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #475569;
}
.fair-row a { color: #3b82f6; text-decoration: none; }
.fair-row a:hover { color: #60a5fa; }
.fair-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  background: rgba(59,130,246,0.1);
  border-radius: 4px;
  border: 1px solid rgba(59,130,246,0.3);
  font-size: 0.7rem;
  color: #60a5fa;
  font-weight: 700;
}

/* ─── Last result pill ──────────────────────── */
.last-result {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 3;
}
.last-result.visible { opacity: 1; }
.result-pill {
  padding: 6px 18px;
  border-radius: 20px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.result-pill.win  { background: rgba(74,222,128,0.15); border: 1px solid #4ade80; color: #4ade80; }
.result-pill.lose { background: rgba(248,113,113,0.15); border: 1px solid #f87171; color: #f87171; }
