/* TVClub OSD unifié — inspiration terminal satellite / Mediamaster. */

.video-js .tvclub-player-osd-media {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 54;
    width: var(--player-media-width, 100%);
    height: var(--player-media-height, 100%);
    max-width: 100%;
    max-height: 100%;
    transform: translate(-50%, -50%);
    overflow: hidden;
    pointer-events: none;
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
}

.tvclub-player-zap-osd {
    position: absolute;
    right: clamp(0.65rem, 2vw, 1.4rem);
    bottom: clamp(3.9rem, 8%, 5.2rem);
    left: clamp(0.65rem, 2vw, 1.4rem);
    padding: clamp(0.72rem, 1.55vw, 1rem) clamp(0.82rem, 1.8vw, 1.2rem);
    border: 1px solid rgba(226, 140, 255, 0.22);
    border-top: 2px solid rgba(211, 92, 255, 0.78);
    border-radius: 0.42rem;
    background:
        linear-gradient(90deg, rgba(20, 12, 31, 0.94), rgba(18, 18, 24, 0.92) 64%, rgba(8, 8, 11, 0.91));
    box-shadow: 0 0.75rem 1.9rem rgba(0, 0, 0, 0.58);
    opacity: 1;
    transform: translateY(0);
    transition: opacity 140ms ease, transform 140ms ease;
    pointer-events: none;
}

.tvclub-player-zap-osd.is-pinned {
    pointer-events: auto;
}

.tvclub-player-zap-osd[hidden] {
    display: block !important;
    visibility: hidden;
    opacity: 0;
    transform: translateY(0.65rem);
}

.tvclub-player-zap-header,
.tvclub-player-zap-channel,
.tvclub-player-zap-times,
.tvclub-osd-footer {
    display: flex;
    align-items: center;
}

.tvclub-player-zap-header {
    gap: 0.6rem;
    min-width: 0;
    margin-bottom: 0.42rem;
}

.tvclub-player-zap-channel {
    min-width: 0;
    flex: 1 1 auto;
    gap: 0.62rem;
}

.tvclub-player-zap-number {
    min-width: 2.4ch;
    color: #e28cff;
    font-size: clamp(1.35rem, 3vw, 2rem);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    letter-spacing: 0.02em;
}

.tvclub-player-zap-logo[hidden] { display: none !important; }

.tvclub-player-zap-logo {
    width: clamp(2.05rem, 4.5vw, 3rem);
    height: clamp(1.7rem, 3.7vw, 2.45rem);
    object-fit: contain;
    border-radius: 0.22rem;
    background: rgba(255, 255, 255, 0.05);
}

.tvclub-player-zap-name {
    overflow: hidden;
    font-size: clamp(1rem, 2.2vw, 1.3rem);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tvclub-player-zap-clock {
    flex: 0 0 auto;
    margin-left: auto;
    color: rgba(255, 255, 255, 0.92);
    font-size: clamp(0.9rem, 1.8vw, 1.08rem);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.tvclub-player-zap-body { min-width: 0; }

.tvclub-player-zap-title {
    overflow: hidden;
    color: #fff;
    font-size: clamp(1.02rem, 2.35vw, 1.42rem);
    font-weight: 760;
    line-height: 1.18;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tvclub-player-zap-subtitle {
    overflow: hidden;
    margin-top: 0.12rem;
    color: rgba(255, 255, 255, 0.82);
    font-size: clamp(0.78rem, 1.65vw, 0.96rem);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tvclub-player-zap-meta {
    overflow: hidden;
    margin-top: 0.28rem;
    color: rgba(255, 255, 255, 0.65);
    font-size: clamp(0.7rem, 1.35vw, 0.84rem);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tvclub-osd-synopsis {
    display: none;
    max-width: 88ch;
    margin-top: 0.38rem;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.77);
    font-size: clamp(0.72rem, 1.32vw, 0.87rem);
    line-height: 1.32;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.tvclub-player-zap-osd.is-pinned .tvclub-osd-synopsis {
    display: -webkit-box;
}

.tvclub-player-zap-timeline {
    display: grid;
    grid-template-columns: auto minmax(5rem, 1fr);
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.55rem;
}

.tvclub-player-zap-times {
    color: rgba(255, 255, 255, 0.74);
    font-size: clamp(0.68rem, 1.3vw, 0.8rem);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.tvclub-player-zap-progress-track {
    position: relative;
    height: 0.32rem;
    overflow: hidden;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.17);
}

.tvclub-player-zap-progress-track.is-inactive { opacity: 0.42; }

.tvclub-player-zap-progress {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #8e3a9a, #e12f9c);
    transition: width 350ms linear;
}

.tvclub-osd-channel-button,
.tvclub-osd-close,
.tvclub-osd-watch,
.tvclub-osd-program-slot {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.13);
    background: rgba(255, 255, 255, 0.045);
    color: #fff;
    font: inherit;
}

.tvclub-osd-channel-button,
.tvclub-osd-close {
    display: none;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 2.25rem;
    place-items: center;
    padding: 0;
    border-radius: 0.35rem;
    cursor: pointer;
    font-size: 1.45rem;
    line-height: 1;
}

.tvclub-player-zap-osd.is-pinned .tvclub-osd-channel-button,
.tvclub-player-zap-osd.is-pinned .tvclub-osd-close {
    display: inline-grid;
}

.tvclub-osd-program-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 0.62rem;
}

.tvclub-osd-program-slot {
    display: none;
    min-width: 0;
    min-height: 3.8rem;
    padding: 0.45rem 0.58rem;
    border-radius: 0.38rem;
    cursor: pointer;
    text-align: left;
}

.tvclub-player-zap-osd.is-pinned .tvclub-osd-program-slot {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.5rem;
    align-content: center;
}

.tvclub-osd-program-slot[hidden],
.tvclub-osd-program-slot:disabled {
    opacity: 0.34;
    cursor: default;
}

.tvclub-osd-program-slot.is-selected {
    border-color: rgba(226, 140, 255, 0.9);
    background: rgba(142, 58, 154, 0.35);
    box-shadow: inset 0 0 0 1px rgba(226, 140, 255, 0.14);
}

.tvclub-osd-program-slot.is-live:not(.is-selected) {
    border-color: rgba(81, 215, 128, 0.35);
}

.tvclub-osd-program-role {
    grid-column: 1 / -1;
    color: rgba(226, 140, 255, 0.9);
    font-size: 0.65rem;
    font-weight: 760;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.tvclub-osd-program-time {
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
}

.tvclub-osd-program-title {
    min-width: 0;
    overflow: hidden;
    font-size: clamp(0.73rem, 1.25vw, 0.86rem);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tvclub-osd-footer {
    display: none;
    gap: 0.65rem;
    min-width: 0;
    margin-top: 0.52rem;
    padding-top: 0.42rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tvclub-player-zap-osd.is-pinned .tvclub-osd-footer { display: flex; }

.tvclub-osd-status {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    color: #e28cff;
    font-size: clamp(0.68rem, 1.25vw, 0.82rem);
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tvclub-osd-hints {
    flex: 0 1 auto;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.48);
    font-size: clamp(0.58rem, 1.05vw, 0.72rem);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tvclub-osd-watch {
    flex: 0 0 auto;
    min-height: 2rem;
    padding: 0.35rem 0.62rem;
    border-radius: 0.35rem;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 750;
}

.tvclub-osd-watch:disabled {
    opacity: 0.55;
    cursor: default;
}

.tvclub-osd-channel-button:hover,
.tvclub-osd-channel-button:focus-visible,
.tvclub-osd-close:hover,
.tvclub-osd-close:focus-visible,
.tvclub-osd-watch:hover:not(:disabled),
.tvclub-osd-watch:focus-visible:not(:disabled),
.tvclub-osd-program-slot:hover:not(:disabled),
.tvclub-osd-program-slot:focus-visible:not(:disabled) {
    border-color: rgba(226, 140, 255, 0.9);
    background: rgba(142, 58, 154, 0.28);
    outline: 2px solid transparent;
}

.video-js.tvclub-pvr-browser-open .vjs-control-bar {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.tvclub-player-numeric-entry {
    position: absolute;
    top: clamp(0.8rem, 4%, 1.8rem);
    right: clamp(0.8rem, 3%, 1.8rem);
    z-index: 4;
    min-width: 7.2rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid rgba(226, 140, 255, 0.65);
    border-radius: 0.45rem;
    background: rgba(15, 12, 21, 0.94);
    box-shadow: 0 0.5rem 1.4rem rgba(0, 0, 0, 0.48);
    text-align: right;
}

.tvclub-player-numeric-entry[hidden] { display: none !important; }
.tvclub-player-numeric-prefix {
    display: block;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.6rem;
    letter-spacing: 0.08em;
}
.tvclub-player-numeric-value {
    display: block;
    margin-top: 0.1rem;
    color: #e28cff;
    font-size: 2rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.08em;
}

.tvclub-player-osd-toast {
    position: absolute;
    left: 50%;
    bottom: clamp(8rem, 23%, 11rem);
    z-index: 5;
    max-width: min(35rem, calc(100% - 2rem));
    padding: 0.58rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.42rem;
    background: rgba(15, 13, 20, 0.94);
    color: #fff;
    box-shadow: 0 0.55rem 1.5rem rgba(0, 0, 0, 0.5);
    font-size: 0.8rem;
    line-height: 1.3;
    text-align: center;
    transform: translateX(-50%);
}
.tvclub-player-osd-toast[hidden] { display: none !important; }

.video-js.tvclub-osd-visible:not(.tvclub-pvr-browser-open) .vjs-text-track-display {
    bottom: clamp(10rem, 28%, 13rem) !important;
}
.video-js.tvclub-pvr-browser-open .vjs-text-track-display {
    bottom: clamp(14rem, 35%, 17rem) !important;
}

@media (max-width: 720px) {
    .tvclub-player-zap-osd {
        right: 0.55rem;
        bottom: 3.8rem;
        left: 0.55rem;
        padding: 0.65rem 0.72rem;
    }
    .tvclub-osd-synopsis { -webkit-line-clamp: 1; }
    .tvclub-osd-program-nav { gap: 0.3rem; }
    .tvclub-osd-program-slot { padding: 0.4rem 0.42rem; }
    .tvclub-osd-program-role { font-size: 0.56rem; }
    .tvclub-osd-program-title { font-size: 0.7rem; }
    .tvclub-osd-hints { display: none; }
    .tvclub-osd-status { white-space: normal; }
}

@media (max-width: 460px) {
    .tvclub-player-zap-title { font-size: 0.98rem; }
    .tvclub-player-zap-name { font-size: 0.95rem; }
    .tvclub-player-zap-logo { width: 2rem; height: 1.55rem; }
    .tvclub-osd-program-role { display: none; }
    .tvclub-player-zap-osd.is-pinned .tvclub-osd-program-slot {
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-rows: auto;
        min-height: 2.8rem;
    }
    .tvclub-osd-watch { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .tvclub-player-zap-osd,
    .tvclub-player-zap-progress { transition: none; }
}
