:root {
    --comic-bg: #F5F0E8;
    --comic-red: #DC143C;
    --comic-blue: #4682B4;
    --comic-green: #228B22;
    --comic-brown: #8B4513;
    --pixar-primary: #FF6B6B;
    --pixar-secondary: #4ECDC4;
    --pixar-accent: #FFE66D;
    --pixar-purple: #A8E6CF;
    --pixar-orange: #FFB347;
}

/* Background Animation with Graph Paper Overlay */
body {
    font-family: 'Fredoka', sans-serif;
    background: 
        linear-gradient(90deg, rgba(128, 128, 128, 0.1) 1px, transparent 1px),
        linear-gradient(180deg, rgba(128, 128, 128, 0.1) 1px, transparent 1px),
        linear-gradient(135deg, #F5F0E8, #F0EAE0, #EDE8DD);
    background-size: 20px 20px, 20px 20px, 400% 400%;
    animation: gradientShift 15s ease infinite;
}

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

/* Comic Book Typography */
.comic-title {
    font-family: 'Bangers', cursive;
    color: var(--comic-red);
    text-shadow: 
        4px 4px 0px #000,
        -2px -2px 0px #000,
        2px -2px 0px #000,
        -2px 2px 0px #000,
        2px 2px 0px #000,
        6px 6px 0px rgba(0,0,0,0.3);
    letter-spacing: 3px;
    line-height: 0.9;
}

.nav-title {
    font-family: 'Bangers', cursive;
    color: white;
    text-shadow: 
        2px 2px 0px #000,
        -1px -1px 0px #000,
        1px -1px 0px #000,
        -1px 1px 0px #000,
        1px 1px 0px #000;
    letter-spacing: 2px;
}

.comic-subtitle {
    font-family: 'Comic Neue', cursive;
}

.comic-text {
    font-family: 'Comic Neue', cursive;
}

.comic-heading-readable {
    font-family: 'Fredoka', sans-serif;
    color: var(--comic-brown);
    font-weight: 700;
}

.comic-text-readable {
    font-family: 'Fredoka', sans-serif;
    color: var(--comic-brown);
}

/* Comic Page Styling */
.comic-page {
    background-color: transparent;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    border: none;
}

/* Accessibility Classes */
.high-contrast {
    filter: contrast(150%) brightness(120%);
}

.reduce-animations,
.reduce-animations * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

/* Theme Classes */
.theme-dark {
    background: #1a1a1a !important;
    color: #ffffff !important;
}

.theme-dark .epilogue-panel {
    background: #2a2a2a !important;
    color: #ffffff !important;
}

.theme-light {
    background: #ffffff !important;
    color: #000000 !important;
}

.theme-sepia {
    background: #f4f3e8 !important;
    color: #3e2723 !important;
    filter: sepia(20%);
}

/* Navigation Buttons */
.nav-button {
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
    text-align: center;
}

.nav-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.nav-button::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.2);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.5s ease;
    z-index: -1;
}

.nav-button:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.nav-home {
    background-color: #f24432;
    color: white;
}

.nav-read {
    background-color: #4e8adb;
    color: white;
}

.nav-cast {
    background-color: #9e60f8;
    color: white;
}

.nav-epilogue {
    background-color: #209b6c;
    color: white;
}

.nav-community {
    background-color: #ff9300;
    color: white;
}

/* Reader Controls */
.reader-controls {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 2px solid #DDD;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.control-title {
    font-weight: 700;
    color: var(--comic-brown);
    margin-bottom: 0.5rem;
}

.control-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.control-label {
    flex: 1;
    font-size: 0.875rem;
    color: var(--comic-brown);
}

.control-item {
    flex: 2;
}

/* Character Cards */
.character-card {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.character-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Epilogue Styling */
.epilogue-panel {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: 3px solid var(--comic-brown);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.epilogue-title {
    font-family: 'Bangers', cursive;
    color: var(--comic-red);
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

.epilogue-text {
    font-family: 'Comic Neue', cursive;
    color: black;
    line-height: 1.6;
    font-size: 1.125rem; /* 18px - 2 points bigger than default 16px */
}

/* Comments Styling */
.comment-card {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--comic-blue);
}

.commenter-name {
    font-weight: 700;
    color: var(--comic-blue);
    margin-bottom: 0.25rem;
}

.comment-date {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 0.5rem;
}

.comment-text {
    color: #333;
    line-height: 1.5;
}

/* Mobile Optimization */
@media (max-width: 640px) {
    .mobile-spacing {
        margin-bottom: 1rem;
    }
    
    .comic-title {
        font-size: 2.5rem;
        letter-spacing: 2px;
    }
    
    .nav-button {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
}

/* Theme Colors */
.theme-original {
    --theme-bg: var(--comic-bg);
    --theme-text: var(--comic-brown);
}

.theme-dark {
    --theme-bg: #333;
    --theme-text: #EEE;
}

.theme-light {
    --theme-bg: #FFF;
    --theme-text: #333;
}

.theme-sepia {
    --theme-bg: #F4ECD8;
    --theme-text: #5B4636;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--comic-brown);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6d370f;
}