/* Elite Rádio — leitor persistente */
:root {
    --ep-rb-h: 64px;
    --ep-rb-bg: #2a1500;
    --ep-rb-bg2: #3d1f00;
    --ep-rb-cor: #673200;
    --ep-rb-txt: #f3e6d6;
    --ep-rb-sub: #c0a888;
    --ep-rb-live: #e53935;
}

/* ---------- Barra ---------- */
#ep-radio-bar {
    position: fixed;
    z-index: 2147483100;
    left: 16px;
    bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 52px;
    max-width: calc(100vw - 32px);
    padding: 0 10px 0 6px;
    background: var(--ep-rb-bg);
    color: var(--ep-rb-txt);
    border-radius: 26px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .35);
    font-family: inherit;
    font-size: 13px;
    line-height: 1.25;
    transition: left .25s, right .25s, bottom .25s, border-radius .25s, height .25s;
}
#ep-radio-bar[hidden] { display: none !important; }
#ep-radio-bar svg { width: 18px; height: 18px; display: block; }
#ep-radio-bar button { font: inherit; }

/* Fechada (pílula): esconder extras */
#ep-radio-bar .ep-rb-extra,
#ep-radio-bar .ep-rb-fechar,
#ep-radio-bar .ep-rb-live { display: none; }

/* Aberta (a tocar): barra a toda a largura */
#ep-radio-bar.ep-rb--aberta {
    left: 0; right: 0; bottom: 0;
    max-width: none;
    height: var(--ep-rb-h);
    padding: 0 16px;
    border-radius: 0;
    border-top: 3px solid var(--ep-rb-cor);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, .25);
}
#ep-radio-bar.ep-rb--aberta .ep-rb-extra { display: flex; }
#ep-radio-bar.ep-rb--aberta .ep-rb-fechar { display: flex; }
#ep-radio-bar.ep-rb--aberta .ep-rb-live { display: inline-flex; }
#ep-radio-bar.ep-rb--aviso .ep-rb-linha2 { color: #ffcc80; }

.ep-rb-play {
    flex-shrink: 0;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border: 0; border-radius: 50%;
    background: var(--ep-rb-cor);
    color: #fff;
    cursor: pointer;
    transition: background .2s, transform .15s;
}
.ep-rb-play:hover { background: #8a4a10; }
.ep-rb-play:active { transform: scale(.94); }
.ep-rb-play:focus-visible,
.ep-rb-fechar:focus-visible,
.ep-rb-mudo:focus-visible,
.ep-rb-pedido:focus-visible { outline: 2px solid #ffcc80; outline-offset: 2px; }
#ep-radio-bar.ep-rb--aberta .ep-rb-play { width: 44px; height: 44px; }
#ep-radio-bar.ep-rb--aberta .ep-rb-play svg { width: 22px; height: 22px; }

.ep-rb-info { min-width: 0; flex: 1 1 auto; }
.ep-rb-linha1 { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.ep-rb-nome { font-weight: 800; font-size: 13px; color: #fff; overflow: hidden; text-overflow: ellipsis; }
.ep-rb-linha2 {
    color: var(--ep-rb-sub);
    font-size: 12px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 260px;
}
#ep-radio-bar.ep-rb--aberta .ep-rb-linha2 { max-width: none; }

.ep-rb-live {
    align-items: center; gap: 5px;
    font-size: 9.5px; font-weight: 800; letter-spacing: .8px;
    color: #fff; background: var(--ep-rb-live);
    padding: 2px 7px; border-radius: 2px;
}
.ep-rb-live i {
    width: 6px; height: 6px; border-radius: 50%; background: #fff;
    animation: ep-rb-pulso 1.4s infinite;
}
@keyframes ep-rb-pulso { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.ep-rb-extra { align-items: center; gap: 16px; flex-shrink: 0; }
.ep-rb-ouv { display: inline-flex; align-items: center; gap: 6px; color: var(--ep-rb-sub); }
.ep-rb-ouv b { color: #fff; font-weight: 800; }
.ep-rb-pedido {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--ep-rb-txt) !important; text-decoration: none !important;
    background: var(--ep-rb-bg2); padding: 7px 12px; border-radius: 16px;
    font-size: 12px; font-weight: 700;
    transition: background .2s;
}
.ep-rb-pedido:hover { background: var(--ep-rb-cor); }
.ep-rb-vol { display: inline-flex; align-items: center; gap: 6px; }
.ep-rb-mudo {
    border: 0; background: none; color: var(--ep-rb-sub); cursor: pointer; padding: 4px;
    display: flex; align-items: center;
}
.ep-rb-mudo:hover { color: #fff; }
.ep-rb-vol input[type=range] { width: 90px; accent-color: #c0a888; cursor: pointer; }

.ep-rb-fechar {
    flex-shrink: 0;
    width: 34px; height: 34px;
    align-items: center; justify-content: center;
    border: 1px solid rgba(255, 255, 255, .15); border-radius: 50%;
    background: transparent; color: var(--ep-rb-sub); cursor: pointer;
    transition: background .2s, color .2s;
}
.ep-rb-fechar:hover { background: #c62828; border-color: #c62828; color: #fff; }

.ep-rb-spin { animation: ep-rb-roda 0.9s linear infinite; }
@keyframes ep-rb-roda { to { transform: rotate(360deg); } }

/* Espaço para a barra no fim da página */
html.ep-rb-aberta body { padding-bottom: var(--ep-rb-h) !important; }

/* ---------- Invólucro (iframe) ---------- */
#ep-radio-frame { display: none; }
html.ep-radio-shell,
html.ep-radio-shell body { overflow: hidden !important; height: 100% !important; }
html.ep-radio-shell body { padding-bottom: 0 !important; }
html.ep-radio-shell body > *:not(#ep-radio-bar):not(#ep-radio-frame) { display: none !important; }
html.ep-radio-shell #ep-radio-frame {
    display: block;
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;              /* iframes não esticam com top/bottom — altura explícita */
    border: 0;
    background: #fff;
    z-index: 2147483000;
}
html.ep-radio-shell.ep-rb-aberta #ep-radio-frame { height: calc(100% - var(--ep-rb-h)); }

/* Dentro do iframe não há barra própria */
html.ep-radio-em-frame #ep-radio-bar { display: none !important; }

/* ---------- Botão "Ouvir" reutilizável (navbar, página da rádio) ---------- */
.ep-radio-btn {
    display: inline-flex; align-items: center; gap: 7px;
    border: 0; cursor: pointer;
    background: var(--ep-rb-live); color: #fff;
    font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px;
    padding: 6px 12px; border-radius: 3px;
    transition: background .2s;
}
.ep-radio-btn:hover { background: #b71c1c; color: #fff; }
.ep-radio-btn .ep-radio-btn-ico {
    width: 0; height: 0;
    border-left: 8px solid #fff; border-top: 5px solid transparent; border-bottom: 5px solid transparent;
}
.ep-radio-btn.is-playing { background: #2e7d32; }
.ep-radio-btn.is-playing .ep-radio-btn-ico { width: 8px; height: 8px; border: 0; background: #fff; border-radius: 1px; }
.ep-radio-btn.is-loading .ep-radio-btn-ico {
    width: 10px; height: 10px; border: 2px solid #fff; border-right-color: transparent; border-radius: 50%;
    animation: ep-rb-roda .8s linear infinite;
}

/* ---------- Telemóvel ---------- */
@media (max-width: 768px) {
    :root { --ep-rb-h: 60px; }
    #ep-radio-bar.ep-rb--aberta { padding: 0 10px; gap: 10px; }
    .ep-rb-vol, .ep-rb-pedido span { display: none !important; }
    .ep-rb-pedido { padding: 8px; }
    .ep-rb-extra { gap: 10px; }
    .ep-rb-linha2 { max-width: 180px; }
}
@media (max-width: 420px) {
    .ep-rb-ouv { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    #ep-radio-bar, .ep-rb-live i, .ep-rb-spin { transition: none; animation: none; }
}
