:root {
    --gold: #F5A623;
    --deep-gold: #C4841D;
    --dark-brown: #1A0F07;
    --warm-brown: #2D1B0E;
    --parchment: #E8D5B7;
    --parchment-dark: #C9A96E;
    --royal-purple: #4A1A6B;
    --deep-purple: #2E0845;
    --clash-orange: #E8721C;
    --clash-red: #C0392B;
    --elixir-pink: #D946EF;
}

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

body {
    background: var(--dark-brown);
    color: var(--parchment);
    font-family: 'Crimson Pro', Georgia, serif;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

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

::-webkit-scrollbar-track {
    background: var(--dark-brown);
}

::-webkit-scrollbar-thumb {
    background: var(--deep-gold);
    border-radius: 4px;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(245, 166, 35, 0.3); }
    50% { box-shadow: 0 0 40px rgba(245, 166, 35, 0.6); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

@keyframes countUp {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

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

@keyframes borderGlow {
    0%, 100% { border-color: var(--gold); }
    50% { border-color: var(--clash-orange); }
}

.chapter-visible {
    animation: fadeInUp 0.8s ease-out forwards;
}

.chapter-hidden {
    opacity: 0;
    transform: translateY(60px);
}

.hero-title {
    font-family: 'Bungee', cursive;
    text-shadow: 
        3px 3px 0 var(--dark-brown),
        -1px -1px 0 var(--dark-brown),
        0 4px 8px rgba(0,0,0,0.5);
}

.chapter-title {
    font-family: 'Permanent Marker', cursive;
}

.parchment-bg {
    background: linear-gradient(135deg, 
        rgba(232, 213, 183, 0.08) 0%, 
        rgba(201, 169, 110, 0.04) 50%,
        rgba(232, 213, 183, 0.08) 100%
    );
    border: 2px solid rgba(245, 166, 35, 0.3);
    position: relative;
}

.parchment-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.parchment-bg::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--deep-gold), transparent);
}

.stat-card {
    background: linear-gradient(145deg, #1a0a2e, #0d0520);
    border: 3px solid var(--gold);
    animation: borderGlow 3s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(245,166,35,0.05) 0%, transparent 70%);
    pointer-events: none;
}

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

.fun-fact-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(245, 166, 35, 0.2);
}

.progress-dot {
    transition: all 0.3s ease;
}

.progress-dot.active {
    background: var(--gold);
    box-shadow: 0 0 10px var(--gold);
}

.chapter-image-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    border: 2px solid rgba(245, 166, 35, 0.4);
}

.chapter-image-container img {
    image-rendering: pixelated;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-btn {
    font-family: 'Permanent Marker', cursive;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(245, 166, 35, 0.4);
}

.hero-bg {
    background: 
        radial-gradient(ellipse at 50% 0%, rgba(74,26,107,0.4) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 100%, rgba(232,114,28,0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 80%, rgba(196,132,29,0.15) 0%, transparent 50%),
        linear-gradient(180deg, #0d0520 0%, var(--dark-brown) 100%);
}

.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--clash-orange), var(--gold), var(--elixir-pink));
    z-index: 100;
    transition: width 0.3s ease;
}