html, body {
  margin: 0;
  height: 100%;
  background: black;
  /*background: url(https://lilithdev.neocities.org/shrine/vg/omori/sprites/bg/starbg.png);*/
  /*background: url("https://www.spriters-resource.com/resources/sheets/198/201053.png?updated=1689050968");
  background-size: 33.33%;*/
  /*image-rendering: pixelated;*/
}

body {
  background-attachment: scroll;
  /*background-image: url("./sprites/border/border_default.png");*/
  background-image: var(--border-image);
  background-position: center center;
  background-size: calc(var(--fit-container-scale) * 960px);
  background-repeat: no-repeat;
}

#meta-menu {
  /*width: 32px;*/
  z-index: 100;
  position: absolute;
  left: 16px;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  opacity: 0.25;
  align-items: flex-start;
  transition: opacity 1s;
}
#meta-menu:hover {
  opacity: 1;
}

.meta-menu-option {
  height: 32px;
}

#meta-menu-volume {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
}
#meta-menu-volume:hover > #volume-slider {
  display: initial !important;
  opacity: 1;
  pointer-events: initial;
}

#volume-slider {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
}

.custom-slider {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 5px;
  /*border: black solid 2px;*/
  background: white;
  outline: none;
  opacity: 0.7;
  -webkit-transition: .2s;
  transition: opacity .2s;
}

.custom-slider:hover {
  opacity: 1;
}

.custom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: white;
  border: black solid 1px;
  /*border-color: black;*/
  cursor: pointer;
}

.custom-slider::-moz-range-thumb {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: white;
  border: black solid 1px;
  /*border-color: black;*/
  cursor: pointer;
}

/*#meta-menu > *::before {
  position: relative;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 100%;
  background: grey;
  border-radius: 16px;
}*/

#meta-info {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /*width: 352px;
  height: 85px;*/
  width: 100%;
  max-width: min(640px, calc(100% - 60px));
  height: auto;
  max-height: calc(480px);
  /*max-width: 960px;*/
  border: 3px solid white;
  color: #FFFFFF;
  /*padding: 8px;*/
  font-family: "Omori Normal";
  background: black;
  font-size: 32px;
  /*margin: 8px;*/
  box-shadow: 0px 0px 0 1px black;

  overflow: auto;

  /* corrected */
  font-size: 50px;
  /*line-height: 0.5em;*/
  z-index: 999999;
  /*letter-spacing: -0.4px;
  line-height: 28px;
  z-index: 5;*/

  padding: 16px;
}

.meta-info-section {
  font-size: 1.5em;
  font-weight: bold;
  text-align: center;
}

#screen {
  background: var(--battle-background);
  /*background: url("./sprites/bg/battleback_dw_highway.png");*/
  /*background: url("./sprites/screenshot/battle_scenario.png");*/
  /*background: url("https://i.redd.it/7r1j92uazc4d1.gif");*/
  /*width: 1280px;
  height: 960px;*/
  width: 640px;
  height: 480px;
  background-size: 100%;
  /*background-position: 0 20px;*/
  position: relative;
  overflow: clip;
  /*image-rendering: pixelated;*/
  /*box-shadow: 0 0 20px 8px black;*/
  /*scale: calc(100vw / 1920);*/
  /*border: 8px ridge white;*/
}

.screen-layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.screen-layer > * {
  pointer-events: initial;
}

#screen-battle {
  background: inherit;
  width: 640px;
  height: 480px;
  background-size: 100%;
}

#screen-loading {
  z-index: 99999;
  /*background: url("./sprites/system/loading.png");
  background-size: cover;*/
  background: black;
  transition: opacity 0.2s;
  pointer-events: initial;
}
#screen-loading.hide {
  opacity: 0;
  pointer-events: none;
}
#screen-loading-logo {
  position: absolute;
  right: 18px;
  bottom: 13px;
}

#screen-gameover {
  z-index: 99998;
  /*background: url("./sprites/system/loading.png");
  background-size: cover;*/
  background: black;
  /*transition: opacity 5s;
  opacity: 0;*/
  /*pointer-events: initial;*/

  color: #FFFFFF;
  font-family: "Omori Normal";
  font-size: 25px;
  letter-spacing: -0.4px;
  line-height: 28px;
}
#gameover-text {
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  animation-name: gameover-logo;
  /*animation-duration: 500ms;*/
  animation-duration: 2s;
  animation-timing-function: step-end;
  animation-iteration-count: infinite;
  opacity: 0;
}
@keyframes gameover-logo {
  0% {
    transform: translate(-50%, -50%);
  }

  25% {
    transform: translate(-50%, calc(-50% - 3px));
  }

  50% {
    transform: translate(-50%, -50%);
  }

  75% {
    transform: translate(-50%, calc(-50% + 3px));
  }
}
#gameover-message {
  position: absolute;
  left: 50%;
  bottom: 24.5%;
  transform: translateX(-50%);
  letter-spacing: 0.2px;
}
#gameover-menu {
  position: absolute;
  left: 50%;
  bottom: 69px;
  transform: translateX(calc(-50% - 3px));
  display: flex;
  flex-direction: row;
  gap: 50px;
  opacity: 0;
}
#gameover-menu > * {
  border: 3px solid white;
  padding: 0px 6px;
  letter-spacing: 0px;
  line-height: 24px;
  position: relative;
}
#gameover-menu > *::before {
  left: 0;
  transform: translate(-130%, -50%);
}

#screen-lowhealth {
  pointer-events: none;
  background: url("../images/battle_lowhealth.png");
  animation-name: screen-lowhealth;
  animation-duration: 0.5s;
  animation-iteration-count: infinite;
  z-index: 50;
  /*animation-timing-function: ;*/
}
@keyframes screen-lowhealth {
  0% {
    opacity: 0;
  }

  50% {
    opacity: 0.5;
  }
  
  100% {
    opacity: 0;
  }
}

.fit-container {
  position: relative;
  top: 50%;
  left: 50%;
  transform: scale(var(--fit-container-scale)) translate(-50%, -50%);
  transform-origin: top left;
}

/**:has(.fit-container) {
  overflow: clip;
}*/

characterbox {
  display: none;
  z-index: 5;
}

characterbox.selected::before, characterbox.action-hovered::before {
  content:"";
  background: url("../images/target_selected.png");
  width: 138px;
  height: 178px;
  position: absolute;
  left: 50%;
  top: calc(50% - 1px);
  transform: translate(-50%,-50%);
  z-index: 1;
  animation-name: portrait-selected;
  animation-duration: 800ms;
  animation-direction: alternate;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
  image-rendering: crisp-edges;
}

@keyframes portrait-selected {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

/*.action-hovered::before {
  content:"";
  background: url("../images/cursor.png");
  width: 29px;
  height: 15px;
  position: absolute;
  top: calc(50% + 1px);
  left: 16%;
  transform: translate(-50%, -50%);
  animation-name: cursor-bounce;
  animation-duration: 500ms;
  animation-direction: alternate;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
  image-rendering: crisp-edges;
}

@keyframes cursor-bounce {
  from {
    transform: translate(calc(-50% - 4px), -50%);
  }

  to {
    transform: translate(calc(-50% + 4px), -50%);
  }
}*/

#player-down-left {
  position: absolute;
  left: 14px;
  bottom: 11px;
}

#player-up-left {
  position: absolute;
  left: 14px;
  top: 14px;
}

#player-down-right {
  position: absolute;
  right: 14px;
  bottom: 11px;
}

#player-up-right {
  position: absolute;
  right: 14px;
  top: 14px;
}

characterbox {
  display: none !important;
}
characterbox.show {
  display: flex !important;
}

.follow-up-parent {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  z-index: 15;
}

.follow-up-bubble {
  position: absolute;
  width: 128px;
  height: 97px;
  background: var(--bubble-sprite);
}
.follow-up-bubble.disabled {
  opacity: 0.6;
}

.follow-up-bubble::after {
  position: absolute;
  width: 32px;
  height: 29px;
  background: url("../images/directional_cursor.png");
  content: "";

  animation-name: follow-up-hand;
  animation-duration: 400ms;
  animation-direction: alternate;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
  animation-composition: add;
  image-rendering: crisp-edges;

  --follow-up-hand-x: 0px;
  --follow-up-hand-y: 0px;
}
.follow-up-bubble.disabled::after {
  animation-name: none;
  filter: grayscale();
}

@keyframes follow-up-hand {
  from {
    transform: translate(calc(-var(--follow-up-hand-x)), calc(-var(--follow-up-hand-y)));
  }

  to {
    transform: translate(calc(var(--follow-up-hand-x)), calc(var(--follow-up-hand-y)));
  }
}

.follow-up-bubble[direction="down"]::after {
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 25%);
  background-position-x: calc(0 * 32px);
  --follow-up-hand-y: 4px;
}
.follow-up-bubble[direction="right"]::after {
  right: 0;
  top: 50%;
  transform: translate(25%, -50%);
  background-position-x: calc(-1 * 32px);
  --follow-up-hand-x: 4px;
}
.follow-up-bubble[direction="left"]::after {
  left: 0;
  top: 50%;
  transform: translate(-25%, -50%);
  background-position-x: calc(-2 * 32px);
  --follow-up-hand-x: -4px;
}
.follow-up-bubble[direction="up"]::after {
  left: 50%;
  top: 0;
  transform: translate(-50%, -25%);
  background-position-x: calc(-3 * 32px);
  --follow-up-hand-y: -4px;
}

.heart-icon {
  background: url("../images/hp_icon.png");
  width: 16px;
  height: 16px;
}

.juice-icon {
  background: url("../images/mp_icon.png");
  width: 16px;
  height: 16px;
}

/*#player-up-left .portrait, #player-down-right .portrait, #player-up-right .portrait {
  filter: grayscale() brightness(110%);
}*/

.enemy {
  position: absolute;
  /*bottom: -10px;*/
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  /*z-index: -1;*/
  /*display: none;*/
}

.enemy.action-hovered {
  /*filter: saturate(0.6) brightness(1.2);*/
  animation-name: enemy-selected;
  animation-duration: 0.6s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes enemy-selected {
  0% {
  }

  50% {
    /*filter: saturate(0.6) brightness(1.2);*/
    /*filter: saturate(0.7) brightness(1.3);*/
    filter: contrast(0.7) brightness(1.2);
  }

  100% {
  }
}

#action-section {
  display: flex;
  flex-direction: column;
  /*gap: 3px;*/
  gap: 1px;
  position: absolute;
  bottom: 9px;
  left: 50%;
  transform: translate(-50%);
  z-index: 5;
}

.action-subsection {
  /*position: absolute;*/
  /* To account for action-section gap and remove from content flow */
  top: calc(100% + 1px);
}

/*#action-section.unfold {
  bottom: calc(9px - 84px);
  animation-name: action-section-unfold;
  animation-duration: 200ms;
  animation-timing-function: ease-out;
  animation-fill-mode: forwards;
}*/

#action-section.unfold > #party-action {
  display: flex;
}

@keyframes action-section-unfold {
  from {
    bottom: calc(9px - 84px);
  }

  to {
    bottom: 9px;
  }
}

#party-action {
  /*visibility: hidden;*/
  display: flex;
  /*display: none;*/
  flex-direction: column;
  gap: 5px;
}

.action-hovered::before {
  content:"";
  background: url("../images/cursor.png");
  width: 29px;
  height: 15px;
  position: absolute;
  top: calc(50% + 1px);
  left: 16%;
  transform: translate(-50%, -50%);
  animation-name: cursor-bounce;
  animation-duration: 500ms;
  animation-direction: alternate;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
  animation-composition: add;
  image-rendering: crisp-edges;
}

@keyframes cursor-bounce {
  from {
    transform: translate(-4px, 0);
  }

  to {
    transform: translate(calc(4px), 0);
  }
}

/*#friend-action {
  visibility: hidden;
  display: flex;
  display: none;
  flex-direction: column;
  gap: 5px;
}*/

#party-action-fight, #party-action-run {
  width: 360px;
  height: 39px;
  position: relative;
}

#party-action-fight {
  background: url("../images/button_fight_1.png")
}
#party-action-run {
  background: url("../images/button_run.png")
}

.bs #party-action-fight {
  background: url("../images/button_fight.png")
}
.bs #party-action-run {
  background: url("../images/button_run_1.png")
}

#friend-action {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  row-gap: 4px;
  width: calc(100% + 2px);
  margin-bottom: 1px;
  /*gap: 5px;*/
}

#friend-action-attack, #friend-action-skill, #friend-action-snack, #friend-action-toy {
  width: 179px;
  height: 39px;
  position: relative;
}

#friend-action-attack {
  background: url("../images/button_attack_1.png");
}
#friend-action-skill {
  background: url("../images/button_skill.png");
}
#friend-action-snack {
  background: url("../images/button_snack.png");
}
#friend-action-toy {
  background: url("../images/button_toy.png");
}

.bs #friend-action-attack {
  background: url("../images/button_attack.png");
  width: 360px;
  height: 39px;
}
.bs #friend-action-skill {
  background: url("../images/button_skill_1.png");
  width: 360px;
  height: 39px;
}
.bs #friend-action-snack {
  display: none;
}
.bs #friend-action-toy {
  display: none;
}

characterbox,#stress-bar,#log {
  transition: filter 0.5s;
}

.dialog-darken characterbox, .dialog-darken #action-section > *:not(#dialog-box):not(#choice-box), .dialog-darken #log {
  filter: brightness(0.5);
}

#choice-box {
  /*height: 88px;*/
  border: 3px solid white;
  color: #FFFFFF;
  padding: 8px;
  /*padding-top: 15px;*/
  font-family: "Omori Normal";
  background: black;
  box-shadow: 0px 0px 0 1px black;
  /*font-size: 25px;*/
  /*font-size: 28px;*/
  font-size: 25px;
  /*letter-spacing: -0.4px;*/
  line-height: 25px;
  margin-bottom: 7px;
  margin-left: 1px;
  margin-right: 1px;
  /*adding-left: 14px;
  padding-right: 14px;*/
  transform-origin: center;
  position: relative;

  width: fit-content;
  position: relative;
  left: 100%;
  transform: translateX(-100%);
}

.choice-item {
  padding-left: 32px;
  position: relative;
}

#dialog-box {
  width: calc(360px - 18px * 2);
  /*width: 360px;*/
  height: 88px;
  border: 3px solid white;
  color: #FFFFFF;
  padding: 8px;
  font-family: "Omori Normal";
  background: black;
  box-shadow: 0px 0px 0 1px black;
  /*font-size: 25px;*/
  font-size: 28px;
  /*letter-spacing: -0.4px;*/
  line-height: 28px;
  margin-bottom: 7px;
  margin-left: 1px;
  margin-right: 1px;
  padding-left: 14px;
  padding-right: 14px;
  transform-origin: center;
  position: relative;
}

#dialog-box {
  height: 88px;
  border: 3px solid white;
  color: #FFFFFF;
  padding: 8px;
  font-family: "Omori Normal";
  background: black;
  box-shadow: 0px 0px 0 1px black;
  /*font-size: 25px;*/
  font-size: 28px;
  /*letter-spacing: -0.4px;*/
  line-height: 28px;
  margin-bottom: 7px;
  margin-left: 1px;
  margin-right: 1px;
  padding-left: 14px;
  padding-right: 14px;
  transform-origin: center;
  position: relative;
}

#dialog-box.next::before {
  content:"";
  background: url("../images/cursor.png");
  width: 29px;
  height: 15px;
  position: absolute;
  bottom: 6px;
  right: 20px;
  /*transform: translate(-50%, -50%);*/
  animation-name: cursor-bounce-dialog;
  animation-duration: 1s;
  animation-direction: alternate;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
  image-rendering: crisp-edges;
}

@keyframes cursor-bounce-dialog {
  from {
    transform: translateX(-4px);
  }

  to {
    transform: translateX(4px);
  }
}

#dialog-box.tail::after {
  content:"";
  background: url("../images/battle_speech_tail.png");
  width: 26px;
  height: 17px;
  position: absolute;
  top: -17px;
  left: 50%;
  transform: translateX(-50%);
  /*transform: translate(-50%, -50%);*/
  /*image-rendering: crisp-edges;*/
}

#stress-bar {
  background: url("../images/stress_bar0.png");
  width: 360px;
  height: 45px;
  margin-bottom: 2px;
  /*position: absolute;
  left: 50%;
  bottom: 11px;
  transform: translate(-50%);*/
}

#stress-bar[stress="0"],
#stress-bar[stress="1"],
#stress-bar[stress="2"] {
  background: url("../images/stress_bar0.png");
}
#stress-bar[stress="3"],
#stress-bar[stress="4"] {
  background: url("../images/stress_bar1.png");
}
#stress-bar[stress="5"],
#stress-bar[stress="6"] {
  background: url("../images/stress_bar2.png");
}
#stress-bar[stress="7"],
#stress-bar[stress="8"],
#stress-bar[stress="9"] {
  background: url("../images/stress_bar3.png");
}
#stress-bar[stress="10"] {
  background: url("../images/stress_bar4.png");
}

#stress-bar-inner {
  margin: 10px 10px 9px 10px;
  /*background: red;*/
  width: calc(100% - 10 * 2px);
  height: calc(100% - 10px - 9px);
  display: flex;
  gap: 5px;
  overflow: clip;
  position: relative;
}

#stress-bar-cosmetic {
  display: relative;
  flex-grow: 1;
  background: url("./sprites/stress_beep06.png");
  background-position: center 0 !important;
  background-repeat: no-repeat !important;
  /*background: red;*/
  animation-duration: 5s;
  animation-timing-function: linear;
  animation-name: stress-bar-cosmetic-slide;
  clip-path: inset(0 100% 0 -10%);
  animation-iteration-count: infinite;
  --slice-size: 40px;
  /*background: green;*/
}

@keyframes stress-bar-cosmetic-slide {
  from {
    /*clip-path: inset(0 calc(0% - var(--slice-size)) 0 0%);*/
    clip-path: inset(0 100% 0 calc(0% - var(--slice-size)));
  }
  
  to {
    /*clip-path: inset(0 100% 0 calc(100% + var(--slice-size)));*/
    clip-path: inset(0 calc(0% - var(--slice-size)) 0 100%);
  }
}

#stress-bar[stress="0"] #stress-bar-cosmetic {
  background: url("../images/stress_beep0.png");
}
#stress-bar[stress="1"] #stress-bar-cosmetic {
  background: url("../images/stress_beep1.png");
}
#stress-bar[stress="2"] #stress-bar-cosmetic {
  background: url("../images/stress_beep2.png");
}
#stress-bar[stress="3"] #stress-bar-cosmetic {
  background: url("../images/stress_beep3.png");
}
#stress-bar[stress="4"] #stress-bar-cosmetic {
  background: url("../images/stress_beep4.png");
}
#stress-bar[stress="5"] #stress-bar-cosmetic {
  background: url("../images/stress_beep5.png");
}
#stress-bar[stress="6"] #stress-bar-cosmetic {
  background: url("../images/stress_beep6.png");
}
#stress-bar[stress="7"] #stress-bar-cosmetic {
  background: url("../images/stress_beep7.png");
}
#stress-bar[stress="8"] #stress-bar-cosmetic {
  background: url("../images/stress_beep8.png");
}
#stress-bar[stress="9"] #stress-bar-cosmetic {
  background: url("../images/stress_beep9.png");
}
#stress-bar[stress="10"] #stress-bar-cosmetic {
  background: url("../images/stress_beep10.png");
}

#stress-bar-number {
  aspect-ratio: 1/1;
  /*background: blue;*/

  color: white;
  font-family: "Omori Normal";
  text-align: center;
  font-size: 30px;
  /*line-height: 28px;*/
  /*padding: 0 7px;*/
  transform: translateY(-3px);
  --shadow-color: rgba(0, 0, 0, 0.8);
  --shadow: 1px;
  text-shadow: -1px -1px var(--shadow) var(--shadow-color), 0 -1px var(--shadow) var(--shadow-color), 1px -1px var(--shadow) var(--shadow-color), 1px 0 var(--shadow) var(--shadow-color), 1px 1px var(--shadow) var(--shadow-color), 0 1px var(--shadow) var(--shadow-color), -1px 1px var(--shadow) var(--shadow-color), -1px 0 var(--shadow) var(--shadow-color);
  white-space: nowrap;
}

#log {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%);
  width: 352px;
  height: 85px;
  /*max-width: 960px;*/
  border: 3px solid white;
  border-top: 0;
  color: #FFFFFF;
  /*padding: 8px;*/
  font-family: "Omori Normal";
  background: black;
  font-size: 32px;
  /*margin: 8px;*/
  box-shadow: 0px 0px 0 1px black;

  /* corrected */
  font-size: 25px;
  letter-spacing: -0.4px;
  line-height: 28px;
  z-index: 5;
}

.inner-log {
  position: absolute;
  left: 1px;
  top: 0;
  width: calc(100% - 2px - 10px * 2);
  height: calc(100% - 1px + 2px);
  margin: -2px 10px;
  overflow-y: hidden;
  /*background:red;*/
}

.log-action-line {
  animation-duration: 200ms;
  animation-name: fade-in;
  animation-timing-function: linear;
}

#log-skill {
  margin: 2px 6px;
  width: calc(100% - 6px * 2);
  height: calc(100% - 2px * 2);
  /* TODO: fix, shouldn't use margin or it'd fuck up images for items*/
}

#log-skill-name {
  font-size: 28px;
  letter-spacing: -0.4px;
}

#log-skill-desc {
  font-size: 22px;
  line-height: 21px;
  letter-spacing: -0.7px;
}

#item-icon {
  position: absolute;
  width: 80px;
  height: 80px;
  right: 0;
  top: 0;
  background-size: contain;
  /*image-rendering: smooth;*/
}

#skill-menu {
  width: calc(360px - 2px);
  height: calc(95px - 1px);
  background: black;
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translate(-50%, 100%);
  border: white solid 3px;
  border-bottom: 0;
  box-sizing: border-box;
  box-shadow: 0px 0px 0 1px black;

  color: #FFFFFF;
  font-family: "Omori Normal";
  font-size: 25px;
  letter-spacing: -0.4px;
  line-height: 28px;

  display: flex;
  flex-direction: column;

  transition: transform 200ms;

  z-index: 10;
}

#skill-menu-header {
  height: 28px;
  border-bottom: white solid 2px;
  font-size: 22px;
  padding-left: 6px;
  white-space:pre;
}

#skill-menu-body {
  padding-top: 15px;
  padding-bottom: 9px;
  flex-grow: 1;
  min-height: 0;

  padding-top: 13px;
  padding-bottom: 10px;

  position: relative;
}

#skill-menu-list {
  width: 100%;
  /*height: 100%;*/
  max-height: 100%;
  display: flex;
  gap: 4px;
  row-gap: 11px;
  flex-wrap: wrap;
  overflow: hidden;

  gap: 0px;
  row-gap: 5px;
}

.skill-menu-item {
  /*font-size: 22px;*/
  height: 13px;
  /*line-height: 13px;*/
  /*line-height: 10px;*/
  line-height: 13px;
  padding-left: 42px;
  width: 124px;/*calc(124px + 42px);*/
  /*overflow: clip;*/
  /*background: red;*/
  position: relative;

  padding-left: 46px;
  height: 16px;
}

.action-disabled > .skill-menu-item-inner {
  opacity: 0.4;
}

.skill-menu-item-inner {
  transform-origin: left;
  white-space: nowrap;
  display: inline-block;
}

#skill-menu-up {
  position: absolute;
  right: 3px;
  top: 3px;
  transform: scaleY(-1);
}

#skill-menu-down {
  position: absolute;
  right: 3px;
  bottom: 3px;
}

.damage-number-container {
  display: flex;
  flex-direction: row;
  transition: opacity 0.1s;
  opacity: 1;
  z-index: 20;
}
.damage-number-container.crit {
  filter: brightness(0) saturate(100%) invert(16%) sepia(76%) saturate(6881%) hue-rotate(357deg) brightness(97%) contrast(120%);
}

.damage-number {
  width: 32px;
  height: 44px;
  background: url("../images/numbers.png");
  /*margin-right: -2px;
  margin-left: -2px;*/
  margin-right: -3px;
  margin-left: -3px;
  opacity: 0;
  animation-duration: 80ms;
  animation-name: damage-number-slide;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

/*.mask-test {
  width: 147px;
  height: 159px;
  mask: url("./sprites/enemy/forest_bunny_mask.gif");
  background: url("/shrine/a/mp100/psychic_effect_small.gif");
}*/

@keyframes damage-number-slide {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

#target-box {
  border: black solid 2px;
  background: #DEDEDE;
  padding: 4px;
  pointer-events: none;
  z-index: 10;
}

#target-box::before {
  content:"";
  background: url("../images/cursor.png");
  width: 29px;
  height: 15px;
  position: absolute;
  top: -19px;
  left: 50%;
  transform: translate(-50%) rotate(-90deg);
  image-rendering: pixelated;
}

#target-box-name {
  background: black;
  padding: 4px;
  /*box-shadow: 0px 1.5px 0px 0px #FBFCFB, 0px 2.5px 0px 0px #A7A7A7;*/
  box-shadow: 0px 1px 0px 0px #FBFCFB, 0px 2px 0px 0px #A7A7A7;
  /*box-shadow: 0px 1.5px 0px 0px #A7A7A7;
  border-bottom: #FBFCFB solid 1px;*/
  height: 23px;

  color: #FFFFFF;
  font-family: "Omori Normal";
  background: black;
  /*font-size: 25px;
  letter-spacing: -0.4px;
  line-height: 15px;*/
  /*font-size: 26px;
  letter-spacing: -0.9px;*/
  font-size: 25px;
  letter-spacing: -0.6px;
  line-height: 14px;
  text-align: center;
  box-sizing: border-box;
}

#target-box-info {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 5px;
  margin-bottom: 1px;
}

#target-health-bg {
  position: relative;
  background: url("../images/enemy_health.png");
  background-position-y: 12px;
  width: 93px;
  height: 12px;
}

#target-health-fill {
  position: absolute;
  left: 0;
  background: url("../images/enemy_health.png");
  width: 50%;
  height: 100%;
}

.enemy-stat {
  width: 270px;
  height: 270px;
  overflow: clip;
  mask-image: linear-gradient(to bottom, transparent 0px, black 40px, black 230px, transparent 100%);
}

.enemy-stat > img {
  position: relative;
  left: 50%;
  animation-duration: 0.72s;
  /*animation-iteration-count: infinite;*/
  animation-fill-mode: forwards;
  animation-timing-function: steps(12, end);
}

.enemy-stat.down > img {
  animation-name: stat-down;
}

.enemy-stat.up > img {
  animation-name: stat-up;
}

@keyframes stat-down {
  from {
    top: 0;
    transform: translate(-50%, -100%);
  }
  
  to {
    top: 100%;
    transform: translate(-50%, 0);
  }
}

@keyframes stat-up {
  from {
    top: 100%;
    transform: translate(-50%, 0);
  }
  
  to {
    top: 0%;
    transform: translate(-50%, -100%);
  }
}

/* experiment */
.six-party-mode characterbox {
  --rescale: 0.9;
  scale: var(--rescale);
}

.six-party-mode #player-down-left {
  transform-origin: bottom left;
}

.six-party-mode #player-up-left {
  transform-origin: top left;
}

.six-party-mode #player-down-right {
  transform-origin: bottom right;
}

.six-party-mode #player-up-right {
  transform-origin: top right;
}

.six-party-mode #player-left {
  left: 14px;
  top: calc(50% - 6px);
  transform: translateY(-50%);
  transform-origin: center left;
}

.six-party-mode #player-right {
  right: 14px;
  top: calc(50% - 6px);
  transform: translateY(-50%);
  transform-origin: center right;
  position: absolute;
}

/* TEXT ANIMATION */
.text-wave {
  animation-name: wave-anim;
  animation-duration: 1s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-composition: add;
  animation-direction: reverse;
  position: relative;
  top: 0;
  left: 0;
}

@keyframes wave-anim {
  0% {top: -4px}
  50% {top: 4px}
  100% {top: -4px}
}

/*.shake {
  display:inline-flex
 }*/
.text-shake {
  /*animation-name:shake-anim;
  transform-origin:center center;
  animation-iteration-count:infinite;
  animation-duration: 1s;
  animation-timing-function:ease-in-out;
  animation-composition: add;
  position: relative;*/
  animation-name: shake-anim2;
  animation-duration: 1.2s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-composition: add;
  animation-direction: reverse;

  position: relative;
  top: 0;
  left: 0;
  /*display: table-cell;*/
  /*white-space: break-spaces;*/
}

.text-shake.text-wave {
  animation-name: wave-anim shake-anim;
}

@keyframes shake-anim2 {
  2% {
    left: 0px; top: 2px;
  }
  4% {
    left: 0px; top: 2px;
  }
  6% {
    left: 2px; top: 2px;
  }
  8% {
    left: 2px; top: 2px;
  }
  10% {
    left: 2px; top: 2px;
  }
  12% {
    left: 2px; top: 2px;
  }
  14% {
    left: 0px; top: 0px;
  }
  16% {
    left: 2px; top: 0px;
  }
  18% {
    left: 0px; top: 2px;
  }
  20% {
    left: 0px; top: 2px;
  }
  22% {
    left: 2px; top: 2px;
  }
  24% {
    left: 0px; top: 2px;
  }
  26% {
    left: 0px; top: 0px;
  }
  28% {
    left: 2px; top: 0px;
  }
  30% {
    left: 2px; top: 0px;
  }
  32% {
    left: 0px; top: 2px;
  }
  34% {
    left: 0px; top: 2px;
  }
  36% {
    left: 0px; top: 0px;
  }
  38% {
    left: 2px; top: 2px;
  }
  40% {
    left: 2px; top: 0px;
  }
  42% {
    left: 0px; top: 2px;
  }
  44% {
    left: 0px; top: 2px;
  }
  46% {
    left: 0px; top: 0px;
  }
  48% {
    left: 0px; top: 2px;
  }
  50% {
    left: 0px; top: 2px;
  }
  52% {
    left: 2px; top: 2px;
  }
  54% {
    left: 0px; top: 0px;
  }
  56% {
    left: 0px; top: 0px;
  }
  58% {
    left: 0px; top: 0px;
  }
  60% {
    left: 0px; top: 2px;
  }
  62% {
    left: 0px; top: 0px;
  }
  64% {
    left: 2px; top: 0px;
  }
  66% {
    left: 0px; top: 2px;
  }
  68% {
    left: 0px; top: 0px;
  }
  70% {
    left: 2px; top: 2px;
  }
  72% {
    left: 2px; top: 0px;
  }
  74% {
    left: 0px; top: 2px;
  }
  76% {
    left: 0px; top: 2px;
  }
  78% {
    left: 2px; top: 0px;
  }
  80% {
    left: 2px; top: 0px;
  }
  82% {
    left: 0px; top: 0px;
  }
  84% {
    left: 2px; top: 0px;
  }
  86% {
    left: 0px; top: 0px;
  }
  88% {
    left: 0px; top: 0px;
  }
  90% {
    left: 2px; top: 2px;
  }
  92% {
    left: 2px; top: 2px;
  }
  94% {
    left: 2px; top: 0px;
  }
  96% {
    left: 2px; top: 0px;
  }
  98% {
    left: 0px; top: 2px;
  }
  0%,
  100% {
    left: 0px; top: 0px;
  }
}
 
@keyframes shake-anim {
  2% {
    transform:translate(0px,2px) rotate(0.5deg)
  }
  4% {
    transform:translate(0px,2px) rotate(0.5deg)
  }
  6% {
    transform:translate(2px,2px) rotate(0.5deg)
  }
  8% {
    transform:translate(2px,2px) rotate(0.5deg)
  }
  10% {
    transform:translate(2px,2px) rotate(0.5deg)
  }
  12% {
    transform:translate(2px,2px) rotate(0.5deg)
  }
  14% {
    transform:translate(0px,0px) rotate(0.5deg)
  }
  16% {
    transform:translate(2px,0px) rotate(0.5deg)
  }
  18% {
    transform:translate(0px,2px) rotate(0.5deg)
  }
  20% {
    transform:translate(0px,2px) rotate(0.5deg)
  }
  22% {
    transform:translate(2px,2px) rotate(0.5deg)
  }
  24% {
    transform:translate(0px,2px) rotate(0.5deg)
  }
  26% {
    transform:translate(0px,0px) rotate(0.5deg)
  }
  28% {
    transform:translate(2px,0px) rotate(0.5deg)
  }
  30% {
    transform:translate(2px,0px) rotate(0.5deg)
  }
  32% {
    transform:translate(0px,2px) rotate(0.5deg)
  }
  34% {
    transform:translate(0px,2px) rotate(0.5deg)
  }
  36% {
    transform:translate(0px,0px) rotate(0.5deg)
  }
  38% {
    transform:translate(2px,2px) rotate(0.5deg)
  }
  40% {
    transform:translate(2px,0px) rotate(0.5deg)
  }
  42% {
    transform:translate(0px,2px) rotate(0.5deg)
  }
  44% {
    transform:translate(0px,2px) rotate(0.5deg)
  }
  46% {
    transform:translate(0px,0px) rotate(0.5deg)
  }
  48% {
    transform:translate(0px,2px) rotate(0.5deg)
  }
  50% {
    transform:translate(0px,2px) rotate(0.5deg)
  }
  52% {
    transform:translate(2px,2px) rotate(0.5deg)
  }
  54% {
    transform:translate(0px,0px) rotate(0.5deg)
  }
  56% {
    transform:translate(0px,0px) rotate(0.5deg)
  }
  58% {
    transform:translate(0px,0px) rotate(0.5deg)
  }
  60% {
    transform:translate(0px,2px) rotate(0.5deg)
  }
  62% {
    transform:translate(0px,0px) rotate(0.5deg)
  }
  64% {
    transform:translate(2px,0px) rotate(0.5deg)
  }
  66% {
    transform:translate(0px,2px) rotate(0.5deg)
  }
  68% {
    transform:translate(0px,0px) rotate(0.5deg)
  }
  70% {
    transform:translate(2px,2px) rotate(0.5deg)
  }
  72% {
    transform:translate(2px,0px) rotate(0.5deg)
  }
  74% {
    transform:translate(0px,2px) rotate(0.5deg)
  }
  76% {
    transform:translate(0px,2px) rotate(0.5deg)
  }
  78% {
    transform:translate(2px,0px) rotate(0.5deg)
  }
  80% {
    transform:translate(2px,0px) rotate(0.5deg)
  }
  82% {
    transform:translate(0px,0px) rotate(0.5deg)
  }
  84% {
    transform:translate(2px,0px) rotate(0.5deg)
  }
  86% {
    transform:translate(0px,0px) rotate(0.5deg)
  }
  88% {
    transform:translate(0px,0px) rotate(0.5deg)
  }
  90% {
    transform:translate(2px,2px) rotate(0.5deg)
  }
  92% {
    transform:translate(2px,2px) rotate(0.5deg)
  }
  94% {
    transform:translate(2px,0px) rotate(0.5deg)
  }
  96% {
    transform:translate(2px,0px) rotate(0.5deg)
  }
  98% {
    transform:translate(0px,0px) rotate(0.5deg)
  }
  0%,
  100% {
    transform:translate(0,0) rotate(0)
  }
}