/* 
   Sparkle Stories Studio - Stylesheet
   Friendly, playful, professional design for a children's book studio.
*/

:root {
    --primary-color: #FF6B6B;
    --primary-hover: #E85D5D;
    --secondary-color: #48DBFB;
    --secondary-hover: #0ABDE3;
    --buy-color: #27AE60;
    --buy-hover: #219653;
    --bg-color: #F8FAFF;
    --card-bg: #FFFFFF;
    --text-color: #2C3A47;
    --text-secondary: #576574;
    --text-faint: #8395a7;
    --footer-bg: #2C3A47;
    --footer-text: #c8d6e5;
    --border-color: #e8ecf1;
    --container-width: 820px;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 28px;
}

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

/* ==========================================
   ANIMATIONS
   ========================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3 {
    font-family: 'Fredoka', sans-serif;
    color: var(--text-color);
    line-height: 1.3;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style-position: inside;
}

img {
    max-width: 100%;
    height: auto;
}

/* Layout */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.25rem;
    width: 100%;
}

main {
    flex: 1;
    padding: 2.5rem 0;
    animation: fadeIn 0.5s ease-out;
}

/* Header */
header {
    background-color: var(--card-bg);
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 0;
}

.logo a {
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-img {
    height: 36px;
    width: auto;
    display: block;
    border-radius: 4px;
}

nav {
    display: flex;
    gap: 1.25rem;
}

nav a {
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.95rem;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

nav a.active,
nav a:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-lg);
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.25s ease, background-color 0.2s, box-shadow 0.3s ease;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.3);
}

.btn-buy:hover {
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.3);
}

.btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-buy {
    background-color: var(--buy-color);
    color: white;
}

.btn-buy:hover {
    background-color: var(--buy-hover);
}

.btn-outline {
    background-color: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-outline:hover {
    border-color: var(--text-secondary);
    color: var(--text-color);
}

.btn-outline:disabled {
    color: var(--text-faint);
    border-color: var(--border-color);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-large {
    font-size: 1.15rem;
    padding: 0.9rem 2.25rem;
    min-width: 200px;
}

/* ==========================================
   LIBRARY HOMEPAGE
   ========================================== */
.library-page {
    padding: 0;
}

.library-hero {
    background: linear-gradient(170deg, #FFF5F5 0%, #F0F4FF 50%, #E8FFF0 100%);
    padding: 2.5rem 0 2rem;
    text-align: center;
}

.library-logo {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
    animation: fadeInUp 0.5s ease-out both;
}

.library-title {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    animation: fadeInUp 0.5s 0.05s ease-out both;
}

.library-tagline {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.5s 0.1s ease-out both;
}

.library-ages {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--secondary-color);
    letter-spacing: 0.02em;
}

.parent-trust {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.25rem;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.5s 0.12s ease-out both;
}

.trust-item {
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e7a42;
}

.trust-check {
    color: #27AE60;
    font-weight: 700;
    margin-right: 0.2rem;
}

.library-install {
    animation: fadeInUp 0.5s 0.15s ease-out both;
}

.library-books {
    padding: 2rem 0 1.5rem;
}

.library-section-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.5rem;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 1.25rem;
}

.library-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    max-width: 480px;
    margin: 0 auto;
}

.library-card-link {
    text-decoration: none;
    color: inherit;
}

.library-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: row;
    transition: transform 0.2s, box-shadow 0.2s;
    animation: fadeInUp 0.5s 0.1s ease-out both;
}

.library-card:nth-child(2) {
    animation-delay: 0.15s;
}

.library-card:nth-child(3) {
    animation-delay: 0.2s;
}

.library-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.library-card-cover {
    width: 120px;
    flex-shrink: 0;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}

.library-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.library-card-info {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.library-card-info h3 {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.15rem;
    color: var(--text-color);
    margin-bottom: 0.2rem;
}

.library-card-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.library-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: 'Fredoka', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    background: var(--buy-color);
    border-radius: var(--radius-lg);
    padding: 0.5rem 1.25rem;
    width: fit-content;
    transition: background 0.2s;
}

.library-card:hover .library-card-btn {
    background: var(--buy-hover);
}

/* ==========================================
   INTRO / BOOK DETAIL PAGES
   ========================================== */
.intro-page {
    padding: 2rem 0 3rem;
}

.intro-card {
    max-width: 480px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    animation: fadeInUp 0.4s ease-out both;
}

.intro-cover {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #eee;
}

.intro-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.intro-details {
    padding: 1.5rem;
}

.intro-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.intro-badge {
    display: inline-block;
    font-family: 'Nunito', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--secondary-color);
    background: #E8F8FD;
    padding: 0.2rem 0.75rem;
    border-radius: 20px;
    margin-bottom: 1rem;
}

.intro-desc {
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.intro-features {
    list-style: none;
    padding: 0;
    margin: 1rem 0 1.5rem;
}

.intro-features li {
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    color: var(--text-color);
    padding: 0.35rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.intro-features li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: #27AE60;
    font-weight: 700;
}

.intro-buy-btn {
    display: flex;
    width: 100%;
    justify-content: center;
    font-size: 1.1rem;
    padding: 0.9rem 1.5rem;
    margin-bottom: 0.75rem;
}

.intro-back-btn {
    display: flex;
    width: 100%;
    justify-content: center;
}

.section-heading {
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.section-text {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto 2rem;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

/* ==========================================
   BOOKS PAGE
   ========================================== */
.page-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.book-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 400px;
    margin: 0 auto;
}

.book-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.25s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.5s 0.1s ease-out both;
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.1);
}

.book-cover-image {
    width: 100%;
    display: block;
}

.book-info {
    padding: 1.5rem;
    text-align: center;
}

.book-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.6rem;
}

.age-range {
    display: inline-block;
    background-color: #EBF8FF;
    color: #2B6CB0;
    padding: 0.25rem 0.85rem;
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.book-short-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* ==========================================
   BOOK DETAIL / SALES PAGE
   ========================================== */
.book-detail {
    padding-top: 2rem;
}

.detail-header {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 2.5rem;
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    animation: fadeInUp 0.5s ease-out both;
}

.book-cover-large-image {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    border-radius: var(--radius-sm);
    display: block;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

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

.book-title {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}

.book-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.price-tag {
    font-family: 'Fredoka', sans-serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--buy-color);
    margin-bottom: 1.25rem;
}

.detail-content h3 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.story-summary {
    margin-bottom: 2rem;
    line-height: 1.8;
    font-size: 1.02rem;
    color: var(--text-secondary);
}

.story-summary h3 {
    color: var(--text-color);
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.feature-box {
    background: #F8FAFF;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    animation: fadeInUp 0.5s 0.15s ease-out both;
}

.feature-box h3 {
    color: var(--secondary-color);
    font-size: 1.1rem;
}

.feature-box ul {
    list-style: none;
}

.feature-box li {
    margin-bottom: 0.6rem;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.feature-box li::before {
    content: "\2022";
    color: var(--secondary-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.parent-reassurance {
    background: linear-gradient(135deg, #E8FFF0, #F0FFFA);
    padding: 2rem;
    border-radius: var(--radius-md);
    text-align: center;
    margin-top: 2rem;
    border: 1px solid #c3f0d6;
}

.parent-reassurance h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
}

.reassurance-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}

.reassurance-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: #1e7a42;
    font-size: 0.95rem;
}

.reassurance-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background-color: #27AE60;
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: bold;
    flex-shrink: 0;
}

/* ==========================================
   THANK YOU PAGE
   ========================================== */
.thank-you-confirmation {
    padding: 2.5rem 0;
}

.success-card {
    background: linear-gradient(135deg, #E8FFF0, #F0FFFA);
    padding: 2.5rem 2rem;
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid #c3f0d6;
    max-width: 520px;
    margin: 0 auto;
    animation: fadeInUp 0.5s ease-out both;
}

.success-icon {
    color: var(--buy-color);
    margin-bottom: 0.75rem;
    line-height: 1;
}

.success-card h2 {
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
}

.success-card > p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
}

/* ==========================================
   FOOTER
   ========================================== */
footer {
    background-color: var(--footer-bg);
    padding: 2rem 0;
    text-align: center;
    margin-top: auto;
}

.footer-tagline {
    font-family: 'Fredoka', sans-serif;
    font-size: 1rem;
    color: var(--footer-text);
    margin-bottom: 0.4rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 0.6rem 0;
}

.footer-links a {
    color: var(--footer-text);
    font-size: 0.9rem;
    transition: color 0.2s;
    border-bottom: 1px solid transparent;
}

.footer-links a:hover {
    color: #FFFFFF;
    border-bottom-color: #FFFFFF;
}

.footer-copy {
    font-size: 0.85rem;
    color: #8395a7;
}

/* ==========================================
   LEGAL PAGES (Privacy & Terms)
   ========================================== */
.legal-page {
    padding-top: 2rem;
}

.legal-card {
    background: var(--card-bg);
    padding: 2.5rem 2rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    max-width: 680px;
    margin: 0 auto;
}

.legal-intro {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.legal-section {
    margin-bottom: 1.75rem;
}

.legal-section h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.legal-section p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 0.5rem;
}

.legal-updated {
    margin-top: 2rem;
    font-size: 0.85rem;
    color: var(--text-faint);
    text-align: right;
}

/* ==========================================
   MOBILE-FIRST (small screens are the default)
   ========================================== */

@media (max-width: 599px) {
    .container {
        padding: 0 1rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    nav a {
        font-size: 1rem;
        padding: 0.4rem 0;
    }

    .btn {
        padding: 0.85rem 1.5rem;
        font-size: 1rem;
        min-height: 48px;
    }

    .btn-large {
        font-size: 1.1rem;
        padding: 1rem 1.75rem;
        min-width: 0;
        width: 100%;
        max-width: 320px;
    }

    .library-hero {
        padding: 2rem 0 1.5rem;
    }

    .library-logo {
        width: 64px;
        height: 64px;
        border-radius: 16px;
    }

    .library-title {
        font-size: 1.6rem;
    }

    .library-tagline {
        font-size: 1rem;
    }

    .library-grid {
        max-width: 100%;
    }

    .library-card-cover {
        width: 100px;
        aspect-ratio: 1 / 1;
    }

    .section-heading {
        font-size: 1.35rem;
    }

    .section-text {
        font-size: 1rem;
        padding: 0 0.25rem;
    }

    .page-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

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

    .book-info {
        padding: 1.25rem;
    }

    .book-info h3 {
        font-size: 1.15rem;
    }

    .detail-header {
        padding: 1.25rem;
        gap: 1.5rem;
    }

    .book-cover-large-image {
        max-width: 240px;
    }

    .book-title {
        font-size: 1.35rem;
    }

    .book-subtitle {
        font-size: 1rem;
    }

    .price-tag {
        font-size: 1.75rem;
    }

    .feature-box {
        padding: 1.25rem;
    }

    .parent-reassurance {
        padding: 1.5rem 1rem;
    }

    .reassurance-items {
        flex-direction: column;
        align-items: center;
        gap: 0.6rem;
    }

    .thank-you-confirmation {
        padding: 1.5rem 0;
    }

    .success-card {
        padding: 1.75rem 1.25rem;
    }

    .success-card h2 {
        font-size: 1.35rem;
    }

    .legal-card {
        padding: 1.75rem 1.25rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
    }

    .footer-links a {
        padding: 0.3rem 0;
        font-size: 0.95rem;
    }

    .games-hero {
        padding: 2.5rem 0 2rem;
    }

    .games-title {
        font-size: 1.5rem;
    }

    .games-subtitle {
        font-size: 1rem;
        padding: 0 0.25rem;
    }

    .games-feature-card {
        padding: 1.5rem 1.25rem;
    }

    .check-back-card {
        padding: 1.5rem 1.25rem;
    }

    .check-back-text {
        font-size: 1rem;
    }

    .read-along-hero {
        padding: 2.5rem 0 1.5rem;
    }

    .read-along-title {
        font-size: 1.5rem;
    }

    .read-along-intro {
        font-size: 1rem;
        padding: 0 0.25rem;
    }

    .pdf-viewer-frame {
        height: 60vh;
        min-height: 380px;
    }

    .read-along-instruction {
        font-size: 1rem;
    }
}

/* ==========================================
   TABLET AND UP (600px+)
   ========================================== */
@media (min-width: 600px) {
    .button-group {
        flex-direction: row;
        justify-content: center;
    }

    .library-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 720px;
    }

    .library-card {
        flex-direction: column;
    }

    .library-card-cover {
        width: 100%;
        aspect-ratio: 3 / 4;
    }

    .library-card-info {
        text-align: center;
        align-items: center;
    }

    .library-title {
        font-size: 2.2rem;
    }

    .detail-header {
        flex-direction: row;
        align-items: center;
    }

    .book-cover-large-image {
        width: 280px;
        flex-shrink: 0;
        margin: 0;
    }

    .detail-info {
        text-align: left;
        flex: 1;
    }

    .features-grid {
        grid-template-columns: 1fr 1fr;
    }

    .reassurance-items {
        flex-direction: row;
        justify-content: center;
        gap: 2rem;
    }

    .games-feature-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .games-title {
        font-size: 2rem;
    }

    .read-along-title {
        font-size: 2rem;
    }

    .pdf-viewer-frame {
        height: 70vh;
        min-height: 480px;
    }

    .thank-you-actions {
        flex-direction: row;
        justify-content: center;
    }
}

/* ==========================================
   DESKTOP (900px+)
   ========================================== */
@media (min-width: 900px) {
    .library-grid {
        max-width: 780px;
    }

    .library-card-cover {
        aspect-ratio: 3 / 4;
    }

    .book-grid {
        max-width: 420px;
    }
}

/* ==========================================
   GAMES COMING SOON PAGE
   ========================================== */
.games-coming-soon {
    padding: 0;
}

.games-hero {
    background: linear-gradient(170deg, #F0F4FF 0%, #FFF5F5 50%, #F0FFFA 100%);
    padding: 3.5rem 0 3rem;
    text-align: center;
}

.games-badge {
    display: inline-block;
    background-color: var(--secondary-color);
    color: white;
    font-family: 'Fredoka', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.3rem 1.2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
    letter-spacing: 0.03em;
    animation: fadeInUp 0.5s ease-out both;
}

.games-title {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
    animation: fadeInUp 0.5s 0.1s ease-out both;
}

.games-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.7;
    animation: fadeInUp 0.5s 0.2s ease-out both;
}

.games-preview {
    padding: 2.5rem 0;
}

.games-feature-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    max-width: 680px;
    margin: 0 auto;
}

.games-feature-card {
    background: var(--card-bg);
    padding: 1.75rem 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    text-align: center;
    animation: fadeInUp 0.5s 0.15s ease-out both;
}

.games-feature-card:nth-child(2) {
    animation-delay: 0.25s;
}

.games-feature-card:nth-child(3) {
    animation-delay: 0.35s;
}

.games-feature-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    line-height: 1;
    color: var(--secondary-color);
}

.games-feature-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.games-feature-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.games-check-back {
    padding: 0 0 3rem;
}

.check-back-card {
    background: linear-gradient(135deg, #EBF8FF, #F0F4FF);
    padding: 2rem;
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid #c3d9f0;
    max-width: 520px;
    margin: 0 auto;
    animation: fadeInUp 0.5s 0.3s ease-out both;
}

.check-back-text {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

/* ==========================================
   READ-ALONG PAGE
   ========================================== */
.read-along-page {
    padding: 0;
}

.read-along-hero {
    background: linear-gradient(170deg, #FFF5F5 0%, #FFF9EE 50%, #F0F4FF 100%);
    padding: 3rem 0 2rem;
    text-align: center;
}

.read-along-title {
    font-size: 1.75rem;
    color: var(--text-color);
    margin-bottom: 0.75rem;
    animation: fadeInUp 0.5s ease-out both;
}

.read-along-intro {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.8;
    animation: fadeInUp 0.5s 0.1s ease-out both;
}

.slideshow-wrapper {
    max-width: 700px;
    margin: 2rem auto;
    animation: fadeInUp 0.5s 0.15s ease-out both;
}

.page-indicator-inline {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.slideshow-area {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 30px rgba(124, 94, 217, 0.12);
    overflow: hidden;
}

.slideshow-area img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: var(--radius-md);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.slideshow-area img.active {
    opacity: 1;
}

.slideshow-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.25rem 0 1rem;
}

.progress-bar-wrapper {
    width: 100%;
    max-width: 400px;
    height: 6px;
    background: rgba(124, 94, 217, 0.15);
    border-radius: 3px;
    overflow: hidden;
    margin: 0 auto 1.5rem;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 3px;
    transition: width 0.3s linear;
}

.btn-play {
    background-color: var(--buy-color);
    color: white;
}

.btn-play:hover {
    background-color: var(--buy-hover);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.3);
}

.btn-replay {
    background-color: var(--secondary-color);
    color: white;
}

.btn-replay:hover {
    background-color: var(--secondary-hover);
    box-shadow: 0 6px 20px rgba(72, 219, 251, 0.3);
}

.btn-icon {
    margin-right: 0.35rem;
}

.btn-svg-icon {
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.3rem;
    flex-shrink: 0;
}

.games-feature-icon svg {
    color: var(--secondary-color);
}

.parent-note {
    font-size: 0.9rem;
    color: var(--text-faint);
    text-align: center;
    max-width: 460px;
    margin: 0 auto 2rem;
    line-height: 1.6;
    animation: fadeInUp 0.5s 0.3s ease-out both;
}

.footer-email {
    margin-bottom: 0.4rem;
}

.footer-email a {
    color: var(--footer-text);
    font-size: 0.9rem;
    transition: color 0.2s;
    border-bottom: 1px solid transparent;
}

.footer-email a:hover {
    color: #FFFFFF;
    border-bottom-color: #FFFFFF;
}

/* ==========================================
   TOUCH-FRIENDLY ENHANCEMENTS
   ========================================== */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
        box-shadow: none;
    }

    .btn:active {
        transform: scale(0.97);
    }

    .book-card:hover {
        transform: none;
        box-shadow: none;
    }

    .hero-cover-wrapper:hover {
        transform: none;
    }
}

/* ==========================================
   YOUR BOOKS GRID (Thank You page)
   ========================================== */
.your-books-section {
    padding: 2rem 0 1.5rem;
}

.your-books-heading {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.5rem;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 0.25rem;
}

.your-books-intro {
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 1.25rem;
}

.your-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    max-width: 520px;
    margin: 0 auto;
}

.book-card-link {
    text-decoration: none;
    color: inherit;
}

.book-card-mini {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem 1rem;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.book-card-mini:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.12);
}

.book-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fff0f0;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.book-card-cover {
    width: 100%;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
}

.book-card-mini h3 {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.05rem;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.book-card-label {
    font-size: 0.8rem;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ==========================================
   VIDEO BOOK PAGE
   ========================================== */
.video-book-page {
    padding: 2rem 0 3rem;
}

.video-book-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 2rem;
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.video-book-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.8rem;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.video-book-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.video-wrapper {
    position: relative;
    width: 100%;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #000;
    margin-bottom: 1.5rem;
}

.video-wrapper video {
    display: block;
    width: 100%;
    max-height: 70vh;
    border-radius: var(--radius-sm);
}

.story-mode-exit {
    display: none;
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 20;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.4);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, opacity 0.3s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.story-mode-exit:hover {
    background: rgba(0, 0, 0, 0.85);
}

.story-mode-exit svg {
    display: block;
    margin: auto;
}

body.story-mode-active {
    overflow: hidden !important;
}

body.story-mode-active > header,
body.story-mode-active > main > .video-book-page .video-book-card > *:not(.video-wrapper),
body.story-mode-active > footer {
    display: none !important;
}

.video-wrapper.story-mode {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    margin: 0;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.video-wrapper.story-mode video {
    max-height: 100vh;
    max-width: 100vw;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0;
}

.video-wrapper.story-mode .story-mode-exit {
    display: flex;
}

.video-wrapper.story-mode .video-spinner {
    border-radius: 0;
}

.video-spinner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    z-index: 10;
    border-radius: var(--radius-sm);
    pointer-events: none;
    transition: opacity 0.3s;
}

.video-spinner.hidden {
    opacity: 0;
    pointer-events: none;
}

@keyframes spinRing {
    to { transform: rotate(360deg); }
}

.spinner-ring {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spinRing 0.8s linear infinite;
}

.spinner-text {
    margin-top: 0.75rem;
    font-family: 'Fredoka', sans-serif;
    font-size: 0.95rem;
    color: #fff;
    font-weight: 600;
}

.resume-banner {
    background: linear-gradient(135deg, #EBF8FF, #F0F4FF);
    border: 2px solid var(--secondary-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    text-align: center;
    margin-bottom: 1rem;
    animation: fadeInUp 0.3s ease-out both;
}

.resume-text {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.75rem;
}

.resume-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.btn-resume-yes {
    background: var(--buy-color);
    color: #fff;
    padding: 0.5rem 1.25rem;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-resume-yes:hover {
    background: var(--buy-hover);
}

.btn-resume-no {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
    padding: 0.5rem 1.25rem;
    font-size: 0.95rem;
}

.btn-resume-no:hover {
    border-color: var(--text-secondary);
    color: var(--text-color);
}

.btn-fullscreen {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Fredoka', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: var(--secondary-color);
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 1rem;
}

.btn-fullscreen:hover {
    background: var(--secondary-hover);
}

.video-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.btn-download-video {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* ==========================================
   INSTALL & DOWNLOAD SECTION
   ========================================== */
.install-section {
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
}

.install-section-top {
    margin-top: 0.5rem;
    margin-bottom: 1.25rem;
}

.btn-install-app {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Fredoka', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #27AE60 0%, #2ECC71 100%);
    border: none;
    border-radius: 16px;
    padding: 1rem 2rem;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 14px rgba(39, 174, 96, 0.3);
    min-height: 56px;
}

.btn-install-app:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

.btn-install-app:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}

.install-note {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.install-instructions {
    display: none;
    background: #f0f7ff;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-top: 0.75rem;
    text-align: left;
}

.install-step {
    font-size: 0.95rem;
    color: var(--text-color);
    padding: 0.5rem 0;
    line-height: 1.6;
}

.install-step + .install-step {
    border-top: 1px solid #dce8f5;
}

.install-icon-inline {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    vertical-align: middle;
}

.btn-installed {
    background: var(--text-faint) !important;
    cursor: default;
}

.download-secondary {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.btn-link-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}

.btn-link-secondary:hover {
    color: var(--text-color);
}

.btn-svg-icon-sm {
    flex-shrink: 0;
}

.download-note {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

/* ==========================================
   REDUCED MOTION (accessibility)
   ========================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0ms !important;
        transition-duration: 0.01ms !important;
    }
}
