html,
body {
  height: 100%;
  width: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #333;
  font-family: 'Roboto Mono', monospace;
  font-size: 16px;
}

main {
  width: 960px;
  min-width: 960px;
  height: 640px;
  background-color: #eee;
}

#loading:not(.hidden),
#titlescreen:not(.hidden),
#epilogue:not(.hidden) {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  position: relative;
}

.hidden {
  display: none;
}

/******* START LOADING SCREEN STYLING *******/

#loading {
  background-color: #242424;
}

.loading-dots {
  margin-right: -90px;
  margin-top: 28px;
  width: 10px;
  height: 10px;
  border-radius: 5px;
  background-color: transparent;
  box-shadow: -72px 0 0 0 #FFF, -48px 0 0 0 #FFF, -24px 0 0 0 #FFF;
  animation: bounce 1.5s infinite linear;
}

@keyframes bounce {
  0% {
    box-shadow: -72px 0 0 0 #FFF, -48px 0 0 0 #FFF, -24px 0 0 0 #FFF;
  }
  16.667% {
    box-shadow: -72px -10px 0 0 #FFF, -48px 0 0 0 #FFF, -24px 0 0 0 #FFF;
  }
  33.333% {
    box-shadow: -72px 0 0 0 #FFF, -48px 0 0 0 #FFF, -24px 0 0 0 #FFF;
  }
  50% {
    box-shadow: -72px 0 0 0 #FFF, -48px -10px 0 0 #FFF, -24px 0 0 0 #FFF;
  }
  66.667% {
    box-shadow: -72px 0 0 0 #FFF, -48px 0 0 0 #FFF, -24px 0 0 0 #FFF;
  }
  83.333% {
    box-shadow: -72px 0 0 0 #FFF, -48px 0 0 0 #FFF, -24px -10px 0 0 #FFF;
  }
  100% {
    box-shadow: -72px 0 0 0 #FFF, -48px 0 0 0 #FFF, -24px 0 0 0 #FFF;
  }
}

/******* END LOADING SCREEN STYLING *******/

/******* START TITLE SCREEN STYLING *******/

#titlescreen h1 {
  margin: 0;
}

#titlescreen button {
  background: repeating-linear-gradient(to bottom, transparent, transparent 1px, white 1px, white 3px), repeating-linear-gradient(to right, #ccc, #ccc 1px, white 1px, white 3px);
  margin: 20px;
  padding: 8px 20px;
  font: inherit;
  cursor: pointer;
  border: 2px solid #333;
  box-shadow: 4px 4px #333;
  border-radius: 4px;
  transition: all 0.1s;
}

#titlescreen button:hover,
#titlescreen button:focus {
  box-shadow: 2px 2px #333;
  margin: 22px 18px 18px 22px;
}

#titlescreen .wrapper {
  width: 90%;
  height: 90%;
  background-color: white;
  margin: 16px;
  position: relative;
  border-radius: 10px;
  border: 2px solid #333;
  box-shadow: 4px 4px #333;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#titlescreen a {
  color: inherit;
}

#titlescreen .wrapper::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  background: repeating-linear-gradient(to bottom, transparent, transparent 1px, white 1px, white 3px), repeating-linear-gradient(to right, #ccc, #ccc 1px, white 1px, white 3px);
  border-radius: 9px 9px 0 0;
  border-bottom: 2px solid #333;
  box-sizing: border-box;
  height: 30px;
}

#titlescreen .wrapper::after {
  content: "";
  position: absolute;
  height: 10px;
  width: 10px;
  background-color: white;
  left: 10px;
  top: 6px;
  border: 2px solid #333;
  border-radius: 100%;
}

/******* END TITLE SCREEN STYLING *******/

/******* START DIALOGUE SCREEN STYLING *******/

#dialogue-container:not(.hidden) {
  display: flex;
  position: relative;
  height: 100%;
  width: 100%;
  justify-content: space-between;
}

#character-portrait {
  position: absolute;
  height: 300px;
  width: 300px;
  bottom: 220px;
  left: calc(50% - 150px);
  background-repeat: no-repeat;
  background-size: 200%;
  background-position-x: 0;
  background-position-y: 0;
}

.dialogue-main {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  width: 100%;
  background: radial-gradient(white 5%, transparent), repeating-linear-gradient(to bottom, #ddd, #ddd 2px, transparent 2px, transparent 20px), repeating-linear-gradient( to right, #ddd, #ddd 2px, transparent 2px, transparent 20px), white;
}

.dialogue-overlay {
  display: flex;
  justify-content: space-between;
  margin: 14px;
  z-index: 5;
}

.dialogue-responses-wrapper {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  margin: 40px 0 40px 0;
  z-index: 5;
}

.dialogue-wrapper {
  margin: 16px;
  position: relative;
  z-index: 5;
  min-height: 200px;
  box-sizing: border-box;
  background-color: white;
  border-radius: 10px;
  border: 2px solid #333;
  box-shadow: 4px 4px #333;
}

#speaker-name {
  background: repeating-linear-gradient(to bottom, transparent, transparent 1px, white 1px, white 3px), repeating-linear-gradient(to right, #ccc, #ccc 1px, white 1px, white 3px);
  font-size: 20px;
  border-radius: 9px 9px 0 0;
  padding: 4px;
  padding-left: 55px;
  position: relative;
  border-bottom: 2px solid #333;
}

#speaker-name::before, #speaker-name::after {
  content: '';
  position: absolute;
  height: 10px;
  width: 10px;
  background-color: white;
  top: calc(50% - 7px);
  left: 10px;
  border: 2px solid #333;
  border-radius: 100%;
}

#speaker-name::after {
  left: 28px;
}

#responses button {
  background-color: rgba(255,255,255);
  height: 80px;
  width: 500px;
  font: inherit;
  padding: 6px;
  cursor: pointer;
  border: 2px solid #333;
  box-shadow: 4px 4px #333;
  border-radius: 4px;
}

#progress-dialogue {
  background-color: transparent;
  border: none;
  position: absolute;
  right: 15px;
  bottom: 18px;
  cursor: pointer;
  animation: wiggle 0.75s infinite linear;
}

@keyframes wiggle {
  0% {
    right: 15px;
  } 
  50% {
    right: 18px;
  }
  100% {
    right: 15px;
  }
}

#progress-dialogue div {
  transform: rotate(45deg);
    width: 0;
    height: 0;
    border-color: #333;
    border: 7px solid transparent;
    border-top: 7px solid;
    border-right: 7px solid;
    margin: 15px;
}

#character-dialogue {
  margin: 8px;
}

/******* END DIALOGUE SCREEN STYLING *******/

/******* START EPILOGUE SCREEN STYLING *******/

#epilogue-result {
  margin: 20px 10%
} 

#epilogue button {
  background: repeating-linear-gradient(to bottom, transparent, transparent 1px, white 1px, white 3px), repeating-linear-gradient(to right, #ccc, #ccc 1px, white 1px, white 3px);
  margin: 20px;
  padding: 8px 20px;
  font: inherit;
  cursor: pointer;
  border: 2px solid #333;
  box-shadow: 4px 4px #333;
  border-radius: 4px;
  transition: all 0.1s;
}

#epilogue button:hover,
#epilogue button:focus {
  box-shadow: 2px 2px #333;
  margin: 22px 18px 18px 22px;
}

/******* END EPILOGUE SCREEN STYLING *******/