/* Fit the actual visible viewport; court projection shares the measured inset. */
.picnic-game-shell {
  min-height: 0;
  height: var(--picnic-viewport-height, 100dvh);
  overflow: hidden;
}
.picnic-game-shell > .dual-page {
  min-height: 0;
  height: calc(var(--picnic-viewport-height, 100dvh) - var(--game-settings-space) - env(safe-area-inset-bottom));
}
.picnic-game-shell .orientation-hint { display: none; }
.picnic-game-shell.needs-portrait .dual-page > :not(.orientation-hint) { visibility: hidden; }
.picnic-game-shell.needs-portrait .orientation-hint {
  position: absolute;
  inset: 8px;
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: auto;
  padding: 18px;
  background: #fffbedf5;
  color: #466e55;
  border: 2px solid #d5dfb0;
  border-radius: 24px;
  text-align: center;
  pointer-events: auto;
}
.orientation-hint > span { font-size: 44px; line-height: 1; }
.orientation-hint strong { font-size: 22px; }
.orientation-hint small { font-size: 14px; line-height: 1.5; }

/* Narrow portrait screens keep every hit target in separate edge bands. */
.dual-page.is-compact .player-hud { display: flex; height: 66px; padding: 5px 6px; gap: 7px; align-items: center; }
.dual-page.is-compact .player-hud.bottom,
.dual-page.is-compact .player-hud.top { align-items: center; }
.dual-page.is-compact .dual-person { flex: 1; flex-direction: row; width: auto; min-width: 0; gap: 5px; padding: 4px; border-radius: 16px; text-align: left; }
.dual-page.is-compact .dual-person .avatar { width: 30px; height: 30px; border-width: 2px; }
.dual-page.is-compact .dual-person h2 { font-size: 15px; line-height: 1.2; }
.dual-page.is-compact .dual-person .role { margin-top: 2px; font-size: 10px; line-height: 1.25; word-break: keep-all; }
.dual-page.is-compact .score-pill { flex: none; width: auto; min-width: 46px; padding: 3px 5px; border-radius: 13px; }
.dual-page.is-compact .score-pill b { font-size: 21px; line-height: 1.1; }
.dual-page.is-compact .score-pill span,
.dual-page.is-compact .score-pill small { font-size: 9px; line-height: 1.25; }
.dual-page.is-compact .item-button { flex: none; align-self: center; width: auto; min-width: 66px; min-height: 52px; max-width: 72px; padding: 3px 4px; border-radius: 13px; font-size: 10px; line-height: 1.25; }
.dual-page.is-compact .item-button strong { margin-bottom: 1px; }
.dual-page.is-compact .item-button strong .game-action-icon { width: 25px; height: 25px; }
.dual-page.is-compact .dual-tip { display: none; }
.dual-page.is-compact .launch-button,
.dual-page.is-compact .orchard-weather { width: min(60%, 240px); min-width: 0; height: 44px; min-height: 44px; max-width: calc(100% - 120px); padding: 3px 8px; font-size: 12px; border-radius: 14px; }
.dual-page.is-compact .launch-button.bottom,
.dual-page.is-compact .orchard-weather.bottom { top: auto; bottom: 70px; }
.dual-page.is-compact .launch-button.top,
.dual-page.is-compact .orchard-weather.top { bottom: auto; top: 70px; }
.dual-page.is-compact .orchard-weather .orchard-obstacle-art { width: 30px; height: 30px; }
.dual-page.is-compact .orchard-weather b { font-size: 11px; line-height: 1.2; }
.dual-page.is-compact .orchard-weather small { font-size: 9px; line-height: 1.2; }
.dual-page.is-compact .dual-middle { inset: 0; height: 100%; transform: none; display: block; padding: 0; }
.dual-page.is-compact .dual-middle > .iconbtn { position: absolute; top: calc(50% - 22px); width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 9px; }
.dual-page.is-compact .dual-middle > .iconbtn:first-child { left: 3px; }
.dual-page.is-compact .dual-middle > .iconbtn:last-child { right: 3px; }
.dual-page.is-compact .dual-timer { left: 5px; top: 70px; width: 49px; height: 44px; padding: 3px 1px; border-radius: 11px; }
.dual-page.is-compact .picnic-match-label,
.dual-page.is-compact .picnic-settings-label { display: none; }
.dual-page.is-compact .dual-timer #turn-label { font-size: 8px; line-height: 1; white-space: nowrap; }
.dual-page.is-compact .dual-timer strong { font-size: 17px; line-height: 1.2; }
.dual-page.is-compact .farmer-hud { top: 4px; min-height: 0; height: calc(var(--picnic-court-inset) - 8px); grid-template-columns: minmax(0,1fr) calc((var(--picnic-court-inset) - 8px)*.667) minmax(0,1fr); }
.dual-page.is-compact .farmer-stage { width: calc((var(--picnic-court-inset) - 8px)*.667); height: calc(var(--picnic-court-inset) - 8px); }
.dual-page.is-compact .farmer-hud-copy { margin-left: 0; padding: 6px 4px; border-radius: 14px; }
.dual-page.is-compact .farmer-hud h2 { font-size: 15px; line-height: 1.3; }
.dual-page.is-compact .farmer-hud p { display: none; }
.dual-page.is-compact .farmer-skill-tag { padding: 2px 3px; margin-bottom: 3px; font-size: 9px; }
.dual-page.is-compact .farmer-action { left: -73px; top: 13px; min-width: 66px; padding: 5px; font-size: 11px; }
.dual-page.is-compact .farmer-hand-fruit,
.dual-page.is-compact .farmer-release-fruit { width: 23px; height: 23px; }
.dual-page.is-compact .farmer-release-fruit,
.dual-page.is-compact .farmer-release-arc { display: none; }
.dual-page.is-compact .round-banner { left: 56px; width: calc(100% - 112px); top: calc(50% - 104px); padding: 10px; font-size: 17px; line-height: 1.35; border-radius: 18px; }
.dual-page.is-compact .round-banner.bottom { top: auto; bottom: calc(50% - 104px); }
.dual-page.is-compact .round-banner small { margin-top: 4px; font-size: 11px; }
.dual-page.is-compact.farmer-game .round-banner.bottom { top: 50%; bottom: auto; transform: translateY(-50%); }
.dual-page.is-compact .duel-toast { display: none; }

/* Tall narrow phones still need compact horizontal HUD sizing. */
@media (max-width: 650px) {
  .picnic-game-shell > .game-settings-bar { margin-inline: 6px; }
}

/* The orchard lane is the foreground. The farmkeeper stands behind its far
   edge, so his face and throwing arm stay large without reserving leg space. */
.picnic-game-shell .dual-canvas { z-index: 2; }
.picnic-game-shell .player-hud,
.picnic-game-shell .launch-button,
.picnic-game-shell .orchard-weather { z-index: 3; }
.picnic-game-shell .dual-middle,
.picnic-game-shell .round-banner,
.picnic-game-shell .duel-toast { z-index: 4; }
.dual-page.farmer-game .farmer-hud {
  z-index: 1;
  top: 4px;
  min-height: 0;
  height: calc(var(--picnic-court-inset) - 8px);
  grid-template-columns: minmax(0, 1fr) calc(var(--picnic-court-inset) * 1.06) minmax(0, 1fr);
}
.dual-page.farmer-game .farmer-stage {
  width: calc(var(--picnic-court-inset) * 1.06);
  height: calc(var(--picnic-court-inset) - 8px);
}
.dual-page.farmer-game .farmer-body {
  bottom: auto;
  height: calc(var(--picnic-court-inset) * 1.59);
  transform-origin: 50% 56%;
}
.dual-page.farmer-game .farmer-release-arc,
.dual-page.farmer-game .farmer-release-fruit { display: none; }
.dual-page.farmer-game .farmer-hud-copy { margin-left: 0; padding: 8px; max-width: 205px; border-radius: 16px; }
.dual-page.farmer-game .farmer-hud h2 { font-size: 20px; line-height: 1.3; }
.dual-page.farmer-game .farmer-hud p { font-size: 12px; line-height: 1.4; margin-top: 4px; word-break: keep-all; }
.dual-page.farmer-game .farmer-skill-tag { padding: 3px 5px; margin-bottom: 4px; font-size: 10px; }
.dual-page.farmer-game .farmer-action { left: -103px; top: 15px; min-width: 92px; padding: 6px 8px; font-size: 14px; }
.dual-page.is-compact.farmer-game .farmer-hud-copy { padding: 6px 4px; }
.dual-page.is-compact.farmer-game .farmer-hud h2 { font-size: 14px; }
.dual-page.is-compact.farmer-game .farmer-skill-tag { padding: 2px 3px; font-size: 9px; }
.dual-page.is-compact.farmer-game .farmer-action { left: -73px; top: 13px; min-width: 66px; padding: 5px; font-size: 11px; }

/* Tablets use the same short edge bands as phones, with larger type and
   controls. These bands match courtLayout's reserved 124px plus the basket. */
.dual-page:not(.is-compact) .player-hud { height: 78px; padding: 6px 12px; gap: 10px; align-items: center; }
.dual-page:not(.is-compact) .dual-person { flex-direction: row; width: auto; min-width: 0; gap: 8px; padding: 4px 8px; border-radius: 18px; text-align: left; }
.dual-page:not(.is-compact) .dual-person .avatar { width: 44px; height: 44px; }
.dual-page:not(.is-compact) .dual-person h2 { font-size: 18px; line-height: 1.2; }
.dual-page:not(.is-compact) .dual-person .role { margin-top: 3px; font-size: 11px; line-height: 1.25; }
.dual-page:not(.is-compact) .score-pill { min-width: 60px; padding: 4px 10px; }
.dual-page:not(.is-compact) .score-pill b { font-size: 26px; line-height: 1.1; }
.dual-page:not(.is-compact) .score-pill span,
.dual-page:not(.is-compact) .score-pill small { font-size: 10px; line-height: 1.25; }
.dual-page:not(.is-compact) .item-button { align-self: center; min-width: 82px; min-height: 60px; max-width: 94px; padding: 4px 7px; border-radius: 15px; font-size: 11px; line-height: 1.25; }
.dual-page:not(.is-compact) .item-button strong { margin-bottom: 1px; }
.dual-page:not(.is-compact) .item-button strong .game-action-icon { width: 28px; height: 28px; }
.dual-page:not(.is-compact) .dual-tip { display: none; }
.dual-page:not(.is-compact) .launch-button,
.dual-page:not(.is-compact) .orchard-weather { width: min(60%, 300px); min-width: 0; height: 44px; min-height: 44px; max-width: calc(100% - 150px); padding: 3px 10px; font-size: 14px; border-radius: 14px; }
.dual-page:not(.is-compact) .launch-button.bottom,
.dual-page:not(.is-compact) .orchard-weather.bottom { top: auto; bottom: 80px; }
.dual-page:not(.is-compact) .launch-button.top,
.dual-page:not(.is-compact) .orchard-weather.top { bottom: auto; top: 80px; }
.dual-page:not(.is-compact) .orchard-weather .orchard-obstacle-art { width: 30px; height: 30px; }
.dual-page:not(.is-compact) .orchard-weather b { font-size: 12px; line-height: 1.2; }
.dual-page:not(.is-compact) .orchard-weather small { font-size: 10px; line-height: 1.2; }
.dual-page:not(.is-compact) .dual-middle { inset: 0; height: 100%; transform: none; display: block; padding: 0; }
.dual-page:not(.is-compact) .dual-middle > .iconbtn { position: absolute; top: calc(50% - 25px); width: 50px; min-width: 50px; height: 50px; min-height: 50px; padding: 10px; }
.dual-page:not(.is-compact) .dual-middle > .iconbtn:first-child { left: 5px; }
.dual-page:not(.is-compact) .dual-middle > .iconbtn:last-child { right: 5px; }
.dual-page:not(.is-compact) .dual-timer { left: 5px; top: 80px; width: 64px; min-width: 0; height: 44px; padding: 3px 2px; border-radius: 11px; }
.dual-page:not(.is-compact) .picnic-match-label,
.dual-page:not(.is-compact) .picnic-settings-label { display: none; }
.dual-page:not(.is-compact) .dual-timer #turn-label { font-size: 10px; line-height: 1; white-space: nowrap; }
.dual-page:not(.is-compact) .dual-timer strong { font-size: 20px; line-height: 1.2; }
