@font-face {
    font-family: 'VCR OSD Mono';
    src: url('/VCR_OSD_MONO.ttf') format('truetype');
}

@font-face {
    font-family: 'Arial';
    src: url('/arial.ttf') format('truetype');
}

body, html {
    height: 100%;
    margin: 0;
    overflow: hidden;
    background-color: #1a1a1a;
    background-image: url('/background.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #fff;
    font-family: 'Arial', sans-serif;
}

#app-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

#tv-container {
    position: relative;
}

#tv-frame {
    width: 100%;
    height: auto;
    position: relative;
    z-index: 2;
    pointer-events: none; /* Allow clicks to pass through to screen */
    image-rendering: auto;
    will-change: transform, opacity;
}

#tv-screen {
    position: absolute;
    top: 9.85%;
    left: 11.9%;
    width: 58.60%;
    height: 73.60%;
    background-color: #000;
    overflow: hidden;
    box-shadow: inset 0 0 20px 5px rgba(0,0,0,0.7);
    z-index: 1;
}

#channel-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    display: flex;
    justify-content: center;
    align-items: center;
}

#channel-content video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #000;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 4; /* Below channel info but above video */
}

.video-overlay p {
    font-family: 'VCR OSD Mono', monospace;
    font-size: 2.5vmin;
    color: #f0f0f0;
    text-shadow: 2px 2px 2px #111;
}

#screenbug-container {
    position: absolute;
    z-index: 6;
    display: flex;
    gap: 10px;
    align-items: center;
    pointer-events: none;
}

#screenbug-container img {
    max-width: 80px;
    max-height: 50px;
    width: auto;
    height: auto;
}

/* Screenbug Positions */
#screenbug-container.top-left { top: 10px; left: 10px; }
#screenbug-container.top-right { top: 10px; right: 10px; flex-direction: row-reverse; }
#screenbug-container.bottom-left { bottom: 10px; left: 10px; }
#screenbug-container.bottom-right { bottom: 10px; right: 10px; flex-direction: row-reverse; }


#static-gif {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
}

#channel-info-overlay {
    position: absolute;
    bottom: 5%;
    left: 5%;
    right: 5%;
    background-color: rgba(20, 20, 100, 0.3);
    border: 1px solid rgba(100, 100, 255, 0.3);
    padding: 0.5% 2%;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
    z-index: 5;
}

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

#channel-info-text {
    margin: 0;
    font-family: 'VCR OSD Mono', monospace;
    font-size: 2.5vmin;
    color: #f0f0f0;
    text-shadow: 2px 2px 2px #111;
    white-space: nowrap;
}

#channel-skipper-overlay {
    display: none; /* No longer used */
}

.blinking-cursor {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    from, to { color: transparent; }
    50% { color: #f0f0f0; }
}

#click-to-start {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    background-color: rgba(0,0,0,0.8);
    cursor: pointer;
    z-index: 100;
    font-family: 'VCR OSD Mono', monospace;
    flex-direction: column;
}

#click-to-start .logo {
    width: min(60vmin, 480px);
    transform: scale(0.2);
    /* animation starts only when .animate is added */
    image-rendering: auto;
    user-select: none;
}
#click-to-start .logo.animate {
    animation: logo-pop 1200ms ease-out forwards;
}

@keyframes logo-pop {
    to { transform: scale(1); }
}

#click-to-start .start-hint {
    margin-top: 12px;
    opacity: 0;
    font-size: 1.25rem;
    /* animation will be applied when .show is added */
}
#click-to-start .start-hint.show {
    animation: hint-fade 300ms ease-out forwards;
}

@keyframes hint-fade {
    to { opacity: 1; }
}

.channel-skipper-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    z-index: 900;
    display: flex;
    justify-content: center;
    align-items: center;
}

.remote-control {
    background-color: #222;
    border: 2px solid #555;
    border-radius: 20px;
    padding: 20px;
    width: 250px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    font-family: 'VCR OSD Mono', monospace;
}

.remote-display {
    background-color: #111;
    border: 1px solid #444;
    color: #f0f0f0;
    font-size: 2rem;
    padding: 10px;
    margin-bottom: 20px;
    text-align: right;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.remote-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.remote-button {
    padding: 15px;
    font-size: 1.5rem;
    background-color: #333;
    border: 1px solid #555;
    color: white;
    cursor: pointer;
    border-radius: 10px;
    font-family: 'VCR OSD Mono', monospace;
    transition: background-color 0.1s;
}

.remote-button:hover {
    background-color: #444;
}

.remote-button:active {
    background-color: #555;
}

.remote-button.go {
    grid-column: 1 / -1; /* Span all columns */
    margin-top: 10px;
    background-color: #4CAF50;
}

.remote-button.go:hover {
    background-color: #45a049;
}

.controls-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    align-items: center;
    background-color: rgba(0,0,0,0.5);
    padding: 10px 20px;
    border-radius: 10px;
    z-index: 50;
    min-height: 42px; /* Ensure container height is consistent */
}

.controls-container button, .controls-container label {
    font-family: 'Arial', sans-serif;
    font-size: 1rem;
    color: white;
    background-color: #333;
    border: 1px solid #555;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
}

.controls-container button:hover {
    background-color: #444;
}

.controls-container button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.controls-container label {
    display: flex;
    align-items: center;
    gap: 5px;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dev-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4); /* Less obtrusive backdrop */
    z-index: 1000;
}

.dev-menu-content {
    background-color: #2c2c2c;
    padding: 15px;
    border-radius: 10px;
    width: 300px;
    max-height: 90vh;
    overflow-y: auto;
    font-family: 'Arial', sans-serif;
    border: 2px solid #555;
    position: absolute;
    top: 20px;
    right: 20px;
}

.modal-content {
    background-color: #2c2c2c;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    height: 90vh;
    overflow-y: auto;
    font-family: 'Arial', sans-serif;
    border: 2px solid #555;
}

.modal-content h2 {
    margin-top: 0;
    border-bottom: 1px solid #555;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #666;
    background-color: #333;
    color: #fff;
    box-sizing: border-box;
}

.drop-zone {
    border: 2px dashed #666;
    padding: 20px;
    text-align: center;
    border-radius: 5px;
    transition: background-color 0.2s, border-color 0.2s;
    position: relative;
}

.drop-zone.drag-over {
    background-color: #3a3a3a;
    border-color: #00aaff;
}

.drop-zone .drop-zone-text {
    color: #aaa;
    margin: 5px 0 10px 0;
}

.drop-zone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.form-group input[type="file"] {
    padding: 3px;
}

.form-group.inline {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group.inline label {
    margin-bottom: 0;
}

.guideline-select {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.guideline-option {
    border: 2px solid transparent;
    cursor: pointer;
    padding: 5px;
    background-color: #444;
    border-radius: 5px;
}

.guideline-option.selected {
    border-color: #00aaff;
}

.guideline-option img {
    width: 60px;
    height: auto;
}

.video-list {
    list-style: none;
    padding: 0;
}

.video-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    background-color: #333;
    padding: 5px;
    border-radius: 4px;
}

.video-list-item input {
    flex-grow: 1;
}

.video-list-item span {
    color: #aaa;
    font-size: 0.8em;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions button {
    padding: 10px 20px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.modal-actions .save {
    background-color: #4CAF50;
    color: white;
}

.modal-actions .cancel {
    background-color: #f44336;
    color: white;
}
.modal-actions .delete {
    background-color: #800000;
    color: white;
    margin-right: auto;
}

.promo-banner {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #ffffff;
    padding: 6px 16px;
    font-family: 'Arial', sans-serif;
    font-size: 0.9rem;
    z-index: 1150;
    border-radius: 0 0 8px 8px;
    border: 1px solid #333;
    border-top: none;
    pointer-events: none;
    text-shadow: 1px 1px 2px #000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* Hotpage banner */
#hotpage-banner {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, #0f9d58 0%, #34a853 50%, #fbbc05 100%);
    color: #081014;
    padding: 10px 18px;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.45);
    font-family: 'VCR OSD Mono', monospace;
    font-size: 1.05rem;
    z-index: 1200;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: calc(100% - 40px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#hotpage-banner .banner-text {
    display: inline-block;
    line-height: 1;
    padding-right: 6px;
}

#hotpage-banner .banner-close {
    background: rgba(255,255,255,0.95);
    border: none;
    color: #081014;
    padding: 6px 10px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

#hotpage-banner .banner-close:hover {
    transform: translateY(-1px);
}

/* Small-screen tweaks */
@media (max-width: 520px) {
    #hotpage-banner {
        font-size: 0.95rem;
        top: 8px;
        padding: 8px 12px;
    }
}

/* Light Bulb Hijack Trigger */
.light-bulb-trigger {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 100px;
    cursor: pointer;
    z-index: 1000;
    border-radius: 0 0 40px 40px;
    background: transparent;
    transition: background 0.3s;
}
.light-bulb-trigger:hover {
    background: rgba(255, 255, 200, 0.08);
    box-shadow: 0 0 40px rgba(255, 255, 200, 0.1);
}

.hijack-modal-content {
    background-color: #1a1a1a;
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    border: 2px solid #ff4444;
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.3);
    font-family: 'VCR OSD Mono', monospace;
    color: #fff;
    animation: glitch-border 2s infinite;
}

@keyframes glitch-border {
    0% { border-color: #ff4444; box-shadow: 0 0 20px rgba(255, 68, 68, 0.3); }
    50% { border-color: #ff8888; box-shadow: 0 0 30px rgba(255, 136, 136, 0.5); }
    100% { border-color: #ff4444; box-shadow: 0 0 20px rgba(255, 68, 68, 0.3); }
}

.hijack-input {
    width: 100%;
    padding: 12px;
    background: #000;
    border: 1px solid #444;
    color: #0f0;
    font-family: 'VCR OSD Mono', monospace;
    margin: 15px 0;
    outline: none;
}

.hijack-btn {
    background: #ff4444;
    color: white;
    border: none;
    padding: 12px 20px;
    width: 100%;
    cursor: pointer;
    font-weight: bold;
    letter-spacing: 1px;
}

.hijack-btn:hover {
    background: #cc0000;
}

/* TV Mod Positioning */
.tv-mod-attachment.on-top {
    bottom: 95%;
    left: 20%;
    width: 25%;
    transform: translateY(10px);
}
.tv-mod-attachment.on-left {
    right: 95%;
    top: 20%;
    width: 20%;
}
.tv-mod-attachment.on-right {
    left: 95%;
    top: 20%;
    width: 20%;
}
.tv-mod-attachment.screen-overlay {
    top: 10%;
    left: 12%;
    width: 58%;
    height: 73%;
    opacity: 0.15;
    object-fit: contain;
    mix-blend-mode: screen;
}

/* Celebration Diamonds */
.diamond-rain-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.falling-diamond {
    position: absolute;
    top: -50px;
    color: #fff;
    font-size: 2rem;
    text-shadow: 0 0 10px rgba(255,255,255,0.8);
    user-select: none;
    animation: diamond-fall linear forwards;
}

.report-btn-main {
    position: fixed;
    top: 10px;
    left: 10px;
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.5);
    color: white;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    font-size: 1.2rem;
    transition: background 0.2s;
}

.report-btn-main:hover {
    background: rgba(255, 0, 0, 0.6);
}

@keyframes diamond-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(110vh) rotate(720deg);
        opacity: 0;
    }
}

/* Sign Off Styles */
.sign-off-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    overflow: hidden;
}

.sign-off-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

.sign-off-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle, transparent 40%, rgba(0,0,0,0.8) 100%);
}

.sign-off-message {
    background-color: rgba(0, 0, 0, 0.7);
    border: 2px solid #555;
    padding: 20px;
    text-align: center;
    font-family: 'VCR OSD Mono', monospace;
    max-width: 80%;
    box-shadow: 0 0 20px rgba(0,0,0,1);
}

.sign-off-message h3 {
    margin: 0 0 10px 0;
    color: #f0f0f0;
    letter-spacing: 2px;
}

.sign-off-message p {
    font-size: 1.5vmin;
    color: #aaa;
    margin-bottom: 15px;
    line-height: 1.4;
}

.current-time-display {
    font-size: 2.5vmin;
    color: #fff;
    text-shadow: 0 0 5px rgba(255,255,255,0.5);
}

/* Floating Monitor Style */
.floating-monitor {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 280px;
    height: 350px;
    z-index: 800;
    border: 2px solid #00ff41;
    background-color: #050510;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.2), 0 10px 30px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: monitor-slide-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.monitor-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    color: #00ff41;
    border: 1px solid #00ff41;
    padding: 2px 6px;
    cursor: pointer;
    font-family: 'VCR OSD Mono', monospace;
    font-size: 10px;
    z-index: 100;
    transition: all 0.2s;
}

.monitor-close-btn:hover {
    background: #00ff41;
    color: #000;
}

@keyframes monitor-slide-in {
    from { transform: translateX(320px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Video Animations */
.video-anim-ken-burns {
    animation: ken-burns 30s infinite alternate ease-in-out;
}

.video-anim-film-jitter {
    animation: film-jitter 0.15s infinite;
}

.video-anim-vhs-wobble {
    animation: vhs-wobble 4s infinite ease-in-out;
}

.video-anim-pulse {
    animation: video-pulse 6s infinite ease-in-out;
}

.video-anim-glitch-random {
    animation: video-glitch-rand 8s infinite step-end;
}

@keyframes ken-burns {
    0% { transform: scale(1); }
    100% { transform: scale(1.15); }
}

@keyframes film-jitter {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(1px, -1px) rotate(0.1deg); }
    50% { transform: translate(-1px, 1px) rotate(-0.1deg); }
    75% { transform: translate(1px, 1px) rotate(0.05deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes vhs-wobble {
    0%, 100% { transform: translateX(0); filter: hue-rotate(0deg); }
    33% { transform: translateX(2px) skewX(0.5deg); filter: hue-rotate(2deg); }
    66% { transform: translateX(-2px) skewX(-0.5deg); filter: hue-rotate(-2deg); }
}

@keyframes video-pulse {
    0%, 100% { filter: brightness(1) contrast(1); }
    50% { filter: brightness(1.1) contrast(1.05); }
}

@keyframes video-glitch-rand {
    0%, 90%, 100% { transform: translate(0,0) scale(1); filter: none; }
    92% { transform: translate(5px, -2px) scale(1.02); filter: hue-rotate(90deg) invert(0.1); }
    94% { transform: translate(-5px, 2px) scale(0.98); filter: saturate(3); }
    96% { transform: translate(2px, 5px) scale(1.01); filter: brightness(2); }
}

.video-anim-black-white { filter: grayscale(1) contrast(1.2); }
.video-anim-sepia { filter: sepia(0.8) contrast(1.1); }
.video-anim-toxic-green { filter: sepia(1) hue-rotate(90deg) saturate(6) brightness(0.7) contrast(1.5); }
.video-anim-midnight { filter: hue-rotate(180deg) brightness(0.5) saturate(2); }
.video-anim-inverted { filter: invert(1); }
.video-anim-psychedelic { animation: psychedelic-anim 4s infinite linear; }

@keyframes psychedelic-anim {
    0% { filter: hue-rotate(0deg) saturate(3) brightness(1.2); }
    100% { filter: hue-rotate(360deg) saturate(3) brightness(1.2); }
}

.video-anim-dream-haze { filter: brightness(1.2) saturate(1.3) blur(1.5px) contrast(0.9); }
.video-anim-vapor-sky { animation: vapor-anim 10s infinite alternate ease-in-out; }
@keyframes vapor-anim {
    0% { filter: hue-rotate(-20deg) saturate(2) brightness(1.1) contrast(1.1); }
    100% { filter: hue-rotate(20deg) saturate(2.5) brightness(1.2) contrast(1.2); }
}

.video-anim-thermal-vision { filter: invert(1) hue-rotate(180deg) saturate(10) contrast(1.5) brightness(0.8); }
.video-anim-cyberpunk { filter: contrast(1.8) saturate(2.5) brightness(1.1) hue-rotate(-10deg); }
.video-anim-cga-graphics { filter: contrast(5) saturate(0) sepia(1) hue-rotate(140deg) brightness(1.2); }

.video-anim-old-newsreel { animation: newsreel-anim 0.2s infinite, film-jitter 0.1s infinite; }
@keyframes newsreel-anim {
    0%, 100% { filter: grayscale(1) contrast(1.5) brightness(0.9) sepia(0.2); }
    50% { filter: grayscale(1) contrast(1.7) brightness(1.1) sepia(0.3); }
}

.video-anim-solarized { filter: invert(0.6) contrast(2) saturate(1.5); }
.video-anim-frozen { filter: hue-rotate(180deg) brightness(1.2) saturate(0.5) contrast(1.1); }
.video-anim-burning { animation: burning-anim 3s infinite ease-in-out; }
@keyframes burning-anim {
    0%, 100% { filter: sepia(1) hue-rotate(-15deg) saturate(5) brightness(0.8) contrast(1.5); }
    50% { filter: sepia(1) hue-rotate(5deg) saturate(8) brightness(1.2) contrast(1.8); }
}

.crt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 11;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}