/* ============================================
   STONE SOUP - A Modern Folktale
   Stylesheet inspired by classic literature
   ============================================ */

/* CSS Variables */
:root {
    /* Colors - Warm, aged paper aesthetic */
    --color-parchment: #f5f0e6;
    --color-parchment-dark: #e8e0d0;
    --color-ink: #2c2416;
    --color-ink-light: #4a4235;
    --color-accent: #8b4513;
    --color-accent-dark: #5c2e0d;
    --color-gold: #c9a227;
    --color-copper: #b87333;
    --color-shadow: rgba(44, 36, 22, 0.15);

    /* Typography */
    --font-display: 'Cinzel', serif;
    --font-body: 'EB Garamond', Georgia, serif;

    /* Spacing */
    --page-padding: 3rem;
    --page-padding-mobile: 1.5rem;

    /* Book dimensions */
    --book-width: min(90vw, 1000px);
    --book-height: min(80vh, 700px);
    --page-width: calc(var(--book-width) / 2);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(135deg, #2c2416 0%, #1a1610 100%);
    color: var(--color-ink);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   LANDING PAGE
   ============================================ */

.landing-page {
    min-height: 100vh;
    background:
        radial-gradient(ellipse at center, rgba(201, 162, 39, 0.1) 0%, transparent 70%),
        linear-gradient(135deg, #2c2416 0%, #1a1610 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.landing-content {
    max-width: 1200px;
    width: 100%;
    text-align: center;
}

.landing-header {
    margin-bottom: 3rem;
}

.main-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 10vw, 6rem);
    color: var(--color-gold);
    letter-spacing: 0.1em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 0.5rem;
}

.tagline {
    font-family: var(--font-body);
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: var(--color-parchment);
    font-style: italic;
    letter-spacing: 0.05em;
}

.intro-text {
    max-width: 700px;
    margin: 0 auto 4rem;
    color: var(--color-parchment-dark);
    font-size: 1.1rem;
}

.intro-text p {
    margin-bottom: 1rem;
}

.vocabulary-note {
    font-size: 0.95rem;
    opacity: 0.8;
    border-left: 2px solid var(--color-gold);
    padding-left: 1rem;
    text-align: left;
    margin-top: 1.5rem;
}

.volume-selection h2 {
    font-family: var(--font-display);
    color: var(--color-parchment);
    font-size: 1.5rem;
    margin-bottom: 2rem;
    letter-spacing: 0.1em;
}

.volumes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 1rem;
}

.volume-card {
    background: var(--color-parchment);
    border-radius: 8px;
    overflow: hidden;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 0 0 1px var(--color-gold);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.volume-card.available:hover {
    transform: translateY(-10px);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 0 2px var(--color-gold);
}

.volume-card.coming-soon {
    opacity: 0.6;
}

.volume-cover {
    height: 180px;
    background: linear-gradient(135deg, var(--color-accent-dark) 0%, var(--color-accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Three stones icon - replaces pot */
.stones-icon {
    width: 100px;
    height: 60px;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 5px;
}

/* Individual stone styling */
.stone {
    background: linear-gradient(145deg, #8b8b8b 0%, #5a5a5a 50%, #3d3d3d 100%);
    border-radius: 50% 50% 48% 48%;
    position: relative;
    box-shadow:
        2px 3px 6px rgba(0, 0, 0, 0.4),
        inset -3px -3px 8px rgba(0, 0, 0, 0.3),
        inset 3px 3px 8px rgba(255, 255, 255, 0.1);
}

/* Left stone - medium, tilted left */
.stone-1 {
    width: 32px;
    height: 28px;
    transform: rotate(-15deg);
    background: linear-gradient(135deg, #7a7a7a 0%, #4a4a4a 50%, #333 100%);
}

/* Center stone - largest, slightly forward */
.stone-2 {
    width: 38px;
    height: 32px;
    transform: translateY(-2px);
    background: linear-gradient(150deg, #8f8f8f 0%, #5f5f5f 50%, #3a3a3a 100%);
    z-index: 1;
}

/* Right stone - smallest, tilted right */
.stone-3 {
    width: 28px;
    height: 24px;
    transform: rotate(12deg);
    background: linear-gradient(160deg, #858585 0%, #555 50%, #363636 100%);
}

/* Subtle shine on each stone */
.stone::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 20%;
    width: 30%;
    height: 20%;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    filter: blur(2px);
}

.stones-icon.faded .stone {
    opacity: 0.5;
}

/* Legacy pot-icon class - now renders as stones */
.pot-icon {
    width: 100px;
    height: 60px;
    position: relative;
    background: none;
    box-shadow: none;
}

/* Left stone */
.pot-icon::before {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 5px;
    width: 32px;
    height: 28px;
    background: linear-gradient(135deg, #7a7a7a 0%, #4a4a4a 50%, #333 100%);
    border-radius: 50% 50% 48% 48%;
    transform: rotate(-15deg);
    box-shadow:
        2px 3px 6px rgba(0, 0, 0, 0.4),
        inset -3px -3px 8px rgba(0, 0, 0, 0.3),
        inset 3px 3px 8px rgba(255, 255, 255, 0.1);
}

/* Right stone */
.pot-icon::after {
    content: '';
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 28px;
    height: 24px;
    background: linear-gradient(160deg, #858585 0%, #555 50%, #363636 100%);
    border-radius: 50% 50% 48% 48%;
    transform: rotate(12deg);
    box-shadow:
        2px 3px 6px rgba(0, 0, 0, 0.4),
        inset -3px -3px 8px rgba(0, 0, 0, 0.3),
        inset 3px 3px 8px rgba(255, 255, 255, 0.1);
    animation: none;
}

.pot-icon.faded {
    opacity: 0.5;
}

.pot-icon.faded::before,
.pot-icon.faded::after {
    opacity: 0.5;
}

.volume-info {
    padding: 1.5rem;
    text-align: left;
}

.volume-number {
    font-family: var(--font-display);
    font-size: 0.75rem;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.volume-info h3 {
    font-family: var(--font-display);
    color: var(--color-ink);
    font-size: 1.25rem;
    margin: 0.5rem 0;
}

.volume-info p {
    font-size: 0.95rem;
    color: var(--color-ink-light);
    margin-bottom: 1rem;
}

.read-btn {
    font-family: var(--font-display);
    background: var(--color-accent);
    color: var(--color-parchment);
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: background 0.3s ease;
    width: 100%;
}

.read-btn:hover:not(.disabled) {
    background: var(--color-accent-dark);
}

.read-btn.disabled {
    background: #999;
    cursor: not-allowed;
}

.landing-footer {
    margin-top: 4rem;
    color: var(--color-parchment-dark);
    font-style: italic;
    opacity: 0.7;
}

/* ============================================
   BOOK READER
   ============================================ */

.book-reader {
    min-height: 100vh;
    background: linear-gradient(135deg, #2c2416 0%, #1a1610 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
}

.back-to-library {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-family: var(--font-body);
    background: transparent;
    color: var(--color-parchment);
    border: 1px solid var(--color-parchment);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.back-to-library:hover {
    background: var(--color-parchment);
    color: var(--color-ink);
}

.book-container {
    perspective: 2000px;
    width: var(--book-width);
    height: var(--book-height);
}

.book {
    width: 100%;
    height: 100%;
    display: flex;
    position: relative;
    transform-style: preserve-3d;
    box-shadow:
        0 0 50px rgba(0, 0, 0, 0.5),
        0 0 100px rgba(0, 0, 0, 0.3);
}

.page {
    width: 50%;
    height: 100%;
    background: var(--color-parchment);
    position: relative;
    overflow: hidden;
}

.page-left {
    border-radius: 8px 0 0 8px;
    box-shadow:
        inset -10px 0 30px rgba(0, 0, 0, 0.1),
        -5px 0 15px rgba(0, 0, 0, 0.2);
}

.page-right {
    border-radius: 0 8px 8px 0;
    box-shadow:
        inset 10px 0 30px rgba(0, 0, 0, 0.05),
        5px 0 15px rgba(0, 0, 0, 0.2);
}

.page-content {
    height: 100%;
    padding: var(--page-padding);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevent scrollbars */
}

.page-inner {
    flex: 1;
    overflow: hidden; /* Ensure content stays within bounds */
    display: flex;
    flex-direction: column;
}

.page-number {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--color-ink-light);
    text-align: center;
    padding-top: 1rem;
    margin-top: auto;
}

/* Page Content Styles */
.page-cover {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.cover-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--color-accent-dark);
    margin-bottom: 1rem;
    letter-spacing: 0.1em;
}

.cover-subtitle {
    font-family: var(--font-body);
    font-size: 1.2rem;
    font-style: italic;
    color: var(--color-ink-light);
    margin-bottom: 2rem;
}

.cover-volume {
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--color-accent);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.cover-decoration {
    width: 100px;
    height: 100px;
    margin: 2rem auto;
    background: var(--color-copper);
    border-radius: 50% 50% 45% 45%;
    position: relative;
    box-shadow:
        inset -5px -5px 15px rgba(0, 0, 0, 0.3),
        0 5px 20px rgba(0, 0, 0, 0.2);
}

.page-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.title-main {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--color-ink);
    margin-bottom: 1rem;
}

.title-sub {
    font-style: italic;
    color: var(--color-ink-light);
    font-size: 1.1rem;
}

.page-credits {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 2rem;
}

.credits-item {
    margin-bottom: 2rem;
}

.credits-label {
    font-size: 0.85rem;
    color: var(--color-ink-light);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.credits-value {
    font-size: 1.1rem;
    font-style: italic;
}

.page-story {
    font-size: 0.95rem;
    line-height: 1.6;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

.page-story-text {
    flex-shrink: 0; /* Don't shrink text */
}

.page-story p {
    margin-bottom: 0.8rem;
    text-indent: 1.5em;
}

.page-story p:first-child {
    text-indent: 0;
}

.page-story p:first-child::first-letter {
    font-family: var(--font-display);
    font-size: 2.5rem;
    float: left;
    line-height: 1;
    padding-right: 0.4rem;
    color: var(--color-accent);
}

.story-sound {
    font-style: italic;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--color-ink-light);
}

.story-emphasis {
    font-style: italic;
}

.story-refrain {
    text-align: center;
    font-style: italic;
    margin: 1rem 0;
    color: var(--color-accent);
}

.page-story .dialogue {
    margin: 1rem 0;
}

/* Image Placeholder Styling */
.image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    padding: 0.5rem;
    background: var(--color-parchment);
    position: relative;
    /* Double border effect: 1px inner, 3px gap, 3px outer */
    border: 1px solid #000;
    outline: 3px solid #000;
    outline-offset: 3px;
}

.image-placeholder-text {
    font-family: var(--font-body);
    font-size: 0.65rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
}

.image-placeholder-desc {
    font-family: var(--font-body);
    font-size: 0.7rem;
    color: #888;
    font-style: italic;
    text-align: center;
    max-width: 95%;
    line-height: 1.3;
}

/* Cover page image placeholder */
.cover-image-placeholder {
    width: 150px;
    height: 150px;
    flex-shrink: 0;
    margin: 1rem auto;
}

/* Inline image placeholder - fills remaining space */
.inline-image-placeholder {
    flex: 1; /* Fill available space */
    min-height: 60px;
    max-height: none;
    width: 100%;
    margin: 0.5rem 0;
}

/* Image at top of page */
.image-position-top {
    order: -1;
    margin-top: 0;
    margin-bottom: 0.75rem;
}

/* Image in middle of page - text splits around it */
.image-position-middle {
    order: 0;
    margin: 0.5rem 0;
}

/* Image at bottom of page (default) */
.image-position-bottom {
    order: 1;
    margin-top: 0.75rem;
    margin-bottom: 0;
}

/* Moral page image */
.moral-image-placeholder {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    margin: 1rem auto;
}

.page-moral {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.moral-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--color-ink);
    line-height: 2;
}

/* Page Turn Animation Container */
.book {
    perspective: 2000px;
}

.page {
    transform-style: preserve-3d;
}

/* Page flip overlay - covers the page during animation */
.page-flip-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    transform-style: preserve-3d;
    z-index: 100;
}

/* The flipping page element */
.page-flip {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-origin: left center;
    transform-style: preserve-3d;
    opacity: 0;
    pointer-events: none;
}

.page-flip-front,
.page-flip-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background: var(--color-parchment);
    border-radius: 0 8px 8px 0;
    box-shadow:
        inset -15px 0 30px rgba(0, 0, 0, 0.1),
        inset 5px 0 10px rgba(255, 255, 255, 0.3);
    overflow: hidden;
    padding: var(--page-padding);
    display: flex;
    flex-direction: column;
}

.page-flip-back {
    transform: rotateY(180deg);
    border-radius: 8px 0 0 8px;
    box-shadow:
        inset 15px 0 30px rgba(0, 0, 0, 0.1),
        inset -5px 0 10px rgba(255, 255, 255, 0.3);
}

/* Forward page turn (next) - right page flips to the left */
.page-flip.turning-forward {
    opacity: 1;
    transform-origin: left center;
    animation: pageFlipForward 0.6s ease-in-out forwards;
}

@keyframes pageFlipForward {
    0% {
        transform: rotateY(0deg);
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    }
    30% {
        transform: rotateY(-15deg) translateZ(20px);
        box-shadow: -10px 10px 30px rgba(0, 0, 0, 0.4);
    }
    100% {
        transform: rotateY(-180deg);
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    }
}

/* Backward page turn (prev) - page flips from left to right */
.page-flip.turning-backward {
    opacity: 1;
    transform-origin: right center;
    animation: pageFlipBackward 0.6s ease-in-out forwards;
}

.page-flip.turning-backward .page-flip-front {
    border-radius: 8px 0 0 8px;
    box-shadow:
        inset 15px 0 30px rgba(0, 0, 0, 0.1),
        inset -5px 0 10px rgba(255, 255, 255, 0.3);
}

.page-flip.turning-backward .page-flip-back {
    border-radius: 0 8px 8px 0;
    box-shadow:
        inset -15px 0 30px rgba(0, 0, 0, 0.1),
        inset 5px 0 10px rgba(255, 255, 255, 0.3);
}

@keyframes pageFlipBackward {
    0% {
        transform: rotateY(0deg);
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    }
    30% {
        transform: rotateY(15deg) translateZ(20px);
        box-shadow: 10px 10px 30px rgba(0, 0, 0, 0.4);
    }
    100% {
        transform: rotateY(180deg);
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    }
}

/* Corner curl hint on hover */
.page-right::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    background: linear-gradient(135deg, transparent 50%, rgba(0, 0, 0, 0.05) 50%);
    transition: all 0.3s ease;
    pointer-events: none;
}

.page-right:hover::after {
    width: 40px;
    height: 40px;
    box-shadow: -2px -2px 5px rgba(0, 0, 0, 0.1);
}

.page-left::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 0;
    background: linear-gradient(-135deg, transparent 50%, rgba(0, 0, 0, 0.05) 50%);
    transition: all 0.3s ease;
    pointer-events: none;
}

.page-left:hover::after {
    width: 40px;
    height: 40px;
    box-shadow: 2px -2px 5px rgba(0, 0, 0, 0.1);
}

/* Page shadow during turn */
.page.flipping {
    z-index: 50;
}

.page-shadow {
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.2) 0%, transparent 20%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.page-shadow.visible {
    opacity: 1;
}

/* Navigation */
.book-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}

.nav-btn {
    font-family: var(--font-body);
    background: transparent;
    color: var(--color-parchment);
    border: 1px solid var(--color-parchment);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.nav-btn:hover:not(:disabled) {
    background: var(--color-parchment);
    color: var(--color-ink);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.nav-arrow {
    font-size: 1.5rem;
    line-height: 1;
}

.page-indicator {
    font-family: var(--font-body);
    color: var(--color-parchment);
    font-size: 0.9rem;
}

.progress-bar {
    width: var(--book-width);
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    margin-top: 1rem;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--color-gold);
    transition: width 0.3s ease;
    width: 0%;
}

/* ============================================
   MODALS (Recipe & Vocabulary)
   ============================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}

.modal-content {
    background: var(--color-parchment);
    max-width: 800px;
    max-height: 90vh;
    width: 100%;
    border-radius: 8px;
    position: relative;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-ink-light);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--color-ink);
}

/* Recipe Page */
.recipe-page {
    padding: 3rem;
}

.recipe-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--color-accent);
}

.recipe-title {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--color-accent-dark);
    margin-bottom: 0.5rem;
}

.recipe-subtitle {
    font-style: italic;
    color: var(--color-ink-light);
}

.recipe-intro {
    font-style: italic;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--color-ink-light);
}

.recipe-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.meta-item {
    text-align: center;
}

.meta-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-ink-light);
}

.meta-value {
    font-size: 1.1rem;
    color: var(--color-ink);
}

.recipe-section {
    margin-bottom: 2rem;
}

.recipe-section h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--color-accent);
    margin-bottom: 1rem;
}

.recipe-section ul,
.recipe-section ol {
    padding-left: 1.5rem;
}

.recipe-section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.recipe-closing {
    text-align: center;
    font-style: italic;
    padding-top: 2rem;
    border-top: 1px solid var(--color-ink-light);
    color: var(--color-accent);
    font-size: 1.1rem;
}

/* Vocabulary Page - In-book version */
.vocabulary-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.vocabulary-header {
    text-align: center;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.vocabulary-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--color-accent-dark);
    margin-bottom: 0.25rem;
}

.vocabulary-subtitle {
    font-style: italic;
    color: var(--color-ink-light);
    font-size: 0.85rem;
}

.character-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    overflow: hidden;
}

.character-card {
    padding: 0.5rem 0.75rem;
    background: rgba(139, 69, 19, 0.05);
    border-left: 3px solid var(--color-accent);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.character-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.character-name {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--color-accent-dark);
}

.character-pronunciation {
    font-style: italic;
    color: var(--color-ink-light);
    font-size: 0.75rem;
}

.character-definition {
    font-size: 0.8rem;
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

.character-example {
    font-size: 0.75rem;
    font-style: italic;
    color: var(--color-ink-light);
    line-height: 1.3;
}

.character-example::before {
    content: '"';
}

.character-example::after {
    content: '"';
}

/* Vocabulary Page - Modal version */
.vocabulary-page {
    padding: 3rem;
}

.vocabulary-page .vocabulary-title {
    font-size: 2rem;
}

.vocabulary-page .character-list {
    gap: 1.5rem;
}

.vocabulary-page .character-card {
    padding: 1.5rem;
    border-radius: 8px;
}

.vocabulary-page .character-name {
    font-size: 1.2rem;
}

.vocabulary-page .character-definition {
    font-size: 1rem;
}

.vocabulary-page .character-example {
    font-size: 0.95rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
}

.character-ingredient {
    font-size: 0.85rem;
    color: var(--color-copper);
    margin-bottom: 0.5rem;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.hidden {
    display: none !important;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Mobile - Single Page View */
@media (max-width: 768px) {
    :root {
        --book-width: 95vw;
        --book-height: 75vh;
        --page-padding: 1.5rem;
    }

    .book {
        flex-direction: column;
    }

    /* Show only left page on mobile (single page at a time) */
    .page-left {
        width: 100%;
        height: 100%;
        border-radius: 8px;
    }

    .page-right {
        display: none;
    }

    /* Mobile page flip adjustments */
    .page-flip {
        width: 100% !important;
        left: 0 !important;
    }

    .page-flip-front,
    .page-flip-back {
        border-radius: 8px;
    }

    /* Hide corner curl hints on mobile (touch interface) */
    .page-left::after,
    .page-right::after {
        display: none;
    }

    .volumes-grid {
        grid-template-columns: 1fr;
    }

    .nav-btn .nav-text {
        display: none;
    }

    .back-to-library {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .page-story p:first-child::first-letter {
        font-size: 2.5rem;
    }

    .modal-content {
        padding: 1.5rem;
        max-height: 95vh;
    }

    .recipe-meta {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    :root {
        --book-width: 90vw;
        --page-padding: 2rem;
    }
}

/* Print styles for recipe */
@media print {
    .modal-close,
    .back-to-library,
    .book-nav,
    .progress-bar {
        display: none;
    }

    .modal {
        position: static;
        background: white;
    }

    .modal-content {
        box-shadow: none;
        max-height: none;
    }
}

/* Keyboard navigation focus styles */
button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
