@font-face {
  font-family: milkjf;
  src: url("pc-9800.ttf");
  /* src:  url("x68000_sans.ttf"); */
}

@font-face {
  font-family: otherfont;
  src: url("x68000_sans.ttf");
  /* src:  url("x68000_sans.ttf"); */
}

* {
  box-sizing: border-box;
}
textarea:focus, input:focus{
  outline: none;
}

video {
  opacity: 0;
  pointer-events: none;
  position: fixed;
  top: 0;
}

body {
  height: 100vh;
  width: 100vw;
  margin: 0;
  background-color: white;
  font-family: milkjf;
  overflow:hidden;
}

#loading-screen, #saveload-screen {
  position:fixed;
  top:0;
  width:100vw;
  height:100vh;
  z-index:999999999;
  background:#000;
  color:#fff;
  user-select:none;
  text-align: center;
  font-size:1vw;
  padding-top:20vh;
}

#loading-progress, #saveload-progress {
  width:100%;
  text-align:center;
  font-size:2vw;
}

.main {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  background: black;
}

#menu-bar {
  position: fixed;
  top: -4.5vw;
  width: 100vw;
  height: 7vw;
  z-index: 9999;
  transition: top 0.5s linear;
  user-select: none;
}

#menu-bar.locked {
  top: 0;
}

.menu-bar-bg {
  width: 100vw;
  height: 4.5vw;
  background: #000;
}

.menu-bar-bg > div {
  display: inline-block;
  color: #fff;
  font-size: 2vw;
  padding: 1vw 0 1vw 1vw;
}

.menu-bar-bg > div.open-menu {
  color: #e60017;
}

#savebutton, #resetbutton {
  padding: 1vw 1vw 1vw 0;
  float: right;
}

#menu-bar:hover {
  top: 0;
}

#settings-menu {
  position: fixed;
  width: 20vw;
  height: auto;
  font-size: 1.5vw;
  pointer-events: all;
  z-index: 100;
  border: 0.1vw;
  border-style: solid;
  border-color: white;
  background-color: RGBA(0, 0, 0, 0.9);
  color: #fff;
  padding: 1.5vw;
}

#settings-menu > input {
  width: 100%;
}

#save-menu {
  position: fixed;
  width: 30vw;
  height: auto;
  font-size: 1.5vw;
  pointer-events: all;
  z-index: 100;
  border: 0.1vw;
  border-style: solid;
  border-color: white;
  background-color: RGBA(0, 0, 0, 0.9);
  color: #fff;
  padding: 1.5vw;
}

.save-slot {
  height:auto;
  width:100%;
  display: flex;
  align-items: center;
}

.save-slot span {
  padding:0 0.3vw;
}

.no-save {
  color:gray;
}

#save-slot-auto {
  padding-bottom:1.5vw;
  border-bottom: 0.1vw white solid;
}

#save-slot-container {
  overflow-y: scroll;
  max-height:40vh;
  scrollbar-width: thin;
  scrollbar-color: red black;
}

.save-slot > div:nth-child(1) {
  width:24%;
  height:3vw;
  background:gray;
  background-size: cover;
}

#save-slot-thumb-auto {
  height:4vw;
}

#save-slot-container .save-slot {
  padding:1vw 1vw 0 0;
}

#save-slot-container .save-slot > div:nth-child(1) {
  width:20%;
}

.save-slot > div:nth-child(2) {
  margin-left:1vw;
}

.save-slot > div:nth-child(3) {
  margin-left: auto;
}

.save-slot > div:nth-child(3):hover, .save-slot > div:nth-child(5):hover {
  cursor:pointer;
  color:red;
}

#saveload-screen {
  display:none;
}

#saveload-screen.loading {
  display:block;
}

.sidebar {
  z-index: 4;
  position: absolute;
  top: 0;
  right: 3vw;
}

.menu-bar-bg > div:hover {
  cursor: pointer;
  color: #e60017;
}

#tag-input {
  width:40vw;
  height:5vw;
  background:#000;
  border:0.15vw #fff solid;
  position:fixed;
  z-index:99;
  color:#fff;
  font-family:"milkjf";
  font-size:2vw;
  padding:1vw;
}

.choices,
.status {
  padding: 1.5vw;
  user-select: none;
  display: inline-block;
  font-size: 1.5vw;
  letter-spacing: 0.15rem;
  color: white;
  margin: 2vw;
  border: 0.1vw;
  border-style: solid;
  border-color: white;
  background-color: RGBA(0, 0, 0, 0.5);
  height: fit-content;
  /* transition: height 1.5s; */
}

#history-container {
  display: inline-block;
  font-size: 1.5vw;
  letter-spacing: 0.15rem;
  color: white;
  margin: 6vw 2vw 2vw;
  border: 0.1vw;
  border-style: solid;
  border-color: white;
  background-color: RGBA(0, 0, 0, 0.9);
  z-index: 99;
  overflow: scroll;
  scrollbar-width: thin;
  scrollbar-color: red black;
  user-select: none;
  padding: 1.5vw;
  min-width: 100%;
}

.loglist {
  list-style-type: none;
  padding-left: none;
  margin-bottom: 5px;
}

.hidden {
  border: 0px;
  border-style: solid;
  border-color: white;
  opacity: 0;
  pointer-events: none !important;
  /* height:  5px; */
  /* transition: height 1.5s; */
}

.choiceListItem {
  color: white;
  text-decoration: none;
}

.choices {
  color: #e60017;
}

.choiceListItem:hover {
  color: #e60017;
  /* text-decoration: underline; */
}

.crt::after {
  content: " ";
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: rgba(18, 16, 16, 0.1);
  opacity: 0;
  z-index: 4;
  pointer-events: none;
}
.crt::before {
  content: " ";
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
    linear-gradient(
      90deg,
      rgba(255, 0, 0, 0.06),
      rgba(0, 255, 0, 0.02),
      rgba(0, 0, 255, 0.06)
    );
  z-index: 4;
  background-size: 100% 2px, 3px 100%;
  pointer-events: none;
}
.crt {
  animation: textShadow 5.6s infinite;
}

#screen {
  height: 100%;
  width: 100%;
  position: relative;
  border: 2px solid black;
  margin: auto;
  background: black;
  display: flex;
  justify-content: center;
  image-rendering: pixelated;
}

canvas {
  position: absolute;
  height: 100%;
  width: 100%;
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  transition-timing-function: linear;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  animation-iteration-count:1;
}
#text {
  z-index: 4;
}
#front {
  z-index: 3;
}
#front2 {
  z-index: 3;
}
#backTrans {
  z-index: 2;
}
#back {
  z-index: 1;
}

/* transitions */
.transitionFade {
  opacity:0;
  transition-property:opacity;
}
.transitionScale {
  transform:scale(0);
  transition-property:transform;
}

.transitionCircleWipe {
  animation-name:circleWipe;
  animation-iteration-count:1;
}

@keyframes circleWipe {
  from {clip-path: circle(100% at 50% 50%);}
  to {clip-path: circle(0% at 50% 50%);}
}