/* YesStreaming free player — compact horizontal now-playing bar */
/* Colors use !important so host-site CSS cannot override the widget */

.ys-player {
    --ys-p-bg: #12141c;
    --ys-p-surface: rgba(255, 255, 255, 0.06);
    --ys-p-primary: #ff7a2e;
    --ys-p-accent: #ff7a2e;
    --ys-p-text: #f4f5f7;
    --ys-p-muted: rgba(244, 245, 247, 0.6);
    --ys-p-line: rgba(255, 255, 255, 0.08);
    --ys-p-font: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --ys-p-max: 420px;
    --ys-p-art: 64px;
    box-sizing: border-box;
    width: 100%;
    max-width: var(--ys-p-max);
    margin: 0 auto;
    text-align: left;
    container-type: inline-size;
    container-name: ysp;
}

.ys-player *,
.ys-player *::before,
.ys-player *::after {
    box-sizing: border-box;
}

.ys-player[data-size="s"] { --ys-p-max: 300px; --ys-p-art: 52px; }
.ys-player[data-size="m"] { --ys-p-max: 420px; --ys-p-art: 64px; }
.ys-player[data-size="l"] { --ys-p-max: 560px; --ys-p-art: 76px; }
.ys-player[data-size="xl"] { --ys-p-max: 760px; --ys-p-art: 88px; }

.ys-player .ys-player-card {
    position: relative;
    overflow: hidden;
    padding: 14px;
    border-radius: 20px;
    font-family: var(--ys-p-font) !important;
    color: var(--ys-p-text) !important;
    background: var(--ys-p-bg) !important;
    border: 1px solid var(--ys-p-line);
    box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.55);
    -webkit-font-smoothing: antialiased;
}

.ys-player p,
.ys-player ul,
.ys-player li {
    margin: 0 !important;
    padding: 0;
    font-family: var(--ys-p-font) !important;
    letter-spacing: normal;
    text-transform: none;
}

/* Main row: cover · info · play */
.ys-player .ys-player-main {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ys-player .ys-player-art {
    position: relative;
    flex: 0 0 var(--ys-p-art);
    width: var(--ys-p-art);
    height: var(--ys-p-art);
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--ys-p-primary), var(--ys-p-accent)) !important;
}

.ys-player .ys-player-art img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ys-player .ys-player-art.has-image img {
    opacity: 1;
}

.ys-player .ys-player-art-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: calc(var(--ys-p-art) * 0.42);
    font-weight: 800;
    color: #fff !important;
}

.ys-player .ys-player-info {
    flex: 1 1 auto;
    min-width: 0;
}

.ys-player .ys-player-station {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px !important;
    font-weight: 600;
    line-height: 1.3 !important;
    color: var(--ys-p-muted) !important;
}

.ys-player .ys-player-station-name {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ys-player .ys-player-live {
    flex: 0 0 auto;
    margin-left: auto;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ys-p-muted) !important;
    background: var(--ys-p-surface) !important;
}

.ys-player.is-playing .ys-player-live {
    color: #fff !important;
    background: var(--ys-p-primary) !important;
}

.ys-player .ys-player-title {
    margin-top: 3px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    color: var(--ys-p-text) !important;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ys-player .ys-player-artist {
    margin-top: 1px !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    color: var(--ys-p-muted) !important;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Mini equalizer next to station name */
.ys-player .ys-player-wave {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 11px;
}

.ys-player .ys-player-wave span {
    width: 2px;
    height: 30%;
    border-radius: 2px;
    background: var(--ys-p-primary) !important;
}

.ys-player.is-playing .ys-player-wave span {
    animation: ys-p-eq 0.9s ease-in-out infinite;
}

.ys-player.is-playing .ys-player-wave span:nth-child(2) { animation-delay: -0.3s; }
.ys-player.is-playing .ys-player-wave span:nth-child(3) { animation-delay: -0.6s; }
.ys-player.is-playing .ys-player-wave span:nth-child(4) { animation-delay: -0.15s; }
.ys-player.is-playing .ys-player-wave span:nth-child(5) { animation-delay: -0.45s; }

.ys-player .ys-player-play {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    color: #fff !important;
    background: linear-gradient(135deg, var(--ys-p-primary), var(--ys-p-accent)) !important;
    box-shadow: 0 8px 20px -8px var(--ys-p-primary);
    transition: transform 0.15s ease;
}

.ys-player .ys-player-play:hover {
    transform: scale(1.06);
}

.ys-player .ys-player-play:focus-visible {
    outline: 2px solid var(--ys-p-text);
    outline-offset: 3px;
}

.ys-player .ys-player-play svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.ys-player .ys-player-play svg:last-child,
.ys-player.is-playing .ys-player-play svg:first-child {
    display: none;
}

.ys-player.is-playing .ys-player-play svg:last-child {
    display: block;
}

/* Status + volume bar */
.ys-player .ys-player-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 12px;
    background: var(--ys-p-surface) !important;
}

.ys-player .ys-player-status {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 12px !important;
    line-height: 1.3 !important;
    color: var(--ys-p-muted) !important;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ys-player .ys-player-status:empty::before {
    content: 'Live stream';
}

.ys-player .ys-player-vol {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ys-p-muted) !important;
}

.ys-player .ys-player-vol svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.ys-player .ys-player-vol input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 90px;
    height: 4px;
    margin: 0;
    padding: 0;
    border: 0 !important;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.18) !important;
    box-shadow: none !important;
    cursor: pointer;
}

.ys-player .ys-player-vol input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--ys-p-text);
}

.ys-player .ys-player-vol input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 50%;
    background: var(--ys-p-text);
}

/* Last played */
.ys-player .ys-player-history {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--ys-p-line);
}

.ys-player[data-history="0"] .ys-player-history {
    display: none;
}

.ys-player .ys-player-history-head {
    margin-bottom: 6px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ys-p-muted) !important;
}

.ys-player .ys-player-history-empty {
    font-size: 12px !important;
    color: var(--ys-p-muted) !important;
}

.ys-player .ys-player-history ul {
    list-style: none;
}

.ys-player .ys-player-history li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    font-size: 13px !important;
    line-height: 1.35 !important;
    color: var(--ys-p-text) !important;
}

.ys-player .ys-player-history li + li {
    border-top: 1px solid var(--ys-p-line);
}

.ys-player .ys-player-history li span {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ys-player .ys-player-history li time {
    flex: 0 0 auto;
    font-size: 11px;
    color: var(--ys-p-muted) !important;
}

/* Narrow containers: hide volume, browsers' own volume works on mobile */
@container ysp (max-width: 320px) {
    .ys-player .ys-player-card {
        padding: 12px;
    }

    .ys-player .ys-player-main {
        gap: 10px;
    }

    .ys-player .ys-player-play {
        width: 42px;
        height: 42px;
    }

    .ys-player .ys-player-title {
        font-size: 14px !important;
    }

    .ys-player .ys-player-vol {
        display: none;
    }
}

@container ysp (min-width: 600px) {
    .ys-player .ys-player-title {
        font-size: 19px !important;
    }

    .ys-player .ys-player-play {
        width: 56px;
        height: 56px;
    }

    .ys-player .ys-player-vol input[type="range"] {
        width: 130px;
    }
}

@media (max-width: 480px) {
    .ys-player {
        max-width: 100%;
    }
}

@keyframes ys-p-eq {
    0%, 100% { height: 30%; }
    50% { height: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .ys-player.is-playing .ys-player-wave span{
        animation: none;
    }
}

/* ---------- Style: Card (vertical, centered cover) ---------- */
.ys-player[data-style="card"] {
    --ys-p-max: 340px;
}

.ys-player[data-style="card"][data-size="s"] { --ys-p-max: 280px; }
.ys-player[data-style="card"][data-size="l"] { --ys-p-max: 400px; }
.ys-player[data-style="card"][data-size="xl"] { --ys-p-max: 460px; }

.ys-player[data-style="card"] .ys-player-card {
    padding: 22px 20px 18px;
    border-radius: 26px;
}

.ys-player[data-style="card"] .ys-player-main {
    flex-direction: column;
    text-align: center;
    gap: 14px;
}

.ys-player[data-style="card"] .ys-player-art {
    flex-basis: auto;
    width: calc(var(--ys-p-art) * 2);
    height: calc(var(--ys-p-art) * 2);
    border-radius: 22px;
    box-shadow: 0 16px 30px -14px rgba(0, 0, 0, 0.6);
}

.ys-player[data-style="card"] .ys-player-info {
    width: 100%;
}

.ys-player[data-style="card"] .ys-player-station {
    justify-content: center;
}

.ys-player[data-style="card"] .ys-player-live {
    margin-left: 0;
}

.ys-player[data-style="card"] .ys-player-title {
    margin-top: 8px !important;
    font-size: 18px !important;
}

.ys-player[data-style="card"] .ys-player-play {
    width: 60px;
    height: 60px;
}

.ys-player[data-style="card"] .ys-player-play svg {
    width: 24px;
    height: 24px;
}

.ys-player[data-style="card"] .ys-player-bar {
    margin-top: 16px;
}

/* ---------- Style: Pill (slim rounded strip) ---------- */
.ys-player[data-style="pill"] {
    --ys-p-art: 44px;
}

.ys-player[data-style="pill"][data-size="l"],
.ys-player[data-style="pill"][data-size="xl"] {
    --ys-p-art: 52px;
}

.ys-player[data-style="pill"] .ys-player-card {
    padding: 6px 6px 6px 6px;
    border-radius: 999px;
}

.ys-player[data-style="pill"] .ys-player-main {
    gap: 12px;
}

.ys-player[data-style="pill"] .ys-player-art {
    border-radius: 50%;
}

.ys-player.is-playing[data-style="pill"] .ys-player-art {
    animation: ys-p-spin 8s linear infinite;
}

.ys-player[data-style="pill"] .ys-player-title {
    margin-top: 1px !important;
    font-size: 14px !important;
}

.ys-player[data-style="pill"] .ys-player-artist {
    font-size: 12px !important;
}

.ys-player[data-style="pill"] .ys-player-live,
.ys-player[data-style="pill"] .ys-player-bar,
.ys-player[data-style="pill"] .ys-player-history {
    display: none;
}

.ys-player[data-style="pill"] .ys-player-play {
    width: var(--ys-p-art);
    height: var(--ys-p-art);
}

@keyframes ys-p-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .ys-player.is-playing[data-style="pill"] .ys-player-art {
        animation: none;
    }
}

/* Small credit dot linking back to YesStreaming */
.ys-player .ys-player-credit {
    position: absolute !important;
    right: 8px !important;
    bottom: 8px !important;
    width: 6px !important;
    height: 6px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background: var(--ys-p-primary) !important;
    opacity: 0.55 !important;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.ys-player .ys-player-credit:hover,
.ys-player .ys-player-credit:focus-visible {
    opacity: 1 !important;
    transform: scale(1.4);
}
