* { 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
    min-height: 100vh;
    touch-action: manipulation;
    overflow-x: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

header {
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
    color: white;
    padding: 20px 15px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
}

.header-text {
    flex: 1;
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: clamp(1.5rem, 8vw, 2.5rem);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: bounce 2s ease-in-out infinite;
}

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

header p {
    margin: 5px 0 0;
    font-size: clamp(0.8rem, 4vw, 1rem);
    opacity: 0.9;
}

.profile-icon {
    background: rgba(255,255,255,0.3);
    border-radius: 25px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.2);
}

#ageDisplay {
    color: white;
    font-weight: bold;
    font-size: 0.8rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.change-age-btn {
    background: rgba(255,255,255,0.4);
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 0.6rem;
    cursor: pointer;
    min-height: 32px;
    font-weight: bold;
}

main {
    padding: 20px 10px;
    max-width: 100%;
}

section h2 {
    text-align: center;
    color: #2e7d32;
    font-size: clamp(1.3rem, 7vw, 2rem);
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    animation: wiggle 3s ease-in-out infinite;
}

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

.age-grid, .category-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.age-card, .category-card {
    background: linear-gradient(135deg, #fff, #f8f9fa);
    border-radius: 25px;
    padding: 25px 15px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.age-card::before, .category-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.age-card:active::before, .category-card:active::before {
    opacity: 1;
    animation: shine 0.6s ease;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.age-card:active, .category-card:active {
    transform: scale(0.95);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border-color: #ff6b6b;
}

.age-icon, .category-icon {
    font-size: clamp(3rem, 15vw, 5rem);
    display: block;
    margin-bottom: 15px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.2));
}

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

.age-card h3, .category-card h3 {
    margin: 10px 0;
    color: #2e7d32;
    font-size: clamp(1.2rem, 6vw, 1.6rem);
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.age-card p {
    color: #666;
    margin: 5px 0;
    font-size: clamp(0.9rem, 4vw, 1.1rem);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.1));
    backdrop-filter: blur(10px);
}

.back-btn {
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.back-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.age-badge {
    background: linear-gradient(135deg, #4ecdc4, #45b7d1);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.learning-display {
    background: linear-gradient(135deg, #fff, #f8f9fa);
    border-radius: 25px;
    padding: 30px 20px;
    margin: 20px 0;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    text-align: center;
    border: 3px solid #ff6b6b;
    position: relative;
    overflow: hidden;
}

.learning-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

#currentLetter, #currentNumber {
    font-size: clamp(4rem, 20vw, 8rem);
    font-weight: bold;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

#wordImage, #numberDots, #animalImage, #bodyImage, #fruitImage, 
#geoImage, #spaceImage, #anatomyImage {
    font-size: clamp(3rem, 15vw, 6rem);
    margin: 20px 0;
    animation: spin 4s linear infinite;
    position: relative;
    z-index: 1;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#englishWord, #hindiWord, #englishNumber, #hindiNumber,
#colorName, #shapeName, #scienceTopic, #currentWord,
#animalName, #bodyName, #fruitName, #geoName, #spaceName, #anatomyName,
#calendarItem {
    font-size: clamp(1.3rem, 7vw, 2.2rem);
    margin: 15px 0;
    font-weight: bold;
    color: #2e7d32;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
}

#hindiColor, #hindiShape, #wordMeaning, #scienceFact,
#animalSound, #fruitType, #hindiAnimal, #hindiBody, #hindiFruit,
#calendarType, #geoType, #spaceType, #anatomyType,
#geoCapital, #spaceFact, #anatomyFunction, #hindiCalendar {
    font-size: clamp(1rem, 5vw, 1.6rem);
    color: #ff6b35;
    margin: 10px 0;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.controls {
    margin: 25px 0;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 12px;
}

.controls button {
    background: linear-gradient(135deg, #4ecdc4, #45b7d1);
    border: none;
    border-radius: 25px;
    padding: 20px 15px;
    font-size: clamp(0.9rem, 4vw, 1.1rem);
    cursor: pointer;
    color: white;
    font-weight: bold;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.controls button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.controls button:active::before {
    width: 200px;
    height: 200px;
}

.controls button:active {
    transform: scale(0.95);
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

.progress {
    font-size: clamp(1.1rem, 5vw, 1.4rem);
    color: white;
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
    padding: 15px 25px;
    border-radius: 30px;
    display: inline-block;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    margin-top: 20px;
    font-weight: bold;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    0% { box-shadow: 0 4px 20px rgba(0,0,0,0.2); }
    100% { box-shadow: 0 4px 30px rgba(255,107,107,0.4); }
}

#currentColor {
    width: clamp(150px, 50vw, 250px);
    height: clamp(150px, 50vw, 250px);
    border-radius: 50%;
    margin: 20px auto;
    border: 5px solid #fff;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    animation: colorPulse 2s ease-in-out infinite;
}

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

#currentShape {
    width: clamp(120px, 40vw, 180px);
    height: clamp(120px, 40vw, 180px);
    background: linear-gradient(45deg, #4ecdc4, #45b7d1);
    margin: 20px auto;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    animation: shapeRotate 3s linear infinite;
}

@keyframes shapeRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile optimizations */
@media (min-width: 480px) {
    .age-grid, .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .age-grid, .category-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 600px;
        margin: 0 auto 20px;
    }
    
    .learning-display {
        max-width: 500px;
        margin: 20px auto;
    }
    
    .controls {
        max-width: 400px;
        margin: 25px auto;
    }
}

/* Very small screens */
@media (max-width: 320px) {
    .profile-icon {
        position: static;
        margin: 10px auto 0;
        width: fit-content;
        transform: none;
    }
    
    .controls {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* Landscape mode */
@media (orientation: landscape) and (max-height: 500px) {
    header {
        padding: 10px 15px;
    }
    
    .learning-display {
        padding: 20px 15px;
    }
    
    #currentLetter, #currentNumber {
        font-size: 3rem;
    }
}
#dayName, #monthName {
    font-size: clamp(1.5rem, 6vw, 2.5rem);
    color: #2e7d32;
    font-weight: bold;
    margin: 15px 0;
}

#dayEmoji, #monthEmoji {
    font-size: clamp(4rem, 15vw, 8rem);
    margin: 20px 0;
    animation: spin 4s linear infinite;
}

#hindiDay, #hindiMonth {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    color: #ff6b35;
    margin: 10px 0;
}

#monthSeason {
    font-size: clamp(1rem, 4vw, 1.5rem);
    color: #ff9800;
    margin: 8px 0;
    font-style: italic;
}
#fruitName, #vegetableName {
    font-size: clamp(1.5rem, 6vw, 2.5rem);
    color: #2e7d32;
    font-weight: bold;
    margin: 15px 0;
}

#fruitImage, #vegetableImage {
    font-size: clamp(4rem, 15vw, 8rem);
    margin: 20px 0;
    animation: spin 4s linear infinite;
}

#fruitColor, #vegetableColor {
    font-size: clamp(1rem, 4vw, 1.5rem);
    color: #ff9800;
    margin: 8px 0;
    font-style: italic;
}

#hindiFruit, #hindiVegetable {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    color: #ff6b35;
    margin: 10px 0;
}
#tableNumber {
    font-size: clamp(6rem, 20vw, 10rem);
    font-weight: bold;
    background: linear-gradient(45deg, #9c27b0, #e91e63);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

#tableEquation {
    font-size: clamp(1.5rem, 6vw, 2.5rem);
    color: #2e7d32;
    font-weight: bold;
    margin: 15px 0;
    background: rgba(156, 39, 176, 0.1);
    padding: 15px;
    border-radius: 15px;
    border: 2px solid #9c27b0;
}

#tableStep {
    font-size: clamp(1rem, 4vw, 1.5rem);
    color: #ff9800;
    margin: 8px 0;
    font-style: italic;
}
.table-selection h2 {
    text-align: center;
    color: #2e7d32;
    font-size: clamp(1.3rem, 6vw, 1.8rem);
    margin-bottom: 25px;
}

.table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.table-btn {
    background: linear-gradient(135deg, #9c27b0, #e91e63);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 20px 15px;
    font-size: clamp(1rem, 4vw, 1.2rem);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.table-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
/* More attractive animations for kids */
@keyframes rainbow {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

@keyframes wiggleIcon {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-10deg) scale(1.1); }
    75% { transform: rotate(10deg) scale(1.1); }
}

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

.age-icon:hover, .category-icon:hover {
    animation: wiggleIcon 0.6s ease-in-out infinite;
}

#currentLetter:hover, #currentNumber:hover {
    animation: rainbow 2s linear infinite, heartbeat 1s ease-in-out infinite;
}

.controls button:hover {
    animation: heartbeat 0.5s ease-in-out infinite;
}

/* Floating emojis background */
body::before {
    content: '🌟 ⭐ 🎈 🎊 🌈 ✨ 🎉 🦄 🍭 🎨';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-size: 2rem;
    opacity: 0.1;
    pointer-events: none;
    z-index: -1;
    animation: floatingEmojis 20s linear infinite;
    word-spacing: 100px;
    line-height: 150px;
}

@keyframes floatingEmojis {
    0% { transform: translateY(100vh) rotate(0deg); }
    100% { transform: translateY(-100vh) rotate(360deg); }
}

/* Magic cursor trail */
.cursor-trail {
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle, #ff6b6b, #4ecdc4);
    pointer-events: none;
    z-index: 9999;
    animation: cursorFade 1s ease-out forwards;
}

@keyframes cursorFade {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0); opacity: 0; }
}

/* Bouncing progress bar */
.progress {
    animation: glow 2s ease-in-out infinite alternate, bounce 3s ease-in-out infinite;
}

/* Twinkling stars effect */
.learning-display::after {
    content: '⭐';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
    animation: twinkle 2s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}
/* Mobile-specific attractive features */
@media (max-width: 768px) {
    /* Larger, more colorful elements for mobile */
    .age-icon, .category-icon {
        font-size: clamp(4rem, 20vw, 6rem);
        filter: drop-shadow(0 0 10px rgba(255,107,107,0.5));
    }
    
    /* Bouncing cards on mobile */
    .age-card, .category-card {
        animation: mobileFloat 4s ease-in-out infinite;
    }
    
    .age-card:nth-child(2) { animation-delay: 0.5s; }
    .age-card:nth-child(3) { animation-delay: 1s; }
    
    /* Pulsing buttons */
    .controls button {
        animation: mobilePulse 2s ease-in-out infinite;
        font-size: clamp(1.1rem, 5vw, 1.4rem);
        padding: 22px 18px;
    }
    
    /* Glowing progress bar */
    .progress {
        animation: mobileGlow 3s ease-in-out infinite;
        font-size: clamp(1.3rem, 6vw, 1.6rem);
    }
    
    /* Bigger learning display */
    #currentLetter, #currentNumber {
        font-size: clamp(5rem, 25vw, 10rem);
        animation: mobileWiggle 3s ease-in-out infinite;
    }
}

@keyframes mobileFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(2deg); }
}

@keyframes mobilePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
    50% { transform: scale(1.05); box-shadow: 0 8px 25px rgba(255,107,107,0.4); }
}

@keyframes mobileGlow {
    0%, 100% { box-shadow: 0 4px 20px rgba(0,0,0,0.2); }
    50% { box-shadow: 0 8px 30px rgba(76,175,80,0.6); }
}

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