/*
  Base
*/

.novel-container {
  user-select: none;
  overflow: hidden;
}

.novel-layer {
  position: absolute;
  inset: 0;
}

/*
  Text-General
*/

.novel-paragraph {
  display: flex;
  flex-wrap: wrap;
  column-gap: 8px;
  row-gap: 1px;
}

.novel-word {
  display: flex;
}

/*
  Page
*/

.novel-page {
  position: absolute;
  inset: 25%;
  bottom: 40%;
  padding: 40px;
  border-radius: 16px;
  color: #ddd;
  background-color: rgba(0, 0, 0, 0.3);
  transition: all 0.5s;
  transition-property: opacity, background-color;
}

.novel-page-hidden {
  opacity: 0;
}

.novel-page-waiting::after {
  translate: 0 10px;
  content: '■';
  position: absolute;
  animation-name: novelCursorFlicker;
  animation-duration: 1s;
  animation-iteration-count: infinite;
  opacity: 0;
}

.novel-passage {
  font: 20px Courier;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.novel-passage + .novel-passage {
  margin-top: 10px;
}

.novel-page-written {
  background-color: rgba(0, 0, 0, 0.4);
}

.novel-page-written .novel-link-event,
.novel-page-written .novel-link-scene {
  cursor: pointer;
  transition: color 1s;
}

.novel-passageFragment {
  opacity: 0;
  transition: opacity 0.5s;
}

.novel-passageFragment-rendered {
  opacity: 1;
}

.novel-page-written .novel-link-event {
  color: chartreuse;
}

.novel-page-written .novel-link-scene {
  color: violet;
}

@keyframes novelCursorFlicker {
  0% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

/*
  Characters
*/

.novel-character {
  position: absolute;
  width: 350px;
  height: 350px;
  bottom: 40px;
  transition: all 0.5s ease;
}

.novel-character-align-left {
  left: 20px;
}

.novel-character-align-right {
  right: 20px;
}

.novel-character-align-left.novel-character-inactive {
  left: 0;
}

.novel-character-align-right.novel-character-inactive {
  right: 0;
}

.novel-portrait {
  position: absolute;
  inset: 0;
  background-size: contain;
  background-position: bottom;
  background-repeat: no-repeat;
  transition: opacity 0.5s ease;
}

.novel-portrait-hidden {
  opacity: 0;
}

.novel-label {
  position: absolute;
  bottom: 0;
  color: #eee;
  font: 18px Arial;
  text-shadow: 0 1px 2px #000;
  transition: all 0.3s ease;
}

.novel-character-align-left .novel-label {
  left: -20px;
  padding-left: 20px;
  padding-right: 50px;
  background: linear-gradient(90deg,
    rgba(80,80,80,1) 0%,
    rgba(80,80,80,0.8) 70%,
    rgba(80,80,80,0) 100%
  );
}

.novel-character-align-right .novel-label {
  right: -20px;
  text-align: right;
  padding-left: 50px;
  padding-right: 20px;
  background: linear-gradient(270deg,
    rgba(80,80,80,1) 0%,
    rgba(80,80,80,0.8) 70%,
    rgba(80,80,80,0) 100%
  );
}

.novel-label-hidden {
  opacity: 0;
}

/*
  TextBox
*/

.novel-textbox {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 40px;
  min-height: 180px;
  padding: 16px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #eee;
  font: 24px Arial;
  white-space: pre-wrap;
  background-color: rgba(40, 40, 40, 0.5);
  backdrop-filter: blur(20px);
  box-sizing: border-box;
  transition: all 0.8s ease;
  transition-property: opacity, background-color;
}

.novel-textbox-hidden {
  opacity: 0;
  transition: all 0.5s ease;
}

/* .novel-textbox-note {} */

.novel-messages {
  max-width: 1000px;
  text-shadow: 0 1px 2px #000;
}

.novel-messageFragment {
  display: inline-block;
  translate: 0 10px;
  opacity: 0;
  transition: all 0.2s;
}

.novel-messageFragment-rendered {
  opacity: 1;
  translate: none;
}

/* .novel-textbox-waiting {} */

.novel-textbox-left {
  padding-left: 200px;
}

.novel-textbox-right {
  padding-right: 200px;
}

/*
  Select
*/

.novel-choices {
  display: flex;
  justify-content: center;
  align-items: center;
}

.novel-select {
  min-width: 300px;
  max-width: 800px;
  border-radius: 8px;
  border: 2px solid #aaa;
  overflow: hidden;
  box-shadow: 1px 4px 20px rgba(0, 0, 0, 0.5);
  transition: all 0.5s ease;
  translate: 0 -100px;
}

/* .novel-select[scene="tavern"] {} */

.novel-select-hidden {
  opacity: 0;
  translate: 0 -120px;
}

.novel-select-option {
  color: #ddd;
  padding: 20px 40px;
  background-color: #444;
  cursor: pointer;
  transition: all 0.3s ease;
  font: 20px Arial;
  text-align: center;
}

.novel-select-option + .novel-select-option {
  border-top: 1px solid #666;
}

.novel-select-option:not(.novel-select-option-locked):hover {
  background-color: #111;
}

.novel-select-option-locked {
  background-color: #666;
  cursor: default;
}

/*
  Automatically tracked elements, i.e. elements that have
  an attribute named as specified in the "watchedAttr" parameter.
*/

/*
.novel-watched {
  border: 2px solid white;
}

.novel-watched-clicked {
  border: 2px solid greenyellow;
}

.novel-watched-clicked-other {
  border: 2px solid red;
}
*/
