/* Reserve the real recipe height before placing the forest shortcut. The
   canvas stays continuous behind both rows; the action has no extra panel. */
#app .game-shell[data-page="camp"] .mother-camp-overview {
  display: flex;
  flex-direction: column;
  container-type: size;
}
#app .game-shell[data-page="camp"] .camp-tap-anchor {
  position: relative;
  z-index: 2;
  flex: 1 1 0;
  min-height: 52px;
  pointer-events: none;
}
#app .game-shell[data-page="camp"] .camp-tap-anchor > .camp-tap-hotspot {
  top: min(calc(51cqh - 22px), calc(100% - 52px));
  bottom: auto;
  left: 43%;
  width: 52px;
  height: 44px;
  min-height: 44px;
  transform: translateX(-50%);
  pointer-events: auto;
}
#app .game-shell[data-page="camp"] .camp-tap-anchor > .camp-tap-hotspot:active {
  transform: translateX(-50%);
  filter: brightness(1.08) drop-shadow(0 3px 0 #35241599);
}
@container (max-width: 340px) {
  #app .game-shell[data-page="camp"] .camp-tap-anchor > .camp-tap-hotspot {
    top: min(calc(43cqh - 22px), calc(100% - 52px));
  }
}
#app .game-shell[data-page="camp"] .mother-camp-overview > :is(.mother-upgrade-split,.camp-upgrade-compact) {
  position: relative;
  inset: auto;
  flex: none;
  width: calc(100% - 8px);
  margin: 0 4px 3px;
}
#app .game-shell[data-page="camp"] .mother-camp-overview > .camp-mastered-board {
  position: relative;
  inset: auto;
  flex: none;
  width: calc(100% - 8px);
  margin: 0 4px 3px;
}

/* The two papers share a compact ledger rhythm. Reserve the forest by
   removing repeated inset padding, without cropping or moving its animals. */
#app .game-shell[data-page="camp"] .camp-recipe-papers > article {
  padding: 9px 11px;
}
#app .game-shell[data-page="camp"] .camp-recipe-papers :is(.mother-current-upgrade,.mother-next-upgrade) > h2 {
  font-size: 13px;
  line-height: 18px;
  margin-bottom: 2px;
}
#app .game-shell[data-page="camp"] .camp-recipe-papers h3 {
  line-height: 14px;
  margin-bottom: 1px;
}
#app .game-shell[data-page="camp"] .camp-recipe-papers :is(.mother-upgrade-cost > .resource-list,.mother-next-upgrade > .resource-list) {
  gap: 1px;
}
#app .game-shell[data-page="camp"] .camp-recipe-papers .mother-next-upgrade > .resource-list {
  padding: 0;
  border: 0;
  background: none;
}
#app .game-shell[data-page="camp"] .camp-recipe-papers .mother-next-upgrade > .mother-upgrade-stats {
  padding: 0;
  margin-top: 3px;
  border: 0;
  background: none;
}
#app .game-shell[data-page="camp"] .camp-recipe-papers .mother-next-upgrade .stat-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: baseline;
  gap: 0 3px;
  min-height: 0;
}
#app .game-shell[data-page="camp"] .camp-recipe-papers .mother-next-upgrade .stat-row > :is(span,b,small) {
  flex: 0 0 auto;
  order: initial;
}
#app .game-shell[data-page="camp"] .camp-recipe-papers .mother-next-upgrade .stat-row > span {
  grid-column: 1;
  grid-row: 1;
  font-size: 10px;
  line-height: 20px;
}
#app .game-shell[data-page="camp"] .camp-recipe-papers .mother-next-upgrade .stat-row > b {
  grid-column: 2;
  grid-row: 1;
  font-size: 14px;
  line-height: 20px;
}
#app .game-shell[data-page="camp"] .camp-recipe-papers .mother-next-upgrade .stat-row > small {
  grid-column: 3;
  grid-row: 1;
  font-size: 10px;
  line-height: 12px;
}
#app .game-shell[data-page="camp"] .camp-recipe-papers .mother-next-shortfall {
  margin-top: 3px;
}
#app .game-shell[data-page="camp"] .camp-recipe-papers .mother-next-shortfall .material-term {
  line-height: 14px;
}
#app .game-shell[data-page="camp"] .camp-recipe-papers .mother-payment {
  padding-top: 2px;
  margin-top: 2px;
}
#app .game-shell[data-page="camp"] .camp-recipe-papers .mother-payment > span {
  margin-bottom: 0;
}
#app .game-shell[data-page="camp"] .camp-recipe-papers .mother-payment .resource-value {
  height: 18px;
}
#app .game-shell[data-page="camp"] .camp-recipe-papers .mother-current-upgrade > .button {
  height: 44px;
  min-height: 44px;
}
/* The mother's plain green navigation face shares the existing action slot.
   Keep its corners at that slot's scale instead of the growth-page height. */
#app .game-shell[data-page="camp"] .camp-recipe-papers .mother-current-upgrade > button.camp-upgrade-route[data-button-skin="workshop"] {
  --upgrade-skin-height: 44px;
  height: 44px; min-height: 44px;
}

/* The narrow layout keeps the forest space of the current recipe. Its next
   paper opens above the shared action row instead of pushing the animals
   behind another permanently expanded panel. */
@container (max-width: 380px) {
  #app .game-shell[data-page="camp"] .camp-compact-actions {
    position: relative; display: grid;
    grid-template-columns: minmax(0,1fr) 88px; gap: 5px;
    align-items: stretch; min-width: 0;
  }
  #app .game-shell[data-page="camp"] .camp-compact-actions > .button {
    width: 100%; margin: 0;
  }
  #app .game-shell[data-page="camp"] .camp-next-preview { min-width: 0; }
  #app .game-shell[data-page="camp"] .camp-next-preview[open] {
    position: absolute; z-index: 6; right: 0; bottom: 0;
    width: 100%; pointer-events: none;
  }
  #app .game-shell[data-page="camp"] .camp-next-preview > summary {
    position: relative; isolation: isolate; display: flex;
    flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; height: 56px; min-height: 56px; padding: 5px 7px;
    list-style: none; color: #69441f; font-size: 13px; line-height: 18px;
    font-weight: bold; cursor: pointer;
  }
  #app .game-shell[data-page="camp"] .camp-next-preview > summary::-webkit-details-marker { display: none; }
  #app .game-shell[data-page="camp"] .camp-next-preview[open] > summary {
    position: absolute; right: 0; bottom: 0; width: 88px;
    pointer-events: auto;
  }
  #app .game-shell[data-page="camp"] .camp-next-preview > summary > .paper-frame-skin { --paper-frame-scale: .055; }
  #app .game-shell[data-page="camp"] .camp-next-preview > summary small {
    color: #8d6b39; font-size: 11px; line-height: 15px;
  }
  #app .game-shell[data-page="camp"] .camp-next-preview:not([open]) .camp-next-hide,
  #app .game-shell[data-page="camp"] .camp-next-preview[open] .camp-next-show { display: none; }
  #app .game-shell[data-page="camp"] .camp-next-sheet {
    position: relative; isolation: isolate; width: 100%;
    margin-bottom: 62px; pointer-events: auto;
    display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr);
    gap: 3px 9px; padding: 11px 13px;
    color: #674726; filter: drop-shadow(0 4px 2px #263c2e99);
  }
  #app .game-shell[data-page="camp"] .camp-next-sheet > .paper-frame-skin { --paper-frame-scale: .085; }
  #app .game-shell[data-page="camp"] .camp-next-sheet > h2 {
    grid-column: 1 / -1; margin: 0 0 2px;
    padding-bottom: 3px; border-bottom: 1px solid #c5a266;
    font-size: 15px; line-height: 21px;
  }
  #app .game-shell[data-page="camp"] .camp-next-sheet > h3 {
    grid-column: 1; grid-row: 2; margin: 0;
    font-size: 11px; line-height: 17px;
  }
  #app .game-shell[data-page="camp"] .camp-next-sheet > .resource-list {
    grid-column: 1; grid-row: 3; flex-direction: column;
    align-items: start; gap: 2px;
  }
  #app .game-shell[data-page="camp"] .camp-next-sheet .resource-value {
    font-size: 11px; line-height: 20px; gap: 3px;
  }
  #app .game-shell[data-page="camp"] .camp-next-sheet .resource-value b { font-size: 15px; line-height: 20px; }
  #app .game-shell[data-page="camp"] .camp-next-sheet .resource-value > span { font-size: 11px; }
  #app .game-shell[data-page="camp"] .camp-next-sheet .resource-icon { width: 17px; height: 21px; }
  #app .game-shell[data-page="camp"] .camp-next-sheet > .mother-upgrade-stats {
    grid-column: 2; grid-row: 2 / span 2; padding-left: 7px;
    border-left: 1px solid #c5a266;
  }
  #app .game-shell[data-page="camp"] .camp-next-sheet .mother-upgrade-stats h3 {
    margin: 0 0 3px; font-size: 11px; line-height: 17px;
  }
  #app .game-shell[data-page="camp"] .camp-next-sheet .stat-row {
    display: grid; grid-template-columns: minmax(0,1fr) auto;
    align-items: baseline; gap: 0 3px; margin: 0 0 3px;
  }
  #app .game-shell[data-page="camp"] .camp-next-sheet .stat-row > span { grid-column: 1; grid-row: 1; font-size: 11px; line-height: 17px; }
  #app .game-shell[data-page="camp"] .camp-next-sheet .stat-row > b { grid-column: 1 / -1; grid-row: 2; font-size: 17px; line-height: 23px; white-space: nowrap; }
  #app .game-shell[data-page="camp"] .camp-next-sheet .stat-row > small { grid-column: 2; grid-row: 1; font-size: 10px; line-height: 17px; }
  #app .game-shell[data-page="camp"] .camp-next-sheet > .mother-next-shortfall {
    grid-column: 1 / -1; margin-top: 2px; padding-top: 4px;
    border-top: 1px solid #c5a266; font-size: 11px; line-height: 17px;
  }
  #app .game-shell[data-page="camp"] .camp-next-sheet :is(.sufficient,.deficit,.muted) { margin: 1px 0 0; line-height: 17px; }
  #app .game-shell[data-page="camp"] .camp-next-sheet > .sufficient { grid-column: 1 / -1; }
}
