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

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;800&display=swap');

body {
    font-family: 'Montserrat', 'Comic Sans MS', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* HEADER */
.header {
    text-align: center;
    margin-bottom: 60px;
    animation: fadeInDown 0.8s ease;
}

.main-title {
    font-size: 4rem;
    color: white;
    text-shadow: 4px 4px 8px rgba(0,0,0,0.3);
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

.subtitle {
    font-size: 1.8rem;
    color: #ffe5b4;
    font-weight: bold;
}

/* STORY GRID */
.story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 40px;
    padding: 20px;
}

.story-card {
    background: white;
    border-radius: 30px;
    padding: 30px;
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.story-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

.story-image {
    width: 100%;
    height: 300px;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 5px solid #667eea;
}

.story-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-title {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 15px;
    text-align: center;
}

.story-desc {
    font-size: 1.3rem;
    color: #666;
    text-align: center;
}

/* STORY PAGE STYLES */
.story-container {
    background: white;
    border-radius: 30px;
    padding: 40px;
    max-width: 900px;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.back-button {
    display: inline-block;
    padding: 15px 30px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 15px;
    font-size: 1.5rem;
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.back-button:hover {
    background: #5568d3;
    transform: scale(1.05);
}

.story-header {
    text-align: center;
    margin-bottom: 40px;
}

.story-header h1 {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 20px;
}

.story-header img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 20px;
    border: 5px solid #667eea;
}

/* READING CONTROLS */
.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.control-btn {
    padding: 20px 40px;
    font-size: 1.5rem;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.control-btn:hover {
    transform: scale(1.1);
}

.control-btn:active {
    transform: scale(0.95);
}

.btn-start {
    background: #48bb78;
    color: white;
}

.btn-pause {
    background: #ed8936;
    color: white;
}

.btn-reset {
    background: #f56565;
    color: white;
}

.btn-speed {
    background: #4299e1;
    color: white;
}

/* STORY TEXT */
.story-text {
    font-size: 2rem;
    line-height: 2.5;
    color: #333;
    padding: 30px;
    background: #f7fafc;
    border-radius: 20px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.story-text p {
    margin-bottom: 30px;
    word-spacing: 0.5em;
}

.syllable {
    display: inline-block;
    padding: 3px 2px;
    margin: 0 1px;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    font-weight: 800;
    vertical-align: middle;
    white-space: nowrap;
}

.syllable:hover {
    background: #bee3f8;
    transform: scale(1.1);
}

.syllable.active {
    background: #ffd700;
    transform: scale(1.2);
    font-weight: 800;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

.syllable.completed {
    background: #c6f6d5;
    color: #22543d;
}

.word {
    display: inline-block;
    margin-right: 15px;
    margin-bottom: 5px;
}

/* Kötőjel speciális stílus */
.syllable:not(:last-child)::after {
    content: '';
    display: inline;
}

/* Vizuális kötőjel a szövegben marad */
.story-text .syllable {
    letter-spacing: 0.02em;
}

/* PROGRESS BAR */
.progress-container {
    margin: 30px 0;
    background: #e2e8f0;
    border-radius: 20px;
    height: 30px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #48bb78, #38a169);
    width: 0%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: white;
    font-weight: bold;
}

/* REWARD SYSTEM */
.rewards {
    text-align: center;
    margin: 30px 0;
    font-size: 3rem;
}

.star {
    display: inline-block;
    animation: starPop 0.5s ease;
}

/* ANIMATIONS */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes starPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.3rem;
    }
    
    .story-grid {
        grid-template-columns: 1fr;
    }
    
    .story-text {
        font-size: 1.8rem;
        line-height: 2.2;
        padding: 20px;
    }
    
    .syllable {
        padding: 2px 1px;
        margin: 0 0.5px;
    }
    
    .control-btn {
        padding: 15px 25px;
        font-size: 1.2rem;
    }
}