/**
 * USA Takeover Styles
 * America 250 Edition (1776-2026)
 */

:root {
  --usa-red: #b22234;
  --usa-white: #ffffff;
  --usa-blue: #3c3b6e;
  --usa-red-bright: #f44336;
  --usa-blue-bright: #304ffe;
  --usa-gold: #ffd700;
  --usa-gold-dark: #b8860b;
}

/* Main container */
.usa-takeover {
  position: fixed;
  inset: 0;
  z-index: 99999;
  overflow: hidden;
}

.usa-takeover-bg {
  position: absolute;
  inset: 0;
}

.usa-takeover-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1e3a5f 0%, #7f1d1d 50%, #1e3a5f 100%);
  animation: usa-pulse-slow 3s ease-in-out infinite;
}

.usa-takeover-stripes {
  position: absolute;
  inset: 0;
  opacity: 0.2;
}

.usa-stripe {
  position: absolute;
  width: 100%;
  height: 7.7%;
  animation: usa-stripe-wave 2s ease-in-out infinite;
}

.usa-star-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.usa-twinkle-star {
  position: absolute;
  animation: usa-twinkle 2s ease-in-out infinite;
}

/* America 250 Badge */
.usa-250-badge {
  position: absolute;
  top: 5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100002;
  animation: usa-badge-appear 0.5s ease-out forwards;
}

.usa-250-badge-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(30, 58, 95, 0.8) 100%);
  border: 2px solid var(--usa-gold);
  border-radius: 0.5rem;
  box-shadow:
    0 0 20px rgba(255, 215, 0, 0.3),
    0 0 40px rgba(255, 215, 0, 0.1),
    inset 0 0 20px rgba(255, 215, 0, 0.1);
}

.usa-250-years {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  color: var(--usa-gold);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.usa-250-number {
  font-size: 3rem;
  font-weight: 900;
  background: linear-gradient(180deg, var(--usa-gold) 0%, var(--usa-gold-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.usa-250-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--usa-white);
  opacity: 0.9;
}

/* Controls */
.usa-controls {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 100001;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.usa-timer {
  color: white;
  font-size: 1.25rem;
  font-weight: bold;
  background: linear-gradient(90deg, #dc2626, #2563eb);
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.usa-timer-text {
  animation: usa-pulse 1s ease-in-out infinite;
}

.usa-close-btn {
  color: white;
  background: linear-gradient(90deg, #dc2626, #2563eb);
  padding: 0.75rem;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transition: all 0.2s;
}

.usa-close-btn:hover {
  background: linear-gradient(90deg, #b91c1c, #1d4ed8);
  transform: scale(1.1);
}

.usa-close-icon {
  width: 1.5rem;
  height: 1.5rem;
}

/* Initial burst */
.usa-initial-burst {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.usa-burst-dot {
  width: 1rem;
  height: 1rem;
  background: white;
  border-radius: 9999px;
  animation: usa-explode-out 1s ease-out forwards;
}

.usa-shockwave-container {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.usa-shockwave {
  width: 2rem;
  height: 2rem;
  background: white;
  border-radius: 9999px;
  animation: usa-shockwave 1s ease-out forwards;
}

/* Fireworks */
.usa-firework-launch {
  position: absolute;
  bottom: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  animation: usa-firework-up 1s ease-out forwards;
}

.usa-firework-explode {
  position: absolute;
  animation: usa-firework-burst 0.5s ease-out forwards;
}

.usa-particle {
  position: absolute;
  width: 0.25rem;
  height: 0.25rem;
  border-radius: 9999px;
  animation: usa-particle-fly 1s ease-out forwards;
}

/* Flag */
.usa-flag-container {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.usa-flag-glow {
  animation: usa-flag-glow 2s ease-in-out infinite;
}

.usa-flag-formation {
  position: relative;
  width: 600px;
  height: 400px;
  animation: usa-scale-in 0.5s ease-out forwards;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.usa-flag-glow-bg {
  position: absolute;
  inset: -2rem;
  background: linear-gradient(90deg, var(--usa-red-bright), white, var(--usa-blue-bright));
  opacity: 0.3;
  filter: blur(48px);
  animation: usa-pulse 2s ease-in-out infinite;
}

.usa-flag-stripe {
  position: absolute;
  width: 100%;
  height: 7.7%;
  animation: usa-slide-in-left 0.5s ease-out forwards;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.usa-canton {
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 53.85%;
  background: var(--usa-blue);
  animation: usa-fade-in 0.5s ease-out 0.7s forwards;
  opacity: 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.usa-stars-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.usa-canton-star {
  position: absolute;
  color: white;
  font-size: 1.2rem;
  animation: usa-star-twinkle 1s ease-in-out infinite;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.8));
}

/* 250 Star Formation */
.usa-250-formation {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.usa-250-star {
  position: absolute;
  font-size: 2rem;
  color: var(--usa-gold);
  animation: usa-250-star-appear 0.5s ease-out forwards;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
}

/* Wave effects */
.usa-wave-effect {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.usa-wave-horizontal {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: usa-wave-across 3s linear infinite;
}

.usa-wave-vertical {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.2), transparent, rgba(239, 68, 68, 0.2));
  animation: usa-wave-vertical 4s linear infinite;
}

/* Eagle and jets */
.usa-eagle-main {
  position: absolute;
  top: 2.5rem;
  right: 0;
  animation: usa-fly-rtl 4s linear forwards;
  z-index: 99999;
}

.usa-eagle-flap {
  font-size: 5rem;
  animation: usa-flap 0.3s ease-in-out infinite;
  transform: scaleX(-1);
  display: inline-block;
}

.usa-jet {
  position: absolute;
  left: 0;
  font-size: 3.75rem;
  animation: usa-fly-ltr-fast 3s linear forwards;
  z-index: 99998;
}

/* Liberty Bell */
.usa-bell-container {
  position: relative;
}

.usa-liberty-bell {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  animation: usa-fade-in-up 0.5s ease-out forwards;
}

.usa-bell-ring {
  font-size: 3.75rem;
  animation: usa-ring 0.5s ease-in-out infinite;
  display: inline-block;
}

.usa-sound-wave {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 8rem;
  height: 8rem;
  border-radius: 9999px;
  border: 4px solid rgba(255, 255, 255, 0.5);
  animation: usa-sound-wave 1s ease-out infinite;
}

/* Grand finale */
.usa-grand-finale {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.usa-finale-eagle {
  position: absolute;
  right: -100px;
  animation: usa-fly-formation 4s linear forwards;
}

.usa-eagle-flap-fast {
  animation: usa-flap 0.15s ease-in-out infinite;
  transform: scaleX(-1);
  display: inline-block;
}

.usa-helicopter {
  position: absolute;
  left: -100px;
  font-size: 3rem;
  animation: usa-fly-helicopter 5s linear forwards;
  z-index: 99980;
}

.usa-bomber {
  position: absolute;
  top: 25%;
  animation: usa-fly-bomber 6s linear 1s forwards;
  font-size: 6rem;
  opacity: 0.8;
}

.usa-confetti {
  position: absolute;
  width: 0.5rem;
  height: 1rem;
  top: -10px;
  animation: usa-confetti-fall linear forwards;
}

/* Central message */
.usa-message-container {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 100000;
}

.usa-message {
  text-align: center;
  animation: usa-fade-in-up 0.5s ease-out forwards;
}

.usa-heading-1 {
  font-size: clamp(3rem, 10vw, 9rem);
  font-weight: 900;
  color: white;
  margin: 0 0 1rem 0;
  animation: usa-pulse-glow 2s ease-in-out infinite;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.usa-heading-2 {
  font-size: clamp(4rem, 12vw, 12rem);
  font-weight: 900;
  margin: 0;
  background: linear-gradient(90deg, var(--usa-red-bright), white, var(--usa-blue-bright));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: usa-gradient-x 3s linear infinite;
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.3));
}

.usa-subtext {
  margin-top: 2rem;
}

.usa-tagline {
  font-size: clamp(1.5rem, 4vw, 3rem);
  color: white;
  animation: usa-fade-in 0.5s ease-out forwards;
  font-weight: bold;
  text-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  margin: 0 0 1rem 0;
}

.usa-quote {
  font-size: clamp(1rem, 2vw, 1.5rem);
  color: rgba(255, 255, 255, 0.9);
  font-style: italic;
  max-width: 800px;
  margin: 1rem auto;
  animation: usa-quote-fade 0.5s ease-out forwards;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.usa-quote-author {
  display: block;
  font-size: 0.875em;
  font-style: normal;
  color: var(--usa-gold);
  margin-top: 0.5rem;
}

.usa-united {
  font-size: clamp(1.25rem, 3vw, 2rem);
  color: #fde047;
  animation: usa-bounce 1s ease-in-out infinite;
  font-weight: bold;
  margin: 1rem 0 0 0;
}

/* Keyframes */
@keyframes usa-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

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

@keyframes usa-pulse-glow {
  0%,
  100% {
    text-shadow:
      0 0 20px rgba(255, 255, 255, 0.5),
      0 4px 20px rgba(0, 0, 0, 0.5);
  }
  50% {
    text-shadow:
      0 0 40px rgba(255, 255, 255, 0.8),
      0 4px 20px rgba(0, 0, 0, 0.5);
  }
}

@keyframes usa-twinkle {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.3;
    transform: scale(0.8);
  }
}

@keyframes usa-stripe-wave {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(10px);
  }
}

@keyframes usa-explode-out {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(100);
    opacity: 0;
  }
}

@keyframes usa-shockwave {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(50);
    opacity: 0;
  }
}

@keyframes usa-firework-up {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(calc(-1 * var(--launch-height, 80vh)));
    opacity: 0;
  }
}

@keyframes usa-firework-burst {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

@keyframes usa-particle-fly {
  0% {
    transform: rotate(var(--angle, 0deg)) translateX(0);
    opacity: 1;
  }
  100% {
    transform: rotate(var(--angle, 0deg)) translateX(100px);
    opacity: 0;
  }
}

@keyframes usa-scale-in {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes usa-slide-in-left {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes usa-fade-in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes usa-fade-in-up {
  0% {
    transform: translateY(20px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes usa-star-twinkle {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
}

@keyframes usa-flag-glow {
  0%,
  100% {
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.3));
  }
  50% {
    filter: drop-shadow(0 0 40px rgba(255, 255, 255, 0.6));
  }
}

@keyframes usa-wave-across {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes usa-wave-vertical {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(100%);
  }
}

@keyframes usa-fly-rtl {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-120vw);
  }
}

@keyframes usa-fly-ltr-fast {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(120vw);
  }
}

@keyframes usa-flap {
  0%,
  100% {
    transform: scaleX(-1) rotate(-5deg);
  }
  50% {
    transform: scaleX(-1) rotate(5deg);
  }
}

@keyframes usa-ring {
  0%,
  100% {
    transform: rotate(-10deg);
  }
  50% {
    transform: rotate(10deg);
  }
}

@keyframes usa-sound-wave {
  0% {
    transform: translateX(-50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) scale(3);
    opacity: 0;
  }
}

@keyframes usa-fly-formation {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-120vw);
  }
}

@keyframes usa-fly-helicopter {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(120vw);
  }
}

@keyframes usa-fly-bomber {
  0% {
    transform: translateX(-200px);
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.8;
  }
  100% {
    transform: translateX(120vw);
    opacity: 0;
  }
}

@keyframes usa-confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

@keyframes usa-gradient-x {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes usa-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes usa-badge-appear {
  0% {
    transform: translateX(-50%) translateY(-20px);
    opacity: 0;
  }
  100% {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

@keyframes usa-250-star-appear {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes usa-quote-fade {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .usa-takeover *,
  .usa-takeover *::before,
  .usa-takeover *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .usa-flag-formation {
    width: 300px;
    height: 200px;
  }

  .usa-canton-star {
    font-size: 0.6rem;
  }

  .usa-eagle-flap {
    font-size: 3rem;
  }

  .usa-jet {
    font-size: 2rem;
  }

  .usa-finale-eagle {
    font-size: 2rem !important;
  }

  .usa-250-badge {
    top: 4rem;
  }

  .usa-250-badge-inner {
    padding: 0.75rem 1.5rem;
  }

  .usa-250-number {
    font-size: 2rem;
  }

  .usa-250-star {
    font-size: 1.5rem;
  }

  .usa-quote {
    padding: 0 1rem;
  }
}
