
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: dark;
  font-family: 'Inter', sans-serif;

  --bg: #080809;
  --surface: #101012;
  --surface-hover: #19191c;
  --border: #252326;

  --text: #f4f1f2;
  --muted: #777278;

  --red: #e53b52;
  --red-hover: #fa5066;
  --red-soft: rgba(229, 59, 82, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
}

body {
  display: flex;
  flex-direction: column;
  color: var(--text);
  font-family: 'Inter', sans-serif;
}

button {
  font: inherit;
}

/* HEADER */

.topbar {
  position: relative;
  z-index: 1000;

  display: flex;
  align-items: center;
  justify-content: space-between;

  min-height: 68px;
  padding: 0 26px;

  background: rgba(16, 16, 18, 0.96);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  display: grid;
  place-items: center;

  width: 34px;
  height: 34px;

  border-radius: 10px;

  background: var(--red);
  color: white;

  font-size: 18px;
  font-weight: 800;

  box-shadow: 0 0 22px rgba(229, 59, 82, 0.22);
}

.brand h1 {
  margin: 0;

  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand p {
  margin: 4px 0 0;

  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

/* HEADER ACTIONS */

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

#tile-count {
  display: flex;
  align-items: center;
  gap: 8px;

  color: #aaa4aa;
  font-size: 11px;
  font-weight: 500;
}

#tile-count::before {
  content: '';

  width: 7px;
  height: 7px;

  border-radius: 50%;
  background: var(--red);

  box-shadow: 0 0 10px rgba(229, 59, 82, 0.55);
}

#fit-map {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  min-height: 36px;
  padding: 0 14px;

  border: 1px solid rgba(229, 59, 82, 0.35);
  border-radius: 8px;

  background: var(--red-soft);
  color: #ff7184;

  font-size: 11px;
  font-weight: 600;

  cursor: pointer;

  transition: all 160ms ease;
}

#fit-map:hover {
  background: var(--red);
  border-color: var(--red);
  color: white;

  box-shadow: 0 4px 18px rgba(229, 59, 82, 0.2);
}

#fit-map:active {
  transform: scale(0.97);
}

/* MAP AREA */

main {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;

  background: #000;
}

#map {
  flex: 1;
  min-height: 0;
  width: 100%;

  /* Чёрная подложка скрывает пустое пространство вокруг карты. */
  background: #000000 !important;
}

.leaflet-container {
  background: #000000 !important;
  font-family: 'Inter', sans-serif;
}

/* IMAGE QUALITY */

.leaflet-image-layer {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* LEAFLET CONTROLS */

.leaflet-control-zoom {
  overflow: hidden;

  border: 1px solid var(--border) !important;
  border-radius: 10px !important;

  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.45) !important;
}

.leaflet-control-zoom a {
  display: flex !important;
  align-items: center;
  justify-content: center;

  width: 36px !important;
  height: 36px !important;

  background: #111113 !important;
  color: #e8e3e6 !important;

  border: 0 !important;
  font-size: 19px !important;

  transition: background 150ms ease, color 150ms ease;
}

.leaflet-control-zoom a:hover {
  background: #252024 !important;
  color: var(--red-hover) !important;
}

.leaflet-control-zoom-in {
  border-bottom: 1px solid var(--border) !important;
}

/* COORDINATE PANEL */

.coordinate-panel {
  position: relative;
  z-index: 500;

  display: flex;
  align-items: center;
  gap: 25px;

  min-height: 54px;
  padding: 0 26px;

  background: #101012;
  border-top: 1px solid var(--border);
}

.coordinate-panel > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.coordinate-label {
  display: grid;
  place-items: center;

  width: 23px;
  height: 23px;

  border-radius: 6px;

  background: var(--red-soft);
  color: #f15b70;

  font-size: 10px;
  font-weight: 700;
}

.coordinate-panel strong {
  color: #e9e4e7;

  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

#map-status {
  display: flex;
  align-items: center;
  gap: 8px;

  margin-left: auto;

  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

/* CHUNK HIGHLIGHT */

.chunk-hover-highlight {
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
  pointer-events: none;
}

/* FOCUS */

button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

/* MOBILE */

@media (max-width: 600px) {
  .topbar {
    min-height: 62px;
    padding: 0 14px;
  }

  .brand {
    gap: 9px;
  }

  .brand-icon {
    width: 31px;
    height: 31px;
  }

  .brand h1 {
    font-size: 13px;
  }

  .brand p {
    font-size: 10px;
  }

  .topbar-actions {
    gap: 8px;
  }

  #tile-count {
    font-size: 9px;
  }

  #fit-map {
    min-height: 33px;
    padding: 0 9px;
    font-size: 10px;
  }

  .coordinate-panel {
    min-height: 49px;
    gap: 14px;
    padding: 0 13px;
  }

  .coordinate-panel > div {
    gap: 6px;
  }

  #map-status {
    max-width: 42%;
    font-size: 9px;
    text-align: right;
  }
}
