* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
    font-family: 'Segoe UI', Tahoma, sans-serif; 
    background: linear-gradient(-45deg, #0f2027, #203a43, #2c5364, #34495e); 
    background-size: 500% 500%; 
    animation: gradientShift 20s ease infinite; 
    min-height: 100vh; 
    overflow-x: hidden; 
    color: #ecf0f1;
}

@keyframes gradientShift { 
    0%, 100% { background-position: 0% 50%; } 
    50% { background-position: 100% 50%; } 
}

.particles { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.particle { 
    position: absolute; 
    border-radius: 50%; 
    animation: particleFloat linear infinite; 
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.8);
}
.particle.blue { background: rgba(52, 152, 219, 0.9); width: 4px; height: 4px; animation-duration: 15s; }
.particle.green { background: rgba(46, 204, 113, 0.9); width: 6px; height: 6px; animation-duration: 20s; }
.particle.purple { background: rgba(155, 89, 182, 0.9); width: 3px; height: 3px; animation-duration: 18s; }
@keyframes particleFloat { 
    0% { transform: translateY(100vh) rotate(0deg) scale(0); opacity: 0; } 
    10% { opacity: 1; } 
    90% { opacity: 1; } 
    100% { transform: translateY(-100px) rotate(360deg) scale(1); opacity: 0; } 
}

.container { max-width: 1000px; margin: 0 auto; padding: 25px; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; position: relative; z-index: 10; }

.screen { 
    background: rgba(255,255,255,0.1); 
    backdrop-filter: blur(30px); 
    border-radius: 35px; 
    padding: 50px; 
    box-shadow: 0 35px 80px rgba(0,0,0,0.4); 
    transform: translateY(40px) scale(0.95); 
    opacity: 0; 
    transition: all 1s cubic-bezier(0.25,0.46,0.45,0.94); 
    text-align: center; 
    border: 1px solid rgba(255,255,255,0.2);
    position: relative;
    overflow: hidden;
}
.screen::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
}
.screen-active { transform: translateY(0) scale(1); opacity: 1; }

h1 { 
    font-size: 3.5em; 
    background: linear-gradient(45deg, #3498db, #2ecc71, #f39c12, #e74c3c, #9b59b6); 
    background-size: 400% 400%; 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
    margin-bottom: 30px; 
    animation: titleGlow 3s ease-in-out infinite alternate, bgShift 6s linear infinite;
    text-shadow: 0 0 30px rgba(255,255,255,0.5);
}
@keyframes titleGlow { from { filter: drop-shadow(0 0 30px #3498db); } to { filter: drop-shadow(0 0 50px #2ecc71); } }
@keyframes bgShift { 0% { background-position: 0% 50%; } 100% { background-position: 400% 50%; } }

.welcome-text, .setup-text { font-size: 1.6em; margin-bottom: 40px; color: #bdc3c7; line-height: 1.6; }
.count-display { font-size: 1.6em; color: #2ecc71; font-weight: 700; margin: 30px 0; }

.question-container { 
    background: linear-gradient(145deg, rgba(52, 152, 219, 0.2), rgba(41, 128, 185, 0.3)); 
    border-radius: 30px; 
    padding: 45px; 
    margin: 30px 0; 
    box-shadow: 0 30px 70px rgba(52, 152, 219, 0.3); 
    position: relative; 
    border: 1px solid rgba(52, 152, 219, 0.4);
    animation: slideInUp 1.2s ease;
}
@keyframes slideInUp { from { transform: translateY(100px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.question-number { 
    position: absolute; top: -20px; right: -20px; 
    background: linear-gradient(45deg, #e74c3c, #c0392b); 
    color: white; width: 70px; height: 70px; border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; 
    font-weight: 800; font-size: 1.6em; 
    box-shadow: 0 15px 35px rgba(231, 76, 60, 0.6); 
    animation: pulseRing 2s infinite;
}
@keyframes pulseRing { 0% { box-shadow: 0 0 0 0 rgba(231,76,60,0.7); } 70% { box-shadow: 0 0 0 20px rgba(231,76,60,0); } 100% { box-shadow: 0 0 0 0 rgba(231,76,60,0); } }

.question-text { font-size: 1.6em; font-weight: 700; color: #ecf0f1; margin-bottom: 35px; line-height: 1.6; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }

.answers { display: grid; gap: 22px; }
.answer-btn { 
    background: rgba(255,255,255,0.15); 
    border: 2px solid rgba(255,255,255,0.2); 
    padding: 25px 35px; 
    border-radius: 25px; 
    font-size: 1.25em; 
    font-weight: 600; 
    cursor: pointer; 
    transition: all 0.5s ease; 
    position: relative; 
    overflow: hidden; 
    text-align: left;
    color: #ecf0f1;
}
.answer-btn:hover { 
    transform: translateY(-10px) scale(1.02); 
    box-shadow: 0 25px 60px rgba(0,0,0,0.4); 
    border-color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.25);
}
.answer-btn:active { transform: scale(0.98); }
.answer-btn.correct { 
    background: linear-gradient(45deg, #27ae60, #2ecc71); 
    border-color: #27ae60; 
    color: white; 
    animation: successPulse 1s ease; 
    box-shadow: 0 20px 50px rgba(39, 174, 96, 0.6);
    transform: scale(1.05) !important;
}
.answer-btn.incorrect { 
    background: linear-gradient(45deg, #e74c3c, #c0392b); 
    border-color: #e74c3c; 
    color: white; 
    animation: errorShake 0.8s ease; 
    box-shadow: 0 20px 50px rgba(231, 76, 60, 0.6);
}
@keyframes successPulse { 0% { transform: scale(1); } 50% { transform: scale(1.1) rotate(5deg); } 100% { transform: scale(1.05); } }
@keyframes errorShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }

.feedback { 
    margin: 30px 0; padding: 30px; border-radius: 25px; 
    font-size: 1.4em; font-weight: 700; 
    opacity: 0; transform: translateY(30px) scale(0.9); 
    transition: all 0.8s ease; 
}
.feedback.show { opacity: 1; transform: translateY(0) scale(1); }
.feedback.correct { 
    background: linear-gradient(135deg, #27ae60, #2ecc71); 
    color: white; 
    box-shadow: 0 15px 40px rgba(39, 174, 96, 0.5);
    animation: feedbackPulse 2s infinite;
}
.feedback.incorrect { 
    background: linear-gradient(135deg, #e74c3c, #c0392b); 
    color: white; 
    box-shadow: 0 15px 40px rgba(231, 76, 60, 0.5);
}
@keyframes feedbackPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }

.progress-bar { 
    width: 100%; height: 16px; 
    background: rgba(255,255,255,0.15); 
    border-radius: 20px; 
    margin: 30px 0; 
    overflow: hidden; 
}
.progress-fill { 
    height: 100%; 
    background: linear-gradient(90deg, #3498db, #2ecc71); 
    width: 0%; 
    transition: width 1s ease; 
    border-radius: 20px; 
}

.btn { 
    background: linear-gradient(45deg, #3498db, #2980b9); 
    color: white; border: none; 
    padding: 22px 50px; border-radius: 50px; 
    font-size: 1.3em; font-weight: 700; 
    cursor: pointer; 
    transition: all 0.5s ease; 
    box-shadow: 0 15px 45px rgba(52, 152, 219, 0.4); 
    margin: 20px 10px; 
    text-transform: uppercase; 
    letter-spacing: 2px;
}
.btn:hover { transform: translateY(-12px) scale(1.08); box-shadow: 0 25px 70px rgba(52, 152, 219, 0.6); }
.next-btn { background: linear-gradient(45deg, #27ae60, #2ecc71) !important; margin-top: 30px; }
.download-btn { background: linear-gradient(45deg, #f39c12, #e67e22) !important; }

.number-input { 
    width: 140px; height: 80px; 
    font-size: 2.5em; text-align: center; 
    border: 3px solid rgba(255,255,255,0.4); 
    border-radius: 25px; 
    margin: 25px; 
    background: rgba(255,255,255,0.15); 
    font-weight: 700; 
    color: #ecf0f1;
    transition: all 0.4s ease;
}
.number-input:focus { 
    outline: none; 
    border-color: #3498db; 
    transform: scale(1.08); 
    box-shadow: 0 15px 40px rgba(52, 152, 219, 0.4);
}

.score-display { 
    font-size: 6em; 
    font-weight: 900; 
    background: linear-gradient(45deg, #2ecc71, #27ae60); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
    margin: 40px 0; 
    animation: scoreGlow 2.5s ease-in-out infinite;
    text-shadow: 0 0 50px rgba(46, 204, 113, 1);
}
@keyframes scoreGlow { 0%, 100% { filter: drop-shadow(0 0 30px #2ecc71); } 50% { filter: drop-shadow(0 0 60px #27ae60); } }

.results-stats {
    display:
.results-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin: 40px 0;
}
.stat-card {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.4s ease;
}
.stat-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 60px rgba(0,0,0,0.4);
}
.stat-number {
    font-size: 2.5em;
    font-weight: 800;
    display: block;
    margin-bottom: 10px;
}
.stat-label {
    font-size: 1.1em;
    color: #bdc3c7;
}

.grade-badge {
    display: inline-block;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.4em;
    font-weight: 700;
    margin: 20px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.score-message {
    font-size: 1.6em;
    margin: 30px 0;
    color: #bdc3c7;
    font-weight: 500;
}

.results-actions {
    margin: 40px 0;
}

.confetti { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    pointer-events: none; z-index: 1000; 
}
.confetti-piece { 
    position: absolute; width: 12px; height: 12px; 
    background: #f39c12; border-radius: 50%; 
    animation: confettiFall 3s linear infinite; 
}
@keyframes confettiFall { 
    0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; } 
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; } 
}

/* Mobile Responsive */
@media (max-width: 768px) { 
    .container { padding: 20px 15px; } 
    h1 { font-size: 2.8em; } 
    .screen { padding: 35px 25px; }
    .question-container { padding: 30px 25px; } 
    .answer-btn { padding: 20px 25px; font-size: 1.1em; } 
    .score-display { font-size: 4.5em; }
    .btn { padding: 18px 30px; font-size: 1.1em; }
    .number-input { width: 120px; height: 70px; font-size: 2em; }
}

@media (max-width: 480px) {
    h1 { font-size: 2.2em; }
    .screen { padding: 25px 20px; }
    .question-text { font-size: 1.3em; }
    .answer-btn { padding: 18px 20px; font-size: 1em; }
}
