:root {
    --paper: #f4f1ea;       /* Warm, aged book paper */
    --ink: #2b2b2b;         /* Soft black ink */
    --ink-light: #5a5a5a;   /* Muted ink for secondary text */
    --accent: #8c1c13;      /* Deep, classic book red */
    --font-book: 'Cormorant Garamond', serif;
    --app-height: 100dvh;
}

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

body {
    background:
        radial-gradient(circle at 20% 10%, #d8cbb7 0%, transparent 35%),
        radial-gradient(circle at 80% 80%, #c9baa2 0%, transparent 40%),
        #b9a78d;
    color: var(--ink);
    font-family: var(--font-book);
    font-size: 21px;
    line-height: 1.8;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    min-height: var(--app-height);
    overflow: hidden;
}

/* Birthday scene behind the book */
.party-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.balloon-layer,
.confetti-layer,
.cake-layer {
    position: absolute;
    inset: 0;
}

.balloon-layer-a {
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 900'%3E%3Cg fill='none' stroke-linecap='round'%3E%3Cellipse cx='100' cy='160' rx='38' ry='52' fill='%23f9a8d4' fill-opacity='.78'/%3E%3Cpath d='M100 210 C91 260 113 310 98 380' stroke='%237a6757' stroke-opacity='.58' stroke-width='2.2'/%3E%3Cellipse cx='260' cy='120' rx='34' ry='48' fill='%23fde047' fill-opacity='.74'/%3E%3Cpath d='M260 168 C271 220 246 273 261 344' stroke='%237a6757' stroke-opacity='.58' stroke-width='2.2'/%3E%3Cellipse cx='1040' cy='165' rx='39' ry='52' fill='%237dd3fc' fill-opacity='.76'/%3E%3Cpath d='M1040 216 C1053 266 1026 320 1042 392' stroke='%237a6757' stroke-opacity='.58' stroke-width='2.2'/%3E%3Cellipse cx='1115' cy='760' rx='36' ry='50' fill='%23c4b5fd' fill-opacity='.76'/%3E%3Cpath d='M1115 810 C1098 859 1130 900 1110 940' stroke='%237a6757' stroke-opacity='.58' stroke-width='2.2'/%3E%3Cellipse cx='150' cy='760' rx='38' ry='51' fill='%23a7f3d0' fill-opacity='.74'/%3E%3Cpath d='M150 810 C162 858 135 900 150 940' stroke='%237a6757' stroke-opacity='.58' stroke-width='2.2'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 1200px 900px;
    opacity: 0.88;
    animation: balloonsRiseA 16s linear infinite, balloonSwayA 6.5s ease-in-out infinite alternate;
}

.balloon-layer-b {
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 900'%3E%3Cg fill='none' stroke-linecap='round'%3E%3Cellipse cx='360' cy='82' rx='30' ry='43' fill='%23fecaca' fill-opacity='.7'/%3E%3Cpath d='M360 125 C350 176 372 215 356 286' stroke='%237a6757' stroke-opacity='.52' stroke-width='2'/%3E%3Cellipse cx='860' cy='88' rx='31' ry='44' fill='%23bfdbfe' fill-opacity='.7'/%3E%3Cpath d='M860 132 C873 179 845 223 862 292' stroke='%237a6757' stroke-opacity='.52' stroke-width='2'/%3E%3Cellipse cx='430' cy='828' rx='30' ry='43' fill='%23fcd34d' fill-opacity='.68'/%3E%3Cpath d='M430 868 C446 906 420 938 432 980' stroke='%237a6757' stroke-opacity='.5' stroke-width='2'/%3E%3Cellipse cx='820' cy='834' rx='30' ry='43' fill='%2386efac' fill-opacity='.68'/%3E%3Cpath d='M820 874 C808 913 833 946 818 980' stroke='%237a6757' stroke-opacity='.5' stroke-width='2'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 1200px 900px;
    opacity: 0.8;
    animation: balloonsRiseB 19s linear infinite, balloonSwayB 7.2s ease-in-out infinite alternate;
}

.confetti-layer {
    background-image:
        radial-gradient(circle at 18% 35%, rgba(239, 68, 68, 0.48) 0 4px, transparent 5px),
        radial-gradient(circle at 26% 28%, rgba(59, 130, 246, 0.48) 0 3px, transparent 4px),
        radial-gradient(circle at 82% 40%, rgba(16, 185, 129, 0.48) 0 4px, transparent 5px),
        radial-gradient(circle at 74% 33%, rgba(245, 158, 11, 0.48) 0 3px, transparent 4px),
        radial-gradient(circle at 12% 62%, rgba(236, 72, 153, 0.48) 0 4px, transparent 5px),
        radial-gradient(circle at 88% 66%, rgba(139, 92, 246, 0.48) 0 4px, transparent 5px);
    animation: confettiDrift 6s linear infinite;
}

.cake-layer {
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 900'%3E%3Cg opacity='.3'%3E%3Cpath d='M110 720 h120 v24 h16 v68 h-152 v-68 h16z' fill='%23f6d28b'/%3E%3Crect x='165' y='686' width='10' height='30' rx='3' fill='%23ffd166'/%3E%3Ccircle cx='170' cy='682' r='7' fill='%23f97316'/%3E%3Cpath d='M980 190 h120 v24 h16 v68 h-152 v-68 h16z' fill='%23f3ddb3'/%3E%3Crect x='1035' y='156' width='10' height='30' rx='3' fill='%23fde68a'/%3E%3Ccircle cx='1040' cy='152' r='7' fill='%23ef4444'/%3E%3Cpath d='M530 80 h120 v24 h16 v68 h-152 v-68 h16z' fill='%23e8d4a2'/%3E%3Crect x='585' y='46' width='10' height='30' rx='3' fill='%23fcd34d'/%3E%3Ccircle cx='590' cy='42' r='7' fill='%23fb7185'/%3E%3C/g%3E%3C/svg%3E");
    background-size: cover;
    background-position: center;
    animation: cakePulse 4.8s ease-in-out infinite;
}

.party-bg::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(circle at center, transparent 10%, rgba(113, 84, 42, 0.14) 100%);
}

@keyframes balloonsRiseA {
    0% { background-position: 0 0; }
    100% { background-position: 0 -900px; }
}

@keyframes balloonsRiseB {
    0% { background-position: 0 0; }
    100% { background-position: 0 -900px; }
}

@keyframes balloonSwayA {
    0% { transform: translateX(-8px); }
    100% { transform: translateX(10px); }
}

@keyframes balloonSwayB {
    0% { transform: translateX(8px); }
    100% { transform: translateX(-10px); }
}

@keyframes confettiDrift {
    0% { transform: translateY(0) translateX(0); opacity: 0.65; }
    50% { transform: translateY(8px) translateX(4px); opacity: 0.85; }
    100% { transform: translateY(16px) translateX(-3px); opacity: 0.65; }
}

@keyframes cakePulse {
    0%, 100% { transform: scale(1); opacity: 0.95; }
    50% { transform: scale(1.02); opacity: 1; }
}

/* Subtle paper texture overlay */
.page-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.4;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    mix-blend-mode: multiply;
}

.book-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 2rem 8rem;
    position: relative;
    z-index: 3;
}

body.paged-book .book-container {
    max-width: none;
    width: 100%;
    height: var(--app-height);
    min-height: var(--app-height);
    padding: 0;
    overflow: hidden;
    background: transparent;
    border: none;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-stage {
    width: 100vw;
    height: var(--app-height);
    margin: 0;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-shadow {
    position: absolute;
    inset: auto 3% -10px 3%;
    height: 30px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.05) 65%, transparent 100%);
    filter: blur(7px);
    z-index: 0;
}

.chapter {
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6rem 0;
    opacity: 1;
    transform: none;
}

.content-wrapper {
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

.text-center {
    text-align: center;
}

/* Typography */
h1.title {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 500;
    letter-spacing: 0.05em;
    margin: 1rem 0;
    font-style: italic;
}

.subtitle {
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--ink-light);
}

.divider {
    width: 40px;
    height: 1px;
    background-color: var(--ink);
    margin: 2rem auto;
    transform: scaleX(0.4);
    transform-origin: center;
    transition: transform 1s ease;
}

.poem {
    font-size: 1.4rem;
    font-style: italic;
    line-height: 2;
    color: var(--ink-light);
}

.title-page.visible .divider {
    transform: scaleX(1);
}

.title-page .title,
.title-page .subtitle,
.title-page .poem {
    opacity: 1;
    transform: none;
    transition: none;
}

#flipbook {
    width: 100%;
    height: 100%;
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
}

#flipbook .chapter {
    min-height: auto;
    height: 100%;
    margin: 0;
    padding: 1.2rem 1.3rem 2.1rem;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(250, 245, 236, 0.95), rgba(242, 233, 216, 0.94));
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.cover-page {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 22% 16%, rgba(255, 245, 225, 0.5), transparent 46%),
        radial-gradient(circle at 78% 82%, rgba(255, 220, 220, 0.26), transparent 44%),
        linear-gradient(180deg, rgba(250, 243, 230, 0.98), rgba(242, 231, 212, 0.96));
    border: 1px solid rgba(114, 79, 39, 0.18);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.42),
        inset 0 0 48px rgba(173, 131, 69, 0.12);
}

.cover-page::before {
    content: "";
    position: absolute;
    inset: 0.8rem;
    border: 1px solid rgba(142, 106, 57, 0.22);
    border-radius: 8px;
    pointer-events: none;
    z-index: -1;
}

.cover-page::after {
    content: "Happy Birthday";
    position: absolute;
    top: 0.55rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(0.8rem, 1.7vw, 1rem);
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: rgba(120, 79, 35, 0.78);
    font-weight: 500;
}

.cover-page .content-wrapper {
    max-width: 620px;
    text-align: center;
    flex: 0 0 auto;
    max-height: 46%;
    overflow: hidden;
    margin-top: 2.1rem;
}

.cover-page .title {
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
    margin-top: 0.6rem;
    color: #443020;
}

.cover-page .subtitle {
    color: rgba(110, 75, 38, 0.78);
    letter-spacing: 0.23em;
}

.cover-page .cover-kicker {
    margin-top: 0.2rem;
    margin-bottom: 0.25rem;
    font-size: clamp(0.82rem, 1.8vw, 1rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(128, 88, 42, 0.75);
    font-weight: 500;
}

.cover-page .poem {
    font-size: clamp(1.2rem, 2.4vw, 1.45rem);
    color: #5e4d3d;
    max-width: 560px;
    margin: 0 auto;
}

.cover-page .hero-image {
    margin-top: 1rem;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 0;
    flex: 1 1 auto;
    max-height: 52%;
    overflow: hidden;
}

.cover-page .hero-image img {
    width: auto;
    max-width: min(84%, 460px);
    max-height: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    padding: 10px;
    filter: sepia(0.18) contrast(1.06) saturate(1.03);
    box-shadow:
        0 9px 24px rgba(83, 58, 24, 0.16),
        inset 0 0 0 1px rgba(255, 255, 255, 0.28);
    margin-inline: auto;
}

body.paged-book #flipbook {
    width: 100%;
    height: var(--app-height);
    max-height: var(--app-height);
    filter: drop-shadow(0 18px 28px rgba(40, 26, 8, 0.22));
}

body.paged-book #flipbook .stf__parent,
body.paged-book #flipbook .stf__wrapper {
    width: 100% !important;
    height: 100% !important;
}

body.paged-book #flipbook .stf__block {
    background: transparent !important;
}

body.paged-book #flipbook .stf__item {
    background: linear-gradient(180deg, rgba(248, 240, 226, 0.92), rgba(242, 231, 212, 0.93)) !important;
}

body.paged-book #flipbook .stf__item.--left {
    box-shadow: inset -14px 0 22px rgba(82, 58, 29, 0.08);
}

body.paged-book #flipbook .stf__item.--right {
    box-shadow: inset 14px 0 22px rgba(82, 58, 29, 0.08);
}

.dedication-page {
    min-height: 85vh;
}

.dedication-text {
    max-width: 640px;
    margin: 0 auto;
}

.signature-figure {
    margin-top: 2.5rem;
    display: flex;
    justify-content: center;
}

.signature-image {
    width: min(340px, 72vw);
    height: auto;
    opacity: 0.88;
    filter: sepia(0.28) contrast(1.08);
    transform-origin: left center;
}

.signature-image.draw {
    animation: drawSignature 3.2s ease forwards;
}

@keyframes drawSignature {
    0% {
        opacity: 0.35;
        clip-path: inset(0 100% 0 0);
        transform: translateY(4px);
    }
    100% {
        opacity: 0.9;
        clip-path: inset(0 0 0 0);
        transform: translateY(0);
    }
}

.chapter-number {
    display: none;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    margin-bottom: 0.5rem;
    text-align: center;
}

.chapter-title {
    font-size: 2.5rem;
    font-weight: 400;
    text-align: center;
    margin-bottom: 3rem;
    line-height: 1.2;
}

.prose p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

/* Classic Drop Cap */
.drop-cap::first-letter {
    float: left;
    font-size: 4.5rem;
    line-height: 0.8;
    padding-top: 0.2rem;
    padding-right: 0.5rem;
    padding-left: 0.1rem;
    font-weight: 400;
    color: var(--ink);
    font-style: normal;
}

/* Images styled as book plates */
.hero-image {
    margin-top: 4rem;
    width: 100%;
    display: flex;
    justify-content: center;
}

.hero-image img {
    width: 100%;
    max-width: 400px;
    height: auto;
    filter: sepia(0.3) contrast(1.1) grayscale(0.2);
    border: 1px solid rgba(0,0,0,0.1);
    padding: 10px;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 1.2s ease;
    will-change: transform;
}

.chapter-image {
    margin: 4rem 0;
    display: flex;
    flex-direction: column;
}

.chapter-image.right-align {
    align-items: flex-end;
}

.chapter-image.left-align {
    align-items: flex-start;
}

.chapter-image.center-align {
    align-items: center;
}

.chapter-image img {
    max-width: 80%;
    height: auto;
    filter: grayscale(100%) contrast(1.2);
    transition: filter 0.8s ease, transform 1.1s ease;
    border: 1px solid rgba(0,0,0,0.1);
    padding: 8px;
    background: #fff;
    will-change: transform;
}

.chapter-image img:hover {
    filter: grayscale(0%) contrast(1.1);
    transform: translateY(-4px);
}

/* Keep mobile swipes focused on page turning, not image drag/selection. */
#flipbook img,
#flipbook figure {
    -webkit-user-drag: none;
    user-select: none;
}

.auto-even-image {
    margin-top: 0;
    margin-bottom: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auto-even-image img {
    width: min(94%, 960px);
    max-height: calc(100dvh - 11rem);
    object-fit: contain;
}

.image-only-page {
    justify-content: center;
    align-items: center;
    padding: 0.6rem !important;
}

.image-only-page .chapter-image {
    width: 100%;
    margin: 0;
    align-items: center !important;
}

figcaption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    font-style: italic;
    color: var(--ink-light);
    letter-spacing: 0.05em;
}

/* Reassurance Button / Hidden Section */
.envelope-section {
    min-height: 60vh;
}

.wax-seal-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--font-book);
    font-size: 1.3rem;
    font-style: italic;
    color: var(--ink);
    border-bottom: 1px solid var(--ink);
    padding-bottom: 5px;
    transition: color 0.3s, border-color 0.3s;
}

.wax-seal-btn:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.hidden-message {
    margin-top: 3rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 1s ease, transform 1s ease;
    height: 0;
    overflow: hidden;
}

.hidden-message.open {
    opacity: 1;
    transform: translateY(0);
    height: auto;
    padding: 2rem 0;
}

.hidden-message p {
    font-size: 1.5rem;
    font-style: italic;
    color: var(--accent);
    line-height: 1.6;
}

/* Footer */
.book-footer {
    padding: 6rem 0 2rem;
    border-top: 1px solid rgba(0,0,0,0.1);
}

body.paged-book .book-footer {
    border-top: none;
    padding: 1.2rem;
}

.page-controls {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 1rem;
    z-index: 12;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.5rem 0.7rem;
    background: rgba(247, 240, 227, 0.75);
    border: 1px solid rgba(79, 56, 24, 0.2);
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(47, 33, 13, 0.12);
}

.page-btn {
    border: 1px solid rgba(59, 39, 13, 0.25);
    background: #fff9ef;
    color: #4a3420;
    border-radius: 999px;
    font-family: var(--font-book);
    font-size: 0.95rem;
    padding: 0.28rem 0.9rem;
    cursor: pointer;
}

.page-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.page-counter {
    font-size: 0.95rem;
    color: #4a3420;
    min-width: 90px;
    text-align: center;
}

.sign-off {
    font-size: 1.8rem;
    font-style: italic;
    margin-bottom: 0.5rem;
}

.date {
    font-size: 1rem;
    letter-spacing: 0.1em;
    color: var(--ink-light);
    margin-bottom: 2rem;
}

.ps {
    font-size: 1.4rem;
    font-style: italic;
    color: var(--accent);
}

/* Page Indicator */
.page-number {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    font-family: var(--font-book);
    font-size: 1.1rem;
    color: var(--ink-light);
    font-style: italic;
    z-index: 50;
    opacity: 0;
    transition: opacity 0.5s;
}

.page-number.visible {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .chapter,
    .title-page .title,
    .title-page .subtitle,
    .title-page .poem,
    .divider,
    .hero-image img,
    .chapter-image img,
    .signature-image {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 18px;
    }
    
    .book-container {
        padding: 1.25rem 1rem 5rem;
    }

    body.paged-book .book-container {
        padding: 0;
    }

    body.paged-book #flipbook {
        height: var(--app-height);
        max-height: var(--app-height);
    }

    .book-stage {
        width: 100vw;
        margin: 0;
    }

    .cover-page .hero-image img {
        max-width: min(90vw, 320px);
        max-height: 100%;
        padding: 8px;
    }

    .cover-page .poem {
        font-size: 1.12rem;
        line-height: 1.65;
    }

    .cover-page .cover-kicker {
        font-size: 0.74rem;
        letter-spacing: 0.1em;
    }

    .cover-page::after {
        top: 0.35rem;
        letter-spacing: 0.18em;
        font-size: 0.74rem;
    }

    .cover-page .content-wrapper {
        margin-top: 1.6rem;
    }

    .chapter {
        min-height: auto;
        padding: 2.2rem 0;
        transform: none;
    }

    #flipbook .chapter {
        padding: 0.85rem 0.85rem 1.3rem;
        border-radius: 8px;
    }

    h1.title {
        font-size: clamp(2.3rem, 11vw, 3.2rem);
        letter-spacing: 0.02em;
        margin: 0.6rem 0;
    }

    .subtitle {
        font-size: 0.95rem;
        letter-spacing: 0.14em;
    }

    .poem {
        font-size: 1.15rem;
        line-height: 1.7;
    }

    .chapter-number {
        font-size: 0.85rem;
        letter-spacing: 0.1em;
    }

    .chapter-title {
        font-size: clamp(1.7rem, 8.5vw, 2.2rem);
        margin-bottom: 1.7rem;
    }

    .content-wrapper {
        max-width: 100%;
    }

    .prose p {
        text-align: left;
        margin-bottom: 1rem;
        line-height: 1.7;
    }

    .drop-cap::first-letter {
        font-size: 3.3rem;
        line-height: 0.9;
        padding-right: 0.35rem;
    }

    .hero-image {
        margin-top: 2rem;
    }

    .hero-image img {
        max-width: 100%;
        width: min(90vw, 330px);
        padding: 6px;
    }

    .chapter-image {
        margin: 2.2rem 0 0;
    }

    .chapter-image.right-align,
    .chapter-image.left-align,
    .chapter-image.center-align {
        align-items: center;
    }
    
    .chapter-image img {
        max-width: 100%;
        width: min(90vw, 360px);
        padding: 5px;
    }
    
    figcaption {
        font-size: 0.82rem;
        text-align: center;
    }

    .dedication-text {
        max-width: 100%;
    }
    
    .page-number {
        bottom: 0.75rem;
        right: 0.85rem;
        font-size: 0.95rem;
    }

    .page-controls {
        bottom: 0.5rem;
        width: calc(100% - 1.2rem);
        justify-content: space-between;
        border-radius: 12px;
    }

    .signature-image {
        width: min(220px, 72vw);
    }

    .wax-seal-btn {
        font-size: 1.1rem;
    }

    .hidden-message {
        margin-top: 1.6rem;
    }

    .hidden-message p {
        font-size: 1.2rem;
        line-height: 1.5;
    }

    .book-footer {
        padding-top: 4rem;
    }
}

@media (max-width: 420px) {
    .book-container {
        padding-left: 0.8rem;
        padding-right: 0.8rem;
    }

    .chapter {
        padding: 1.8rem 0;
    }

    #flipbook .chapter {
        padding: 0.72rem 0.72rem 1.1rem;
    }

    h1.title {
        font-size: 2.15rem;
    }

    .chapter-title {
        font-size: 1.55rem;
    }

    .poem {
        font-size: 1.05rem;
    }

    .drop-cap::first-letter {
        font-size: 3rem;
    }
}