/* ===== Full-screen player: flat controls on a live cover-colour background =====
   Replaces the glows, pulse ring and equaliser-in-the-button of style.css; the background is three soft colour
   fields drifting back and forth (transform/opacity only, so the compositor does the work), kept away from the text.
   Loaded after ui.css; every rule is scoped to #player-full. Layout rules that differ per screen are in
   three blocks: phone portrait (default), phone landscape (short), desktop (>= 1024px keeps its own grid). */

/* ---- surface: tint of the cover colour + a slow drift of three colour fields ---- */
@property --pf-acc { syntax: '<color>'; inherits: true; initial-value: hsl(0 0% 100%); }
#player-full {
  --pf-base: #0d0d0f;
  --pf-text-2: #b6b6be;                      /* artist, labels */
  --pf-text-3: #b0b0b9;                      /* times, caption */
  --pf-line: rgba(255, 255, 255, 0.1);
  --pf-acc: var(--acc);                      /* own copy: it cross-fades between tracks while the page behind stays still */
  transition: --pf-acc 1.2s ease;
  background: linear-gradient(180deg, color-mix(in srgb, var(--pf-acc) 22%, var(--pf-base)) 0%, var(--pf-base) 75%);
}
#player-full > .pf-aura { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; contain: strict; }
.pf-aura i {
  position: absolute; left: 50%; top: 50%; width: 125vmin; height: 125vmin; margin: -62.5vmin 0 0 -62.5vmin; border-radius: 50%;
  will-change: transform, opacity; backface-visibility: hidden;
}
.pf-aura i:nth-child(1) { background: radial-gradient(closest-side, color-mix(in srgb, var(--pf-acc) 55%, #000), transparent); animation: pf-aura-a 11s ease-in-out -4s infinite alternate; }
.pf-aura i:nth-child(2) { background: radial-gradient(closest-side, color-mix(in srgb, var(--pf-acc) 45%, hsl(205 70% 22%)), transparent); animation: pf-aura-b 14s ease-in-out -9s infinite alternate; }
.pf-aura i:nth-child(3) { background: radial-gradient(closest-side, color-mix(in srgb, var(--pf-acc) 45%, hsl(320 60% 22%)), transparent); animation: pf-aura-c 17s ease-in-out -2s infinite alternate; }
@supports (color: oklch(from red l c h)) {      /* same cover colour, fixed perceptual lightness (a yellow cover must not get brighter than a blue one), neighbouring hues */
  .pf-aura i:nth-child(1) { background: radial-gradient(closest-side, oklch(from var(--pf-acc) 0.54 c h), transparent); }
  .pf-aura i:nth-child(2) { background: radial-gradient(closest-side, oklch(from var(--pf-acc) 0.52 c calc(h + 45)), transparent); }
  .pf-aura i:nth-child(3) { background: radial-gradient(closest-side, oklch(from var(--pf-acc) 0.52 c calc(h - 45)), transparent); }
}
@keyframes pf-aura-a { from { transform: translate3d(-42vw, -24vh, 0) scale(0.85); opacity: 0.7; } to { transform: translate3d(36vw, 12vh, 0) scale(1.3); opacity: 1; } }
@keyframes pf-aura-b { from { transform: translate3d(44vw, -8vh, 0) scale(1.25); opacity: 1; } to { transform: translate3d(-40vw, 24vh, 0) scale(0.85); opacity: 0.55; } }
@keyframes pf-aura-c { from { transform: translate3d(-30vw, 26vh, 0) scale(0.95); opacity: 0.5; } to { transform: translate3d(34vw, -28vh, 0) scale(1.3); opacity: 0.95; } }
/* it flows while music plays and rests on pause; a swipe in progress freezes it so the gesture stays smooth */
#player-full:not(.is-playing) .pf-aura i, #player-full.pf-drag .pf-aura i { animation-play-state: paused; }
/* static dark veil over the fields: whatever colour a cover has, the text rows stay on a dark ground */
.pf-aura b {                                 /* the controls block is a fixed ~300px tall column at the bottom, the top bar is 52px: measure from the edges, not in % */
  position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, rgba(13, 13, 15, 0.7) 0, rgba(13, 13, 15, 0.7) 56px, transparent 130px),
    linear-gradient(to top, rgba(13, 13, 15, 0.88) 0, rgba(13, 13, 15, 0.72) 270px, rgba(13, 13, 15, 0.4) 340px, transparent 430px);
}
@media (min-width: 1024px), (orientation: landscape) and (max-height: 540px) {   /* text sits on the right: veil sideways */
  .pf-aura b { background: linear-gradient(to bottom, rgba(13, 13, 15, 0.7) 0, rgba(13, 13, 15, 0.7) 56px, transparent 130px), linear-gradient(to right, transparent 22%, rgba(13, 13, 15, 0.74) 52%, rgba(13, 13, 15, 0.82) 100%); }
}
@media (prefers-reduced-motion: reduce) { .pf-aura i:nth-child(n) { animation: none; } }   /* :nth-child(n) = same specificity as the per-field rules above */

/* ---- top bar: chevron, "now playing" caption + source ---- */
#player-full .pf-top {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 0;
  min-height: 44px; padding: 0; margin: 0 -8px 12px;
}
#player-full .pf-top-spacer { display: block; width: 44px; }
#player-full #pf-close.glass-btn {
  position: static; transform: none; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; color: #fff;
}
#player-full #pf-close.glass-btn svg { display: block; width: 28px; height: 28px; }
#player-full #pf-close.glass-btn::after { content: none; }
#player-full #pf-close.glass-btn:active { background: rgba(255, 255, 255, 0.1); }
#player-full .pf-context { font-size: 14px; font-weight: 600; line-height: 1.3; color: #fff; }
#player-full .pf-context::before { content: 'Сейчас играет'; display: block; font-size: 12px; font-weight: 400; color: var(--pf-text-3); }

/* ---- cover + neighbours ---- */
#player-full .pf-cover {
  border-radius: 10px; background-color: #17171a; background-image: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}
#player-full .pf-cover svg { color: #6c6c75; }
#player-full > .pf-peek { border-radius: 10px; background-color: #17171a; box-shadow: none; }
#player-full > .pf-peek.nocover { background-image: none; }

/* ---- title, artist, like ---- */
#player-full .pf-meta { gap: 8px; }
#player-full .pf-title { font-weight: 700; letter-spacing: -0.01em; color: #fff; }
#player-full .pf-artist { color: var(--pf-text-2); }
#player-full .pf-meta #pf-like { width: 48px; height: 48px; margin-right: -12px; border-radius: 50%; background: none; color: #fff; }
#player-full .pf-meta #pf-like svg { width: 26px; height: 26px; }
#player-full .pf-meta #pf-like.liked { color: #fff; }
#player-full .pf-meta #pf-like:active { background: rgba(255, 255, 255, 0.1); }

/* ---- seek: bars, still; played = white, rest = dim ---- */
#player-full .pf-seek-wrap { padding-bottom: 0; }
#player-full .pf-seek-wrap .seek.wavy { height: 32px; }
#player-full .pf-seek-wrap .seek::after { content: ''; position: absolute; inset: -10px 0; }   /* 52px touch area */
#player-full .seek.wavy .wave i { background: rgba(255, 255, 255, 0.3); border-radius: 1.5px; animation: none !important; }
#player-full .seek.wavy .wave i.on { background: #fff; filter: none; }
#player-full .seek.wavy:hover .wave i:not(.on) { background: rgba(255, 255, 255, 0.42); }
#player-full .seek.wavy.dragging .wave i.on { filter: none; }
#player-full .pf-times { margin-top: 6px; font-size: 12px; line-height: 1.25; color: var(--pf-text-3); }
#player-full .pf-seek-wrap:has(.seek.dragging) #pf-seek-cur { color: #fff; font-weight: 600; }

/* ---- transport: plain icons, one solid white play button ---- */
#player-full .pf-controls .pbtn { width: 56px; height: 56px; border: 0; background: none; color: #fff; box-shadow: none; }
#player-full .pf-controls .pbtn svg { width: 28px; height: 28px; }
#player-full .pf-controls .pbtn:active { transform: none; opacity: 0.6; }
#player-full .pf-controls .pbtn.main { width: 68px; height: 68px; background: #fff; color: var(--pf-base); box-shadow: none; }
#player-full .pf-controls .pbtn.main svg { width: 30px; height: 30px; animation: none; }
#player-full .pf-controls .pbtn.main:active { opacity: 0.85; }
#player-full .pf-controls .sbtn { width: 48px; height: 48px; color: var(--pf-text-2); }
#player-full .pf-controls .sbtn svg { width: 22px; height: 22px; }
#player-full .pf-controls .sbtn:active { transform: none; opacity: 0.6; }
#player-full .pf-controls .sbtn.active { color: #fff; }
#player-full .pf-controls .sbtn.active::after { background: #fff; }
/* playing: the pause glyph stays (the old overlay drew moving bars and a pulsing ring instead) */
#player-full.is-playing:not(.buffering) #pf-toggle#pf-toggle svg { visibility: visible; }
#player-full.is-playing:not(.buffering) #pf-toggle#pf-toggle::before,
#player-full.is-playing:not(.buffering) #pf-toggle#pf-toggle::after { content: none; animation: none; }

/* ---- actions: one hairline-topped row of four ---- */
#player-full .pf-actions {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0;
  margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--pf-line);
}
#player-full .pf-actions .pf-act { width: auto; height: 56px; padding: 8px 0 4px; gap: 5px; border-radius: 8px; color: var(--pf-text-2); }
#player-full .pf-actions .pf-act span { font-size: 12px; font-weight: 500; }
#player-full .pf-actions .pf-act:active, #player-full #pf-more[aria-expanded="true"] { background: rgba(255, 255, 255, 0.08); color: #fff; }

/* ---- "more": a docked bottom sheet like the rest of the app (was a translucent floating pill) ---- */
#player-full .pf-sheet-scrim { background: rgba(0, 0, 0, 0.62); }
#player-full > .pf-sheet {
  left: 0; right: 0; bottom: 0; width: 100%; max-width: 560px; margin: 0 auto;
  padding: 20px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  flex-direction: column; justify-content: flex-start; gap: 0;
  border-radius: 16px 16px 0 0; background: #18181b; box-shadow: none; transform: translateY(100%);
}
#player-full > .pf-sheet.open { transform: none; }
#player-full > .pf-sheet::before {
  content: ''; position: absolute; top: 8px; left: 50%; width: 32px; height: 4px; margin-left: -16px; border-radius: 2px; background: #3b3b41;
}
#player-full .pf-sheet .pf-act {
  flex: 0 0 auto; flex-direction: row; justify-content: flex-start; align-items: center; gap: 16px;
  width: calc(100% + 16px); height: 52px; margin: 0 -8px; padding: 0 8px; border-radius: 8px; color: #fff;
}
#player-full .pf-sheet .pf-act svg { flex: 0 0 22px; color: #b4b4bc; }
#player-full .pf-sheet .pf-act span { height: auto; font-size: 16px; font-weight: 500; line-height: 1.2; }
#player-full .pf-sheet .pf-act:active { background: rgba(255, 255, 255, 0.07); }

/* focus: no ring clipped by the scroller, a quiet highlight instead */
#player-full:focus, #player-full:focus-visible { outline: none; }
#player-full :focus-visible { outline: none; background-color: rgba(255, 255, 255, 0.1); }
#player-full .seek:focus-visible { background-color: transparent; outline: 2px solid rgba(255, 255, 255, 0.5); outline-offset: 4px; border-radius: 4px; }
#player-full .pf-controls .pbtn.main:focus-visible { background-color: #fff; outline: 2px solid #fff; outline-offset: 3px; }

/* ---- phone portrait: everything fits the screen, the cover takes what is left ---- */
@media (max-width: 1023.98px) {
  #player-full { padding: calc(8px + env(safe-area-inset-top, 0px)) 24px calc(12px + env(safe-area-inset-bottom, 0px)); }
  #player-full { --pf-inset: calc(env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px)); }
  #player-full .pf-cover { width: min(82vw, 400px, calc(100vh - 376px - var(--pf-inset))); min-width: 96px; margin: auto; }
  @supports (height: 100dvh) { #player-full .pf-cover { width: min(82vw, 400px, calc(100dvh - 376px - var(--pf-inset))); } }
  #player-full .pf-meta { margin-top: 18px; }
  #player-full .pf-title { font-size: 24px; line-height: 1.15; }
  #player-full .pf-artist { font-size: 16px; line-height: 1.25; margin-top: 4px; }
  #player-full .pf-seek-wrap { margin-top: 16px; }
  #player-full .pf-controls { justify-content: space-between; gap: 0; margin-top: 12px; }
}
@media (max-width: 340px) {
  #player-full .pf-controls .pbtn { width: 52px; height: 52px; }
  #player-full .pf-controls .pbtn.main { width: 64px; height: 64px; }
  #player-full .pf-controls .sbtn { width: 44px; height: 44px; }
}

/* ---- phone landscape (short screens): cover left, controls right, no scrolling ---- */
@media (max-width: 1023.98px) and (orientation: landscape) and (max-height: 540px) {
  #player-full {
    display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto repeat(4, auto); align-content: center; align-items: center;
    column-gap: 28px;
    padding: calc(6px + env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(24px, env(safe-area-inset-left, 0px));
  }
  #player-full .pf-top { grid-column: 1 / -1; grid-row: 1; margin-bottom: 0; }
  #player-full .pf-cover { grid-column: 1; grid-row: 2 / 6; margin: 0; width: min(calc(100vh - 76px - var(--pf-inset)), 46vw); }
  @supports (height: 100dvh) { #player-full .pf-cover { width: min(calc(100dvh - 76px - var(--pf-inset)), 46vw); } }
  #player-full .pf-meta { grid-column: 2; grid-row: 2; margin-top: 0; }
  #player-full .pf-seek-wrap { grid-column: 2; grid-row: 3; margin-top: 10px; }
  #player-full .pf-controls { grid-column: 2; grid-row: 4; margin-top: 6px; }
  #player-full .pf-actions { grid-column: 2; grid-row: 5; margin-top: 2px; }
  #player-full .pf-peek { display: none !important; }
}

/* ---- desktop: the existing two-column grid stays, only the look changes ---- */
@media (min-width: 1024px) {
  #player-full .pf-cover { border-radius: 12px; }
  #player-full .pf-controls { gap: 12px; }
  #player-full .pf-actions { max-width: 460px; justify-self: center; width: 100%; }
}

@media (prefers-reduced-motion: reduce) { #player-full { animation: none; } }
