/* ===================================
   BALL RALLY GAME - KEEP IT IN THE AIR
   BrandBall - This Ball Was Not Born To Be Dropped
   =================================== */

/* ---- Game Background: Floating Objects ---- */
.game-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.floating-obj {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--primary);
  opacity: 0.22;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity 0.4s ease,
              border-width 0.4s ease;
  will-change: transform;
}

.floating-obj.scattered {
  opacity: 0.35;
  border-width: 3px !important;
}

/* ---- Hero layout ---- */
.hero-content {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 1s ease;
}

.hero-text-center {
  text-align: center;
  max-width: 700px;
}

/* ---- Air Throwers (cone launchers at bottom corners) ---- */
.air-thrower {
  position: absolute;
  bottom: 100px;
  width: 70px;
  height: 100px;
  cursor: pointer;
  z-index: 5;
  transition: transform 0.2s ease;
}

.air-thrower:hover {
  transform: scale(1.1);
}

.air-thrower:active {
  transform: scale(0.93);
}

.air-thrower-left {
  left: 2%;
  transform: rotate(25deg);
}

.air-thrower-right {
  right: 2%;
  transform: rotate(-25deg);
}

.air-thrower-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 12px rgba(255, 69, 0, 0.2));
  overflow: visible;
}

/* Air burst animation on click */
.air-thrower.blowing .air-line {
  animation: airBurst 0.6s ease-out;
}

.air-thrower-left:hover {
  transform: rotate(25deg) scale(1.1);
}
.air-thrower-right:hover {
  transform: rotate(-25deg) scale(1.1);
}
.air-thrower-left:active {
  transform: rotate(25deg) scale(0.93);
}
.air-thrower-right:active {
  transform: rotate(-25deg) scale(0.93);
}

/* Active state — rainbow cycling border highlights which cone to click */
.air-thrower.active .air-thrower-svg polygon,
.air-thrower.active .air-thrower-svg path {
  stroke-width: 4;
  animation: rainbowCycle 3s linear infinite;
}

.air-thrower.active .air-thrower-svg circle {
  animation: rainbowCycle 3s linear infinite;
}

.air-thrower.active .air-thrower-svg line {
  animation: rainbowCycle 3s linear infinite;
}

@keyframes rainbowCycle {
  0%   { stroke: #E53935; }
  16%  { stroke: #FF6D00; }
  33%  { stroke: #FFD700; }
  50%  { stroke: #4CAF50; }
  66%  { stroke: #2196F3; }
  83%  { stroke: #9C27B0; }
  100% { stroke: #E53935; }
}

.air-thrower.active .air-thrower-svg {
  filter: drop-shadow(0 0 10px rgba(255, 200, 0, 0.3));
}

/* Firework particles */
.firework-particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10;
  animation: fireworkBurst 1.1s ease-out forwards;
}

@keyframes fireworkBurst {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  70% {
    opacity: 0.8;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) scale(0);
    opacity: 0;
  }
}

@keyframes airBurst {
  0% { opacity: 0.5; transform: translateY(0); }
  50% { opacity: 0.9; transform: translateY(-8px); }
  100% { opacity: 0.2; transform: translateY(-14px); }
}

/* Idle subtle pulse on air lines */
.air-line {
  animation: airIdle 2.5s ease-in-out infinite;
}

.air-line-left {
  animation-delay: 0.3s;
}

.air-line-right {
  animation-delay: 0.6s;
}

@keyframes airIdle {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 0.55; transform: translateY(-3px); }
}

/* ---- Rally Ball ---- */
.rally-ball-container {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}

.rally-ball {
  position: absolute;
  width: 90px;
  height: 90px;
  pointer-events: none;
  filter: drop-shadow(0 8px 20px rgba(255, 69, 0, 0.35));
  transition: filter 0.3s ease;
  will-change: transform, left, top;
}

.rally-ball.hit {
  filter: drop-shadow(0 8px 30px rgba(255, 69, 0, 0.7));
}

/* Ball trail sparkle */
.ball-trail {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.5;
  pointer-events: none;
  animation: trailFade 0.6s ease-out forwards;
}

@keyframes trailFade {
  from { transform: scale(1); opacity: 0.5; }
  to { transform: scale(0); opacity: 0; }
}







/* ---- Hit flash ring ---- */
.hit-ring {
  position: absolute;
  width: 60px;
  height: 60px;
  border: 3px solid var(--primary);
  border-radius: 50%;
  pointer-events: none;
  animation: ringExpand 0.5s ease-out forwards;
  z-index: 5;
}

@keyframes ringExpand {
  from { transform: scale(0.5); opacity: 1; }
  to { transform: scale(2.5); opacity: 0; }
}

/* ---- Hero section adjustments ---- */
.hero {
  position: relative;
  overflow: hidden;
}

.hero .container {
  position: relative;
  z-index: 2;
}

/* Bounce Tagline */
.bounce-tagline {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: var(--spacing-sm) 0;
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .air-thrower {
    width: 55px;
    height: 80px;
    bottom: 80px;
  }

  .air-thrower-left {
    left: 1%;
  }

  .air-thrower-right {
    right: 1%;
  }

  .rally-ball {
    width: 65px;
    height: 65px;
  }
}

@media (max-width: 480px) {
  .air-thrower {
    width: 45px;
    height: 65px;
    bottom: 60px;
  }

  .air-thrower-left {
    left: 1%;
  }

  .air-thrower-right {
    right: 1%;
  }

  .rally-ball {
    width: 50px;
    height: 50px;
  }
}
