/* StagePort: přehrávač skladeb interpretů (templates/profile/_player.html.twig, public/js/player.js),
   vložený playlist (_embed) a správa hudby (manage/profile_hudba). Tmavý panel s oranžovou z loga. */

.stp-card { padding: 18px; }
.stp-card > h2 { margin-top: 0; }
.stp-single { max-width: 860px; }
.stp-layout { align-items: start; }
.stp-layout > * { min-width: 0; }
.section > .stp-bare { margin-bottom: 22px; }   /* přehrávač na přehledu je sám kartou, bez bílého obalu */

.stp {
    --stp-bg: var(--dark, #0e0c0a);
    --stp-bg-2: var(--dark-2, #1b1814);
    --stp-line: var(--dark-line, #2c2721);
    --stp-text: var(--on-dark, #f3eee7);
    --stp-muted: var(--on-dark-muted, #b3aa9e);
    --stp-accent: var(--orange, #ff8a00);
    background: radial-gradient(120% 140% at 0% 0%, #2a1a08 0%, var(--stp-bg) 55%) var(--stp-bg);
    color: var(--stp-text);
    border-radius: var(--radius, 14px);
    padding: 18px;
    outline: none;
}
.stp:focus-visible { box-shadow: 0 0 0 3px rgba(255, 138, 0, .5); }

/* právě hraje */
.stp-now { display: flex; gap: 18px; align-items: center; }
.stp-cover {
    width: 132px; height: 132px; flex-shrink: 0; border-radius: 12px; overflow: hidden; position: relative;
    background: var(--grad, linear-gradient(135deg, #ffc61a, #ff7a00)); display: grid; place-items: center; color: #1b1104;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
.stp-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stp-cover img[hidden], .stp-cover-ico[hidden] { display: none; }
.stp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.stp-meta { display: flex; flex-direction: column; min-width: 0; }
.stp-title { font: 700 18.5px/1.25 var(--font-head, inherit); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stp-sub { color: var(--stp-muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.stp-controls { display: flex; align-items: center; gap: 8px; }
.stp-btn {
    width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: var(--stp-text);
    display: inline-grid; place-items: center; cursor: pointer; transition: background .15s, transform .1s; padding: 0;
}
.stp-btn:hover { background: rgba(255, 255, 255, .08); }
.stp-btn:active { transform: scale(.94); }
.stp-btn:focus-visible { outline: 2px solid var(--stp-accent); outline-offset: 2px; }
.stp-btn-sm { width: 38px; height: 38px; }
.stp-play { width: 56px; height: 56px; background: var(--stp-accent); color: #1b1104; box-shadow: 0 6px 18px rgba(255, 138, 0, .35); }
.stp-play:hover { background: #ffa033; }
.stp-play .ico { fill: currentColor; }
.stp-i-play .ico { margin-left: 3px; }
.stp-i-play, .stp-i-pause, .stp-i-vol, .stp-i-mute { display: inline-flex; }
.stp .stp-i-pause, .stp.is-playing .stp-i-play { display: none; }
.stp.is-playing .stp-i-pause { display: inline-flex; }
.stp .stp-i-mute, .stp.is-muted .stp-i-vol { display: none; }
.stp.is-muted .stp-i-mute { display: inline-flex; }

.stp-volume { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.stp-volume input { width: 96px; }

.stp-seek { display: flex; align-items: center; gap: 10px; }
.stp-time { font-size: 12px; color: var(--stp-muted); font-variant-numeric: tabular-nums; min-width: 36px; }
.stp-time:last-child { text-align: right; }
.stp-seek input { flex: 1; }

/* posuvníky */
.stp input[type=range] {
    -webkit-appearance: none; appearance: none; height: 6px; padding: 0; border: 0; border-radius: 3px;
    background: rgba(255, 255, 255, .18); accent-color: var(--stp-accent); cursor: pointer; margin: 0;
}
.stp input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--stp-accent); border: 2px solid #fff; }
.stp input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--stp-accent); border: 2px solid #fff; }
.stp input[type=range]::-moz-range-progress { background: var(--stp-accent); height: 6px; border-radius: 3px; }
.stp input[type=range]:focus-visible { outline: 2px solid var(--stp-accent); outline-offset: 4px; }

/* seznam skladeb */
.stp-list { list-style: none; margin: 16px 0 0; padding: 8px 0 0; border-top: 1px solid var(--stp-line); counter-reset: none; }
.stp-item { border-radius: 10px; }
.stp-item + .stp-item { margin-top: 2px; }
.stp-pick {
    width: 100%; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center;
    background: transparent; border: 0; color: var(--stp-text); text-align: left; padding: 10px 10px; border-radius: 10px;
    cursor: pointer; font: inherit; min-height: 48px;
}
.stp-pick:hover { background: rgba(255, 255, 255, .06); }
.stp-pick:focus-visible { outline: 2px solid var(--stp-accent); outline-offset: -2px; }
.stp-n { display: grid; place-items: center; color: var(--stp-muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.stp-name { display: flex; flex-direction: column; min-width: 0; }
.stp-name > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.stp-name small { color: var(--stp-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stp-len { color: var(--stp-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.stp-item.is-current .stp-pick { background: rgba(255, 138, 0, .14); }
.stp-item.is-current .stp-name > span { color: var(--stp-accent); }
.stp-item.is-error .stp-name > span { text-decoration: line-through; opacity: .6; }
.stp-compact .stp-more { display: none; }
.stp-all { margin-top: 12px; color: var(--stp-accent); }

/* ekvalizér u právě hrané */
.stp-eq { display: none; gap: 2px; align-items: flex-end; height: 14px; }
.stp-eq i { width: 3px; background: var(--stp-accent); border-radius: 1px; height: 40%; }
.stp-item.is-current .stp-num { display: none; }
.stp-item.is-current .stp-eq { display: inline-flex; }
.stp.is-playing .stp-item.is-current .stp-eq i { animation: stp-eq .9s ease-in-out infinite; }
.stp.is-playing .stp-item.is-current .stp-eq i:nth-child(2) { animation-delay: -.3s; }
.stp.is-playing .stp-item.is-current .stp-eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes stp-eq { 0%, 100% { height: 25%; } 50% { height: 100%; } }
@media (prefers-reduced-motion: reduce) { .stp.is-playing .stp-item.is-current .stp-eq i { animation: none; height: 70%; } }

.stp-text { margin: 0 10px 8px 54px; font-size: 13px; color: var(--stp-muted); }
.stp-text summary { cursor: pointer; font-size: 13px; color: var(--stp-muted); }
.stp-text summary:hover { color: var(--stp-text); }
.stp-text > div { padding: 8px 0 4px; line-height: 1.6; white-space: normal; }

/* vložený playlist */
.stp-embed { border-radius: 12px; overflow: hidden; background: var(--surface-2, #f3f1ed); }
.stp-embed iframe { display: block; width: 100%; height: var(--h, 352px); border: 0; }
.stp-embed.is-ratio { aspect-ratio: 16 / 9; }
.stp-embed.is-ratio iframe { height: 100%; }

/* ── správa hudby ── */
.stp-uploads { list-style: none; margin: 12px 0 0; padding: 0; width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.stp-uploads li { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 4px 12px; font-size: 13px; color: var(--text-2); }
.stp-up-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.stp-up-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; align-self: center; }
.stp-up-bar i { display: block; height: 100%; width: 0; background: var(--orange); transition: width .2s; }
.stp-up-state { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.stp-uploads li.is-ok .stp-up-bar i { background: var(--ok, #16a34a); width: 100%; }
.stp-uploads li.is-ok .stp-up-state { color: var(--ok, #16a34a); }
.stp-uploads li.is-error .stp-up-bar i { background: var(--danger, #dc2626); width: 100%; }
.stp-uploads li.is-error .stp-up-state { color: var(--danger, #dc2626); }

.mtracks { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.mtracks.is-error { outline: 2px solid var(--danger, #dc2626); outline-offset: 4px; border-radius: var(--radius); }
.mtrack { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: var(--surface); transition: box-shadow .2s, opacity .2s; }
.mtrack.is-draft { background: var(--surface-2); }
.mtrack.is-dragging { opacity: .45; }
.mtrack.is-moved { box-shadow: 0 0 0 2px var(--accent-soft), 0 0 0 4px var(--orange); }
.mtrack-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mtrack-grip { cursor: grab; color: var(--muted); display: inline-flex; padding: 6px 2px; touch-action: none; }
.mtrack-grip:active { cursor: grabbing; }
.mtrack-move { display: inline-flex; gap: 2px; }
.mtrack-move form { display: contents; }
.mtrack-move .btn-icon[disabled] { opacity: .35; cursor: default; }
.mtrack-cover { width: 44px; height: 44px; border-radius: 8px; overflow: hidden; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; flex-shrink: 0; }
.mtrack-cover img { width: 100%; height: 100%; object-fit: cover; }
.mtrack-title { display: flex; flex-direction: column; min-width: 0; flex: 1 1 200px; }
.mtrack-title strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtrack-audio { height: 36px; flex: 0 1 300px; max-width: 100%; }
.mtrack-form { margin-top: 10px; }
.mtrack-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(90px, 1fr); gap: 0 12px; }
.mtrack-more { margin-bottom: 8px; }
.mtrack-more > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent-ink); margin-bottom: 8px; }
.mtrack-more .mtrack-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.mtrack-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mtrack-bar .check { margin: 0; }
.mtrack-bar .grow { flex: 1; }

/* mobil: velké ovládání, cover nad ovládáním */
@media (max-width: 640px) {
    .stp-card { padding: 10px; }
    .stp { padding: 14px; }
    .stp-now { flex-direction: column; align-items: stretch; gap: 14px; }
    .stp-cover { width: 100%; height: auto; aspect-ratio: 1 / 1; max-width: 200px; align-self: center; }
    .stp-meta { text-align: center; }
    .stp-title { font-size: 17.5px; white-space: normal; }
    .stp-controls { justify-content: center; gap: 14px; flex-wrap: wrap; }
    .stp-btn { width: 52px; height: 52px; }
    .stp-play { width: 68px; height: 68px; }
    .stp-volume { margin-left: 0; width: 100%; justify-content: center; }
    .stp-volume input { width: 60%; }
    .stp input[type=range] { height: 8px; }
    .stp input[type=range]::-webkit-slider-thumb { width: 22px; height: 22px; }
    .stp input[type=range]::-moz-range-thumb { width: 20px; height: 20px; }
    .stp-pick { min-height: 56px; padding: 12px 8px; }
    .stp-text { margin-left: 8px; }
    .mtrack-grid, .mtrack-more .mtrack-grid { grid-template-columns: minmax(0, 1fr); }
    .mtrack-audio { flex-basis: 100%; }
    .stp-uploads li { grid-template-columns: minmax(0, 1fr) 80px; }
}
@media (hover: none) { .stp-volume input { display: none; } .stp-volume { width: auto; } }

/* playlist po sekcích (karta Hudba): Výběr a alba v jednom přehrávači */
.stp-section { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 10px 8px; margin-top: 10px; border-top: 1px solid var(--stp-line); }
.stp-section:first-child { margin-top: 0; border-top: 0; padding-top: 4px; }
.stp-section-cover { width: 40px; height: 40px; border-radius: 6px; background: rgba(255, 255, 255, .06) center/cover; display: grid; place-items: center; color: var(--stp-accent); }
.stp-section-main { display: flex; flex-direction: column; min-width: 0; }
.stp-section-main strong { font: 800 15px/1.2 var(--font-head); color: var(--stp-text); }
.stp-section-main small { color: var(--stp-muted); font-size: 12px; }
.stp-section-link { color: var(--stp-accent); font-size: 13px; font-weight: 600; display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.stp-section-link:hover { text-decoration: underline; }
