
@font-face { font-family: 'DarckF'; src: url('fonts/dirs.otf') format('truetype'); }
@font-face { font-family: 'ClassicF'; src: url('fonts/slepy.ttf') format('truetype'); }
@font-face { font-family: 'EsteticF'; src: url('fonts/LazurskiBold.ttf') format('truetype'); }

html, body {
    margin: 0; padding: 0;
    width: 100%; height: 100vh;
    overflow: hidden;
}

/* Общие правила для парящих игровых элементов (Капсула, Уведомления, Кнопка-крестик) */
.read-progress-bar, .game-alert-toast, .close-reader-btn {
    background: rgba(15, 12, 18, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}


.nav-arrow-btn:hover, .close-reader-btn:hover, .archive-eye-btn:hover {
    color: white;
    filter: drop-shadow(0 0 8px #ff7b00);
}


.bg {
    position: fixed; top: 0; left: 0;
    width: 100vw; height: 100vh; z-index: -2;
    background-size: cover; background-position: center; background-repeat: no-repeat;
    filter: blur(12px) brightness(0.4); transform: scale(1.05);
}

.lines {
    position: fixed; top: 5px; left: 0;
    width: 100%; height: 20px; z-index: 10;
    background-image: repeating-linear-gradient(-45deg, black, black 10px, chocolate 10px, chocolate 20px);
    background-size: 56.57px 56.57px;
    animation: movelef 2s linear infinite;
}
@keyframes movelef { 0% { background-position: 0 0; } 100% { background-position: -56.57px 0; } }

.portal-interface {
    width: 100%; height: 100vh; box-sizing: border-box;
    padding-top: 40px; display: flex; flex-direction: column;
}

.title-navigation-row {
    display: flex; align-items: center; justify-content: space-between;
    max-width: 600px; width: 100%; margin-bottom: 15px;
}

.nav-arrow-btn {
    background: none; border: none; color: #ff7b00; font-size: 28px;
    cursor: pointer; padding: 10px; flex-shrink: 0;
    transition: transform 0.2s ease, color 0.2s ease;
}
.nav-arrow-btn:hover { transform: scale(1.2); }

#current-title-name { margin: 0; font-size: 32px; text-align: center; flex-grow: 1; }

.title-description-zone { max-width: 650px; margin-left: 8%; margin-bottom: 15px; color: white; font-family: 'ComicCustom', EsteticF; }
.title-description-zone h1 { margin: 0 0 10px 0; font-size: 32px; text-transform: uppercase; letter-spacing: 2px; }
.title-description-zone p { margin: 0; font-size: 15px; line-height: 1.5; color: #b0aab2; }

.lock-notice {
    color: #633851; font-family: ClassicF; font-size: 16px; font-weight: bold;
    text-transform: uppercase; letter-spacing: 1px; padding: 30px;
    background: rgba(0, 0, 0, 0.5); border: 1px dashed rgba(255, 59, 48, 0.4);
    border-radius: 12px; text-align: center; max-width: 600px; box-sizing: border-box;
}

.chapters-list {
    display: flex; flex-direction: column; gap: 20px;
    height: calc(100vh - 180px); max-height: calc(100vh - 180px); overflow-y: auto;        
    max-width: 650px; margin-left: 8%; padding-bottom: 40px;
    scrollbar-width: none; position: relative; z-index: 1; 
    mask-image: linear-gradient(to bottom, transparent 0%, black 5%, black 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 5%, black 90%, transparent 100%);
}
.chapters-list::-webkit-scrollbar { display: none; }

.comic-widget {
    display: flex; align-items: center; height: 150px; width: 100%; padding: 12px;
    box-sizing: border-box; border-radius: 12px; filter: brightness(0.6) saturate(0.5);
    background-size: cover; background-position: center; flex-shrink: 0; position: relative; overflow: hidden;    
    transition: all 0.4s ease;
}
.comic-widget:hover { filter: brightness(1) saturate(1); box-shadow: 0 8px 25px rgba(0,0,0,0.5); }
.comic-widget > img { width: 111px; height: 100%; object-fit: cover; border-radius: 8px; flex-shrink: 0; }

.widget-info { display: flex; flex-direction: column; gap: 6px; margin-left: 15px; flex-shrink: 0; font-family: 'ComicCustom', sans-serif; color: white; }
.comic-title { margin: 0; font-size: 20px; }
.chapter-number { color: #ff7b00; font-size: 15px; font-weight: bold; }

.chapter-preview { display: flex; align-items: center; justify-content: flex-end; flex-grow: 1; height: 100%; margin-left: 15px; padding-right: 5px; opacity: 0; visibility: hidden; transition: all 0.4s ease; }
.chapter-preview img { height: 85%; width: auto; object-fit: cover; border-radius: 4px; box-shadow: 10px 0 20px rgba(20, 21, 27, 0.68); margin-left: -35px; position: relative; }
.comic-widget:hover .chapter-preview { opacity: 1; visibility: visible; }

/* ==========================================================================
   ОКНО ЧТЕНИЯ И ИНДИКАТОРЫ
   ========================================================================== */
.reader-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background: rgba(10, 10, 10, 0.96); overflow-y: auto; z-index: 8;          
    opacity: 0; visibility: hidden; transition: opacity 0.4s ease, visibility 0.4s ease;      
}
.reader-overlay.active { opacity: 1; visibility: visible; }

.reader-pages {
    display: flex; flex-direction: column; align-items: center; gap: 15px;           
    padding-top: 40px; padding-bottom: 100vh; 
}
.manga-page { max-width: 800px; width: 100%; height: auto; display: block; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7); }

/* Парящая капсула прогресса */
.read-progress-bar {
    position: fixed; bottom: 25px; left: 50%;
    transform: translateX(-50%); width: 280px; height: 8px;
    border-radius: 20px; z-index: 99; overflow: hidden;
}
.read-progress-fill {
    width: 0%; height: 100%; background: #ff7b00; border-radius: 20px;
    box-shadow: 0 0 10px #ff7b00, 0 0 20px rgba(255, 123, 0, 0.8);
    transition: width 0.1s linear;
}

/* Кнопка закрытия читалки (слева) */
.close-reader-btn {
    position: fixed; top: 35px; left: 25px;
    width: 40px; height: 40px; border-radius: 50%;
    color: #888; font-size: 24px; line-height: 36px; text-align: center;
    cursor: pointer; z-index: 101; transition: all 0.3s ease;
}
.close-reader-btn:hover {
    border-color: #ff7b00;
    background: rgba(255, 123, 0, 0.15);
    transform: scale(1.1);
}


.archive-indicator { position: absolute; top: 2px; right: 2px; width: 12px; height: 12px; background: #ff3b30; border-radius: 50%; box-shadow: 0 0 8px #ff3b30; display: none; }

.archive-sidebar {
    position: fixed;
    top: 0; 
    right: -350px; width: 320px; height: 100vh;
    background: rgba(15, 12, 18, 0.98); border-left: 2px solid rgba(255, 123, 0, 0.3); box-shadow: -10px 0 30px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px); 
    z-index: 100; padding: 30px 20px; 
    box-sizing: border-box;
    display: flex; flex-direction: column; transition: right 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.archive-sidebar.open { right: 0; }

.close-archive-btn {
    align-self: flex-end; 
    background: none; 
    border: none; 
    color: #888; 
    font-size: 14px; 
    cursor: pointer; 
    margin-bottom: 20px;
    position: relative; /* Добавляем позиционирование */
    z-index: 110;       
     pointer-events: auto !important;
    transition: color 0.2s ease;

}
.close-archive-btn:hover { color: white; }

.archive-sidebar-title { color: #ff7b00; margin: 0 0 25px 0; font-size: 22px; letter-spacing: 1px; text-shadow: 0 0 10px rgba(255, 123, 0, 0.3); font-family: sans-serif; }

.archive-eye-btn { position: fixed; top: 50vh; right: 3%; background: none; border: none; width: 60px; height: 60px; cursor: pointer; z-index: 5; display: flex; justify-content: center; align-items: center; filter: drop-shadow(0 0 8px rgba(255, 123, 0, 0.5)); transition: filter 0.3s ease; }
.eye-graphic { width: 90%; height: 90%; object-fit: contain; transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1); }
.archive-eye-btn:hover .eye-graphic { transform: rotate(180deg) scale(1.1); filter: brightness(1.2); }

/* Сетка документов и карточки досье */
.documents-grid {
    display: flex; flex-direction: column; gap: 15px;
    max-height: 75vh; overflow-y: auto; padding-right: 5px;
    scrollbar-width: none;
}
.documents-grid::-webkit-scrollbar { display: none; }

.doc-item { padding: 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 6px; font-size: 13px; color: #b0aab2; transition: all 0.3s ease; }
.doc-item.locked { border-color: rgba(255, 255, 255, 0.05); color: #555; }
.doc-item.unlocked { border-color: #ff7b00; color: white; background: rgba(255, 123, 0, 0.05); }

.doc-card-layout { display: flex; align-items: flex-start; gap: 12px; width: 100%; }

.doc-avatar { width: 55px; height: 55px; border-radius: 8px; object-fit: cover; border: 1px solid rgba(255, 123, 0, 0.4); flex-shrink: 0; box-shadow: 0 0 8px rgba(255, 123, 0, 0.1); }
.doc-avatar.silhouette { background: rgba(0, 0, 0, 0.5); border-color: #333; display: flex; justify-content: center; align-items: center; color: #ff3b30; font-size: 18px; }

.doc-text-block { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.doc-type-tag { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: #b81d6d; font-weight: bold; }
.doc-name { margin: 2px 0 4px 0; font-size: 15px; color: white; }
.doc-details { 
    margin: 0;
    font-size: 12px;
    line-height: 1.4; color: #a09aa3; }

/* ==========================================ИГРОВЫЕ УВЕДОМЛЕНИЯ (TOAST)========================================== */
.game-alert-toast {
    position: fixed; 
    bottom: 25px; 
    right: -350px; 
    z-index: 1000;
    border-radius: 8px; 
    padding: 14px 20px;
    box-shadow: 0 0 15px rgba(255, 123, 0, 0.3), inset 0 0 10px rgba(255, 123, 0, 0.1);
    border: 1px solid #ff7b00;
    transition: right 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.game-alert-toast.show { right: 25px; }
.game-alert-content { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    font-family: sans-serif; 
    color: #e2dbe5; 
    font-size: 14px; 
    letter-spacing: 0.5px; 
}
.game-alert-icon { 
    font-size: 18px; 
    filter: drop-shadow(0 0 5px #ff7b00); 
}

/* Контейнер для вкладок на всю ширину меню */
.archive-tabs-nav {
    display: flex;
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 123, 0, 0.15);
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
    padding: 3px;
    box-sizing: border-box;
}

/* Стильные кнопки переключения */
.archive-tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: #666;
    font-size: 14px;
    font-family: sans-serif;
    font-weight: bold;
    padding: 10px 0;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

/* Активная вкладка с мягким неоновым свечением */
.archive-tab-btn.active {
    background: rgba(255, 123, 0, 0.12); /* Прозрачный оранжевый фон */
    color: #ff7b00; /* Яркий рыжий текст */
    border: 1px solid rgba(255, 123, 0, 0.3);
    text-shadow: 0 0 8px rgba(255, 123, 0, 0.5);
    box-shadow: inset 0 0 10px rgba(255, 123, 0, 0.05);
}

/* Отметка о прочитанности главы */
.read-mark {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 0 6px rgba(255, 123, 0, 0.6));
    animation: markAppear 0.4s ease-out;
    pointer-events: none;
}

@keyframes markAppear {
    from {
        opacity: 0;
        transform: scale(0.5) rotate(-15deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Убедимся, что widget-info позиционируется относительно */
.widget-info {
    position: relative;
}

/* Блок счетчика печатей в архиве */
.stamps-counter-block {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 123, 0, 0.1);
    border: 1px solid rgba(255, 123, 0, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.stamps-counter-block:hover {
    background: rgba(255, 123, 0, 0.15);
    box-shadow: 0 0 15px rgba(255, 123, 0, 0.2);
}

.stamp-icon {
    font-size: 24px;
    filter: drop-shadow(0 0 6px #ff7b00);
}

.stamp-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stamp-label {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stamp-count {
    font-size: 18px;
    font-weight: bold;
    color: #ff7b00;
    text-shadow: 0 0 8px rgba(255, 123, 0, 0.4);
}

/* Печать на карточке главы — исправленная */
.chapter-stamp {
    position: absolute;
    top: 50%;
    right: 35%;
    width: 50px;
    height: 50px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
    opacity: 0.8;
    filter: drop-shadow(0 0 8px currentColor);
    z-index: 5;
    /* ✅ Анимация stampAppear удалена, штамп больше не прыгает */
}

/* Переключатель */
.view-switcher {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}
.switch-btn {
    background: transparent;
    border: 1px solid #555;
    color: #aaa;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 14px;
}
.switch-btn:hover {
    border-color: #ff7b00;
    color: #fff;
}
.switch-btn.active {
    background: #ff7b00;
    color: #fff;
    border-color: #ff7b00;
}

/* Панели с анимацией "отодвигания" */
.view-panel {
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.view-panel.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
}
.view-panel.hidden {
    display: none;
    opacity: 0;
    transform: translateX(-20px); /* Уезжает влево при скрытии */
}


/* Переключатель - по центру, менее явный */
.view-switcher {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.view-switcher:hover {
    opacity: 1;
}

.switch-btn {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.6);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 13px;
    backdrop-filter: blur(4px);
}

.switch-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 123, 0, 0.4);
}

.switch-btn.active {
    background: rgba(255, 123, 0, 0.7);
    color: #fff;
    border-color: #ff7b00;
    box-shadow: 0 0 12px rgba(255, 123, 0, 0.4);
}

/* ==========================================================================
   ЛОГИКА В КЛАДОК И ПЕРЕКЛЮЧЕНИЯ (ЖЕСТКОЕ СКРЫТИЕ)
   ========================================================================== */
.hidden {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Общий класс для списков, чтобы они не накладывались */
.chapters-list, #videosContainer {
    height: calc(100vh - 240px); /* Четко ограничиваем высоту */
    max-height: calc(100vh - 240px);
    overflow-y: auto;        
    max-width: 650px; 
    margin-left: 8%; 
    padding-bottom: 40px;
    scrollbar-width: none; 
    position: relative;
    box-sizing: border-box;
}
.chapters-list::-webkit-scrollbar, #videosContainer::-webkit-scrollbar { 
    display: none; 
}

/* Переключатель вкладок */
.view-switcher {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    margin-left: 8%; /* Выравниваем по левому краю, как и списки */
    opacity: 0.8;
    transition: opacity 0.3s;
}
.view-switcher:hover { opacity: 1; }

.switch-btn {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.6);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}
.switch-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 123, 0, 0.4);
}
.switch-btn.active {
    background: rgba(255, 123, 0, 0.7);
    color: #fff;
    border-color: #ff7b00;
    box-shadow: 0 0 12px rgba(255, 123, 0, 0.4);
}

/* ==========================================================================
   КОМПАКТНЫЕ ФИКСИРОВАННЫЕ ВИДЖЕТЫ ВИДЕО
   ========================================================================== */
.video-widget {
    background: rgba(15, 12, 18, 0.6);
    border-radius: 12px;
    padding: 14px;
    border: 1px solid rgba(255, 123, 0, 0.15);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    margin-bottom: 20px; /* Отступ между роликами */
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.video-title {
    font-size: 15px;
    font-weight: bold;
    color: #ffaa00;
    font-family: sans-serif;
    text-shadow: 0 0 8px rgba(255, 170, 0, 0.3);
}

/* Фиксированный размер контейнера плеера */
.video-embed-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9; /* Фиксирует пропорции экрана 16:9 автоматически */
    max-width: 560px;     /* Идеальный стандартный размер */
    overflow: hidden;
    border-radius: 8px;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Сам фрейм плеера */
.video-embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    z-index: 10; /* Поднимаем фрейм выше фона */
    pointer-events: auto !important; /* Разрешаем все клики */
}
