/* apply a natural box layout model to all elements, but allowing components to change */
html {
  box-sizing: border-box;
}
*,
*:before,
*:after {
  box-sizing: inherit;
}

@font-face {
  font-family: "Atkinson Hyperlegible Mono";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/Atkinson-Hyperlegible-Mono-Italic-1.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Atkinson Hyperlegible Mono";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/Atkinson-Hyperlegible-Mono-Italic-2.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Atkinson Hyperlegible Mono";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/Atkinson-Hyperlegible-Mono-1.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Atkinson Hyperlegible Mono";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/Atkinson-Hyperlegible-Mono-2.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

body {
  /*font-family: "JetBrains Mono";
  font-optical-sizing: auto;*/
  font-family: "Atkinson Hyperlegible Mono", sans-serif;
  font-optical-sizing: auto;
  background-color: var(--bg);
  font-size: 10px;
  line-height: 1.25em;
  color: var(--bg2);
  padding: 0;
  margin: 0px;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gamecontainer {
  display: flex;
  flex-direction: row;
  justify-content: stretch;
  align-items: stretch;
  margin: 0 auto;
  width: calc(100% - 2rem);
  max-width: 1400px;
  height: calc(100% - 2rem);
  max-height: 600px;
  position: relative;
}

.mapcontainer {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  content-visibility: auto;
  contain: strict;
  box-shadow: inset 0 0 10rem var(--fg1), inset -0.5rem 0 0.75rem 0 var(--fg4);
  background-color: var(--fg);
  overflow: hidden;
  border-radius: 8px 0 0 8px;
  position: relative;
}

.logcontainer_outer {
  width: 50%;
  max-width: calc(70ch + 6rem);
  min-width: 320px;
  height: 100%;
  background: var(--fg);
  box-shadow: inset 0 0 8rem var(--fg1);
  z-index: 4;
  border-radius: 0 8px 8px 0;
  position: relative;
}

.logcontainer {
  padding: 1rem 0;
  overflow-y: scroll;
  border-radius: 0;
  position: absolute;
  top: 1rem;
  bottom: 1rem;
  left: 0;
  right: 0.5rem;
  scrollbar-color: var(--fg4) var(--fg1);
}

.logcontainer .log {
  width: calc(100% - 1rem);
  margin: 0rem 1rem 1rem 0;
  padding: 0.25rem 0rem 0.25rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-left: 0.25rem solid var(--bg4);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  scroll-margin-bottom: 1rem;
}

.logcontainer .log.undefined {
  margin: 0;
  padding: 0 0 0 1.25rem;
  border-left: 0px hidden transparent;
}

.logcontainer .log.input {
  width: calc(100% - 3rem);
  margin: 0 1rem 1rem 2rem;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-style: italic;
  border-left: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--fg1);
  border-radius: 0 1rem 0 0;
}

.logcontainer .log .header {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--bg4);
}

.logcontainer .log.kid {
  border-left: 0.25rem solid var(--yellow);
}
.logcontainer .log.kid .header {
  color: var(--yellow-dim);
}

.logcontainer .log.hope {
  border-left: 0.25rem solid var(--green);
}
.logcontainer .log.hope .header {
  color: var(--green-dim);
}

.logcontainer .log.rebel {
  border-left: 0.25rem solid var(--red);
}
.logcontainer .log.rebel .header {
  color: var(--red-dim);
}

.logcontainer .log.romantic {
  border-left: 0.25rem solid var(--purple);
}
.logcontainer .log.romantic .header {
  color: var(--purple-dim);
}

.logcontainer .log.cynic {
  border-left: 0.25rem solid var(--gray-dim);
}
.logcontainer .log.cynic .header {
  color: var(--gray);
}

.logcontainer .log.practical {
  border-left: 0.25rem solid var(--blue);
}
.logcontainer .log.practical .header {
  color: var(--blue-dim);
}

.logcontainer .log.gotitem {
  border-left: none;
  background-color: color(from var(--aqua) srgb r g b / 0.25);
  border-radius: 1rem;
  border: 0.125rem solid var(--aqua-dim);
  width: calc(100% - 2rem);
  margin: 1rem;
  padding: 0.75rem 1rem;
  gap: 0;
}

.logcontainer .log.gotitem .header {
  color: var(--aqua-dim);
}

.logcontainer .log.lostitem {
  border-left: none;
  background-color: color(from var(--red) srgb r g b / 0.25);
  border-radius: 1rem;
  border: 0.125rem solid var(--red-dim);
  width: calc(100% - 2rem);
  margin: 1rem;
  padding: 0.75rem 1rem;
  gap: 0;
}

.logcontainer .log.lostitem .header {
  color: var(--red-dim);
}

.logcontainer .log .choice {
  font-weight: 800;
  font-size: 0.9rem;
  margin: -0.25rem;
  padding: 0.25rem 0.25rem 0.25rem 1rem;
  color: var(--blue-dim);
  cursor: pointer;
  transition: 0.2s all linear;
  position: relative;
}

.logcontainer .log .choice::after {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 0.5rem;
  width: 0;
  height: 0;
  border-top: 0.35rem solid transparent;
  border-bottom: 0.35rem solid transparent;
  border-left: 0.35rem solid var(--blue-dim);
  transition: 0.2s border-left linear;
}

.logcontainer .log .choice:hover {
  /*text-decoration: underline;*/
  background: var(--blue);
  color: var(--fg);
}
.logcontainer .log .choice:hover::after {
  border-left: 0.35rem solid var(--fg);
}

.maplayer {
  contain: strict;
  content-visibility: auto;
  transition: opacity 0.8s linear;
}

.maplayer.hidden {
  opacity: 0;
}

.mapcontainer .cell {
  display: block;
  position: absolute;
  text-align: center;
  overflow: hidden;
  background-color: transparent;
  border: none;
}

.mapcell.player {
  font-size: 1.5em;
  font-weight: 800;
}

.mapcell.water div {
  animation: anim_4_frames 2s linear both infinite;
}

.mapcell.smoke div {
  animation: anim_4_frames 1s linear both infinite;
}

.mapcell.fire {
  border-bottom: 0.25em dotted var(--bg4);
}

.mapcell.fire div {
  animation: anim_4_frames 0.5s linear both infinite;
}

/*.mapcell.water::after {
  display: block;
  content: "∽";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  animation: water_after 1s linear both infinite;
}

.mapcell.water::before {
  display: block;
  content: "~";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  animation: water_main 1s linear both infinite;
}*/

.mapcontainer .mapcell_actor {
  font-weight: 700;
  transition: top 0.1s 0s cubic-bezier(0.64, 0.57, 0.67, 1.53),
    left 0.1s 0s cubic-bezier(0.64, 0.57, 0.67, 1.53);
  /*color: #fff !important;*/
  color: #282828;
}

p {
  font-size: 1em;
  line-height: 1.4em;
  margin: 0 0 1em;
}

.column {
  display: flex;
  flex-direction: column;
}

.row {
  display: flex;
  flex-direction: row;
}

.text.square .cell {
  width: 0.5em;
  height: 1em;
  line-height: 1em;
  font-size: 1em;
  display: block;
}

/* ANIMATION */

.fadeup {
  animation: fadeup 0.5s ease-out;
}

.nudge-up {
  animation: nudge-up 0.3s ease-out;
}
.nudge-right {
  animation: nudge-right 0.3s ease-out;
}
.nudge-down {
  animation: nudge-down 0.3s ease-out;
}
.nudge-left {
  animation: nudge-left 0.3s ease-out;
}

@keyframes anim_4_frames {
  0% {
    transform: translateY(0);
  }

  24.9% {
    transform: translateY(0);
  }
  25% {
    transform: translateY(-25%);
  }
  49.9% {
    transform: translateY(-25%);
  }
  50% {
    transform: translateY(-50%);
  }
  74.9% {
    transform: translateY(-50%);
  }
  75% {
    transform: translateY(-75%);
  }
  100% {
    transform: translateY(-75%);
  }
}

@keyframes water_before {
  0% {
    opacity: 0;
  }

  24% {
    opacity: 0;
  }

  25% {
    opacity: 1;
  }

  49% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }

  74% {
    opacity: 0;
  }

  75% {
    opacity: 1;
  }

  99% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@keyframes water_after {
  0% {
    opacity: 0;
  }

  49% {
    opacity: 0;
  }

  50% {
    opacity: 1;
  }

  74% {
    opacity: 1;
  }

  75% {
    opacity: 0;
  }

  100% {
    opacity: 0;
  }
}

@keyframes fadeup {
  0% {
    opacity: 0;
    transform: scaleY(0);
  }
  31% {
    opacity: 0;
    transform: translateY(0.5em);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes blurcycle {
  0% {
    filter: blur(0.01rem);
  }

  30% {
    filter: blur(0.03rem);
  }

  60% {
    filter: blur(0.02rem);
  }

  80% {
    filter: blur(0.04rem);
  }

  100% {
    filter: blur(0.01rem);
  }
}

::-webkit-scrollbar-thumb:hover,
::-webkit-scrollbar-button:hover {
  background-color: var(--fg3);
  cursor: pointer;
}

/* Responsive */
@media (orientation: portrait) {
  /* For portrait view */
  .gamecontainer {
    flex-direction: column;
    position: absolute;
    top: 1rem;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    border-radius: 0.5rem;
    width: unset;
    height: unset;
    max-width: unset;
    max-height: unset;
  }

  .mapcontainer {
    width: 100%;
    height: 50%;
    border-radius: 0;
    /*box-shadow: inset 0 0 10rem var(--fg1), inset 0 -0.5rem 0.75rem 0 var(--fg4);*/
    box-shadow: none;
  }

  .logcontainer_outer {
    width: 100%;
    max-width: unset;
    height: 60%;
    border-radius: 0;
  }

  .logcontainer {
    width: 100%;
    border-radius: 0;
    font-size: 2rem;
  }
}
