/* Blast Off - Crash Game Styles */

.blastoff-stage {
  display: flex;
  flex-direction: column;
  background: var(--bg-dark, #0a0e17);
  padding: 16px;
  gap: 16px;
  min-height: calc(100vh - 60px);
}

/* History Pills */
.bo-history {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  overflow-x: auto;
  width: 100%;
}

.bo-history::-webkit-scrollbar { display: none; }

.bo-history-item {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.bo-history-item.low { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.bo-history-item.mid { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
.bo-history-item.high { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.bo-history-item.mega { background: rgba(168, 85, 247, 0.2); color: #a855f7; }

/* Game Display */
.bo-display {
  position: relative;
  background: linear-gradient(180deg, #0a0a1a 0%, #1a1a3a 50%, #0f0f2f 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  height: 220px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Multi-layer Parallax Stars */
.bo-stars {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.bo-stars-layer {
  position: absolute;
  inset: -100% 0;
  height: 300%;
  will-change: transform;
}

/* Fast layer - big bright stars */
.bo-stars-layer.layer-1 {
  background-image:
    radial-gradient(2px 2px at 8% 15%, #fff, transparent),
    radial-gradient(3px 3px at 22% 45%, #ffd700, transparent),
    radial-gradient(2px 2px at 35% 8%, #fff, transparent),
    radial-gradient(3px 3px at 48% 72%, #87ceeb, transparent),
    radial-gradient(2px 2px at 62% 28%, #fff, transparent),
    radial-gradient(3px 3px at 78% 55%, #ffd700, transparent),
    radial-gradient(2px 2px at 92% 18%, #fff, transparent),
    radial-gradient(2px 2px at 15% 88%, #fff, transparent),
    radial-gradient(3px 3px at 55% 92%, #87ceeb, transparent);
  opacity: 1;
}

/* Medium layer */
.bo-stars-layer.layer-2 {
  background-image:
    radial-gradient(1.5px 1.5px at 5% 32%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1.5px 1.5px at 18% 68%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1.5px 1.5px at 28% 22%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1.5px 1.5px at 42% 85%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1.5px 1.5px at 58% 42%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1.5px 1.5px at 72% 78%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1.5px 1.5px at 85% 35%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1.5px 1.5px at 95% 62%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1.5px 1.5px at 38% 12%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1.5px 1.5px at 68% 95%, rgba(255,255,255,0.7), transparent);
  opacity: 0.85;
}

/* Slow layer - distant dim stars */
.bo-stars-layer.layer-3 {
  background-image:
    radial-gradient(1px 1px at 12% 48%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 25% 82%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 38% 15%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 52% 58%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 65% 25%, rgba(255,255,255,0.45), transparent),
    radial-gradient(1px 1px at 78% 92%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 88% 48%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 32% 72%, rgba(255,255,255,0.45), transparent),
    radial-gradient(1px 1px at 45% 35%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 82% 68%, rgba(255,255,255,0.4), transparent);
  opacity: 0.7;
}

/* Twinkle when not moving */
.bo-stars:not(.moving) .layer-1 { animation: twinkle1 2.5s ease-in-out infinite; }
.bo-stars:not(.moving) .layer-2 { animation: twinkle2 3.5s ease-in-out infinite; }

@keyframes twinkle1 {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes twinkle2 {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 0.5; }
}

/* Moving stars - parallax speeds */
.bo-stars.moving .layer-1 { animation: starsMove1 0.5s linear infinite; }
.bo-stars.moving .layer-2 { animation: starsMove2 0.8s linear infinite; }
.bo-stars.moving .layer-3 { animation: starsMove3 1.3s linear infinite; }

@keyframes starsMove1 {
  0% { transform: translateY(0); }
  100% { transform: translateY(33.33%); }
}

@keyframes starsMove2 {
  0% { transform: translateY(0); }
  100% { transform: translateY(33.33%); }
}

@keyframes starsMove3 {
  0% { transform: translateY(0); }
  100% { transform: translateY(33.33%); }
}

/* Falling Planets/Asteroids */
.bo-planet {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
}

.bo-planet.active {
  animation: planetFall 3s linear forwards;
}

.bo-planet.planet-orange {
  width: 25px;
  height: 25px;
  background: radial-gradient(circle at 30% 30%, #f97316, #c2410c 60%, #7c2d12);
  box-shadow: 0 0 15px rgba(249, 115, 22, 0.4);
}

.bo-planet.planet-blue {
  width: 18px;
  height: 18px;
  background: radial-gradient(circle at 30% 30%, #60a5fa, #2563eb 60%, #1e3a8a);
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.4);
}

.bo-planet.planet-purple {
  width: 30px;
  height: 30px;
  background: radial-gradient(circle at 30% 30%, #c084fc, #9333ea 60%, #581c87);
  box-shadow: 0 0 18px rgba(192, 132, 252, 0.4);
}

.bo-planet.planet-red {
  width: 22px;
  height: 22px;
  background: radial-gradient(circle at 30% 30%, #f87171, #dc2626 60%, #7f1d1d);
  box-shadow: 0 0 14px rgba(248, 113, 113, 0.4);
}

/* Planet ring for saturn-like */
.bo-planet.planet-purple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotateX(70deg);
  width: 50px;
  height: 50px;
  border: 2px solid rgba(192, 132, 252, 0.3);
  border-radius: 50%;
}

@keyframes planetFall {
  0% {
    opacity: 0;
    transform: translate(0, 0);
  }
  10% { opacity: 0.7; }
  85% { opacity: 0.7; }
  100% {
    opacity: 0;
    transform: translate(var(--planet-dx, 0px), var(--planet-dy, 300px));
  }
}

.bo-multiplier {
  font-size: 42px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
  z-index: 10;
  margin-bottom: 120px;
}

.bo-multiplier.rising { color: #22c55e; text-shadow: 0 0 30px rgba(34, 197, 94, 0.5); }
.bo-multiplier.high { color: #fbbf24; text-shadow: 0 0 30px rgba(251, 191, 36, 0.5); }
.bo-multiplier.mega { color: #a855f7; text-shadow: 0 0 30px rgba(168, 85, 247, 0.5); }
.bo-multiplier.crashed { color: #ef4444; text-shadow: 0 0 30px rgba(239, 68, 68, 0.5); }

/* Rocket */
.bo-rocket {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bo-rocket-img {
  width: 100px;
  height: auto;
  filter: drop-shadow(0 0 10px rgba(255, 150, 50, 0.3));
}

.bo-rocket.launching {
  animation: rocketShake 0.1s ease-in-out infinite;
}

.bo-rocket.launching .bo-rocket-img {
  filter: drop-shadow(0 0 20px rgba(255, 150, 50, 0.6)) drop-shadow(0 8px 4px rgba(255, 150, 50, 0.3));
}

/* Motion blur trail effect */
.bo-rocket-trail {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 120px;
  background: linear-gradient(180deg,
    rgba(255, 200, 100, 0.4) 0%,
    rgba(255, 150, 50, 0.2) 30%,
    rgba(255, 100, 50, 0.1) 60%,
    transparent 100%);
  filter: blur(8px);
  opacity: 0;
  pointer-events: none;
}

.bo-rocket.launching .bo-rocket-trail {
  opacity: 1;
  animation: trailPulse 0.15s ease-in-out infinite alternate;
}

@keyframes trailPulse {
  0% { transform: translateX(-50%) scaleY(0.9); opacity: 0.7; }
  100% { transform: translateX(-50%) scaleY(1.1); opacity: 1; }
}

/* Speed lines during flight */
.bo-speed-line {
  position: absolute;
  width: 2px;
  background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.6) 50%, transparent 100%);
  pointer-events: none;
  opacity: 0;
}

.bo-stars.moving ~ .bo-speed-line {
  opacity: 1;
  animation: speedLine 0.3s linear infinite;
}

@keyframes speedLine {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(300px); }
}

@keyframes rocketShake {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  25% { transform: translateX(-51%) translateY(1px); }
  75% { transform: translateX(-49%) translateY(-1px); }
}

/* Rocket Fire */
.bo-rocket-fire {
  width: 50px;
  height: 80px;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.9) 0%,
    #fbbf24 20%,
    #f97316 50%,
    #ef4444 80%,
    transparent 100%);
  border-radius: 50% 50% 50% 50% / 30% 30% 70% 70%;
  margin-top: -15px;
  opacity: 0;
  filter: blur(3px);
}

.bo-rocket.launching .bo-rocket-fire {
  opacity: 1;
  animation: fireFlicker 0.1s ease-in-out infinite alternate;
}

@keyframes fireFlicker {
  0% {
    transform: scaleY(0.85) scaleX(0.9);
    opacity: 0.9;
  }
  100% {
    transform: scaleY(1.15) scaleX(1.1);
    opacity: 1;
  }
}

/* Explosion */
.bo-rocket.exploded .bo-rocket-img {
  opacity: 0;
}

.bo-rocket.exploded .bo-rocket-fire {
  opacity: 0;
}

.bo-status {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  z-index: 10;
}

.bo-status.live { color: #22c55e; }
.bo-status.crashed { color: #ef4444; }

/* Bet Controls */
.bo-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

@media (min-width: 500px) {
  .bo-controls {
    flex-direction: row;
  }
}

.bo-bet-panel {
  flex: 1;
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bo-panel-label {
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: -4px;
}

/* Override bet-input-group for blastoff compact layout */
.bo-input-group {
  margin-bottom: 0;
}

.bo-input-group .form-control {
  flex: 1;
  min-width: 70px;
  max-width: 100px;
  text-align: center;
  font-weight: 600;
  background: var(--bg-input, rgba(0,0,0,0.3));
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: 6px;
  color: #fff;
  padding: 8px 12px;
  font-size: 1rem;
}

.bo-input-group .btn {
  padding: 0.5rem 0.6rem;
  font-size: 0.75rem;
}

.bo-auto-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.bo-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #94a3b8;
  cursor: pointer;
}

.bo-toggle input { width: 16px; height: 16px; accent-color: #22c55e; }

.bo-auto-val {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 13px;
  color: #94a3b8;
}

.bo-auto-val input {
  width: 55px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
  color: #fff;
  text-align: center;
}

.bo-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
}

.bo-btn-bet {
  background: linear-gradient(135deg, #0d9488, #14b8a6);
  color: #fff;
}

.bo-btn-bet:hover { background: linear-gradient(135deg, #14b8a6, #2dd4bf); }
.bo-btn-bet:disabled { background: #334155; color: #64748b; cursor: not-allowed; }
.bo-btn-bet.queued { background: linear-gradient(135deg, #7c3aed, #8b5cf6); }

.bo-btn-cashout {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #fff;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
  animation: pulseCashout 1s ease-in-out infinite;
}

.bo-btn-cashout:active {
  transform: scale(0.98);
}

@keyframes pulseCashout {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

.bo-btn-take50 {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  color: #fff;
  margin-top: -6px;
  padding: 10px;
  font-size: 12px;
}

/* Players Section */
.bo-players {
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  width: 100%;
}

.bo-players-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bo-players-count { font-size: 14px; font-weight: 600; color: #94a3b8; }
.bo-players-total { font-size: 14px; font-weight: 600; color: #22c55e; }

.bo-table-head {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.bo-table-body { }

.bo-player-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
  padding: 10px 12px;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.bo-player-row:last-child { border-bottom: none; }

.bo-player-row span:first-child { color: #94a3b8; }
.bo-player-row span:nth-child(2) { color: #fbbf24; font-weight: 600; }
.bo-player-row span:nth-child(3) { color: #64748b; }
.bo-player-row span:nth-child(4) { color: #64748b; }

.bo-player-row.cashed span:nth-child(3) { color: #22c55e; }
.bo-player-row.cashed span:nth-child(4) { color: #22c55e; }
.bo-player-row.lost span:nth-child(3) { color: #ef4444; }
.bo-player-row.lost span:nth-child(4) { color: #ef4444; }

/* Explosion Effect */
.bo-explosion {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 100px;
  z-index: 20;
  pointer-events: none;
}

.bo-explosion::before,
.bo-explosion::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  animation: explode 0.6s ease-out forwards;
}

.bo-explosion::before {
  background: radial-gradient(circle, #fff 0%, #fbbf24 30%, #f97316 50%, #ef4444 70%, transparent 100%);
}

.bo-explosion::after {
  background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, transparent 60%);
  animation-delay: 0.05s;
}

@keyframes explode {
  0% { transform: scale(0.1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.9; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* Explosion particles */
.bo-explosion-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #fbbf24;
  border-radius: 50%;
  animation: particle 0.6s ease-out forwards;
}

@keyframes particle {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { opacity: 0; }
}

.bo-explosion-particle:nth-child(1) { animation: particle1 0.6s ease-out forwards; background: #ef4444; }
.bo-explosion-particle:nth-child(2) { animation: particle2 0.6s ease-out forwards; background: #f97316; }
.bo-explosion-particle:nth-child(3) { animation: particle3 0.6s ease-out forwards; background: #fbbf24; }
.bo-explosion-particle:nth-child(4) { animation: particle4 0.6s ease-out forwards; background: #ef4444; }
.bo-explosion-particle:nth-child(5) { animation: particle5 0.6s ease-out forwards; background: #fff; }
.bo-explosion-particle:nth-child(6) { animation: particle6 0.6s ease-out forwards; background: #f97316; }

@keyframes particle1 { 0% { transform: translate(0,0); opacity:1; } 100% { transform: translate(-40px,-60px); opacity:0; } }
@keyframes particle2 { 0% { transform: translate(0,0); opacity:1; } 100% { transform: translate(40px,-50px); opacity:0; } }
@keyframes particle3 { 0% { transform: translate(0,0); opacity:1; } 100% { transform: translate(-50px,20px); opacity:0; } }
@keyframes particle4 { 0% { transform: translate(0,0); opacity:1; } 100% { transform: translate(50px,30px); opacity:0; } }
@keyframes particle5 { 0% { transform: translate(0,0); opacity:1; } 100% { transform: translate(0,-70px); opacity:0; } }
@keyframes particle6 { 0% { transform: translate(0,0); opacity:1; } 100% { transform: translate(-30px,-40px); opacity:0; } }

.hidden { display: none !important; }

/* Desktop */
@media (min-width: 768px) {
  .blastoff-stage {
    padding: 24px;
    gap: 20px;
  }

  .bo-display { height: 280px; }
  .bo-multiplier { font-size: 72px; }

  .bo-player-row { font-size: 15px; }
}

/* Large screens - add some max width but still wide */
@media (min-width: 1200px) {
  .blastoff-stage {
    max-width: 1000px !important;
    margin: 0 auto;
  }
}
