/* ============================================
   CINEMATIC STARTUP OVERLAY
   ============================================ */

.startup-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at center, rgba(10, 10, 10, .95) 0%, rgba(0, 0, 0, .98) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease-in;
  overflow: hidden;
  perspective: 1200px;
}

.startup-overlay.active {
  opacity: 1;
}

/* CRT Screen Effect */
.startup-overlay::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 0%,
    rgba(18, 16, 16, 0.1) 50%,
    rgba(18, 16, 16, 0) 100%
  );
  pointer-events: none;
  z-index: 1;
  animation: scanlines 8s linear infinite;
}

@keyframes scanlines {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

/* Film Grain Overlay */
.startup-overlay::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 2;
}

.startup-box {
  position: relative;
  width: 90%;
  max-width: 900px;
  padding: 3rem;
  background: linear-gradient(145deg, #0a0d0c 0%, #121614 50%, #0f1312 100%);
  border-radius: 20px;
  border: 2px solid #D4A04A;
  box-shadow: 
    0 0 60px rgba(212, 160, 74, 0.4),
    0 0 120px rgba(212, 160, 74, 0.2),
    inset 0 0 50px rgba(255, 255, 255, 0.03);
  transform: scale(0.9) rotateX(10deg);
  animation: startupPulse 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0;
  z-index: 3;
  overflow: hidden;
}

@keyframes startupPulse {
  0% {
    transform: scale(0.9) rotateX(10deg);
    opacity: 0;
    box-shadow: 0 0 0 rgba(212, 160, 74, 0);
  }
  50% {
    transform: scale(1.02) rotateX(-5deg);
    opacity: 1;
    box-shadow: 0 0 80px rgba(212, 160, 74, 0.8);
  }
  100% {
    transform: scale(1) rotateX(0);
    opacity: 1;
    box-shadow: 0 0 60px rgba(212, 160, 74, 0.4);
  }
}

/* Header with glitch effect */
.startup-header {
  text-align: center;
  margin-bottom: 2.5rem;
  position: relative;
}

.startup-title {
  color: #F4EDE0;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 3rem;
  font-weight: 400;
  margin: 0;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: 
    0 0 20px rgba(212, 160, 74, 0.8),
    0 0 40px rgba(212, 160, 74, 0.4);
  position: relative;
  animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
  0% { text-shadow: 0 0 20px rgba(212, 160, 74, 0.8); }
  100% { text-shadow: 0 0 40px rgba(212, 160, 74, 1), 0 0 60px rgba(212, 160, 74, 0.8); }
}

/* Subtitle */
.startup-subtitle {
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.1rem;
  margin-top: 0.5rem;
  text-align: center;
  font-weight: 300;
  letter-spacing: 1px;
}

/* Mode Grid */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin: 2.5rem auto;
  max-width: 800px;
  perspective: 1000px;
}

.mode-btn {
  height: 100px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(29, 125, 88, 0.15), rgba(212, 160, 74, 0.08));
  border: 2px solid rgba(255, 255, 255, 0.06);
  color: #F4EDE0;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
}

.mode-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: 0.5s;
}

.mode-btn:hover::before {
  left: 100%;
}

.mode-btn:hover {
  background: linear-gradient(135deg, rgba(29, 125, 88, 0.3), rgba(212, 160, 74, 0.2));
  box-shadow: 0 0 30px rgba(212, 160, 74, 0.5);
  transform: translateY(-5px) scale(1.05) rotateX(5deg);
  border-color: rgba(212, 160, 74, 0.4);
}

.mode-btn.selected {
  background: linear-gradient(135deg, rgba(212, 160, 74, 0.3), rgba(212, 160, 74, 0.5));
  border-color: #D4A04A;
  box-shadow: 0 0 40px rgba(212, 160, 74, 0.8);
  animation: selectedPulse 0.6s ease-out;
}

@keyframes selectedPulse {
  0% { transform: scale(1); box-shadow: 0 0 20px rgba(212, 160, 74, 0.5); }
  50% { transform: scale(1.15); box-shadow: 0 0 60px rgba(212, 160, 74, 1); }
  100% { transform: scale(1.1); box-shadow: 0 0 40px rgba(212, 160, 74, 0.8); }
}

.mode-icon {
  font-size: 2.2rem;
  margin-bottom: 0.2rem;
  filter: drop-shadow(0 0 10px rgba(212, 160, 74, 0.3));
  transition: all 0.3s ease;
}

.mode-btn:hover .mode-icon {
  transform: scale(1.2) rotate(5deg);
  filter: drop-shadow(0 0 20px rgba(212, 160, 74, 0.8));
}

.mode-label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.mode-btn:hover .mode-label {
  color: #F4EDE0;
  text-shadow: 0 0 10px rgba(212, 160, 74, 0.6);
}

/* Scan effect */
.scan-effect {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(212, 160, 74, 0.8), transparent);
  box-shadow: 0 0 20px rgba(212, 160, 74, 0.8);
  animation: scan 3s linear infinite;
  opacity: 0.3;
}

@keyframes scan {
  0% { top: -10px; opacity: 0; }
  20% { opacity: 0.6; }
  50% { opacity: 0.4; }
  100% { top: 100%; opacity: 0; }
}

/* Retro corners */
.startup-corner {
  position: absolute;
  width: 30px;
  height: 30px;
  border-color: rgba(212, 160, 74, 0.6);
  border-style: solid;
  transition: all 0.3s ease;
}

.startup-corner.top-left {
  top: -1px;
  left: -1px;
  border-width: 4px 0 0 4px;
  border-radius: 8px 0 0 0;
}

.startup-corner.top-right {
  top: -1px;
  right: -1px;
  border-width: 4px 4px 0 0;
  border-radius: 0 8px 0 0;
}

.startup-corner.bottom-left {
  bottom: -1px;
  left: -1px;
  border-width: 0 0 4px 4px;
  border-radius: 0 0 0 8px;
}

.startup-corner.bottom-right {
  bottom: -1px;
  right: -1px;
  border-width: 0 4px 4px 0;
  border-radius: 0 0 8px 0;
}

/* Close button */
.startup-close {
  display: block;
  margin: 2.5rem auto 0;
  padding: 0.8rem 2rem;
  border-radius: 99px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.startup-close::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(212, 160, 74, 0.4), transparent);
  transition: 0.5s;
}

.startup-close:hover::before {
  left: 100%;
}

.startup-close:hover {
  background: linear-gradient(135deg, rgba(212, 160, 74, 0.15), rgba(212, 160, 74, 0.05));
  border-color: rgba(212, 160, 74, 0.4);
  color: #F4EDE0;
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(212, 160, 74, 0.4);
}

/* Startup effects */
.startup-effect-glitch {
  animation: glitchEffect 0.5s infinite alternate;
}

@keyframes glitchEffect {
  0%, 100% { transform: translate(0) skew(0); }
  10% { transform: translate(-3px,2px) skew(-5deg); }
  20% { transform: translate(3px,-2px) skew(5deg); }
  30% { transform: translate(-2px) skew(-3deg); }
  40% { transform: translate(2px) skew(3deg); }
  50% { transform: translate(-1px) skew(-2deg); }
  60% { transform: translate(1px) skew(2deg); }
}

.startup-effect-pop {
  animation: popEffect 0.8s 0.2s ease-out forwards;
  opacity: 0;
  transform: scale(0.8);
}

@keyframes popEffect {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.05); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

.startup-effect-glam {
  animation: glamEffect 1.5s ease-out;
}

@keyframes glamEffect {
  0% { filter: brightness(0.5) saturate(0); }
  50% { filter: brightness(1.2) saturate(1.5); }
  100% { filter: brightness(1) saturate(1); }
}

.startup-effect-roll {
  animation: rollEffect 1.5s ease-out;
}

@keyframes rollEffect {
  0% { transform: translateX(-100%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .startup-box {
    padding: 1.5rem;
    width: 95%;
  }
  
  .mode-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .mode-btn {
    height: 80px;
  }
  
  .mode-icon {
    font-size: 1.8rem;
  }
  
  .startup-title {
    font-size: 2rem;
  }
}