:root {
    --theme-color-pink: #e83d84; 
    --theme-color-purple: #a436a0; 
    --header-height-desktop: 70px; 
    --header-height-mobile: 60px; 
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body { 
    background-color: #000000; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; 
    color: #ffffff; 
    touch-action: manipulation; 
    overscroll-behavior: none; 
}

body.drawer-open, body.player-open { 
    overflow: hidden; 
}

/* Header */
.top-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 0 20px; 
    background-color: #0d0d0d; 
    border-top: 4px solid var(--theme-color-purple); 
    gap: 15px; 
    position: sticky; 
    top: 0; 
    z-index: 999; 
    width: 100%; 
    height: var(--header-height-desktop); 
    box-sizing: border-box;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.logo-container { 
    display: flex; 
    align-items: center; 
    cursor: pointer; 
    flex-shrink: 0; 
    height: 100%; 
}

.logo-container img { 
    max-height: 45px; 
    width: auto; 
    object-fit: contain; 
} 

.header-controls { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}

.search-container { 
    display: flex; 
    align-items: center; 
    flex-grow: 1; 
    max-width: 400px; 
    margin-left: auto; 
    position: relative; 
}

.search-container input { 
    background-color: #222; 
    border: 1px solid #444; 
    border-radius: 20px; 
    padding: 8px 15px; 
    color: #fff; 
    width: 100%; 
}

.search-container button.search-btn { 
    background-color: var(--theme-color-pink); 
    border: none; 
    border-radius: 20px; 
    padding: 8px 20px; 
    color: #fff; 
    font-weight: bold; 
    cursor: pointer; 
    flex-shrink: 0; 
    margin-left: 10px; 
}

.search-container button.search-btn:hover { 
    background-color: #f0589e; 
}

.header-btn { 
    background-color: transparent; 
    border: none; 
    border-radius: 50%; 
    width: 36px; 
    height: 36px; 
    color: #fff; 
    cursor: pointer; 
    flex-shrink: 0; 
    transition: background-color 0.2s, transform 0.2s; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    padding: 0; 
}

.header-btn:hover { 
    background-color: rgba(255, 255, 255, 0.1); 
}

.header-btn svg { 
    width: 22px; 
    height: 22px; 
}

#refresh-button { 
    background-color: var(--theme-color-pink); 
}

#refresh-button svg { 
    width: 20px; 
    height: 20px; 
}

#refresh-button:hover { 
    background-color: #f0589e; 
}

#refresh-button:active { 
    transform: scale(0.9) rotate(90deg); 
}

#search-toggle-btn, #search-close-btn { 
    display: none; 
}

#menu-toggle-btn { 
    background: none; 
    border: none; 
    color: #fff; 
    cursor: pointer; 
    padding: 5px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin-right: 15px; 
}

#menu-toggle-btn svg { 
    width: 28px; 
    height: 28px; 
}

/* Marquee Notice */
.marquee-container {
    width: 100%;
    background: #e83d84;
    color: #fff;
    padding: 8px 0;
    overflow: hidden;
    position: sticky; 
    top: var(--header-height-desktop); 
    z-index: 998; 
    border-bottom: 2px solid #a436a0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
}

.marquee-container.hidden { 
    display: none; 
}

.marquee-text {
    white-space: nowrap;
    display: inline-block;
    padding-left: 100%;
    animation: marquee 25s linear infinite;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

@keyframes marquee {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-100%, 0); }
}

/* Navigation Drawer */
#nav-overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(0, 0, 0, 0.6); 
    backdrop-filter: blur(8px); 
    -webkit-backdrop-filter: blur(8px); 
    z-index: 1001; 
    opacity: 0; 
    pointer-events: none; 
    transition: opacity 0.3s ease-in-out; 
}

#nav-overlay.open { 
    opacity: 1; 
    pointer-events: auto; 
}

#nav-drawer { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 280px; 
    height: 100%; 
    background: linear-gradient(145deg, rgba(30, 30, 30, 0.7), rgba(15, 15, 15, 0.8)); 
    backdrop-filter: blur(15px); 
    -webkit-backdrop-filter: blur(15px); 
    border-right: 1px solid rgba(255,255,255,0.05); 
    z-index: 1002; 
    display: flex; 
    flex-direction: column; 
    transform: translateX(-100%); 
    transition: transform 0.3s ease-in-out; 
}

#nav-drawer.open { 
    transform: translateX(0); 
}

.drawer-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 15px 20px; 
    background-color: #0d0d0d; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); 
}

.drawer-header .logo { 
    width: 120px; 
}

#drawer-close-btn { 
    background: none; 
    border: none; 
    color: #fff; 
    cursor: pointer; 
    padding: 5px; 
}

#drawer-close-btn svg { 
    width: 24px; 
    height: 24px; 
}

.drawer-menu { 
    list-style: none; 
    padding: 10px 0; 
}

.drawer-menu li a { 
    display: flex; 
    align-items: center; 
    padding: 15px 20px; 
    color: #f1f1f1; 
    text-decoration: none; 
    font-size: 0.95rem; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    transition: background-color 0.2s, color 0.2s; 
}

.drawer-menu li a:hover { 
    background-color: rgba(255, 255, 255, 0.1); 
}

.drawer-menu li a svg { 
    width: 22px; 
    height: 22px; 
    margin-right: 15px; 
    color: #ccc; 
    flex-shrink: 0; 
}

.drawer-menu .menu-heading { 
    padding: 20px 20px 8px; 
    color: #aaa; 
    font-size: 0.85rem; 
    text-transform: uppercase; 
    font-weight: bold; 
    border-top: 1px solid rgba(255, 255, 255, 0.05); 
    margin-top: 10px; 
}

/* Modals */
#custom-modal-overlay, #resume-overlay { 
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(0, 0, 0, 0.85); 
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px); 
    z-index: 100000; 
    justify-content: center; 
    align-items: center; 
    padding: 20px; 
    flex-direction: column; 
}

#custom-modal, .resume-content { 
    background: linear-gradient(145deg, #1e1e1e, #2a2a2a); 
    border-radius: 20px; 
    padding: 30px; 
    max-width: 400px; 
    width: 100%; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.6); 
    border: 1px solid rgba(255,255,255,0.1); 
    text-align: center; 
    position: relative; 
}

.resume-content { 
    width: 320px; 
}

#modal-title, #resume-channel-name { 
    font-size: 1.3rem; 
    font-weight: bold; 
    margin-bottom: 15px; 
    color: #fff; 
    text-shadow: 0 2px 4px rgba(0,0,0,0.5); 
}

#modal-text, .resume-subtext { 
    font-size: 1rem; 
    line-height: 1.6; 
    color: #ccc; 
    margin-bottom: 25px; 
}

#modal-text a { 
    color: var(--theme-color-pink); 
    text-decoration: none; 
    font-weight: bold; 
}

.modal-actions { 
    display: flex; 
    justify-content: center; 
    gap: 15px; 
    margin-top: 5px; 
}

#modal-ok-btn, #resume-play-btn { 
    background: linear-gradient(90deg, var(--theme-color-purple), var(--theme-color-pink)); 
    border: none; 
    font-size: 1rem; 
    font-weight: bold; 
    cursor: pointer; 
    padding: 12px 25px; 
    border-radius: 50px; 
    color: #fff; 
    transition: transform 0.2s; 
    box-shadow: 0 4px 15px rgba(232, 61, 132, 0.4); 
    flex: 1; 
}

#modal-ok-btn:hover, #resume-play-btn:hover { 
    transform: scale(1.03); 
}

#modal-cancel-btn { 
    background: rgba(255, 255, 255, 0.1); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    font-size: 1rem; 
    font-weight: bold; 
    cursor: pointer; 
    padding: 12px 25px; 
    border-radius: 50px; 
    color: #ccc; 
    transition: background 0.2s; 
    flex: 1; 
}

#modal-cancel-btn:hover { 
    background: rgba(255, 255, 255, 0.2); 
    color: #fff; 
}

#resume-play-btn { 
    width: 100%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 10px; 
}

#resume-play-btn svg { 
    width: 24px; 
    height: 24px; 
}

#resume-close-btn { 
    position: absolute; 
    top: 10px; 
    right: 10px; 
    background: rgba(255,255,255,0.1); 
    border: none; 
    color: #fff; 
    width: 30px; 
    height: 30px; 
    border-radius: 50%; 
    cursor: pointer; 
    font-weight: bold; 
}

#resume-channel-logo { 
    width: 90px; 
    height: 90px; 
    object-fit: contain; 
    background: #fff; 
    border-radius: 50%; 
    padding: 5px; 
    margin-bottom: 15px; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.3); 
}

/* Grid */
.channel-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); 
    gap: 20px; 
    padding: 30px; 
    justify-content: center; 
}

.channel-card { 
    background-color: #111111; 
    border: 2px solid var(--theme-color-pink); 
    border-radius: 20px; 
    padding: 20px 10px 15px; 
    text-align: center; 
    transition: transform 0.2s ease-in-out, border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out; 
    cursor: pointer; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: flex-start; 
    overflow: hidden; 
    position: relative; 
}

.channel-card:hover { 
    transform: scale(1.05); 
    border-color: var(--theme-color-purple); 
    box-shadow: 0 0 15px rgba(164, 54, 160, 0.5); 
    z-index: 5; 
}

.channel-card.active { 
    border-color: var(--theme-color-purple); 
    transform: scale(1.1); 
    box-shadow: 0 0 20px rgba(164, 54, 160, 0.7); 
    z-index: 10; 
}

.channel-logo-wrapper { 
    background-color: #ffffff; 
    width: 90px; 
    height: 90px; 
    border-radius: 50%; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    margin-bottom: 15px; 
    overflow: hidden; 
    flex-shrink: 0; 
}

.channel-logo-wrapper img { 
    max-width: 85%; 
    max-height: 85%; 
    object-fit: contain; 
}

.channel-name { 
    font-size: 14px; 
    font-weight: bold; 
    word-break: break-word; 
}

#error-message, #no-results-message { 
    text-align: center; 
    padding: 50px; 
    grid-column: 1 / -1; 
    display: none; 
}

#error-message { color: red; } 
#no-results-message { color: #cccccc; }

/* Loader */
#loading-overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: radial-gradient(circle at center, #1a1a1a 0%, #000000 100%); 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    z-index: 999999; 
    transition: opacity 0.5s ease-out; 
}

#loading-overlay.hidden { 
    opacity: 0; 
    pointer-events: none; 
}

.loader-logo { 
    width: 150px; 
    mix-blend-mode: lighten; 
    margin-bottom: 30px; 
}

.spinner { 
    width: 50px; 
    height: 50px; 
    border: 4px solid rgba(255, 255, 255, 0.1); 
    border-left-color: var(--theme-color-pink); 
    border-radius: 50%; 
    animation: spin 1s linear infinite; 
}

.loading-text { 
    color: #ffffff; 
    margin-top: 25px; 
    font-size: 1.1rem; 
    letter-spacing: 1px; 
    opacity: 0.8; 
}

@keyframes spin { 
    to { transform: rotate(360deg); } 
}

/* ==============================================
   PLAYER UI CSS - ZONED LAYOUT
============================================== */
#video-player-overlay { 
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh; 
    background-color: #000; 
    z-index: 99999; 
    flex-direction: column; 
    justify-content: center; 
}

#videoWrap { 
    width: 100%; 
    height: 100%; 
    background: #000; 
    position: relative; 
    border-radius: 0; 
    border: none; 
    overflow: hidden; 
}

#video-player { 
    width: 100%; 
    height: 100%; 
}

video::-webkit-media-controls { display: none !important; }
video::-webkit-media-controls-enclosure { display: none !important; }

#videoWrap.aspect-fit video { object-fit: contain !important; transform: scale(1); }
#videoWrap.aspect-stretch video { object-fit: fill !important; transform: scale(1); }
#videoWrap.aspect-zoom video { object-fit: cover !important; transform: scale(1.2); }

#player-ui { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    display: flex; 
    flex-direction: column; 
    justify-content: flex-start; 
    opacity: 0; 
    transition: opacity 0.3s ease; 
    z-index: 50; 
    pointer-events: none; 
}

#player-ui.visible { 
    opacity: 1; 
}

#player-top-bar { 
    pointer-events: auto; 
    padding: 15px 20px; 
    background: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent); 
    display: flex; 
    flex-wrap: wrap; 
    justify-content: space-between; 
    align-items: center; 
    position: relative; 
    z-index: 100; 
}

.player-left { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    z-index: 120; 
    max-width: 40%;
    flex: 1;
    overflow: hidden;
}

.player-right { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    z-index: 120; 
    flex-shrink: 0;
}

.p-btn { 
    background: transparent; 
    border: none; 
    color: white; 
    cursor: pointer; 
    padding: 6px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    border-radius: 50%; 
    transition: 0.2s; 
    pointer-events: auto; 
}

.p-btn:hover { 
    background: rgba(255,255,255,0.2); 
    color: var(--theme-color-pink); 
}

.p-btn svg { 
    width: 24px; 
    height: 24px; 
}

#p-num { 
    font-size: 20px; 
    font-weight: bold; 
    color: #fff; 
    margin: 0 5px; 
    flex-shrink: 0;
}

#p-logo { 
    width: 35px; 
    height: 35px; 
    border-radius: 5px; 
    background: #fff; 
    padding: 2px; 
    object-fit: contain; 
    flex-shrink: 0;
}

/* Smart Scroll (Marquee) Container */
.p-name-container { 
    overflow: hidden; 
    white-space: nowrap; 
    flex: 1;
    position: relative;
}

#p-name { 
    display: inline-block; 
    font-size: 18px; 
    font-weight: bold; 
    color: #fff; 
    text-shadow: 1px 1px 3px #000; 
    padding-right: 20px; 
}

.smart-scroll { 
    animation: scrollText 8s linear infinite alternate; 
}

@keyframes scrollText { 
    0% { transform: translateX(0); } 
    100% { transform: translateX(calc(-100% + 150px)); } 
}

/* Multi-Server Wrapper */
.player-left { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    z-index: 120; 
    max-width: 35%; 
    flex: 1;
    overflow: hidden;
}

#p-servers-wrapper { 
    position: absolute; 
    left: 50%; 
    transform: translateX(-50%); 
    display: flex; 
    justify-content: flex-start; 
    align-items: center; 
    z-index: 110; 
    pointer-events: auto; 
    max-width: 35%; 
    overflow-x: auto; 
    scrollbar-width: none; 
    -webkit-overflow-scrolling: touch; 
    user-select: none; 
    -webkit-user-select: none;
}

#p-servers-wrapper.active {
    cursor: grabbing !important;
}

#p-servers-wrapper::-webkit-scrollbar { 
    display: none; 
}
.server-container { 
    display: flex; 
    justify-content: flex-start; 
    align-items: center; 
    gap: 8px; 
    padding: 5px; 
    white-space: nowrap; 
}

.server-pill { 
    background: rgba(255, 255, 255, 0.15); 
    border: 1px solid rgba(255, 255, 255, 0.2); 
    border-radius: 20px; 
    padding: 6px 16px; 
    font-size: 13px; 
    font-weight: bold; 
    color: #fff; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    white-space: nowrap; 
    backdrop-filter: blur(5px); 
    pointer-events: auto; 
    flex-shrink: 0; 
}

.server-pill:hover { 
    background: rgba(255, 255, 255, 0.3); 
}

.server-pill.active { 
    background: var(--theme-color-pink); 
    border-color: var(--theme-color-pink); 
    box-shadow: 0 0 10px rgba(232, 61, 132, 0.6); 
    color: #fff; 
}

/* ON-SCREEN NUMPAD */
#numpad-wrapper { 
    position: absolute; 
    bottom: 30px; 
    right: 20px; 
    display: flex; 
    flex-direction: column; 
    align-items: flex-end; 
    pointer-events: auto; 
    z-index: 150; 
}

#numpad-toggle-btn { 
    background: rgba(232, 61, 132, 0.7); 
    border-radius: 50%; 
    width: 45px; 
    height: 45px; 
    border: 1px solid rgba(255,255,255,0.2); 
    color: #fff; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    cursor: pointer; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.5); 
    transition: 0.3s; 
    margin-top: 10px; 
}

#numpad-toggle-btn:hover { 
    background: var(--theme-color-pink); 
    transform: scale(1.1); 
}

#numpad-container { 
    background: rgba(15, 15, 20, 0.95); 
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px); 
    border: 1px solid rgba(255,255,255,0.1); 
    border-radius: 12px; 
    padding: 12px; 
    width: 220px; 
    box-shadow: 0 8px 25px rgba(0,0,0,0.8); 
    display: none; 
}

#numpad-container.visible { 
    display: block; 
}

.numpad-display { 
    background: #000; 
    border: 1px solid #333; 
    color: var(--theme-color-pink); 
    font-size: 24px; 
    font-weight: bold; 
    text-align: center; 
    border-radius: 8px; 
    margin-bottom: 12px; 
    height: 45px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    letter-spacing: 2px; 
}

.numpad-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 8px; 
}

.num-btn { 
    background: rgba(255,255,255,0.1); 
    border: none; 
    color: white; 
    font-size: 18px; 
    font-weight: bold; 
    padding: 12px 0; 
    border-radius: 8px; 
    cursor: pointer; 
    transition: 0.2s; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
}

.num-btn:hover { 
    background: rgba(255,255,255,0.25); 
    color: var(--theme-color-pink); 
}

.num-btn.clear-btn { 
    background: rgba(255, 60, 60, 0.2); 
    color: #ff5555; 
}

.num-btn.ok-btn { 
    background: rgba(0, 230, 118, 0.2); 
    color: #00e676; 
}

/* OSD Indicator */
#osd-indicator { 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    background: rgba(0, 0, 0, 0.7); 
    color: white; 
    padding: 15px 25px; 
    border-radius: 12px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    pointer-events: none; 
    opacity: 0; 
    transition: opacity 0.2s ease; 
    z-index: 1010; 
    backdrop-filter: blur(5px); 
    -webkit-backdrop-filter: blur(5px); 
    border: 1px solid rgba(255,255,255,0.1); 
}

#osd-indicator.visible { 
    opacity: 1; 
}

#osd-icon { 
    color: #fff; 
    margin-bottom: 8px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

#osd-text { 
    font-size: 16px; 
    font-weight: bold; 
    margin-bottom: 10px; 
    color: #fff; 
}

.osd-bar { 
    width: 120px; 
    height: 5px; 
    background: rgba(255,255,255,0.2); 
    border-radius: 3px; 
    overflow: hidden; 
}

#osd-fill { 
    height: 100%; 
    background: var(--theme-color-pink); 
    width: 50%; 
    transition: width 0.1s ease-out; 
}

#channel-input-overlay { 
    display: none; 
    position: absolute; 
    top: 25px; 
    left: 50%; 
    transform: translateX(-50%); 
    background: rgba(0, 0, 0, 0.75); 
    color: #ffffff; 
    font-size: 3rem; 
    font-weight: bold; 
    padding: 10px 30px; 
    border-radius: 15px; 
    z-index: 1003; 
    pointer-events: none; 
    border: 1px solid rgba(255, 255, 255, 0.2); 
    backdrop-filter: blur(5px); 
    -webkit-backdrop-filter: blur(5px); 
}

/* Settings Menu */
.settings-menu-container { 
    position: absolute; 
    top: 65px; 
    right: 20px; 
    background-color: rgba(28, 28, 28, 0.95); 
    border-radius: 8px; 
    padding: 8px 0; 
    width: 280px; 
    z-index: 999; 
    display: none; 
    flex-direction: column; 
    backdrop-filter: blur(8px); 
    -webkit-backdrop-filter: blur(8px); 
    border: 1px solid rgba(255,255,255,0.1); 
    pointer-events: auto; 
}

.settings-menu-container.visible { 
    display: flex; 
}

.menu-item { 
    display: flex; 
    align-items: center; 
    padding: 12px 15px; 
    cursor: pointer; 
    color: #f1f1f1; 
    transition: background-color 0.2s; 
    font-size: 0.95rem; 
}

.menu-item.disabled { 
    color: #777; 
    cursor: not-allowed; 
}

.menu-item:not(.disabled):hover { 
    background-color: rgba(255, 255, 255, 0.1); 
}

.menu-item svg { 
    width: 22px; 
    height: 22px; 
    margin-right: 15px; 
    color: #e0e0e0; 
}

.menu-item .label { 
    flex-grow: 1; 
}

.menu-item .value { 
    color: #aaa; 
}

.menu-item.active .value, .menu-item.active .label { 
    color: var(--theme-color-pink); 
    font-weight: bold; 
}

.menu-item .arrow { 
    margin-left: auto; 
    color: #aaa; 
    transform: rotate(0deg); 
    transition: transform 0.2s; 
    font-size: 20px; 
    line-height: 1;
}

.menu-item.back-item .arrow { 
    transform: rotate(180deg); 
}

.menu-item.back-item { 
    font-weight: bold; 
    padding-bottom: 8px; 
    border-bottom: 1px solid rgba(255,255,255,0.1); 
    margin-bottom: 5px; 
}

#splash-logo { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    object-fit: contain; 
    pointer-events: none; 
    display: none; 
    z-index: 40; 
    opacity: 0; 
    transition: opacity 1.5s ease; 
    mix-blend-mode: screen; 
}

/* Sticky Ad Banner */
.sticky-ad-container { 
    position: fixed; 
    bottom: 0; 
    left: 50%; 
    transform: translateX(-50%); 
    width: 100%; 
    background: #0b0f19; 
    border-top: 1px solid #1f2937;
    z-index: 9990; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    padding: 5px 0 10px 0; 
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
}

#close-ad-btn { 
    position: absolute; 
    top: -15px; 
    right: 10px; 
    background: #1f2937; 
    color: #fff; 
    border: 1px solid #374151; 
    border-radius: 50%; 
    width: 28px; 
    height: 28px; 
    font-size: 14px; 
    font-weight: bold; 
    cursor: pointer; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

#close-ad-btn:hover { 
    background: var(--theme-color-pink); 
    border-color: var(--theme-color-pink); 
}

.ad-content { 
    width: 100%; 
    display: flex; 
    justify-content: center; 
    min-height: 50px; 
}

footer { 
    text-align: center; 
    padding: 20px 0; 
    margin-top: 30px; 
    background-color: #0d0d0d; 
    color: #cccccc; 
    font-size: 0.9rem; 
}

footer p { 
    margin: 0; 
}

/* ==========================================
   Responsive Logic for Mobile Layout
========================================== */
@media (max-width: 768px) {
    .top-header { 
        height: var(--header-height-mobile); 
        padding: 0 10px; 
    }
    
    .logo-container img { 
        max-height: 38px; 
    }
    
    .search-container { 
        display: none; 
        margin-left: 0; 
    }
    
    #search-toggle-btn { 
        display: flex; 
    }
    
    .top-header.search-active { 
        gap: 10px; 
        justify-content: center; 
    }
    
    .top-header.search-active .logo-container, 
    .top-header.search-active #menu-toggle-btn, 
    .top-header.search-active #search-toggle-btn, 
    .top-header.search-active #refresh-button, 
    .top-header.search-active .header-left-controls { 
        display: none; 
    }
    
    .top-header.search-active .search-container { 
        display: flex; 
        width: 100%; 
        max-width: none; 
        flex-grow: 0; 
        position: relative; 
    }
    
    .top-header.search-active .search-container input { 
        padding-right: 40px; 
    }
    
    .top-header.search-active #search-close-btn { 
        display: flex; 
        position: absolute; 
        right: 5px; 
        top: 50%; 
        transform: translateY(-50%); 
        z-index: 5; 
    }
    
    .top-header.search-active button.search-btn { 
        display: none; 
    }
    
    #menu-toggle-btn { 
        margin-right: 0; 
    }
    
    .marquee-container { 
        top: var(--header-height-mobile); 
    } 

    .channel-grid { 
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); 
        padding: 20px; 
        gap: 15px; 
    }
    
    .channel-logo-wrapper { 
        width: 80px; 
        height: 80px; 
    }
    
    /* 🔴 MOBILE PLAYER UI FIXED (2-ROWS) */
    #player-top-bar { 
        flex-wrap: wrap; 
        padding: 10px; 
    }
    
    .player-left { 
        max-width: 60%; 
    }
    
    .p-name-container { 
        max-width: 160px; 
    }
    
    #p-name { 
        font-size: 15px; 
    }
    
    #p-num { 
        font-size: 16px; 
    }
    
    .p-btn svg { 
        width: 22px; 
        height: 22px; 
    }
    
    .player-right { 
        gap: 10px; 
    }
    
    #p-logo { 
        width: 28px; 
        height: 28px; 
    }
    
    /* Move Server Wrapper to 2nd Line on Mobile */
    #p-servers-wrapper { 
        position: relative; 
        transform: none; 
        left: 0; 
        max-width: 100%; 
        flex-basis: 100%; 
        margin: 10px 0 0 0; 
        padding-bottom: 5px; 
        order: 3; 
        justify-content: flex-start;
    }
    
    .server-pill { 
        padding: 6px 14px; 
        font-size: 12px; 
    }

    .settings-menu-container { 
        top: 55px; 
        right: 10px; 
        width: 240px; 
    }
    
    #numpad-wrapper { 
        bottom: 20px; 
        right: 15px; 
        transform: scale(0.9); 
        transform-origin: bottom right; 
    }
}

@media (max-width: 576px) {
    .logo-container img { 
        width: 120px; 
    }
    .channel-grid { 
        grid-template-columns: repeat(auto-fill, minmax(95px, 1fr)); 
        padding: 15px; 
        gap: 15px; 
    }
    .channel-logo-wrapper { 
        width: 70px; 
        height: 70px; 
    }
    .channel-name { 
        font-size: 12px; 
    }
    #nav-drawer { 
        width: 260px; 
    }
}

@media (max-width: 320px) {
    :root { 
        var(--header-height-mobile): 45px; 
    }
    
    .top-header { 
        padding: 0 5px; 
    }
    
    .logo-container img { 
        max-height: 28px; 
        width: auto; 
    }
    
    .header-btn { 
        width: 30px; 
        height: 30px; 
    }
    
    .header-btn svg { 
        width: 18px; 
        height: 18px; 
    }
    
    #nav-drawer { 
        width: 100vw; 
    }
    
    .drawer-header { 
        padding: 10px 15px; 
    }
    
    .drawer-header .logo { 
        width: 90px; 
    }
    
    .drawer-menu li a { 
        padding: 10px 15px; 
        font-size: 13px; 
    }
    
    .channel-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 10px; 
        padding: 10px; 
    }
    
    .channel-card { 
        padding: 10px 5px; 
        border-radius: 12px; 
    }
    
    .channel-logo-wrapper { 
        width: 45px; 
        height: 45px; 
        margin-bottom: 8px; 
    }
    
    .channel-name { 
        font-size: 11px; 
        line-height: 1.2; 
    }
    
    .channel-card.active { 
        transform: scale(1.05); 
        box-shadow: 0 0 15px var(--theme-color-pink); 
        border-width: 3px; 
    }

    #player-top-bar { 
        padding: 5px; 
    }
    
    .p-name-container { 
        max-width: 80px; 
    }
    
    #p-logo { 
        width: 20px; 
        height: 20px; 
    }
    
    #p-name { 
        font-size: 12px; 
    }
    
    .p-btn { 
        padding: 4px; 
    }
    
    .p-btn svg { 
        width: 18px; 
        height: 18px; 
    }
    
    .server-pill { 
        padding: 3px 8px; 
        font-size: 10px; 
    }
    
    .settings-menu-container { 
        width: 90vw; 
        right: 5vw; 
        top: 40px; 
    }
    
    .menu-item { 
        padding: 8px 10px; 
        font-size: 12px; 
    }
    
    #custom-modal, .resume-content { 
        padding: 15px; 
        width: 90vw; 
    }
    
    #modal-title, #resume-channel-name { 
        font-size: 1rem; 
        margin-bottom: 10px; 
    }
    
    #modal-text, .resume-subtext { 
        font-size: 12px; 
        margin-bottom: 15px; 
    }
    
    #modal-ok-btn, #resume-play-btn, #modal-cancel-btn { 
        padding: 8px 15px; 
        font-size: 12px; 
    }
    
    #resume-channel-logo { 
        width: 50px; 
        height: 50px; 
        margin-bottom: 10px; 
    }
    
    #numpad-wrapper { 
        transform: scale(0.8); 
    }
    
    .sticky-ad-container { 
        transform: scale(0.75); 
        transform-origin: bottom center; 
        margin-bottom: -10px; 
    }
}