:root {
    --color-primary: #020614;
    --color-secondary: #161B22;
    --color-accent: #CFB360;
    --color-bg-dark: #0D1117;
    --color-accent-light: #E2CC88;
    --color-black: #000000;
    --color-accent-alt: #E2CC87;
    --color-accent-dark: #B89A50;
    --color-white: #FFFFFF;
    --color-gray: #21262D;
    
    --font-serif: 'Amiri', 'Scheherazade New', 'Georgia', serif;
    --font-display: 'Cairo', 'Amiri', serif;
    --font-heading: 'Cairo', 'Tajawal', sans-serif;
    
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s ease;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(207, 179, 96, 0.3);
    
    --reader-font-size: 20px;
    --reader-line-height: 2.0;
    --reader-max-width: 800px;
    --reader-font-family: var(--font-serif);
}

[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .hero-decoration {
    left: auto;
    right: -20px;
    border-left: 3px solid var(--color-accent);
    border-right: none;
    border-top: 3px solid var(--color-accent);
}

[dir="rtl"] .chapter-card::before {
    left: auto;
    right: 0;
}

[dir="rtl"] .reader-content p {
    text-align: justify;
    text-indent: 0;
}

[dir="rtl"] .reader-content p:first-of-type {
    text-indent: 0;
}

[dir="rtl"] .nav-chapter-btn:first-child {
    justify-content: flex-end;
}

[dir="rtl"] .nav-chapter-btn:last-child {
    justify-content: flex-start;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-serif);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-bg-dark) 50%, var(--color-secondary) 100%);
    background-attachment: fixed;
    color: var(--color-white);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, var(--color-accent), transparent),
        radial-gradient(2px 2px at 60% 70%, var(--color-accent-light), transparent),
        radial-gradient(1px 1px at 50% 50%, var(--color-accent), transparent),
        radial-gradient(1px 1px at 80% 10%, var(--color-accent-light), transparent),
        radial-gradient(2px 2px at 90% 60%, var(--color-accent-dark), transparent),
        radial-gradient(1px 1px at 33% 90%, var(--color-accent), transparent);
    background-size: 200% 200%;
    background-position: 0% 0%;
    animation: floatingParticles 20s ease-in-out infinite;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

@keyframes floatingParticles {
    0%, 100% { background-position: 0% 0%; }
    25% { background-position: 100% 50%; }
    50% { background-position: 50% 100%; }
    75% { background-position: 100% 25%; }
}

body::after {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(207, 179, 96, 0.1) 0%, transparent 50%);
    animation: ambientGlow 15s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}

@keyframes ambientGlow {
    0% { transform: translate(0, 0) scale(1); opacity: 0.3; }
    50% { transform: translate(10%, 10%) scale(1.1); opacity: 0.5; }
    100% { transform: translate(-10%, 5%) scale(0.9); opacity: 0.3; }
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(22, 27, 34, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(207, 179, 96, 0.2);
    z-index: 1000;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
    opacity: 0.5;
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.brand-icon {
    font-size: 1.8rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.brand-text {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-accent);
    letter-spacing: 1px;
}

.nav-actions {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    background: transparent;
    border: 1px solid rgba(207, 179, 96, 0.3);
    color: var(--color-accent-light);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.nav-btn:hover {
    background: var(--color-accent);
    color: var(--color-black);
    border-color: var(--color-accent);
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-glow), 0 0 30px rgba(207, 179, 96, 0.4);
}

.nav-btn:active {
    transform: translateY(0) scale(0.95);
}

.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
    width: 0%;
    transition: width 0.3s ease;
}

.main-container {
    padding-top: 80px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.page {
    display: none;
    animation: pageEnter 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.page.active {
    display: block;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    min-height: calc(100vh - 200px);
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 10%;
    right: 10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(207, 179, 96, 0.15), transparent 70%);
    border-radius: 50%;
    filter: blur(60px);
    animation: pulseGlow 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

.hero-content {
    position: relative;
}

.hero-decoration {
    position: absolute;
    top: -20px;
    left: -20px;
    width: 100px;
    height: 100px;
    border-top: 3px solid var(--color-accent);
    border-left: 3px solid var(--color-accent);
    opacity: 0.5;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: slideInLeft 0.8s ease;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--color-accent-light);
    margin-bottom: 2rem;
    font-style: italic;
    animation: slideInLeft 0.8s ease 0.2s both;
}

.hero-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 2.5rem;
    animation: slideInLeft 0.8s ease 0.4s both;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-accent-dark);
    font-size: 0.95rem;
}

.meta-item svg {
    color: var(--color-accent);
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.library-hero {
    padding: 6rem 2rem 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.library-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(207, 179, 96, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulseGlow 4s ease-in-out infinite;
    pointer-events: none;
}

.library-hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.library-title {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 0.8s ease;
}

.library-subtitle {
    font-size: 1.3rem;
    color: var(--color-accent-light);
    margin-bottom: 2rem;
    font-style: italic;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.library-author {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-accent-dark);
    font-size: 1rem;
    padding: 0.5rem 1.5rem;
    background: rgba(207, 179, 96, 0.1);
    border-radius: 50px;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.library-author svg {
    color: var(--color-accent);
}

.novels-section {
    padding: 4rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.novels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.novel-card {
    background: var(--color-darker);
    border-radius: 16px;
    overflow: hidden;
    transition: var(--transition-smooth);
    cursor: pointer;
    border: 1px solid rgba(207, 179, 96, 0.2);
    position: relative;
}

.novel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: var(--novel-gradient, linear-gradient(135deg, var(--color-accent), var(--color-accent-light)));
    opacity: 0.8;
    transition: var(--transition-smooth);
}

.novel-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg), 0 0 40px rgba(207, 179, 96, 0.3);
    border-color: var(--color-accent);
}

.novel-card:hover::before {
    height: 100%;
    opacity: 0.1;
}

.novel-card-header {
    padding: 2rem 2rem 1.5rem;
    position: relative;
}

.novel-status-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(207, 179, 96, 0.2);
    color: var(--color-accent-light);
    border: 1px solid var(--color-accent);
}

.novel-status-badge.coming-soon {
    background: rgba(184, 154, 80, 0.2);
    color: var(--color-accent-dark);
    border-color: var(--color-accent-dark);
}

.novel-card-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--color-accent-light);
    line-height: 1.3;
}

.novel-card-subtitle {
    font-size: 1rem;
    color: var(--color-accent-dark);
    margin-bottom: 1rem;
    font-style: italic;
}

.novel-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    color: var(--color-text-light);
    font-size: 0.9rem;
}

.novel-meta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.novel-meta-item svg {
    color: var(--color-accent);
}

.novel-card-body {
    padding: 0 2rem 2rem;
}

.novel-card-description {
    color: var(--color-text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.novel-card-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(207, 179, 96, 0.1);
}

.novel-card-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
    color: var(--color-black);
    border: none;
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition-smooth);
    font-family: var(--font-heading);
}

.novel-card-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(207, 179, 96, 0.4);
}

.novel-card-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.novel-card-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.start-reading-btn {
    animation: slideInLeft 0.8s ease 0.6s both;
}

.status-badge {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(207, 179, 96, 0.2);
    color: var(--color-accent-light);
    border: 1px solid var(--color-accent);
}

.primary-btn {
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
    color: var(--color-black);
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-md);
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
}

.primary-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-lg), 0 0 40px rgba(207, 179, 96, 0.5);
    background: linear-gradient(135deg, var(--color-accent-light), var(--color-accent));
}

.primary-btn:active {
    transform: translateY(-1px) scale(0.98);
}

.primary-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 2px;
    background: linear-gradient(135deg, var(--color-accent-light), var(--color-accent-dark));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: var(--transition-fast);
}

.primary-btn:hover::before {
    opacity: 1;
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: slideInRight 0.8s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.book-illustration {
    position: relative;
    width: 300px;
    height: 400px;
    perspective: 1000px;
    animation: floatBook 4s ease-in-out infinite;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5));
    transition: var(--transition-smooth);
}

.book-illustration:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 25px 50px rgba(207, 179, 96, 0.3));
}

@keyframes floatBook {
    0%, 100% { transform: translateY(0) rotateY(-10deg); }
    50% { transform: translateY(-20px) rotateY(10deg); }
}

.book-cover {
    position: absolute;
    width: 280px;
    height: 380px;
    background: linear-gradient(135deg, var(--color-secondary), var(--color-gray));
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--color-accent);
    transform: rotateY(-15deg);
    left: 20px;
}

.book-cover::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    border: 2px solid var(--color-accent);
    border-radius: 4px;
    animation: borderPulse 3s ease-in-out infinite;
}

@keyframes borderPulse {
    0%, 100% { border-color: var(--color-accent); box-shadow: 0 0 10px rgba(207, 179, 96, 0.3); }
    50% { border-color: var(--color-accent-light); box-shadow: 0 0 20px rgba(207, 179, 96, 0.6); }
}

.book-spine {
    position: absolute;
    width: 40px;
    height: 380px;
    background: linear-gradient(90deg, var(--color-accent-dark), var(--color-accent));
    border-radius: 8px 0 0 8px;
    left: 0;
    box-shadow: var(--shadow-md);
}

.book-pages {
    position: absolute;
    width: 270px;
    height: 370px;
    background: var(--color-white);
    border-radius: 0 8px 8px 0;
    right: 0;
    top: 5px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.book-pages::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: repeating-linear-gradient(
        to bottom,
        var(--color-gray) 0px,
        var(--color-gray) 2px,
        transparent 2px,
        transparent 10px
    );
}

.continue-reading-section {
    max-width: 1400px;
    margin: 2rem auto 3rem;
    padding: 0 2rem;
    animation: slideInUp 0.8s ease;
}

.continue-reading-card {
    background: linear-gradient(135deg, rgba(207, 179, 96, 0.15), rgba(226, 204, 136, 0.1));
    backdrop-filter: blur(20px);
    border: 2px solid var(--color-accent);
    border-radius: 20px;
    padding: 2rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 2rem;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(207, 179, 96, 0.3), inset 0 0 60px rgba(207, 179, 96, 0.1);
    transition: var(--transition-smooth);
}

.continue-reading-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(207, 179, 96, 0.2), transparent);
    animation: shimmerContinue 3s infinite;
}

@keyframes shimmerContinue {
    0% { left: -100%; }
    100% { left: 100%; }
}

.continue-reading-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 48px rgba(207, 179, 96, 0.4), inset 0 0 80px rgba(207, 179, 96, 0.15);
    border-color: var(--color-accent-light);
}

.continue-icon {
    width: 80px;
    height: 80px;
    background: var(--color-accent);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-black);
    box-shadow: 0 4px 20px rgba(207, 179, 96, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 20px rgba(207, 179, 96, 0.5); }
    50% { transform: scale(1.05); box-shadow: 0 6px 30px rgba(207, 179, 96, 0.7); }
}

.continue-content {
    flex: 1;
}

.continue-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--color-accent);
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.continue-novel-info {
    margin-bottom: 0.5rem;
}

.continue-novel-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-accent-light);
}

.continue-chapter-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--color-accent-light);
    font-size: 1.1rem;
}

.continue-chapter-number {
    font-weight: 600;
    color: var(--color-accent);
}

.continue-separator {
    color: var(--color-accent-dark);
}

.continue-chapter-title {
    font-style: italic;
}

.continue-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.continue-progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(22, 27, 34, 0.8);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(207, 179, 96, 0.3);
}

.continue-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent-dark), var(--color-accent), var(--color-accent-light));
    border-radius: 4px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(207, 179, 96, 0.6);
}

.continue-progress-text {
    font-size: 0.9rem;
    color: var(--color-accent);
    font-weight: 600;
    min-width: 45px;
}

.continue-btn {
    background: var(--color-accent);
    color: var(--color-black);
    border: none;
    padding: 1.25rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--font-heading);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 20px rgba(207, 179, 96, 0.4);
    position: relative;
    overflow: hidden;
}

.continue-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.continue-btn:hover::before {
    transform: translateX(100%);
}

.continue-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(207, 179, 96, 0.6);
    background: var(--color-accent-light);
}

.continue-btn:active {
    transform: scale(0.98);
}

.description-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 2rem;
    background: rgba(22, 27, 34, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    margin-bottom: 4rem;
    border: 1px solid rgba(207, 179, 96, 0.2);
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.description-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(207, 179, 96, 0.05) 50%, transparent 70%);
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.description-section:hover {
    border-color: rgba(207, 179, 96, 0.4);
    box-shadow: 0 8px 40px rgba(207, 179, 96, 0.15);
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--color-accent);
    margin-bottom: 1.5rem;
    text-align: center;
}

.description-text {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--color-accent-light);
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.chapters-header {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 2rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.page-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    color: var(--color-accent);
}

.chapters-search {
    position: relative;
    display: flex;
    align-items: center;
}

.chapters-search svg {
    position: absolute;
    left: 1rem;
    color: var(--color-accent);
}

.chapters-search input {
    background: rgba(22, 27, 34, 0.8);
    border: 1px solid rgba(207, 179, 96, 0.3);
    color: var(--color-white);
    padding: 0.75rem 1rem 0.75rem 3rem;
    border-radius: 8px;
    font-size: 1rem;
    width: 300px;
    transition: var(--transition-fast);
}

.chapters-search input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: var(--shadow-glow);
}

.chapters-search input::placeholder {
    color: var(--color-accent-dark);
}

.chapters-grid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.chapter-card {
    background: rgba(22, 27, 34, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(207, 179, 96, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    animation: cardFadeIn 0.5s ease backwards;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chapter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--color-accent), var(--color-accent-dark));
    transform: scaleY(0);
    transition: var(--transition-smooth);
}

.chapter-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--color-accent);
    box-shadow: var(--shadow-lg), 0 0 40px rgba(207, 179, 96, 0.4);
    background: rgba(22, 27, 34, 0.95);
}

.chapter-card:hover::before {
    transform: scaleY(1);
}

.chapter-card:active {
    transform: translateY(-4px) scale(1);
}

.chapter-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(207, 179, 96, 0.2), transparent 70%);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.chapter-card:hover::after {
    width: 300%;
    height: 300%;
}

.chapter-number {
    font-size: 0.9rem;
    color: var(--color-accent-dark);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.chapter-name {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--color-accent-light);
    margin-bottom: 0.75rem;
}

.chapter-preview {
    font-size: 0.95rem;
    color: rgba(226, 204, 136, 0.7);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.chapter-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(207, 179, 96, 0.2);
    font-size: 0.85rem;
    color: var(--color-accent-dark);
}

.reader-container {
    max-width: var(--reader-max-width);
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 100px);
}

.reader-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid rgba(207, 179, 96, 0.2);
}

.chapter-info {
    text-align: center;
    flex: 1;
}

.current-chapter-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
}

.current-chapter-number {
    font-size: 1rem;
    color: var(--color-accent-dark);
}

.icon-btn {
    background: transparent;
    border: 1px solid rgba(207, 179, 96, 0.3);
    color: var(--color-accent);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.icon-btn:hover:not(:disabled) {
    background: var(--color-accent);
    color: var(--color-black);
    border-color: var(--color-accent);
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 20px rgba(207, 179, 96, 0.5);
}

.icon-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.icon-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.reader-content {
    font-family: var(--reader-font-family);
    font-size: var(--reader-font-size);
    line-height: var(--reader-line-height);
    color: var(--color-accent-light);
    margin-bottom: 4rem;
    animation: contentFadeIn 0.8s ease;
}

@keyframes contentFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reader-content p {
    margin-bottom: 1.8rem;
    text-align: justify;
    animation: paragraphFadeIn 0.6s ease backwards;
}

@keyframes paragraphFadeIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.reader-content p:first-of-type::first-letter {
    font-size: 4.5rem;
    font-family: var(--font-display);
    float: right;
    line-height: 0.8;
    margin: 0.1em 0 0 0.1em;
    color: var(--color-accent);
    text-shadow: 0 0 20px rgba(207, 179, 96, 0.5);
    animation: dropCapGlow 3s ease-in-out infinite;
    font-weight: bold;
}

@keyframes dropCapGlow {
    0%, 100% { text-shadow: 0 0 20px rgba(207, 179, 96, 0.5); }
    50% { text-shadow: 0 0 30px rgba(207, 179, 96, 0.8); }
}

.reader-content h1,
.reader-content h2,
.reader-content h3 {
    font-family: var(--font-heading);
    color: var(--color-accent);
    margin: 2rem 0 1rem;
}

.reader-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(207, 179, 96, 0.2);
}

.nav-chapter-btn {
    background: rgba(22, 27, 34, 0.8);
    border: 1px solid rgba(207, 179, 96, 0.3);
    color: var(--color-accent-light);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    transition: var(--transition-smooth);
    flex: 1;
}

.nav-chapter-btn:first-child {
    justify-content: flex-start;
}

.nav-chapter-btn:last-child {
    justify-content: flex-end;
}

.nav-chapter-btn:hover:not(:disabled) {
    background: var(--color-accent);
    color: var(--color-black);
    border-color: var(--color-accent);
    transform: translateY(-2px);
}

.nav-chapter-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.settings-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.settings-group {
    background: rgba(22, 27, 34, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(207, 179, 96, 0.2);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.settings-group-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--color-accent);
    margin-bottom: 1.5rem;
}

.font-size-controls,
.font-family-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.font-btn,
.font-family-btn {
    background: transparent;
    border: 1px solid rgba(207, 179, 96, 0.3);
    color: var(--color-accent-light);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
    font-family: var(--font-serif);
}

.font-btn {
    width: 60px;
    height: 60px;
    font-weight: 600;
}

.font-btn[data-size="small"] { font-size: 1rem; }
.font-btn[data-size="medium"] { font-size: 1.25rem; }
.font-btn[data-size="large"] { font-size: 1.5rem; }
.font-btn[data-size="xlarge"] { font-size: 1.75rem; }

.font-btn:hover,
.font-family-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(207, 179, 96, 0.3);
}

.font-btn.active,
.font-family-btn.active {
    background: var(--color-accent);
    color: var(--color-black);
    border-color: var(--color-accent);
    box-shadow: 0 0 20px rgba(207, 179, 96, 0.4);
    animation: activeGlow 2s ease-in-out infinite;
}

@keyframes activeGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(207, 179, 96, 0.4); }
    50% { box-shadow: 0 0 30px rgba(207, 179, 96, 0.6); }
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(207, 179, 96, 0.2);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-accent);
    cursor: pointer;
    transition: var(--transition-fast);
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: var(--shadow-glow);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-accent);
    cursor: pointer;
    border: none;
    transition: var(--transition-fast);
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: var(--shadow-glow);
}

.slider-value {
    display: inline-block;
    margin-top: 0.75rem;
    color: var(--color-accent-light);
    font-weight: 600;
}

.reset-btn {
    margin-top: 2rem;
    width: 100%;
}

.music-control-btn {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-light));
    border: 2px solid var(--color-accent-light);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(207, 179, 96, 0.5), inset 0 2px 8px rgba(255, 255, 255, 0.2);
    transition: var(--transition-smooth);
    overflow: hidden;
    padding: 0;
}

.music-control-btn::before {
    content: '';
    position: absolute;
    inset: -3px;
    background: linear-gradient(45deg, var(--color-accent), var(--color-accent-light), var(--color-accent));
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: rotateBorder 3s linear infinite;
}

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

.music-control-btn:hover::before {
    opacity: 1;
}

.music-control-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 48px rgba(207, 179, 96, 0.7), inset 0 2px 8px rgba(255, 255, 255, 0.3);
}

.music-control-btn:active {
    transform: scale(0.95);
}

.music-icon {
    position: relative;
    color: var(--color-black);
    margin-bottom: 4px;
    z-index: 2;
}

.music-icon svg {
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.music-waves {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    height: 16px;
    z-index: 2;
}

.wave {
    width: 3px;
    height: 8px;
    background: var(--color-black);
    border-radius: 2px;
    animation: waveAnimation 0.8s ease-in-out infinite;
}

.wave:nth-child(1) { animation-delay: 0s; }
.wave:nth-child(2) { animation-delay: 0.2s; }
.wave:nth-child(3) { animation-delay: 0.4s; }
.wave:nth-child(4) { animation-delay: 0.6s; }

@keyframes waveAnimation {
    0%, 100% { height: 4px; }
    50% { height: 16px; }
}

.music-control-btn.paused .music-waves .wave {
    animation: none;
    height: 4px;
}

.music-control-btn.paused .music-icon-playing {
    display: none;
}

.music-control-btn.paused .music-icon-paused {
    display: block !important;
}

.music-control-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    right: calc(100% + 1rem);
    background: rgba(22, 27, 34, 0.95);
    color: var(--color-accent);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: var(--font-heading);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateX(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    border: 1px solid var(--color-accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.music-control-btn:hover::after {
    opacity: 1;
    transform: translateX(0);
}

[dir="rtl"] .music-control-btn {
    left: auto;
    right: 2rem;
}

[dir="rtl"] .music-control-btn::after {
    right: auto;
    left: calc(100% + 1rem);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 20, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(207, 179, 96, 0.2);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite, pulse 2s ease-in-out infinite;
    box-shadow: 0 0 30px rgba(207, 179, 96, 0.5);
    position: relative;
}

.loading-spinner::after {
    content: '';
    position: absolute;
    inset: -10px;
    border: 2px solid rgba(207, 179, 96, 0.1);
    border-radius: 50%;
    animation: spin 2s linear infinite reverse;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@media (hover: none) and (pointer: coarse) {
    .chapter-card:active {
        transform: scale(0.98);
        background: rgba(22, 27, 34, 0.95);
    }
    
    .nav-btn:active {
        transform: scale(0.95);
    }
    
    .primary-btn:active {
        transform: scale(0.97);
    }
    
    .chapter-card:hover::after {
        width: 0;
        height: 0;
    }
}

@media (max-width: 1024px) {
    .hero-section {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
        padding: 3rem 1.5rem;
    }
    
    .hero-section::before {
        top: 5%;
        right: 5%;
        width: 200px;
        height: 200px;
    }
    
    .hero-decoration {
        display: none;
    }
    
    .hero-meta {
        justify-content: center;
    }
    
    .library-title {
        font-size: 3rem;
    }
    
    .novels-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1.5rem;
    }
    
    .chapters-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.25rem;
    }
    
    .reader-container {
        padding: 1.5rem;
    }
    
    .settings-container {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    :root {
        --reader-font-size: 16px;
        --reader-line-height: 1.7;
    }
    
    .music-control-btn {
        bottom: 1.5rem;
        left: 1.5rem;
        width: 56px;
        height: 56px;
    }
    
    [dir="rtl"] .music-control-btn {
        left: auto;
        right: 1.5rem;
    }
    
    .music-control-btn::after {
        display: none;
    }
    
    .music-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .music-waves {
        height: 14px;
    }
    
    .library-hero {
        padding: 4rem 1.5rem 3rem;
    }
    
    .library-title {
        font-size: 2.5rem;
    }
    
    .library-subtitle {
        font-size: 1.1rem;
    }
    
    .novels-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .novel-card-title {
        font-size: 1.75rem;
    }
    
    .continue-reading-section {
        padding: 0 1rem;
        margin: 1.5rem auto 2rem;
    }
    
    .continue-reading-card {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
        text-align: center;
    }
    
    .continue-icon {
        width: 60px;
        height: 60px;
        margin: 0 auto;
    }
    
    .continue-title {
        font-size: 1.25rem;
    }
    
    .continue-chapter-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .continue-separator {
        display: none;
    }
    
    .continue-btn {
        width: 100%;
        justify-content: center;
        padding: 1rem 1.5rem;
    }
    
    .nav-container {
        padding: 0.875rem 1rem;
    }
    
    .brand-text {
        font-size: 1rem;
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .brand-icon {
        font-size: 1.5rem;
    }
    
    .nav-btn {
        width: 36px;
        height: 36px;
    }
    
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .hero-meta {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .primary-btn {
        width: 100%;
        justify-content: center;
        padding: 1rem 2rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .description-section {
        padding: 2.5rem 1.5rem;
    }
    
    .chapters-header {
        flex-direction: column;
        align-items: stretch;
        padding: 1.5rem 1rem 1rem;
    }
    
    .chapters-search input {
        width: 100%;
        padding: 0.875rem 1rem 0.875rem 3rem;
    }
    
    .chapters-grid {
        padding: 1rem;
        gap: 1rem;
    }
    
    .chapter-card {
        padding: 1.25rem;
    }
    
    .reader-container {
        padding: 1rem;
    }
    
    .reader-header {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .current-chapter-title {
        font-size: 1.5rem;
    }
    
    .icon-btn {
        width: 44px;
        height: 44px;
    }
    
    .reader-navigation {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .nav-chapter-btn {
        justify-content: center !important;
        width: 100%;
    }
    
    .reader-content {
        margin-bottom: 3rem;
    }
    
    .reader-content p {
        text-indent: 1.5rem;
    }
    
    .reader-content p:first-of-type::first-letter {
        font-size: 3rem;
    }
    
    .book-illustration {
        transform: scale(0.8);
    }
    
    .settings-group {
        padding: 1.5rem;
    }
    
    .font-size-controls,
    .font-family-controls {
        gap: 0.75rem;
    }
    
    .font-btn {
        width: 50px;
        height: 50px;
    }
    
    .chapter-card {
        min-height: 140px;
    }
}

@media (max-width: 480px) {
    :root {
        --reader-font-size: 15px;
        --reader-max-width: 100%;
    }
    
    body {
        font-size: 14px;
    }
    
    .music-control-btn {
        bottom: 1rem;
        left: 1rem;
        width: 52px;
        height: 52px;
    }
    
    [dir="rtl"] .music-control-btn {
        left: auto;
        right: 1rem;
    }
    
    .music-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .library-hero {
        padding: 3rem 1rem 2rem;
    }
    
    .library-title {
        font-size: 2rem;
    }
    
    .library-subtitle {
        font-size: 1rem;
    }
    
    .novels-section {
        padding: 2rem 1rem;
    }
    
    .novel-card-title {
        font-size: 1.5rem;
    }
    
    .novel-card-header,
    .novel-card-body,
    .novel-card-footer {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .continue-reading-card {
        padding: 1.25rem;
    }
    
    .continue-icon {
        width: 50px;
        height: 50px;
    }
    
    .continue-icon svg {
        width: 32px;
        height: 32px;
    }
    
    .continue-title {
        font-size: 1.1rem;
    }
    
    .continue-chapter-info {
        font-size: 1rem;
    }
    
    .continue-progress {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .continue-progress-bar {
        width: 100%;
    }
    
    .continue-btn {
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
    }
    
    .nav-container {
        padding: 0.75rem 0.875rem;
    }
    
    .brand-text {
        font-size: 0.9rem;
        max-width: 140px;
    }
    
    .brand-icon {
        font-size: 1.3rem;
    }
    
    .nav-actions {
        gap: 0.25rem;
    }
    
    .nav-btn {
        width: 32px;
        height: 32px;
    }
    
    .hero-section {
        padding: 2rem 1rem;
        min-height: calc(100vh - 150px);
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }
    
    .meta-item {
        font-size: 0.875rem;
    }
    
    .primary-btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    .book-illustration {
        transform: scale(0.7);
    }
    
    .description-section {
        padding: 2rem 1.25rem;
        margin-bottom: 2rem;
    }
    
    .section-title {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }
    
    .description-text {
        font-size: 1rem;
    }
    
    .page-title {
        font-size: 1.75rem;
    }
    
    .chapters-header {
        padding: 1.25rem 0.875rem 0.875rem;
    }
    
    .chapters-search input {
        font-size: 0.9rem;
        padding: 0.75rem 0.875rem 0.75rem 2.75rem;
    }
    
    .chapters-search svg {
        width: 16px;
        height: 16px;
        left: 0.875rem;
    }
    
    .chapters-grid {
        grid-template-columns: 1fr;
        padding: 0.875rem;
    }
    
    .chapter-card {
        padding: 1rem;
    }
    
    .chapter-name {
        font-size: 1.15rem;
    }
    
    .chapter-preview {
        font-size: 0.875rem;
    }
    
    .chapter-meta {
        font-size: 0.8rem;
        flex-wrap: wrap;
    }
    
    .reader-container {
        padding: 0.875rem;
    }
    
    .reader-header {
        padding-bottom: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .current-chapter-title {
        font-size: 1.3rem;
    }
    
    .current-chapter-number {
        font-size: 0.9rem;
    }
    
    .icon-btn {
        width: 40px;
        height: 40px;
    }
    
    .icon-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .reader-content {
        margin-bottom: 2rem;
    }
    
    .reader-content p {
        margin-bottom: 1.25rem;
        text-indent: 1rem;
    }
    
    .reader-content p:first-of-type::first-letter {
        font-size: 2.5rem;
    }
    
    .reader-navigation {
        padding-top: 1.5rem;
    }
    
    .nav-chapter-btn {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }
    
    .nav-chapter-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .settings-container {
        padding: 1rem;
    }
    
    .settings-group {
        padding: 1.25rem;
        margin-bottom: 1.5rem;
    }
    
    .settings-group-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .font-btn {
        width: 45px;
        height: 45px;
        padding: 0.5rem;
    }
    
    .font-family-btn {
        padding: 0.625rem 1rem;
        font-size: 0.9rem;
    }
    
    .hero-section::before {
        width: 150px;
        height: 150px;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

.slide-up {
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

::selection {
    background: var(--color-accent);
    color: var(--color-black);
}

::-moz-selection {
    background: var(--color-accent);
    color: var(--color-black);
}

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--color-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--color-accent-dark);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
    box-shadow: 0 0 10px rgba(207, 179, 96, 0.5);
}


.hero-content,
.hero-image {
    will-change: transform;
}

@media (max-width: 768px) {
    .page {
        scroll-snap-align: start;
    }
}

*::selection {
    animation: selectionPulse 0.3s ease;
}

@keyframes selectionPulse {
    from { background-color: rgba(207, 179, 96, 0.5); }
    to { background-color: var(--color-accent); }
}

*:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.glass-effect {
    background: rgba(22, 27, 34, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(207, 179, 96, 0.2);
}

.floating {
    animation: floating 6s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

.gradient-text {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        rgba(22, 27, 34, 0.8) 25%,
        rgba(33, 38, 45, 0.8) 50%,
        rgba(22, 27, 34, 0.8) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.bounce-in {
    animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

.slide-in-left {
    animation: slideInLeftAnim 0.6s ease-out;
}

.slide-in-right {
    animation: slideInRightAnim 0.6s ease-out;
}

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

@keyframes slideInRightAnim {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rotate-in {
    animation: rotateIn 0.6s ease-out;
}

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

.glow-pulse {
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(207, 179, 96, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(207, 179, 96, 0.6);
    }
}

.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--color-accent);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--color-accent); }
}

.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.page-load {
    animation: pageLoad 0.6s ease-out;
}

@keyframes pageLoad {
    from {
        opacity: 0;
        transform: scale(0.95);
        filter: blur(5px);
    }
    to {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

.pattern-bg {
    background-image: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(207, 179, 96, 0.02) 10px,
            rgba(207, 179, 96, 0.02) 20px
        );
}

.card-lift:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 60px rgba(207, 179, 96, 0.3);
}

.gradient-border {
    position: relative;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, var(--color-accent), var(--color-accent-light), var(--color-accent-dark));
    border-radius: inherit;
    z-index: -1;
    animation: borderRotate 3s linear infinite;
}

@keyframes borderRotate {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

.text-shimmer {
    background: linear-gradient(
        90deg,
        var(--color-accent-dark) 0%,
        var(--color-accent) 50%,
        var(--color-accent-light) 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textShimmer 3s linear infinite;
}

@keyframes textShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.breathe {
    animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

@keyframes confettiFall {
    0% {
        top: -10px;
        opacity: 1;
    }
    100% {
        top: 100vh;
        opacity: 0;
        transform: translateX(calc(var(--random-x, 0) * 100px)) rotate(calc(var(--random-rotate, 0) * 720deg));
    }
}

.novel-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.novel-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 30px 60px rgba(207, 179, 96, 0.4), 0 0 50px rgba(207, 179, 96, 0.2);
}

.page {
    animation: pageLoad 0.6s ease-out;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.active-glow {
    box-shadow: 0 0 20px rgba(207, 179, 96, 0.6), 0 0 40px rgba(207, 179, 96, 0.4);
    animation: glowPulse 2s ease-in-out infinite;
}

.scroll-progress-bar {
    box-shadow: 0 2px 10px rgba(207, 179, 96, 0.5);
}

.music-control-btn {
    transition: all 0.3s ease;
}

.music-control-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 40px rgba(207, 179, 96, 0.6);
}

.music-control-btn:active {
    transform: scale(0.95);
}

#particles-canvas {
    filter: blur(0.5px);
}

.chapter-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.chapter-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(207, 179, 96, 0.1), transparent);
    transition: left 0.5s;
}

.chapter-card:hover::after {
    left: 100%;
}

.reading-time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(207, 179, 96, 0.1);
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--color-accent);
    margin-top: 0.5rem;
}

.reading-time svg {
    opacity: 0.8;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.floating {
    animation: float 3s ease-in-out infinite;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(207, 179, 96, 0.4);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.shimmer-text {
    background: linear-gradient(90deg, 
        var(--color-accent) 0%, 
        var(--color-accent-light) 50%, 
        var(--color-accent) 100%);
    background-size: 1000px 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s linear infinite;
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

*:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
    border-radius: 4px;
}

::selection {
    background: var(--color-accent);
    color: var(--color-dark);
}

::-moz-selection {
    background: var(--color-accent);
    color: var(--color-dark);
}

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--color-darker);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--color-accent), var(--color-accent-light));
    border-radius: 10px;
    border: 2px solid var(--color-darker);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--color-accent-light), var(--color-accent));
}

.blur-backdrop {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.transform-3d {
    transform-style: preserve-3d;
    perspective: 1000px;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.animated-gradient {
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
}

@media (hover: none) {
    .chapter-card:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    .novel-card:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
}

.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}
