html {
  background: green url("../assets/grass.jpg") top left / 100px repeat;
  display: flex;
  font-family: "Tahoma", "Arial", sans-serif;
  font-size: 12px;
  min-height: 100%;
  overflow-y: scroll;
  width: 100%;
}

body, hr, #towngrid, #minimap, #acregrid, .tile {
  border: 1px dashed darkgray;
}

body {
  background-color: white;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: calc(100% - 100px);
  margin: 70px auto;
  padding: 70px;
  max-width: 590px;
  width: 100%;
}

h1 {
  margin-top: 0;
}

h2 {
  margin-top: 20px;
  margin-bottom: 0px;
}

p {
  margin-bottom: 0px;
}

p, ul {
  margin-top: 10px;
}

ul {
  list-style-position: inside;
  list-style-type: square;
  padding-left: 0;
}

hr {
  margin: 24px 0px;
}

input {
  font-size: 12px;
  max-width: 100%;
}

a {
  color: blue;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

#main {
  flex: 1;
}

#gci {
  padding: 15px 0px 5px 0px;
  display: none;
}

#map {
  flex: 1 0 auto;
}

#towngrid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 10px;
  max-width: 100%;
}

.acre {
  aspect-ratio: 1 / 1;
  background-size: cover;
  cursor: pointer;
  image-rendering: pixelated;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  :not(:has(.acre:active)) > .acre:hover {
    outline: 5px solid rgb(255, 91, 220);
    outline-offset: -5px;
  }
}

.acre:is(:focus-visible, :active) {
  outline: 5px solid rgb(255, 91, 220);
  outline-offset: -5px;
}

.acre:active {
  background-color: rgba(255, 255, 255, 0.5);
  background-blend-mode: overlay;
}

#minimap {
  box-sizing: border-box;
  padding: 40px;
  width: min(calc(100vw - 20px), 510px);
}

#minimap::backdrop {
  background-color: rgba(0, 0, 0, 0.50);
}

#acregrid, #legend {
  container-type: inline-size;
  margin: 20px 0px;
  max-width: 100%;
}

#acregrid {
  display: grid;
  grid-template-columns: repeat(16, minmax(0, 1fr));
  background-size: cover;
  image-rendering: pixelated;
}

.tile {
  align-items: center;
  aspect-ratio: 1 / 1;
  color: white;
  cursor: default;
  display: flex;
  font-size: 3.5cqw;
  justify-content: center;
}

@media (hover: hover) {
  :not(:has(.tile:active)) > .tile:hover {
    outline: 3px solid white;
    outline-offset: -3px;
  }
}

.tile:is(:focus-visible, :active) {
  outline: 3px solid white;
  outline-offset: -3px;
}

.tile.valid {
  background-color: rgba(0, 0, 0, 0.20);
}

.tile.valid::after {
  content: "\2714\FE0E";
  font-family: -apple-system, sans-serif;
}

.tile.restricted {
  background-image: conic-gradient(rgba(0, 0, 0, 0.15) 0% 25%, transparent 25% 50%, rgba(0, 0, 0, 0.15) 50% 75%, transparent 75% 100%);
  background-size: 50% 50%;
  background-repeat: repeat;
}

.tile.occupied {
  background-image: linear-gradient(135deg, rgba(0, 0, 0, 0.25) 25%, transparent 25%, transparent 50%, rgba(0, 0, 0, 0.25) 50%, rgba(0, 0, 0, 0.25) 75%, transparent 75%);
  background-size: cover;
}

#legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#legend .entry {
  align-items: center;
  display: flex;
  gap: 10px;
}

#legend .tile {
  flex-shrink: 0;
  outline-style: none;
  width: calc(100% / 16);
}

#legend .text {
  margin-top: 0;
}

#minimap h1:focus, h1:focus-visible {
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
  #minimap {
    max-height: 80dvh;
  }
}
