/* Radio & TV Sticker v6.4 */

:root {
    --rts-radio-bg:  #1a2a6c;
    --rts-tv-bg:     #c0392b;
    --rts-panel-bg:  rgba(15, 15, 30, 0.97);
    --rts-accent:    #3a7bd5;
    --rts-text:      #f0f0f0;
    --rts-radius:    10px;
    --rts-shadow:    0 4px 24px rgba(0,0,0,0.45);
    --rts-z:         9999;
}

/* ── Botones laterales ─────────────────────────────────────── */
#rts-radio-btn,
#rts-tv-btn {
    position: fixed;
    left: 0;
    z-index: var(--rts-z);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 10px;
    border-radius: 0 8px 8px 0;
    color: #fff;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    user-select: none;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    /* top se asigna por JS una sola vez — sin transición de top */
    transition: padding 0.2s, box-shadow 0.2s;
    will-change: padding;
    letter-spacing: 0.3px;
}

#rts-radio-btn {
    background: var(--rts-radio-bg);
    box-shadow: 2px 2px 10px rgba(26,42,108,0.4);
    border-top: 2px solid rgba(255,255,255,0.15);
    border-right: 2px solid rgba(255,255,255,0.15);
    border-bottom: 2px solid rgba(255,255,255,0.15);
}

#rts-tv-btn {
    background: var(--rts-tv-bg);
    box-shadow: 2px 2px 10px rgba(192,57,43,0.4);
    border-top: 2px solid rgba(255,255,255,0.15);
    border-right: 2px solid rgba(255,255,255,0.15);
    border-bottom: 2px solid rgba(255,255,255,0.15);
}

#rts-radio-btn:hover,
#rts-radio-btn:focus-visible {
    padding-left: 15px;
    box-shadow: 3px 3px 14px rgba(26,42,108,0.6);
    outline: none;
}

#rts-tv-btn:hover,
#rts-tv-btn:focus-visible {
    padding-left: 15px;
    box-shadow: 3px 3px 14px rgba(192,57,43,0.6);
    outline: none;
}

.rts-icon {
    line-height: 0;
    flex-shrink: 0;
    opacity: 0.9;
}

#rts-radio-btn.rts-hidden,
#rts-tv-btn.rts-hidden {
    display: none;
}

/* ── Paneles flotantes ─────────────────────────────────────── */
#rts-radio-panel,
#rts-tv-panel {
    position: fixed;
    bottom: 16px;
    left: 50%;
    translate: -50% 0;
    width: min(92vw, 500px);
    background: var(--rts-panel-bg);
    border-radius: var(--rts-radius);
    box-shadow: var(--rts-shadow);
    z-index: var(--rts-z);
    padding: 12px 14px;
    color: var(--rts-text);
    font-family: system-ui, -apple-system, sans-serif;
    border-top: 3px solid var(--rts-accent);
    animation: rts-slidein 0.22s ease-out;
}

#rts-radio-panel[hidden],
#rts-tv-panel[hidden] {
    display: none;
}

@keyframes rts-slidein {
    from { opacity: 0; translate: -50% 20px; }
    to   { opacity: 1; translate: -50% 0; }
}

.rts-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.rts-station-name {
    font-size: 14px;
    font-weight: 700;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rts-panel-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.rts-panel-header button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: none;
    border-radius: 5px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.15s;
}

.rts-panel-header button:hover { opacity: 0.82; }

#rts-close-radio,
#rts-close-tv  { background: #c0392b; }
#rts-change-btn { background: var(--rts-radio-bg); }

#rts-audio-container audio {
    width: 100%;
    height: 40px;
    border-radius: 6px;
    accent-color: var(--rts-accent);
}

.rts-status {
    font-size: 11px;
    color: #aaa;
    margin-top: 6px;
    min-height: 14px;
    text-align: center;
}

#rts-tv-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    overflow: hidden;
    background: #000;
}

#rts-tv-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

@media (max-width: 640px) {
    #rts-radio-btn,
    #rts-tv-btn {
        padding: 12px 6px;
        font-size: 12px;
        border-radius: 0 10px 10px 0;
    }

    #rts-radio-panel,
    #rts-tv-panel {
        bottom: 60px;
    }
}
