/* override finalBoard.css */
#exercise #finalBoard {
  max-width: 450px;
}

#finalBoard h2 {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
}
#finalBoard h2 img {
  height: 1.7em;
  margin-right: 5px;
}

#exercise{
  max-width: 900px;  
}

#question-frame {
  margin-left: auto;
  margin-right: auto;
}

.start {
  min-width: 50%;
  justify-content: space-around;
}

#finalBoard .illustration {
  max-width: 100%;
  margin-bottom: 25px;
}

/********************** PLAN **********************/
#plan {
  position: relative;
  overflow: hidden;

  width: 100%;
  height: 300px;
  margin: 30px 0;

  background-color: white; /* fallback */
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;

  border-radius: 3px;
  box-shadow: 0 0 32px 0 rgba(0,0,0,0.1);
}

@keyframes blink-reverse {
  0%, 100% { opacity: 0; }
  50% { opacity: 0.8; }
}

#plan::after {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);

  opacity: 0;

  font-size: 36px;
  line-height: 1;
  color: white;
  background-color: var(--redHover);
  box-shadow: 0 0 2em 2em var(--redHover);
  border-radius: 6px;
}

#plan.wave:not(.loss)::after {
  animation: blink-reverse 1s 2 ease-in-out;
}

#plan::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;

  background-color: var(--redHover);
  opacity: 0;
  transition: opacity 500ms linear;
}

#plan.loss::before {
  opacity: 0.8;
}

.monster {
  --monster-width: 70px;
  position: absolute;
  z-index: 0;

  left: 0;
  width: calc(100% - var(--monster-width));

  transform: translateX(100%);
  transition-property: transform;
  transition-timing-function: linear;
  will-change: transform;

  animation: appear 1000ms;
}

@keyframes appear {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.monster img {
  width: var(--monster-width);
  position: absolute;
  left: 0;
}

.monster .hp-bar {
  width: var(--monster-width);
  height: 5px;

  display: flex;
  flex-direction: row-reverse;
  gap: 2px;
}

.monster .hp-bar .hp-segment {
  background-color: var(--red);
  flex: 1 1 0;
  transition: transform 200ms ease-in-out 200ms;
}

.monster .hp-bar .hp-segment.empty {
  transform: translateX(-50%) scaleX(0);
}

.monster.hit img {
  animation: blink 300ms ease-in-out;
}

.monster.dead img {
  opacity: 0;
  transform: scale(2);
  transition-property: transform, opacity;
  transition-duration: 200ms;
  transition-timing-function: ease-out;
}
.monster.dead .hp-bar {
  visibility: hidden;
}

/********************** SCORE **********************/
#question-frame {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  justify-items: flex-start;
  align-items: center;
  gap: 10px;
}

.score-box {
  display: inline-flex;
  flex-direction: column;

  font-size: 16px;
  line-height: 1;

  gap: 5px;
  padding: 10px;
  align-items: center;

  background-color: var(--faintGreen);
  border: 2px solid var(--greenHover);
  border-radius: 6px;
}

.score-value {
  font-size: 2em;
}

@media screen and (max-width: 599px) {
  #question-frame {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 30px;
  }
  .score-box {
    flex-direction: row;
  }
  .score-label::after {
    content: ':';
  }
}

.final-stats-box {
  display: flex;
  font-size: 16px;
  line-height: 1.2;
  justify-content: space-around;
  align-items: flex-end;
  margin-bottom: 25px;
}

.final-stats:not(:first-child):not(:last-child) {
  font-size: 20px;
}