/* =========================================
   LIGHT THEME (style.css)
   ========================================= */
@font-face { font-family: 'OnAddFont1'; src: url('../fonts/Jost/Jost-VariableFont_wght.ttf') format('truetype'); font-weight: normal; }
@font-face { font-family: 'OnAddFont2'; src: url('../fonts/Cocogoose.ttf') format('truetype'); font-weight: normal; }
@font-face { font-family: 'OnAddFont3'; src: url('../fonts/Cocogoose.ttf') format('truetype'); font-weight: normal; }
@font-face { font-family: 'OnAddFont4'; src: url('../fonts/montserrat/Montserrat-VariableFont_wght.ttf') format('truetype'); }

:root {
    --bg-color: #f4f4f9;
    --surface: #ffffff;
    --surface-glass: rgba(255, 255, 255, 0.95);
    --surface-hover: #fbfbfb;
    --primary: #dc143c;
    --primary-dark: #b61827;
    --text-main: #333333;
    --text-muted: #666666;
    --border: rgba(0, 0, 0, 0.1);
    --radius: 16px;
    
    /* КРАСНОЕ СВЕЧЕНИЕ (GLOW) */
    --shadow-glow-fixed: 0 0 20px rgba(220, 20, 60, 0.25); 
    --shadow-hover: 0 0 30px rgba(220, 20, 60, 0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; outline: none; -webkit-user-select: none; -moz-user-select: none; user-select: none; }
input, textarea { -webkit-user-select: text; -moz-user-select: text; user-select: text; }
*:not(h1):not(.main-title-title):not(.srv-ping) { font-family: 'OnAddFont4', sans-serif; }
h1, h2, h3, h4, h5 { font-family: 'OnAddFont2', sans-serif; color: #111; }

html, body { height: 100%; width: 100%; }
body {
    background: url("../img/bcg.png") no-repeat center center fixed;
    background-size: cover;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex; flex-direction: column; overflow-x: hidden;
    padding-top: 4.5em !important; /* Отступ для фиксированного хедера */
}
main { flex: 1 1 auto; width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 20px; }
a { text-decoration: none; color: inherit; transition: 0.3s ease; }
img { user-select: none; pointer-events: none; }

header {
        position: fixed !important;
        top: 0;
        left: 0;
        width: 100%;
        height: 4.5em; /* Высота твоего меню */
        z-index: 2147483647 !important; /* Максимально возможный Z-Index */
}

/* HEADER */
#navbar { 
    display: flex; align-items: center; width: 100%;
    background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px); 
    border-bottom: 1px solid var(--border); position: sticky; top: 0; 
    padding: 0 20px; 
    position: static !important;
    width: 100% !important;
    z-index: auto !important;
}
#menuButton { height: 2.5em; cursor: pointer; transition: 0.2s; } #menuButton:hover { transform: scale(1.1); }
#logo { height: 3.5em; cursor: pointer; margin-left: 15px; }
#name { margin-left: 15px; cursor: pointer; text-transform: uppercase; font-size: 1.5em; font-weight: 700; color: #000; display: block; }
#tele { height: 2.5em; cursor: pointer; transition: 0.2s; } #tele:hover { transform: scale(1.1); }

/* NAVBAR POPUP */
/* NAVBAR POPUP */
#navbarOverlay { 
    display: none; 
    z-index: 2147483646 !important;
    position: fixed; inset: 0; 
    background-color: rgba(255,255,255,0.6); backdrop-filter: blur(5px); 
}
#navbarPopup { 
    display: none; 
    z-index: 2147483647 !important;
    background: #ffffff; width: 300px; height: 100%; 
    position: fixed; left: 0; top: 0; 
    box-shadow: 10px 0 40px rgba(0,0,0,0.1); border-right: 1px solid #eee; 
    padding-top: 20px; color: #000; 
}
#menuClose { margin-left: 20px; height: 2.5em; cursor: pointer; margin-bottom: 30px; }
.navbar-tab, .navbar-tab-open { display: block; margin: 10px 20px; padding: 12px 15px; font-size: 1.1em; color: #555; border-radius: 8px; border-left: 3px solid transparent; transition: 0.3s; }
.navbar-tab:hover { color: #000; background: rgba(0,0,0,0.05); padding-left: 25px; border-left-color: var(--primary); }
.navbar-tab-open { color: #000; font-weight: bold; border-left-color: var(--primary); background: rgba(220, 20, 60, 0.08); }
#navbarAd { position: absolute; bottom: 20px; left: 20px; right: 20px; display: flex; align-items: center; gap: 10px; padding: 15px; background: rgba(40, 160, 220, 0.1); border-radius: 8px; cursor: pointer; transition: 0.3s; border: 1px solid rgba(40, 160, 220, 0.3); }
#navbarAd:hover { background: rgba(40, 160, 220, 0.2); }
#nav-tele { height: 2em; } #nav-tele-text { font-size: 0.9em; margin: 0; color: #333; }

/* FOOTER */
.for-footer { margin-top: auto; width: 100%; }
.footer { width: 100%; padding: 40px 0; background: linear-gradient(to top, #900000, #b80000); border-top: 4px solid #dc143c; text-align: center; position: relative; }
.footer-icon { width: 50px; height: 50px; margin: 0 10px; transition: transform 0.3s, filter 0.3s; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.3)); vertical-align: middle; pointer-events: auto; }
.footer-icon:hover { transform: scale(1.15); filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5)); }
.wm { height: 50px; width: auto; margin-top: 20px; opacity: 0.9; }

/* HOME & GENERAL */
#video-showcase, #projectMain { margin-top: 40px; margin-bottom: 30px; text-align: center; }
.main-title-title { font-family: 'OnAddFont1', sans-serif; font-weight: 800; font-size: clamp(2.5em, 5vw, 4.5em); text-transform: uppercase; background: linear-gradient(135deg, #333 30%, #666 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 0.2em; }

/* ОПИСАНИЕ (С ОТСТУПОМ И СВЕЧЕНИЕМ) */
.main-desc { 
    display: inline-block; font-size: 1.1em; padding: 20px 30px !important; max-width: 800px; 
    color: #333 !important; background: rgba(255, 255, 255, 0.8) !important; 
    border: 1px solid rgba(220, 20, 60, 0.2) !important; 
    box-shadow: var(--shadow-glow-fixed) !important; 
    backdrop-filter: blur(10px); border-radius: var(--radius) !important; 
    line-height: 1.5; margin-bottom: 40px; 
}

/* CAROUSEL */
.carousel-wrapper { position: relative; z-index: 1; display: flex; align-items: center; overflow: hidden; margin: 30px auto; max-width: 1200px; background: rgba(255,255,255,0.7); border: 1px solid #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-glow-fixed); }
.carousel-track { display: flex; overflow-x: auto; scroll-behavior: smooth; width: 100%; scrollbar-width: none; } .carousel-track::-webkit-scrollbar { display: none; }
.carousel-page { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; min-width: 100%; padding: 5px; box-sizing: border-box; }
#playerCarousel .carousel-page { grid-template-columns: repeat(4, 1fr); }
.episode-prev { width: 100%; cursor: pointer; transition: transform 0.3s; position: relative; }
.episode-prev:hover { transform: scale(1.05); z-index: 10; }
.thumbnail-wrapper { position: relative; width: 100%; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; box-shadow: 0 5px 15px rgba(0,0,0,0.1); background: #eee; border: 1px solid #fff; transition: 0.3s; }
.episode-prev:hover .thumbnail-wrapper { border-color: var(--primary); box-shadow: var(--shadow-hover); }
.preview-image { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbnail-wrapper video.preview { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.4s; pointer-events: none; z-index: 2; }
.episode-prev:hover video.preview { opacity: 1; }
.caption { position: absolute; bottom: 0; left: 0; width: 100%; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); color: white; padding: 8px 5px; font-size: 13px; font-weight: 600; text-align: center; z-index: 5; }
.carousel-arrow { width: 45px; height: 45px; display: flex; justify-content: center; align-items: center; background: #fff; color: var(--primary); border: 1px solid #eee; font-size: 20px; cursor: pointer; z-index: 10; border-radius: 50%; transition: all 0.2s; margin: 0 10px; }
.carousel-arrow:hover { background: var(--primary); color: white; transform: scale(1.1); box-shadow: var(--shadow-hover); }

/* PLAYER & STATS */
#bigPlayerContainer { max-width: 1100px; margin: 0 auto; }

/* ПЛЕЕР (СВЕЧЕНИЕ) */
#playerWrapper { 
    border-radius: var(--radius); overflow: hidden; 
    box-shadow: var(--shadow-glow-fixed); 
    border: 1px solid rgba(220, 20, 60, 0.2); 
}

#player, #bigPlayer { width: 100%; height: 100%; }
.episode-stats-overlay { margin: 15px auto 0; display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; background: #fff; border: 1px solid #eee; border-radius: var(--radius); width: 100%; box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.views-mini { color: #555; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.views-mini svg { fill: #888; width: 20px; height: 20px; }
.reactions-mini { display: flex; gap: 10px; align-items: center; flex-direction: row; }
.reaction-btn-mini { background: #f9f9f9; border: 1px solid #ddd; color: #555; padding: 8px 15px; border-radius: 20px; cursor: pointer; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; transition: 0.3s; }
.reaction-btn-mini:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); background: #fff5f5; box-shadow: var(--shadow-hover); }
.reaction-btn-mini.active { background: var(--primary); border-color: var(--primary); color: white; box-shadow: var(--shadow-hover); }
.reaction-btn-mini svg { width: 16px; height: 16px; fill: currentColor; }

/* SCHEDULE (3 COLUMNS + GLOW) */
.schedule-container { 
    max-width: 1100px; margin: 40px auto; padding: 30px; 
    border-radius: var(--radius); background: #fff; 
    border: 1px solid rgba(220, 20, 60, 0.1); 
    box-shadow: var(--shadow-glow-fixed); 
    backdrop-filter: blur(5px); 
}
.schedule-title { text-align: center; margin-bottom: 30px; color: var(--primary); text-transform: uppercase; letter-spacing: 1px; font-weight: 800; font-family: 'OnAddFont1', sans-serif; }
.episodes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.episode-card { background: #fff; border: 1px solid #eee; border-radius: var(--radius); overflow: hidden; transition: 0.3s; display: flex; flex-direction: column; }
.episode-card:hover { transform: translateY(-5px); border-color: var(--border-active); box-shadow: var(--shadow-hover); }
.episode-thumbnail { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-bottom: 1px solid #eee; }
.episode-info { padding: 20px; text-align: center; }
.episode-info h4 { font-size: 0.9em; color: var(--primary); margin-bottom: 5px; }
.episode-info h3 { font-size: 1.2em; margin-bottom: 10px; color: #333; }
.stage-indicator { display: inline-block; padding: 5px 12px; border-radius: 12px; font-size: 0.75em; font-weight: 700; text-transform: uppercase; margin-bottom: 5px; }
.stage-серия-ещё-не-вышла { background: #eee; color: #999; } 
.stage-в-очереди { background: #fff9c4; color: #fbc02d; } 
.stage-перевод { background: #ffebee; color: #e53935; } 
.stage-дубляж { background: #fff3e0; color: #fb8c00; } 
.stage-фиксы { background: #e3f2fd; color: #1976d2; }
.stage-на-бусти, .stage-на-сайте { background: #e8f5e9; color: #2e7d32; }
.countdown { margin-top: 10px; font-size: 0.9em; font-family: monospace; color: var(--primary); border: 1px solid var(--primary-dark); padding: 6px 12px; border-radius: 6px; display: block; width: 100%; box-sizing: border-box; background: #fff5f5; }

/* PROJECTS DISPLAY */
#team-showcase { margin: 50px auto; text-align: center; max-width: 1200px; }
.poster { width: 90%; max-width: 300px; border-radius: var(--radius); transition: transform 0.3s, box-shadow 0.3s; border: 2px solid transparent; margin: 0 auto 20px; display: block; }
.poster:hover { transform: scale(1.05); border-color: var(--primary); box-shadow: var(--shadow-hover); }

/* SERVERS PAGE */
.page-header { text-align: center; margin-bottom: 40px; }
.page-header h1 { margin-bottom: 10px; font-size: 2.5em; }
.page-header p { margin-bottom: 20px; }
.server-card { background: #fff; border: 1px solid #eee; border-radius: var(--radius); padding: 20px; margin-bottom: 15px; display: flex; justify-content: space-between; align-items: center; transition: 0.3s; }
.server-card:hover { border-color: var(--text-muted); background: #fdfdfd; box-shadow: var(--shadow-hover); }
.server-card.active { border-color: var(--primary); background: #fff5f5; box-shadow: var(--shadow-glow-fixed); }
.server-actions { display: flex; align-items: center; gap: 20px; flex-direction: row; }
.server-ping { font-family: monospace; font-size: 16px; font-weight: bold; opacity: 0.8; margin-right: 10px; }
.btn-select { padding: 8px 20px; border-radius: 20px; border: 1px solid var(--primary); background: transparent; color: var(--primary); font-weight: 600; cursor: pointer; transition: 0.3s; }
.btn-select:hover { background: var(--primary); color: white; box-shadow: var(--shadow-hover); }
.btn-refresh { display: block; margin: 30px auto; padding: 15px 40px; font-size: 18px; border-radius: 40px; border: none; background: var(--primary); color: white; font-weight: 700; cursor: pointer; box-shadow: var(--shadow-glow-fixed); transition: 0.3s; }
.btn-refresh:hover { transform: scale(1.05); background: var(--primary-dark); }
.matrix-title { text-align: center; font-size: 2em; margin: 40px 0 20px; color: #333; font-weight: 700; font-family: 'OnAddFont1', sans-serif; }
.project-block { background: #fff; border: 1px solid #eee; border-radius: var(--radius); overflow: hidden; margin-bottom: 30px; }
.project-header { padding: 15px 20px; background: #f9f9f9; border-bottom: 1px solid #eee; font-weight: 700; color: var(--primary); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 20px; text-align: left; border-bottom: 1px solid #eee; color: #555; }
th { color: #333; text-transform: uppercase; font-size: 0.8em; background: #fdfdfd; }
.status-ok { color: #2e7d32; font-size: 1.2em; } .status-no { color: #ccc; font-size: 1.2em; }

/* LEGACY & MODALS */
#video-showcase2 img { border-radius: var(--radius); border: 1px solid #fff; box-shadow: 0 10px 30px rgba(0,0,0,0.1); margin-bottom: 20px; }
.mainPageVid { width: 100%; max-width: 1000px; }
.server-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 255, 255, 0.8); z-index: 10000; display: none; justify-content: center; align-items: center; backdrop-filter: blur(8px); }
.server-modal-overlay.active { display: flex; }
.server-modal { background: #fff; border: 1px solid #eee; border-radius: var(--radius); width: 90%; max-width: 500px; box-shadow: 0 0 50px rgba(220, 20, 60, 0.1); overflow: hidden; }
.modal-header { background: var(--primary); padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; color: white; }
.modal-list { padding: 10px; display: flex; flex-direction: column; gap: 5px; }
.srv-item { padding: 15px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: 0.2s; background: #f9f9f9; }
.srv-item:hover { background: #f0f0f0; border-color: #ddd; }
.srv-item.active { background: #fff5f5; border-color: var(--primary); }
.srv-name { font-weight: 600; color: #333; }
.ping-good { color: #2e7d32; } .ping-medium { color: #f57c00; } .ping-bad { color: #ff4d4d; }

/* DROPDOWN & BTNS */
.server-btn-container { text-align: center; margin: 20px 0; }
.server-trigger-btn { background: #fff; border: 2px solid var(--primary); color: var(--primary); padding: 10px 25px; border-radius: 30px; cursor: pointer; font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 10px; transition: all 0.3s ease; box-shadow: var(--shadow-glow-fixed); }
.server-trigger-btn:hover { background: var(--primary); color: white; box-shadow: var(--shadow-hover); transform: translateY(-2px); }

/* OTHER */
.cast { margin: 40px auto; max-width: 800px; padding: 2px; background: transparent; }
.cast-fill { background: rgba(255, 255, 255, 0.8); border: 1px solid rgba(220, 20, 60, 0.2); border-radius: var(--radius); padding: 20px; backdrop-filter: blur(5px); display: flex; align-items: center; gap: 20px; }
.cast h5 { color: var(--primary); font-size: 1.2em; font-weight: 700; margin: 0; white-space: nowrap; }
.person { color: #fff; margin: 0; font-size: 1.1em; }
.survey-panel { position: absolute; top: 50%; right: 20px; transform: translateY(-50%) scale(0.9); width: 300px; background: #fff; border: 1px solid #ddd; border-radius: var(--radius); box-shadow: 0 0 30px rgba(0,0,0,0.8); opacity: 0; pointer-events: none; transition: all 0.3s ease; z-index: 200; display: flex; flex-direction: column; }
.survey-panel.active { transform: translateY(-50%) scale(1); opacity: 1; pointer-events: all; }
.survey-header { padding: 15px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; }
.survey-body { padding: 20px; color: var(--text-muted); }
.star-rating .star { color: #444; font-size: 24px; cursor: pointer; } .star-rating .star.active { color: #ffc107; }
.fb-input, .fb-select { width: 100%; background: #fff; border: 1px solid #ccc; color: #333; padding: 10px; border-radius: 6px; margin-bottom: 10px; }
.fb-btn { width: 100%; background: var(--primary); color: white; border: none; padding: 10px; border-radius: 6px; cursor: pointer; font-weight: bold; }

/* CLIPPER FIXES */
.clipper-container { padding: 20px; }
.clipper-video-wrapper { width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 8px; overflow: hidden; margin-bottom: 20px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.clipper-video { width: 100%; height: 100%; display: block; }
/* Слайдер (Фикс: Круглые ручки и Красный цвет) */
.noUi-target {
    /* В style.css оставь #e0e0e0, в style_dark.css поставь #333 */
    background: var(--border); 
    border: none;
    border-radius: 4px;
    box-shadow: none;
    height: 6px;
    margin: 10px 5px 30px;
}

.noUi-connect { 
    background: #dc143c !important; /* Красная полоса */
}

.noUi-handle {
    background: #dc143c !important; /* Красный шар */
    border: 2px solid #fff;
    border-radius: 50% !important;  /* Круглый */
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    width: 18px !important;
    height: 18px !important;
    right: -9px !important;
    top: -7px !important;
    cursor: grab;
}

/* Убираем полоски внутри ручки */
.noUi-handle:before, .noUi-handle:after { 
    display: none !important; 
}
.clipper-controls { display: flex; justify-content: space-between; align-items: center; background: #f9f9f9; padding: 15px; border-radius: 8px; border: 1px solid #eee; margin-bottom: 20px; }
.time-group { display: flex; flex-direction: column; width: 30%; }
.time-group label { font-size: 11px; text-transform: uppercase; color: #888; margin-bottom: 5px; font-weight: 700; text-align: center; }
.time-input { background: #fff; border: 1px solid #ccc; color: #333; padding: 8px; border-radius: 6px; text-align: center; font-family: monospace; font-size: 14px; font-weight: bold; width: 100%; }
.time-input:focus { border-color: var(--primary); }
.clip-duration-display { text-align: center; font-weight: 800; color: var(--primary); font-size: 16px; }
.clip-info { text-align: center; color: #888; font-size: 12px; margin: 10px 0 20px; }
.clipper-step-1 { display: block; }
.clipper-step-2 { display: none; text-align: center; padding: 20px 0; }
.clip-success-icon { font-size: 40px; margin-bottom: 10px; display: block; }
.clip-success-text { color: #2e7d32; font-weight: 800; font-size: 20px; margin-bottom: 20px; }
.btn-download { display: block; width: 100%; text-align: center; text-decoration: none; background: #4caf50; color: white; font-weight: bold; padding: 12px; border-radius: 8px; margin-bottom: 10px; transition: 0.2s; }
.btn-copy { width: 100%; background: #eee; border: 1px solid #ddd; color: #333; padding: 10px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.btn-reset { background: none; border: none; color: #888; text-decoration: underline; margin-top: 15px; cursor: pointer; font-size: 13px; display: block; width: 100%; }
.btn-reset:hover { color: var(--primary); }

/* RESPONSIVE */
.mobile-episode-menu { display: none; }
@media (min-width: 769px) { .posters-mobile { display: none !important; } }
@media (max-width: 768px) {
    .lazy.slider { display: none !important; }
    .posters-mobile { display: flex; flex-direction: column; gap: 20px; align-items: center; }
    #name { display: none; }
    .main-title-title { font-size: 2em; }
    .carousel-page { grid-template-columns: 1fr !important; }
    .mobile-episode-menu { display: block; margin: 20px 0; }
    .mobile-menu-toggle { width: 100%; padding: 12px; background: #fff; color: #333; border: 1px solid #ccc; border-radius: 8px; font-size: 16px; font-weight: bold; }
    .mobile-episodes-grid { display: none; grid-template-columns: 1fr; gap: 8px; margin-top: 10px; }
    .mobile-episodes-grid.active { display: grid; }
    .mobile-episode-card { background: #f9f9f9; padding: 12px; border-radius: 6px; color: #333; text-align: center; cursor: pointer; border: 1px solid #eee; }
    .mobile-episode-card:hover { border-color: var(--primary); background: #fff5f5; }
    .survey-panel { position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: 100%; transform: translateY(100%); border-radius: 20px 20px 0 0; }
    .survey-panel.active { transform: translateY(0); }
    .server-card { flex-direction: column; align-items: flex-start; gap: 15px; }
    .server-actions { width: 100%; justify-content: space-between; }
    .cast-fill { flex-direction: column; text-align: center; gap: 10px; }
}

/* 🔥 FIX: Разрешаем клики по кнопкам-картинкам */
#menuButton, #menuClose, #logo, #tele, #nav-tele, .footer-icon, .poster {
    pointer-events: auto !important;
}
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f0f0f0; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }