/* ==========================================
   EASY4KIDS - Çocuk Dostu Animasyonlu Tasarım
   ========================================== */

/* CSS Değişkenleri */
:root {
    --primary: #FF6B9D;
    --primary-dark: #E91E63;
    --secondary: #7C4DFF;
    --accent: #FFD93D;
    --success: #4CAF50;
    --error: #FF5252;
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-primary: #2D3436;
    --text-secondary: #636E72;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.2);
}

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

body {
    font-family: 'Nunito', 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--text-primary);
}

/* Arka Plan Animasyonları */
.bg-animations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    font-size: 2rem;
    opacity: 0.6;
    animation: float 15s ease-in-out infinite;
}

.shape-1 { top: 10%; left: 10%; animation-delay: 0s; }
.shape-2 { top: 20%; right: 15%; animation-delay: 2s; }
.shape-3 { top: 60%; left: 5%; animation-delay: 4s; font-size: 3rem; }
.shape-4 { bottom: 30%; right: 10%; animation-delay: 6s; }
.shape-5 { top: 40%; left: 20%; animation-delay: 8s; }
.shape-6 { bottom: 20%; left: 30%; animation-delay: 10s; }
.shape-7 { top: 15%; right: 30%; animation-delay: 3s; }
.shape-8 { bottom: 40%; right: 25%; animation-delay: 7s; }

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-20px) rotate(10deg);
    }
    50% {
        transform: translateY(-10px) rotate(-5deg);
    }
    75% {
        transform: translateY(-30px) rotate(5deg);
    }
}

/* Ana Container */
.app-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Ana ekran için container ayarları */
body:has(#level-screen.active) .app-container {
    align-items: flex-start !important;
    justify-content: flex-start !important;
    width: 100% !important;
    max-width: none !important;
}

/* Ekranlar */
.screen {
    display: none;
    width: 100%;
    max-width: 600px;
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: block;
}

/* Ana ekran tam genişlik */
#level-screen.active {
    max-width: 100%;
}

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

/* Kartlar */
.card {
    background: var(--card-bg);
    border-radius: 30px;
    padding: 40px 30px;
    box-shadow: 
        0 20px 60px var(--shadow-medium),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    text-align: center;
    backdrop-filter: blur(10px);
}

.wide-card {
    max-width: 800px;
}

/* Animasyonlar */
.bounce-in {
    animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.slide-up {
    animation: slideUp 0.6s ease;
}

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

.bounce {
    animation: bounce 2s ease-in-out infinite;
}

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

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 5px 20px var(--shadow-light);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 10px 40px var(--shadow-medium);
    }
}

/* Maskot */
.mascot {
    font-size: 5rem;
    margin-bottom: 10px;
    display: inline-block;
}

/* Başlıklar */
.title {
    font-family: 'Baloo 2', cursive;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.rainbow-text {
    background: linear-gradient(90deg, #FF6B6B, #FFE66D, #4ECDC4, #45B7D1, #96CEB4, #FF6B9D);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbow 3s linear infinite;
}

@keyframes rainbow {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

/* API Input */
.api-input-wrapper {
    margin: 30px 0;
    text-align: left;
}

.api-input-wrapper label {
    display: block;
    font-weight: 700;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.input-group input {
    flex: 1;
    padding: 15px 20px;
    border: 3px solid #E0E0E0;
    border-radius: 15px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 107, 157, 0.2);
}

.toggle-visibility {
    width: 50px;
    border: none;
    background: #F5F5F5;
    border-radius: 15px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.toggle-visibility:hover {
    background: #E0E0E0;
}

.api-input-wrapper small {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.api-input-wrapper a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
}

.api-input-wrapper a:hover {
    text-decoration: underline;
}

/* Butonlar */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(255, 107, 157, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 107, 157, 0.5);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 1.4rem;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 30px;
    background: white;
    color: var(--text-primary);
    border: 3px solid #E0E0E0;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* Seçim Grupları */
.selection-group {
    margin: 25px 0;
}

.selection-group h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.age-buttons,
.level-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.topic-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    max-height: 280px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0,0,0,0.02);
    border-radius: 15px;
}

.age-btn,
.level-btn,
.topic-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 15px 20px;
    background: white;
    border: 3px solid #E0E0E0;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.age-btn:hover,
.level-btn:hover,
.topic-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--shadow-light);
}

.age-btn.selected,
.level-btn.selected,
.topic-btn.selected {
    border-color: var(--secondary);
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.1) 0%, rgba(124, 77, 255, 0.2) 100%);
    color: var(--secondary);
}

.age-emoji,
.level-emoji {
    font-size: 2rem;
}

.topic-btn span:first-child {
    font-size: 1.8rem;
}

.topic-btn .story-count {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(0,0,0,0.05);
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 2px;
}

.topic-btn.selected .story-count {
    background: rgba(124, 77, 255, 0.2);
    color: var(--secondary);
}

.topic-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.topic-btn.disabled:hover {
    transform: none;
    box-shadow: none;
}

/* İlerleme Çubuğu */
.progress-bar {
    height: 12px;
    background: #E0E0E0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 25px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--success));
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
}

/* Kelime Kartı */
.word-card-container {
    perspective: 1000px;
    margin: 30px auto;
    width: 280px;
    height: 200px;
}

.word-card {
    width: 280px;
    height: 200px;
    margin: 0 auto;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
    cursor: pointer;
}

.word-card:hover {
    transform: rotateY(180deg);
}

.word-card.flipped {
    transform: rotateY(180deg);
}

.word-front,
.word-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-shadow: 0 10px 30px var(--shadow-light);
}

.word-front {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Kelime kartı ipucu */
.word-card-hint {
    margin-bottom: 15px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    padding: 10px 20px;
    border-radius: 25px;
}

.word-back {
    background: linear-gradient(135deg, var(--accent) 0%, #FFA502 100%);
    transform: rotateY(180deg);
}

.word-emoji {
    font-size: 3rem;
    margin-bottom: 10px;
}

.word-english {
    font-family: 'Baloo 2', cursive;
    font-size: 2.5rem;
    font-weight: 800;
}

.word-pronunciation {
    font-size: 1.1rem;
    opacity: 0.8;
}

.word-turkish {
    font-family: 'Baloo 2', cursive;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.word-example {
    background: #F8F9FA;
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
}

.example-en {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 8px;
}

.example-tr {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Navigasyon */
.word-navigation,
.story-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 25px 0;
    gap: 15px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 25px;
    background: white;
    border: 3px solid #E0E0E0;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover:not(:disabled) {
    border-color: var(--secondary);
    color: var(--secondary);
}

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

.word-counter,
.sentence-counter {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: #F5F5F5;
    padding: 10px 20px;
    border-radius: 50px;
}

/* Yükleme Animasyonu */
.loading-animation {
    padding: 40px 0;
}

.book-loader {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.book {
    width: 80px;
    height: 60px;
    position: relative;
    perspective: 400px;
}

.book .page {
    width: 40px;
    height: 60px;
    background: linear-gradient(90deg, #FFF 0%, #F0F0F0 100%);
    position: absolute;
    right: 0;
    top: 0;
    border-radius: 0 5px 5px 0;
    transform-origin: left center;
    box-shadow: 0 2px 10px var(--shadow-light);
}

.book .page:nth-child(1) {
    animation: pageTurn 1.5s ease-in-out infinite;
    animation-delay: 0s;
    z-index: 3;
}

.book .page:nth-child(2) {
    animation: pageTurn 1.5s ease-in-out infinite;
    animation-delay: 0.3s;
    z-index: 2;
}

.book .page:nth-child(3) {
    animation: pageTurn 1.5s ease-in-out infinite;
    animation-delay: 0.6s;
    z-index: 1;
}

@keyframes pageTurn {
    0%, 100% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(-150deg);
    }
}

.loading-text {
    font-family: 'Baloo 2', cursive;
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.loading-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Hikaye Ekranı */
.story-title {
    margin-bottom: 10px;
}

.story-moral {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(255, 217, 61, 0.15) 0%, rgba(255, 165, 2, 0.15) 100%);
    border-radius: 12px;
    display: inline-block;
}

.sentence-container {
    margin: 30px 0;
}

.sentence-card {
    background: linear-gradient(135deg, #F8F9FA 0%, #E9ECEF 100%);
    border-radius: 25px;
    padding: 30px;
    animation: sentenceIn 0.5s ease;
}

@keyframes sentenceIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.sentence-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sentence-turkish {
    font-size: 1.4rem;
    color: var(--secondary);
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 2;
}

.sentence-divider {
    font-size: 1.5rem;
    margin: 10px 0;
    opacity: 0.5;
}

.sentence-english {
    font-size: 1.4rem;
    color: var(--text-primary);
    font-weight: 600;
    line-height: 2;
}

/* Kelime Highlight Sistemi */
.word-highlight {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: inline-block;
    position: relative;
}

.word-highlight:hover {
    background: rgba(124, 77, 255, 0.2);
    transform: scale(1.05);
}

.word-highlight.active {
    background: linear-gradient(135deg, var(--secondary) 0%, #6C5CE7 100%);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(124, 77, 255, 0.4);
}

.word-highlight-en {
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: inline-block;
}

.word-highlight-en.active {
    background: linear-gradient(135deg, var(--accent) 0%, #FFA502 100%);
    color: var(--text-primary);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(255, 217, 61, 0.5);
    animation: pulseHighlight 0.5s ease;
}

@keyframes pulseHighlight {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1.1); }
}

.hover-hint {
    margin-top: 20px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.1) 0%, rgba(255, 107, 157, 0.1) 100%);
    border-radius: 12px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.hover-hint span {
    font-size: 1.2rem;
}

/* Cümle Okuma Butonu */
.speak-sentence-btn {
    background: linear-gradient(135deg, var(--secondary) 0%, #6C5CE7 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1rem;
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.3s ease;
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(124, 77, 255, 0.3);
}

.speak-sentence-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 5px 20px rgba(124, 77, 255, 0.5);
}

/* Hikayenin Tamamı */
.full-story-container {
    margin-top: 25px;
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,249,250,0.95) 100%);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 2px solid var(--primary);
    animation: slideUp 0.5s ease;
}

.full-story-header {
    font-family: 'Baloo 2', cursive;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px dashed var(--primary-light);
}

.full-story-header span {
    margin-right: 8px;
}

.full-story-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.full-story-section {
    padding: 15px;
    border-radius: 15px;
}

.full-story-section:first-child {
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.1) 0%, rgba(255, 107, 157, 0.05) 100%);
}

.full-story-section:last-child {
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.1) 0%, rgba(124, 77, 255, 0.05) 100%);
}

.full-story-label {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.full-story-text {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-secondary);
    text-align: left;
}

.full-story-text p {
    margin-bottom: 8px;
}

.full-story-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--primary-light) 50%, transparent 100%);
}

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

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

/* Speaker icon for TTS */
.speaker-icon {
    display: inline-block;
    margin-left: 5px;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.word-highlight:hover .speaker-icon,
.word-highlight.active .speaker-icon {
    opacity: 1;
}

/* Oyun Başlığı */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.score-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
    background: linear-gradient(135deg, rgba(255, 217, 61, 0.2) 0%, rgba(255, 165, 2, 0.2) 100%);
    padding: 10px 20px;
    border-radius: 50px;
}

/* Kelime Sıralama Oyunu */
.ordering-sentence-tr {
    background: linear-gradient(135deg, var(--secondary) 0%, #6C5CE7 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 15px;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 25px 0;
}

.drop-zone {
    min-height: 80px;
    background: #F8F9FA;
    border: 3px dashed #D0D0D0;
    border-radius: 20px;
    padding: 20px;
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.drop-zone.drag-over {
    border-color: var(--secondary);
    background: rgba(124, 77, 255, 0.1);
}

.drop-hint {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.word-bank {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin: 25px 0;
}

.draggable-word {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: grab;
    transition: all 0.3s ease;
    user-select: none;
}

.draggable-word:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 107, 157, 0.4);
}

.draggable-word.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.draggable-word.in-zone {
    background: linear-gradient(135deg, var(--secondary) 0%, #6C5CE7 100%);
}

.game-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 25px 0;
}

/* Kelime Eşleştirme Oyunu */
.matching-container {
    display: flex;
    gap: 40px;
    justify-content: center;
    margin: 30px 0;
    flex-wrap: wrap;
}

.matching-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 180px;
}

.match-word {
    padding: 15px 25px;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.match-word.english {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.match-word.turkish {
    background: white;
    border: 3px solid #E0E0E0;
    color: var(--text-primary);
}

.match-word:hover:not(.matched):not(.selected) {
    transform: scale(1.05);
}

.match-word.selected {
    transform: scale(1.08);
    box-shadow: 0 5px 20px var(--shadow-medium);
}

.match-word.selected.english {
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.5);
}

.match-word.selected.turkish {
    border-color: var(--secondary);
}

.match-word.matched {
    opacity: 0.5;
    cursor: default;
    transform: scale(0.95);
}

.match-word.correct {
    animation: correctMatch 0.5s ease;
}

@keyframes correctMatch {
    0%, 100% {
        transform: scale(0.95);
    }
    50% {
        transform: scale(1.1);
    }
}

.match-word.wrong {
    animation: wrongMatch 0.5s ease;
}

@keyframes wrongMatch {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

/* Sonuç Ekranı */
.results-animation {
    position: relative;
    margin-bottom: 20px;
}

.trophy {
    font-size: 6rem;
    animation: trophyBounce 1s ease infinite;
}

@keyframes trophyBounce {
    0%, 100% {
        transform: scale(1) rotate(-5deg);
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
}

.results-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 30px 0;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    background: #F8F9FA;
    padding: 20px 30px;
    border-radius: 20px;
    min-width: 120px;
}

.stat-icon {
    font-size: 2rem;
}

.stat-value {
    font-family: 'Baloo 2', cursive;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--secondary);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 25px;
    text-align: center;
    max-width: 400px;
    width: 100%;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.modal-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 25px;
}

/* Başarı Popup */
.success-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 1001;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.success-popup.show {
    transform: translate(-50%, -50%) scale(1);
}

.popup-content {
    background: linear-gradient(135deg, var(--success) 0%, #2ECC71 100%);
    color: white;
    padding: 30px 50px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 40px rgba(76, 175, 80, 0.5);
}

.popup-emoji {
    font-size: 3rem;
}

.popup-text {
    font-family: 'Baloo 2', cursive;
    font-size: 2rem;
    font-weight: 800;
}

/* Konfeti Animasyonu */
.confetti {
    position: absolute;
    width: 100%;
    height: 200px;
    top: -50px;
    left: 0;
    pointer-events: none;
}

/* Responsive Tasarım */
@media (max-width: 768px) {
    .card {
        padding: 30px 20px;
        border-radius: 25px;
    }

    .title {
        font-size: 2rem;
    }

    .mascot {
        font-size: 4rem;
    }

    .word-card-container {
        width: 240px;
        height: 180px;
    }

    .word-card {
        width: 240px;
        height: 180px;
    }

    .word-english,
    .word-turkish {
        font-size: 2rem;
    }

    .matching-container {
        gap: 20px;
    }

    .matching-column {
        min-width: 150px;
    }

    .nav-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .btn-primary {
        padding: 15px 30px;
        font-size: 1.1rem;
    }

    .results-stats {
        gap: 15px;
    }

    .stat-item {
        padding: 15px 20px;
        min-width: 100px;
    }

    .stat-value {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 10px;
    }

    .card {
        padding: 25px 15px;
    }

    .title {
        font-size: 1.7rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .age-btn,
    .level-btn,
    .topic-btn {
        min-width: 80px;
        padding: 12px 15px;
        font-size: 0.9rem;
    }

    .age-emoji,
    .level-emoji {
        font-size: 1.5rem;
    }

    .topic-btn span:first-child {
        font-size: 1.5rem;
    }

    .word-navigation,
    .story-navigation {
        flex-direction: column;
        gap: 10px;
    }

    .matching-container {
        flex-direction: column;
        align-items: center;
    }

    .game-actions {
        flex-direction: column;
    }

    .results-actions {
        flex-direction: column;
    }
}

/* ==========================================
   HİKAYE KARTLARI SAYFASI
   ========================================== */

/* Stories Page Layout */
.stories-page {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* IMPORTANT: Make all children visible */
.stories-page > * {
    display: block !important;
}

.page-header {
    text-align: center;
    margin-bottom: 30px;
}

.page-title {
    font-family: 'Baloo 2', cursive;
    font-size: 3rem;
    font-weight: 900;
    color: white;
    text-shadow: 3px 3px 0 var(--primary-dark), 6px 6px 20px rgba(0,0,0,0.3);
    margin-bottom: 5px;
}

.page-subtitle {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.9);
}

/* Filters Bar */
.filters-bar {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px 25px;
    margin-bottom: 20px;
    box-shadow: 0 10px 40px var(--shadow-medium);
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #E0E0E0;
    background: white;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

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

.filter-btn.active {
    background: linear-gradient(135deg, var(--secondary) 0%, #6C5CE7 100%);
    color: white;
    border-color: transparent;
}

/* Stories Count */
.stories-count {
    text-align: center;
    color: rgba(255,255,255,0.9);
    font-size: 1rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.stories-count span {
    font-weight: 800;
    font-size: 1.2rem;
}

/* Stories Grid */
.stories-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 20px !important;
    min-height: 200px;
}

/* Story Card */
.story-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px var(--shadow-light);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 3px solid transparent;
    text-align: left;
    font-family: inherit;
    font-size: inherit;
    width: 100%;
    display: block;
}

.story-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
}

.story-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px var(--shadow-medium);
    border-color: var(--secondary);
}

.story-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.story-card-emoji {
    font-size: 3rem;
    line-height: 1;
}

.story-card-badges {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-end;
}

.story-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-level {
    background: linear-gradient(135deg, var(--secondary) 0%, #6C5CE7 100%);
    color: white;
}

.badge-level.beginner {
    background: linear-gradient(135deg, #4CAF50 0%, #2ECC71 100%);
}

.badge-level.elementary {
    background: linear-gradient(135deg, #FF9800 0%, #FFA502 100%);
}

.badge-level.intermediate {
    background: linear-gradient(135deg, #E91E63 0%, #FF6B9D 100%);
}

.badge-age {
    background: #F0F0F0;
    color: var(--text-secondary);
}

.story-card-title {
    font-family: 'Baloo 2', cursive;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 5px;
    line-height: 1.3;
}

.story-card-title-en {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.story-card-moral {
    font-size: 0.9rem;
    color: var(--secondary);
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.1) 0%, rgba(124, 77, 255, 0.05) 100%);
    padding: 10px 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    font-style: italic;
}

.story-card-stats {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.story-card-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.story-card-play {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(255, 107, 157, 0.4);
}

.story-card:hover .story-card-play {
    opacity: 1;
    transform: scale(1);
}

/* No Stories Message */
.no-stories {
    text-align: center;
    padding: 60px 20px;
    background: var(--card-bg);
    border-radius: 20px;
    grid-column: 1 / -1;
}

.no-stories-emoji {
    font-size: 4rem;
    margin-bottom: 15px;
}

.no-stories-text {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* ==========================================
   ANA EKRAN İÇİN ÖZEL STLLER
   ========================================== */

/* Level screen tam genişlik olmalı */
#level-screen.active {
    display: block !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* Stories-page ve tüm çocukları görünür olmalı */
.stories-page,
.stories-page .page-header,
.stories-page .stories-count,
.stories-page .stories-grid,
.stories-page .filters-bar {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
}

/* Responsive for Stories Page */
@media (max-width: 768px) {
    .stories-page {
        padding: 15px;
    }

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

    .filters-bar {
        padding: 15px;
        gap: 15px;
    }

    .filter-group {
        width: 100%;
    }

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

    .story-card {
        padding: 20px;
    }

    .story-card-emoji {
        font-size: 2.5rem;
    }

    .story-card-title {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.8rem;
    }

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

    .filter-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* Özel Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #F0F0F0;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #6C5CE7 100%);
}
