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

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

.container {
    width: 100%;
    max-width: 800px;
}

.screen {
    background: white;
    border-radius: 24px;
    padding: 48px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.screen.active {
    display: block;
}

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

h1 {
    font-size: 3rem;
    color: #667eea;
    text-align: center;
    margin-bottom: 16px;
}

.subtitle {
    font-size: 1.25rem;
    color: #666;
    text-align: center;
    margin-bottom: 32px;
}

.message {
    font-size: 1.5rem;
    color: #333;
    text-align: center;
    margin-bottom: 24px;
}

.info {
    background: #f8f9ff;
    border-radius: 12px;
    padding: 24px;
    margin-top: 32px;
}

.info p {
    font-size: 1.1rem;
    color: #555;
    margin: 8px 0;
}

/* Buttons */
.btn {
    padding: 16px 32px;
    font-size: 1.25rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
}

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

.btn:active {
    transform: translateY(0);
}

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

.btn-secondary {
    background: #e0e7ff;
    color: #667eea;
    margin-top: 16px;
}

.btn-mic {
    background: #10b981;
    color: white;
    font-size: 1.5rem;
    padding: 20px 40px;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Practice Screen */
.header {
    margin-bottom: 32px;
}

.stats {
    display: flex;
    justify-content: space-around;
    gap: 16px;
    flex-wrap: wrap;
}

.stat {
    background: #f8f9ff;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1.1rem;
    color: #555;
}

.stat strong {
    color: #667eea;
    font-size: 1.3rem;
}

.problem-container {
    text-align: center;
    margin: 48px 0;
}

.problem {
    font-size: 6rem;
    font-weight: bold;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
}

.operator {
    color: #667eea;
}

.answer {
    font-size: 4rem;
    font-weight: bold;
    color: #10b981;
    margin-top: 24px;
}

.answer.hidden {
    display: none;
}

/* Feedback */
.feedback {
    text-align: center;
    padding: 24px;
    border-radius: 12px;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 24px 0;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.feedback.hidden {
    display: none;
}

.feedback.correct {
    background: #d1fae5;
    color: #065f46;
}

.feedback.incorrect {
    background: #fee2e2;
    color: #991b1b;
}

/* Countdown Timer */
.countdown-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    margin: 32px 0;
}

.countdown-container.hidden {
    display: none;
}

.countdown-circle {
    position: relative;
    width: 150px;
    height: 150px;
}

.countdown-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.countdown-bg {
    fill: none;
    stroke: #e0e7ff;
    stroke-width: 8;
}

.countdown-progress {
    fill: none;
    stroke: #667eea;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.1s linear;
}

.countdown-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    font-weight: bold;
    color: #667eea;
}

/* Listening Indicator */
.listening {
    text-align: center;
    margin: 32px 0;
}

.listening.hidden {
    display: none;
}

.mic-animation {
    font-size: 4rem;
    animation: pulse 1.5s ease-in-out infinite;
}

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

.listening p {
    font-size: 1.5rem;
    color: #667eea;
    font-weight: 600;
    margin-top: 16px;
}

.controls {
    margin-top: 32px;
}

/* Success Screen */
.confetti {
    font-size: 3rem;
    text-align: center;
    margin: 32px 0;
    animation: bounce 1s ease-in-out infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .screen {
        padding: 32px 24px;
    }

    h1 {
        font-size: 2rem;
    }

    .problem {
        font-size: 4rem;
        gap: 16px;
    }

    .answer {
        font-size: 3rem;
    }

    .btn {
        font-size: 1.1rem;
        padding: 14px 28px;
    }

    .stats {
        flex-direction: column;
    }
}
