@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
    /* Официальные цвета РГПУ им. А. И. Герцена по брендбуку в современном премиальном прочтении */
    --cobalt: #003087;        /* Pantone 287 C (Основной кобальт) */
    --cobalt-dark: #010714;   /* Космический кобальт (очень глубокий благородный синий) */
    --cobalt-light: #0055ff;  /* Яркий акцентный кобальт (для современного свечения) */
    --gold: #dfba73;          /* Pantone 8643 C в прочтении жидкого шампань-золота */
    --gold-light: #f7e7c4;    /* Светлое платиновое золото */
    --gold-dark: #b58c3d;     /* Богатое темное золото */
    --bg-dark: #020813;       /* Ультратемный фон сцены */
    
    /* Элементы Glassmorphism на базе Pantone 287 C */
    --card-bg: rgba(1, 10, 31, 0.75);
    --card-border: rgba(223, 186, 115, 0.25);
    --text-light: #f7e7c4;
    --text-muted: #8a9fc4;
    
    --font-header: 'Playfair Display', serif;
    --font-ui: 'Manrope', sans-serif;
}

html, body {
    margin: 0; 
    padding: 0; 
    height: 100%; 
    overflow: hidden; 
    font-family: var(--font-ui); 
    box-sizing: border-box;
    background-color: var(--bg-dark);
}

.scene {
    width: 100%; 
    height: 100vh;
    background: radial-gradient(circle at center, #002261 0%, #000817 100%);
    display: flex; 
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Декоративное кобальтово-золотое интерактивное свечение на заднем плане с добавлением фиолетового спектра */
.ambient-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vw;
    height: 80vh;
    background: radial-gradient(circle, rgba(0, 85, 255, 0.15) 0%, rgba(223, 186, 115, 0.02) 40%, rgba(138, 43, 226, 0.05) 70%, transparent 100%);
    z-index: 0;
    pointer-events: none;
    filter: blur(60px);
}

/* Тончайшая золотая нить прогресса чтения (обёртка + заполнитель) */
.reading-progress-wrapper {
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 101;
    cursor: crosshair;
}
.reading-progress-wrapper::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    width: 100%;
    height: 23px;
}
.reading-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--gold-dark) 0%, var(--gold) 50%, var(--gold-light) 100%);
    box-shadow: 0 1px 8px rgba(223, 186, 115, 0.5);
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.scroll-wrapper {
    flex-grow: 1; 
    width: 100%; 
    overflow: hidden; 
    display: flex;
    perspective: 2000px;
    z-index: 1;
}

/* Элегантный премиальный скроллбар под цвет бренда */
.scroll-wrapper::-webkit-scrollbar { 
    width: 10px; 
    height: 10px; 
}
.scroll-wrapper::-webkit-scrollbar-track { 
    background: rgba(0, 10, 28, 0.5); 
    backdrop-filter: blur(10px);
}
.scroll-wrapper::-webkit-scrollbar-thumb { 
    background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dark) 100%); 
    border-radius: 6px; 
    border: 2px solid var(--bg-dark);
}
.scroll-wrapper::-webkit-scrollbar-thumb:hover { 
    background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 100%); 
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
}

/* Экран загрузки РГПУ им. А. И. Герцена */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    visibility: visible;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loading-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.spinner-box {
    position: relative;
    width: 150px;
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
}

.circle-loader {
    width: 130px;
    height: 130px;
    border: 3px solid rgba(212, 175, 55, 0.08);
    border-top: 3px solid var(--gold);
    border-radius: 50%;
    animation: spin 1.4s cubic-bezier(0.68, -0.4, 0.27, 1.4) infinite;
    position: absolute;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.15);
}

.spinner-logo {
    color: var(--gold);
    position: absolute;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.35));
    display: flex;
    justify-content: center;
    align-items: center;
}

.percent-box {
    position: absolute;
    bottom: -35px;
    font-family: var(--font-ui);
    font-size: 1.15rem;
    color: var(--text-light);
    font-weight: 700;
    letter-spacing: 1px;
}

.loading-title {
    font-family: var(--font-header);
    font-size: 1.65rem;
    letter-spacing: 4px;
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    margin-top: 20px;
    text-shadow: 0 2px 15px rgba(0, 48, 135, 0.4);
}

.loading-subtitle {
    margin-top: 12px;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    text-align: center;
    font-weight: 300;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse-gold {
    0%, 100% { opacity: 0.8; transform: scale(0.96); }
    50% { opacity: 1; transform: scale(1.04); }
}

/* Шапка и подвал в корпоративном стиле РГПУ с эффектом Glassmorphism */
.book-header, .book-controls {
    width: 100%; 
    background: var(--card-bg); 
    backdrop-filter: blur(25px); 
    -webkit-backdrop-filter: blur(25px);
    display: flex; 
    align-items: center; 
    color: var(--text-light); 
    z-index: 100; 
    box-shadow: 0 8px 32px rgba(0, 10, 28, 0.6); 
    flex-shrink: 0; 
    border: 1px solid var(--card-border);
    box-sizing: border-box;
}

.book-header { 
    height: 80px; /* Слегка увеличим для герба и надзаголовка */
    justify-content: space-between; 
    border-left: none;
    border-right: none;
    border-top: none;
    padding: 0 40px;
}

.header-logo-left {
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.25));
    transition: all 0.3s ease;
    cursor: pointer;
    width: 40px;
    height: 40px;
}

.header-logo-left:hover {
    filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.6));
    transform: scale(1.08);
}

.header-title-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.uni-name {
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--gold-light);
    opacity: 0.85;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.book-header h1 { 
    font-family: var(--font-header);
    font-size: 1.45rem; 
    margin: 0; 
    font-weight: 600; 
    letter-spacing: 1.5px;
    text-align: center;
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 12px rgba(212, 175, 55, 0.2);
}

.header-logo-right-placeholder {
    width: 40px; /* Баланс для левого логотипа */
}

.header-decor-left, .header-decor-right {
    height: 1px;
    flex-grow: 1;
    max-width: 120px;
    background: linear-gradient(to right, transparent, var(--gold));
    margin: 0 20px;
    opacity: 0.5;
}

.header-decor-right {
    background: linear-gradient(to left, transparent, var(--gold));
}

.book-controls { 
    height: 80px;
    justify-content: space-between; 
    padding: 0 40px; 
    border-left: none;
    border-right: none;
    border-bottom: none;
}

.nav-controls { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    flex-wrap: nowrap; 
    gap: 20px; 
}

.zoom-controls { 
    display: flex; 
    align-items: center; 
    flex-wrap: nowrap; 
    gap: 12px; 
    flex: 1;
    min-width: 0;
}

.extra-controls { 
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px; 
    flex: 1;
    min-width: 0;
}

/* Современные pill-кнопки с золотыми и синими тонами бренда с эффектом матового стекла */
.ctrl-btn {
    background: rgba(255, 255, 255, 0.03); 
    border: 1px solid var(--card-border); 
    color: var(--text-light);
    padding: 10px 20px; 
    cursor: pointer; 
    font-family: var(--font-ui); 
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 14px; 
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); 
    white-space: nowrap; 
    outline: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 10, 28, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ctrl-btn svg {
    transition: transform 0.3s ease;
}

.ctrl-btn:hover { 
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.18) 0%, rgba(0, 48, 135, 0.25) 100%); 
    border-color: var(--gold);
    color: #ffffff; 
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
    transform: translateY(-2px);
}

.ctrl-btn:hover svg {
    transform: scale(1.1);
}

.ctrl-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.2);
}

.ctrl-btn.active { 
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%); 
    color: var(--cobalt-dark); 
    border-color: var(--gold-light);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.6); 
    font-weight: 700;
}

.ctrl-btn.active svg {
    stroke: var(--cobalt-dark);
}

/* Специфичные стили для интерактивной иконки звука */
.volume-mute-cross {
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: center;
}

.ctrl-btn.active .volume-mute-cross {
    opacity: 0;
    transform: scale(0.3) rotate(45deg);
}

/* Счётчик страниц */
.page-counter { 
    font-family: var(--font-ui);
    font-size: 0.95rem; 
    font-weight: 600;
    text-align: center; 
    white-space: nowrap; 
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.02);
    padding: 6px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.page-counter .divider {
    color: var(--text-muted);
    font-weight: 300;
}

#page-total {
    color: var(--text-light);
    text-shadow: 0 0 8px rgba(243, 229, 171, 0.3);
}

#page-input {
    background: rgba(255, 255, 255, 0.03); 
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #ffffff; 
    font-size: 0.95rem; 
    font-family: var(--font-ui); 
    text-align: center; 
    width: 48px; 
    height: 32px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-weight: 700;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

#page-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 12px rgba(223, 186, 115, 0.4), inset 0 1px 3px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.07);
    width: 58px; /* Изящное микро-расширение */
}

#page-input::-webkit-outer-spin-button, #page-input::-webkit-inner-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}

/* 3D-книга и сцена */
.book-perspective {
    position: relative; 
    display: flex; 
    justify-content: center; 
    align-items: center;
    transform-style: preserve-3d; 
    margin: auto; 
    transition: width 0.3s ease, height 0.3s ease; 
}

.page { 
    background-color: #fdfaf2; 
    overflow: hidden; 
    transform: translateZ(0); 
    box-shadow: 0 12px 38px rgba(0, 8, 28, 0.7);
}

.page-content { 
    position: relative; 
    width: 100%; 
    height: 100%; 
}

/* Внутреннее затенение переплета для 3D реализма */
.page.hard { 
    box-shadow: inset 0 0 40px rgba(0,0,0,0.45), 0 12px 38px rgba(0, 8, 28, 0.7); 
}

.page:not(.hard)::before {
    content: ''; 
    position: absolute; 
    left: 0; 
    top: 0; 
    width: 45px; 
    height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0) 100%); 
    z-index: 5;
}

/* 3D-тень парения на полу */
.book-shadow-floor {
    position: absolute; 
    bottom: -60px; 
    width: 96%; 
    height: 45px;
    background: radial-gradient(ellipse at center, rgba(0, 5, 15, 0.8) 0%, rgba(0, 5, 15, 0) 80%); 
    filter: blur(18px); 
    border-radius: 50%; 
    z-index: -1; 
    transform: rotateX(85deg);
    pointer-events: none;
    transition: all 0.3s ease;
}

.protected-img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    user-select: none; 
    -webkit-user-drag: none; 
    pointer-events: none; 
}

.anti-copy-overlay { 
    position: absolute; 
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0; 
    z-index: 10; 
    background: transparent; 
}

/* =======================================================================
   ПРЕМИУМ МОДАЛЬНОЕ ОКНО СОДЕРЖАНИЯ (GLASSMORPHISM & BRAND COLORS)
   ======================================================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 10, 28, 0.65);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), backdrop-filter 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: 0 24px 64px rgba(0, 5, 15, 0.8), 
                inset 0 0 20px rgba(212, 175, 55, 0.05);
    width: 90%;
    max-width: 650px;
    border-radius: 20px;
    padding: 35px;
    position: relative;
    transform: scale(0.92) translateY(20px);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close-btn {
    position: absolute;
    top: 25px;
    right: 25px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-close-btn:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(0, 48, 135, 0.3) 100%);
    border-color: var(--gold);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
    transform: rotate(90deg) scale(1.05);
}

.modal-close-btn:active {
    transform: rotate(90deg) scale(0.95);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.modal-logo {
    color: var(--gold);
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.35));
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-title-group {
    display: flex;
    flex-direction: column;
}

.modal-subtitle {
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gold-light);
    opacity: 0.75;
}

.modal-title {
    font-family: var(--font-header);
    font-size: 1.8rem;
    margin: 0;
    font-weight: 600;
    letter-spacing: 1px;
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--gold) 20%, var(--gold) 80%, transparent);
    opacity: 0.3;
    margin: 0 0 25px 0;
}

.toc-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

/* Кастомизация скроллбара списка содержания */
.toc-list::-webkit-scrollbar {
    width: 6px;
}

.toc-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}

.toc-list::-webkit-scrollbar-thumb {
    background: var(--gold-dark);
    border-radius: 3px;
    opacity: 0.5;
}

.toc-list::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

.toc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    margin-bottom: 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    
    /* Начальное состояние для каскадной анимации появления */
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), 
                background 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toc-item.animate {
    opacity: 1;
    transform: translateY(0);
}

.toc-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gold);
    transform: scaleY(0);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: bottom;
}

.toc-item:hover {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.08) 0%, rgba(0, 48, 135, 0.12) 100%);
    border-color: rgba(212, 175, 55, 0.25);
    box-shadow: 0 4px 15px rgba(0, 5, 15, 0.3);
    transform: translateX(5px);
}

.toc-item:hover::before {
    transform: scaleY(1);
}

.toc-title {
    font-family: var(--font-ui);
    font-size: 0.95rem;
    color: #ffffff;
    font-weight: 500;
    transition: color 0.3s ease;
    flex-shrink: 0;
    max-width: 75%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toc-item:hover .toc-title {
    color: var(--text-light);
}

.toc-dots {
    flex-grow: 1;
    border-bottom: 1px dotted rgba(212, 175, 55, 0.25);
    margin: 0 15px;
    transform: translateY(-2px);
    transition: border-bottom-color 0.3s ease;
}

.toc-item:hover .toc-dots {
    border-bottom-color: rgba(212, 175, 55, 0.6);
}

.toc-page {
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gold-light);
    white-space: nowrap;
    transition: color 0.3s ease;
}

.toc-item:hover .toc-page {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
}

/* ====================================================================
   ИНДИКАТОР ТЕКУЩЕЙ ГЛАВЫ
   ==================================================================== */
.current-chapter {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 1.8px;
    color: var(--gold);
    text-transform: uppercase;
    text-align: center;
    opacity: 0.8;
    margin-top: 2px;
    min-height: 13px;
    max-width: 360px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.18s ease, transform 0.18s ease, color 0.3s ease;
}

/* ====================================================================
   ТУЛТИП ПРОГРЕСС-БАРА
   ==================================================================== */
.progress-tooltip {
    position: fixed;
    top: 88px;
    left: 0;
    background: var(--card-bg);
    border: 1px solid rgba(212, 175, 55, 0.35);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text-light);
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 5px 14px;
    border-radius: 8px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    box-shadow: 0 4px 20px rgba(0, 5, 15, 0.45), 0 0 10px rgba(212, 175, 55, 0.1);
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 5000;
}

/* ====================================================================
   КОМПАКТНАЯ ИКОНОЧНАЯ КНОПКА (без текста)
   ==================================================================== */
.ctrl-btn-icon {
    padding: 10px 11px !important;
}
.ctrl-btn-icon span { display: none; }

/* ====================================================================
   СВЕТЛАЯ ТЕМА
   ==================================================================== */

/* Плавные переходы темы на ключевых элементах */
.scene,
.book-header,
.book-controls,
.loading-overlay,
.ambient-glow,
.ctrl-btn,
.modal-overlay,
.modal-content,
.toc-item,
.page-counter,
.current-chapter,
.progress-tooltip {
    transition-property: background, background-color, border-color, color, box-shadow;
    transition-duration: 0.45s;
    transition-timing-function: ease;
}

html[data-theme="light"] {
    --bg-dark: #dcd5c9;
    --card-bg: rgba(248, 244, 236, 0.94);
    --card-border: rgba(0, 48, 135, 0.18);
    --text-light: #0a1628;
    --text-muted: #2c3e6b;
}

html[data-theme="light"] .scene {
    background: radial-gradient(circle at 35% 45%, #c2d4eb 0%, #d8d0c4 100%);
}

html[data-theme="light"] .ambient-glow {
    background: radial-gradient(circle, rgba(0, 85, 210, 0.07) 0%, rgba(210, 175, 55, 0.03) 40%, transparent 100%);
    opacity: 0.8;
}

html[data-theme="light"] .loading-overlay {
    background: #d8d0c4;
}

html[data-theme="light"] .loading-title {
    text-shadow: 0 2px 15px rgba(0, 48, 135, 0.12);
}

html[data-theme="light"] .book-header,
html[data-theme="light"] .book-controls {
    background: rgba(240, 236, 228, 0.92);
    border-color: rgba(0, 48, 135, 0.14);
}

html[data-theme="light"] .ctrl-btn {
    background: rgba(0, 48, 135, 0.04);
    border-color: rgba(0, 48, 135, 0.14);
    color: #0a1628;
}

html[data-theme="light"] .ctrl-btn:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.18) 0%, rgba(0, 48, 135, 0.12) 100%);
    border-color: rgba(212, 175, 55, 0.4);
    color: #000;
}

html[data-theme="light"] .ctrl-btn.active {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.28) 0%, rgba(0, 48, 135, 0.18) 100%);
    border-color: rgba(212, 175, 55, 0.55);
    color: #0a1628;
}

html[data-theme="light"] .modal-overlay {
    background: rgba(190, 205, 225, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

html[data-theme="light"] .modal-content {
    background: rgba(248, 244, 236, 0.97);
    border-color: rgba(0, 48, 135, 0.18);
    box-shadow: 0 30px 80px rgba(0, 8, 28, 0.2), 0 0 0 1px rgba(212, 175, 55, 0.15);
}

html[data-theme="light"] .modal-subtitle {
    color: #2c3e6b;
}

html[data-theme="light"] .uni-name {
    color: var(--cobalt);
    opacity: 1;
}

html[data-theme="light"] .modal-title {
    color: #0a1628;
    text-shadow: none;
}

html[data-theme="light"] h1 {
    background: none;
    -webkit-text-fill-color: var(--cobalt);
    color: var(--cobalt);
    text-shadow: none;
}

html[data-theme="light"] .current-chapter {
    color: var(--cobalt);
    opacity: 0.8;
}

html[data-theme="light"] .toc-item {
    background: rgba(0, 48, 135, 0.02);
    border-color: rgba(0, 48, 135, 0.08);
}

html[data-theme="light"] .toc-item:hover {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.1) 0%, rgba(0, 48, 135, 0.06) 100%);
    border-color: rgba(212, 175, 55, 0.28);
}

html[data-theme="light"] .toc-title {
    color: #0a1628;
}

html[data-theme="light"] .toc-dots {
    border-bottom-color: rgba(0, 48, 135, 0.12);
}

html[data-theme="light"] .modal-divider {
    background: linear-gradient(90deg, transparent 0%, rgba(0, 48, 135, 0.25) 30%, rgba(212, 175, 55, 0.4) 50%, rgba(0, 48, 135, 0.25) 70%, transparent 100%);
}

html[data-theme="light"] .page-counter {
    background: rgba(0, 48, 135, 0.06);
    border-color: rgba(0, 48, 135, 0.15);
}

html[data-theme="light"] .page-counter input,
html[data-theme="light"] .page-counter span {
    color: #0a1628;
}