.terrain-select-fallback {
  margin-bottom: 10px;
}

.terrain-variants {
  display: grid;
  gap: 8px;
  margin: 2px 0 16px;
}

.terrain-variants button {
  position: relative;
  display: grid;
  grid-template-columns: 54px 28px 1fr;
  grid-template-rows: auto auto;
  min-height: 66px;
  padding: 10px 12px 10px 8px;
  overflow: hidden;
  color: inherit;
  text-align: left;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.terrain-variants button:hover {
  transform: translateX(2px);
  border-color: rgba(255, 255, 255, 0.28);
}

.terrain-variants button.selected {
  background:
    linear-gradient(90deg, rgba(255, 118, 95, 0.17), transparent 72%),
    rgba(255, 255, 255, 0.055);
  border-color: #ff765f;
}

.terrain-variants button > span {
  align-self: center;
  color: #ff765f;
  font: 700 10px/1 Manrope, sans-serif;
  letter-spacing: 0.08em;
}

.terrain-variants button > b {
  align-self: center;
  font: 600 12px/1.2 Manrope, sans-serif;
}

.terrain-variants button > small {
  grid-column: 2 / 4;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.56);
  font: 400 10px/1.35 Manrope, sans-serif;
}

.terrain-mini {
  position: relative;
  grid-row: 1 / 3;
  display: block;
  width: 44px;
  height: 40px;
  align-self: center;
  border-radius: 5px;
  background:
    linear-gradient(180deg, transparent 57%, rgba(102, 171, 184, 0.58) 58%),
    #2d3132;
}

.terrain-mini::before,
.terrain-mini::after {
  position: absolute;
  content: "";
}

.terrain-mini-flat::before {
  right: 4px;
  bottom: 15px;
  left: 3px;
  height: 7px;
  background: #8f9b7e;
  border-radius: 60% 35% 0 0;
}

.terrain-mini-flat::after {
  right: 8px;
  bottom: 8px;
  left: 8px;
  height: 1px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 3px rgba(255, 255, 255, 0.28);
}

.terrain-mini-hill::before {
  right: -2px;
  bottom: 15px;
  left: -2px;
  height: 21px;
  background: #8f9b7e;
  border-radius: 70% 35% 0 0;
  transform: rotate(-4deg);
}

.terrain-mini-hill::after {
  width: 2px;
  height: 18px;
  right: 12px;
  bottom: 17px;
  background: #6d5747;
  box-shadow: 0 -3px 0 4px #74806a;
}

.terrain-mini-rocky::before {
  right: 3px;
  bottom: 14px;
  left: 3px;
  height: 25px;
  background:
    linear-gradient(128deg, transparent 44%, #b3a58e 45% 60%, transparent 61%),
    linear-gradient(62deg, #756f64 0 43%, transparent 44%),
    linear-gradient(112deg, transparent 0 42%, #9b917f 43%);
  clip-path: polygon(0 100%, 8% 44%, 25% 58%, 43% 9%, 62% 42%, 77% 20%, 100% 100%);
}

.terrain-mini-rocky::after {
  right: 4px;
  bottom: 7px;
  left: 4px;
  height: 1px;
  background: rgba(255, 255, 255, 0.56);
  box-shadow: 0 3px rgba(255, 255, 255, 0.23);
}

.terrain-detail-control {
  position: relative;
}

.terrain-story {
  margin: 14px 0;
  padding: 13px 14px;
  background:
    linear-gradient(135deg, rgba(255, 118, 95, 0.11), transparent 55%),
    rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
}

.terrain-story span {
  display: block;
  margin-bottom: 7px;
  color: #ff765f;
  font: 700 9px/1 Manrope, sans-serif;
  letter-spacing: 0.12em;
}

.terrain-story b {
  display: block;
  font: 600 12px/1.35 Manrope, sans-serif;
}

.terrain-story p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.58);
  font: 400 10.5px/1.45 Manrope, sans-serif;
}

body[data-terrain-type="rocky"] .legend .terrain-dot {
  background: #9a846b;
}

body[data-terrain-type="flat"] .legend .terrain-dot,
body[data-terrain-type="hill"] .legend .terrain-dot {
  background: #aeb8a5;
}

@media (max-width: 820px) {
  .terrain-variants {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .terrain-variants button {
    display: flex;
    min-height: 112px;
    padding: 9px;
    flex-direction: column;
  }

  .terrain-variants button > span {
    position: absolute;
    top: 8px;
    right: 8px;
  }

  .terrain-variants button > small {
    margin-top: 4px;
  }
}
