* {
  box-sizing: border-box;
}

body {
  font-family: "Rajdhani", sans-serif;
  touch-action: none;
  overflow: hidden;
  background-color: #030617; /* slate-950 */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  margin: 0;
  padding: 0;
}

#gameContainer {
  width: 100vw;
  height: 100vh;
  position: relative;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  #gameContainer {
    width: 100vw;
    height: 100vh;
  }
}

@media (max-width: 480px) {
  #gameContainer {
    width: 100vw;
    height: 100vh;
  }
}

canvas {
  background-color: #030617;
  background-image: radial-gradient(
      circle at 15% 20%,
      rgba(191, 219, 254, 0.1) 0%,
      transparent 40%
    ),
    radial-gradient(
      circle at 85% 70%,
      rgba(165, 180, 252, 0.1) 0%,
      transparent 40%
    );
  cursor: pointer;
  border-radius: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.glow-text {
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.7),
    0 0 10px rgba(199, 210, 254, 0.7);
}

/* Beautiful Pop-up Styles */
.popup-container {
  position: relative;
  width: 90%;
  max-width: 500px;
  animation: popupSlideIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.popup-content {
  background-color: #030617 !important;
  background-image: none !important;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(255, 255, 255, 0.1), 0 0 40px rgba(139, 92, 246, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(20px);
  border: 2px solid transparent;
  background-clip: padding-box;
  position: relative;
  overflow: hidden;
}

.popup-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: none !important;
  animation: none !important;
  pointer-events: none;
}

.popup-content::after {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: none !important;
  border-radius: 22px;
  z-index: -1;
  animation: none !important;
  background-size: auto;
}

.popup-header {
  text-align: center;
  margin-bottom: 2rem;
}

.popup-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.5rem;
  letter-spacing: 0.1em;
}

.popup-subtitle {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 300;
  letter-spacing: 0.05em;
}

.popup-body {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: white;
  margin-bottom: 1rem;
  text-align: center;
  letter-spacing: 0.05em;
}

.instruction-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.instruction-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.instruction-item:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.instruction-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.instruction-text {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 400;
  line-height: 1.4;
}

/* .goal-section {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.goal-text {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
  font-size: 0.95rem;
  text-align: center;
} */

.popup-footer {
  text-align: center;
}

.start-button,
.restart-button {
  position: relative;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 50px;
  padding: 1rem 2.5rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.start-button:hover,
.restart-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.2);
}

.start-button:active,
.restart-button:active {
  transform: translateY(-1px);
}

.button-glow {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s ease;
}

.start-button:hover .button-glow,
.restart-button:hover .button-glow {
  left: 100%;
}

.button-text {
  position: relative;
  z-index: 1;
}

/* Game Over Specific Styles */
.game-over-popup .popup-title {
  color: #ff6b6b;
  text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.score-summary {
  display: flex;
  justify-content: space-around;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.final-score,
.high-score {
  text-align: center;
  flex: 1;
}

.score-label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.5rem;
  font-weight: 400;
}

.score-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.performance-message {
  text-align: center;
  margin-bottom: 1rem;
}

.performance-text {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 25px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Animations */
@keyframes popupSlideIn {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(50px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes shimmer {
  0%,
  100% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(100%);
  }
}

@keyframes borderRotate {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
  .popup-container {
    width: 95%;
    max-width: 400px;
  }

  .popup-content {
    padding: 1.5rem;
  }

  .popup-title {
    font-size: 2rem;
  }

  .instruction-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .instruction-item {
    padding: 0.5rem;
  }

  .instruction-icon {
    font-size: 1.25rem;
  }

  .instruction-text {
    font-size: 0.85rem;
  }

  .score-summary {
    flex-direction: column;
    gap: 1rem;
  }

  .score-value {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .popup-content {
    padding: 1rem;
  }

  .popup-title {
    font-size: 1.75rem;
  }

  .start-button,
  .restart-button {
    padding: 0.875rem 2rem;
    font-size: 1rem;
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .glow-text {
    text-shadow: 0 0 2px rgba(255, 255, 255, 1), 0 0 4px rgba(255, 255, 255, 1);
  }
}

/* Focus styles for accessibility */
button:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

/* Prevent text selection on mobile */
* {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
