/* Radio Christmas Player */

:root {
    --rc-red:     #C8102E;
    --rc-gold:    #C9A84C;
    --rc-white:   #ffffff;
    --rc-muted:   rgba(255, 255, 255, 0.45);
    --bar-height: 80px;
    --presenter-size: 108px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0E0406;
    color: var(--rc-white);
    overflow-x: hidden;
    min-height: 100dvh;
}

/* ── Background ─────────────────────── */

.bg-blur {
    position: fixed;
    inset: -40px;
    background-image: url('rcnoartwork.png');
    background-size: cover;
    background-position: center;
    filter: blur(50px) brightness(0.3) saturate(1.8);
    transition: background-image 0.8s ease;
    z-index: 0;
}

.bg-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(170deg,
        rgba(122, 10, 26, 0.55) 0%,
        rgba(12, 3, 5, 0.82) 100%
    );
    z-index: 1;
}

/* ── Player ──────────────────────────── */

.player {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px 18px calc(var(--bar-height) + 20px);
    max-width: 420px;
    margin: 0 auto;
    min-height: 100dvh;
}

/* ── Header ──────────────────────────── */

.player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rc-logo {
    height: 34px;
    width: auto;
    object-fit: contain;
}

.live-badge {
    background: var(--rc-red);
    color: var(--rc-white);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.4px;
    padding: 5px 10px;
    border-radius: 3px;
    text-transform: uppercase;
    user-select: none;
}

/* ── Artwork ──────────────────────────── */

.artwork-wrapper {
    position: relative;
    width: 100%;
}

.artwork-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: filter 0.8s ease;
}

.artwork-container.playing {
    filter: drop-shadow(0 0 28px rgba(200, 16, 46, 0.45));
}

.artwork-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.artwork-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 52px 16px 16px;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.85) 100%);
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

/* ── Equaliser ───────────────────────── */

.equaliser {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 16px;
    width: 22px;
    flex-shrink: 0;
    margin-bottom: 3px;
}

.equaliser span {
    display: block;
    width: 3px;
    background: var(--rc-white);
    border-radius: 1px;
    animation: eq 1.3s ease-in-out infinite;
    transform-origin: bottom;
}

.equaliser span:nth-child(1) { height: 55%; animation-delay: 0s; }
.equaliser span:nth-child(2) { height: 90%; animation-delay: -0.45s; }
.equaliser span:nth-child(3) { height: 70%; animation-delay: -0.9s; }
.equaliser span:nth-child(4) { height: 45%; animation-delay: -1.1s; }

@keyframes eq {
    0%, 100% { transform: scaleY(1); }
    50%       { transform: scaleY(0.25); }
}

.equaliser.stopped span {
    animation: none;
    transform: scaleY(0.2);
    transition: transform 0.4s ease;
}

.np-text { flex: 1; min-width: 0; }

.np-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: var(--rc-white);
}

.np-artist {
    font-size: 13px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Play button (on artwork, hides when playing) ── */

.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    background: #ffffff;
    color: var(--rc-red);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.35);
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.35s ease, transform 0.15s ease;
}

.play-btn svg {
    width: 48px;
    height: 48px;
    pointer-events: none;
}

.play-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

.play-btn:hover:not(.hidden) {
    transform: translate(-50%, -50%) scale(1.07);
    background: var(--rc-white);
}

.play-btn:active:not(.hidden) {
    transform: translate(-50%, -50%) scale(0.96);
}

.play-btn:focus-visible {
    outline: 3px solid var(--rc-white);
    outline-offset: 4px;
}

/* ── Tracks row ──────────────────────── */

.tracks-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.tracks-row.hidden   { display: none; }

.tracks-section {
    flex: 1;
    min-width: 0;
}

.tracks-section.hidden { display: none; }

/* Up Next — right-aligned content */
#nextSection .tracks-label { text-align: right; }
#nextSection .tracks-thumbs { justify-content: flex-end; }

.tracks-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--rc-muted);
    margin-bottom: 8px;
}

.tracks-thumbs {
    display: flex;
    gap: 6px;
    height: 80px;
    overflow: hidden;
}

.track-thumb-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    transition: flex 0.4s ease, opacity 0.4s ease;
}

/* Desktop: JS mousemove sets .hover-expand — avoids gap-flicker from CSS :hover */
.track-thumb-wrap.hover-expand {
    flex: 9;
    transition: flex 0.4s ease, opacity 0.4s ease;
}

.tracks-thumbs:has(.track-thumb-wrap.hover-expand) .track-thumb-wrap:not(.hover-expand) {
    flex: 0 0 0;
    opacity: 0;
}

.track-thumb-wrap.hover-expand .track-thumb-overlay { opacity: 1; }

/* Touch: JS toggles .expanded on tap */
.track-thumb-wrap.expanded { flex: 9; }

.tracks-thumbs:has(.track-thumb-wrap.expanded) .track-thumb-wrap:not(.expanded) {
    flex: 0 0 0;
    opacity: 0;
}

.track-thumb-wrap.expanded .track-thumb-overlay { opacity: 1; }


.track-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.track-thumb-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 20%, rgba(0, 0, 0, 0.88) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.thumb-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--rc-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.thumb-artist {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

/* ── Contact card ────────────────────── */

.contact-card {
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    padding: 16px;
}

.contact-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--rc-muted);
    margin-bottom: 12px;
}

.contact-links {
    display: flex;
    gap: 10px;
}

.contact-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 13px 6px 11px;
    text-decoration: none;
    color: var(--rc-white);
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s ease;
}

.contact-btn:hover { background: rgba(255, 255, 255, 0.12); }
.contact-btn:active { background: rgba(255, 255, 255, 0.16); }

.contact-btn svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.contact-btn span {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
}

/* ── Text info popup ─────────────────── */

.text-popup-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 50;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: calc(var(--bar-height) + 16px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.text-popup-backdrop.active {
    opacity: 1;
    pointer-events: all;
}

.text-popup-card {
    background: #1c0608;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 24px 20px 20px;
    width: calc(100% - 36px);
    max-width: 390px;
    position: relative;
    transform: translateY(10px);
    transition: transform 0.25s ease;
}

.text-popup-backdrop.active .text-popup-card {
    transform: translateY(0);
}

.text-popup-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 50%;
    color: var(--rc-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.text-popup-close svg { width: 14px; height: 14px; }

.text-popup-eyebrow {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--rc-muted);
    margin-bottom: 8px;
}

.text-popup-number {
    font-size: 42px;
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--rc-white);
    line-height: 1;
    margin-bottom: 16px;
}

.text-popup-body {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.55;
    margin-bottom: 14px;
}

.text-popup-body strong {
    color: var(--rc-white);
    font-weight: 700;
}

.text-popup-amounts {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.amount-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 11px 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    color: var(--rc-white);
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.amount-btn.active {
    background: rgba(200, 16, 46, 0.18);
    border-color: var(--rc-red);
}

.amount-code {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: rgba(255, 255, 255, 0.65);
}

.amount-btn.active .amount-code { color: rgba(255, 255, 255, 0.9); }

.amount-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--rc-white);
}


.text-popup-disclaimer {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.3);
    line-height: 1.5;
    margin-bottom: 6px;
}

.text-popup-learn {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.text-popup-learn:hover {
    color: rgba(255, 255, 255, 0.75);
    border-color: rgba(255, 255, 255, 0.45);
}

.text-popup-cta {
    display: block;
    margin-top: 20px;
    background: var(--rc-red);
    color: var(--rc-white);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-align: center;
    padding: 14px;
    border-radius: 10px;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.15s ease;
}

.text-popup-cta:hover { opacity: 0.88; }

/* ── Bottom bar ──────────────────────── */

.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bar-height);
    background: var(--rc-white);
    box-shadow: 0 -2px 24px rgba(0, 0, 0, 0.18);
    z-index: 10;
    display: flex;
    flex-direction: column;
}

/* Main row: presenter info + button */
.bar-main {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 24px 0 calc(14px + var(--presenter-size) + 12px);
    min-height: 0;
    gap: 10px;
}

/* Presenter — overflows above the bar */
.presenter-wrap {
    position: absolute;
    bottom: 0;
    left: 14px;
    width: var(--presenter-size);
    height: var(--presenter-size);
}

.presenter-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    background: transparent;
    display: block;
}

.presenter-img[src=""] { display: none; }

.bar-info {
    flex: 1;
    min-width: 0;
}

.bar-title {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bar-meta {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Bar play/stop button */
.bar-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--rc-red);
    background: transparent;
    color: var(--rc-red);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s ease, color 0.2s ease;
}

.bar-btn:hover { background: var(--rc-red); color: var(--rc-white); }
.bar-btn svg { width: 21px; height: 21px; pointer-events: none; }

/* Progress bar row */
.bar-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 24px 10px calc(14px + var(--presenter-size) + 12px);
}

.prog-label {
    font-size: 10px;
    font-weight: 600;
    color: #888;
    white-space: nowrap;
    flex-shrink: 0;
}

.prog-track {
    flex: 1;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: visible;
    position: relative;
}

.prog-fill {
    height: 100%;
    background: var(--rc-red);
    border-radius: 2px;
    transition: width 1s linear;
    width: 0%;
    position: relative;
}

.prog-fill::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: var(--rc-red);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.2);
    transition: right 1s linear;
}

/* ── Reduced motion ───────────────────── */

@media (prefers-reduced-motion: reduce) {
    .live-dot,
    .equaliser span { animation: none !important; }
    .artwork-container,
    .bg-blur,
    .play-btn,
    .track-thumb,
    .track-thumb-overlay,
    .prog-fill { transition: none !important; }
}

/* ── Dynamic cards container ─────────── */

#dynamicCards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── Promo card ───────────────────────── */

.promo-card {
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255,255,255,0.06);
}

.promo-card-inner {
    display: block;
    text-decoration: none;
}

.promo-card-header {
    padding: 14px 16px 12px;
}

.promo-card-img {
    width: 100%;
    display: block;
    object-fit: cover;
}

.promo-card-title {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
    margin-bottom: 4px;
}

.promo-card-subtitle {
    font-size: 13px;
    color: rgba(255,255,255,0.65);
    line-height: 1.4;
}

/* ── News card ────────────────────────── */

.news-card {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    overflow: hidden;
}

.news-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.news-card-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255,255,255,0.55);
}

.news-card-more {
    font-size: 13px;
    font-weight: 600;
    color: var(--rc-gold);
    text-decoration: none;
    flex-shrink: 0;
}

.news-card-list {
    display: flex;
    flex-direction: column;
}

/* Grid container — used by grid and featured modes */
.news-card-grid {
    display: flex;
    flex-direction: column;
}

.news-card-loading {
    padding: 16px;
    font-size: 13px;
    color: rgba(255,255,255,0.4);
    text-align: center;
}

.news-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    align-items: flex-start;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    transition: background 0.15s ease;
}

.news-item:last-child { border-bottom: none; }
.news-item:active     { background: rgba(255,255,255,0.05); }

.news-item-thumb {
    width: 64px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.08);
}

.news-item-text {
    flex: 1;
    min-width: 0;
}

.news-item-headline {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.news-item-date {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
}

/* ── News: list mode (image right) ───── */

.news-card--list .news-item {
    flex-direction: row;
}

.news-card--list .news-item-text { order: 1; }
.news-card--list .news-item-thumb { order: 2; }

/* ── News: featured mode ──────────────── */

.news-hero {
    display: block;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    transition: background 0.15s;
}
.news-hero:active { background: rgba(255,255,255,0.04); }

.news-hero-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    background: rgba(255,255,255,0.08);
}

.news-hero-text {
    padding: 12px 16px;
}

.news-hero-headline {
    font-size: 17px;
    font-weight: 700;
    color: rgba(255,255,255,0.95);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}

.news-card-sub-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.news-card-sub-grid .news-grid-item {
    border-right: 1px solid rgba(255,255,255,0.06);
}
.news-card-sub-grid .news-grid-item:nth-child(2n) {
    border-right: none;
}

/* ── News: grid mode ──────────────────── */

.news-card--grid .news-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

/* ── News: grid item (shared by grid + featured sub-grid) ── */

.news-grid-item {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    transition: background 0.15s;
    overflow: hidden;
}
.news-grid-item:active { background: rgba(255,255,255,0.05); }

.news-grid-img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
    background: rgba(255,255,255,0.08);
}

.news-grid-headline {
    font-size: 12.5px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding: 8px 10px 4px;
}

.news-grid-date {
    padding: 0 10px 10px;
}

/* ── News: headlines mode ─────────────── */

.news-headline-item {
    display: block;
    padding: 10px 16px;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    transition: background 0.15s;
}
.news-headline-item:last-child { border-bottom: none; }
.news-headline-item:active { background: rgba(255,255,255,0.05); }

.news-headline-item .news-item-headline {
    -webkit-line-clamp: 2;
    margin-bottom: 3px;
}

/* ── Schedule card ────────────────────── */

.schedule-card {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    overflow: hidden;
}

.schedule-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.schedule-card-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255,255,255,0.55);
}

.schedule-card-more {
    font-size: 12px;
    font-weight: 600;
    color: var(--rc-red);
    text-decoration: none;
}

.schedule-card-body {
    padding: 4px 0;
}

.schedule-loading {
    padding: 16px;
    font-size: 13px;
    color: rgba(255,255,255,0.4);
    text-align: center;
}

.schedule-show-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    text-decoration: none;
    transition: background 0.15s ease;
}

.schedule-show-row:active { background: rgba(255,255,255,0.05); }

.schedule-show-img {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255,255,255,0.1);
}

.schedule-show-info {
    flex: 1;
    min-width: 0;
}

.schedule-show-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--rc-muted);
    margin-bottom: 2px;
}

.schedule-show-name {
    font-size: 15px;
    font-weight: 700;
    color: rgba(255,255,255,0.95);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.schedule-show-time {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    margin-top: 2px;
}

.schedule-arrow {
    font-size: 22px;
    color: rgba(255,255,255,0.3);
    flex-shrink: 0;
}

/* ── Live card ────────────────────────── */

.live-card {
    background: #0a0a0a;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(200, 16, 46, 0.4);
}

.live-card.hidden { display: none; }

.live-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(200, 16, 46, 0.12);
}

.live-card-badge {
    background: var(--rc-red);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.5px;
    padding: 3px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.live-card-title {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
}

.live-card-video-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.live-card-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* ── Floating live PIP ────────────────── */

.live-pip {
    position: fixed;
    top: 68px;
    right: 18px;
    width: 110px;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(200,16,46,0.5);
    z-index: 100;
    cursor: pointer;
}

.live-pip[hidden] { display: none; }

.live-pip-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.live-pip-badge {
    position: absolute;
    top: 6px;
    left: 7px;
    background: var(--rc-red);
    color: #fff;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 1.2px;
    padding: 2px 5px;
    border-radius: 3px;
    text-transform: uppercase;
}

.live-pip-close {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,0.7);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

.live-pip-close svg { width: 12px; height: 12px; stroke: #fff; }

.live-pip-expand {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0,0,0,0.65);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}
.live-pip-expand svg { width: 11px; height: 11px; stroke: #fff; }

.live-card-expand {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}
.live-card-expand-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.live-card-expand-icon svg { width: 22px; height: 22px; stroke: #fff; }

/* ── Video player modal ───────────────── */

.video-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.video-modal[hidden] { display: none; }

.video-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    cursor: pointer;
}

.video-modal-body {
    position: relative;
    width: 100%;
    max-width: 560px;
    z-index: 1;
}

.video-modal-close {
    position: absolute;
    top: -44px;
    right: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    -webkit-tap-highlight-color: transparent;
}
.video-modal-close svg { width: 18px; height: 18px; }

.video-modal-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 10px;
    display: block;
}

/* ── Spinner keyframe ─────────────────── */
@keyframes rc-spin {
    to { transform: rotate(360deg); }
}

/* ── Video buffering overlay ──────────── */
.video-buffer-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s;
}
.video-buffer-overlay.visible { opacity: 1; }

.video-buffer-spinner {
    width: 38px;
    height: 38px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: rc-spin 0.75s linear infinite;
}
/* Card overlay is last in DOM so it always renders above the expand button */
.live-card-video-wrap .video-buffer-overlay { z-index: 2; }

.live-pip .video-buffer-overlay { border-radius: 10px; }
.live-pip .video-buffer-spinner { width: 22px; height: 22px; border-width: 2px; }

/* ── Play button loading state ────────── */
.play-btn-icon { pointer-events: none; }

.play-btn-spinner {
    display: none;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(200,16,46,0.2);
    border-top-color: var(--rc-red);
    border-radius: 50%;
    animation: rc-spin 0.75s linear infinite;
    flex-shrink: 0;
}
.play-btn.loading .play-btn-icon { display: none; }
.play-btn.loading .play-btn-spinner { display: block; }

/* ── Bar button loading state ─────────── */
.bar-btn-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255,255,255,0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: rc-spin 0.75s linear infinite;
    flex-shrink: 0;
}
.bar-btn.loading .bar-icon-play,
.bar-btn.loading .bar-icon-stop { display: none !important; }
.bar-btn.loading .bar-btn-spinner { display: block; }

/* ── Offline banner ───────────────────── */
.offline-banner {
    position: fixed;
    bottom: calc(var(--bar-height, 80px) + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1a1a1a;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 8px 18px;
    border-radius: 99px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 500;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.offline-banner.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
