/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

/* === HEADER === */
header {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* === SCREENS === */
.screen {
    padding: 40px;
}

.screen.hidden {
    display: none;
}

/* === START SCREEN === */
.intro {
    text-align: center;
    margin-bottom: 40px;
}

.intro h2 {
    color: #333;
    margin-bottom: 20px;
}

.intro p {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.intro ul {
    list-style: none;
    text-align: left;
    display: inline-block;
    margin: 20px 0;
}

.intro li {
    padding: 10px 0;
    color: #555;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(139, 92, 246, 0.4);
}

/* === STATISTICS BAR === */
.stats-bar {
    display: flex;
    justify-content: space-around;
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.stat-value.success {
    color: #28a745;
}

.stat-value.error {
    color: #dc3545;
}

/* === PROBLEM CONTAINER === */
.problem-container {
    padding: 30px;
}

.problem-content {
    max-width: 800px;
    margin: 0 auto;
}

.problem-statement {
    background: #eff6ff;
    border-left: 4px solid #8b5cf6;
    padding: 25px;
    margin-bottom: 30px;
    border-radius: 8px;
}

.equation-display {
    font-size: 1.6rem;
    font-weight: bold;
    color: #333;
    text-align: center;
}

/* === CHOICES === */
.choices-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.choice-btn {
    padding: 20px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.choice-btn:hover {
    border-color: #8b5cf6;
    background: #f5f3ff;
    transform: translateX(5px);
}

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

.choice-btn.disabled:hover {
    transform: none;
    border-color: #e9ecef;
    background: white;
}

.choice-number {
    display: inline-block;
    width: 30px;
    height: 30px;
    background: #8b5cf6;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 30px;
    margin-right: 15px;
    font-weight: bold;
    flex-shrink: 0;
}

.choice-text {
    flex: 1;
}

.choice-btn.correct {
    background: #d4edda;
    border-color: #28a745;
}

.choice-btn.correct .choice-number {
    background: #28a745;
}

.choice-btn.wrong {
    background: #f8d7da;
    border-color: #dc3545;
}

.choice-btn.wrong .choice-number {
    background: #dc3545;
}

/* === MASTERY OVERLAY === */
.mastery-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.mastery-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
}

.mastery-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.mastery-text {
    font-size: 2rem;
    font-weight: bold;
    color: #28a745;
}

/* === MILESTONE OVERLAY === */
.milestone-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    animation: fadeIn 0.5s ease-out;
}

.milestone-overlay.fade-out {
    animation: fadeOut 0.5s ease-out;
}

.milestone-content {
    background: white;
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    max-width: 600px;
}

.milestone-stars {
    font-size: 3rem;
    margin-bottom: 20px;
}

.milestone-message {
    font-size: 1.8rem;
    font-weight: bold;
    color: #8b5cf6;
    margin-bottom: 30px;
}

.milestone-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-continue,
.btn-skip {
    padding: 15px 30px;
    font-size: 1.1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-continue {
    background: #3b82f6;
    color: white;
}

.btn-skip {
    background: #dc3545;
    color: white;
}

.btn-continue:hover,
.btn-skip:hover {
    transform: translateY(-2px);
}

/* === ANIMATIONS === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* === RESPONSIVE === */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .container {
        border-radius: 0;
    }
    
    .screen {
        padding: 20px;
    }
    
    .problem-container {
        padding: 20px;
    }
    
    .pool-status {
        flex-direction: column;
        align-items: center;
    }
    
    .pool-badge {
        width: 100%;
        max-width: 300px;
    }
}

/* === ANIMATIONS === */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
