* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  background: #000;
  overflow: hidden;
}

#earth {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 140px;
  height: 140px;
  margin: -70px 0 0 -70px;
  border-radius: 50%;
  background-image: url('earth-512.jpg');
  background-size: cover;
  background-position: center;
}

.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  pointer-events: none;
}

#title {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  color: #2fd45e;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 0 0 12px rgba(120, 180, 255, 0.6), 0 0 24px rgba(120, 180, 255, 0.3);
  z-index: 10;
  display: none;
}

#health-container {
  position: absolute;
  top: 30px;
  right: 30px;
  text-align: right;
  z-index: 10;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #ffffff;
  display: none;
}

#health-label {
  font-size: 14px;
  opacity: 0.7;
  display: block;
  margin-bottom: 6px;
}

#health-bar {
  width: 150px;
  height: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0;
  overflow: hidden;
}

#health-fill {
  height: 100%;
  width: 100%;
  background: #e30505;
  border-radius: 0;
  transition: width 0.3s ease, background 0.3s ease;
}

#score-display {
  position: absolute;
  top: 90px;
  right: 30px;
  z-index: 10;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  opacity: 0.85;
  display: none;
}

.threat {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  user-select: none;
  z-index: 5;
  transform: translate(-50%, -50%);
}

.threat-badge {
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.7));
  backdrop-filter: none;
}

.threat-label {
  margin-top: 4px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.75);
  font-family: 'Courier New', monospace;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.threat.pop {
  animation: threatPop 0.3s ease forwards;
  pointer-events: none;
}

@keyframes threatPop {
  to {
    transform: translate(-50%, -50%) scale(1.6);
    opacity: 0;
  }
}

.burst {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3px solid;
  transform: translate(-50%, -50%);
  animation: burstExpand 0.3s ease forwards;
  pointer-events: none;
  z-index: 4;
}

@keyframes burstExpand {
  to {
    width: 70px;
    height: 70px;
    opacity: 0;
  }
}

#start-screen {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 60px;
  font-family: 'Courier New', monospace;
  color: #ffffff;
}

#start-screen h1 {
  font-size: 40px;
  letter-spacing: -1px;
  margin: 0 0 8px;
  font-weight: 700;
}

.subtitle {
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 40px;
  font-size: 14px;
  border-left: 2px solid #ff3b3b;
  padding-left: 12px;
}

.instructions {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 460px;
  margin-bottom: 40px;
}

.instruction-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
}

.instruction-item .icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 24px;
}

#start-btn {
  background: transparent;
  color: #ffffff;
  border: 1px solid #ffffff;
  padding: 12px 28px;
  border-radius: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  font-family: 'Courier New', monospace;
}

#start-btn:hover {
  background: #ffffff;
  color: #000000;
}

#game-over-screen {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 100;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

#game-over-screen h1 {
  font-size: 32px;
  margin-bottom: 12px;
}

#final-score {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 30px;
}

#restart-btn {
  background: #ffffff;
  color: #05060a;
  border: none;
  padding: 12px 32px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

#restart-btn:hover {
  opacity: 0.9;
}
