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

body {
    font-family: 'Quicksand', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1000px;
    background: white;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    min-height: 600px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-family: 'Bubblegum Sans', cursive;
    color: white;
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.score-board {
    display: flex;
    gap: 20px;
}

.score-item {
    background: rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    backdrop-filter: blur(10px);
}

.score-item i {
    color: #ffd700;
    margin-right: 5px;
}

/* Screen Management */
.screen {
    display: none;
    padding: 40px;
    animation: fadeIn 0.5s ease-in-out;
}

.screen.active {
    display: block;
}

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

/* Welcome Screen */
.welcome-content {
    text-align: center;
}

.welcome-title {
    font-family: 'Bubblegum Sans', cursive;
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

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

.welcome-text {
    font-size: 1.3rem;
    color: #555;
    margin-bottom: 20px;
}

.teacher-avatar {
    font-size: 5rem;
    margin: 20px 0;
    animation: wave 2s ease-in-out infinite;
}

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

.welcome-subtitle {
    font-size: 1.1rem;
    color: #777;
    margin-bottom: 40px;
}

.topic-selection h3 {
    font-size: 1.5rem;
    color: #667eea;
    margin-bottom: 30px;
}

.topic-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.topic-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 20px;
    padding: 30px 20px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.topic-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.6);
}

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

.topic-btn i {
    font-size: 2.5rem;
}

.topic-btn span {
    font-size: 1.3rem;
    font-weight: 700;
}

.topic-btn small {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Back Button */
.back-btn {
    background: #e0e0e0;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #555;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.back-btn:hover {
    background: #d0d0d0;
    transform: translateX(-5px);
}

/* Lesson Screen */
.lesson-content {
    max-width: 800px;
    margin: 0 auto;
}

.teacher-says {
    margin-bottom: 30px;
}

.teacher-bubble {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.teacher-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.bubble-content p {
    font-size: 1.2rem;
    color: #333;
    line-height: 1.8;
}

.lesson-visual {
    background: #f8f9fa;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    text-align: center;
    min-height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.visual-item {
    font-size: 3rem;
    animation: popIn 0.5s ease-out;
}

@keyframes popIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.lesson-explanation {
    background: white;
    border: 3px solid #667eea;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
}

.lesson-explanation h3 {
    color: #667eea;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.lesson-explanation p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #555;
    margin-bottom: 10px;
}

.next-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    padding: 15px 40px;
    border-radius: 15px;
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: block;
    margin: 0 auto;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(245, 87, 108, 0.4);
}

.next-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(245, 87, 108, 0.6);
}

/* Practice Screen */
.practice-content {
    max-width: 800px;
    margin: 0 auto;
}

.progress-bar {
    background: #e0e0e0;
    height: 30px;
    border-radius: 15px;
    position: relative;
    margin-bottom: 40px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    border-radius: 15px;
    transition: width 0.5s ease;
    width: 20%;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #333;
    font-weight: 700;
    font-size: 0.9rem;
}

.question-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.question-visual {
    min-height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
}

.question-text {
    font-size: 2rem;
    color: #333;
    text-align: center;
    margin-bottom: 30px;
    font-weight: 700;
}

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

.answer-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 20px;
    border-radius: 15px;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.answer-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);
}

.answer-btn.correct {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    animation: pulse 0.5s ease;
}

.answer-btn.incorrect {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    animation: shake 0.5s ease;
}

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

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

.encouragement {
    text-align: center;
    font-size: 1.2rem;
    color: #667eea;
    font-weight: 600;
    min-height: 30px;
}

/* Results Screen */
.results-content {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.celebration {
    margin-bottom: 40px;
}

.trophy-icon {
    font-size: 6rem;
    animation: bounce 2s infinite;
}

.results-content h2 {
    font-family: 'Bubblegum Sans', cursive;
    font-size: 2.5rem;
    color: #667eea;
    margin: 20px 0;
}

.results-content > p {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 30px;
}

.results-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    border-radius: 20px;
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.stat-card i {
    font-size: 2rem;
    margin-bottom: 10px;
}

.stat-card h3 {
    font-size: 2.5rem;
    margin: 10px 0;
}

.stat-card p {
    font-size: 1rem;
    opacity: 0.9;
}

.teacher-feedback {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.teacher-feedback .teacher-icon {
    font-size: 3rem;
}

.teacher-feedback p {
    font-size: 1.1rem;
    color: #333;
    text-align: left;
}

.results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    border: none;
    padding: 15px 30px;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn.primary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(245, 87, 108, 0.4);
}

.action-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(245, 87, 108, 0.6);
}

.action-btn.secondary {
    background: #e0e0e0;
    color: #555;
}

.action-btn.secondary:hover {
    background: #d0d0d0;
}

/* Confetti Animation */
#confettiContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .score-board {
        gap: 10px;
    }
    
    .score-item {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    .screen {
        padding: 20px;
    }
    
    .welcome-title {
        font-size: 2rem;
    }
    
    .topic-buttons {
        grid-template-columns: 1fr;
    }
    
    .question-text {
        font-size: 1.5rem;
    }
    
    .answer-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .header {
        flex-direction: column;
        gap: 15px;
    }
    
    .welcome-title {
        font-size: 1.5rem;
    }
    
    .teacher-avatar {
        font-size: 4rem;
    }
}
