/* Ding gegen Drohne — Spiel-Styles */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0e1a;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #e8f4ff;
  overscroll-behavior: none;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

/* HUD */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 10;
  padding-top: max(12px, env(safe-area-inset-top));
}

#hud-left, #hud-right {
  display: flex;
  gap: 12px;
}

.hud-stat {
  background: rgba(10, 14, 26, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 200, 220, 0.3);
  border-radius: 10px;
  padding: 6px 12px;
  min-width: 68px;
  text-align: center;
}

.hud-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
  color: #7fdbff;
}

.hud-value {
  display: block;
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #fff;
  margin-top: 2px;
}

.hud-value .max {
  font-size: 12px;
  opacity: 0.6;
  font-weight: 500;
}

/* Ammo Bar */
#ammo-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(10, 14, 26, 0.9), rgba(10, 14, 26, 0));
  z-index: 10;
  overflow-x: auto;
  scrollbar-width: none;
}

#ammo-bar::-webkit-scrollbar {
  display: none;
}

.ammo-btn {
  position: relative;
  background: rgba(20, 28, 45, 0.85);
  border: 2px solid rgba(0, 200, 220, 0.3);
  border-radius: 12px;
  padding: 6px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
  min-width: 64px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ammo-btn img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
}

.ammo-btn:hover {
  background: rgba(30, 40, 60, 0.9);
  transform: translateY(-2px);
}

.ammo-btn.selected {
  border-color: #00d4ff;
  background: rgba(0, 100, 130, 0.4);
  box-shadow: 0 0 20px rgba(0, 200, 220, 0.4);
}

.ammo-btn.empty {
  opacity: 0.35;
  cursor: not-allowed;
}

.ammo-count {
  position: absolute;
  top: 2px;
  right: 4px;
  background: #00d4ff;
  color: #0a0e1a;
  border-radius: 8px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Hint */
#hint {
  position: absolute;
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 14, 26, 0.85);
  border: 1px solid rgba(0, 200, 220, 0.3);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  color: #b8e0ff;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
  text-align: center;
  max-width: 90%;
}

#hint.hint-show {
  opacity: 1;
}

/* Pause Button */
#pause-btn {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 14, 26, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 200, 220, 0.3);
  color: #7fdbff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-family: monospace;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  z-index: 11;
  letter-spacing: -2px;
}

#pause-btn:hover {
  background: rgba(30, 40, 60, 0.9);
}

/* Overlays */
#start-overlay, #pause-overlay, #gameover-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  background: rgba(5, 10, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.hidden {
  display: none !important;
}

.modal {
  background: linear-gradient(180deg, #101828 0%, #0a0e1a 100%);
  border: 1px solid rgba(0, 200, 220, 0.4);
  border-radius: 20px;
  padding: 32px 28px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 200, 220, 0.1);
}

.modal h1 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #00d4ff 0%, #7fdbff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}

.modal h2 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 16px;
  color: #00d4ff;
}

.modal p, .tagline {
  color: #b8e0ff;
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 20px;
}

.tagline {
  font-size: 17px;
  margin-bottom: 24px;
}

.gameover-text {
  margin-bottom: 20px;
  opacity: 0.85;
}

.rules {
  list-style: none;
  text-align: left;
  margin-bottom: 24px;
  padding: 0 8px;
}

.rules li {
  padding: 6px 0 6px 24px;
  font-size: 14px;
  color: #b8e0ff;
  position: relative;
}

.rules li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: #00d4ff;
  font-weight: bold;
}

.score-summary {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
  font-size: 15px;
  line-height: 1.8;
}

.score-summary strong {
  color: #00d4ff;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

#new-record {
  margin-top: 8px;
  padding: 6px 12px;
  background: linear-gradient(135deg, #ff9500 0%, #ff6b00 100%);
  color: #fff;
  border-radius: 8px;
  font-weight: 700;
  display: inline-block;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

button {
  font-family: inherit;
}

.modal > button {
  background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
  color: #0a0e1a;
  border: none;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  min-width: 160px;
  margin-bottom: 12px;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 20px rgba(0, 200, 220, 0.3);
}

.modal > button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(0, 200, 220, 0.5);
}

.secondary-link {
  display: block;
  color: #7fdbff;
  text-decoration: none;
  padding: 8px;
  font-size: 14px;
  opacity: 0.75;
  transition: opacity 0.2s;
}

.secondary-link:hover {
  opacity: 1;
  text-decoration: underline;
}

@media (max-width: 480px) {
  .modal {
    padding: 24px 20px;
  }
  .modal h1 { font-size: 26px; }
  .modal h2 { font-size: 22px; }
  .ammo-btn {
    min-width: 56px;
    min-height: 56px;
  }
  .ammo-btn img {
    width: 38px;
    height: 38px;
  }
  .hud-value { font-size: 18px; }
  .hud-stat { padding: 4px 10px; min-width: 60px; }
}
