/* ═══════════════════════════════════════════════════════
   MISSION PAGE STYLES — Gamified Learning
   ═══════════════════════════════════════════════════════ */

/* ─── MISSION TOPBAR ─── */
.mission-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(10, 14, 23, 0.95);
    border-bottom: 1px solid var(--border-subtle);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 2rem;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-back {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.topbar-back:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.topbar-mission-id {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--purple-light);
    background: rgba(139, 92, 246, 0.1);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
}

.topbar-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--text-primary);
}

.topbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.topbar-progress {
    width: 200px;
    height: 6px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.topbar-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold));
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-xp {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.topbar-step {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ─── MISSION CONTAINER ─── */
.mission-container {
    max-width: 780px;
    margin: 0 auto;
    padding: 100px 2rem 120px;
    min-height: 100vh;
}

/* ─── STEP CONTENT ─── */
.mission-step {
    display: none;
    animation: stepFadeIn 0.5s ease;
}

.mission-step.active {
    display: block;
}

@keyframes stepFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── LESSON CONTENT ─── */
.lesson-content {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 2.5rem;
    backdrop-filter: var(--glass-blur);
    margin-bottom: 2rem;
}

.lesson-content h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.lesson-content h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--gold);
    margin: 1.75rem 0 0.75rem;
}

.lesson-content p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.lesson-content strong {
    color: var(--text-primary);
}

.lesson-content em {
    color: var(--gold-light);
    font-style: italic;
}

.lesson-highlight {
    background: rgba(212, 168, 85, 0.06);
    border-left: 3px solid var(--gold);
    padding: 1rem 1.25rem;
    border-radius: 0 12px 12px 0;
    margin: 1.5rem 0;
}

.lesson-highlight p {
    margin-bottom: 0;
    color: var(--gold-light);
    font-style: italic;
}

.lesson-visual {
    text-align: center;
    padding: 2rem;
    background: rgba(139, 92, 246, 0.05);
    border-radius: 16px;
    margin: 1.5rem 0;
    border: 1px solid rgba(139, 92, 246, 0.1);
}

.lesson-visual i {
    font-size: 4rem;
    color: var(--gold);
    opacity: 0.4;
}

.lesson-visual .visual-label {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

/* ─── QUIZ STYLES ─── */
.quiz-question {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 2rem 2.5rem;
    margin-bottom: 1.5rem;
    backdrop-filter: var(--glass-blur);
}

.quiz-number {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--purple-light);
    margin-bottom: 0.75rem;
}

.quiz-question h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    line-height: 1.4;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.quiz-option:hover {
    border-color: var(--purple);
    background: rgba(139, 92, 246, 0.06);
    color: var(--text-primary);
}

.quiz-option .option-letter {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(139, 92, 246, 0.08);
    color: var(--purple-light);
    flex-shrink: 0;
}

.quiz-option.selected {
    border-color: var(--gold);
    background: rgba(212, 168, 85, 0.08);
    color: var(--text-primary);
}

.quiz-option.selected .option-letter {
    background: var(--gold);
    color: var(--bg-primary);
}

.quiz-option.correct {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.08);
    color: var(--text-primary);
}

.quiz-option.correct .option-letter {
    background: #22c55e;
    color: white;
}

.quiz-option.wrong {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.06);
    opacity: 0.6;
}

.quiz-option.wrong .option-letter {
    background: #ef4444;
    color: white;
}

.quiz-option.disabled {
    pointer-events: none;
}

.quiz-feedback {
    margin-top: 1rem;
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    display: none;
}

.quiz-feedback.show {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quiz-feedback.correct {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.quiz-feedback.wrong {
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* ─── MATCHING GAME ─── */
.match-game {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.match-column h3 {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-align: center;
}

.match-item {
    padding: 0.9rem 1.25rem;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    margin-bottom: 0.6rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: var(--bg-card);
}

.match-item:hover {
    border-color: var(--purple);
    color: var(--text-primary);
}

.match-item.selected {
    border-color: var(--gold);
    background: rgba(212, 168, 85, 0.1);
    color: var(--gold);
    box-shadow: var(--glow-gold);
}

.match-item.matched {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.08);
    color: #22c55e;
    pointer-events: none;
}

.match-item.wrong-flash {
    animation: wrongFlash 0.5s ease;
}

@keyframes wrongFlash {

    0%,
    100% {
        border-color: var(--border-subtle);
    }

    50% {
        border-color: #ef4444;
        background: rgba(239, 68, 68, 0.1);
    }
}

/* ─── CLASSIFICATION GAME ─── */
.classify-area {
    margin-bottom: 2rem;
}

.classify-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    min-height: 60px;
    padding: 1rem;
    background: rgba(139, 92, 246, 0.04);
    border: 1px dashed rgba(139, 92, 246, 0.15);
    border-radius: 16px;
    margin-bottom: 2rem;
}

.classify-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: var(--transition);
    user-select: none;
}

.classify-chip:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.classify-chip.selected {
    border-color: var(--gold);
    background: rgba(212, 168, 85, 0.1);
    color: var(--gold);
}

.classify-chip.placed {
    opacity: 0.3;
    pointer-events: none;
}

.classify-chip.correct-placed {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    opacity: 1;
    pointer-events: none;
}

.classify-chip.wrong-placed {
    border-color: #ef4444;
    animation: wrongFlash 0.6s ease;
}

.classify-buckets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.classify-bucket {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 1.25rem 1rem;
    text-align: center;
    min-height: 180px;
    transition: var(--transition);
}

.classify-bucket.highlight {
    border-color: var(--gold);
    background: rgba(212, 168, 85, 0.04);
}

.classify-bucket h4 {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--gold);
    margin-bottom: 0.25rem;
}

.classify-bucket .bucket-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.bucket-items {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.bucket-placed-item {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

/* ─── MISSION ACTIONS ─── */
.mission-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    gap: 1rem;
}

.btn-mission {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
}

.btn-next {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    color: var(--bg-primary);
}

.btn-next:hover {
    box-shadow: var(--glow-gold);
    transform: translateY(-2px);
}

.btn-next:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-prev {
    background: transparent;
    border: 1px solid var(--border-subtle) !important;
    color: var(--text-secondary);
}

.btn-prev:hover {
    border-color: var(--purple) !important;
    color: var(--text-primary);
}

.btn-check {
    background: linear-gradient(135deg, var(--purple), var(--indigo));
    color: white;
}

.btn-check:hover {
    box-shadow: var(--glow-purple);
}

/* ─── RESULTS SCREEN ─── */
.results-screen {
    text-align: center;
    padding: 3rem 2rem;
}

.results-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.results-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.results-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.results-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.result-stat {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    min-width: 140px;
}

.result-stat .stat-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold);
    display: block;
}

.result-stat .stat-label {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.results-xp {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--gold);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.results-xp i {
    animation: twinkle 2s ease-in-out infinite;
}

.results-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ─── BOSS BATTLE EXTRAS ─── */
.boss-timer {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.boss-timer.warning {
    color: #ef4444;
    animation: timerPulse 0.5s ease infinite;
}

@keyframes timerPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.boss-lives {
    display: flex;
    gap: 0.3rem;
}

.boss-life {
    font-size: 1rem;
    color: #ef4444;
    transition: var(--transition);
}

.boss-life.lost {
    opacity: 0.15;
}

.boss-streak {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--gold);
    text-align: center;
    margin-bottom: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.boss-streak.show {
    opacity: 1;
}

/* ─── MATCH CARD GAME (Zone 2+) ─── */
.match-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.match-column {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.match-card {
    padding: 0.9rem 1.25rem;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: var(--bg-card);
    user-select: none;
}

.match-card:hover {
    border-color: var(--purple);
    color: var(--text-primary);
}

.match-card.selected {
    border-color: var(--gold);
    background: rgba(212, 168, 85, 0.1);
    color: var(--gold);
    box-shadow: var(--glow-gold);
}

.match-card.matched {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.08);
    color: #22c55e;
    pointer-events: none;
}

.match-card.wrong-match {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
    animation: wrongFlash 0.5s ease;
}

.match-score {
    text-align: center;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: 0.75rem;
    background: rgba(139, 92, 246, 0.04);
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.08);
}

/* ─── BOSS HUD (Zone 2+) ─── */
.boss-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(10, 14, 23, 0.8);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(8px);
}

.hud-lives {
    font-size: 1.1rem;
    letter-spacing: 0.2em;
}

.hud-timer {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gold);
}

.hud-score {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.hud-score span {
    color: var(--gold);
    font-weight: 700;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
    .mission-topbar {
        padding: 0 1rem;
    }

    .topbar-title {
        display: none;
    }

    .mission-container {
        padding: 80px 1rem 100px;
    }

    .lesson-content {
        padding: 1.5rem;
    }

    .quiz-question {
        padding: 1.5rem;
    }

    .match-game {
        grid-template-columns: 1fr;
    }

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

    .classify-buckets {
        grid-template-columns: repeat(2, 1fr);
    }

    .results-stats {
        gap: 1rem;
    }

    .result-stat {
        min-width: 120px;
        padding: 1rem 1.25rem;
    }
}

@media (max-width: 480px) {
    .classify-buckets {
        grid-template-columns: 1fr;
    }
}