        :root {
            --chat-width: 350px;
            --twitch-purple: #9147ff;
            --tab-height: 35px;
        }

        body, html {
            margin: 0; padding: 0; height: 100%;
            background: #0e0e10; color: white;
            font-family: sans-serif; overflow: hidden;
        }

        #setup-screen {
            display: flex; flex-direction: column; align-items: center; 
                /*justify-content: center; */
            height: 100vh; text-align: center; background: radial-gradient(circle, #1f1f23 0%, #0e0e10 100%);
        }
        /* --- Premium Setup Card --- */
        .setup-card { 
            background: #18181b; 
            padding: 35px 40px; 
            border-radius: 12px; 
            width: 480px; /* Made it wider to fix the tall rectangle look */
            max-width: 90vw;
            box-shadow: 0 15px 40px rgba(0,0,0,0.6); /* Adds depth */
            border: 1px solid #2a2a2f;
        }

        /* --- Modern Radio Button Pills --- */
        .setup-radio-group {
            display: flex;
            gap: 8px;
            margin-bottom: 20px;
        }

        .setup-radio-group label {
            flex: 1;
            text-align: center;
            background: #0e0e10;
            border: 1px solid #333;
            padding: 10px 0;
            border-radius: 6px;
            font-size: 12px;
            font-weight: bold;
            cursor: pointer;
            color: #adadb8;
            transition: all 0.2s ease;
        }

        .setup-radio-group label:hover {
            background: #252529;
        }

        /* This applies styles when the hidden radio inside is checked */
        .setup-radio-group label:has(input:checked) {
            background: #35353b;
            color: white;
            border-color: var(--twitch-purple);
            box-shadow: 0 0 10px rgba(145, 71, 255, 0.2);
        }

        .setup-radio-group input[type="radio"] {
            display: none; /* Hides the actual tiny circle */
        }

        input[type="text"] {
            width: 100%; padding: 12px; margin: 15px 0; border-radius: 4px;
            border: 1px solid #333; background: #000; color: white; box-sizing: border-box;
        }

        #dashboard { display: none; height: 100vh; }
        #main-container { display: flex; width: 100vw; height: 100vh; }

        #chat-sidebar {
            width: var(--chat-width); display: flex; flex-direction: column;
            background: #18181b; border-right: 1px solid #333; flex-shrink: 0;
            z-index: 10 !important;
        }

        #sidebar-controls {
            display: grid; 
                grid-template-columns: auto 25px repeat(4, 1fr) 25px;
            gap: 4px; padding: 8px; background: #1f1f23; border-bottom: 1px solid #333;
        }

        #sidebar-controls button {
            width: 100%; font-size: 10px; padding: 6px 0; border-radius: 4px;
            border: none; cursor: pointer; font-weight: bold;
            background: var(--twitch-purple); color: white;
        }

#bring-back-chat{
    position: absolute;
    top: 0px;
    right: 0px;
    font-size: 10px;
    border-radius: 4px;
    background: #3887b5;
    z-index: 1;
    width: 25px;
    height: 25px;
}

        #home-link button { padding: 6px 10px; min-width: 30px; }
        #sidebar-controls button.secondary { background: #35353b; }
        #sidebar-controls button.reset-btn { background: #eb0400; }

        #tabs-header {
            display: flex; flex-wrap: wrap; background: #0e0e10;
            min-height: var(--tab-height); border-bottom: 1px solid #333;
            padding: 2px; gap: 2px;
        }

        .tab {
            display: flex; align-items: center; gap: 5px; padding: 6px 8px;
            cursor: pointer; background: #1f1f23; border: 1px solid #000;
            font-size: 11px; white-space: nowrap; flex: 1 1 auto;
            justify-content: space-between; max-width: 48%;
        }

        .tab.active { 
                background: #26262c; 
                border-bottom: 2px solid #3cd8ff; 
                box-shadow: inset 0 -15px 20px -10px rgb(134 195 195 / 63%);
        }

        .tab.focused { 
                background: rgb(0, 47, 74); 
                color: white; 
        }

        .focus-btn {
            background: transparent; border: none; color: #adadb8;
            cursor: pointer; font-size: 14px; padding: 0 2px; line-height: 1;
        }
        .focus-btn:hover { color: white; }

        #chat-frames { flex-grow: 1; position: relative; }
        .chat-frame { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: none; border: none; }
        .chat-frame.active { display: block; }

        #video-grid { flex-grow: 1; 
                     position: relative; 
                     background: #000; 
                     overflow: hidden; 
                     display: block;
                    }
        .video-container { 
                position: absolute; 
                transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1); 
                aspect-ratio: 16/9; 

                /* borders */
                padding: 4.5px 8px;
                  box-sizing: border-box;
                z-index: 200;

        }
.video-container iframe {
               /* border: 3px solid;
  border-image-source: linear-gradient(45deg, #00f2ff, #7000ff);
  border-image-slice: 1;
  background: #000;
  box-shadow: 0 0 15px rgba(0, 242, 255, 0.4),  inset 0 0 10px rgba(112, 0, 255, 0.4); */
        
}

        
        /* force hide */
        .is-hidden { display: none !important; }

/*testing new way of hiding thins*/
.is-hidden-moved {
    position: absolute !important;
    left: -9999px !important; 
    top: 0 !important;
    width: 400px !important;
    height: 225px !important;
    pointer-events: none;
}

        .close-btn { font-size: 14px; font-weight: bold; color: #adadb8; padding: 0 4px; }
        .close-btn:hover { color: #ff4a4a; }

        #copy-popup {
            display: none; position: fixed; bottom: 20px; left: 50%; 
            transform: translateX(-50%); background: #1f1f23; 
            border: 2px solid var(--twitch-purple); padding: 20px; 
            border-radius: 8px; z-index: 100; box-shadow: 0 10px 30px rgba(0,0,0,0.5); width: 300px;
        }

.tab.is-live {
    border-left: 3px solid #ff5454 !important;
        box-shadow: inset 15px 0 10px -10px rgb(255 62 62);
}

.tab.is-offline {
    color: #adadb8;
    opacity: 0.7;
}

#tabs-header .tab.is-hidden { /*forcing offline tabs to stay visible*/
    /* display: flex !important; */
}

/* vertical mode */
@media (orientation: portrait) {
    #main-container {
        flex-direction: column;
    }

    #chat-sidebar {
        width: 100% !important; 
        height: 68vh;           
        border-right: none;
        border-top: 1px solid #333;
        
    }

    #video-grid {
        width: 100% !important;
        height: 1vh;           
    }

    #main-container {
        display: flex;
    }
}

.video-container.youtube iframe {
    /* border: 3px solid;
    border-image-source: linear-gradient(45deg, #f57fb0, #750000);
    border-image-slice: 1;
    background: #000;
    box-shadow: 0 0 15px rgb(255 106 106 / 40%),  inset 0 0 10px rgba(112, 0, 255, 0.4); */
}


#save-layout-prompt {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    background: #18181b;
    border: 1px solid var(--twitch-purple);
    padding: 15px;
    border-radius: 8px;
    z-index: 10001;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

#save-layout-prompt button {
    background: var(--twitch-purple);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
    font-size: 12px;
}



/* drop form */
#tabs-header.drag-over {
    background: rgba(145, 71, 255, 0.2) !important;
    outline: 2px dashed var(--twitch-purple);
    outline-offset: -4px;
}

/* temp fix attempt */
body.dragging-active iframe {
    pointer-events: none !important;
}


/*youtube playlist queue*/

.playlist-sidebar {
    display: none;
    flex-direction: column;
    height: 100%;
    background: #0e0e10;
    overflow-y: auto;
    border-left: 1px solid #2a2a2f;
}

.playlist-sidebar.active {
    display: flex;
}

.playlist-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #1f1f23;
    transition: background 0.2s;
}

.playlist-item:hover {
    background: #1f1f23;
}

.playlist-item.playing {
    background: #8c0036;
    border-left: 3px solid #f70260;
}

.playlist-item img {
    width: 80px;
    height: 45px;
    object-fit: cover;
    border-radius: 4px;
}

.playlist-item-info {
    flex: 1;
    font-size: 12px;
    color: #efeff1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.playlist-sidebar::-webkit-scrollbar {
    display: none;
}

.playlist-sidebar {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
    overflow-y: auto; 
}

.playlist-item-index {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px; 
    font-size: 12px;
    color: #adadb8; 
    font-weight: bold;
    flex-shrink: 0; 
}


.close-sidebar-btn {
    background-color: #35353b;
    color: #adadb8;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.close-sidebar-btn:hover {
    background-color: #e91e63; /* Optional: Makes it red on hover */
    color: white;
}
