:root {
  --grid-size: 32px;
  image-rendering: pixelated;
}

body {
  background-color: lightseagreen;
}

.main-container {
  display: grid;
  background-color: lightblue;
  max-width: 800px;
  margin: 2rem auto;
  grid-template-columns: 360px 1fr;
  text-align: center;
  border: 2px solid black;
  padding: 0.5rem;
}

#map-name {
  grid-column: 1 / span 2;
}

.editor {
  margin: 0 auto;
  border: 2px solid black;
  border-radius: 5px;
  padding: 0.5rem;
}

.editor div {
  margin: 1rem 0;
}

#palette-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

#palette-container > h2 {
  grid-column: 1 / span 3;
}

#palette-container > button {
  width: 48px;
  height: 48px;
}

#grid-container {
  margin: auto;
}

#grid {
  display: flex;
  border: 5px solid black;
  flex-wrap: wrap;
}

.grid-cell {
  position: relative;
  border: none;
  width: var(--grid-size);
  height: var(--grid-size);
  box-sizing: border-box;
  text-align: center;
  background-color: lightgray;
  cursor: pointer;
}

.grid-cell:hover {
  filter: brightness(140%);
}

.layer {
  position: absolute;
  width: var(--grid-size);
  height: var(--grid-size);
  top: 0;
  left: 0;
  pointer-events: none;
}

.layer-active {
  background-color: darkblue;
}

img {
  width: 100%;
  height: 100%;
}

.btn-img {
  pointer-events: none;
}

.cell-img {
  pointer-events: none;
}

.maps-modal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  font-weight: 900;
  font-size: 1.3rem;
  gap: 1rem;
}

.map-card {
  display: flex;
  width: 200px;
  height: 270px;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.map-card:hover {
  cursor: pointer;
}

.map-card:hover > img {
  filter: brightness(130%);
  transform: scale(1.10);
  transition: transform 0.3s;
}

.data-buttons {
  display: flex;
  flex-direction: column;
}

button {
  border: 1px solid rgb(255, 255, 255);
  padding: 0.5rem;
  font-weight: 900;
  background-color: lightslategray;
  color: white;
}

button:hover {
  filter: brightness(140%);
}

button:active {
  filter: brightness(80%);
}

@media screen and (max-width: 768px) {
  .main-container {
    grid-template-columns: repeat(auto-fill, 100%);
    gap: 2rem;
  }

  #map-name {
    grid-column: 1;
  }

  #grid-container {
    grid-row: 2;
  }
}