/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #FF6B6B;
    --secondary-color: #4ECDC4;
    --accent-color: #FFE66D;
    --background-color: #FFF3E0;
    --text-color: #2C3E50;
    --header-height: 110px;
    --border-radius: 20px;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    --hover-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    --card-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    --animation-duration: 0.3s;

    /* New Playful Colors */
    --color-red: #FF6B6B;
    --color-blue: #4ECDC4;
    --color-yellow: #FFE66D;
    --color-green: #7ED56F;
    --color-purple: #9B59B6;
    --color-orange: #FF9F1C;
    --gradient-primary: linear-gradient(135deg, var(--color-red), var(--color-orange));
    --gradient-secondary: linear-gradient(135deg, var(--color-blue), var(--color-green));
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background: var(--background-color) url('data:image/svg+xml,<svg width="52" height="26" viewBox="0 0 52 26" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ddd" fill-opacity="0.4"><path d="M10 10c0-2.21-1.79-4-4-4-2.21 0-4 1.79-4 4 0 2.21 1.79 4 4 4 2.21 0 4-1.79 4-4zm25 1c0-1.657-1.343-3-3-3s-3 1.343-3 3 1.343 3 3 3 3-1.343 3-3z"/></g></g></svg>');
    color: var(--text-color);
    min-height: 100vh;
}

/* Header Styles */
.main-header {
    background: linear-gradient(45deg,
            var(--color-red),
            var(--color-orange),
            var(--color-yellow),
            var(--color-green),
            var(--color-blue),
            var(--color-purple));

    background-size: 400% 400%;
    animation: gradientShift 15s ease-in-out infinite;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border-bottom: 5px solid var(--color-yellow);
    transition: all 0.5s ease;
    padding-left: 2rem;
}

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

    25% {
        background-position: 50% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    75% {
        background-position: 50% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    flex-wrap: wrap;
}

.logo-container {
    height: 100px;
    width: auto;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-logo {
    height: 100%;
    width: auto;
    max-width: 600px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: transform 0.5s ease;
}

.site-logo:hover {
    transform: scale(1.03);
}

.site-title {
    font-size: 3rem;
    color: white;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    animation: titleGlow 4s ease-in-out infinite;
    margin-left: 1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1.5rem;
    border-radius: 30px;
    backdrop-filter: blur(2px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

@keyframes titleGlow {

    0%,
    100% {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
        transform: scale(1);
    }

    50% {
        text-shadow: 0 0 15px rgba(255, 255, 255, 0.6),
            0 0 30px rgba(255, 255, 255, 0.3),
            0 0 45px rgba(255, 255, 255, 0.1);
        transform: scale(1.03);
    }
}

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

/* Navigation Styles */
.main-header .nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.main-header .nav-link a {
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 0.5rem 1rem;
    display: block;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.main-header .nav-link a:before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    transition: all 0.3s ease;
    z-index: -1;
}

.main-header .nav-link:hover {
    transform: translateY(-3px);
}

.main-header .nav-link:hover a:before {
    height: 100%;
}

.main-header .nav-link:active {
    transform: translateY(0);
}

/* Search Bar Styles */
.search-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.search-input {
    width: 100%;
    padding: 1rem 2rem;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    box-shadow: var(--card-shadow);
    background: white url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23666"><path d="M15.5 14h-.79l-.28-.27a6.5 6.5 0 0 0 1.48-5.34c-.47-2.78-2.79-5-5.59-5.34a6.505 6.505 0 0 0-7.27 7.27c.34 2.8 2.56 5.12 5.34 5.59a6.5 6.5 0 0 0 5.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>') no-repeat;
    background-position: calc(100% - 1rem) center;
    background-size: 1.5rem;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-color);
    transform: translateY(-2px);
}

/* Video Grid Styles */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.game-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.5s ease;
    cursor: pointer;
    position: relative;
    border: 5px solid transparent;
    transform-origin: center;
    background-image: linear-gradient(white, white),
        linear-gradient(45deg,
            var(--color-red),
            var(--color-orange),
            var(--color-yellow),
            var(--color-green),
            var(--color-blue),
            var(--color-purple));
    background-origin: border-box;
    background-clip: content-box, border-box;
    background-size: 100% 100%, 400% 400%;
    animation: gradientBorder 15s ease-in-out infinite;
}

@keyframes gradientBorder {
    0% {
        background-position: 0 0, 0% 50%;
    }

    25% {
        background-position: 0 0, 50% 50%;
    }

    50% {
        background-position: 0 0, 100% 50%;
    }

    75% {
        background-position: 0 0, 50% 50%;
    }

    100% {
        background-position: 0 0, 0% 50%;
    }
}

.game-card:hover {
    transform: translateY(-15px) scale(1.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: gradientBorder 8s ease-in-out infinite;
}

.game-card:hover .play-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2) rotate(360deg);
}

.game-thumbnail {
    position: relative;
    padding-top: 56.25%;
    background: #f0f0f0;
    overflow: hidden;
    border-radius: calc(var(--border-radius) - 5px);
}

.game-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.game-card:hover .game-thumbnail img {
    transform: scale(1.1);
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: linear-gradient(45deg,
            var(--color-red),
            var(--color-orange),
            var(--color-yellow),
            var(--color-green),
            var(--color-blue),
            var(--color-purple));
    background-size: 400% 400%;
    animation: gradientShift 15s ease-in-out infinite;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    opacity: 0;
    transition: all 0.5s ease;
    z-index: 2;
    border: 4px solid white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.game-info {
    padding: 1.5rem;
    background: white;
    border-radius: 0 0 calc(var(--border-radius) - 5px) calc(var(--border-radius) - 5px);
    transition: all 0.5s ease;
}

.game-info h3 {
    margin: 0 0 0.5rem;
    font-size: 1.4rem;
    color: var(--text-color);
    line-height: 1.4;
}

.video-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

/* Decorative Elements */
.floating-bubble {
    position: fixed;
    font-size: 2rem;
    pointer-events: none;
    animation: float 20s linear infinite;
    opacity: 0.6;
    z-index: 1;
}

@keyframes float {
    0% {
        transform: translate(0, 100vh) rotate(0deg);
    }

    100% {
        transform: translate(0, -100px) rotate(360deg);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Loading Animation */
.loading {
    text-align: center;
    padding: 3rem;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    border: 8px solid var(--color-yellow);
    border-top: 8px solid var(--color-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.loading-progress {
    color: var(--text-color);
    font-size: 1.1rem;
    margin-top: 1rem;
}

.error-message {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    max-width: 600px;
    margin: 2rem auto;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.retry-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 30px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 1rem;
}

.retry-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Message Banner */
.message-banner {
    background: var(--accent-color);
    color: var(--text-color);
    padding: 1rem 2rem;
    margin: 1rem auto;
    border-radius: 10px;
    text-align: center;
    max-width: 800px;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Animations */
@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0);
    }

    50% {
        transform: translateY(-10px) rotate(5deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        padding: 1rem;
        gap: 1rem;
    }

    .nav-buttons {
        padding: 0.5rem;
    }

    .nav-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }

    .search-input {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
}

/* Fun Elements */
.particle {
    position: absolute;
    pointer-events: none;
    animation: float 1s ease-out forwards;
    z-index: 10;
}

/* Category Icons */
.category-icon {
    font-size: 2rem;
    margin-right: 0.5rem;
}

/* Footer */
.main-footer {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem;
    margin-top: 4rem;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-controls {
    display: flex;
    gap: 1rem;
}

.footer-controls button {
    background: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.footer-controls button:hover {
    background: linear-gradient(135deg, var(--color-blue), var(--color-green));
}

/* Video Modal Styles */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1100;
}

.video-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    width: 90%;
    max-width: 1200px;
    background: white;
    border-radius: var(--border-radius);
    position: relative;
}

.close-modal {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 40px;
    height: 40px;
    border: none;
    background: white;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.close-modal:hover {
    background: #e0e0e0;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Category Navigation */
.category-nav {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.85));
    backdrop-filter: blur(8px);
    border-radius: 20px;
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    max-width: 1200px;
    margin: 1rem auto;
    position: relative;
}

.category-btn {
    flex: 1;
    min-width: 120px;
    max-width: 200px;
    background: white;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 15px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-color);
}

.category-btn .emoji {
    font-size: 1.4rem;
}

.category-btn .text {
    font-weight: bold;
}

.category-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
}

.category-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .category-nav {
        padding: 0.8rem;
        gap: 0.8rem;
    }

    .category-btn {
        min-width: 100px;
        padding: 0.6rem 1rem;
        font-size: 1rem;
    }

    .category-btn .emoji {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .category-nav {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .category-btn {
        min-width: 90px;
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
    }

    .category-btn .emoji {
        font-size: 1.1rem;
    }
}

.login-section {
    display: flex;
    gap: 1rem;
    margin-right: 1rem;

}

.login-btn,
.signup-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.5s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    font-family: 'Comic Neue', cursive;
    font-weight: bold;
    position: relative;
    overflow: hidden;
}

.login-btn::before,
.signup-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg,
            var(--color-red),
            var(--color-orange),
            var(--color-yellow),
            var(--color-green),
            var(--color-blue),
            var(--color-purple));
    background-size: 400% 400%;
    opacity: 0;
    transition: opacity 0.5s ease;
    animation: gradientShift 15s ease-in-out infinite;
}

.login-btn:hover::before,
.signup-btn:hover::before {
    opacity: 0.9;
}

.login-btn span,
.signup-btn span {
    position: relative;
    z-index: 1;
    mix-blend-mode: difference;
    color: white;
    transition: all 0.5s ease;
}

.login-btn:hover,
.signup-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Responsive styles */
@media (max-width: 1200px) {
    .main-header {
        padding-left: 1.5rem;
    }

    .logo-container {
        height: 90px;
        position: relative;
    }
}

@media (max-width: 768px) {
    .main-header {
        padding-left: 1rem;
        height: 90px;
    }

    .logo-container {
        height: 70px;
    }
}

@media (max-width: 480px) {
    .main-header {
        padding-left: 0.5rem;
        height: 80px;
    }

    .logo-container {
        height: 60px;
    }
}

/* Quiz Styles */
.quiz-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 1rem;
}

.quiz-section {
    display: none;
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--card-shadow);
    text-align: center;
}

.quiz-section.active {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

.quiz-title {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 2rem;
    text-align: center;
}

/* Age Verification Styles */
.age-question {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.age-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Animal Selection Styles */
.animal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.animal-btn {
    background: white;
    border: 4px solid transparent;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background-image: linear-gradient(white, white),
        linear-gradient(45deg,
            var(--color-red),
            var(--color-orange),
            var(--color-yellow),
            var(--color-green),
            var(--color-blue),
            var(--color-purple));
    background-origin: border-box;
    background-clip: content-box, border-box;
    box-shadow: var(--shadow);
}

.animal-btn:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.animal-btn .emoji {
    font-size: 3rem;
}

/* Quiz Questions Styles */
.quiz-progress {
    height: 10px;
    background: #eee;
    border-radius: 5px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(45deg,
            var(--color-green),
            var(--color-blue));
    width: 0%;
    transition: width 0.3s ease;
}

.question-container {
    margin-bottom: 2rem;
}

.question {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
}

.answers-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.answer-btn {
    background: white;
    border: 3px solid #eee;
    padding: 1rem;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.answer-btn:hover {
    border-color: var(--color-blue);
    transform: translateY(-2px);
}

.answer-btn.correct {
    background: var(--color-green);
    color: white;
    border-color: var(--color-green);
}

.answer-btn.incorrect {
    background: var(--color-red);
    color: white;
    border-color: var(--color-red);
}

/* Quiz Controls */
.quiz-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.quiz-btn {
    background: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 30px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow);
}

.quiz-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--hover-shadow);
}

.quiz-btn.next-btn {
    background: var(--color-blue);
    color: white;
}

.quiz-btn.restart-btn {
    background: var(--color-green);
    color: white;
}

/* Results Styles */
.results-container {
    text-align: center;
}

.score-display {
    font-size: 2rem;
    margin-bottom: 2rem;
}

.score-number {
    font-size: 3rem;
    color: var(--color-green);
    font-weight: bold;
}

.celebration-animation {
    font-size: 3rem;
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.celebration-animation .emoji {
    animation: bounce 1s ease infinite;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* Responsive Quiz Styles */
@media (max-width: 768px) {
    .quiz-container {
        padding: 0.5rem;
    }

    .quiz-section {
        padding: 1rem;
    }

    .quiz-title {
        font-size: 1.5rem;
    }

    .age-question {
        font-size: 1.2rem;
    }

    .animal-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .animal-btn .emoji {
        font-size: 2.5rem;
    }

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

    .quiz-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
}

.quiz-nav-btn {
    background: linear-gradient(135deg, #FF6B6B, #9B59B6);
    color: white;
    position: relative;
    overflow: hidden;
}

.quiz-nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg,
            var(--color-purple),
            var(--color-red),
            var(--color-orange),
            var(--color-yellow),
            var(--color-green),
            var(--color-blue));
    background-size: 400% 400%;
    opacity: 0;
    transition: opacity 0.5s ease;
    animation: gradientShift 15s ease-in-out infinite;
}

.quiz-nav-btn:hover::before {
    opacity: 1;
}

.quiz-nav-btn .text,
.quiz-nav-btn .emoji {
    position: relative;
    z-index: 1;
    color: white;
}

.quiz-nav-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.quiz-nav-btn .emoji {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

/* Celebration Styles */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background-color: #f00;
    pointer-events: none;
    opacity: 0.8;
    animation: confetti-fall 5s ease-in-out forwards;
    z-index: 1000;
}

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

    25% {
        transform: translateY(-50vh) rotate(90deg) translateX(20px);
    }

    50% {
        transform: translateY(0vh) rotate(180deg) translateX(-20px);
    }

    75% {
        transform: translateY(50vh) rotate(270deg) translateX(20px);
    }

    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.celebration-message {
    font-size: 2rem;
    color: var(--color-purple);
    margin: 1rem 0;
    text-align: center;
    animation: pop-in 0.5s ease-out forwards;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

@keyframes pop-in {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.celebration-animation {
    animation: celebration-bounce 2s infinite;
}

.celebration-animation .emoji {
    display: inline-block;
    animation: spin-and-grow 3s infinite;
    margin: 0 0.5rem;
}

@keyframes celebration-bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes spin-and-grow {

    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    50% {
        transform: scale(1.5) rotate(180deg);
    }
}

.results-container {
    position: relative;
    overflow: hidden;
}

.results-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center,
            rgba(255, 255, 255, 0.9) 0%,
            rgba(255, 255, 255, 0) 70%);
    animation: glow-pulse 2s infinite;
    pointer-events: none;
}

@keyframes glow-pulse {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.2);
    }
}

/* Enhanced Speech Button Styles */
.speak-btn {
    background: linear-gradient(145deg, #ffcc00, #ff9500);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    font-size: 1.2rem;
    margin-left: 15px;
    vertical-align: middle;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    animation: pulse-glow 2s infinite;
}

.speak-btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 204, 0, 0.3);
    z-index: -1;
    animation: ripple 2s infinite;
}

.speak-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 5px 15px rgba(255, 150, 0, 0.4);
}

.speak-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.speak-btn.speaking {
    animation: speaking 1s infinite alternate;
}

.answer-speak-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-left: 10px;
    font-size: 0.8rem;
    background: linear-gradient(145deg, #5db7ff, #3a95e4);
    color: white;
    border-radius: 50%;
    opacity: 0.8;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.answer-speak-btn:hover {
    opacity: 1;
    transform: scale(1.2);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.speak-result-btn {
    background: linear-gradient(145deg, #5ce95c, #2ecc71);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 15px;
    font-size: 1.3rem;
    cursor: pointer;
    vertical-align: middle;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.speak-result-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 15px rgba(46, 204, 113, 0.4);
}

/* Speech animation effects */
@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes speaking {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 204, 0, 0.7);
    }

    100% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(255, 204, 0, 0);
    }
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 5px rgba(255, 204, 0, 0.5);
    }

    50% {
        box-shadow: 0 0 15px rgba(255, 204, 0, 0.8);
    }

    100% {
        box-shadow: 0 0 5px rgba(255, 204, 0, 0.5);
    }
}

/* Enhanced Language Selector */
.language-selector {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(245, 245, 245, 0.8));
    padding: 1.2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.language-title {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--color-blue), var(--color-purple));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-align: center;
    font-weight: bold;
}

.language-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
}

.lang-btn {
    background: white;
    border: 2px solid transparent;
    padding: 0.8rem 1.2rem;
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.lang-btn .flag {
    font-size: 1.5rem;
}

.lang-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.lang-btn.active {
    border-color: var(--color-blue);
    background: linear-gradient(45deg, var(--color-blue), var(--color-purple));
    color: white;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(var(--color-blue-rgb), 0.4);
    transform: scale(1.05);
}

/* Child-friendly improvements */
.quiz-container {
    position: relative;
    overflow: hidden;
}

.quiz-container::before {
    content: '';
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    background: linear-gradient(135deg,
            var(--color-red) 0%,
            var(--color-orange) 25%,
            var(--color-yellow) 50%,
            var(--color-green) 75%,
            var(--color-blue) 100%);
    background-size: 400% 400%;
    animation: gradientBg 15s ease infinite;
    z-index: -1;
    border-radius: calc(var(--border-radius) + 10px);
    filter: blur(15px);
    opacity: 0.7;
}

.nav-link {
    color: #000;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 0.5rem 1rem;
}

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

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.quiz-section {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 4px solid rgba(255, 255, 255, 0.7);
}

.question {
    font-size: 1.6rem;
    background: rgba(255, 255, 255, 0.85);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    border-left: 5px solid var(--color-blue);
}

.answer-btn {
    padding: 1.2rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-width: 3px;
}

.answer-btn:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.answer-btn.correct {
    border-color: var(--color-green);
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.15), rgba(46, 204, 113, 0.3));
}

.answer-btn.incorrect {
    border-color: var(--color-red);
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.15), rgba(231, 76, 60, 0.3));
}

/* RTL Support for Speech Buttons */
[dir="rtl"] .speak-btn {
    margin-left: 0;
    margin-right: 15px;
}

[dir="rtl"] .answer-speak-btn {
    margin-left: 0;
    margin-right: 10px;
}

[dir="rtl"] .speak-result-btn {
    margin-left: 0;
    margin-right: 15px;
}

[dir="rtl"] .question {
    border-left: none;
    border-right: 5px solid var(--color-blue);
}

/* Responsive adjustments for speech buttons */
@media (max-width: 768px) {
    .speak-btn {
        width: 30px;
        height: 30px;
        font-size: 1rem;
        margin-left: 10px;
    }

    .answer-speak-btn {
        width: 22px;
        height: 22px;
        font-size: 0.7rem;
        margin-left: 8px;
    }

    .speak-result-btn {
        width: 35px;
        height: 35px;
        font-size: 1.1rem;
    }

    .question {
        font-size: 1.4rem;
        padding: 1.2rem;
    }
}

/* Mobile-first responsive styles */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        padding: 0.5rem;
        gap: 10px;
    }

    .nav-menu {
        width: 100%;
        margin: 0 auto;
        padding: 8px;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
        background-color: rgba(255, 255, 255, 0.4);
        position: static;
    }

    .logo-container {
        width: 90%;
        max-width: 300px;
        margin: 0 auto;
    }

    .site-logo {
        height: auto;
        width: 100%;
        max-height: 60px;
        object-fit: contain;
    }

    /* Quiz container responsive styles */
    .quiz-container {
        width: 95%;
        margin: 1rem auto;
        padding: 1rem;
    }

    .quiz-section {
        padding: 1rem;
        margin: 0.5rem;
    }

    .quiz-title {
        font-size: clamp(1.2rem, 4vw, 1.5rem);
        margin-bottom: 1rem;
    }

    .age-question {
        font-size: clamp(1rem, 3vw, 1.2rem);
    }

    .age-buttons {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0 1rem;
    }

    .quiz-btn {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.8rem;
        padding: 0.5rem;
    }

    .category-btn {
        padding: 0.8rem;
        font-size: clamp(0.9rem, 2.5vw, 1rem);
    }

    .answers-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        padding: 0.5rem;
    }

    .answer-btn {
        padding: 0.8rem;
        font-size: clamp(0.9rem, 2.5vw, 1rem);
    }

    /* Language selector responsive styles */
    .language-buttons {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .lang-btn {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .main-header {
        padding: 0.5rem;
        height: auto;
        min-height: 80px;
    }

    .nav-menu {
        padding: 5px;
        gap: 5px;
    }

    .nav-link a {
        font-size: 0.9rem;
        padding: 6px 10px;
    }

    .quiz-title {
        font-size: 1.2rem;
    }

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

    .category-btn {
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }

    .question {
        font-size: 1.1rem;
        padding: 0.8rem;
    }

    .answer-btn {
        padding: 0.7rem;
        font-size: 0.9rem;
    }
}