/* Redesigned Now Playing and persistent transport. All selectors are player-scoped. */
#panel[data-layout="full-player"],
#panel[data-layout="full-player"] .fullPlayer { background: rgb(var(--t-base)); color: #f4f6fb; }

#panel[data-layout="full-player"] .fullPlayer {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: transparent;
}
#panel[data-layout="full-player"] .fullPlayer::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: -16%;
  background: var(--np-ambient) center / cover;
  filter: blur(64px) saturate(1.6) brightness(.85);
  opacity: .95;
  transform: scale(1.15);
}
#panel[data-layout="full-player"] .fullPlayer::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgb(var(--t-base) / 15%), rgb(var(--t-base) / 35%) 45%, rgb(var(--t-base) / 92%));
}
#panel[data-layout="full-player"] .fullPlayer > :is(.npHeader, .npGrid) { position: relative; z-index: 1; }

#panel[data-layout="full-player"] .fullPlayer .npGrid {
  grid-template-rows: auto auto auto;
  row-gap: 20px;
  align-content: start;
}
#panel[data-layout="full-player"] .fullPlayer .npArt {
  display: block;
  width: min(86vw, 350px);
  min-height: 0;
  aspect-ratio: 1 / 1;
  height: auto;
  margin: 8px auto 0;
  background: transparent;
}
#panel[data-layout="full-player"] .fullPlayer .npArt .fullCover {
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  aspect-ratio: 1 / 1;
  margin: 0;
  border-radius: 14px;
  object-fit: cover;
  background: transparent;
  box-shadow: 0 24px 60px rgb(0 0 0 / 55%);
}

#panel[data-layout="full-player"] .fullPlayer .npDetails { margin-top: -4px; }
#panel[data-layout="full-player"] .fullPlayer .npTitleRow > div { min-width: 0; }
#panel[data-layout="full-player"] .fullPlayer .npTitle { overflow: hidden; text-overflow: ellipsis; text-wrap: nowrap; white-space: nowrap; }
#panel[data-layout="full-player"] .fullPlayer .npMode:not(:empty) {
  position: relative;
  left: 50%;
  display: inline-block;
  width: fit-content;
  min-height: 0;
  margin: 0 0 8px;
  padding: 3px 8px;
  transform: translateX(-50%);
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 999px;
  background: transparent;
  color: rgb(255 255 255 / 78%);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1.2;
  text-transform: uppercase;
}
#panel[data-layout="full-player"] .fullPlayer .npMode:empty { display: none; }

#panel[data-layout="full-player"] .fullPlayer .npTimeline .range:not(.volume)::-webkit-slider-runnable-track { background: linear-gradient(90deg, #fff, #fff) 0 / var(--range-progress, 0%) 100% no-repeat, rgb(255 255 255 / 25%); }
#panel[data-layout="full-player"] .fullPlayer .npTimeline .range:not(.volume)::-webkit-slider-thumb { background: #fff; box-shadow: none; }
#panel[data-layout="full-player"] .fullPlayer .npTimeline .range:not(.volume)::-moz-range-track { background: rgb(255 255 255 / 25%); }
#panel[data-layout="full-player"] .fullPlayer .npTimeline .range:not(.volume)::-moz-range-progress { background: #fff; }
#panel[data-layout="full-player"] .fullPlayer .npTimeline .range:not(.volume)::-moz-range-thumb { background: #fff; box-shadow: none; }

#panel[data-layout="full-player"] .fullPlayer .npSave,
#panel[data-layout="full-player"] .fullPlayer .npSave:hover,
#panel[data-layout="full-player"] .fullPlayer .npSave[aria-pressed="true"] { color: #fff; }
#panel[data-layout="full-player"] .fullPlayer .npSave .ico { fill: none; stroke: currentColor; }
#panel[data-layout="full-player"] .fullPlayer .npSave[aria-pressed="true"] .ico { fill: currentColor; stroke: currentColor; }

#panel[data-layout="full-player"] .fullPlayer .npTransport { justify-content: center; }
#panel[data-layout="full-player"] .fullPlayer .npTransport .icon,
#panel[data-layout="full-player"] .fullPlayer .npTools .npTool { border: 0; background: transparent; color: #f4f6fb; }
#panel[data-layout="full-player"] .fullPlayer .npTransport .icon:hover,
#panel[data-layout="full-player"] .fullPlayer .npTools .npTool:hover,
#panel[data-layout="full-player"] .fullPlayer .npTools .npTool:focus-visible { background: transparent; color: #fff; }
#panel[data-layout="full-player"] .fullPlayer .npTransport .npPlay { background: #fff; color: color-mix(in srgb, rgb(7 16 22 / 1), rgb(var(--t-surf) / 1) var(--t-mix)); }

#panel[data-layout="full-player"] .fullPlayer .npVolume {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  margin: 12px 0 2px;
  color: #f4f6fb;
}
#panel[data-layout="full-player"] .fullPlayer .npVolume .ico { width: 18px; height: 18px; }
#panel[data-layout="full-player"] .fullPlayer .npVolume .range { width: 100%; min-width: 0; max-width: none; }

#panel[data-layout="full-player"] .fullPlayer .npTools {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  justify-content: center;
  gap: 16px;
  margin-top: 14px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
#panel[data-layout="full-player"] .fullPlayer .npTools .npTool { width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; }
#panel[data-layout="full-player"] .fullPlayer .npTools .npTool .ico { color: currentColor; }

#panel[data-layout="full-player"] .fullPlayer .npPlaybackNote {
  width: 100%;
  min-height: 0;
  margin: 10px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgb(244 246 251 / 55%);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}
#panel[data-layout="full-player"] .fullPlayer .npPlaybackNote[hidden],
#panel[data-layout="full-player"] .fullPlayer .npTools .npTool[hidden],
#panel[data-layout="full-player"] .fullPlayer .npAirPlayStatus[hidden] { display: none; }
#panel[data-layout="full-player"] .fullPlayer.npUnavailable .npTimeline { display: none; }

#transport .range.volume,
#panel[data-layout="full-player"] .range.volume {
  --range-progress: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 14px;
  background: transparent;
  accent-color: #fff;
}
#transport .range.volume::-webkit-slider-runnable-track,
#panel[data-layout="full-player"] .range.volume::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: linear-gradient(90deg, #fff, #fff) 0 / var(--range-progress) 100% no-repeat, rgb(255 255 255 / 22%); }
#transport .range.volume::-webkit-slider-thumb,
#panel[data-layout="full-player"] .range.volume::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border: 0; border-radius: 50%; background: #fff; box-shadow: none; }
#transport .range.volume::-moz-range-track,
#panel[data-layout="full-player"] .range.volume::-moz-range-track { height: 4px; border-radius: 999px; background: rgb(255 255 255 / 22%); }
#transport .range.volume::-moz-range-progress,
#panel[data-layout="full-player"] .range.volume::-moz-range-progress { height: 4px; border-radius: 999px; background: #fff; }
#transport .range.volume::-moz-range-thumb,
#panel[data-layout="full-player"] .range.volume::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; box-shadow: none; }

#transport .nowRight > .icon[data-act="now"],
#transport .mobilePlay > .icon[data-act="now"] { color: #f4f6fb; }

@media (max-width: 650px) {
  #panel[data-layout="full-player"] .fullPlayer .npGrid { row-gap: 12px; }
  #panel[data-layout="full-player"] .fullPlayer .npArt { width: min(86vw, 350px); margin-top: 0; }
  #panel[data-layout="full-player"] .fullPlayer .npVolume { margin-top: 8px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  #panel[data-layout="full-player"] .fullPlayer .npGrid { grid-template-columns: minmax(180px, 350px) minmax(0, 1fr); column-gap: 28px; }
  #panel[data-layout="full-player"] .fullPlayer .npArt { grid-row: 1 / span 2; width: min(46vw, 350px); }
  #panel[data-layout="full-player"] .fullPlayer .npDetails { align-self: end; }
  #panel[data-layout="full-player"] .fullPlayer .npControls { align-self: start; }
}

/* Ivy: Apple Music feel. Full-screen colour from the cover art. */
.fullPlayer { position: relative; isolation: isolate; overflow: hidden; }
.fullPlayer::before { content: ""; position: absolute; inset: -20%; z-index: -2; background: var(--np-ambient) center / cover no-repeat; filter: blur(60px) saturate(1.5) brightness(.7); transform: scale(1.2); }
.fullPlayer::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, color-mix(in srgb, rgb(6 8 18 / 20%), rgb(var(--t-surf) / 20%) var(--t-mix)) 0%, color-mix(in srgb, rgb(6 8 18 / 45%), rgb(var(--t-surf) / 45%) var(--t-mix)) 55%, color-mix(in srgb, rgb(6 8 18 / 80%), rgb(var(--t-surf) / 80%) var(--t-mix)) 100%); }
.fullPlayer .npArt { box-shadow: 0 24px 60px rgb(0 0 0 / 50%); }
.fullPlayer .npDetails .npMode { justify-self: start; text-align: left; margin-inline: 0; }
.fullPlayer .npTransport { display: flex; justify-content: space-evenly; align-items: center; }
.fullPlayer .npTransport > .icon { width: 56px; height: 56px; opacity: 1; }
.fullPlayer .npTransport > .icon svg { width: 34px; height: 34px; }
.fullPlayer .npTools { display: flex; justify-content: space-between; width: 100%; padding-inline: 12px; box-sizing: border-box; }
.fullPlayer .npPlaybackNote { text-align: center; opacity: .6; font-size: 13px; }
.fullPlayer .npControls { display: grid; gap: 18px; }

/* Ivy: these must win over earlier player rules */
.fullPlayer .npTools { display: flex !important; justify-content: space-between !important; padding-inline: 16px !important; }
.fullPlayer .npDetails .npMode { display: inline-block !important; margin: 0 0 6px 0 !important; width: auto !important; }
.fullPlayer .npDetails { text-align: left !important; }
.fullPlayer .npTransport > .icon { width: 60px !important; height: 60px !important; }
.fullPlayer .npTransport > .icon svg { width: 36px !important; height: 36px !important; }

/* Fit the normal player into the viewport; only the dedicated lyrics reader scrolls. */
#panel[data-layout="full-player"] .fullPlayer .npGrid:has(.npArt:not([hidden])) {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: pinch-zoom;
}
@media (max-width:650px) {
  #panel[data-layout="full-player"] .fullPlayer .npGrid:has(.npArt:not([hidden])) {
    grid-template-rows: minmax(0, 1fr) auto auto;
    row-gap: clamp(6px, 1.2dvh, 12px);
  }
  #panel[data-layout="full-player"] .fullPlayer .npArt {
    display: grid;
    place-items: center;
    place-self: stretch;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    aspect-ratio: auto;
    container-type: size;
    box-shadow: none;
    transform: none;
  }
  #panel[data-layout="full-player"] .fullPlayer .npArt .fullCover {
    width: min(100cqw, 100cqh, 350px);
    height: min(100cqw, 100cqh, 350px);
    object-fit: contain;
  }
  #panel[data-layout="full-player"] .fullPlayer .npControls { gap: clamp(4px, 1.2dvh, 12px); }
  #panel[data-layout="full-player"] .fullPlayer .npTools { margin-top: 4px; }
  #panel[data-layout="full-player"] .fullPlayer .npVolume { margin-block: 4px 0; }
}
@media (max-height:500px) and (orientation:landscape) {
  #panel[data-layout="full-player"] .fullPlayer { padding-block: max(8px, env(safe-area-inset-top,0px)) max(8px, env(safe-area-inset-bottom,0px)); }
  #panel[data-layout="full-player"] .fullPlayer .npHeader { min-height:44px; margin-bottom:6px; }
  #panel[data-layout="full-player"] .fullPlayer .npGrid:has(.npArt:not([hidden])) {
    grid-template-columns:minmax(0, 1fr) minmax(0, 1.2fr);
    grid-template-rows:auto minmax(0, 1fr);
    row-gap:4px;
  }
  #panel[data-layout="full-player"] .fullPlayer .npArt {
    display:grid; place-items:center; place-self:stretch;
    width:100%; height:100%; margin:0; aspect-ratio:auto; container-type:size; transform:none; box-shadow:none;
  }
  #panel[data-layout="full-player"] .fullPlayer .npArt .fullCover { width:min(100cqw,100cqh,350px); height:min(100cqw,100cqh,350px); object-fit:contain; }
  #panel[data-layout="full-player"] .fullPlayer .npDetails { align-self:start; margin:0; }
  #panel[data-layout="full-player"] .fullPlayer .npControls { align-self:start; gap:0; }
  #panel[data-layout="full-player"] .fullPlayer .npTransport { min-height:48px; margin:0; }
  #panel[data-layout="full-player"] .fullPlayer .npTransport > .icon { width:48px!important; height:48px!important; }
  #panel[data-layout="full-player"] .fullPlayer .npTimeline,
  #panel[data-layout="full-player"] .fullPlayer .npVolume,
  #panel[data-layout="full-player"] .fullPlayer .npTools { margin-block:0; }
}

/* Lyrics share the current cover-colour player, with a separately scrolling page. */
#panel[data-layout="full-player"] .fullPlayer .npGrid:has(#npLyricReader:not([hidden])) {
  overflow: hidden;
  overscroll-behavior: none;
  grid-template-rows: minmax(0,1fr) auto;
}
#panel[data-layout="full-player"] #npLyricReader:not([hidden]) {
  width: 100%; height: 100%; min-height: 0; max-height: 100%;
  background: transparent; border: 0; border-radius: 0;
  padding: 0; box-shadow: none;
  --lyric-ink: #fff; --lyric-secondary: #d7d9df; --lyric-accent: #fff;
}
#panel[data-layout="full-player"] #npLyricReader .npLyricHeader {
  padding: 0 0 12px; border-bottom: 1px solid #ffffff24;
}
#panel[data-layout="full-player"] #npLyricReader .npLyricActions button {
  background: #ffffff16; border-color: #ffffff28; color: #fff; min-height: 44px;
}
#panel[data-layout="full-player"] #npLyricReader .npLyricLines {
  min-height: 0; touch-action: pan-y pinch-zoom; overscroll-behavior: contain;
  padding: 24px 0 48px; scroll-padding-block: 24px;
}
#panel[data-layout="full-player"] #npLyricReader .npLyricLines p {
  font-family: -apple-system, BlinkMacSystemFont, "HVR Tight", sans-serif;
  font-size: clamp(1.65rem, 4.7vw, 2.45rem); font-weight: 700; line-height: 1.25;
  letter-spacing: -.025em; padding: .28em 0; border: 0; border-radius: 0;
  background: transparent; color: #fff;
}
#panel[data-layout="full-player"] #npLyricReader .npLyricLines:has([aria-current]) p:not([aria-current]) { color: #c9cbd2; }
#panel[data-layout="full-player"] #npLyricReader .npLyricLines p[aria-current] { color: #fff; text-shadow: 0 2px 24px #ffffff25; }
#panel[data-layout="full-player"] #npLyricReader .npLyricLines p[aria-current] .sungWord { color: #fff; }
#lyricStage { color: #fff; --stage-quiet: #d7d9df; }
#lyricStage .lyricStageArt { filter: blur(55px) saturate(1.5); opacity: .65; }
#lyricStage::before { background: linear-gradient(180deg,color-mix(in srgb, rgb(6 8 18 / 0.4), rgb(var(--t-surf) / 0.4) var(--t-mix)),color-mix(in srgb, rgb(6 8 18 / 0.8), rgb(var(--t-surf) / 0.8) var(--t-mix))); }
#lyricStage :is(button,select) { background: #ffffff16; border-color: #ffffff30; color: #fff; }
#lyricStage .lyricStageCurrent { color: #fff; }
@media(max-width:650px) {
  #panel[data-layout="full-player"] .fullPlayer .npGrid:has(#npLyricReader:not([hidden])) { grid-template-rows: minmax(0,1fr) auto; gap: 10px; }
  #panel[data-layout="full-player"] #npLyricReader .npLyricIdentity { flex-basis: 100%; }
  #panel[data-layout="full-player"] #npLyricReader .npLyricActions { gap: 8px; }
}
@media(max-height:500px) and (orientation:landscape) {
  #panel[data-layout="full-player"] .fullPlayer .npGrid:has(#npLyricReader:not([hidden])) {
    grid-template-columns: minmax(0,1fr) minmax(0,1.2fr);
    grid-template-rows: auto minmax(0,1fr);
  }
  #panel[data-layout="full-player"] #npLyricReader .npLyricActions button { min-height: 36px; }
}
/* Cover sizing rules must never override the reader's hidden cover state. */
#panel[data-layout="full-player"] .fullPlayer .npArt[hidden] { display: none !important; }
