/* Cuba Beisbol Tarjetas v5.6 — fix opening text overlap on iPhone.
 * Never allow the 5:9.4 card+foil scene to overrun its flex stage.
 * This changes layout only: original artwork and swipe animations are untouched.
 */
.opening-overlay .opening-stage:has(.opening-draw-scene){
  container-type:size;
  min-height:0;
}
/* Safe viewport-based fallback for browsers without container query length units. */
.opening-overlay .opening-draw-scene{
  width:min(74vw,310px,max(110px,calc((100dvh - 350px)*5/9.4)));
}
@supports (width: 1cqh){
  .opening-overlay .opening-draw-scene{
    width:min(74vw,310px,max(110px,calc((100cqh - 20px)*5/9.4)));
  }
}
/* Keep all supply information in its own row, no wrap into the foil artwork. */
.opening-overlay .opening-supply{width:min(340px,100%);flex:0 0 auto}
.opening-overlay .supply-inline{width:100%;margin:0;padding:3px 0 2px}
.opening-overlay .supply-inline>div:first-child{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  align-items:baseline;
  justify-content:stretch;
  gap:5px;
  flex-wrap:nowrap;
  white-space:nowrap;
}
.opening-overlay .supply-inline span{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  font-size:clamp(8px,2.15vw,9px);
  letter-spacing:0;
}
.opening-overlay .supply-inline strong{font-size:clamp(17px,4.45vw,21px)}
.opening-overlay .supply-inline small{font-size:clamp(10px,2.8vw,12px)}
.opening-overlay .supply-inline .supply-track{margin-top:4px}
.opening-overlay .opening-bottom:has(.supply-inline){gap:4px;padding-top:5px}
/* On shorter viewports prevent the reveal metadata from collapsing into the counter. */
.opening-overlay .opening-reveal-label{flex:0 0 auto;gap:3px}
.opening-overlay .opening-reveal-label>strong{line-height:1.14}
@media(max-height:690px){
 .opening-overlay .opening-bottom:has(.supply-inline){gap:3px;padding-top:3px}
 .opening-overlay .supply-inline{padding:1px 0}
}
