:root {
  --bg-1: #0b1718;
  --bg-2: #1a2d24;
  --accent: #6dd5b0;
  --warn: #6ba0ff;
  --danger: #ff6d6d;
  --ink: #ecf4ef;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background: radial-gradient(circle at 20% 20%, #1f3e3d 0%, #0d1618 60%, #060b0f 100%);
}

canvas {
  display: block;
}

#hud {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 14px 18px;
  display: grid;
  gap: 6px;
  pointer-events: none;
  z-index: 20;
  text-shadow: 0 1px 2px #000;
}

#hudStats,
#hudZone {
  width: max-content;
  padding: 8px 10px;
  border: 1px solid rgba(130, 180, 160, 0.35);
  background: rgba(8, 13, 16, 0.5);
  border-radius: 8px;
  font-size: 14px;
  letter-spacing: 0.2px;
}

#debugCoords {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 20;
  pointer-events: none;
  white-space: pre;
  font-size: 11px;
  line-height: 1.35;
  text-align: right;
  padding: 8px 10px;
  border: 1px solid rgba(130, 180, 160, 0.35);
  background: rgba(8, 13, 16, 0.5);
  border-radius: 8px;
  text-shadow: 0 1px 2px #000;
}

#invincibleToggle {
  position: fixed;
  top: 86px;
  right: 18px;
  z-index: 22;
  pointer-events: auto;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(130, 180, 160, 0.45);
  background: rgba(8, 13, 16, 0.7);
  color: #ecf4ef;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.2px;
}

#invincibleToggle.active {
  border-color: rgba(109, 213, 176, 0.9);
  background: rgba(109, 213, 176, 0.26);
  color: #f7fffb;
}

#crosshair {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -52%);
  z-index: 18;
  pointer-events: none;
  font-size: 26px;
  line-height: 1;
  color: rgba(240, 255, 247, 0.9);
  text-shadow: 0 0 8px rgba(80, 255, 180, 0.35);
}

#notice {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 25;
  min-height: 24px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(10, 12, 16, 0.6);
  border: 1px solid rgba(180, 220, 205, 0.25);
  font-size: 14px;
  text-align: center;
  pointer-events: none;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 80% 15%, rgba(109, 213, 176, 0.16) 0%, transparent 38%),
    radial-gradient(circle at 10% 80%, rgba(107, 160, 255, 0.14) 0%, transparent 30%),
    rgba(3, 7, 10, 0.82);
}

.hidden {
  display: none;
}

.panel {
  width: min(92vw, 500px);
  padding: 24px 24px 20px;
  border-radius: 16px;
  border: 1px solid rgba(154, 211, 189, 0.32);
  background: linear-gradient(145deg, rgba(20, 28, 32, 0.9), rgba(8, 12, 16, 0.9));
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.45),
    inset 0 0 20px rgba(109, 213, 176, 0.08);
}

.panel h1,
.panel h2 {
  margin: 0 0 10px;
  font-size: clamp(28px, 5vw, 36px);
  letter-spacing: 0.8px;
}

.sub {
  margin: 0 0 16px;
  color: #bfd4ca;
  font-size: 14px;
}

.controls {
  margin: 0 0 18px;
  display: grid;
  gap: 4px;
  font-size: 14px;
}

button {
  appearance: none;
  border: 0;
  cursor: pointer;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  color: #0a1512;
  background: linear-gradient(135deg, var(--accent), #bdf5de);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

@media (max-width: 700px) {
  #hudStats,
  #hudZone {
    font-size: 12px;
  }

  #debugCoords {
    top: 12px;
    right: 12px;
    font-size: 10px;
  }

  #invincibleToggle {
    top: 78px;
    right: 12px;
    font-size: 10px;
  }

  #crosshair {
    font-size: 22px;
  }
}
