html {
  height: 100%;
}

@font-face {
  font-family: Minecraftia;
  src: url('assets/fonts/minecraft.ttf') format('truetype');
}

body {
  margin: 0;
  overflow: hidden;
  font-family: Minecraftia;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
  background: url(assets/textures/sky.png);
  background-size: cover;
  height: 100%;
  image-rendering: pixelated;
}

.texturedBackground {
  backdrop-filter: contrast(50) blur(100px) saturate(1.8);
  background: url(assets/textures/bg.png);
  background-size: cover;
}

#gameCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: -2;
}

#debugCanvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  backdrop-filter: blur(20px) contrast(1.1) brightness(0.7);
  z-index: -1;
}

#menu {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: white;
  z-index: 1;
}

#stats {
  position: fixed;
  top: 20px;
  right: 20px;
  color: white;
  font-size: 20px;
  z-index: 2;
  text-align: right;
}

#craftingPanel {
  position: fixed;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  background: url(assets/textures/bg.png);
  padding: 12px;
  display: none;
  flex-direction: column;
  gap: 10px;
  z-index: 2;
  color: white;
  min-height: 250px;
  background-size: 100%;
  backdrop-filter: contrast(50) blur(100px) saturate(1.8);
  max-width: 95vw;
}

.section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px;
}

.slot {
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  box-sizing: border-box;
  overflow: hidden;
}

.slot img {
  width: 80%;
  pointer-events: none;
}

.slot span {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 12px;
  pointer-events: none;
  color: white;
}

#inventorySlots {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(9, 50px);
  gap: 5px;
}

#hotbar {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(9, 50px);
  gap: 5px;
  z-index: 3;
}

#hotbar .slot {
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.06);
}

#hotbar .slot.selected {
  outline: 3px solid white;
}

#craftingGridWrapper {
  display: flex;
  justify-content: center;
  max-height: 240px;
  overflow-y: auto;
  padding: 0 4px;
  box-sizing: border-box;
  scrollbar-width: none;
}

#craftingGrid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, 50px);
}

#craftingInfo {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 150px;
  width: 150px;
  gap: 10px;
}

.ingredients {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-start;
}

.output {
  display: flex;
  justify-content: center;
  margin-top: auto;
}

.output .slot {
  width: 70px;
  height: 70px;
}

.output .slot img.clickable {
  cursor: pointer;
  border-radius: 5px;
  transition: transform 0.1s;
}

.output .slot img.clickable:hover {
  transform: scale(1.1);
}

#worldCreatorOverlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url(assets/textures/sky.png);
  background-size: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

#worldCreatorMenu {
  padding: 20px;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#homeMenu {
  height: 100%;
  background: url(assets/textures/sky.png);
  background-size: cover;
  backdrop-filter: blur(5px);
}

#worldSelectorMenu {
  padding: 20px;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.button {
  background: url(assets/textures/bg.png);
  padding: 8px 12px;
  cursor: pointer;
  color: white;
}
.button:hover {
  background: #555;
}

.inputField {
  border: none;
  padding: 8px;
  color: white;
  font-size: 16px;
}

.pictureButton {
  width: 50px;
  height: 50px;
  padding: 10px;
}

.inactive {
  filter: grayscale(100%);
}

.worldList {
    display: flex;
    grid-template-rows: repeat(2, auto);
    grid-auto-flow: column;
    overflow-y: scroll;
    max-height: 800px;
    min-width: 100%;
    flex-wrap: wrap;
    scrollbar-width: none;
}

.creativeGridWrapper {
  padding-top: 10px;
  background: rgba(0, 0, 0, 0.25);
}

.selectEl {
  background: rgba(0, 0, 0, 0.35);
  color: white;
  outline: none;
}