@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Orbitron', monospace;
  line-height: 1;
}

body {
  color: #ffffff;
  overflow: hidden;
  background: radial-gradient(circle at center, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
  position: relative;
}

/* Animated Background Stars */
.stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  animation: twinkle 3s infinite;
}

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

/* Preloader */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.loader {
  width: 80px;
  height: 80px;
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 30px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 2px;
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from { text-shadow: 0 0 20px rgba(255,255,255,0.5); }
  to { text-shadow: 0 0 30px rgba(255,255,255,0.8), 0 0 40px rgba(255,255,255,0.8); }
}

/* Enhanced Score Display */
#score {
  position: fixed;
  top: 20px;
  left: 20px;
  color: white;
  font-size: 16px;
  font-weight: 700;
  padding: 15px 25px;
  background: rgba(0,0,0,0.7);
  border-radius: 15px;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255,255,255,0.1);
  user-select: none;
  z-index: 99;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
}

#score:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

#score p {
  display: block;
  margin-bottom: 8px;
  text-shadow: 0 0 10px rgba(255,255,255,0.5);
}

#score p:last-child {
  margin-bottom: 0;
}

.score-label {
  color: #64ffda;
  font-weight: 400;
}

.score-value {
  color: #ffffff;
  font-weight: 900;
  text-shadow: 0 0 15px rgba(100, 255, 218, 0.5);
}

button:focus {
  outline: none;
}

/* Enhanced Modal */
#modelEl {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  padding: 1em;
  text-align: center;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(20px);
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

#modelEl > div {
  width: 100%;
  max-width: 400px;
  padding: 3em 2em;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: slideUp 0.5s ease;
  position: relative;
  overflow: hidden;
}

@keyframes slideUp {
  from { transform: translateY(50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

#modelEl > div::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: rotate(45deg);
  animation: shine 3s infinite;
}

@keyframes shine {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

#modelEl h1 {
  font-size: 4em;
  font-weight: 900;
  background: linear-gradient(45deg, #64ffda, #ff6b6b, #4ecdc4, #45b7d1);
  background-size: 300%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 3s ease infinite;
  text-shadow: 0 0 30px rgba(100, 255, 218, 0.3);
  margin-bottom: 15px;
}

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

#modelEl p {
  font-size: 18px;
  color: rgba(255,255,255,0.8);
  margin-bottom: 10px;
  font-weight: 400;
}

.game-title {
  font-size: 14px !important;
  color: #64ffda !important;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 20px !important;
}

#modelEl button {
  width: 100%;
  margin-top: 2em;
  border: none;
  color: white;
  cursor: pointer;
  border-radius: 50px;
  padding: 1.2em 2.5em;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transition: all 0.3s ease;
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 1px;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

#modelEl button::before {
  content: '';
  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;
}

#modelEl button:hover::before {
  left: 100%;
}

#modelEl button:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

#modelEl button:active {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

canvas {
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: crosshair;
}

/* Pulse animation for score updates */
@keyframes scorePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.score-pulse {
  animation: scorePulse 0.3s ease;
}

/* Crosshair cursor effect */
canvas:hover {
  cursor: crosshair;
}

/* Responsive Design */
@media (max-width: 768px) {
  #score {
    font-size: 14px;
    padding: 12px 20px;
    top: 10px;
    left: 10px;
  }
  
  #modelEl h1 {
    font-size: 3em;
  }
  
  #modelEl > div {
    padding: 2em 1.5em;
    max-width: 350px;
  }
}
