/* Field-book treatment for the animal residents of The Nine Lands. */
#stage {
  position: relative;
}

#modal-card.book.animal-book .book-plate {
  background-color: rgba(103, 76, 42, 0.08);
  background-position: center bottom;
  background-repeat: no-repeat;
  background-size: contain;
  border: 0;
  box-shadow: none;
  filter: drop-shadow(0 8px 8px rgba(54, 36, 18, 0.22));
  animation: animal-portrait-in 320ms ease-out both;
}

@keyframes animal-portrait-in {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
}

.animal-book .modal-clue {
  display: flex;
  min-height: 0;
  flex-direction: column;
}

.animal-book .modal-title {
  margin-bottom: 5px;
}

.animal-book .clue-body {
  margin: 0 0 12px;
  padding: 0;
  background: transparent;
  border: 0;
}

.animal-book-kicker,
.animal-book-label {
  margin: 0;
  color: #806238;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  line-height: 1.3;
  text-transform: uppercase;
}

.animal-book-speech {
  margin: 10px 0 14px;
  padding: 11px 0;
  border-top: 1px solid rgba(102, 73, 37, 0.35);
  border-bottom: 1px solid rgba(102, 73, 37, 0.35);
  color: #3d2c19;
  font-family: var(--serif);
  font-size: clamp(0.9rem, 1.35vw, 1.13rem);
  font-style: italic;
  line-height: 1.45;
}

.animal-book-note {
  margin: 6px 0 0;
  color: #5d472f;
  font-size: 0.86rem;
  line-height: 1.45;
}

.animal-book .btn-primary {
  align-self: flex-start;
  min-height: 40px;
}

@media (prefers-reduced-motion: reduce) {
  #modal-card.book.animal-book .book-plate { animation: none; }
}

/* The game forces phones into landscape. Keep both pages of the field book
   visible there instead of falling back to the generic one-page modal. */
@media (max-width: 780px), (max-height: 520px) {
  #modal-card.book.animal-book {
    width: min(96vw, calc(92dvh * 1.79), 900px);
    max-height: 92dvh;
    aspect-ratio: 1.79;
    padding: 0;
    overflow: hidden;
    background: url('../assets/ui/book.webp') center / 100% 100% no-repeat;
    border-radius: 8px;
  }

  #modal-card.book.animal-book .book-page {
    position: absolute;
    top: 13%;
    bottom: 11%;
  }

  #modal-card.book.animal-book .book-left {
    display: flex;
    left: 17%;
    width: 29%;
    gap: 3px;
  }

  #modal-card.book.animal-book .book-right {
    left: 51.5%;
    width: 32.5%;
    overflow-y: auto;
    justify-content: flex-start;
  }

  #modal-card.book.animal-book .book-caption {
    font-size: 0.62rem;
    line-height: 1.15;
  }

  #modal-card.book.animal-book .modal-title {
    margin-bottom: 2px;
    font-size: clamp(0.93rem, 3.3vh, 1.14rem);
    line-height: 1.05;
  }

  #modal-card.book.animal-book .animal-book-kicker,
  #modal-card.book.animal-book .animal-book-label {
    font-size: clamp(0.48rem, 1.7vh, 0.62rem);
    letter-spacing: 0.08em;
  }

  #modal-card.book.animal-book .animal-book-speech {
    margin: 4px 0 5px;
    padding: 4px 0;
    font-size: clamp(0.66rem, 2.25vh, 0.82rem);
    line-height: 1.22;
  }

  #modal-card.book.animal-book .animal-book-note {
    margin-top: 2px;
    font-size: clamp(0.56rem, 1.85vh, 0.72rem);
    line-height: 1.22;
  }

  #modal-card.book.animal-book .clue-body {
    margin-bottom: 5px;
  }

  #modal-card.book.animal-book .btn-primary {
    min-height: 30px;
    padding: 5px 10px;
    font-size: 0.66rem;
  }
}
