@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
body {
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    font-family: Arial, sans-serif;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    padding-top: 0px;
    padding-bottom: 100px;
}

.main-header {
    width: 100%;
    padding: 10px 0;
    background-color: transparent;
    position: fixed;
    top: 20px;
    left: 0;
    z-index: 10;
    text-align: center;
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 325px;
}

.nav-item {
    color: white;
    font-family: 'Press Start 2P', monospace;
    font-size: 14px;
    text-decoration: none;
    padding: 5px 10px;
    transition: color 0.3s;
}

.nav-item:hover {
    color: #fbc02d;
}

.star-field {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}

.star {
    position: absolute;
    background-color: #fff;
    border-radius: 50%;
    opacity: 0;
    animation: twinkle var(--duration) ease-in-out infinite;
    animation-delay: var(--delay);
}

@keyframes twinkle {
    0%, 100% { opacity: 0; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(var(--distance)); }
}

.tv-container {
    width: 1500px;
    height: 1125px;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-image: url('../images/tv.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    /* position: relative; -- already set above, so this line is redundant */
    overflow: hidden;
    margin-top: -50px;
}

.tv-screen {
    width: 775px;
    height: 581px;
    position: absolute;
    overflow: visible;
    z-index: 1;
    top: 50%;
    left: 50%;
    transform: translate(-55.5%, -54.5%);
    image-rendering: pixelated;
}

.tv-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(0, 0, 0, 0.1) 50%
    );
    background-size: 100% 4px;
    z-index: 2;
    pointer-events: none;
}

.tv-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    animation: ghosting 5s infinite;
    z-index: 3;
    pointer-events: none;
}

@keyframes ghosting {
    0%, 100% { opacity: 0; transform: translateX(0); }
    10%, 90% { opacity: 0.1; transform: translateX(5px); }
    20%, 80% { opacity: 0.2; transform: translateX(-5px); }
    30%, 70% { opacity: 0.3; transform: translateX(10px); }
    40%, 60% { opacity: 0.4; transform: translateX(-10px); }
    50% { opacity: 0.5; transform: translateX(15px); }
}

.tv-screen iframe {
    width: 100%;
    height: 100%;
    border: none;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.tv-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/tv.png') no-repeat center center;
    background-size: contain;
    pointer-events: none;
    z-index: 2;
}

.tv-controls {
    position: absolute;
    top: 75%;
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 3;
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

.tv-controls button {
    background-color: #444;
    color: #fff;
    border: none;
    padding: 15px;
    cursor: pointer;
    font-family: 'Press Start 2P', monospace;
    font-size: 18px;
    border-radius: 10px;
    transition: all 0.1s ease-in-out;
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(255, 255, 255, 0.1);
    position: relative;
    top: 0;
}

.tv-controls .power { background-color: #b71c1c; } /* More muted Red */
.tv-controls .menu { background-color: #444; } /* Changed to gray */
.tv-controls .channel-up { background-color: #444; } /* Gray */
.tv-controls .channel-down { background-color: #444; } /* Gray */
.tv-controls .volume-up { background-color: #444; } /* Gray */
.tv-controls .volume-down { background-color: #444; } /* Gray */
/* Fine-tuned play button content alignment */
.tv-controls .play {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 8px;
    padding-bottom: 16px;
    background-color: #388e3c;
}
.tv-controls .pause { background-color: #fbc02d; } /* Muted Yellow */

/* Specific button order */
.tv-controls .power { order: 1; }
.tv-controls .menu { order: 2; }
.tv-controls .channel-up { order: 3; }
.tv-controls .channel-down { order: 4; }
.tv-controls .play { order: 5; }
.tv-controls .pause { order: 6; }
.tv-controls .volume-up { order: 7; }
.tv-controls .volume-down { order: 8; }

/* Hover effect for all buttons */
.tv-controls button:hover {
    filter: brightness(1.2);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3), 0 0 0 2px rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Active effect for all buttons */
.tv-controls button:active {
    filter: brightness(0.8);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transform: translateY(2px);
    transition: all 0.05s ease-in-out;
}

.tv-screen.off::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.1);
    z-index: 4;
    backdrop-filter: blur(2px);
}

.tv-screen.off iframe {
    visibility: hidden;
}

.volume-indicator {
    position: absolute;
    bottom: 388px;
    left: 47%;
    transform: translateX(-50%);
    padding: 3px 5px;
    border-radius: 3px;
    z-index: 4;
    transition: opacity 0.5s;
    opacity: 0;
    display: flex;
    align-items: center;
    height: 19px;
    width: 300px;
    background-color: transparent;
}

.volume-bar-container {
    display: flex;
    align-items: center;
    height: 100%;
    flex: 1;
    justify-content: space-between;
}

.volume-bar {
    width: 6px;
    height: 19px;
    background-color: #0a1a0a;
    margin: 0 3px;
    transition: background-color 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.volume-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAAUVBMVEWFhYWDg4N3d3dtbW17e3t1dXWBgYGHh4d5eXlzc3OLi4ubm5uVlZWPj4+NjY19fX2JiYl/f39ra2uRkZGZ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z/7gC9hesnr+7wqCwG8c5yAg3AL1fm8T9AZtp/bbJGwl1pNrE7RuOX7PeMRUERVaPpEs+yqeoSmuOlokqw49pgomjLeh7icHNlG19yjs6XXOMedYm5xH2YxpV2tc0Ro2jJfxC50ApuxGob7lMsxfTbeUv07TyYxpeLucEH1gNd4IKH2LAg5TdVhlCafZvpskfncCfx8pOhJzd76bJWeYFnFciwcYfubRc12Ip/ppIhA1/mSZ/RxjFDrJC5xifFjJpY2Xl5zXdguFqYyTR1zSp1Y9p+tktDYYSNflcxI0iyO4TPBdlRcpeqjK/piF5bklq77VSEaA+z8qmJTFzIWiitbnzR794USKBUaT0NTEsVjZqLaFVqJoPN9ODG70IPbfBHKK+/q/AWR0tJzYHRULOa4MP+W/HfGadZUbfw177G7j/OGbIs8TahLyynl4X4RinF793Oz+BU0saXtUHrVBFT/DnA3ctNPoGbs4hRIjTok8i+algT1lTHi4SxFvONKNrgQFAq2/gFnWMXgwffgYMJpiKYkmW3tTg3ZQ9Jq+f8XN+A5eeUKHWvJWJ2sgJ1Sop+wwhqFVijqWaJhwtD8MNlSBeWNNWTa5Z5kPZw5+LbVT99wqTdx29lMUH4OIG/D86ruKEauBjvH5xy6um/Sfj7ei6UUVk4AIl3MyD4MSSTOFgSwsH/QJWaQ5as7ZcmgBZkzjjU1UrQ74ci1gWBCSGHtuV1H2mhSnO3Wp/3fEV5a+4wz//6qy8JxjZsmxxy5+4w9CDNJY09T072iKG0EnOS0arEYgXqYnXcYHwjTtUNAcMelOd4xpkoqiTYICWFq0JSiPfPDQdnt+4/wuqcXY47QILbgAAAABJRU5ErkJggg==');
    opacity: 0.2;
}

.volume-bar.active {
    background-color: #00FF00;
    box-shadow: 0 0 5px #00FF00, 0 0 10px #00FF00;
}

.volume-bar.active::before {
    opacity: 0.4;
}

.volume-dash {
    display: none;
}

.tv-menu {
    position: absolute;
    top: 50%;
    left: calc(50% + 750px); /* Adjusted for the larger TV size */
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    border: 2px solid #444;
    border-radius: 10px;
    padding: 20px;
    display: none;
    flex-direction: column;
    gap: 15px;
    z-index: 4;
}

.tv-menu.show {
    display: flex;
}

.menu-item {
    background-color: #444;
    color: #fff;
    border: none;
    padding: 15px;
    cursor: pointer;
    font-size: 18px;
    border-radius: 8px;
    transition: background-color 0.3s;
}

.menu-item:hover {
    background-color: #666;
}

:root {
    --tv-width: 1500px;
    --tv-height: 1125px;
    --screen-width: 775px;
    --screen-height: 581px;
    --screen-top: 230px;
    --screen-left: 363px;
    --controls-bottom: 143px;
    --volume-bottom: 388px;
    --volume-width: 300px;
}

:root {
    --tv-width: 1500px;
    --tv-height: 1125px;
    --screen-width: 775px;
    --screen-height: 581px;
    --screen-top: 230px;
    --screen-left: 363px;
    --controls-bottom: 143px;
    --volume-bottom: 388px;
    --volume-width: 300px;
}

/* Dropdown container */
.nav-item.dropdown {
    position: relative;
    display: inline-block;
}

/* Hide dropdown menu by default */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.9);
    border: 2px solid #fbc02d;
    border-radius: 10px;
    padding: 10px;
    flex-direction: column;
    gap: 10px;
    z-index: 11;
    white-space: nowrap;
}

/* Show dropdown on hover */
.nav-item.dropdown:hover .dropdown-menu {
    display: flex;
}

/* Links inside the dropdown */
.dropdown-menu a {
    color: white;
    font-family: 'Press Start 2P', monospace;
    font-size: 14px;
    text-decoration: none;
    padding: 5px 10px;
    transition: background-color 0.3s;
}

.dropdown-menu a:hover {
    color: #fbc02d;
    background-color: rgba(255, 255, 255, 0.1);
}


@media (max-width: 768px) {
    body {
        padding-top: 120px;
        overflow-x: hidden;
    }

    .main-header {
        position: fixed;
        top: 0;
        padding: 5px 0;
        margin-bottom: -50px;
    }

    .nav-links {
        flex-direction: column;
        gap: 1px;
        align-items: center;
    }

    .tv-container {
        transform: scale(0.85);
        transform-origin: top center;
        margin-top: -340px;
    }

    .tv-controls {
        top: 45%;
        left: 50%;
        transform: translateX(-50%);
        display: grid;
        grid-template-columns: repeat(2, auto);
        gap: 10px 20px;
        justify-content: center;
        align-items: center;
    }

    .tv-controls button {
        font-size: 14px;
        padding: 10px 20px;
        width: 120px;
        text-align: center;
    }

    .volume-indicator {
        display: none;
    }

    .tv-screen {
        width: 90vw;
        aspect-ratio: 4 / 3;          /* keeps classic TV shape */
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .tv-frame {
        position: absolute;
        top: 10%;
        left: -55%;
        width: 185%;
        height: 75%;
        overflow: hidden;
    }

    .tv-frame img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: left center; /* bias image to the left */
        transform: translateX(-16%);
    }

    /* Hide scan‑line and ghosting overlays on mobile */
    .tv-screen::before,
    .tv-screen::after {
        display: none;
    }
}
/* Restore iframe visibility in mobile view if .tv-screen.off is applied */
.tv-screen iframe {
    visibility: visible !important;
}

.tv-frame {
    position: absolute;
    top: 18%;
    left: 12%;
    width: 76%;
    height: 60%;
    overflow: hidden;
    border-radius: 8px;
    z-index: 1;
}