body {
  margin: 0;
}

#map-container {
  position: relative;
  width: 100vw;
  height: 100vh;
}

#map {
  height: 100vh;
  width: 100vw;
}

.maplibregl-map {
  background-color: #5a8e99;
}

#legend {
  position: absolute;
  bottom: 20px;
  left: 20px;
  width: 260px;
  min-height: 180px;
  background: white;
  padding: 14px;
  font-family: Arial, sans-serif;
  font-size: 13px;
  border-radius: 6px;
  box-shadow: 0 0 5px rgba(0,0,0,0.3);
  z-index: 1000;
}

.legend-bivar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.legend-middle {
  display: flex;
  align-items: center;
  gap: 10px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 28px);
  grid-template-rows: repeat(3, 28px);
  gap: 3px;
}

.cell {
  width: 28px;
  height: 28px;
}

.c22 { background: #3f2949; }
.c21 { background: #77324c; }
.c20 { background: #ae3a4e; }

.c12 { background: #435786; }
.c11 { background: #806a8a; }
.c10 { background: #bc7c8f; }

.c02 { background: #4785c1; }
.c01 { background: #89a1c8; }
.c00 { background: #cabed0; }

.x-left,
.x-right,
.y-top,
.y-bottom {
  font-size: 12px;
  color: #333;
  width: 80px;
  text-align: center;
}

.maplibregl-control-container {
  z-index: 10000 !important;
}

.maplibregl-ctrl {
  background: white;
  border-radius: 4px;
  overflow: hidden;
}

.maplibregl-ctrl button {
  background: white;
  border: none;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  width: 100%;
}

.maplibregl-ctrl button:hover {
  background: #f0f0f0;
}

.anim-btn {
  position: absolute;
  top: 60px;
  left: 10px;
  z-index: 9000;

  background: white;
  border: none;
  padding: 8px 10px;
  font-family: Arial, sans-serif;
  font-size: 12px;
  cursor: pointer;

  border-radius: 4px;
  box-shadow: 0 0 5px rgba(0,0,0,0.2);
}

#labels {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 9000;

  background: white;
  padding: 6px 10px;
  border-radius: 4px;

  font-family: Arial, sans-serif;
  text-align: right;
}

#labels div:first-child {
  font-size: 18px;
  font-weight: bold;
}

#labels div:last-child {
  font-size: 13px;
  color: #333;
}