/* Malsseum 4.6.1 — Film / exploration mobile width regression hotfix.
   Preserves the 4.5/4.6 visual design and all application data.
   Cause: grid min-content sizing of the five chapter thumbnails expanded
   .v4-main to ~375px even on a 320px viewport. */
.v4-overlay {
  inset:0;
  width:100%;
  max-width:100%;
  overflow-x:hidden!important;
  overflow-y:auto;
  overscroll-behavior-x:none;
  -webkit-overflow-scrolling:touch;
}
.v4-overlay .v4-shell {
  box-sizing:border-box;
  width:100%;
  max-width:1340px;
  min-width:0;
}
.v4-overlay .v4-layout {
  min-width:0;
}
.v4-overlay .v4-main,
.v4-overlay .v4-aside,
.v4-overlay .v4-player,
.v4-overlay .v4-track,
.v4-overlay .v4-quiz,
.v4-overlay .v4-fineprint {
  box-sizing:border-box;
  min-width:0;
  max-width:100%;
}
/* Prevent the five-column film chapter strip from imposing a min-content
   width on the one-column mobile layout. */
.v4-overlay .v4-track {
  grid-template-columns:repeat(5,minmax(0,1fr));
}
.v4-overlay .v4-track > button {
  min-width:0;
  width:100%;
  max-width:100%;
  overflow:hidden;
}
.v4-overlay .v4-track img {
  width:100%;
  max-width:100%;
}
.v4-overlay .v4-track b {
  overflow-wrap:anywhere;
  word-break:keep-all;
}
.v4-overlay .v4-video-wrap {
  min-width:0;
  width:100%;
  max-width:100%;
  aspect-ratio:16/9;
  overflow:hidden;
}
.v4-overlay .v4-video-wrap video {
  width:100%;
  height:100%;
  max-width:100%;
  object-fit:contain;
}
.v4-overlay .v4-panel,
.v4-overlay .v4-ctrl,
.v4-overlay .v4-progress {
  box-sizing:border-box;
  min-width:0;
  max-width:100%;
}
.v4-overlay .v4-ctrl {
  flex-wrap:wrap;
}
.v4-overlay .v4-switch {
  min-width:0;
}
@media(max-width:900px) {
  .v4-overlay .v4-layout {
    grid-template-columns:minmax(0,1fr);
  }
  .v4-overlay .v4-main,
  .v4-overlay .v4-aside {
    width:100%;
  }
  .v4-overlay .v4-shell {
    padding-left:clamp(10px,3.2vw,16px);
    padding-right:clamp(10px,3.2vw,16px);
  }
  /* The 210px forced player height distorted a 16:9 movie on small phones. */
  .v4-direct-cinema .v4-video-wrap {
    height:auto;
    min-height:0!important;
    aspect-ratio:16/9;
  }
  .v4-overlay .v4-track {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
  }
  .v4-overlay .v4-track img {
    aspect-ratio:2.1;
  }
  .v4-overlay .v4-track b {
    font-size:11px;
    padding:7px 10px 8px;
    line-height:1.4;
  }
  .v4-overlay .v4-topline,
  .v4-overlay .v4-brand {
    min-width:0;
    max-width:100%;
  }
}
@media(min-width:540px) and (max-width:900px) {
  .v4-overlay .v4-track {
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}
@media(max-width:400px) {
  /* Keep all controls visible without horizontal panning. Seek slider stays touchable. */
  .v4-overlay .v4-panel {padding:10px 9px 12px}
  .v4-overlay .v4-ctrl {
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:6px;
    width:100%;
  }
  .v4-overlay .v4-ctrl .v4-control {
    box-sizing:border-box;
    width:100%;
    max-width:100%;
    min-width:0;
    padding:9px 2px;
    font-size:clamp(10px,2.8vw,12px);
    white-space:nowrap;
  }
  .v4-overlay .v4-ctrl .v4-time {
    grid-column:1;
    margin-left:0;
    font-size:10px;
    letter-spacing:-.035em;
    white-space:nowrap;
    align-self:center;
  }
  .v4-overlay .v4-ctrl .v4-switch {
    grid-column:2 / span 2;
    margin:0;
    padding:3px;
    width:100%;
    justify-content:space-evenly;
  }
  .v4-overlay .v4-switch button {
    padding:7px 4px;
    flex:1 1 0;
    min-width:0;
  }
  .v4-overlay .v4-ctrl .v4-control[data-v4="fullscreen"] {
    grid-column:4;
  }
  .v4-overlay .v4-prompt button {
    max-width:100%;
    font-size:clamp(12px,4vw,15px);
  }
  .v4-overlay .v4-watermark {
    max-width:calc(100% - 18px);
    overflow-wrap:anywhere;
    font-size:9px;
  }
}
/* The two non-Mark exploratory journeys share the same contained main region. */
#adventure-root,
#adventure-root .adventure-ui,
#adventure-root .mb-episode,
#adventure-root .mb-catalog,
#adventure-root .ad-episode,
#adventure-root .context-explorer {
  min-width:0;
  max-width:100%;
}
#adventure-root .ad-artwork,
#adventure-root .mb-episode-art {
  max-width:100%;
  overflow:hidden;
}
