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

body {
  background: #000;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
}

/* SVG noise filter */
#noise-filter {
  position: absolute;
  width: 0;
  height: 0;
}

.screen-wrap {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: #0a0f0a;
  border-radius: 3px;
  overflow: hidden;
  perspective: 800px;
  animation: flicker 8s infinite;
  filter: brightness(1.05) drop-shadow(0 0 8px rgba(16, 185, 129, 0.4));
  border: 1px solid #065f46;
  box-shadow: 0 0 0 1px #022c22, 0 0 20px rgba(16, 185, 129, 0.15), inset 0 0 60px rgba(0, 0, 0, 0.4);
  cursor: crosshair;
}

@keyframes flicker {
  0% {
    opacity: 1.0;
  }
  2% {
    opacity: 0.97;
  }
  4% {
    opacity: 1.0;
  }
  50% {
    opacity: 1.0;
  }
  52% {
    opacity: 0.98;
  }
  54% {
    opacity: 1.0;
  }
  85% {
    opacity: 1.0;
  }
  87% {
    opacity: 0.96;
  }
  89% {
    opacity: 1.0;
  }
  100% {
    opacity: 1.0;
  }
}

/* Scanlines */
.screen-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
          to bottom,
          transparent 0px,
          transparent 2px,
          rgba(0, 0, 0, 0.12) 2px,
          rgba(0, 0, 0, 0.12) 3px
  );
  pointer-events: none;
  z-index: 10;
  border-radius: 3px;
}

/* Vignette */
.screen-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center,
  transparent 50%,
  rgba(0, 0, 0, 0.35) 75%,
  rgba(0, 0, 0, 0.7) 100%
  );
  pointer-events: none;
  z-index: 11;
  border-radius: 3px;
}

/* Noise overlay */
.noise-layer {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  pointer-events: none;
  z-index: 9;
  filter: url(#noise);
  background: #10b981;
  border-radius: 3px;
  animation: noiseAnim 0.15s steps(1) infinite;
}

@keyframes noiseAnim {
  0% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(-2px, 1px);
  }
  50% {
    transform: translate(1px, -2px);
  }
  75% {
    transform: translate(2px, 1px);
  }
  100% {
    transform: translate(-1px, -1px);
  }
}

canvas#mapCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* HUD Elements */
.hud {
  position: absolute;
  z-index: 20;
  color: #10b981;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  text-shadow: 0 0 6px rgba(16, 185, 129, 0.8), 0 0 12px rgba(16, 185, 129, 0.4);
  pointer-events: none;
  letter-spacing: 0.05em;
}

.hud-tl {
  top: 18px;
  left: 20px;
  line-height: 1.7;
}

.hud-tr {
  top: 18px;
  right: 20px;
  text-align: right;
  line-height: 1.7;
}

.hud-bl {
  bottom: 18px;
  left: 20px;
  line-height: 1.7;
}

.hud-br {
  bottom: 18px;
  right: 20px;
  text-align: right;
  line-height: 1.7;
}

.hud-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #10b981;
}

.hud-sub {
  font-size: 11px;
  color: #065f46;
  letter-spacing: 0.08em;
}

.cursor-blink {
  display: inline-block;
  animation: blink 1.1s step-end infinite;
  color: #10b981;
}

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

.status-ok {
  color: #10b981;
}

.bar-fill {
  color: #10b981;
  letter-spacing: -1px;
}

/* Popup tooltip */
.city-popup {
  position: absolute;
  z-index: 30;
  background: rgba(10, 15, 10, 0.92);
  border: 1px solid #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5), inset 0 0 20px rgba(16, 185, 129, 0.04);
  color: #10b981;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 8px 12px;
  pointer-events: none;
  display: none;
  line-height: 1.8;
  text-shadow: 0 0 6px rgba(16, 185, 129, 0.7);
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.city-popup::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  height: 2px;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.8);
}

.corner-tl, .corner-tr, .corner-bl, .corner-br {
  position: absolute;
  width: 16px;
  height: 16px;
  border-color: #10b981;
  border-style: solid;
  opacity: 0.6;
  z-index: 25;
  pointer-events: none;
}

.corner-tl {
  top: 8px;
  left: 8px;
  border-width: 1px 0 0 1px;
}

.corner-tr {
  top: 8px;
  right: 8px;
  border-width: 1px 1px 0 0;
}

.corner-bl {
  bottom: 8px;
  left: 8px;
  border-width: 0 0 1px 1px;
}

.corner-br {
  bottom: 8px;
  right: 8px;
  border-width: 0 1px 1px 0;
}

@media (max-width: 768px) {
  .hud {
    display: none !important;
  }

  .scanline {
    opacity: 0.03 !important;
  }

  #screenWrap {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
  }

  body {
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
  }
}