/* Player barra — controles centralizados */
:root {
    --rp-accent: #dd0060;
    --rp-bg: #1a1a2e;
    --rp-bg2: #16213e;
    --rp-text: #ffffff;
    --rp-muted: rgba(255, 255, 255, 0.65);
    --rp-bar-h: 88px;
    --rp-radius: 14px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.rp-demo {
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(160deg, #0f0f1a 0%, #1a1a2e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.rp-wrap {
    width: 100%;
    max-width: 920px;
}

.rp-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: var(--rp-bar-h);
    padding: 10px 18px;
    background: linear-gradient(90deg, var(--rp-bg) 0%, var(--rp-bg2) 50%, var(--rp-bg) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--rp-radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    color: var(--rp-text);
}

/* Grupo central: capa + textos + play + barras */
.rp-player__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0 28px;
    width: min(820px, 100%);
    max-width: 100%;
}

.rp-player__inner > .rp-cover {
    margin-right: 10px;
}

.rp-player__inner > .rp-meta-left {
    margin-right: 12px;
}

.rp-player__inner > .rp-controls {
    margin: 0 14px;
}

.rp-player__inner > .rp-meta-right {
    margin-left: 12px;
}

.rp-player__inner > .rp-visualizer {
    margin-left: 10px;
}

.rp-player.rp-fixed-bottom {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    max-width: none;
    width: 100%;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
}

.rp-player.rp-fixed-top {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 99999;
    max-width: none;
    width: 100%;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-top: 0;
}

/* Modo embed (iframe no topo/rodapé do site) */
body.rp-embed {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: transparent;
}

.rp-player.rp-embed-bar {
    width: 100%;
    max-width: none;
    min-height: var(--rp-bar-h);
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
}

.rp-player.rp-embed-top {
    border-top: 0;
}

.rp-player.rp-embed-bottom {
    border-bottom: 0;
}

body.rp-demo.rp-has-fixed-top {
    padding-top: calc(var(--rp-bar-h) + 16px);
}

body.rp-demo.rp-has-fixed-bottom {
    padding-bottom: calc(var(--rp-bar-h) + 16px);
}

/* Capa */
.rp-cover {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
    background: #2d2d44;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Metadados à esquerda do play */
.rp-meta-left {
    flex: 0 1 200px;
    min-width: 0;
    max-width: 220px;
    text-align: right;
    padding-right: 4px;
}

.rp-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--rp-title, var(--rp-text));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.rp-artist {
    margin: 2px 0 0;
    font-size: 0.8rem;
    color: var(--rp-artist, var(--rp-muted));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Controles centralizados */
.rp-controls {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--rp-accent);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(221, 0, 96, 0.45);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.rp-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 20px rgba(221, 0, 96, 0.55);
}

.rp-btn:active {
    transform: scale(0.98);
}

.rp-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.rp-btn .rp-icon-pause {
    display: none;
}

.rp-player.rp-playing .rp-btn .rp-icon-play {
    display: none;
}

.rp-player.rp-playing .rp-btn .rp-icon-pause {
    display: block;
}

/* Metadados à direita do play */
.rp-meta-right {
    flex: 0 1 200px;
    min-width: 0;
    max-width: 220px;
    text-align: left;
    padding-left: 4px;
}

.rp-station {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--rp-station, var(--rp-text));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rp-status {
    margin: 2px 0 0;
    font-size: 0.75rem;
    color: var(--rp-status, var(--rp-muted));
}

.rp-error {
    width: min(820px, 100%);
    margin: 6px 0 0;
    padding: 6px 10px;
    font-size: 0.75rem;
    text-align: center;
    color: #ffb4b4;
    background: rgba(255, 0, 0, 0.12);
    border-radius: 8px;
    display: none;
}

.rp-player.rp-has-error .rp-error {
    display: block;
}

/* ——— Tema white ——— */
body.rp-demo.rp-theme-white-page {
    background: linear-gradient(160deg, #f0f0f5 0%, #ffffff 100%);
}

.rp-player.rp-theme-white {
    border-color: #e8e8ee;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
}

.rp-player.rp-theme-white.rp-embed-bar,
.rp-player.rp-theme-white.rp-fixed-top,
.rp-player.rp-theme-white.rp-fixed-bottom {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.rp-player.rp-theme-white .rp-cover {
    background: #f0f0f4;
    box-shadow: 0 2px 8px rgba(221, 0, 96, 0.12);
}

.rp-player.rp-theme-white .rp-error {
    color: #b8004a;
    background: rgba(221, 0, 96, 0.08);
}

/* Mobile: empilha mantendo play central */
@media (max-width: 640px) {
    .rp-player__inner {
        display: grid;
        grid-template-columns: 52px 1fr auto;
        grid-template-rows: auto auto;
        gap: 8px 12px;
        width: 100%;
    }

    .rp-player__inner > .rp-cover,
    .rp-player__inner > .rp-meta-left,
    .rp-player__inner > .rp-controls,
    .rp-player__inner > .rp-meta-right,
    .rp-player__inner > .rp-visualizer {
        margin: 0;
    }

    .rp-cover {
        width: 52px;
        height: 52px;
        grid-row: 1 / 3;
    }

    .rp-meta-left {
        grid-column: 2 / 4;
        grid-row: 1;
        max-width: none;
        text-align: left;
        padding: 0;
    }

    .rp-controls {
        grid-column: 2;
        grid-row: 2;
        justify-content: flex-start;
    }

    .rp-btn {
        width: 44px;
        height: 44px;
    }

    .rp-meta-right {
        grid-column: 3;
        grid-row: 2;
        max-width: none;
        text-align: right;
        padding: 0;
    }
}
