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

body {
    font-family: 'Fredoka One', 'Comic Sans MS', cursive, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
    position: relative;
}

/* Animated background stars */
body::before {
    content: '';
    position: fixed;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, white, transparent),
        radial-gradient(2px 2px at 60px 70px, white, transparent),
        radial-gradient(1px 1px at 50px 50px, white, transparent),
        radial-gradient(1px 1px at 130px 80px, white, transparent),
        radial-gradient(2px 2px at 90px 10px, white, transparent);
    background-size: 200px 200px;
    animation: sparkle 3s linear infinite;
    opacity: 0.5;
    z-index: 0;
}

@keyframes sparkle {
    from { transform: translateY(0); }
    to { transform: translateY(200px); }
}

.game-container {
    background: white;
    border-radius: 30px;
    padding: 30px;
    max-width: 900px;
    width: 100%;
    box-shadow: 0 30px 80px rgba(0,0,0,0.4), 0 0 0 10px rgba(255,255,255,0.1);
    animation: slideIn 0.5s ease-out;
    position: relative;
    z-index: 1;
}

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

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

.controls-area {
    text-align: center;
    margin-bottom: 20px;
}

.sound-enable-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    border: 4px solid #fff;
    padding: 20px 50px;
    border-radius: 30px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.5em;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.6);
    display: inline-block;
    -webkit-animation: bigPulse 1.5s infinite, shake 2s infinite;
    animation: bigPulse 1.5s infinite, shake 2s infinite;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.sound-enable-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 35px rgba(255, 107, 107, 0.8);
}

.sound-enable-btn:active {
    transform: translateY(-2px) scale(1.02);
}

.sound-enable-btn.enabled {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    animation: none;
    font-size: 1.2em;
    padding: 12px 30px;
    cursor: default;
}

@keyframes bigPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(255, 107, 107, 0.6);
    }
    50% { 
        transform: scale(1.08);
        box-shadow: 0 12px 40px rgba(255, 107, 107, 1);
    }
}

@-webkit-keyframes bigPulse {
    0%, 100% { 
        -webkit-transform: scale(1);
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(255, 107, 107, 0.6);
    }
    50% { 
        -webkit-transform: scale(1.08);
        transform: scale(1.08);
        box-shadow: 0 12px 40px rgba(255, 107, 107, 1);
    }
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(-3deg); }
    20% { transform: rotate(3deg); }
    30% { transform: rotate(-3deg); }
    40% { transform: rotate(3deg); }
    50%, 100% { transform: rotate(0deg); }
}

@-webkit-keyframes shake {
    0%, 100% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
    10% { -webkit-transform: rotate(-3deg); transform: rotate(-3deg); }
    20% { -webkit-transform: rotate(3deg); transform: rotate(3deg); }
    30% { -webkit-transform: rotate(-3deg); transform: rotate(-3deg); }
    40% { -webkit-transform: rotate(3deg); transform: rotate(3deg); }
    50%, 100% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
}

/* Old toggle switch styles - replaced with big button 
.sound-toggle-container {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.9);
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.sound-label {
    font-size: 1.2em;
    font-weight: bold;
    color: #666;
    transition: all 0.3s;
}

.sound-label.active {
    color: #4CAF50;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #e0e0e0 0%, #bdbdbd 100%);
    border-radius: 34px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background: white;
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(26px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.toggle-switch:hover .toggle-slider {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 0 8px rgba(0, 0, 0, 0.05);
}

.toggle-switch input:checked:hover + .toggle-slider {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 8px rgba(76, 175, 80, 0.1);
}

@keyframes togglePulse {
    0%, 100% {
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(244, 67, 54, 0);
    }
    50% {
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 0 8px rgba(244, 67, 54, 0.3);
    }
}

.toggle-switch input:not(:checked) + .toggle-slider {
    animation: togglePulse 2s infinite;
}
End of old toggle CSS */

.header h1 {
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.2), 0 0 30px rgba(102,126,234,0.3);
    animation: titlePulse 2s ease-in-out infinite, rainbow 5s linear infinite;
}

@keyframes rainbow {
    0%, 100% { color: #667eea; }
    25% { color: #f093fb; }
    50% { color: #764ba2; }
    75% { color: #FA8BFF; }
}

.subtitle {
    color: #666;
    font-size: 1.2em;
    margin-bottom: 10px;
}

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

@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 6px 25px rgba(240, 147, 251, 0.8);
    }
}

.score-board {
    display: flex;
    justify-content: space-around;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 20px;
    animation: scoreboardSlide 0.5s ease-out;
}

@keyframes scoreboardSlide {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.score-item {
    color: white;
    font-size: 1.2em;
    font-weight: bold;
    transition: transform 0.3s;
}

.score-item:hover {
    transform: scale(1.1);
}

.score-item.pulse {
    animation: scorePulse 0.5s ease-in-out;
}

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

.streak-display {
    text-align: center;
    margin: 10px 0;
    font-size: 1.3em;
    color: #ff6b6b;
    font-weight: bold;
    animation: streakGlow 1s ease-in-out infinite;
}

@keyframes streakGlow {
    0%, 100% { text-shadow: 0 0 5px rgba(255,107,107,0.5); }
    50% { text-shadow: 0 0 20px rgba(255,107,107,1); }
}

.subject-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.subject-btn {
    padding: 20px;
    border: none;
    border-radius: 15px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

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

.subject-btn:hover::before {
    width: 300px;
    height: 300px;
}

.subject-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.subject-btn:active {
    transform: translateY(-2px) scale(0.98);
}

.subject-btn.completed::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 1.5em;
    color: #4CAF50;
    background: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.subject-btn.language { background: linear-gradient(135deg, #FA8BFF 0%, #2BD2FF 90%); }
.subject-btn.math { background: linear-gradient(135deg, #FFD26F 0%, #3677FF 100%); }
.subject-btn.bible { background: linear-gradient(135deg, #FEE140 0%, #FA709A 100%); }
.subject-btn.science { background: linear-gradient(135deg, #30E8BF 0%, #FF8235 100%); }
.subject-btn.arts { background: linear-gradient(135deg, #C471F5 0%, #FA71CD 100%); }

.game-area {
    display: none;
    min-height: 400px;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    animation: fadeIn 0.3s ease-in;
}

.game-area.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.question-box {
    background: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    animation: questionSlide 0.4s ease-out;
}

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

.question {
    font-size: 1.4em;
    color: #333;
    margin-bottom: 20px;
    font-weight: bold;
}

.attempts-display {
    text-align: center;
    margin-bottom: 15px;
    padding: 10px;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
    border-radius: 10px;
    border: 2px solid #ffcccc;
}

.attempts-label {
    font-size: 1.1em;
    font-weight: bold;
    color: #666;
    margin-right: 10px;
}

.heart-container {
    font-size: 1.5em;
    letter-spacing: 5px;
}

.heart-container .updating {
    animation: heartBeat 0.5s ease-in-out;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1.1); }
    75% { transform: scale(1.3); }
}

.timer {
    text-align: center;
    font-size: 2em;
    color: #667eea;
    margin: 10px 0;
    font-weight: bold;
}

.timer.warning {
    color: #ff6b6b;
    animation: timerPulse 0.5s ease-in-out infinite;
}

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

.options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.option-btn {
    padding: 15px 25px;
    border: 3px solid #667eea;
    background: white;
    border-radius: 12px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    color: #333;
    position: relative;
    overflow: hidden;
}

.option-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.option-btn:hover::before {
    width: 300px;
    height: 300px;
}

.option-btn:hover {
    background: #667eea;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

.option-btn.correct {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
    animation: correctBounce 0.6s ease-out;
}

.option-btn.wrong {
    background: #f44336;
    color: white;
    border-color: #f44336;
    animation: wrongShake 0.5s ease-out;
}

@keyframes correctBounce {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.2) rotate(5deg); }
    50% { transform: scale(1.1) rotate(-5deg); }
    75% { transform: scale(1.15) rotate(3deg); }
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.feedback {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: bold;
    text-align: center;
    display: none;
}

.feedback.show {
    display: block;
    animation: feedbackPop 0.5s ease-out;
}

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

.feedback.correct {
    background: #c8e6c9;
    color: #2e7d32;
}

.feedback.wrong {
    background: #ffcdd2;
    color: #c62828;
}

/* ========== BUTTON STYLES - Kid-Friendly & Modern ========== */

/* Base button styles */
.next-btn, .back-btn, .hint-btn, .speak-question-btn, .speak-options-btn, 
.speak-btn, .repeat-btn, .practice-btn, .print-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 15px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

/* Ripple effect for all buttons */
.next-btn::after, .back-btn::after, .hint-btn::after, 
.speak-question-btn::after, .speak-options-btn::after,
.speak-btn::after, .repeat-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.next-btn:active::after, .back-btn:active::after, .hint-btn:active::after,
.speak-question-btn:active::after, .speak-options-btn:active::after,
.speak-btn:active::after, .repeat-btn:active::after {
    width: 300px;
    height: 300px;
}

/* Next Button - Purple/Success */
.next-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    float: right;
    margin-top: 20px;
}

.next-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Back Button - Gray/Neutral */
.back-btn {
    background: linear-gradient(135deg, #e0e0e0 0%, #c0c0c0 100%);
    color: #333;
    float: left;
}

.back-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #d0d0d0 0%, #b0b0b0 100%);
}

/* Hint Button - Yellow/Orange */
.hint-btn {
    background: linear-gradient(135deg, #FEE140 0%, #FA709A 100%);
    color: white;
    margin: 20px 10px 0 0;
}

.hint-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(250, 112, 154, 0.4);
}

/* Speech Control Buttons */
.speak-question-btn {
    background: linear-gradient(135deg, #FA8BFF 0%, #2BD2FF 90%);
    color: white;
}

.speak-question-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(250, 139, 255, 0.4);
}

.speak-options-btn {
    background: linear-gradient(135deg, #30E8BF 0%, #FF8235 100%);
    color: white;
}

.speak-options-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 130, 53, 0.4);
}

/* Bible Verse Buttons */
.speak-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    margin: 10px;
}

.speak-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(118, 75, 162, 0.4);
}

.repeat-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    padding: 15px 30px;
    margin: 10px;
}

.repeat-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

.practice-btn {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    padding: 12px 25px;
    margin: 5px;
    border: none;
    border-radius: 12px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.practice-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.5);
}

.practice-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Print Button */
.print-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 15px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    margin: 10px;
}

.print-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.5);
}

/* In-Game Sound Toggle Button (appears on question screens) */
.sound-toggle {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 20px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    float: right;
    margin-left: 10px;
    transition: all 0.3s;
}

.sound-toggle:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5);
}

.sound-toggle:active {
    transform: translateY(0) scale(1);
}

/* When sound is OFF */
.sound-toggle.sound-off {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

.sound-toggle.sound-off:hover {
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.5);
}

/* Active state for all buttons */
.next-btn:active, .back-btn:active, .hint-btn:active,
.speak-question-btn:active, .speak-options-btn:active,
.speak-btn:active, .repeat-btn:active, .practice-btn:active, .print-btn:active {
    transform: translateY(-1px) scale(0.98);
}

.math-problem {
    font-size: 3em;
    color: #667eea;
    text-align: center;
    margin: 30px 0;
    font-weight: bold;
    animation: mathFloat 2s ease-in-out infinite;
}

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

.celebration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

@keyframes star-fall {
    0% { transform: translateY(-100px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

.star {
    position: absolute;
    font-size: 2em;
    animation: star-fall 3s linear;
}

.completion-message {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 20px;
    color: white;
    font-size: 1.5em;
    animation: completionZoom 0.6s ease-out;
}

@keyframes completionZoom {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    50% { transform: scale(1.1) rotate(10deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.progress-bar {
    background: #e0e0e0;
    border-radius: 10px;
    height: 20px;
    margin: 20px 0;
    overflow: hidden;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}

.progress-fill {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    transition: width 0.5s ease-out;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.achievements-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    color: white;
}

.achievement-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 15px;
    border-radius: 20px;
    margin: 5px;
    font-weight: bold;
    backdrop-filter: blur(10px);
    animation: badgePop 0.5s ease-out;
}

@keyframes badgePop {
    0% { transform: scale(0) rotate(-180deg); }
    50% { transform: scale(1.2) rotate(10deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.achievement-badge.new {
    animation: badgeShine 1s ease-out;
}

@keyframes badgeShine {
    0%, 100% { box-shadow: 0 0 0 rgba(255, 255, 255, 0); }
    50% { box-shadow: 0 0 20px rgba(255, 255, 255, 0.8); }
}

.hint-box {
    background: #fff3cd;
    border: 2px solid #ffc107;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    color: #856404;
    animation: hintSlide 0.4s ease-out;
}

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

.certificate {
    background: white;
    padding: 40px;
    border: 10px solid #667eea;
    border-radius: 20px;
    text-align: center;
    max-width: 600px;
    margin: 20px auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.certificate h2 {
    color: #667eea;
    font-size: 2em;
    margin-bottom: 20px;
}

.certificate .name {
    font-size: 2.5em;
    color: #764ba2;
    margin: 20px 0;
    font-weight: bold;
}

.print-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s;
}

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

/* Accessibility improvements */
.option-btn:focus,
.next-btn:focus,
.back-btn:focus,
.hint-btn:focus,
.subject-btn:focus {
    outline: 3px solid #ffc107;
    outline-offset: 2px;
}

/* Responsive design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8em;
    }

    .score-board {
        flex-direction: column;
        gap: 10px;
    }

    .subject-menu {
        grid-template-columns: 1fr;
    }

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

    .math-problem {
        font-size: 2em;
    }

    .sound-toggle {
        position: static;
        margin: 10px auto;
        display: block;
    }
}

/* Loading animation */
.loading {
    text-align: center;
    font-size: 2em;
    color: #667eea;
    animation: loadingPulse 1.5s ease-in-out infinite;
}

@keyframes loadingPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Confetti animation */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #f0f;
    position: absolute;
    animation: confetti-fall 3s linear forwards;
}

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

/* Bible Verse Memorization Styles */
.verse-memorization {
    animation: fadeIn 0.5s ease-in;
}

.verse-card {
    background: linear-gradient(135deg, #FEE140 0%, #FA709A 100%);
    padding: 40px;
    border-radius: 20px;
    color: white;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    margin: 20px 0;
}

.verse-icon {
    font-size: 4em;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

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

.verse-text {
    font-size: 1.8em;
    font-weight: bold;
    line-height: 1.5;
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    padding: 20px;
    background: rgba(255,255,255,0.2);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.verse-explanation {
    font-size: 1.3em;
    margin-top: 15px;
    font-style: italic;
}

.verse-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 30px 0;
}

.speak-btn, .repeat-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 15px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.speak-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.repeat-btn {
    background: linear-gradient(135deg, #30E8BF 0%, #FF8235 100%);
}

.speak-btn:hover, .repeat-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.verse-practice {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin: 20px 0;
}

.practice-counter {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0;
}

.practice-btn {
    padding: 15px 25px;
    border: 3px solid #667eea;
    background: white;
    border-radius: 12px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    color: #667eea;
}

.practice-btn:hover:not(:disabled) {
    background: #667eea;
    color: white;
    transform: scale(1.05);
}

.practice-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Question Interface Enhancements */
.question-icon {
    display: inline-block;
    font-size: 1.5em;
    margin-right: 10px;
    animation: bounce 2s ease-in-out infinite;
}

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

.speak-question-btn {
    background: linear-gradient(135deg, #FA8BFF 0%, #2BD2FF 90%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 10px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    margin: 10px 5px;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.speak-question-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

.speak-options-btn {
    background: linear-gradient(135deg, #30E8BF 0%, #FF8235 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 10px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    margin: 10px 5px;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.speak-options-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

.speech-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
}

/* Math Problem Enhancements */
.math-problem-container {
    text-align: center;
    margin: 30px 0;
}

.difficulty-stars {
    font-size: 1.5em;
    margin-top: 10px;
    animation: starGlow 1.5s ease-in-out infinite;
}

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

/* Achievement System */
.achievement-notification {
    position: fixed;
    top: 20px;
    right: -400px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 2000;
    transition: right 0.5s ease-out;
}

.achievement-notification.show {
    right: 20px;
}

.achievement-content h3 {
    margin: 0 0 10px 0;
    font-size: 1.3em;
}

.achievement-content p {
    margin: 0;
    font-size: 1.1em;
}

/* Completion Enhancements */
.completion-icon {
    font-size: 5em;
    animation: rotateIn 0.6s ease-out;
}

@keyframes rotateIn {
    from {
        transform: rotate(-180deg) scale(0);
        opacity: 0;
    }
    to {
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
}

.stars-display {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.star-burst {
    font-size: 3em;
    animation: starBurst 0.6s ease-out;
    animation-fill-mode: both;
}

.star-burst:nth-child(1) { animation-delay: 0s; }
.star-burst:nth-child(2) { animation-delay: 0.1s; }
.star-burst:nth-child(3) { animation-delay: 0.2s; }
.star-burst:nth-child(4) { animation-delay: 0.3s; }
.star-burst:nth-child(5) { animation-delay: 0.4s; }

@keyframes starBurst {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.3) rotate(180deg);
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 1;
    }
}

.grand-completion {
    margin: 30px 0;
    padding: 30px;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

/* Progress Container */
.progress-container {
    margin: 20px 0;
}

/* Enhanced Subject Buttons with Icons */
.subject-btn.completed {
    position: relative;
    border: 3px solid #4CAF50;
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .game-container {
        box-shadow: none;
    }
    
    .back-btn, .next-btn, .print-btn, .sound-toggle {
        display: none;
    }
    
    .certificate {
        break-inside: avoid;
    }
}

/* Enhanced Responsive Design */
@media (max-width: 768px) {
    body::before {
        animation: none;
    }
    
    .header h1 {
        font-size: 1.8em;
    }

    .verse-text {
        font-size: 1.3em;
    }
    
    .verse-controls {
        flex-direction: column;
    }
    
    .practice-counter {
        flex-direction: column;
    }
    
    .achievement-notification {
        right: -100%;
        width: 90%;
    }
    
    .achievement-notification.show {
        right: 5%;
    }
    
    .speech-controls {
        flex-direction: column;
    }
    
    .speak-question-btn,
    .speak-options-btn {
        width: 100%;
        margin: 5px 0;
        -webkit-appearance: none;
        appearance: none;
        border: none;
    }
    
    /* Force gradients on mobile */
    .speak-question-btn {
        background: -webkit-linear-gradient(135deg, #FA8BFF 0%, #2BD2FF 90%) !important;
        background: linear-gradient(135deg, #FA8BFF 0%, #2BD2FF 90%) !important;
    }
    
    .speak-options-btn {
        background: -webkit-linear-gradient(135deg, #30E8BF 0%, #FF8235 100%) !important;
        background: linear-gradient(135deg, #30E8BF 0%, #FF8235 100%) !important;
    }
    
    .sound-enable-btn {
        -webkit-appearance: none !important;
        appearance: none !important;
        background: -webkit-linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%) !important;
        background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%) !important;
        border: 4px solid #fff !important;
        color: white !important;
        font-weight: bold !important;
        font-size: 1.3em !important;
        padding: 18px 40px !important;
        border-radius: 30px !important;
        box-shadow: 0 8px 25px rgba(255, 107, 107, 0.6) !important;
        text-shadow: 2px 2px 4px rgba(0,0,0,0.3) !important;
    }
    
    .sound-enable-btn.enabled {
        background: -webkit-linear-gradient(135deg, #4CAF50 0%, #45a049 100%) !important;
        background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%) !important;
        font-size: 1.1em !important;
        padding: 12px 30px !important;
    }
    
    .sound-toggle {
        -webkit-appearance: none;
        appearance: none;
        background: -webkit-linear-gradient(135deg, #4CAF50 0%, #45a049 100%) !important;
        background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%) !important;
    }
    
    .sound-toggle.sound-off {
        background: -webkit-linear-gradient(135deg, #f44336 0%, #d32f2f 100%) !important;
        background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%) !important;
    }
    
    /* All other buttons */
    .next-btn, .back-btn, .hint-btn, .speak-btn, .repeat-btn, .practice-btn {
        -webkit-appearance: none;
        appearance: none;
    }
    
    .next-btn {
        background: -webkit-linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    }
    
    .back-btn {
        background: -webkit-linear-gradient(135deg, #e0e0e0 0%, #c0c0c0 100%) !important;
        background: linear-gradient(135deg, #e0e0e0 0%, #c0c0c0 100%) !important;
    }
    
    .hint-btn {
        background: -webkit-linear-gradient(135deg, #FEE140 0%, #FA709A 100%) !important;
        background: linear-gradient(135deg, #FEE140 0%, #FA709A 100%) !important;
    }
    
    .speak-btn {
        background: -webkit-linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    }
    
    .repeat-btn {
        background: -webkit-linear-gradient(135deg, #4CAF50 0%, #45a049 100%) !important;
        background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%) !important;
    }
    
    .practice-btn {
        background: -webkit-linear-gradient(135deg, #2196F3 0%, #1976D2 100%) !important;
        background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%) !important;
    }
    
    #speaking-indicator {
        top: 10px;
        right: 10px;
        font-size: 0.9em;
        padding: 8px 15px;
    }
}

/* Loading States */
.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Hover Effects for Options */
.option-btn {
    background: linear-gradient(135deg, white 0%, #f8f9fa 100%);
}

.option-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}