/* ========================================
   SQUISHED - Book Viewer Styles
   Three Themes: Playful, Minimal, Classic Book
   ======================================== */

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem 5rem 1rem;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* ========================================
   SITE HEADER
   ======================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.site-branding {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
}

.header-right {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-decoration: none;
    line-height: 1;
}

.site-subtitle {
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    opacity: 0.8;
}

.site-link {
    font-size: 0.75rem;
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.site-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
}

/* ========================================
   THEME SWITCHER
   ======================================== */
.theme-switcher {
    display: flex;
    gap: 0.5rem;
}

/* ========================================
   TEXT SIZE SWITCHER
   ======================================== */
.size-switcher {
    display: flex;
    gap: 0.25rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid rgba(0,0,0,0.1);
}

.size-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.size-btn[data-size="small"] {
    font-size: 0.7rem;
}

.size-btn[data-size="medium"] {
    font-size: 0.9rem;
}

.size-btn[data-size="large"] {
    font-size: 1.1rem;
}

.size-btn:hover {
    opacity: 1;
}

.size-btn.active {
    opacity: 1;
    transform: scale(1.1);
}

/* Size button theme styling */
.theme-minimal .size-btn {
    background: #e0eef3;
    color: #012A4A;
}

.theme-minimal .size-btn.active {
    background: #0086B6;
    color: white;
}

.theme-playful .size-btn {
    background: rgba(255,255,255,0.3);
    color: white;
}

.theme-playful .size-btn.active {
    background: white;
    color: #2980b9;
}

.theme-book .size-btn {
    background: rgba(255,255,255,0.2);
    color: #f5e6d3;
}

.theme-book .size-btn.active {
    background: #f5e6d3;
    color: #000080;
}

/* ========================================
   TEXT SIZE VARIATIONS
   ======================================== */
/* Small text */
body.size-small .story-page p {
    font-size: 0.95rem !important;
    line-height: 1.7 !important;
}

body.size-small .ending-page p,
body.size-small .author-note p {
    font-size: 0.95rem !important;
}

/* Medium text (default) - no override needed */

/* Large text */
body.size-large .story-page p {
    font-size: 1.35rem !important;
    line-height: 1.9 !important;
}

body.size-large .ending-page p,
body.size-large .author-note p {
    font-size: 1.25rem !important;
}

/* Playful theme size adjustments (starts bigger) */
body.size-small.theme-playful .story-page p {
    font-size: 1.1rem !important;
    line-height: 1.8 !important;
}

body.size-large.theme-playful .story-page p {
    font-size: 1.7rem !important;
    line-height: 2.1 !important;
}

/* ========================================
   START AGAIN BUTTON
   ======================================== */
.start-btn {
    padding: 0.5rem 0.7rem !important;
}

.nav-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.theme-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 2rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.theme-btn:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.theme-btn.active {
    opacity: 1;
    transform: scale(1.05);
}

/* ========================================
   BOOK CONTAINER
   ======================================== */
.book-container {
    width: 100%;
    max-width: 600px;
    display: flex;
    justify-content: center;
    perspective: 1500px;
}

.book {
    width: 100%;
    position: relative;
    min-height: 70vh;
    max-height: 80vh;
    transition: all 0.5s ease;
}

/* ========================================
   PAGES
   ======================================== */
.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 70vh;
    display: none;
    flex-direction: column;
    justify-content: center;
    padding: 2.5rem 2rem;
    overflow-y: hidden;
    transition: all 0.4s ease;
}

.page.active {
    display: flex;
}

.page-content {
    display: flex;
    flex-direction: column;
}

/* Title Page */
.title-page {
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 1rem;
}

.book-title {
    letter-spacing: 0.3em;
    margin-bottom: 0.5rem;
}

.title-divider {
    width: 100px;
    height: 2px;
    margin: 0.5rem 0;
}

.book-subtitle {
    letter-spacing: 0.15em;
    margin-bottom: 2rem;
}

.book-author {
    letter-spacing: 0.2em;
}

/* Story Pages */
.story-page {
    justify-content: flex-start;
    gap: 1.2rem;
}

.story-page p {
    text-align: justify;
    text-justify: inter-word;
}

/* Hidden paragraphs for pagination */
.story-page p.hidden-overflow {
    display: none;
}

.short-page {
    justify-content: center;
}

/* Continuation indicator */
.page-continuation {
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.6;
    padding-top: 1rem;
    font-style: italic;
}

.theme-playful .page-continuation {
    color: #2980b9;
    font-weight: 600;
}

/* Drop Cap */
.drop-cap::first-letter {
    float: left;
    font-size: 3.5em;
    line-height: 0.8;
    padding-right: 0.1em;
    margin-top: 0.05em;
}

/* Ending & Author Note Pages */
.ending-page,
.author-note {
    justify-content: center;
    gap: 1.5rem;
}

.section-title {
    text-align: center;
    letter-spacing: 0.2em;
    margin-bottom: 2rem;
}

.author-signature {
    margin-top: 2rem;
    text-align: center;
    font-style: italic;
}

/* Page Numbers - hidden as they conflict with screen-based navigation */
.page-number {
    display: none;
}

/* ========================================
   NAVIGATION
   ======================================== */
.navigation {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 3rem;
    z-index: 100;
    transition: all 0.3s ease;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 2rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.nav-btn:not(:disabled):hover {
    transform: scale(1.05);
}

.nav-arrow {
    font-size: 1.2rem;
}

.page-indicator {
    font-size: 0.9rem;
    min-width: 60px;
    text-align: center;
}

/* Swipe Hint */
.swipe-hint {
    position: fixed;
    bottom: 5rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.swipe-hint.visible {
    opacity: 0.8;
}

/* ========================================
   THEME: MINIMAL (Default)
   Clean, elegant, modern
   ======================================== */
.theme-minimal {
    background: linear-gradient(135deg, #f5f9fc 0%, #e8f1f5 100%);
    color: #012A4A;
    font-family: 'Merriweather', Georgia, serif;
}

/* Subtle background fish for minimal theme */
.subtle-fish {
    position: fixed;
    opacity: 0.15;
    z-index: 0;
    pointer-events: none;
    fill: #0086B6;
}

@keyframes subtleFishSwim {
    0%, 100% {
        transform: translateX(0) translateY(0);
    }
    25% {
        transform: translateX(60px) translateY(-25px);
    }
    50% {
        transform: translateX(100px) translateY(15px);
    }
    75% {
        transform: translateX(40px) translateY(-10px);
    }
}

/* Hide subtle fish when Playful theme is active (it has its own creatures) */
.theme-playful .subtle-fish {
    display: none;
}

.theme-minimal .theme-btn {
    background: #e0eef3;
    color: #012A4A;
}

.theme-minimal .theme-btn.active {
    background: #0086B6;
    color: white;
}

.theme-minimal .book {
    background: white;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0,134,182,0.15);
    border: 2px solid #0086B6;
}

.theme-minimal .page {
    background: white;
}

.theme-minimal .book-title {
    font-size: 2.5rem;
    font-weight: 400;
    color: #012A4A;
}

.theme-minimal .title-divider {
    background: linear-gradient(90deg, #0086B6, #D4A84B);
}

.theme-minimal .book-subtitle {
    font-size: 0.9rem;
    color: #0086B6;
    font-weight: 400;
}

.theme-minimal .book-author {
    font-size: 1rem;
    color: #012A4A;
    font-weight: 400;
}

.theme-minimal .story-page p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #012A4A;
}

.theme-minimal .drop-cap::first-letter {
    font-weight: 400;
    color: #0086B6;
}

.theme-minimal .section-title {
    font-size: 1.2rem;
    font-weight: 400;
    color: #444;
}

.theme-minimal .navigation {
    background: rgba(255,255,255,0.95);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.theme-minimal .nav-btn {
    background: #e0eef3;
    color: #012A4A;
}

.theme-minimal .nav-btn:not(:disabled):hover {
    background: #0086B6;
    color: white;
}

.theme-minimal .swipe-hint {
    background: rgba(0,0,0,0.7);
    color: white;
}

.theme-minimal .site-header {
    background: rgba(255,255,255,0.95);
    border-bottom: 1px solid rgba(0,134,182,0.2);
}

.theme-minimal .site-title {
    color: #012A4A;
    font-family: 'Merriweather', Georgia, serif;
}

.theme-minimal .site-subtitle {
    color: #0086B6;
}

.theme-minimal .site-link {
    color: #0086B6;
}

/* ========================================
   HIDE UNDERWATER ELEMENTS BY DEFAULT
   (Only visible in Playful theme)
   ======================================== */
.bubbles,
.sea-creatures,
.seaweed {
    display: none !important;
}

.theme-playful .bubbles,
.theme-playful .sea-creatures,
.theme-playful .seaweed {
    display: block !important;
}

/* ========================================
   THEME: PLAYFUL
   Underwater wonderland with sea creatures
   ======================================== */
.theme-playful {
    background: linear-gradient(180deg,
        #1a5276 0%,
        #2980b9 30%,
        #5dade2 60%,
        #85c1e9 80%,
        #a9dfbf 100%
    );
    color: #333;
    font-family: 'Nunito', sans-serif;
    overflow: hidden;
    position: relative;
}

/* Underwater light rays */
.theme-playful::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        repeating-linear-gradient(
            100deg,
            transparent,
            transparent 20px,
            rgba(255,255,255,0.03) 20px,
            rgba(255,255,255,0.03) 40px
        );
    animation: lightRays 20s linear infinite;
    pointer-events: none;
}

@keyframes lightRays {
    0% { transform: translateX(-10%) rotate(0deg); }
    100% { transform: translateX(10%) rotate(5deg); }
}

/* Bubbles container */
.theme-playful .bubbles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.theme-playful .bubble {
    position: absolute;
    bottom: -100px;
    background: radial-gradient(circle at 30% 30%,
        rgba(255,255,255,0.8),
        rgba(255,255,255,0.2) 50%,
        transparent 70%
    );
    border-radius: 50%;
    animation: bubbleRise linear infinite;
    opacity: 0.6;
}

@keyframes bubbleRise {
    0% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-50vh) translateX(20px) scale(1.1);
        opacity: 0.4;
    }
    100% {
        transform: translateY(-110vh) translateX(-10px) scale(0.8);
        opacity: 0;
    }
}

/* Sea creatures container */
.theme-playful .sea-creatures {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.theme-playful .creature {
    position: absolute;
    opacity: 0.15;
    filter: blur(1px);
}

/* Fish swimming */
.theme-playful .fish {
    animation: fishSwim linear infinite;
}

@keyframes fishSwim {
    0% {
        transform: translateX(-100px) translateY(0) scaleX(-1);
    }
    49% {
        transform: translateX(calc(100vw + 100px)) translateY(30px) scaleX(-1);
    }
    50% {
        transform: translateX(calc(100vw + 100px)) translateY(30px) scaleX(1);
    }
    100% {
        transform: translateX(-100px) translateY(0) scaleX(1);
    }
}

/* Jellyfish floating */
.theme-playful .jellyfish {
    animation: jellyfishFloat ease-in-out infinite;
}

@keyframes jellyfishFloat {
    0%, 100% {
        transform: translateY(0) rotate(-5deg);
    }
    50% {
        transform: translateY(-30px) rotate(5deg);
    }
}

/* Starfish on bottom */
.theme-playful .starfish {
    bottom: 5%;
    animation: starfishSway ease-in-out infinite;
}

@keyframes starfishSway {
    0%, 100% { transform: rotate(-10deg); }
    50% { transform: rotate(10deg); }
}

/* Seahorse bobbing */
.theme-playful .seahorse {
    animation: seahorseBob ease-in-out infinite;
}

@keyframes seahorseBob {
    0%, 100% {
        transform: translateY(0) rotate(-5deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

/* Octopus pulsing */
.theme-playful .octopus {
    animation: octopusPulse ease-in-out infinite;
}

@keyframes octopusPulse {
    0%, 100% {
        transform: scale(1) translateY(0);
        opacity: 0.15;
    }
    50% {
        transform: scale(1.1) translateY(-15px);
        opacity: 0.2;
    }
}

/* Seaweed swaying */
.theme-playful .seaweed {
    position: fixed;
    bottom: 0;
    width: 30px;
    height: 150px;
    background: linear-gradient(to top, #1e8449, #27ae60, #2ecc71);
    border-radius: 50% 50% 0 0;
    transform-origin: bottom center;
    animation: seaweedSway ease-in-out infinite;
    opacity: 0.3;
    z-index: 1;
}

@keyframes seaweedSway {
    0%, 100% { transform: rotate(-10deg) scaleY(1); }
    50% { transform: rotate(10deg) scaleY(1.05); }
}

/* Sandy bottom gradient overlay */
.theme-playful::after {
    content: '';
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top,
        rgba(194, 178, 128, 0.4) 0%,
        rgba(194, 178, 128, 0.2) 50%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 1;
}

.theme-playful .theme-btn {
    background: rgba(255,255,255,0.3);
    color: white;
    position: relative;
    z-index: 100;
}

.theme-playful .theme-btn.active {
    background: white;
    color: #2980b9;
}

.theme-playful .book-container {
    position: relative;
    z-index: 10;
}

.theme-playful .book {
    background: linear-gradient(180deg, #fffef5 0%, #fff9e6 100%);
    border-radius: 20px;
    box-shadow:
        0 20px 60px rgba(26, 82, 118, 0.4),
        0 0 0 8px rgba(255,255,255,0.3),
        inset 0 0 30px rgba(255,200,100,0.1);
    transform: rotate(-1deg);
    position: relative;
    z-index: 10;
}

.theme-playful .page {
    background: transparent;
}

.theme-playful .book-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: #1a5276;
    text-shadow: 3px 3px 0 #5dade2;
}

.theme-playful .title-divider {
    background: linear-gradient(90deg, #1a5276, #5dade2, #a9dfbf);
    height: 4px;
    border-radius: 2px;
}

.theme-playful .book-subtitle {
    font-size: 1.2rem;
    color: #2980b9;
    font-weight: 700;
}

.theme-playful .book-author {
    font-size: 1.3rem;
    color: #1a5276;
    font-weight: 700;
}

/* BIGGER TEXT FOR KIDS! */
.theme-playful .story-page p {
    font-size: 1.4rem;
    line-height: 2;
    color: #2c3e50;
}

.theme-playful .story-page {
    gap: 1.4rem;
}

.theme-playful .drop-cap::first-letter {
    font-weight: 800;
    color: #1a5276;
    text-shadow: 2px 2px 0 #5dade2;
    font-size: 4em;
}

.theme-playful .section-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #1a5276;
}

.theme-playful .ending-page p,
.theme-playful .author-note p {
    font-size: 1.3rem;
    line-height: 1.9;
}

.theme-playful .navigation {
    background: rgba(255,255,255,0.95);
    box-shadow: 0 8px 30px rgba(26, 82, 118, 0.3);
    border-radius: 3rem;
    position: relative;
    z-index: 100;
}

.theme-playful .nav-btn {
    background: linear-gradient(135deg, #2980b9, #1a5276);
    color: white;
    font-weight: 700;
}

.theme-playful .nav-btn:not(:disabled):hover {
    background: linear-gradient(135deg, #5dade2, #2980b9);
    box-shadow: 0 4px 15px rgba(41, 128, 185, 0.4);
}

.theme-playful .nav-btn:disabled {
    background: #bdc3c7;
    color: #7f8c8d;
}

.theme-playful .page-indicator {
    color: #1a5276;
    font-weight: 700;
}

.theme-playful .page-number {
    color: #2980b9;
    font-weight: 700;
    font-size: 1rem;
}

.theme-playful .swipe-hint {
    background: linear-gradient(135deg, #2980b9, #1a5276);
    color: white;
    z-index: 100;
}

.theme-playful .site-header {
    background: rgba(26, 82, 118, 0.8);
}

.theme-playful .site-title {
    color: white;
    font-family: 'Nunito', sans-serif;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}

.theme-playful .site-subtitle {
    color: rgba(255,255,255,0.9);
}

.theme-playful .site-link {
    color: rgba(255,255,255,0.8);
}

/* ========================================
   THEME: BOOK (Classic PPT)
   Glorious late 90s PowerPoint aesthetic
   ======================================== */
.theme-book {
    background: linear-gradient(180deg,
        #1a365d 0%,
        #2c5282 40%,
        #4a7ab0 100%
    );
    color: #1a365d;
    font-family: 'Comic Neue', 'Comic Sans MS', cursive, sans-serif;
}

/* Subtle top accent bar */
.theme-book::before {
    content: '';
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2c5282, #4a7ab0, #63b3ed, #4a7ab0, #2c5282);
    z-index: 50;
}

.theme-book .theme-btn {
    background: #e2e8f0;
    color: #1a365d;
    border: 1px solid #a0aec0;
    border-radius: 3px;
    font-family: 'Comic Neue', 'Comic Sans MS', cursive;
}

.theme-book .theme-btn:hover {
    background: #cbd5e0;
}

.theme-book .theme-btn.active {
    background: #2c5282;
    color: white;
    border: 1px solid #1a365d;
}

.theme-book .book {
    background: white;
    border-radius: 4px;
    border: 2px solid #2c5282;
    box-shadow:
        4px 4px 0 rgba(26, 54, 93, 0.3),
        0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* Subtle corner accents */
.theme-book .book::before {
    content: '◆';
    position: absolute;
    top: 8px;
    left: 10px;
    font-size: 12px;
    color: #4a7ab0;
    z-index: 5;
}

.theme-book .book::after {
    content: '◆';
    position: absolute;
    bottom: 8px;
    right: 10px;
    font-size: 12px;
    color: #4a7ab0;
    z-index: 5;
}

.theme-book .page {
    background: white;
    padding: 2.5rem 2rem;
}

.theme-book .book-title {
    font-size: 3rem;
    font-weight: 700;
    color: #1a365d;
    letter-spacing: 0.05em;
    text-shadow: 1px 1px 0 #e2e8f0;
    font-family: 'Comic Neue', 'Comic Sans MS', cursive;
}

.theme-book .title-divider {
    background: linear-gradient(90deg, #2c5282, #4a7ab0, #63b3ed, #4a7ab0, #2c5282);
    height: 3px;
    width: 180px;
    border-radius: 2px;
}

.theme-book .book-subtitle {
    font-size: 1.1rem;
    color: #4a7ab0;
    font-weight: 700;
    letter-spacing: 0.05em;
    font-style: normal;
}

.theme-book .book-author {
    font-size: 1.3rem;
    color: #2c5282;
    letter-spacing: 0.1em;
    font-weight: 700;
}

.theme-book .story-page p {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #000080;
}

.theme-book .story-page {
    text-align: left;
}

.theme-book .story-page p {
    text-align: left;
}

/* Bullet point style drop cap */
.theme-book .drop-cap::first-letter {
    font-weight: 700;
    color: #ff0000;
    font-size: 3.5em;
    text-shadow: 2px 2px 0 #ffd700;
}

.theme-book .section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #000080;
    letter-spacing: 0.1em;
    text-shadow: 1px 1px 0 #87ceeb;
}

.theme-book .page-continuation {
    color: #4169e1;
    font-weight: 700;
}

.theme-book .navigation {
    background: #c0c0c0;
    border: 3px outset #ffffff;
    border-radius: 0;
    box-shadow: 4px 4px 0 #808080;
}

.theme-book .nav-btn {
    background: #e2e8f0;
    color: #1a365d;
    font-family: 'Comic Neue', 'Comic Sans MS', cursive;
    font-weight: 700;
    border: 1px solid #a0aec0;
    border-radius: 4px;
}

.theme-book .nav-btn:not(:disabled):hover {
    background: #2c5282;
    color: white;
}

.theme-book .nav-btn:disabled {
    background: #e2e8f0;
    color: #a0aec0;
}

.theme-book .page-indicator {
    color: white;
    font-weight: 700;
}

.theme-book .page-number {
    color: #e2e8f0;
    font-weight: 700;
    font-style: normal;
}

.theme-book .swipe-hint {
    background: #2c5282;
    color: white;
    border: 1px solid #4a7ab0;
    border-radius: 4px;
}

.theme-book .site-header {
    background: linear-gradient(90deg, #1a365d, #2c5282);
    border-bottom: 1px solid #4a7ab0;
}

.theme-book .site-title {
    color: white;
    font-family: 'Comic Neue', 'Comic Sans MS', cursive;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}

.theme-book .site-subtitle {
    color: #a0d8ef;
}

.theme-book .site-link {
    color: #a0d8ef;
    text-decoration: none;
}

.theme-book .site-link:hover {
    color: white;
}

/* ========================================
   RESPONSIVE STYLES
   ======================================== */
@media (max-width: 768px) {
    body {
        padding: 3.5rem 0.5rem 5rem 0.5rem;
    }

    .site-header {
        padding: 0.5rem;
    }

    .site-title {
        font-size: 1.2rem;
    }

    .site-subtitle {
        font-size: 0.6rem;
    }

    .site-link {
        font-size: 0.65rem;
    }

    .theme-switcher {
        gap: 0.25rem;
    }

    .theme-btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.65rem;
    }

    .book-container {
        max-width: 100%;
    }

    .book {
        min-height: 70vh;
        max-height: 75vh;
    }

    .page {
        padding: 1.5rem 1.25rem;
        min-height: 70vh;
    }

    .book-title {
        font-size: 2rem !important;
    }

    .story-page p {
        font-size: 1rem !important;
        line-height: 1.7 !important;
    }

    /* Keep playful text bigger on tablets */
    .theme-playful .story-page p {
        font-size: 1.25rem !important;
        line-height: 1.9 !important;
    }

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

    .navigation {
        bottom: 1rem;
        padding: 0.5rem 1rem;
        gap: 1rem;
    }

    .nav-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    .nav-text {
        display: none;
    }

    .swipe-hint {
        bottom: 4rem;
    }

    /* Classic PPT theme adjustments */
    .theme-book .book::before {
        font-size: 16px;
        top: 5px;
        left: 5px;
    }

    .theme-book .book::after {
        font-size: 16px;
        bottom: 5px;
        right: 5px;
    }

    /* Hide some underwater elements on smaller screens */
    .theme-playful .seaweed:nth-child(n+4) {
        display: none;
    }
}

@media (max-width: 480px) {
    body {
        padding: 3rem 0.5rem 4.5rem 0.5rem;
    }

    .site-header {
        flex-direction: column;
        gap: 0.3rem;
        align-items: center;
    }

    .site-branding {
        align-items: center;
        text-align: center;
    }

    .header-right {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }

    .site-title {
        font-size: 1rem;
    }

    .page {
        padding: 1.25rem 1rem;
    }

    .book-title {
        font-size: 1.7rem !important;
        letter-spacing: 0.2em !important;
    }

    .story-page p {
        font-size: 0.95rem !important;
    }

    /* Keep playful text readable but slightly smaller on phones */
    .theme-playful .story-page p {
        font-size: 1.15rem !important;
        line-height: 1.85 !important;
    }

    .theme-playful .book {
        transform: none;
        border-radius: 15px;
    }

    /* Simplify underwater on mobile for performance */
    .theme-playful .bubble:nth-child(n+10) {
        display: none;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes pageFlip {
    0% {
        transform: rotateY(0deg);
        opacity: 1;
    }
    50% {
        transform: rotateY(-90deg);
        opacity: 0.5;
    }
    100% {
        transform: rotateY(0deg);
        opacity: 1;
    }
}

.page.flipping {
    animation: pageFlip 0.4s ease-in-out;
}

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

.page.active .page-content {
    animation: fadeIn 0.4s ease-out;
}

/* Theme transition */
.book,
.page,
.navigation,
.theme-btn {
    transition: all 0.5s ease;
}

/* Hover effects for touch hint */
@media (hover: none) {
    .swipe-hint.visible {
        opacity: 0.9;
    }
}

/* Print styles */
@media print {
    .theme-switcher,
    .navigation,
    .swipe-hint {
        display: none !important;
    }

    .page {
        page-break-after: always;
        display: block !important;
        position: relative !important;
    }
}
