body {
  background-color: #C29A62;
  font-family: "Fredoka", sans-serif;
  margin: 0;
  scrollbar-width: none;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.grid {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: 80px 1fr 20px;
  grid-template-areas:
    "topbar topbar"
    "game sidebar"
    "bottom-bar sidebar";
}

.hidden {
  display: none;
}

.saving {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
}

.saving.hidden {
  display: none;
}

.loading {
  height: 15px;
  aspect-ratio: 1;
  border-top: 1px solid rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  transform-origin: center;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.grid-uihidden {
  grid-template-columns: 1fr 0px;
  grid-template-rows: 80px 1fr 0px;
}

.grid-uihidden ::after {
  display: none;
}

.topbar {
  grid-area: topbar;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.actions img.menu-button {
  aspect-ratio: 1;
  width: 40px;
}

.sidebar {
  grid-area: sidebar;
  overflow: hidden;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  scrollbar-width: none;
}

.sidebar-two {
  width: 80px;
  height: 100%;
  display: flex;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}

.sidebar-one {
  width: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  overflow-y: scroll;
  scrollbar-width: none;
}

.bottom-bar {
  display: flex;
  justify-content: space-between;
  padding: 0 5px;
  grid-area: bottom-bar;
}

.left-info,
.right-info {
  display: flex;
  flex-direction: row;
  gap: 5px;
}

.left-info p,
.right-info p {
  margin: 0;
  font-size: 17px;
  font-weight: 350;
  padding-bottom: 4px;
}

.category-blocks {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  border-right: 4px solid #AF8758;
  margin-bottom: 10px;
  box-sizing: border-box;
  transform: translateX(4px)
}

.category-blocks>* {
  margin: 10px 0;
  height: 50px;
  width: 50px;
  padding: 5px 15px;
  image-rendering: pixelated;
}

.tile-select {
  height: 50px;
  width: 50px;
  image-rendering: pixelated;
}


.categories {
  overflow: scroll;
  scrollbar-width: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-self: center;
  align-items: center;
  justify-self: end;
  box-sizing: border-box;
}

.category {
  cursor: pointer;
}

.categories:has(.active) {
  border-left: 4px solid #AF8758;
}

.categories div.active::after {
  content: '';
  position: absolute;
  transform: translateY(175%) translateX(-76px) rotate(45deg);
  width: 10px;
  height: 10px;
  background-color: #C29A62;
  border-right: 4px solid #AF8758;
  border-top: 4px solid #AF8758;
  border-radius: 2px;
}

.zoom {
  display: flex;
  flex-direction: column;
  justify-content: left;
  align-items: center;
}

.zoom img {
  width: 35px;
  height: 35px;
  margin: 15px auto;
}


.tile-selection {
  overflow-y: scroll;
  scrollbar-width: none;
  flex: 1;
  width: 80px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: end;
}

.tile-select-container {
  cursor: pointer;
}

div.eraser>img {
  width: 50px;
  height: 50px;
}

.tile-selection img {
  width: 60px;
  height: 60px;
  image-rendering: pixelated;
  user-select: none;
  margin-bottom: 20px;
}

.actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  object-fit: cover;
}

.actions>* {
  margin-right: 20px;
}

.actions img {
  width: 50px;
  height: 50px;
  font-size: 35px;
}

.actions i {
  font-size: 35px;
}

i::before {
  margin: auto 0;
}

.title {
  color: black;
  text-decoration: none;
  font-size: 35px;
  font-weight: 500;
  padding-left: 20px;
}

.title a {
  color: black;
  text-decoration: none;
}

.game {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  border: 4px solid black;
  justify-self: center;
  position: relative;
  scrollbar-width: none;
}

.minimap {
  position: absolute;
  right: 0;
  bottom: 0;
  margin: 10px;
  background-color: #C29A62;
  border: 3px solid black;
  border-radius: 10px;
  overflow: hidden;
}

.minimap-canvas {
  display: block;
}

.canvas {
  position: absolute;
  box-sizing: border-box;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  scrollbar-width: none;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  justify-content: center;
  align-items: center;
}

.background {
  z-index: 2;
  background-color: rgba(0, 0, 0, 0.5);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.menu-content {
  max-height: max(70vh, 500px);
  margin-top: 20px;
  z-index: 3;
  background-color: #C29A62;
  border-radius: 20px;
  min-height: 400px;
  width: min(700px, 90vw);
  user-select: none;
  font-weight: 500;
  display: flex;
  flex-direction: column;
}

.trigger-dialog {
  width: min(90vw, 800px);
  z-index: 3;
  background-color: #C29A62;
  border-radius: 20px;
  min-height: 400px;
  user-select: none;
  font-weight: 500;
  padding: 20px;
  display: none;
  flex-direction: column;
}

.trigger-dialog p {
  margin: 0;
  font-size: 35px;
  font-weight: 500;
}

.steps-wrapper {
  display: grid;
  grid-template-columns: 30px 1fr 30px;
  margin-top: 20px;
  align-items: stretch;
}

.arrow {
  width: 20px;
  position: relative;
  margin-right: 15px;
  flex-shrink: 0;
}

.arrow::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  background-color: black;
  border-radius: 2px;
}

.arrow::after {
  content: "";
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateY(-20%) translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  border-right: 3px solid black;
  border-bottom: 3px solid black;
  border-radius: 2px;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.step {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  height: 75px;
  border: 3px solid black;
  border-radius: 15px;
  background-color: #b48d57;
  position: relative;
}

.step select {
  height: calc(100% - 20px);
  margin: 10px;
  padding: 5px 10px;
  box-sizing: border-box;
  font-size: 30px;
  outline: none;
  border: none;
  background-color: #C29A62;
  border-radius: 10px;
  font-family: "Fredoka", sans-serif;
}

.step select.block,
div.step .options input.coord {
  font-size: 20px;
}

div.step .options input.coord {
  width: 50px;
}

.steps .step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -14px;
  width: 20px;
  height: 3px;
  background: black;
  border-radius: 4px;
  pointer-events: none;
  z-index: 0;
}

.step .options {
  display: flex;
  justify-content: right;
  margin-right: 10px;
  align-items: center;
  font-size: 25px;
}

.step input[type="number"] {
  height: calc(100% - 20px);
  max-width: 75px;
  margin: 10px;
  padding: 5px 10px;
  box-sizing: border-box;
  font-size: 25px;
  outline: none;
  border: none;
  background-color: #C29A62;
  border-radius: 10px;
  font-family: "Fredoka", sans-serif;
  appearance: textfield;
}

.step input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}

.step .options img {
  width: 35px;
  height: 35px;
}

.buttons {
  margin: 15px 30px auto 30px;
  display: flex;
  justify-content: space-between;
}

.buttons p {
  font-size: 22px;
  font-weight: 400;
}

.buttons .apply {
  background-color: black;
  color: #C29A62;
  outline: none;
  border: none;
  border-radius: 500px;
  font-family: "Fredoka", sans-serif;
  font-size: 20px;
  height: 25px;
  aspect-ratio: 10 / 3;
}

.buttons>* {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  aspect-ratio: 10 / 3;
  width: 90px;
  height: 25px;
  border: 3px solid black;
  border-radius: 20px;
}

.buttons img {
  width: 25px;
  height: 25px;
}

input[type="radio"] {
  display: none;
}

.tab.options .menu-item {
  margin-top: 0;
}

.toggle {
  appearance: none;
  box-sizing: border-box;
  height: 34px;
  aspect-ratio: 5/3;
  background-color: #C29A62;
  border: 3px solid black;
  border-radius: 50px;
  position: relative;
  cursor: pointer;
  background: none;
  border: none;
  outline: none;
}

.toggle::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 2px;
  width: 20px;
  aspect-ratio: 1;
  background-color: transparent;
  border: 3px solid black;
  border-radius: 50%;
  transition: transform 150ms ease;
}

.toggle::before {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.toggle:checked::before {
  border: 3px solid #C29A62;
  height: 7px;
  left: 10px;
  border-radius: 3px;
}

.toggle:not(:checked)::before {
  border: 3px solid black;
  border-radius: 50%;
  right: 5px;
  width: 8px;
  aspect-ratio: 1;
  background-color: #C29A62;
}

.toggle:checked {
  background-color: black;
  border: 3px solid black;
}

.toggle:not(:checked) {
  background-color: #C29A62;
  border: 3px solid black;
}

.toggle:checked::after {
  background-color: #C29A62;
  transform: translateX(22px) translateY(-50%);
}

.menu-content input[type="radio"]:nth-of-type(1):checked~.tabs li:nth-of-type(1),
.menu-content input[type="radio"]:nth-of-type(2):checked~.tabs li:nth-of-type(2),
.menu-content input[type="radio"]:nth-of-type(3):checked~.tabs li:nth-of-type(3),
.menu-content input[type="radio"]:nth-of-type(4):checked~.tabs li:nth-of-type(4),
.menu-content input[type="radio"]:nth-of-type(5):checked~.tabs li:nth-of-type(5) {
  background-color: #C29A62;
  border: 3px solid black;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  transform: translateY(3px);
  z-index: 2;
}

.tabs {
  margin: 15px 20px 15px 20px;
  border-bottom: 3px solid black;
}

.tabs ul {
  list-style-type: none;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  margin: 0;
  padding: 0;
}

.close-button {
  width: 30px;
  height: 30px;
}

.tabs label {
  font-size: 25px;
  width: 100px;
}

.tabs li {
  padding: 5px 0;
  box-sizing: border-box;
  width: 120px;
  text-align: center;
  user-select: none;
  cursor: pointer;
}


.tabs li:has(img) {
  display: flex;
  justify-content: end;
  width: 40px;
}

.menu-item {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  margin: 30px 20px;
  align-items: center;
}

.menu-item input[type="text"] {
  color: black;
  -webkit-text-fill-color: black;
  /* styles the placeholder */
  background-color: transparent;
  border: none;
  font-size: 20px;
  text-decoration: underline;
  border-radius: 2px;
  text-align: right;
}

.menu-item input[type="text"]:focus,
.menu-item input[type="text"]:focus-visible {
  outline: none;
  border: none;
  appearance: none;
}

.menu-item input[type="text"]::-webkit-input-placeholder,
.menu-item input[type="text"]:-ms-input-placeholder,
.menu-item input[type="text"]::placeholder {
  color: black !important;
  opacity: 1;
  text-decoration: underline;
}

.menu-item input[type="text"]:-webkit-autofill,
.menu-item input[type="text"]:-webkit-autofill:focus,
.menu-item input[type="text"]:-webkit-autofill:hover {
  -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
  box-shadow: 0 0 0 1000px transparent inset !important;
  -webkit-text-fill-color: inherit !important;
}

.menu-item h3 {
  margin: 0;
  font-size: 25px;
}

.menu-item select {
  background-color: #C29A62;
  border: none !important;
  font-family: "Fredoka", sans-serif;
  font-size: 20px;
  font-weight: 500;
  text-align: end;
  padding: 5px;
}

.menu-item select option {
  border: none;
  outline: none;
  border-radius: 0 0 10px 10px;
}

.menu-item select:focus {
  outline: none;
  border: none;
}

.menu-item label {
  font-size: 25px;
}

.menu-item input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  width: 300px;
  cursor: pointer;
}

.menu-item input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 3px;
  background: black;
  border: none;
  border-radius: 2px;
}

.menu-item input[type="range"]::-moz-range-track {
  width: 100%;
  height: 3px;
  background: black;
  border: none;
  border-radius: 2px;
}

.menu-item input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 16px;
  width: 16px;
  border-radius: 200px;
  background: #C29A62;
  border: 3px solid black;
  box-sizing: border-box;
  margin-top: -7px;
}

.menu-item input[type="range"]::-moz-range-thumb {
  height: 16px;
  width: 16px;
  border-radius: 200px;
  background: #C29A62;
  border: 3px solid black;
  box-sizing: border-box;
}

.level-name {
  font-family: "Fredoka", sans-serif;
}

.tab-content {
  height: 100%;
  overflow-y: scroll;
  scrollbar-width: none;
}

.tab {
  display: none;
  margin: 0 20px;
}

.menu-content input[type="radio"]:nth-of-type(1):checked~.tab-content .tab:nth-of-type(1),
.menu-content input[type="radio"]:nth-of-type(2):checked~.tab-content .tab:nth-of-type(2),
.menu-content input[type="radio"]:nth-of-type(3):checked~.tab-content .tab:nth-of-type(3),
.menu-content input[type="radio"]:nth-of-type(4):checked~.tab-content .tab:nth-of-type(4),
.menu-content input[type="radio"]:nth-of-type(5):checked~.tab-content .tab:nth-of-type(5) {
  display: block;
  overflow: scroll;
  scrollbar-width: none;
}

.keyboard-shortcuts {
  margin: 0 20px;
}

.keyboard-shortcuts ul {
  list-style-type: none;
  margin: 10px;
  padding: 0;
}

.help p {
  font-size: 25px;
  margin: 10px;
}

.help p.body-text {
  font-size: 18px;
  font-weight: 400;
}

span.keyboard-shortcut {
  border: 2px solid black;
  padding: 0 5px;
  border-radius: 4px;
  background-color: rgba(0, 0, 0, 0.3);
  color: black;
}

.help li {
  padding: 5px;
  font-size: 18px;
}

.description-border {
  width: 100%;
  min-height: 50px;
  border: 3px solid black;
  border-radius: 10px
}

div.menu-item div.description-border input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  font-size: 18px;
  padding: 5px;
  text-align: left;
  text-decoration: none;
}

.menu-item input[type="submit"] {
  background-color: black;
  border: 3px solid black;
  padding: 5px 15px;
  font-size: 20px;
  color: #C29A62;
  border-radius: 20px;
  font-family: "Fredoka", sans-serif;
}

.menu-item input[type="button"] {
  background-color: transparent;
  border: 3px solid black;
  padding: 5px 15px;
  font-size: 20px;
  border-radius: 20px;
  font-family: "Fredoka", sans-serif;
}