:root {
  color-scheme: light;
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #050505;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

#game {
  display: block;
  width: 100vw;
  height: 100vh;
}

.menu {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.75) 100%),
    url("assets/cover.png") center/cover no-repeat;
  color: #f2f2f2;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 200ms ease;
}

.menu.hidden {
  opacity: 0;
  pointer-events: none;
}

.menu-panel {
  background: rgba(10, 10, 10, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 32px 36px;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: center;
}

.menu-title {
  font-size: 28px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.menu-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.menu-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.menu-action-row select {
  background: #1a1a1a;
  color: #f5f5f5;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 10px;
  font-size: 14px;
  min-width: 140px;
}

.menu-actions button {
  background: #1a1a1a;
  color: #f5f5f5;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 16px;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
}

.menu-actions button.hidden {
  display: none;
}

.menu-actions button:hover {
  background: #2a2a2a;
}

.editor {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 5, 0.85);
  color: #f2f2f2;
  z-index: 5;
}

.editor.hidden {
  display: none;
}

.editor-panel {
  background: rgba(12, 12, 12, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.editor-title {
  font-size: 22px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.editor-controls {
  display: flex;
  gap: 16px;
  font-size: 14px;
}

.editor-controls label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.editor-controls select {
  background: #1a1a1a;
  color: #f5f5f5;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 8px;
}

#map-editor-name {
  background: #1a1a1a;
  color: #f5f5f5;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 8px;
  width: 140px;
}

#map-editor-height {
  background: #1a1a1a;
  color: #f5f5f5;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0;
  width: 140px;
  height: 18px;
}

#map-editor-height-value {
  font-size: 12px;
  color: #f5f5f5;
  margin-left: 6px;
  min-width: 24px;
  display: inline-block;
  text-align: right;
}

#map-editor-tall,
#map-editor-sky {
  width: 18px;
  height: 18px;
}

#map-editor-canvas {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #111;
  cursor: crosshair;
}

.editor-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.editor-actions button {
  background: #1a1a1a;
  color: #f5f5f5;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
}

.editor-actions button:hover {
  background: #2a2a2a;
}

.editor-help {
  font-size: 12px;
  color: #bdbdbd;
  text-align: center;
  max-width: 360px;
}

.menu-help {
  font-size: 14px;
  color: #cfcfcf;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.menu-help.hidden {
  display: none;
}

.menu-settings {
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: #d8d8d8;
  font-size: 14px;
}

.menu-settings.hidden {
  display: none;
}

.menu-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.menu-setting select {
  background: #1a1a1a;
  color: #f5f5f5;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 10px;
}

.menu-settings button {
  background: #1a1a1a;
  color: #f5f5f5;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
}

.menu-settings button:hover {
  background: #2a2a2a;
}

.menu-setting input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#weapon {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: min(60vw, 520px);
  max-width: 520px;
  transition: transform 80ms ease;
}

#weapon.fire {
  transform: translateX(-50%) scale(0.96);
}

#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
}

#hitmarker {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26px;
  height: 26px;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 120ms ease;
}

#hitmarker.show {
  opacity: 1;
}

#hitmarker::before,
#hitmarker::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26px;
  height: 2px;
  background: rgba(255, 255, 255, 0.8);
  transform: translate(-50%, -50%) rotate(45deg);
}

#hitmarker::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

#weapon-label {
  position: absolute;
  bottom: 16px;
  left: 24px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

#health {
  position: absolute;
  top: 16px;
  left: 16px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 18px;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 12px;
}

#gold {
  position: absolute;
  top: 64px;
  left: 16px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 18px;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 12px;
}

#armor {
  position: absolute;
  top: 112px;
  left: 16px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 18px;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 12px;
}

#fps {
  position: absolute;
  bottom: 12px;
  right: 16px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  z-index: 2;
}

#armor-digits {
  display: flex;
  align-items: center;
  gap: 6px;
}

#armor-digits img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}

#gold-digits {
  display: flex;
  align-items: center;
  gap: 6px;
}

#gold-digits img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}

#health-digits {
  display: flex;
  align-items: center;
  gap: 6px;
}

#health-digits img {
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
}

.health-label {
  font-size: 14px;
  letter-spacing: 2px;
}

#damage-flash {
  position: absolute;
  inset: 0;
  background: rgba(180, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 120ms ease;
  pointer-events: none;
}

#damage-flash.show {
  opacity: 1;
}

#pickup-flash {
  position: absolute;
  inset: 0;
  background: rgba(255, 210, 60, 0.25);
  opacity: 0;
  transition: opacity 140ms ease;
  pointer-events: none;
}

#pickup-flash.show {
  opacity: 1;
}

#death-visor {
  position: absolute;
  inset: 0;
  width: 140%;
  height: 140%;
  left: -20%;
  top: -120%;
  background: linear-gradient(180deg, rgba(10, 0, 0, 0) 0%, rgba(10, 0, 0, 0.65) 25%, rgba(0, 0, 0, 0.95) 100%);
  opacity: 0;
  transform: rotate(-8deg) translate(0, 0);
  transition: transform 900ms ease, opacity 260ms ease;
  pointer-events: none;
  z-index: 6;
}

#death-visor.show {
  opacity: 1;
  transform: rotate(-8deg) translate(12%, 130%);
}

#click-to-start {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Space Grotesk", sans-serif;
  font-size: 26px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fff7d6;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.85) 70%);
  z-index: 7;
  pointer-events: auto;
  text-shadow: 0 0 12px rgba(255, 200, 120, 0.35);
}

#click-to-start.hidden {
  display: none;
}

#win-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(20, 10, 30, 0.6) 0%, rgba(5, 0, 10, 0.92) 70%);
  color: #ffe9b8;
  z-index: 8;
  text-align: center;
  gap: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(255, 180, 120, 0.5);
}

#win-overlay.hidden {
  display: none;
}

.win-title {
  font-size: 54px;
  font-family: "Space Grotesk", sans-serif;
}

.win-subtitle {
  font-size: 16px;
  opacity: 0.8;
}

#minimap {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 160px;
  height: 160px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.2);
  image-rendering: pixelated;
}
