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

/*
 * Orbit Crash - Global Styles
 * Modern, space-themed UI with responsive desktop and mobile layouts.
 * Uses Tailwind-inspired utility classes and CSS Grid/Flexbox.
 */

:root {
  --bg-dark: #0b081a;
  --bg-panel: #0f0b20;
  --bg-card: #1a1635;
  --bg-accent: #12142b;
  --primary: #7b61ff;
  --primary-hover: #8b75ff;
  --emerald: #10b981;
  --red: #ef4444;
  --text-main: #ffffff;
  --text-muted: #a09db0;
  --border-color: rgba(255, 255, 255, 0.05);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
  overflow-y: auto;
  user-select: none;
}

#app {
  min-height: 100vh;
  background-color: var(--bg-panel);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
}

@media (min-width: 1024px) {
  #app {
    padding: 2rem;
  }
}

/* Loading Overlay */
#loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: var(--bg-panel);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 4rem;
  height: 4rem;
  border: 4px solid rgba(123, 97, 255, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

.loading-title {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
}

.loading-text {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 0.5rem;
  animation: pulse 2s infinite;
}

/* Main Layout */
.game-container {
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: radial-gradient(circle at center, #0a1931 0%, #02050f 100%);
  border-radius: 1.5rem;
  overflow: hidden;
}

@media (min-width: 1024px) {
  .game-container {
    max-width: 1440px;
    display: grid;
    grid-template-columns: 1fr 380px;
    grid-template-rows: auto auto 1fr;
    grid-template-areas: 
      "history history"
      "main controls"
      "main sidebar";
    align-items: stretch;
    height: calc(100vh - 4rem);
    gap: 1rem;
    padding: 1rem;
  }
}

/* Left Column (Main Game Area on Mobile, Right Area on Desktop) */
.game-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

@media (min-width: 1024px) {
  .game-main {
    grid-area: main;
    background-color: rgba(26, 22, 53, 0.4);
    backdrop-filter: blur(12px);
    border-radius: 1.5rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
  }
}

.history-bar {
  padding: 0.45rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background-color: rgba(10, 8, 22, 0.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0.75rem;
  margin: 0 0.25rem;
}

@media (min-width: 1024px) {
  .history-bar {
    grid-area: history;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin: 0;
  }
}

#history-container {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.35rem;
  overflow-x: auto;
  padding: 0.15rem 0;
  width: 100%;
  max-width: 100%;
}

.history-item {
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  border: 1px solid rgba(248, 113, 113, 0.2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
  color: #fda4af;
  background-color: rgba(88, 28, 28, 0.55);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

@media (min-width: 1024px) {
  .history-item {
    font-size: 11px;
    padding: 0.22rem 0.65rem;
  }
}

.history-purple { color: #c084fc; background-color: rgba(168, 85, 247, 0.1); }
.history-yellow { color: #facc15; background-color: rgba(234, 179, 8, 0.2); }
.history-pink { color: #f472b6; background-color: rgba(236, 72, 153, 0.1); }
.history-emerald { color: #34d399; background-color: rgba(16, 185, 129, 0.1); }
.history-blue { color: #60a5fa; background-color: rgba(59, 130, 246, 0.1); }
.history-red { color: #f87171; background-color: rgba(239, 68, 68, 0.1); }
.history-orange { color: #fb923c; background-color: rgba(249, 115, 22, 0.1); }

/* Mobile Header */
.mobile-header {
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

@media (min-width: 1024px) {
  .mobile-header {
    display: none;
  }
}

.balance-badge {
  background-color: var(--bg-accent);
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.balance-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background-color: var(--emerald);
  animation: pulse 2s infinite;
}

.balance-amount {
  font-size: 0.875rem;
  font-weight: 900;
  color: #34d399;
}

.icon-btn {
  color: var(--text-muted);
  transition: color 0.2s;
  background: none;
  border: none;
  cursor: pointer;
}

.icon-btn:hover {
  color: white;
}

/* Graph Area */
.graph-area {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 0.5rem;
}

@media (min-width: 1024px) {
  .graph-area {
    padding: 0;
  }
}

.graph-container {
  width: 100%;
  height: 100%;
  min-height: 250px;
  background-color: transparent;
  border-radius: 1rem;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

@media (min-width: 1024px) {
  .graph-container {
    min-height: 400px;
    border-radius: 2rem;
  }
}

.graph-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.graph-overlay > * {
  pointer-events: auto;
}

.orbital-scene {
  position: absolute;
  inset: 0;
  z-index: 10;
}

/* Multiplicador centrado en el planeta (viewBox 800×800, tierra en 400,400 — mismo centro que el SVG con meet) */
#multiplier-container {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 40;
  pointer-events: none;
  transform: translate(-50%, -50%);
  text-align: center;
  width: min(88%, 16rem);
  transition: opacity 0.25s ease, visibility 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#multiplier-container.az-hidden-waiting {
  opacity: 0;
  visibility: hidden;
}

.multiplier-display {
  font-size: clamp(1.35rem, 5.5vw, 2.75rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1;
  color: #fff;
  /* Contraste sobre océano / tierra */
  text-shadow:
    0 0 1px rgba(0, 0, 0, 0.9),
    0 1px 3px rgba(0, 0, 0, 0.85),
    0 0 18px rgba(0, 0, 0, 0.45),
    0 0 12px rgba(255, 255, 255, 0.35);
  transition: color 0.5s ease, text-shadow 0.5s ease;
  pointer-events: none;
}

@media (min-width: 1024px) {
  .multiplier-display {
    font-size: clamp(2.25rem, 4.2vw, 3.25rem);
    text-shadow:
      0 0 1px rgba(0, 0, 0, 0.9),
      0 2px 4px rgba(0, 0, 0, 0.8),
      0 0 28px rgba(0, 0, 0, 0.4),
      0 0 20px rgba(255, 255, 255, 0.3);
  }
}

.multiplier-display.flew-away {
  color: #ef4444 !important;
  text-shadow:
    0 0 1px rgba(0, 0, 0, 0.95),
    0 2px 4px rgba(0, 0, 0, 0.85),
    0 0 22px rgba(239, 68, 68, 0.65) !important;
}

/* Debajo del multi; ~3× el tamaño de .waiting-text para buena lectura */
.crash-status-line {
  color: #fecaca;
  font-size: 2.25rem;
  font-weight: 700;
  margin: 0.5rem 0 0;
  padding: 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-shadow:
    0 0 2px rgba(0, 0, 0, 0.95),
    0 2px 6px rgba(0, 0, 0, 0.88),
    0 0 20px rgba(220, 38, 38, 0.5);
  pointer-events: none;
}

@media (min-width: 1024px) {
  .crash-status-line {
    font-size: 2.625rem;
    margin-top: 0.6rem;
  }
}

.mult-100 { 
  color: #10b981; /* Emerald/Green */
  text-shadow: 0 0 20px rgba(16, 185, 129, 0.6); 
}
.mult-10 { 
  color: #f472b6; /* Pink */
  text-shadow: 0 0 15px rgba(244, 114, 182, 0.4);
}
.mult-2 { 
  color: #34d399; /* Light Green */
}

/* Popups */
#cashout-popups {
  position: absolute;
  right: 0.5rem;
  top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-end;
  z-index: 55;
  max-height: 80%;
  overflow: hidden;
  pointer-events: none;
}

.cashout-popup {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  backdrop-filter: blur(4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  background-color: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cashout-popup.user-cashout {
  background-color: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.3);
}

.popup-user {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
}

.user-cashout .popup-user {
  color: #6ee7b7;
}

.popup-info {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.popup-mult {
  font-size: 10px;
  color: var(--emerald);
  font-weight: 900;
}

.popup-amount {
  font-size: 10px;
  color: white;
  font-weight: 900;
}

/* System Notifications */
#system-notifications {
  position: absolute;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  z-index: 55;
  pointer-events: none;
  max-width: min(92%, 20rem);
}

.system-notification {
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  border-width: 1px;
  border-style: solid;
}

.system-notification.az-notif-enter {
  animation: azNotifEnter 0.32s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes azNotifEnter {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.cashout-popup.az-notif-enter {
  animation: azNotifEnter 0.32s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.system-notification.cash_out {
  background-color: rgba(16, 185, 129, 0.9);
  border-color: #34d399;
}

.system-notification.lose {
  background-color: rgba(239, 68, 68, 0.9);
  border-color: #f87171;
}

.system-notification.bet_accept {
  background-color: rgba(123, 97, 255, 0.9);
  border-color: #9d85ff;
}

.notif-title {
  font-size: 0.75rem;
  font-weight: 900;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.notif-body {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.notif-mult {
  font-size: 1.125rem;
  font-weight: 900;
  color: white;
  line-height: 1;
  margin-top: 0.25rem;
}

.notif-amount {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
}

.notif-amount-main {
  font-size: 0.875rem;
  font-weight: 900;
  color: white;
  margin-top: 0.125rem;
}

/* Waiting State — absolute para ocupar todo el overlay sin competir en flex con otros hijos */
#waiting-state {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 35;
  pointer-events: auto;
}

#countdown-display {
  font-size: 64px;
  font-weight: 900;
  letter-spacing: -0.05em;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1;
  margin-bottom: 0.25rem;
  text-shadow: 0 0 20px rgba(123, 97, 255, 0.4);
}

@media (min-width: 1024px) {
  #countdown-display {
    font-size: 80px;
  }
}

.waiting-text {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

@media (min-width: 1024px) {
  .waiting-text {
    font-size: 0.875rem;
  }
}

.progress-container {
  width: 12rem;
  height: 0.5rem;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

@media (min-width: 1024px) {
  .progress-container {
    width: 16rem;
  }
}

#progress-bar {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background-color: var(--primary);
  border-radius: 9999px;
  box-shadow: 0 0 10px rgba(123, 97, 255, 0.5);
  width: var(--progress, 0%);
  transition: width 0.1s linear;
}

/* game-state / crashed-text: index.php (bundle); play_az usa #crash-status-line */
#game-state {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 35;
  pointer-events: none;
}

#crashed-text {
  color: #f87171;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 1rem;
  text-shadow:
    0 0 1px rgba(0, 0, 0, 0.95),
    0 1px 3px rgba(0, 0, 0, 0.85),
    0 0 12px rgba(220, 38, 38, 0.45);
}

@media (min-width: 1024px) {
  #crashed-text {
    font-size: 0.875rem;
  }
}

/* Right Column: Controls */
.game-controls {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 1024px) {
  .game-controls {
    grid-area: controls;
    width: 100%;
  }
}

.desktop-header {
  display: none;
  align-items: center;
  justify-content: flex-end;
  background-color: var(--bg-accent);
  padding: 1rem;
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

@media (min-width: 1024px) {
  .desktop-header {
    display: flex;
  }
}

.control-panels {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
  overflow-y: auto;
}

@media (min-width: 1024px) {
  .control-panels {
    padding: 0;
    flex-direction: column;
    overflow-y: visible;
  }
  
  .bet-panel {
    width: 100%;
  }
}

.bet-panel {
  background-color: rgba(18, 16, 35, 0.85);
  backdrop-filter: blur(12px);
  padding: 0.5rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(123, 97, 255, 0.22);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

@media (min-width: 1024px) {
  .bet-panel:hover {
    border-color: rgba(123, 97, 255, 0.3);
  }
}

.panel-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.375rem;
}

.auto-controls {
  display: flex;
  gap: 0.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  cursor: pointer;
}

.checkbox-indicator {
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  background-color: transparent;
}

.checkbox-indicator.checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

.check-dot {
  width: 0.25rem;
  height: 0.25rem;
  background-color: white;
  border-radius: 50%;
}

.autocashout-input-container {
  background-color: rgba(10, 8, 22, 0.95);
  padding: 0.2rem 0.45rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-prefix {
  font-size: 8px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.35);
  margin-right: 0.2rem;
  text-transform: lowercase;
}

.autocashout-input {
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  width: 2.75rem;
  text-align: center;
  border: none;
  outline: none;
}

.panel-main {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

/* Columna derecha: multi auto-cobro encima del botón (layout rocket-bien) */
.action-column {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 0 0 7.25rem;
  min-width: 6.5rem;
  justify-content: flex-end;
}

.action-column .autocashout-input-container {
  width: 100%;
  min-width: 0;
  justify-content: center;
}

.action-column .action-btn {
  width: 100%;
  flex: 1;
  min-height: 3.65rem;
}

.bet-input-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.bet-input-container {
  display: flex;
  align-items: center;
  background-color: var(--bg-panel);
  border-radius: 0.5rem;
  height: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.125rem;
}

.step-btn {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.4);
  transition: color 0.2s;
  border: none;
  cursor: pointer;
}

.step-btn:hover {
  color: white;
}

.step-btn.decrement {
  background-color: #2d2d5a;
}

.step-btn.increment {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 0 8px rgba(123, 97, 255, 0.3);
}

.bet-amount-input {
  flex: 1;
  background: transparent;
  text-align: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: white;
  border: none;
  outline: none;
  width: 100%;
}

.quick-bets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem;
}

.quick-bet-btn {
  padding: 0.25rem 0;
  background-color: rgba(45, 45, 90, 0.4);
  border-radius: 0.375rem;
  font-size: 9px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.4);
  transition: all 0.2s;
  cursor: pointer;
}

.quick-bet-btn:hover {
  border-color: rgba(123, 97, 255, 0.2);
}

.action-btn {
  border-radius: 0.75rem;
  font-weight: 800;
  transition: background 0.2s, box-shadow 0.2s, transform 0.12s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  color: white;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.5rem;
  line-height: 1.15;
}

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

.action-btn:disabled {
  cursor: not-allowed;
  transform: none;
  opacity: 1;
  filter: none;
}

/* Apostar — violeta rocket-bien */
.action-btn.bet {
  background: linear-gradient(180deg, #a78bfa 0%, #7c3aed 48%, #5b21b6 100%);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25), 0 4px 14px rgba(91, 33, 182, 0.45);
}

.action-btn.bet:hover:not(:disabled) {
  filter: brightness(1.06);
}

/* Cobrar — verde */
.action-btn.cashout {
  background: linear-gradient(180deg, #4ade80 0%, #16a34a 55%, #15803d 100%);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2), 0 0 24px rgba(34, 197, 94, 0.35);
}

.action-btn.cashout:hover:not(:disabled) {
  filter: brightness(1.05);
}

/* Cancelar apuesta en cuenta regresiva (rocket-bien) */
.action-btn.cancel {
  background: linear-gradient(180deg, #fb7185 0%, #dc2626 50%, #991b1b 100%);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25), 0 4px 18px rgba(220, 38, 38, 0.4);
}

.action-btn.cancel .action-text {
  font-size: 0.8125rem;
  letter-spacing: 0.07em;
}

.action-btn.cancel .action-sub {
  color: rgba(255, 255, 255, 0.9);
  text-transform: none;
  font-weight: 800;
}

/* LISTO — gris medio sólido */
.action-btn.action-ready {
  background: linear-gradient(180deg, #9ca3af 0%, #6b7280 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 6px rgba(0, 0, 0, 0.35);
  color: rgba(255, 255, 255, 0.95);
}

.action-btn.action-ready .action-sub {
  color: rgba(255, 255, 255, 0.55);
  opacity: 1;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 700;
}

/* CASHED OUT — gris carbón */
.action-btn.action-cashed-out {
  background: linear-gradient(180deg, #52525b 0%, #3f3f46 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 8px rgba(0, 0, 0, 0.4);
  color: rgba(255, 255, 255, 0.88);
}

.action-btn.action-cashed-out .action-sub {
  color: rgba(255, 255, 255, 0.5);
  opacity: 1;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 700;
}

/* Espera / sin apuesta */
.action-btn.action-muted {
  background: #2d2d3a;
  color: rgba(255, 255, 255, 0.28);
  box-shadow: none;
}

.action-text {
  font-size: 0.8125rem;
  line-height: 1.1;
  font-weight: 800;
}

.action-btn.bet .action-text {
  font-size: 0.9375rem;
}

.action-btn.cashout .action-text {
  font-size: 0.75rem;
}

.action-btn.action-cashed-out .action-text {
  font-size: 0.625rem;
  letter-spacing: 0.06em;
}

.action-text.text-sm {
  font-size: 0.875rem;
}

.action-sub {
  font-size: 0.65rem;
  font-weight: 700;
  margin-top: 0.2rem;
  opacity: 0.92;
  letter-spacing: 0.02em;
}

.action-btn.cashout .action-sub {
  color: rgba(255, 255, 255, 0.92);
  text-transform: none;
}

/* Tabs and Footer */
.game-footer {
  padding: 0.5rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 400px;
}

@media (min-width: 1024px) {
  .game-footer {
    grid-area: sidebar;
    padding: 0;
    height: 100%;
    min-height: 0;
    background-color: rgba(26, 22, 53, 0.4);
    backdrop-filter: blur(12px);
    border-radius: 1.5rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
  }
  
  .tabs-nav {
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.2);
  }
  
  .tab-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  
  .tab-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  
  .tab-scroll-area {
    flex: 1;
  }
}

.tabs-nav {
  display: flex;
  background-color: var(--bg-panel);
  border-radius: 9999px;
  padding: 0.125rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.tab-btn {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.875rem;
  transition: all 0.2s;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
}

.tab-btn:hover {
  color: rgba(255, 255, 255, 0.6);
}

.tab-btn.active {
  background-color: #251d45;
  color: white;
}

.tab-content {
  background-color: var(--bg-accent);
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 400px;
}

.tab-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tab-header {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #1a1c3d;
}

.total-bets-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.live-dot-container {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background-color: rgba(16, 185, 129, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.live-dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background-color: var(--emerald);
}

.live-text {
  font-size: 10px;
  font-weight: 700;
  color: #34d399;
}

.tab-scroll-area {
  flex: 1;
  overflow-y: auto;
}

table {
  width: 100%;
  text-align: left;
  border-collapse: collapse;
}

thead {
  position: sticky;
  top: 0;
  background-color: var(--bg-accent);
  z-index: 10;
}

th {
  padding: 0.5rem 1rem;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

td {
  padding: 0.5rem 1rem;
  font-size: 11px;
}

.user-bet-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background-color: rgba(16, 185, 129, 0.05);
}

.user-name {
  font-weight: 700;
  color: #34d399;
}

.bot-bet-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background-color 0.2s;
}

.bot-bet-row:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.bot-name {
  color: var(--text-muted);
}

.bet-amount {
  color: rgba(255, 255, 255, 0.5);
}

.mult-badge {
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background-color: rgba(16, 185, 129, 0.2);
  color: #34d399;
  font-weight: 900;
}

.win-amount {
  font-weight: 900;
  color: white;
}

.win-amount.win {
  color: var(--emerald);
}

.empty-table {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
}

/* Top Tab Specifics */
.top-filters {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  gap: 0.5rem;
  background-color: #1a1c3d;
}

.filter-select {
  flex: 1;
  background-color: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 10px;
  font-weight: 700;
  color: white;
  outline: none;
}

.filter-select:focus {
  border-color: rgba(123, 97, 255, 0.5);
}

.top-bets-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.top-bet-card {
  background-color: #1a1c3d;
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
}

.bet-date {
  color: var(--text-muted);
}

.bet-details {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.detail {
  color: rgba(255, 255, 255, 0.4);
}

.detail .val {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 700;
}

.detail .val.mult {
  color: var(--emerald);
}

.divider {
  width: 1px;
  height: 0.75rem;
  background-color: rgba(255, 255, 255, 0.1);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.modal-container {
  background-color: #1a1c3d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.5rem;
  width: 100%;
  max-width: 32rem;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-height: 70vh;
  overflow-y: auto;
}

.step-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.step-title {
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.step-title.emerald { color: #34d399; }
.step-title.pink { color: #f472b6; }
.step-title.yellow { color: #facc15; }
.step-title.purple { color: var(--primary); }

.step-desc {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  line-height: 1.625;
}

.modal-footer {
  padding: 1.5rem;
  background-color: var(--bg-accent);
}

.modal-btn {
  width: 100%;
  padding: 1rem 0;
  background-color: var(--primary);
  border-radius: 1rem;
  font-weight: 900;
  color: white;
  box-shadow: 0 0 20px rgba(123, 97, 255, 0.4);
  border: none;
  cursor: pointer;
  transition: filter 0.2s;
}

.modal-btn:hover {
  filter: brightness(1.1);
}

/* Utils */
.hidden { display: none !important; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Custom animations */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-spin { animation: spin 1s linear infinite; }
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

/* Continuous Animations */
.earth-map { animation: spinEarth 24s linear infinite; }
/* No usar transform-origin CSS en el <g> del cohete: en varios navegadores rompe o compite con transform="rotate(...)" SVG */
.flame-inner { transform-origin: 0px 0px; animation: flicker 0.08s linear infinite alternate; }
.flame-outer { transform-origin: 0px 0px; animation: flicker 0.12s linear infinite alternate-reverse; }
.stars-back { transform-origin: 400px 400px; animation: rotateStars 120s linear infinite, twinkle 8s ease-in-out infinite; }
.stars-mid { transform-origin: 400px 400px; animation: rotateStars 80s linear infinite reverse, twinkle 6s ease-in-out infinite 1s; }
.stars-front { transform-origin: 400px 400px; animation: rotateStars 40s linear infinite, twinkle 4s ease-in-out infinite 0.5s; }
.nebula-back { transform-origin: 400px 400px; animation: rotateStars 200s linear infinite; }
.nebula-mid { transform-origin: 400px 400px; animation: rotateStars 140s linear infinite reverse; }

.shooting-star {
  animation: shootingStar 10s linear infinite;
}

.shooting-star:nth-child(1) { animation-delay: 2s; }
.shooting-star:nth-child(2) { animation-delay: 5s; }
.shooting-star:nth-child(3) { animation-delay: 8s; }

@keyframes shootingStar {
  0% { transform: translateX(0) translateY(0); opacity: 0; }
  10% { opacity: 1; }
  20% { transform: translateX(1200px) translateY(200px); opacity: 0; }
  100% { transform: translateX(1200px) translateY(200px); opacity: 0; }
}

@keyframes rotateStars { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes twinkle {
  0%, 100% { opacity: 0.6; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1.02); }
}
@keyframes spinEarth { 0% { transform: translateX(0px); } 100% { transform: translateX(600px); } }
@keyframes flicker { 0% { transform: scaleX(0.85) scaleY(0.9); opacity: 0.8; } 100% { transform: scaleX(1.15) scaleY(1.1); opacity: 1; } }
@keyframes shake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  10%, 30%, 50%, 70%, 90% { transform: translate(-4px, -2px) rotate(-2deg); }
  20%, 40%, 60%, 80% { transform: translate(4px, 2px) rotate(2deg); }
}
.animate-shake { animation: shake 0.1s linear infinite; }

/*
 * Crash FLEW_AWAY en rocket-bien/bundle.js: gsap.to(rocketAssembly, {
 *   translate(2500, -100), scale(0.1), ease ~ none / salida rápida al espacio
 * })
 */
#rocket-assembly.az-rocket-flyoff {
  animation: azRocketFlyOff 0.88s cubic-bezier(0.65, 0, 0.9, 0.45) forwards;
}

@keyframes azRocketFlyOff {
  0% {
    transform: translate(400px, 100px) scale(1.8);
    opacity: 1;
  }
  92% {
    opacity: 1;
  }
  100% {
    transform: translate(2500px, -100px) scale(0.1);
    opacity: 0;
  }
}

svg { display: block; width: 100%; height: 100%; }

