#exercise{
  max-width: 680px;
  touch-action: manipulation;
}

#exercise .overlayLayerImage {
  /* override exercise.css */
  display: block;
}

#exercise #question-frame {
  border-radius: 3px;
  background-color: white;

  padding: 30px;
  margin: 40px 0 10px;
}

#exercise .master {
  font-weight: 500 !important;
}

#speaker img {
  height: 20px;
  position: absolute;
  opacity: 0.7;
}

/**************** QUESTION ******************/
#exercise #question {
  margin-bottom: 30px;

  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: left;
}

#exercise #question-title {
  font-size: 28px;
  line-height: 1.3em;
  font-weight: 400;
  margin: 0;
}

#exercise #question-title.long {
  font-size: 24px;
}

#exercise #question-instructions {
  margin: 0;
}

#exercise #question-image {
  max-height: 200px;
  max-width: 100%;
  margin-top: 10px;
  cursor: pointer;
}

#exercise #question-title:empty {
  display: none;
}
#exercise #question-image[src=""] {
  display: none;
}
#exercise #question-instructions:empty {
  display: none;
}

/**************** CARDS ******************/
#options {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;

  margin: 0 auto;
}

#options.grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  max-width: calc(100vh - 270px);
}

.option {
  position: relative;
}

/* ASPECT RATIO 1:1 for cards */
#options.grid .option::before {
  content: '';
  display: block;
  padding-bottom: 100%;
}
#options.grid .card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
/* end ASPECT RATIO */

.card {
  font-size: 18px;
  padding-left: 15px;
}

.card:not(.fill) {
  text-align: left;
}

.card.fill {
  padding: 0;

  display: flex;
  flex-direction: column;
  justify-content: stretch;
  align-items: stretch;
}

.card.fill .card-image {
  flex: 1 1 0;
  position: relative;
}

.card.fill .text {
  flex: 0 0 auto;
  padding: 10px;
}


.card.fill img {
  /* sometimes image would stretch vertically and drive text out of the card */
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;

  object-fit: contain;
  padding: 10px;
}

:root {
  --option-img-margin-adjust: -10px;
}
.card .text:not(:empty) + .card-image {
  margin-top: var(--option-img-margin-adjust);
}

.card .text:empty {
  display: none;
}

.card .card-image:empty {
  display: none;
}

/**************** EXPLANATION ******************/
#exercise .explanation {
  display: flex;
  align-items: center;
  gap: 5px;
  text-align: left;

  border-top: none;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

#exercise .explained .card {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/********************** WHITE SCREEN *****************************/
#exercise.whiteScreen #question-frame {
  padding: 10px;
  margin-top: 20px;
}

#exercise.whiteScreen #question {
  margin-bottom: 20px;
}

/********************** MOBILNI VERZE *****************************/
@media screen and (max-width: 599px) {
  #exercise #question-image {
    max-width: 100%;
  }

  #exercise #question-title.long {
    font-size: 22px;
  }

  #exercise #question-frame {
    padding: 30px 10px;
  }
}
