* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Arial", sans-serif;
  background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
  color: #ffffff;
  overflow: hidden;
  cursor: none;
}

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

.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.screen.active {
  opacity: 1;
  visibility: visible;
}

#start-screen {
  background: radial-gradient(circle, #2a2a2a, #1a1a1a);
}

#start-screen h1 {
  font-size: 3em;
  margin-bottom: 0.5em;
  text-shadow: 0 0 20px #ff4444;
  color: #ff4444;
}

#start-screen p {
  font-size: 1.2em;
  margin-bottom: 2em;
  opacity: 0.8;
}

.settings {
  margin-top: 2em;
  text-align: center;
}

.settings label {
  display: block;
  margin-bottom: 1em;
  font-size: 1.1em;
}

.settings input[type="range"] {
  width: 200px;
  margin: 0 10px;
}

.btn-primary,
.btn-secondary {
  padding: 12px 24px;
  font-size: 1.1em;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0 10px;
  font-weight: bold;
}

.btn-primary {
  background: linear-gradient(45deg, #ff4444, #ff6666);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 68, 68, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(45deg, #ff6666, #ff8888);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 68, 68, 0.6);
}

.btn-secondary {
  background: linear-gradient(45deg, #666666, #888888);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 102, 102, 0.4);
}

.btn-secondary:hover {
  background: linear-gradient(45deg, #888888, #aaaaaa);
  transform: translateY(-2px);
}

#game-screen {
  justify-content: flex-start;
  background: #000000;
}

#game-canvas {
  width: 100%;
  height: 100%;
  cursor: none;
  background: radial-gradient(circle at center, #1a1a1a, #000000);
}

#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 100;
}

#crosshair::before,
#crosshair::after {
  content: "";
  position: absolute;
  background: #ff4444;
  box-shadow: 0 0 10px #ff4444;
}

#crosshair::before {
  width: 2px;
  height: 20px;
  left: 50%;
  transform: translateX(-50%);
}

#crosshair::after {
  width: 20px;
  height: 2px;
  top: 50%;
  transform: translateY(-50%);
}

#game-ui {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  pointer-events: none;
}

.ui-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
}

.score-display {
  display: flex;
  gap: 30px;
  font-size: 1.2em;
  font-weight: bold;
}

.score-display span {
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

#pause-btn {
  pointer-events: all;
  font-size: 0.9em;
  padding: 8px 16px;
}

#game-over-screen h2 {
  font-size: 2.5em;
  margin-bottom: 1em;
  color: #ff4444;
  text-shadow: 0 0 15px #ff4444;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 2em;
  min-width: 400px;
}

.stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-label {
  font-weight: bold;
  opacity: 0.9;
}

.stat-value {
  color: #ff4444;
  font-size: 1.2em;
  font-weight: bold;
}

.buttons {
  display: flex;
  gap: 20px;
}

#pause-screen h2 {
  font-size: 2em;
  margin-bottom: 1em;
  color: #ffaa44;
}

.target {
  position: absolute;
  border-radius: 50%;
  cursor: crosshair;
  transition: all 0.2s ease;
  box-shadow: 0 0 20px rgba(255, 68, 68, 0.6);
  border: 3px solid #ff4444;
}

.target.hit {
  animation: targetHit 0.3s ease-out;
}

.target.miss {
  animation: targetMiss 0.5s ease-out;
}

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

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

.hit-effect {
  animation: hitPop 0.5s ease-out forwards;
}

.miss-effect {
  animation: missFade 0.3s ease-out forwards;
}

@keyframes hitPop {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -75%) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -150%) scale(1.5);
    opacity: 0;
  }
}

@keyframes missFade {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
  }
}

.loading {
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

#crosshair.active {
  animation: crosshairPulse 0.1s ease-out;
}

@keyframes crosshairPulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
}

@media (max-width: 768px) {
  #start-screen h1 {
    font-size: 2em;
  }

  .stats {
    grid-template-columns: 1fr;
    min-width: 300px;
  }

  .score-display {
    flex-direction: column;
    gap: 10px;
    font-size: 1em;
  }

  .ui-top {
    flex-direction: column;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .buttons {
    flex-direction: column;
    align-items: center;
  }

  .btn-primary,
  .btn-secondary {
    width: 200px;
    margin: 5px 0;
  }
}
