@import url('https://fonts.googleapis.com/css2?family=Chicle&family=Edu+SA+Beginner:wght@400..700&family=Fira+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

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

/* Header Styles */
.site-header {
    width: 100%;
    background: linear-gradient(135deg, #f5f1e8 0%, #e8dcc8 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    border-bottom: 1px solid #d4c4b0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo a {
    font-family: 'Chicle', cursive;
    font-size: 1.8rem;
    color: #8b4589;
    text-decoration: none;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo .logo-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.header-logo .logo-text {
    display: inline-block;
}

.header-logo a:hover {
    transform: scale(1.05);
}

.header-nav {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-menu li a {
    color: #6b5b4f;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: background-color 0.3s, transform 0.2s;
}

.nav-menu li a:hover {
    background-color: rgba(139, 69, 137, 0.1);
    color: #8b4589;
    transform: translateY(-2px);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 0.4rem;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: #8b4589;
    border-radius: 3px;
    transition: all 0.3s;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Styles */
@media (max-width: 768px) {
    .header-container {
        padding: 1rem;
    }
    
    .header-logo a {
        font-size: 1.5rem;
    }
    
    .header-logo .logo-icon {
        width: 32px;
        height: 32px;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        right: 0;
        background: linear-gradient(135deg, #f5f1e8 0%, #e8dcc8 100%);
        flex-direction: column;
        width: 200px;
        padding: 1rem;
        gap: 0.5rem;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
        border-radius: 0 0 0 10px;
        border-left: 1px solid #d4c4b0;
        border-bottom: 1px solid #d4c4b0;
        transform: translateX(100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease-in-out;
    }
    
    .nav-menu.active {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-menu li {
        width: 100%;
    }
    
    .nav-menu li a {
        display: block;
        text-align: center;
    }
}

body {
    font-family: 'Fira Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* justify-content: center; */
    align-items: center;
    padding: 80px 20px 20px 20px;
    overflow-x: hidden;
    gap: 20px;
}

h1 {
    color: #8b4589;
    font-size: 2.5em;
    margin: 0;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    font-family: 'Chicle', cursive;
}

.container {
    background: linear-gradient(to right, 
        #fefefe 0%, 
        #fefefe 10px, 
        #f8f8f0 10px, 
        #f8f8f0 100%);
    border-radius: 30px;
    padding: 0px 10px;
    max-width: 1000px;
    width: 100%;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        inset 0 0 30px rgba(0,0,0,0.05);
    border: 1px solid #d4c4b0;
    position: relative;
    overflow: hidden;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}

@media (min-width: 768px) {
    .container {
        padding: 10px 25px 40px 25px;
    }
}

.stars {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    pointer-events: none;
}

.star {
    position: absolute;
    color: #ffd700;
    font-size: 24px;
    animation: twinkle 2s infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.content {
    position: relative;
    z-index: 1;
}

h1 {
    color: #8b4589;
    font-size: 2.5em;
    margin-bottom: 3px;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.5);
    font-family: 'Chicle', cursive;
}

.emoji {
    font-size: 1.2em;
    display: inline-block;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.story-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
}

@media (min-width: 768px) {
    .story-content-wrapper {
        flex-direction: row;
        align-items: center;
    }
}

.story-image {
    width: 100%;
    min-height: 300px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

@media (min-width: 768px) {
    .story-image {
        flex: 0 0 50%;
        min-height: 550px;
        height: 100%;
    }
}

.story-text-container {
    padding: 20px 25px;
    font-size: 1.4em;
    line-height: 1.4;
    color: #2c2c2c;
    flex: 1;
}

.story-text-container::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 20px,
        #e8d7c3 20px,
        #e8d7c3 21px
    );
}

.story-text-container::after {
}

@media (min-width: 768px) {
    .story-text-container {
        flex: 0 0 50%;
        font-size: 1.6em;
        line-height: 1.8;
    }
}

.story-text-container a {
    color: #667eea;
    text-decoration: underline;
    font-weight: bold;
    transition: color 0.2s;
}

.story-text-container a:hover {
    color: #764ba2;
    text-decoration: none;
}

.story-text-container a:visited {
    color: #8b4589;
}

.story-text {
    padding: 25px;
    border-radius: 20px;
    font-size: 1.3em;
    line-height: 1.8;
    color: #333;
    margin: 20px 0;
    min-height: 200px;
    border: 3px dotted #764ba2;
}

.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
    flex-wrap: wrap;
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 20px;
    font-size: 0.9em;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

button:active {
    transform: translateY(-1px);
}

.restart-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.progress-container {
    margin: 20px auto;
    max-width: 600px;
    padding: 0 20px;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(118, 75, 162, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
    box-shadow: 0 2px 5px rgba(118, 75, 162, 0.3);
}

.page-indicator {
    text-align: center;
    font-size: 1.1em;
    color: #764ba2;
    font-weight: bold;
    margin-top: 15px;
}

.character {
    text-align: center;
    font-size: 5em;
    margin: 15px 0;
    animation: wave 2s infinite;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    75% { transform: rotate(-5deg); }
}

/* Floating buttons */
.floating-buttons {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 15px;
    z-index: 1000;
    width: 100%;
    justify-content: space-between;
    padding: 0 20px;
}

.float-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.5em;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: bold;
}

.float-btn:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.float-btn:active {
    transform: scale(1.05) translateY(-2px);
}

.float-btn.back {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.float-btn.next {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

/* Read Along Button */
.read-along-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1.2em;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s, box-shadow 0.3s;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 600;
}

.read-along-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.read-along-btn:active {
    transform: translateY(0);
}

.read-along-btn.speaking {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Swipe hint */
.swipe-hint {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 999;
}

.swipe-hint.show {
    opacity: 1;
}

/* Quiz Link Styles */
.quiz-link {
    margin-top: 30px;
    text-align: center;
}

.quiz-link .quiz-title {
    color: #8b4589;
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 15px;
    font-family: 'Chicle', cursive;
}

.quiz-link .quiz-description {
    color: #6b5b4f;
    font-size: 1.1em;
    margin-bottom: 20px;
    line-height: 1.6;
}

.quiz-link .quiz-button {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 1.2em;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s, box-shadow 0.3s;
}

.quiz-link .quiz-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.quiz-link .quiz-button:active {
    transform: translateY(0);
}
