* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #192526;
  font-family:
    Trebuchet MS,
    Arial,
    "Microsoft Yahei",
    sans-serif;
  color: #fffceb;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
}
#game,
#world {
  width: 100%;
  height: 100%;
  display: block;
}
#game {
  position: relative;
  content-visibility: auto;
  contain-intrinsic-size: 100vw 100vh;
}
#loading {
  position: absolute;
  inset: 0;
  background: #222c2e;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9;
}
#loading strong {
  font-size: clamp(30px, 5vw, 70px);
  font-style: italic;
  font-weight: 1000;
  color: #ee4b55;
  text-shadow: 3px 3px #7f1524;
}
progress {
  width: min(360px, 80vw);
  accent-color: #e9bb61;
}
#menu {
  position: absolute;
  inset: 0;
  background: #0004;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4vh 5vw;
}
#menu[hidden],
#hud[hidden] {
  display: none;
}
.clipboard {
  width: 350px;
  max-width: 80vw;
  background: repeating-linear-gradient(#fffeed 0 38px, #f0f0d9 39px 41px);
  padding: 20px 24px 26px;
  border: 12px solid #bb8a54;
  border-radius: 15px;
  box-shadow: 0 12px 30px #0007;
  transform: rotate(-1deg);
}
h1 {
  color: #f14a5d;
  font-size: 52px;
  line-height: 0.84;
  letter-spacing: -3px;
  font-style: italic;
  text-align: center;
  margin: 0 0 30px;
  text-shadow:
    3px 3px #731728,
    -2px -2px #731728,
    2px -2px #731728,
    -2px 2px #731728;
}
h1 em {
  font-size: 32px;
  letter-spacing: -1px;
  color: white;
}
.clipboard button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: #31758a;
  text-align: left;
  font-weight: 900;
  font-size: 24px;
  padding: 14px 4px;
}
.clipboard button:before {
  content: "□";
  margin-right: 24px;
}
.clipboard button:hover {
  color: #d55251;
  transform: translateX(4px);
}
.clipboard small {
  display: block;
  font-size: 11px;
  color: #777;
  line-height: 1.5;
  margin-top: 15px;
}
.note {
  align-self: flex-start;
  background: #92a55e;
  border: 5px solid #fdfbe7;
  padding: 20px;
  transform: rotate(3deg);
  box-shadow: 4px 4px #3338;
  font-size: 24px;
  font-weight: bold;
}
.note small {
  font-size: 13px;
  font-weight: 400;
}
#hud {
  pointer-events: none;
  position: absolute;
  inset: 0;
  text-shadow: 1px 2px 3px #15201e;
}
#player-tag {
  position: absolute;
  left: 20px;
  top: 18px;
  background: #fff0a6;
  color: #504b32;
  padding: 9px 20px;
  border-radius: 5px;
  text-shadow: none;
  font-weight: bold;
}
#timer {
  position: absolute;
  right: 25px;
  top: 20px;
  font-size: 30px;
  font-weight: 900;
}
#shopping-list {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}
#shopping-list span {
  background: #fbf6df;
  color: #375664;
  padding: 12px 13px;
  border-radius: 5px;
  border-bottom: 6px solid #d7aa51;
  text-shadow: none;
  font-weight: bold;
}
#shopping-list .done {
  opacity: 0.4;
  text-decoration: line-through;
}
#message {
  position: absolute;
  top: 17%;
  left: 50%;
  transform: translateX(-50%);
  background: #182e36db;
  padding: 12px 24px;
  border-radius: 8px;
  max-width: 80%;
  text-align: center;
  transition: opacity 0.3s;
}
#message:empty {
  opacity: 0;
}
#prompt {
  position: absolute;
  left: 50%;
  bottom: 25%;
  transform: translateX(-50%);
  font-size: 19px;
  font-weight: bold;
  text-align: center;
  white-space: pre-line;
}
#reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 20px;
  opacity: 0.7;
}
#inventory {
  position: absolute;
  bottom: 45px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}
#inventory span {
  height: 65px;
  width: 78px;
  background: #fef9dbbb;
  border: 3px solid transparent;
  border-radius: 7px;
  color: #344d57;
  text-align: center;
  padding: 7px 3px;
  font-weight: 700;
  font-size: 12px;
  text-shadow: none;
}
#inventory .selected {
  border-color: #fff9df;
  box-shadow: 0 0 0 3px #deb45e;
}
#inventory b {
  display: block;
  font-size: 20px;
  margin-bottom: 4px;
}
#stamina {
  position: absolute;
  width: 180px;
  height: 7px;
  bottom: 124px;
  left: 50%;
  transform: translateX(-50%);
  background: #0005;
  border-radius: 8px;
  overflow: hidden;
}
#stamina i {
  display: block;
  width: 100%;
  height: 100%;
  background: #f2d66d;
}
#controls {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  white-space: nowrap;
  opacity: 0.9;
}
#version {
  position: absolute;
  bottom: 5px;
  right: 8px;
  opacity: 0.6;
  font-size: 10px;
}
dialog {
  background: #fffbea;
  color: #315363;
  border: 7px solid #ba8d58;
  border-radius: 12px;
  min-width: 300px;
  max-width: 90vw;
}
dialog::backdrop {
  background: #0009;
}
dialog button {
  background: #367e92;
  border: 0;
  border-radius: 4px;
  color: white;
  padding: 10px 20px;
  margin: 12px 5px 0;
}
dialog input {
  padding: 10px;
  border: 1px solid #b9af8b;
  width: 100%;
  margin: 6px 0;
}
button:focus-visible {
  outline: 3px solid #f7bb50;
  outline-offset: 3px;
}
@media (max-width: 650px) {
  .note {
    display: none;
  }
  .clipboard {
    width: 280px;
  }
  .clipboard button {
    font-size: 20px;
  }
  #controls {
    font-size: 9px;
    white-space: normal;
    width: 90%;
    text-align: center;
  }
  #shopping-list {
    top: 64px;
  }
  #inventory span {
    width: 56px;
    height: 58px;
  }
}

#objective {
  position: absolute;
  top: 115px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  background: #342e3399;
  padding: 8px 18px;
  border-radius: 6px;
}
#shopping-list span {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 12px;
  padding: 6px 12px;
}
#shopping-list img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}
#world:focus {
  outline: none;
}

@font-face {
  font-family: LP;
  src: url("/assets/fonts/darumadropone-regular.ttf");
}
@font-face {
  font-family: LPSans;
  src: url("/assets/fonts/niedermanngrotesk-regular.ttf");
}
.clipboard {
  background:
    url("/assets/textures/resources_assets_337.png") center/100% 100% no-repeat,
    url("/assets/textures/resources_assets_443.png") center/95% 100% no-repeat;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transform: none;
  width: 39vw;
  max-width: 530px;
  min-width: 340px;
  height: min(85vh, 780px);
  padding: 3vh 12% 6vh 4vw;
  position: relative;
}
.clipboard h1 {
  width: 30vw;
  max-width: 450px;
  height: 20vh;
  margin: 0 0 4vh;
}
.clipboard h1 img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(2px 2px 0 white) drop-shadow(-2px -2px 0 white);
}
.clipboard button {
  font-family: LP, sans-serif;
  font-size: clamp(21px, 2.8vw, 37px);
  white-space: nowrap;
  padding: 1vh 0;
  line-height: 1.6;
  min-width: 250px;
}
.clipboard button:before {
  display: inline-block;
  content: "";
  width: 22px;
  height: 22px;
  background: url("/assets/textures/resources_assets_421.png") center/contain
    no-repeat;
  margin-right: 3vw;
}
.clipboard button:hover:before {
  background-image: url("/assets/textures/resources_assets_277.png");
}
.clipboard small {
  position: absolute;
  left: 12%;
  bottom: 8%;
  font-size: 11px;
}
#menu {
  padding: 6vh 2vw;
  background: #0001;
}
.note {
  position: absolute;
  left: 34%;
  top: 4%;
  font-family: LP, sans-serif;
  background: url("/assets/textures/resources_assets_325.png") center/100% 100%
    no-repeat;
  border: 0;
  box-shadow: none;
  padding: 26px 30px;
  max-width: 310px;
}
.note small {
  font-family: Arial, sans-serif;
}
.clipboard button:hover {
  transform: translateX(5px);
}
@media (max-width: 700px) {
  .clipboard {
    width: 340px;
    padding: 20px 45px;
  }
  .clipboard h1 {
    width: 250px;
    height: 160px;
    margin-bottom: 10px;
  }
  .clipboard button {
    font-size: 23px;
    line-height: 1.8;
  }
  .clipboard button:before {
    margin-right: 24px;
  }
  .note {
    display: none;
  }
}

#waypoint {
  position: absolute;
  right: 24px;
  top: 85px;
  padding: 9px 16px;
  background: #7d943fcc;
  border: 2px solid #fff9bd;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 700;
}
.note {
  padding: 55px 30px 26px;
  top: 0;
  font-size: 20px;
}
.clipboard {
  padding-right: 5vw;
}
.clipboard button:before {
  filter: brightness(0.45) sepia(1) saturate(2) hue-rotate(135deg);
}

#result {
  position: absolute;
  inset: 30% 20%;
  z-index: 15;
  background: #f7f1d8ed;
  color: #24464d;
  border: 8px solid #be9a68;
  box-shadow: 0 8px 40px #0008;
  text-align: center;
  padding: 32px;
}
#result[hidden] {
  display: none;
}
#result button {
  display: block;
  margin: 18px auto;
  padding: 12px 24px;
  font: inherit;
  background: #fff5cf;
  border: 2px solid #668b78;
  cursor: pointer;
}

#world-status {
  position: absolute;
  left: 24px;
  top: 76px;
  font-size: 13px;
  color: #ffe3a3;
  text-shadow: 0 1px 3px #000;
}
#lesson-toast {
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  width: min(560px, 80vw);
  padding: 26px;
  background: #ece3cd;
  color: #27271f;
  box-shadow: 0 12px 60px #0009;
  pointer-events: auto;
  white-space: pre-line;
  line-height: 1.6;
}
#lesson-toast[hidden] {
  display: none;
}
#lesson-next {
  display: block;
  margin: 16px auto 0;
}

#surveillance {
  position: absolute;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: #102823e8;
  color: #d7ffe9;
  padding: 12px 24px;
  border: 1px solid #77b99d;
  text-align: center;
  pointer-events: none;
}
#surveillance span {
  display: block;
  margin-top: 5px;
  font-size: 12px;
}
