@font-face {
  font-family: "pixel";
  src: url("/fonts/pixel.ttf") format("truetype");
}

@font-face {
  font-family: "04b_03";
  src: url("/fonts/04b_03.ttf") format("truetype");
}

.hidden {
  display: none !important;
}

.story-mode {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  z-index: 1000;
  overflow: hidden;
  display: block;
  pointer-events: none;

  transition:
    scale 0.5s ease,
    transform 0.5s ease;

  --wbg-width: 100%;
  --wbg-height: 100%;
  --wbg-transform: unset;
}

.story-mode.wbg::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: var(--wbg-width);
  height: var(--wbg-height);
  pointer-events: auto;
  transition:
    width 0.5s ease,
    height 0.5s ease,
    transform 0.5s ease;
  transform: var(--wbg-transform);

  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

body:has(.story-mode.wbg),
html:has(.story-mode.wbg) {
  overflow: hidden;
}

.story-mode #moma {
  position: absolute;
  bottom: 0;
  right: calc(50vh / -3.5);
  height: 50vh;
  width: auto;
  aspect-ratio: 1 / 1;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.story-mode .dialog {
  opacity: 0;
  position: absolute;
  bottom: calc(50vh - 65px);
  right: 140px;
  margin-left: 10px;
  padding: 5px 10px;
  background-color: transparent;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border-style: solid;
  border-width: 10px;
  border-image-source: url("/images-ext/aseprite/dialog-bg.png");
  border-image-slice: 2 fill;
  border-image-repeat: repeat;
}

.story-mode .dialog::after {
  content: "";
  position: absolute;
  bottom: -31px;
  right: 0px;
  width: 30px;
  height: 30px;
  background-image: url("/images-ext/aseprite/dialog-arrow.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  image-rendering: pixelated;
}

.story-mode .text {
  font-family: "pixel", "04b_03", sans-serif;
  letter-spacing: 1px;
  color: black;
  max-width: 380px;
  font-size: clamp(1.5rem, 2vw, 2.5rem);
  word-spacing: -3px;

  line-height: normal;

  user-select: none;
  pointer-events: none;
}

.story-mode .options {
  height: 0px;
  display: flex;
  gap: 10px;
  margin-top: 10px;
  overflow: hidden;
  pointer-events: auto;
}

.story-mode .options button:nth-of-type(3) {
  display: none;
}

.story-mode .options.ctn button {
  display: none;
}

.story-mode .options.ctn button:nth-of-type(3) {
  display: block !important;
}

.story-mode .options button {
  font-family: "pixel", "04b_03", sans-serif;
  outline: none;
  appearance: none;
  font-size: clamp(1.5rem, 1.8vw, 2rem);
  color: black;
  letter-spacing: 1px;
  padding: 3px 6px;
  background: transparent;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border-style: solid;
  border-width: 10px;
  border-image-source: url("/images-ext/aseprite/dialog-bg.png");
  border-image-slice: 2 fill;
  border-image-repeat: repeat;
  cursor: pointer !important;
}

@keyframes showOptions {
  from {
    height: 0px;
  }
  to {
    height: 55px;
  }
}
@keyframes hideOptions {
  from {
    height: 55px;
  }
  to {
    height: 0px;
  }
}
@keyframes showDialog {
  from {
    opacity: 0;
    scale: 0;
    right: 60px;
    bottom: calc(50vh - 180px);
  }
  to {
    opacity: 1;
    scale: 1;
    right: 140px;
    bottom: calc(50vh - 65px);
  }
}
@keyframes hideDialog {
  from {
    opacity: 1;
    scale: 1;
    right: 140px;
    bottom: calc(50vh - 65px);
  }
  to {
    opacity: 0;
    scale: 0;
    right: 60px;
    bottom: calc(50vh - 180px);
  }
}

/* Modal */
.sm-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 2px solid var(--primary-color);
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.sm-modal .modal-content {
  position: relative;
  padding: 20px;
  margin: 20px;
  text-align: center;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border-style: solid;
  border-width: 10px;
  border-image-source: url("/images-ext/aseprite/dialog-bg.png");
  border-image-slice: 2 fill;
  border-image-repeat: repeat;
}

.sm-modal .modal-content img {
  position: absolute;
  bottom: 5px;
  right: -85px;
  height: 150px;
  width: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.sm-modal .modal-text {
  font-family: "pixel", "04b_03", sans-serif;
  font-size: 1.5rem;
  color: var(--text-color);
  margin-bottom: 20px;
}

.sm-modal button {
  font-family: "pixel", "04b_03", sans-serif;
  outline: none;
  appearance: none;
  font-size: clamp(1.5rem, 1.8vw, 2rem);
  color: black;
  letter-spacing: 1px;
  padding: 3px 6px;
  background: transparent;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border-style: solid;
  border-width: 10px;
  border-image-source: url("/images-ext/aseprite/dialog-bg.png");
  border-image-slice: 2 fill;
  border-image-repeat: repeat;
  cursor: pointer !important;
}

.sm-modal button:nth-of-type(2) {
  margin-top: 10px;
  border: none;
  font-size: clamp(1.2rem, 1.4vw, 1.6rem);
  color: #000000aa;
}
