@import url('https://fonts.googleapis.com/css2?family=Merriweather&display=swap');

.mode-btn {
  background: linear-gradient(to bottom, #272727, #131313);
  border: 2px solid black;
  border-radius: 12px;
  padding: 8px;
  margin: 0 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  transition: border 0.2s ease, transform 0.3s ease;
  transform-origin: center bottom;
  pointer-events: auto;
  position: relative;
  box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.1);
}

.mode-btn:hover:not(.active) {
  border: 2px solid white;
  transform: scale(1.1);
}

.mode-btn img {
  width: 50px;
  height: 50px;
  position: relative;
  z-index: 2;
}

.mode-btn.active {
  transform: scale(1.1);
  background: linear-gradient(45deg, #790000, #e40603);
  padding: 3px;
  border: none; 
}

.mode-btn.active::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
  background: linear-gradient(to bottom, #272727, #131313);
  border-radius: 9px;
  z-index: 1; 
}

html, body {
  margin: 0; 
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: "Merriweather" !important;
}

#sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: 200px;
  overflow-y: auto;
  background: #ddd;
  border-right: 2px solid #aaa;
  padding: 10px;
  z-index: 2;
}

#sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px;
  background: #353535;
  width: max-content;
  background-image: url('assets/buildingBlocks/misc/HammerBG.png');
  background-repeat: repeat;
  background-size: calc(100%/2) auto;

  animation-name: moveBG2;
  animation-duration: 5s;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
  animation-delay: 0s;
  animation-fill-mode: none;
}

.item {
  position: relative;
  width: 130px;
  height: 130px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  background: #111;
  border: 2px solid #000000;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.item:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  position: absolute ;
  z-index: 1;
}

.item::before {
  z-index: 0;
}

.item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, #464646, #515151 50%, #212121);
  z-index: 1;
}

.item .label-top {
  position: absolute;
  top: 6px;
  left: 8px;
  color: white;
  font-weight: bold;
  font-size: 14px;
  z-index: 2;
  text-shadow: 1px 1px 2px black;
}

.item .label-bottom {
  position: absolute;
  bottom: 6px;
  left: 8px;
  color: white;
  font-size: 13px;
  font-weight: bold;
  z-index: 2;
  text-shadow: 1px 1px 2px black;
}


canvas {
  position: fixed !important;
  top: 0 !important;
  left: 140px !important;
  right: 0 !important;
  bottom: 0 !important;
  background: #bfbfbf !important;
  display: block !important;
  height: 100%;
  width: auto;
}

#toolbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 5px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: none;
  border: none;
  box-shadow: none;
  pointer-events: none;
}

#totalCost {
  position: fixed;
  bottom: 10px;
  right: 10px;
  font-size: 18px;
  background: white;
  padding: 6px 12px;
  border-radius: 8px;
  box-shadow: 0 0 5px #0003;
}

#totalCost i {
  -webkit-text-stroke: 1px rgba(0, 0, 0, 0.6) !important;
  background: linear-gradient(90deg, #13c113, #0b6f0b) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  font-style: normal !important;
}

#tierselector {
  position: fixed;
  left: 173px;
  top: 6px;
  width: 75px;
  height: max-content;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

#tier1, #tier2, #tier3, #tier4 {
  width: 60px;
  height: 60px;
  background: linear-gradient(to bottom, #7b7b7b, #3c3c3c);
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 12px;
  text-align: center;
  font-size: 25px;
  box-sizing: border-box;
  transform-origin: center;
  transition: transform 0.2s ease;
  margin: 2px;
}

#tier1:hover, #tier2:hover, #tier3:hover, #tier4:hover {
  transform: scale(1.05);
}

#tier1.selected1 {
  background: linear-gradient(to bottom, #8b8b8b, #444444) !important;
  border: 2px solid white;
}

#tier2.selected2 {
  background: linear-gradient(to bottom, #39e726, #1c7213) !important;
  border: 2px solid white;
}

#tier3.selected3 {
  background: linear-gradient(to bottom, #0b77eb, #053b73) !important;
  border: 2px solid white;
}

#tier4.selected4 {
  background: linear-gradient(to bottom, #8c00ff, #45007e) !important;
  border: 2px solid white;
}

#loader {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgb(39, 39, 39);
  background-image: url('assets/buildingBlocks/misc/BackgroundGears.png');
  background-repeat: repeat;
  background-size: calc(100% / 40) auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;

  animation-name: moveBG, fadeOutBG;
  animation-duration: 4s, 1s;
  animation-timing-function: linear, ease;
  animation-iteration-count: infinite, 1;
  animation-delay: 0s, 4s;
  animation-fill-mode: none, forwards;
}

.spinner {
  border-radius: 50%;
  width: 221px;
  height: 221px;
  animation-name: spin, fadeOutBG;
  animation-duration: 4s, 1s;
  animation-timing-function: linear, ease;
  animation-iteration-count: infinite, 1;
  animation-delay: 0s, 4s;
  animation-fill-mode: none, forwards;
  transform-origin: center;
}

.Vignette {
  animation-name: fadeOutBG;
  animation-duration: 1s;
  animation-delay: 4s;
  animation-timing-function: ease;
  animation-fill-mode: forwards;
  animation-iteration-count: 1;
}


@keyframes moveBG {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: -200px -200px;
  }
}

@keyframes moveBG2 {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: -200px -200px;
  }
}

@keyframes fadeOutBG {
  to {
    opacity: 0;
    background: rgba(17, 17, 17, 0);
  }
}

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

/* Scrollbar styles */
/* WebKit Browsers */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: #555;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #777;
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #555 transparent;
}
