/* Koi garden on phones (Lab, Nov 17 2026; Jez: "fix the koi garden's overlapping buttons").
   Added to the built /learn/koi-pond/ page by tools/apply-showroom-phone.mjs, after the program's own
   stylesheets, so the program synced from jez237-site is not edited. */

/* Status messages ("the koi gather", "Pond paused: O to swim again") appeared behind the menu buttons. */
@media(max-width:850px){#toast{top:120px}}
@media(max-width:530px){#toast{top:160px}}

/* A touch screen has no keyboard: the Guide keeps its one line about tapping and drops the list of keys. */
@media(hover:none) and (pointer:coarse){
#help dl,#help .foot{display:none}
#help .lead{margin:0}
}

/* A short window (a phone held sideways): the Guide ends above the row of view buttons instead of under it. */
@media(max-height:560px){#help{max-height:calc(100dvh - 89px - 124px);overflow-y:auto}}

/* Guide open on a mid-width screen: the message sits to the right of it, under the menu buttons, not across it. */
@media(min-width:601px) and (max-width:850px){#help:not(.hidden)~#toast{left:auto;right:16px;transform:none;max-width:calc(100vw - 356px)}}

/* Leave the middle of the pond available even while reading or changing settings. */
@media(max-width:700px) and (orientation:portrait){
  body{--pond-sheet-height:min(30dvh,calc(50dvh - 130px))}
  body.panel-open #panel{top:auto;max-height:var(--pond-sheet-height);overscroll-behavior:contain;padding:12px 16px}
  #panel #close-panel{width:40px;height:40px}
  body .dg.ac{top:auto!important;bottom:124px;left:12px;right:12px!important;height:var(--pond-sheet-height)}
  body .dg.ac .dg.main{width:100%!important;max-height:var(--pond-sheet-height)!important}
}
@media(pointer:coarse) and (orientation:landscape) and (max-height:520px){
  body.panel-open #panel{left:auto;right:10px;top:48px;bottom:76px;width:42vw;padding:10px 14px}
  body .dg.ac{top:56px!important;right:10px!important}
  body .dg.ac .dg.main{width:min(40vw,300px)!important;max-height:calc(100dvh - 136px)!important}
}
/* A narrow phone held sideways (under about 740 px wide): the Settings panel reached down over the Settings button
   in the row of view buttons, so its own "Close Controls" bar took the tap (Nov 24 2026). It now ends above that row. */
@media(pointer:coarse) and (orientation:landscape) and (max-height:520px) and (max-width:740px){
  body .dg.ac .dg.main{max-height:calc(100dvh - 177px)!important}
}
