/* Discoveries are object cards above the adventure, not another reading page.
   Load after screen.css. Images are always contained, never cropped. */
.modal.screen-modal.pickup-sheet {
  --pickup-height: min(640px, calc(var(--viewport-height, 100dvh) - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  position: fixed;
  inset: calc((var(--viewport-height, 100dvh) + env(safe-area-inset-top) - env(safe-area-inset-bottom)) / 2) auto auto 50%;
  transform: translate(-50%, -50%);
  width: calc(var(--stage-width) - 24px);
  max-width: 540px;
  height: var(--pickup-height);
  max-height: var(--pickup-height);
  margin: 0;
  padding: 0;
  border: 1px solid #d1ab6a99;
  border-radius: 14px;
  background: #102f27;
  box-shadow: 0 18px 64px #00100bcc, inset 0 0 0 4px #c7a5670b;
  overflow: hidden;
}
.modal.screen-modal.pickup-sheet::backdrop {
  background: #03171199;
  backdrop-filter: blur(2px);
}
.screen-modal.pickup-sheet .modal-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: calc(var(--pickup-height) - 2px);
  min-height: 0;
  padding: 0;
  overflow: hidden;
}
.screen-modal.pickup-sheet .close {
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
}
.screen-modal.pickup-sheet .sheet-head {
  flex: 0 0 auto;
  min-height: 78px;
  padding: 16px 64px 12px 20px;
  background: transparent;
  border-bottom-color: #d1ab6a33;
}
.screen-modal.pickup-sheet .sheet-head h2 {
  margin: 5px 0 0;
  font-size: 26px;
  line-height: 1.12;
  overflow-wrap: normal;
  text-wrap: balance;
}
.screen-modal.pickup-sheet .pickup-art {
  position: relative;
  flex: 1 1 0;
  min-height: 90px;
  width: 100%;
  margin: 0;
  padding: 12px 16px;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 52%, #8f75402b 0, #3c4a2d1a 48%, transparent 74%);
}
.screen-modal.pickup-sheet .pickup-art::after {
  content: "";
  position: absolute;
  inset: 10px 14px;
  border: 1px solid #d2b57320;
  border-radius: 8px;
  pointer-events: none;
}
.item-illustration {
  display: block;
  object-fit: contain;
  object-position: center;
  border: 0;
}
.screen-modal.pickup-sheet .pickup-art > .item-illustration {
  position: absolute;
  inset: 12px 16px;
  width: calc(100% - 32px);
  height: calc(100% - 24px);
  max-width: none;
  max-height: none;
  border-radius: 6px;
}
.screen-modal.pickup-sheet .pickup-copy {
  position: relative;
  flex: 0 0 auto;
  padding: 8px 20px 0;
  text-align: center;
}
.screen-modal.pickup-sheet .pickup-copy p {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.35;
  color: #f0e7cf;
  overflow-wrap: break-word;
}
.screen-modal.pickup-sheet .sheet-actions.pickup-actions {
  display: flex;
  flex-direction: row;
  flex: 0 0 auto;
  gap: 10px;
  padding: 14px 20px 16px;
}
.screen-modal.pickup-sheet .pickup-actions > button {
  flex: 1 1 0;
  width: auto;
  min-height: 44px;
  margin: 0;
  padding: 10px 8px;
  font-size: 15px;
  line-height: 1.25;
}
.screen-modal.pickup-sheet .note,
.screen-modal.pickup-sheet p.pickup-note {
  flex: 0 0 auto;
  margin: -5px 0 0;
  padding: 0 20px 14px;
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.3;
  color: #d5d9c1;
  text-align: center;
}
.screen-modal.pickup-sheet .note:empty,
.screen-modal.pickup-sheet p.pickup-note:empty { display: none; }

/* A discovery can be revisited after choosing to leave it. This small visual
   handle is kept to one touch row; collection itself happens in the window. */
.screen-card .discovery-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  height: 56px;
  min-height: 56px;
  max-height: 56px;
  margin: 0;
  padding: 5px 10px;
  border: 1px solid #d1b27680;
  border-radius: 6px;
  background: linear-gradient(110deg, #284a38, #173b2e);
  color: #f7e4bc;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
}
.screen-card .discovery-button:hover { background: #34523b; border-color: #e7c786; }
.screen-card .discovery-button > .discovery-thumb {
  display: block;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  object-fit: contain;
  object-position: center;
  border-radius: 4px;
}
.screen-card .discovery-button > span { flex: 1 1 0; min-width: 0; }

/* The narrative now chooses its painting for each beat. Preserve that whole
   composition, including faces, hands and the object described in the text.
   Only the interactive leaf retains its established hotspot coordinates. */
.screen-art .screen-image {
  object-fit: contain;
  object-position: center;
  background: radial-gradient(ellipse at 50% 40%, #214b3b, #06271f 80%);
}
.screen-art:has(.exploration-spots) .screen-image {
  object-fit: cover;
  object-position: 50% var(--subject-y);
  background: none;
}

/* Inventory retains its page controls. A large object uses the space left by
   the current description and feedback, rather than forcing a taller page. */
.screen-modal.inventory-sheet .sheet-body {
  justify-content: center;
  gap: 10px;
}
.screen-modal.inventory-sheet .inventory-detail {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 0;
  gap: 10px;
  text-align: center;
}
.screen-modal.inventory-sheet .inventory-detail > .item-illustration.item-inventory {
  flex: 0 1 auto;
  width: 100%;
  height: clamp(130px, 28dvh, 220px);
  min-height: 76px;
  max-height: 220px;
  padding: 4px;
  border-radius: 8px;
  background: radial-gradient(ellipse, #a6884230, transparent 74%);
}
.screen-modal.inventory-sheet .inventory-detail > h3,
.screen-modal.inventory-sheet .inventory-detail > p,
.screen-modal.inventory-sheet .inventory-detail > .item-state {
  flex: 0 0 auto;
}
.screen-modal.inventory-sheet .inventory-detail > p { font-size: 14px; line-height: 1.35; }
.screen-modal.inventory-sheet .inventory-feedback { flex: 0 0 auto; }
.screen-modal.inventory-sheet .sheet-body:has(.inventory-feedback:not(:empty)) .item-inventory {
  height: clamp(90px, 20dvh, 150px);
  max-height: 150px;
}

@media (max-width: 360px), (max-height: 580px) {
  .screen-modal.pickup-sheet .sheet-head { padding: 14px 62px 10px 16px; min-height: 74px; }
  .screen-modal.pickup-sheet .sheet-head h2 { font-size: 24px; }
  .screen-modal.pickup-sheet .pickup-copy { padding: 6px 16px 0; }
  .screen-modal.pickup-sheet .pickup-copy p { font-size: 16px; line-height: 1.3; }
  .screen-modal.pickup-sheet .sheet-actions.pickup-actions { padding: 12px 16px 14px; gap: 8px; }
  .screen-modal.pickup-sheet .note,
  .screen-modal.pickup-sheet p.pickup-note { padding-inline: 16px; padding-bottom: 12px; }
  .screen-modal.inventory-sheet .sheet-body { gap: 8px; }
  .screen-modal.inventory-sheet .inventory-detail { gap: 8px; }
  .screen-modal.inventory-sheet .inventory-detail > .item-illustration.item-inventory { height: 144px; max-height: 144px; }
  .screen-modal.inventory-sheet .inventory-detail > h3 { font-size: 21px; }
  .screen-modal.inventory-sheet .sheet-body:has(.inventory-feedback:not(:empty)) .item-inventory { height: 96px; max-height: 96px; }
}

/* A shallow landscape viewport presents the object beside its short caption.
   Nothing is removed: the picture, description and both choices remain. */
@media (orientation: landscape) and (max-height: 430px) {
  .modal.screen-modal.pickup-sheet { max-width: 680px; }
  .screen-modal.pickup-sheet .modal-content {
    display: grid;
    grid-template-columns: 42% minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto auto;
  }
  .screen-modal.pickup-sheet .sheet-head { grid-column: 2; grid-row: 1; min-height: 0; padding: 12px 62px 8px 12px; }
  .screen-modal.pickup-sheet .sheet-head h2 { font-size: 23px; }
  .screen-modal.pickup-sheet .pickup-art { grid-column: 1; grid-row: 1 / -1; min-height: 0; height: 100%; border-right: 1px solid #d1ab6a33; }
  .screen-modal.pickup-sheet .pickup-copy { grid-column: 2; grid-row: 2; align-self: center; padding: 8px 16px 4px 12px; text-align: left; }
  .screen-modal.pickup-sheet .sheet-actions.pickup-actions { grid-column: 2; grid-row: 3; padding: 6px 16px 10px 12px; }
  .screen-modal.pickup-sheet .note,
  .screen-modal.pickup-sheet p.pickup-note { grid-column: 2; grid-row: 4; padding: 0 16px 10px 12px; text-align: left; }
  .screen-modal.inventory-sheet .inventory-detail { display: grid; grid-template-columns: 34% minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; text-align: left; }
  .screen-modal.inventory-sheet .inventory-detail > .item-illustration.item-inventory { grid-column: 1; grid-row: 1 / 3; width: 100%; height: 140px; max-height: 140px; min-height: 64px; }
  .screen-modal.inventory-sheet .inventory-detail > h3 { grid-column: 2; grid-row: 1; }
  .screen-modal.inventory-sheet .inventory-detail > p { grid-column: 2; grid-row: 2; }
  .screen-modal.inventory-sheet .sheet-body:has(.inventory-feedback:not(:empty)) .item-inventory { height: 90px; max-height: 90px; }
}
