* { box-sizing: border-box; margin: 0; padding: 0; }
        html, body { height: 100%; font-family: 'Nunito', sans-serif; }
        .font-display { font-family: 'Fredoka', sans-serif; }
        
        @keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
        @keyframes pulse-glow { 0%, 100% { box-shadow: 0 0 20px rgba(255,183,77,0.4); } 50% { box-shadow: 0 0 40px rgba(255,183,77,0.8); } }
        @keyframes slide-up { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
        @keyframes confetti { 0% { transform: translateY(0) rotate(0); opacity: 1; } 100% { transform: translateY(300px) rotate(720deg); opacity: 0; } }
        @keyframes bounce-in { 0% { transform: scale(0.3); opacity: 0; } 50% { transform: scale(1.05); } 70% { transform: scale(0.9); } 100% { transform: scale(1); opacity: 1; } }
        @keyframes modal-open { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
        @keyframes flip { 0% { transform: rotateY(0); } 50% { transform: rotateY(90deg); } 100% { transform: rotateY(180deg); } }
        
        .animate-float { animation: float 3s ease-in-out infinite; }
        .animate-fade { animation: fadeIn 0.6s ease-out forwards; }
        .animate-bounce-in { animation: bounce-in 0.6s ease-out forwards; }
        .animate-slide-up { animation: slide-up 0.5s ease-out forwards; }
        .animate-modal { animation: modal-open 0.3s ease-out; }
        
        .card-hover { transition: all 0.3s ease; }
        .card-hover:hover { transform: translateY(-6px) scale(1.02); box-shadow: 0 12px 30px rgba(0,0,0,0.15); }
        .btn-bounce { transition: all 0.2s ease; cursor: pointer; }
        .btn-bounce:hover { transform: scale(1.05); }
        .btn-bounce:active { transform: scale(0.95); }
        .progress-bar { transition: width 0.8s ease; }
        
        .page { display: none; }
        .page.active { display: block; }
        
        .quiz-opt { transition: all 0.2s ease; cursor: pointer; }
        .quiz-opt:hover { transform: translateX(4px); }
        .quiz-opt.correct { background: #c8e6c9 !important; border-color: #4caf50 !important; }
        .quiz-opt.wrong { background: #ffcdd2 !important; border-color: #f44336 !important; }
        
        .puzzle-cell { flex: 1; min-height: 0; border: 3px solid #fff; border-radius: 12px; cursor: pointer; transition: all 0.2s; font-size: clamp(0.7rem, 2.8vw, 1rem); font-weight: 700; display: flex; align-items: center; justify-content: center; text-align: center; padding: 4px 8px; user-select: none; width: 100%; word-break: break-word; line-height: 1.2; }
        .puzzle-cell.selected { box-shadow: 0 0 0 3px #ff9800; transform: scale(1.03); z-index: 10; position: relative; }
        .puzzle-cell.matched { opacity: 0.5; pointer-events: none; }
        
        .toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 9999; padding: 12px 24px; border-radius: 12px; font-weight: 700; animation: slide-up 0.3s ease; font-family: 'Fredoka', sans-serif; }
        .confetti-piece { position: fixed; top: -10px; width: 10px; height: 10px; border-radius: 2px; animation: confetti 2s ease-out forwards; z-index: 9999; }
        .modal-backdrop { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 9998; padding: 20px; }
        
        .flashcard { perspective: 1000px; cursor: pointer; height: 100%; width: 100%; max-width: 450px; position: relative; }
        .flashcard-inner { transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); transform-style: preserve-3d; -webkit-transform-style: preserve-3d; width: 100%; height: 100%; position: relative; }
        .flashcard.flipped .flashcard-inner { transform: rotateY(180deg); -webkit-transform: rotateY(180deg); }
        .flashcard-front, .flashcard-back { backface-visibility: hidden; -webkit-backface-visibility: hidden; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 20px; border-radius: 20px; font-weight: bold; text-align: center; position: absolute; top: 0; left: 0; }
        .flashcard-front { z-index: 2; transform: rotateY(0deg); -webkit-transform: rotateY(0deg); }
        .flashcard-back { transform: rotateY(180deg); -webkit-transform: rotateY(180deg); }
        
        .modal-input { width: 100%; padding: 12px; border: 2px solid #e0e0e0; border-radius: 12px; font-size: 16px; font-family: 'Nunito', sans-serif; margin: 8px 0; }
        .modal-input:focus { outline: none; border-color: #ff9800; box-shadow: 0 0 0 3px rgba(255,152,0,0.1); }
        
        .video-placeholder { width: 100%; aspect-ratio: 16/9; background: linear-gradient(135deg,#667eea 0%,#764ba2 100%); border-radius: 16px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 16px; color: #fff; margin: 20px 0; }
        
        .nested-item { background: rgba(255,255,255,0.7); padding: 14px; border-radius: 12px; margin: 8px 0; border-left: 4px solid #ff9800; }
        .nested-item h4 { font-weight: 700; margin-bottom: 6px; font-size: 15px; }
        .nested-item p { font-size: 14px; line-height: 1.5; }
        .section-divider { height: 2px; background: linear-gradient(90deg,transparent,#ffb74d,transparent); margin: 20px 0; }