@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@200..900&display=swap');

html {
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: url(images/Cursor.png), auto !important;
}

body {
  margin: 0;
  color: #fff;
  font-family: Noto Serif SC, sans-serif;
  font-weight: 200;
  user-select: none;
  max-width: 900px;
  cursor: url(images/Cursor.png), auto !important;
  overflow: hidden;
  width: 900px;
}

#game {
  max-width: 900px;
  position: relative;
  width: 100%;
  flex-direction: column;
}

#scene {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  background-size: 100% 100%;
  overflow: hidden;
}

.element {
  position: absolute;
  background-size: cover;
  background-position: center;
  mask-size: cover;
  mask-position: center;
  transform: translate(-50%,-50%);
}

#zoom-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  aspect-ratio: 3 / 2;
  background: #0006;
}

.hidden {
  display: none;
}

#description {
  height: fit-content;
  text-align: center;
  position: absolute;
  bottom: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0006;
  opacity: 0;
  pointer-events: none;
  width: 100%;
}

#inventory {
  background: #000;
  position: relative;
  padding: 10px;
  display: grid;
  align-items: start;
  gap: 10px;
  grid-auto-flow: column;
  align-content: start;
  max-width: 100%;
  overflow: hidden;
  justify-content: start;
}

#inventory .item.drag-source {
  background-image: none!important;
}

#inventory .item,
#drag-preview {
  display: inline-block;
  width: 50px;
  height: 50px;
  background-size: cover;
  background-position: center;
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

#drag-preview {
  background-size: contain;
  pointer-events: none;
  position: fixed;
  z-index: 9999;
  transform: translate(-50%,-50%);
  background-color: transparent;
}

.element:not(.noInteract).hover {background: #fff !important;}
.noInteract {pointer-events: none;}

/* debug
#scene .element {
  border: 2px solid red;
  mask: none!important;
}*/

#loading-screen {
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 900px;
  width: 100%;
  aspect-ratio: 3 / 2;
  background-size: 100% 100%;
  overflow: hidden;
  padding: 35px 0;
  overflow: hidden;
}

#menu {
  background: #000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 900px;
  width: 100%;
  aspect-ratio: 3 / 2;
  background-size: 100% 100%;
  overflow: hidden;
  padding: 35px 0;
  overflow: hidden;
  gap: 1rem;
}

#menu div {
  font-size: 2rem;
}

#menu div:hover {
  font-weight: 500;
  color: gray;
}

.loading-bar-container {
  width: 300px;
  height: 20px;
  overflow: hidden;
  margin-bottom: 10px;
}

#loading-bar {
  height: 100%;
  width: 0%;
  background: #fff;
  transition: width 0.1s;
}

#loading-text {
  font-size: 16px;
}

#fatigue {
  position: absolute;
  left: 20px;
  bottom: 90px;
  text-align: center;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 3px;
  writing-mode: tb;
}

#fatigue-bar-container {
  width: 15px;
  height: 90px;
  background: #000;
  position: relative;
}

#fatigue-bar {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: #fff;
}

#black-overlay {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  background: black;
  opacity: 0;
  pointer-events: none;
  z-index: 9998;
  transition: opacity 3s linear;
}

#black-overlay.show {
  opacity: 1;
}

#ending-text-layer {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 9999;
  pointer-events: none;
}

.ending-line {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInLine 0.4s ease forwards;
  margin: 1rem 0;
  padding: 0 1rem;
}

#restart {
  position: absolute;
  bottom: 70px;
  left: 50%;
  opacity: 0;
  transform: translate(-50%, 10px);
  font-size: 1.5rem;
  display: none;
  animation: fadeInLine2 0.4s ease forwards;
  z-index: 9999;
  pointer-events: auto;
}

#restart.end {display: block;}

#restart:hover {
  font-weight: 500;
  color: gray;
}

@keyframes fadeInLine {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLine2 {
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

#description2 {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  background: rgba(0,0,0,0.6);
  padding: 8px 16px;
  opacity: 0;
  pointer-events: none;
  text-align: center;
}

#diary {
  position: absolute;
  left: 0px;
  top: 0px;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  box-sizing: border-box;
  white-space: pre-line;
  font-size: 18px;
  z-index: 9999;
}

@media (max-width: 790px) {
  #inventory .item {
    width: 30px;
    height: 30px;
    font-size: 85%;
  }
  #description {
    bottom: 50px;
  }
  #loading-screen, #menu {
    padding: 25px 0;
  }
  .ending-line {
      margin: .25rem 0;
  }
  #fatigue {
    top: 20px;
    bottom: unset;
  }
  #menu div {
    font-size: 1.5rem;
  }
}

@media (max-width: 530px) {
  body {
    font-size: 85%;
  }
  #inventory {
    grid-template-rows: 1fr 1fr;
  }
  #description {
    bottom: 90px;
  }
  #loading-screen, #menu {
    padding: 45px 0;
  }
  #fatigue-bar-container {
    width: 10px;
    height: 70px;
  }
  .loading-bar-container {
    width: 180px;
    height: 10px;
  }
}