body {
    font-family: 'IM Fell DW Pica', serif;
    margin: 0;
    background-color: #f0e6d2; /* Parchment color */
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23noise)' opacity='0.05'/%3E%3C/svg%3E");
    color: #4a3b2a; /* Dark brown text */
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Pirata One', cursive;
    color: #8b0000; /* Dark red for titles */
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

header {
    background-color: #5d4037; /* Wood color */
    color: #f0e6d2;
    padding: 1rem;
    text-align: center;
    border-bottom: 4px solid #3e2723;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

nav ul {
    list-style: none;
    padding: 0;
}

nav ul li {
    display: inline;
    margin: 0 15px;
}

nav a {
    color: #f0e6d2;
    text-decoration: none;
    font-size: 1.2rem;
    transition: color 0.3s;
}

nav a:hover {
    color: #ffd700; /* Gold on hover */
}

main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #8b0000;
    display: inline-block;
    padding-bottom: 10px;
}

#characters-container, #chapters-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.character-card {
    background-color: #fff8e7;
    border: 1px solid #d7c7a5;
    padding: 15px;
    box-shadow: 3px 3px 10px rgba(0,0,0,0.1), inset 0 0 20px rgba(139, 69, 19, 0.1);
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
    border-radius: 2px;
}

/* Paper effect corners */
.character-card::before, .character-card::after {
    content: "";
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.character-card:hover {
    transform: translateY(-5px) rotate(1deg);
    box-shadow: 5px 5px 15px rgba(0,0,0,0.2);
    z-index: 10;
}

.card-header {
    text-align: center;
    border-bottom: 2px solid #4a3b2a;
    margin-bottom: 15px;
    padding-bottom: 10px;
}

.card-header h3 {
    margin: 0;
    font-size: 1.8rem;
    color: #2c1e12;
}

.character-job {
    font-style: italic;
    color: #6d4c41;
    font-size: 1.1rem;
}

.card-section {
    font-size: 1.1rem;
}

.card-section p {
    margin: 8px 0;
    line-height: 1.4;
}

.card-section strong {
    color: #8b0000;
}

.chapter-desc {
    font-style: italic;
    color: #6d4c41;
    font-size: 1rem;
    max-height: 100px;
    overflow-y: auto;
    padding-right: 10px;
}

/* Pagination styling */
#pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 3rem;
    flex-wrap: wrap;
}

#pagination-container button {
    font-family: 'Pirata One', cursive;
    font-size: 1.2rem;
    padding: 8px 16px;
    margin: 5px;
    border: 2px solid #5d4037;
    background-color: #f0e6d2;
    color: #5d4037;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 2px 2px 0 #3e2723;
}

#pagination-container button:hover:not(:disabled) {
    background-color: #5d4037;
    color: #ffd700;
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 #3e2723;
}

#pagination-container button:active:not(:disabled) {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 #3e2723;
}

#pagination-container button.active {
    background-color: #8b0000;
    color: #fff8e7;
    border-color: #5d4037;
}

#pagination-container button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    border-color: #999;
    color: #999;
}

/* Call to Action Button */
.cta-button {
    display: inline-block;
    background-color: #8b0000;
    color: #fff8e7;
    padding: 15px 30px;
    text-decoration: none;
    font-family: 'Pirata One', cursive;
    font-size: 1.5rem;
    border: 2px solid #5d4037;
    box-shadow: 3px 3px 0 #3e2723;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cta-button:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 #3e2723;
    color: #ffd700;
}

.cta-button:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 #3e2723;
}

footer {
    background-color: #3e2723;
    color: #d7ccc8;
    text-align: center;
    padding: 1.5rem;
    margin-top: 3rem;
    border-top: 4px solid #5d4037;
}