* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    width: 1920px;
    height: 1080px;
    background: #000;
    color: #fff;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden;
    position: absolute;
}

/* ── Splash screen ── */
@-webkit-keyframes logoEntrance {
    0%   { opacity: 0; -webkit-transform: scale(0.78) translateY(16px); transform: scale(0.78) translateY(16px); }
    65%  { opacity: 1; -webkit-transform: scale(1.04) translateY(-3px); transform: scale(1.04) translateY(-3px); }
    100% { opacity: 1; -webkit-transform: scale(1.0) translateY(0);     transform: scale(1.0) translateY(0); }
}
@keyframes logoEntrance {
    0%   { opacity: 0; transform: scale(0.78) translateY(16px); }
    65%  { opacity: 1; transform: scale(1.04) translateY(-3px); }
    100% { opacity: 1; transform: scale(1.0) translateY(0); }
}

#splash {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    z-index: 100;
    opacity: 1;
    -webkit-transition: opacity 0.8s ease;
    transition: opacity 0.8s ease;
}

#splash.fade-out {
    opacity: 0;
    pointer-events: none;
}

#splash img {
    height: 160px;
    width: auto;
    -webkit-animation: logoEntrance 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation: logoEntrance 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── AVPlay object ── */
#av-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    z-index: 1;
}

/* ── Fullscreen video ── */
#player-video {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    -webkit-object-fit: contain;
    object-fit: contain;
    background: #000;
    z-index: 2;
}

/* ── Screensaver video ── */
#screensaver-video {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    -webkit-object-fit: cover;
    object-fit: cover;
    z-index: 5;
    background: #000;
}

#screensaver-video.hidden {
    display: none;
}

/* ── Channel info overlay ── */
#channel-info {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: flex-start;
    justify-content: flex-start;
    padding-left: 100px;
    z-index: 10;
    pointer-events: none;
    opacity: 1;
    -webkit-transition: opacity 0.5s ease;
    transition: opacity 0.5s ease;
}

#channel-info.hidden {
    opacity: 0;
}

#channel-badge {
    background: rgba(0, 0, 0, 0.65);
    border-radius: 16px;
    padding: 28px 40px;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-align-items: flex-start;
    align-items: flex-start;
}

#channel-number-label {
    font-size: 80px;
    font-weight: 300;
    line-height: 1;
    color: #fff;
    letter-spacing: -0.02em;
}

#channel-name-label {
    font-size: 22px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.65);
    margin-top: 10px;
}

.ch-neighbor {
    font-size: 26px;
    font-weight: 300;
}

/* ── Bottom bar ── */
#bottom-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: flex-start;
    justify-content: flex-start;
    gap: 36px;
    padding: 80px 0 0;
    z-index: 10;
    opacity: 1;
    pointer-events: none;
    -webkit-transition: opacity 0.3s ease;
    transition: opacity 0.3s ease;
}

#bottom-bar.hidden {
    opacity: 0;
}

.logo {
    height: 48px;
    width: auto;
    pointer-events: none;
}

.back-in-time-btn {
    pointer-events: auto;
}

.back-in-time-btn {
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 9999px;
    padding: 14px 36px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
    letter-spacing: 0.02em;
    -webkit-transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.back-in-time-btn.focused {
    border-color: rgba(255, 255, 255, 0.7);
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    outline: none;
}

/* ── Pause overlay ── */
#pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    z-index: 20;
    background: rgba(0, 0, 0, 0.45);
    gap: 24px;
}

#pause-overlay.hidden {
    display: none;
}

#pause-icon {
    font-size: 96px;
    line-height: 1;
    color: #fff;
    opacity: 0.9;
}

#pause-time-label {
    font-size: 48px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.04em;
}

#back-to-live-btn {
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 9999px;
    padding: 16px 44px;
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 400;
    cursor: pointer;
    letter-spacing: 0.02em;
    margin-top: 60px;
    -webkit-transition: background 0.2s ease;
    transition: background 0.2s ease;
}

#back-to-live-btn:hover,
#back-to-live-btn:focus,
#back-to-live-btn.focused {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.85);
    outline: none;
}

/* ── Seek preview overlay ── */
#exit-confirm {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 1920px;
    height: 1080px;
    background: rgba(0,0,0,0.65);
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    z-index: 200;
    direction: rtl;
}
#exit-confirm.hidden { display: none; }
#exit-confirm-box {
    background: #1a1a2e;
    border: 2px solid rgba(255,255,255,0.25);
    border-radius: 20px;
    padding: 60px 90px;
    text-align: center;
}
#exit-confirm-text {
    font-size: 44px;
    color: #fff;
    margin-bottom: 48px;
}
#exit-confirm-btn {
    font-size: 38px;
    color: #fff;
    background: rgba(255,255,255,0.12);
    border: 3px solid rgba(255,255,255,0.4);
    border-radius: 12px;
    padding: 18px 64px;
    cursor: pointer;
    font-family: inherit;
    outline: none;
}
#exit-confirm-btn:focus {
    background: rgba(255,255,255,0.28);
    border-color: #fff;
}

#toast {
    position: absolute;
    top: 60px;
    left: 50%;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    background: rgba(0,0,0,0.75);
    color: #fff;
    font-size: 36px;
    padding: 18px 40px;
    border-radius: 12px;
    white-space: nowrap;
    z-index: 50;
    pointer-events: none;
    -webkit-transition: opacity 0.4s;
    transition: opacity 0.4s;
}
#toast.hidden { display: none; }

#seek-preview {
    position: absolute;
    bottom: 120px;
    left: 50%;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-align-items: center;
    align-items: center;
    gap: 14px;
    z-index: 25;
    pointer-events: none;
}
#seek-preview.hidden { display: none; }
#seek-thumbs {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    gap: 12px;
}
.seek-thumb-side,
.seek-thumb-center {
    width: 420px;
    height: 236px;
    object-fit: cover;
    border-radius: 8px;
    background: #111;
    border: 3px solid transparent;
}
.seek-thumb-center {
    border-color: #fff;
}
.seek-thumb-side.hidden { visibility: hidden; }
#seek-time-label {
    font-size: 34px;
    font-weight: 500;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.9);
    letter-spacing: 0.02em;
}

/* ── Recording time bar ── */
#recording-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.75) 100%);
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    padding: 0 100px;
    gap: 28px;
    z-index: 15;
}

#recording-bar.hidden {
    display: none;
}

#rec-clock {
    font-size: 26px;
    font-weight: 400;
    color: #fff;
    min-width: 70px;
    white-space: nowrap;
    margin-right: 8px;
}

#rec-current,
#rec-total {
    font-size: 22px;
    font-weight: 300;
    color: rgba(255,255,255,0.85);
    min-width: 80px;
    white-space: nowrap;
}

#rec-total {
    text-align: right;
}

#rec-track {
    -webkit-flex: 1;
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.25);
    border-radius: 2px;
    overflow: hidden;
}

#rec-fill {
    height: 100%;
    width: 0%;
    background: #fff;
    border-radius: 2px;
    -webkit-transition: width 0.5s linear;
    transition: width 0.5s linear;
}

/* ── Browser overlay ── */
#browser-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: flex-end;
    justify-content: flex-end;
    z-index: 30;
    background: rgba(0, 0, 0, 0.6);
}

#browser-overlay.hidden {
    display: none;
}

#resume-panel.hidden {
    display: none;
}

#resume-panel {
    width: 560px;
    height: 100%;
    background: rgba(5,5,5,0.88);
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    padding: 80px 50px;
    direction: rtl;
    border-left: 1px solid rgba(255,255,255,0.07);
}

#resume-title {
    font-size: 28px;
    font-weight: 400;
    color: rgba(255,255,255,0.6);
    margin-bottom: 40px;
}

#resume-list {
    list-style: none;
    overflow-y: auto;
    -webkit-flex: 1;
    flex: 1;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#resume-list::-webkit-scrollbar {
    display: none;
}

#browser-panel.hidden {
    display: none;
}

#browser-panel {
    width: 600px;
    height: 100%;
    background: rgba(10, 10, 10, 0.92);
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    padding: 80px 60px 80px 60px;
    direction: rtl;
}

#browser-title {
    font-size: 28px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 40px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#browser-list {
    list-style: none;
    overflow-y: auto;
    -webkit-flex: 1;
    flex: 1;
    /* hide scrollbar but allow scrolling */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#browser-list::-webkit-scrollbar {
    display: none;
}

.browser-item {
    font-size: 22px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.45);
    padding: 18px 20px;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-transition: color 0.15s ease, background 0.15s ease;
    transition: color 0.15s ease, background 0.15s ease;
}

.browser-item.focused {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

/* Resume item progress bar */
#resume-list .browser-item {
    white-space: normal;   /* allow progress bar to wrap below label */
}

.resume-item-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.resume-progress-track {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
    margin-top: 10px;
    overflow: hidden;
}

.resume-progress-fill {
    height: 100%;
    background: rgba(255, 255, 255, 0.65);
    border-radius: 2px;
}

/* ── Radio label (over screensaver for גלגלץ) ── */
#radio-label {
    position: absolute;
    top: 216px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 96px;
    font-weight: 300;
    color: rgba(255,255,255,0.85);
    letter-spacing: 0.08em;
    z-index: 6;
    pointer-events: none;
}

#radio-label.hidden {
    display: none;
}

/* ── Schedule bar ── */
#schedule-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 220px;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.55) 40%, rgba(0,0,0,0.92) 100%);
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-justify-content: flex-end;
    justify-content: flex-end;
    padding: 0 80px 36px;
    direction: rtl;
    font-family: 'Arial Hebrew', Arial, sans-serif;
    z-index: 8;
    opacity: 1;
    pointer-events: none;
    -webkit-transition: opacity 0.5s ease;
    transition: opacity 0.5s ease;
}
#schedule-bar.hidden {
    opacity: 0;
}
#schedule-progress-track {
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.18);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 20px;
}
#schedule-progress-fill {
    height: 100%;
    background: rgba(255,255,255,0.70);
    border-radius: 2px;
    -webkit-transition: width 0.5s linear;
    transition: width 0.5s linear;
}
#schedule-info-row {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: baseline;
    align-items: baseline;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    gap: 32px;
}
#schedule-title-wrap {
    -webkit-flex: 1;
    flex: 1;
    overflow: hidden;
}
#schedule-title {
    font-size: 36px;
    font-weight: 400;
    color: rgba(255,255,255,0.95);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#schedule-desc {
    font-size: 22px;
    font-weight: 300;
    color: rgba(255,255,255,0.50);
    margin-top: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#schedule-time-range {
    font-size: 26px;
    font-weight: 300;
    color: rgba(255,255,255,0.60);
    white-space: nowrap;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}
