/* FTR YouTube Live Player — player card + program guide (EPG) */

.ftrtv {
    --tv-green: #69976E;
    --tv-green-deep: #3E5C43;
    --tv-gold: #D4AF37;
    --tv-ink: #0f1a14;
    --tv-panel: #16241d;
    --tv-line: #2a3d33;
    --tv-text: #eaf2ec;
    --tv-muted: #9db3a6;
    --tv-live: #e5484d;
    width: 100%;
    font-family: inherit;
}
.ftrtv *,
.ftrtv *::before,
.ftrtv *::after { box-sizing: border-box; }

/* ---------- Player card ---------- */
.ftrtv__player {
    background: var(--tv-ink);
    border: 1px solid var(--tv-line);
    border-top: 2px solid var(--tv-gold);
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 18px 46px rgba(0, 0, 0, .32);
}

/* ---------- Video frame ---------- */
.ftr-youtube-live-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}
.ftr-youtube-live-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}
@supports not (aspect-ratio: 16 / 9) {
    .ftr-youtube-live-frame { height: 0; padding-bottom: 56.25%; }
}

.ftr-youtube-live-badge {
    position: absolute;
    top: 14px; left: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 11px;
    border-radius: 6px;
    background: var(--tv-live);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: .12em;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .4);
}
.ftr-youtube-live-badge[hidden] { display: none; }
.ftrtv__pulse {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #fff;
    animation: ftrtv-pulse 1.6s infinite;
}
@keyframes ftrtv-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, .55); }
    70%  { box-shadow: 0 0 0 9px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* ---------- Program guide (EPG) — horizontal grid ---------- */
.ftrtv__epg {
    margin-top: 8px;
    background: var(--tv-panel);
    border: 1px solid var(--tv-line);
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .22);
}
.ftrtv__epg-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 6px 12px;
    background: #69976E;
    border-bottom: 1px solid rgba(0, 0, 0, .12);
}
.ftrtv__epg-title {
    color: rgba(255, 255, 255, .9);
    font-weight: 800;
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.ftrtv__partner {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 3px;
    background: #fff;
    color: #3E5C43;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid rgba(0, 0, 0, .08);
    transition: background .15s ease, color .15s ease;
}
.ftrtv__partner:hover { background: var(--tv-gold); color: #223028; }
.ftrtv__days { display: flex; gap: 12px; flex-wrap: wrap; background: transparent !important; }
.ftrtv .ftrtv__day {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 13px;
    margin: 0;
    padding: 4px 1px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    text-shadow: none;
    color: rgba(255, 255, 255, .72);
    transition: color .15s ease, border-color .15s ease;
}
.ftrtv .ftrtv__day:hover,
.ftrtv .ftrtv__day:focus,
.ftrtv .ftrtv__day:focus-visible,
.ftrtv .ftrtv__day.is-active { background: transparent !important; background-image: none !important; box-shadow: none !important; }
.ftrtv .ftrtv__day:hover { color: #fff; }
.ftrtv .ftrtv__day.is-active { color: #fff; border-bottom-color: var(--tv-gold); }
.ftrtv .ftrtv__day.is-today::after { content: "•"; margin-left: 5px; color: var(--tv-gold); }

/* Scroll viewport */
.ftrtv__guide {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    background: #e7eae7;
    -webkit-overflow-scrolling: touch;
    scrollbar-color: #b8c2bb #e7eae7;
}
.ftrtv__guide::-webkit-scrollbar { height: 10px; }
.ftrtv__guide::-webkit-scrollbar-track { background: #e7eae7; }
.ftrtv__guide::-webkit-scrollbar-thumb { background: #b8c2bb; border-radius: 999px; border: 2px solid #e7eae7; }

/* Timeline area. --ppm = pixels per minute, --rail = left channel column width */
.ftrtv__grid {
    position: relative;
    --ppm: 4px;
    --rail: 92px;
    width: calc(var(--rail) + 1440 * var(--ppm));
}

/* Charcoal time + day ruler */
.ftrtv__ruler {
    position: relative;
    height: 46px;
    background: #21262a;
}
.ftrtv__daybadge {
    position: sticky;
    left: 0;
    z-index: 6;
    width: var(--rail);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #171b1e;
    border-right: 1px solid #000;
    box-shadow: 4px 0 10px rgba(0, 0, 0, .28);
}
.ftrtv__daybadge-txt {
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: .12em;
}
.ftrtv__tick {
    position: absolute;
    top: 0;
    left: calc(var(--rail) + var(--m) * var(--ppm));
    height: 100%;
    display: flex;
    align-items: center;
    padding-left: 8px;
    color: rgba(255, 255, 255, .55);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    border-left: 1px solid rgba(255, 255, 255, .10);
    pointer-events: none;
}
.ftrtv__tick.is-hour {
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    border-left-color: rgba(255, 255, 255, .22);
}

/* Program lanes (one visible at a time) */
.ftrtv__lane {
    position: relative;
    height: 84px;
    display: none;
    background:
        repeating-linear-gradient(
            to right,
            transparent,
            transparent calc(30 * var(--ppm) - 1px),
            rgba(0, 0, 0, .06) calc(30 * var(--ppm) - 1px),
            rgba(0, 0, 0, .06) calc(30 * var(--ppm))
        );
    background-position: var(--rail) 0;
    background-clip: content-box;
}
.ftrtv__lane.is-active { display: block; }

.ftrtv__chanbadge {
    position: sticky;
    left: 0;
    z-index: 5;
    width: var(--rail);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 8px;
    background: #171b1e;
    color: #fff;
    font-weight: 800;
    font-size: 12px;
    line-height: 1.2;
    border-right: 1px solid #000;
    box-shadow: 4px 0 10px rgba(0, 0, 0, .28);
}

.ftrtv__cell {
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: calc(var(--rail) + var(--s) * var(--ppm));
    width: calc((var(--e) - var(--s)) * var(--ppm) - 3px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 7px 11px;
    overflow: hidden;
    background: #f3f5f3;
    border: 1px solid #d8ddd8;
    border-left: 3px solid #c4ccc5;
    border-radius: 7px;
    color: #223028;
}
.ftrtv__cell-chan {
    font-size: 11px;
    font-weight: 600;
    color: #6e7c72;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ftrtv__cell-name {
    font-weight: 700;
    font-size: 13.5px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ftrtv__cell-time {
    font-size: 11.5px;
    color: #6e7c72;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ftrtv__nowdot {
    display: none;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--tv-live);
    vertical-align: middle;
    box-shadow: 0 0 0 0 rgba(229, 72, 77, .55);
    animation: ftrtv-now-pulse 1.4s infinite;
}
@keyframes ftrtv-now-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(229, 72, 77, .55); }
    70%  { box-shadow: 0 0 0 6px rgba(229, 72, 77, 0); }
    100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0); }
}
.ftrtv__cell.is-now {
    background: #eaf3ec;
    border-color: var(--tv-green);
    border-left: 3px solid var(--tv-gold);
    box-shadow: 0 2px 10px rgba(105, 151, 110, .28);
}
.ftrtv__cell.is-now .ftrtv__cell-name { color: #2e4633; }
.ftrtv__cell.is-now .ftrtv__nowdot { display: inline-block; }

.ftrtv__lane-empty {
    position: absolute;
    left: calc(var(--rail) + 16px);
    top: 50%;
    transform: translateY(-50%);
    color: #6e7c72;
    font-size: 13px;
}

/* Current-time line */
.ftrtv__nowline {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--tv-gold);
    z-index: 4;
    pointer-events: none;
}
.ftrtv__nowline[hidden] { display: none; }
.ftrtv__nowline-dot {
    position: absolute;
    top: 38px;
    left: 50%;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--tv-gold);
    transform: translateX(-50%);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, .28);
}

@media (prefers-reduced-motion: reduce) {
    .ftrtv__pulse,
    .ftrtv__nowdot { animation: none !important; }
}
