/* Szarpidrut 2027 — globalny player (pasek na dole). Szablon: templates/front/sz2027/player.html.twig, skrypt: player.js.
   Kolory podążają za wybranym klimatem (data-sz-vibe na <html>), tak jak menu i stopka. */
.sz27-player {
  --szp-bg: #090909; --szp-panel: #141414; --szp-line: #353535; --szp-ink: #f4f2ee; --szp-muted: #a3a3a3;
  --szp-accent: #ed3039; --szp-accent-soft: #ff7379; --szp-h: 74px;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
  font-family: Lato, Arial, sans-serif; color: var(--szp-ink);
  -webkit-font-smoothing: antialiased;
}
html[data-sz-vibe="rock"] .sz27-player { --szp-bg: #18100d; --szp-panel: #251a15; --szp-line: #4c382d; --szp-accent: #af652b; --szp-accent-soft: #fbba77; }
html[data-sz-vibe="blues"] .sz27-player { --szp-bg: #0c1726; --szp-panel: #152334; --szp-line: #2f465d; --szp-accent: #387dab; --szp-accent-soft: #77cafb; }
html[data-sz-vibe="funky"] .sz27-player { --szp-bg: #130e20; --szp-panel: #1e172d; --szp-line: #3e3054; --szp-accent: #a96add; --szp-accent-soft: #d477fb; }
html[data-sz-vibe="reggae"] .sz27-player { --szp-bg: #0e180e; --szp-panel: #162416; --szp-line: #2f482e; --szp-accent: #4cae73; --szp-accent-soft: #77fba8; }
html[data-sz-vibe="punk"] .sz27-player { --szp-bg: #f6f5f2; --szp-panel: #efeeeb; --szp-line: #dcdad8; --szp-ink: #191919; --szp-muted: #5f5f5f; --szp-accent: #d62634; --szp-accent-soft: #d62634; }
.sz27-player[hidden] { display: none !important; }
.sz27-player *, .sz27-player *::before, .sz27-player *::after { box-sizing: border-box; }
.sz27-player button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }
.sz27-player a { color: inherit; text-decoration: none; }
.sz27-player svg { width: 20px; height: 20px; fill: currentColor; display: block; }
.sz27-player :focus-visible { outline: 2px solid var(--szp-accent); outline-offset: 2px; }
html.sz27-has-player body { padding-bottom: var(--szp-h, 74px); }
html.sz27-has-player.sz27-player-collapsed body { padding-bottom: 0; }

.szp-bar {
  position: relative; height: var(--szp-h); display: flex; align-items: center; gap: 22px;
  padding: 0 max(18px, calc((100vw - 1536px) / 2 + 42px));
  background: var(--szp-bg); border-top: 1px solid var(--szp-line); box-shadow: 0 -12px 30px rgba(0, 0, 0, .35);
}
.szp-bar::before { content: ""; position: absolute; left: 0; top: -1px; width: 120px; height: 2px; background: var(--szp-accent); }
.szp-progress-top { display: none; }

.szp-brand { display: flex; align-items: center; gap: 8px; flex: none; }
.szp-brand img { width: 112px; height: auto; }
html[data-sz-vibe="punk"] .szp-brand img { filter: invert(1) hue-rotate(180deg); }
.szp-radio { font: 900 10px/1 Lato, Arial, sans-serif; letter-spacing: .16em; color: #fff; background: var(--szp-accent); padding: 4px 6px 3px; }

.szp-controls { display: flex; align-items: center; gap: 6px; flex: none; }
.szp-btn { width: 38px; height: 38px; display: grid; place-items: center; color: var(--szp-ink); border-radius: 0; transition: color .15s, background .15s; }
.szp-btn:hover { color: var(--szp-accent-soft); }
.szp-play { width: 46px; height: 46px; background: var(--szp-accent); color: #fff; }
.szp-play:hover { color: #fff; filter: brightness(1.12); }
.szp-play svg { width: 22px; height: 22px; }
.szp-i-pause { display: none !important; }
.sz27-player.is-playing .szp-i-pause { display: block !important; }
.sz27-player.is-playing .szp-i-play { display: none !important; }

.szp-now { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 14px; }
.szp-cover { width: 46px; height: 46px; object-fit: cover; flex: none; background: var(--szp-panel); border: 1px solid var(--szp-line); }
.szp-meta { flex: 1; min-width: 0; }
.szp-title { margin: 0 0 6px; font-size: 14px; font-weight: 700; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.szp-title-link:hover, .szp-artist-link:hover { color: var(--szp-accent-soft); text-decoration: underline; }
.szp-artist-wrap { font-weight: 400; color: var(--szp-muted); }
.szp-artist-wrap:has(.szp-artist-link:empty) { display: none; }
.szp-time-row { display: flex; align-items: center; gap: 10px; }
.szp-time { font-size: 12px; color: var(--szp-muted); font-variant-numeric: tabular-nums; min-width: 34px; }
.szp-duration { text-align: right; }
.szp-seek, .szp-vol { -webkit-appearance: none; appearance: none; flex: 1; height: 4px; background: var(--szp-line); border-radius: 0; cursor: pointer; margin: 0;
  background-image: linear-gradient(var(--szp-accent), var(--szp-accent)); background-size: var(--szp-fill, 0%) 100%; background-repeat: no-repeat; }
.szp-seek::-webkit-slider-thumb, .szp-vol::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; background: var(--szp-ink); border: 0; border-radius: 0; }
.szp-seek::-moz-range-thumb, .szp-vol::-moz-range-thumb { width: 12px; height: 12px; background: var(--szp-ink); border: 0; border-radius: 0; }

.szp-volume, .szp-lists { position: relative; flex: none; }
.szp-lists { display: flex; gap: 8px; }
.szp-list-btn { display: inline-flex; align-items: center; gap: 9px; height: 38px; padding: 0 13px; border: 1px solid var(--szp-line);
  font: 900 11px/1 Lato, Arial, sans-serif !important; letter-spacing: .12em; text-transform: uppercase; }
.szp-list-btn:hover, .szp-list-btn[aria-expanded="true"] { border-color: var(--szp-accent); color: var(--szp-accent-soft); }
.szp-list-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; }
.szp-vol-btn svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.sz27-player.is-muted .szp-vol-btn { color: var(--szp-muted); }
.szp-collapse svg, .szp-tab svg { fill: none; stroke: currentColor; stroke-width: 2.4; }

.szp-pop { position: absolute; bottom: calc(100% + 14px); right: 0; background: var(--szp-panel); border: 1px solid var(--szp-line);
  border-top: 2px solid var(--szp-accent); box-shadow: 0 18px 40px rgba(0, 0, 0, .45); z-index: 2; }
.szp-pop[hidden] { display: none !important; }
.szp-vol-pop { right: 50%; transform: translateX(50%); width: 190px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.szp-vol-pop .szp-vol { width: 100%; }
.szp-mute { font-size: 12px !important; font-weight: 700 !important; letter-spacing: .08em; color: var(--szp-muted) !important; text-align: left; }
.szp-mute:hover { color: var(--szp-ink) !important; }
.szp-queue-pop, .szp-choose-pop { width: min(380px, calc(100vw - 24px)); max-height: min(60vh, 460px); overflow: auto; overscroll-behavior: contain; }
.szp-pop-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 16px 10px; border-bottom: 1px solid var(--szp-line);
  position: sticky; top: 0; background: var(--szp-panel); }
.szp-queue-title { font: 400 18px/1.15 Anton, Impact, sans-serif; letter-spacing: .04em; text-transform: uppercase; }
.szp-queue-page { font-size: 11px; font-weight: 900; letter-spacing: .1em; color: var(--szp-accent-soft); white-space: nowrap; }
.szp-queue { list-style: none; margin: 0; padding: 6px 0; counter-reset: q; }
.szp-queue li { counter-increment: q; }
.szp-queue button, .szp-choose button { width: 100%; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 4px 10px; align-items: center; text-align: left; padding: 9px 16px; }
.szp-queue button::before { content: counter(q, decimal-leading-zero); font-size: 11px; font-weight: 900; color: var(--szp-muted); }
.szp-queue button:hover, .szp-choose button:hover { background: rgba(255, 255, 255, .05); }
html[data-sz-vibe="punk"] .szp-queue button:hover, html[data-sz-vibe="punk"] .szp-choose button:hover { background: rgba(0, 0, 0, .05); }
.szp-queue .is-current button { background: var(--szp-accent); color: #fff; }
.szp-queue .is-current button::before, .szp-queue .is-current .szp-q-artist { color: #fff; }
.szp-q-title { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.szp-q-artist { grid-column: 2; font-size: 11px; color: var(--szp-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.szp-choose { padding: 6px 0 10px; }
.szp-choose h3 { margin: 10px 16px 6px; font: 900 11px/1.3 Lato, Arial, sans-serif; letter-spacing: .15em; color: var(--szp-muted); }
.szp-choose h3::before { content: ""; display: inline-block; width: 3px; height: 13px; background: var(--szp-accent); margin-right: 9px; vertical-align: -2px; }
.szp-choose button { grid-template-columns: 40px minmax(0, 1fr); }
.szp-choose button img, .szp-choose .szp-c-ph { width: 40px; height: 40px; object-fit: cover; grid-row: span 2; background: var(--szp-bg); border: 1px solid var(--szp-line); }
.szp-choose .is-current { box-shadow: inset 3px 0 0 var(--szp-accent); }
.szp-choose p { margin: 4px 16px 8px; font-size: 12px; line-height: 1.5; color: var(--szp-muted); }
.szp-choose p a { color: var(--szp-accent-soft); text-decoration: underline; }
.szp-choose .szp-c-all { display: block; margin: 8px 16px 0; font-size: 11px; font-weight: 900; letter-spacing: .1em; color: var(--szp-accent-soft); }

/* Zwinięty: mała zakładka w prawym dolnym rogu, muzyka gra dalej. */
.szp-tab { position: absolute; right: 18px; bottom: 0; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px;
  background: var(--szp-bg); border: 1px solid var(--szp-line); border-bottom: 0; border-top: 2px solid var(--szp-accent);
  font: 900 11px/1 Lato, Arial, sans-serif !important; letter-spacing: .14em; }
.szp-tab[hidden] { display: none !important; }
.szp-tab svg { width: 16px; height: 16px; }
.szp-tab-eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.szp-tab-eq i { width: 3px; height: 4px; background: var(--szp-accent); }
.sz27-player.is-playing .szp-tab-eq i { animation: szp-eq .9s ease-in-out infinite alternate; }
.sz27-player.is-playing .szp-tab-eq i:nth-child(2) { animation-delay: .3s; }
.sz27-player.is-playing .szp-tab-eq i:nth-child(3) { animation-delay: .6s; }
@keyframes szp-eq { from { height: 3px; } to { height: 12px; } }
.sz27-player.is-collapsed .szp-bar { display: none; }

/* Przyciski „odtwórz” w serwisie (data-sz-play) — stan „gra teraz”. */
[data-sz-play].sz27-is-playing { color: var(--szp-accent, #ed3039); }

@media (max-width: 1180px) {
  .szp-list-btn span { display: none; }
  .szp-list-btn { padding: 0 10px; }
  .szp-brand img { width: 92px; }
}
@media (max-width: 860px) {
  .sz27-player { --szp-h: 64px; }
  .szp-bar { gap: 10px; padding: 0 12px; }
  .szp-brand, .szp-volume, .szp-prev { display: none; }
  .szp-controls { order: 3; gap: 2px; }
  .szp-now { order: 1; gap: 10px; }
  .szp-lists { order: 4; gap: 4px; }
  .szp-collapse { order: 5; width: 30px; }
  .szp-list-btn { border: 0; padding: 0 6px; }
  .szp-cover { width: 42px; height: 42px; }
  .szp-title { margin: 0 0 2px; font-size: 13px; }
  .szp-artist-wrap { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
  .szp-time-row { display: none; }
  .szp-progress-top { display: block; position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: var(--szp-line); z-index: 1; }
  .szp-progress-top-bar { display: block; height: 100%; width: var(--szp-fill, 0%); background: var(--szp-accent); }
  .szp-bar::before { display: none; }
  .szp-play { width: 42px; height: 42px; }
  .szp-pop { position: fixed; left: 8px; right: 8px; bottom: calc(var(--szp-h) + 8px); width: auto; transform: none; }
  .szp-tab { right: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .sz27-player * { animation: none !important; transition: none !important; }
}

/* --- Przyciski „odtwórz w playerze” w widokach (data-sz-play) --- */
.sz27-play-btn {
  position: absolute; z-index: 4; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  background: #ed3039; color: #fff; border: 0; padding: 0; cursor: pointer; transition: filter .15s, transform .15s;
}
.sz27-play-btn svg { width: 18px; height: 18px; fill: currentColor; display: block; }
.sz27-play-btn:hover { filter: brightness(1.12); }
.sz27-play-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.sz27-play-btn.sz27-is-playing { color: #fff; box-shadow: 0 0 0 3px rgba(237, 48, 57, .35); }
.w07-play { top: 12px; right: 58px; }
.sz27-play-action { font: inherit; cursor: pointer; }
.sz27-play-action.sz27-is-playing { filter: brightness(1.12); }
.w13-to-player, .w14-to-player {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 16px; min-height: 42px; padding: 0 16px;
  background: #ed3039; color: #fff; border: 0; font: 900 11px/1 Lato, Arial, sans-serif; letter-spacing: .12em; text-transform: uppercase; cursor: pointer;
}
.w13-to-player:hover, .w14-to-player:hover { filter: brightness(1.12); }
