/* v280 Samsung Fold geometry and PWA continuity. Base iPhone styles are untouched. */
html.samsung-device,html.samsung-device body { background-color:#08080b!important; }
html.samsung-device body { overflow-x:hidden!important; }
html.samsung-device .app-shell { min-width:0!important; }
html.samsung-device .now-playing {
  box-sizing:border-box!important;
  width:100%!important;
  max-width:100%!important;
  max-height:none!important;
  overscroll-behavior:contain!important;
  -webkit-overflow-scrolling:touch!important;
}
html.samsung-device .np-header-actions { min-width:0!important; }
html.samsung-device .np-info, html.samsung-device .np-info-row,
html.samsung-device .scrubber-wrap,html.samsung-device .transport { min-width:0!important; }
html.samsung-device .now-playing:not(.hidden) { overflow-y:auto!important; overflow-x:hidden!important; }
/* Dynamic viewport instead of hard-coded iPhone geometry; preserve Fold cutout margins. */
@media (orientation:landscape) and (min-width:600px) {
  html.samsung-device .app-shell {
    width:100%!important;max-width:none!important;
    margin:0!important;
    padding-left:max(18px,env(safe-area-inset-left))!important;
    padding-right:max(18px,env(safe-area-inset-right))!important;
    padding-top:max(10px,env(safe-area-inset-top))!important;
  }
  html.samsung-device .mini-player {
    width:auto!important;max-width:none!important;
    left:max(18px,env(safe-area-inset-left))!important;
    right:max(18px,env(safe-area-inset-right))!important;
    transform:none!important;
  }
  html.samsung-device .now-playing:not(.hidden) {
    display:grid!important;
    grid-template-columns:minmax(0,42%) minmax(0,1fr)!important;
    grid-template-rows:30px minmax(58px,1fr) auto auto minmax(72px,1fr)!important;
    gap:5px 20px!important;
    align-items:center!important;
    height:100dvh!important;
    min-height:0!important;
    padding-top:max(8px,env(safe-area-inset-top))!important;
    padding-bottom:max(8px,env(safe-area-inset-bottom))!important;
    padding-left:max(16px,env(safe-area-inset-left))!important;
    padding-right:max(16px,env(safe-area-inset-right))!important;
  }
  html.samsung-device .np-header {grid-column:1/-1!important;grid-row:1!important; margin:0!important;min-height:28px!important;}
  html.samsung-device #npVinyl,
  html.samsung-device[data-player-style="avee"] #npVinyl {
    grid-column:1!important;grid-row:2/6!important;
    align-self:center!important;justify-self:center!important;
    --lossless-stage:min(67dvh,37vw,430px);
    width:var(--lossless-stage)!important;
    height:var(--lossless-stage)!important;
    max-width:100%!important;max-height:none!important;
    min-height:0!important;min-width:0!important;
    margin:0!important;aspect-ratio:1 / 1!important;
    overflow:hidden!important;
  }
  html.samsung-device:not([data-player-style="avee"]) #npVinyl{border-radius:50%!important;}
  html.samsung-device[data-player-style="avee"] #npVinyl {border-radius:18px!important;}
  html.samsung-device[data-player-style="avee"] .avee-canvas{
    position:absolute!important;inset:0!important;
    width:100%!important;height:100%!important;
    transform:none!important;
  }
  html.samsung-device .np-info-row {grid-column:2!important;grid-row:2!important;align-self:end!important;justify-self:stretch!important;margin:0!important;width:100%!important;}
  html.samsung-device .np-info h2{font-size:clamp(17px,4.2vh,27px)!important;line-height:1.12!important;}
  html.samsung-device .np-info p{font-size:clamp(11px,2.7vh,15px)!important;margin:5px 0!important;}
  html.samsung-device .quality-badge{grid-column:2!important;grid-row:3!important;align-self:center!important;justify-self:start!important;margin:0!important;max-width:100%!important;}
  html.samsung-device .scrubber-wrap{grid-column:2!important;grid-row:4!important;align-self:center!important;width:100%!important;max-width:none!important;margin:0!important;}
  html.samsung-device .transport{
    grid-column:2!important;grid-row:5!important;align-self:center!important;
    grid-template-columns:repeat(2,minmax(0,1fr)) minmax(54px,72px) repeat(2,minmax(0,1fr))!important;
    gap:2px!important;width:100%!important;max-width:none!important;margin:0!important;
  }
  html.samsung-device .transport .play-circle{width:clamp(52px,10vh,72px)!important;height:clamp(52px,10vh,72px)!important;}
  html.samsung-device .np-actions{display:none!important;}
}
/* Wide but portrait, as on a rotated unfolded inner display: retain one-column player
   while shrinking disc to keep title, scrubber and transport reachable. */
@media (orientation:portrait) and (min-width:600px) {
  html.samsung-device .app-shell {width:min(100%,860px)!important;max-width:none!important;}
  html.samsung-device .now-playing:not(.hidden) {
    height:100dvh!important;min-height:0!important;
    padding:max(10px,env(safe-area-inset-top)) max(26px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(26px,env(safe-area-inset-left))!important;
    overflow-y:auto!important;
  }
  html.samsung-device .np-header {margin:0 0 clamp(10px,2dvh,22px)!important;}
  html.samsung-device #npVinyl {
    width:min(42dvh,72vw,395px)!important;
    height:min(42dvh,72vw,395px)!important;
    max-width:100%!important;max-height:none!important;
    aspect-ratio:1/1!important;
    margin:0 auto clamp(10px,2.5dvh,22px)!important;
  }
  html.samsung-device[data-player-style="avee"] #npVinyl {
    border-radius:18px!important;
  }
  html.samsung-device[data-player-style="avee"] .avee-canvas {inset:0!important;width:100%!important;height:100%!important;transform:none!important;}
  html.samsung-device .np-info-row {margin:0 0 8px!important;}
  html.samsung-device .np-info h2 {font-size:clamp(22px,4vw,31px)!important;}
  html.samsung-device .quality-badge {margin:0 0 10px!important;}
  html.samsung-device .transport {margin:8px 0 0!important;}
  html.samsung-device .np-actions{display:none!important;}
}
/* Fold cover display in portrait: no player redesign, but the controls remain scrollable
   instead of silently being clipped on smaller Android font/display size settings. */
@media (orientation:portrait) and (max-width:599.98px) {
  html.samsung-device .now-playing:not(.hidden){overflow-y:auto!important;}
}
/* Narrow cover landscape: cap control sizes to available screen height. */
@media (orientation:landscape) and (min-width:600px) and (max-height:500px) {
  html.samsung-device .now-playing:not(.hidden){grid-template-rows:24px minmax(35px,1fr) auto auto minmax(54px,1fr)!important;row-gap:2px!important;}
  html.samsung-device #npVinyl,html.samsung-device[data-player-style="avee"] #npVinyl {--lossless-stage:min(60dvh,34vw,290px);}
  html.samsung-device .np-header{min-height:24px!important;}
  html.samsung-device .quality-badge{font-size:8px!important;padding:4px 8px!important;}
  html.samsung-device .transport .play-circle{width:52px!important;height:52px!important;font-size:23px!important;}
  html.samsung-device .np-info h2{font-size:clamp(16px,5vh,22px)!important;}
}
