/* ==========================================================================
   ODYSSEY Course — Styles
   Duolingo-inspired interactive course for seniors 60+
   ========================================================================== */

/* --- 0. Variables --- */
:root {
    --c-navy: #2A2D34;
    --c-coral: #D4734E;
    --c-coral-dark: #C05E3A;
    --c-gold: #E8C46D;
    --c-rose: #C94060;
    --c-beige: #F0E0C8;
    --c-green: #4A8A5C;
    --c-green-light: #5A9E6F;
    --c-blue: #2E86AB;
    --c-bg: #FAFAF8;
    --c-white: #FFFFFF;
    --c-text: #2A2D34;
    --c-text-sec: #5A5D64;
    --c-text-light: #8B8E94;
    --c-border: #E8E4DE;
    --c-correct-bg: #E8F5E9;
    --c-correct-border: #81C784;
    --c-wrong-bg: #FFF0F0;
    --c-wrong-border: #E57373;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --fs: 20px;
    --fs-sm: 16px;
    --fs-md: 18px;
    --fs-lg: 24px;
    --fs-xl: 30px;
    --fs-2xl: 40px;
    --fs-num: 56px;
    --bar-h: 56px;
    --prog-h: 6px;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --btn-h: 56px;
    --shadow: 0 2px 12px rgba(42,45,52,0.08);
    --shadow-lg: 0 8px 32px rgba(42,45,52,0.12);
    --transition: 0.25s ease;
}
body.font-large {
    --fs: 24px;
    --fs-sm: 20px;
    --fs-md: 22px;
    --fs-lg: 28px;
    --fs-xl: 36px;
    --fs-2xl: 48px;
    --fs-num: 64px;
}

/* --- 1. Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    font-family: var(--font);
    font-size: var(--fs);
    font-weight: 500;
    line-height: 1.6;
    color: var(--c-text);
    background: var(--c-bg);
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; height: auto; }

p, li { font-weight: 500; }

/* --- 2. Top Bar --- */
.course-bar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--bar-h);
    background: var(--c-white);
    border-bottom: 1px solid var(--c-border);
    display: flex; align-items: center;
    padding: 0 12px;
    gap: 8px;
}
.course-bar__back {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px;
    background: none; border: none;
    color: var(--c-text); border-radius: 12px;
    transition: background var(--transition);
    flex-shrink: 0;
}
.course-bar__back:hover { background: rgba(0,0,0,0.05); }
.course-bar__back svg { width: 24px; height: 24px; }
.course-bar__info {
    flex: 1; min-width: 0; text-align: center;
}
.course-bar__lesson {
    display: block; font-size: var(--fs-sm); font-weight: 600;
    color: var(--c-coral); letter-spacing: 0.02em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.course-bar__title {
    display: block; font-size: 13px; color: var(--c-text-sec);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.course-bar__actions { display: flex; gap: 4px; flex-shrink: 0; }
.course-bar__btn {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px;
    background: none; border: none;
    color: var(--c-text-sec); border-radius: 12px;
    font-size: 15px; font-weight: 700;
    transition: background var(--transition), color var(--transition);
}
.course-bar__btn:hover { background: rgba(0,0,0,0.05); color: var(--c-text); }
.course-bar__btn svg { width: 22px; height: 22px; }
.course-bar__btn--active { color: var(--c-coral); background: rgba(212,115,78,0.1); }

/* --- 3. Progress Bar --- */
.progress-wrap {
    position: fixed; top: var(--bar-h); left: 0; right: 0; z-index: 99;
    height: var(--prog-h);
    background: var(--c-border);
}
.progress-fill {
    height: 100%; background: var(--c-coral);
    border-radius: 0 3px 3px 0;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 2px;
}
.progress-label {
    position: fixed; top: calc(var(--bar-h) + var(--prog-h) + 4px);
    right: 16px; z-index: 99;
    font-size: 12px; color: var(--c-text-light); font-weight: 600;
}

/* --- 4. Screen Container --- */
.screen-wrap {
    position: fixed;
    top: calc(var(--bar-h) + var(--prog-h));
    left: 0; right: 0; bottom: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.screen {
    min-height: calc(100vh - var(--bar-h) - var(--prog-h));
    min-height: calc(100dvh - var(--bar-h) - var(--prog-h));
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 24px 20px 32px;
    max-width: 560px; margin: 0 auto;
    animation: screenIn 0.4s ease-out;
}
@keyframes screenIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- 5. Common Screen Elements --- */
.screen__icon {
    font-size: 48px; margin-bottom: 16px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    width: 80px; height: 80px; border-radius: 50%;
}
.screen__icon--coral { background: rgba(212,115,78,0.12); }
.screen__icon--green { background: rgba(90,158,111,0.12); }
.screen__icon--rose { background: rgba(201,64,96,0.12); }
.screen__icon--gold { background: rgba(232,196,109,0.15); }
.screen__icon--blue { background: rgba(46,134,171,0.12); }

.screen__title {
    font-size: var(--fs-lg); font-weight: 700;
    color: var(--c-navy); text-align: center;
    margin-bottom: 12px; line-height: 1.3;
}
.screen__text {
    font-size: var(--fs); color: var(--c-text-sec);
    text-align: center; line-height: 1.6;
    margin-bottom: 20px; max-width: 480px;
}
.screen__accent {
    width: 48px; height: 4px; border-radius: 2px;
    margin: 0 auto 20px; background: var(--c-coral);
}
.screen__accent--green { background: var(--c-green-light); }
.screen__accent--rose { background: var(--c-rose); }
.screen__accent--gold { background: var(--c-gold); }
.screen__instruction {
    font-size: var(--fs); font-weight: 600;
    color: var(--c-navy); text-align: center;
    margin-bottom: 20px;
}

/* --- 6. Buttons --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: var(--btn-h); padding: 14px 32px;
    border: none; border-radius: var(--radius);
    font-family: var(--font); font-size: var(--fs-md);
    font-weight: 700; cursor: pointer;
    transition: all 0.2s ease; text-align: center;
    text-decoration: none; line-height: 1.3;
    -webkit-tap-highlight-color: transparent;
}
.btn:focus-visible { outline: 3px solid var(--c-gold); outline-offset: 3px; }
.btn:active { transform: scale(0.97); }

.btn--primary { background: var(--c-coral); color: white; }
.btn--primary:hover { background: var(--c-coral-dark); }
.btn--green { background: var(--c-green); color: white; }
.btn--green:hover { background: #3D7C4F; }
.btn--rose { background: var(--c-rose); color: white; }
.btn--gold { background: var(--c-gold); color: var(--c-navy); }

.btn--outline {
    background: var(--c-white); color: var(--c-navy);
    border: 2px solid var(--c-border);
}
.btn--outline:hover { border-color: var(--c-coral); color: var(--c-coral); }

.btn--next { margin-top: 16px; min-width: 180px; }
.btn--full { width: 100%; }
.btn--lg { min-height: 64px; font-size: var(--fs); padding: 16px 36px; }

.btn[hidden] { display: none; }

/* --- 7. Feedback --- */
.feedback {
    width: 100%; max-width: 480px;
    padding: 16px 20px; border-radius: var(--radius-sm);
    font-size: var(--fs-md); line-height: 1.5;
    margin-top: 12px;
    animation: feedbackIn 0.3s ease-out;
}
@keyframes feedbackIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.feedback--correct {
    background: var(--c-correct-bg);
    border-left: 4px solid var(--c-correct-border);
    color: #2E7D32;
}
.feedback--wrong {
    background: var(--c-wrong-bg);
    border-left: 4px solid var(--c-wrong-border);
    color: #C62828;
}
.feedback--info {
    background: rgba(232,196,109,0.15);
    border-left: 4px solid var(--c-gold);
    color: var(--c-navy);
}
.feedback[hidden] { display: none; }

.red-flags {
    margin-top: 12px; padding: 12px 16px;
    background: rgba(201,64,96,0.08);
    border-radius: var(--radius-xs);
}
.red-flags__title {
    font-size: var(--fs-sm); font-weight: 700;
    color: var(--c-rose); margin-bottom: 6px;
}
.red-flags__list { list-style: none; }
.red-flags__list li {
    font-size: var(--fs-sm); color: var(--c-text-sec);
    padding: 3px 0 3px 20px; position: relative;
}
.red-flags__list li::before {
    content: '\26A0'; position: absolute; left: 0; color: var(--c-rose);
}

/* --- 8. Stat Reveal --- */
.stat-pre {
    font-size: var(--fs); color: var(--c-text-sec);
    text-align: center; margin-bottom: 24px; max-width: 420px;
}
.stat-number {
    font-size: var(--fs-num); font-weight: 900;
    color: var(--c-coral); text-align: center;
    line-height: 1.1; margin-bottom: 16px;
    letter-spacing: -0.02em;
}
.stat-post {
    font-size: var(--fs); color: var(--c-navy);
    text-align: center; font-weight: 600;
    margin-bottom: 8px; max-width: 440px;
}
.stat-source {
    font-size: var(--fs-sm); color: var(--c-text-light);
    text-align: center; font-style: italic;
    margin-bottom: 20px;
}

/* --- 9. Poll --- */
.poll-question {
    font-size: var(--fs-lg); font-weight: 700;
    color: var(--c-navy); text-align: center;
    margin-bottom: 20px; line-height: 1.3;
}
.poll-options { width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 10px; }
.poll-option {
    width: 100%; min-height: var(--btn-h); padding: 14px 20px;
    background: var(--c-white); border: 2px solid var(--c-border);
    border-radius: var(--radius); font-size: var(--fs-md);
    color: var(--c-navy); text-align: left; font-weight: 500;
    transition: all 0.2s ease; cursor: pointer;
}
.poll-option:hover { border-color: var(--c-coral); background: rgba(212,115,78,0.04); }
.poll-option--selected {
    border-color: var(--c-coral); background: rgba(212,115,78,0.08);
    font-weight: 600;
}
.poll-option:disabled { cursor: default; opacity: 0.6; }
.poll-option--selected:disabled { opacity: 1; }

/* --- 10. STC (Z-Z-Z) Cards --- */
.stc-cards { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 12px; }
.stc-card {
    border-radius: var(--radius); overflow: hidden;
    transition: all 0.4s ease; cursor: pointer;
    border: 2px solid var(--c-border);
}
.stc-card--locked {
    opacity: 0.35; filter: grayscale(0.5);
    pointer-events: none; transform: scale(0.96);
}
.stc-card--active {
    opacity: 1; filter: none;
    pointer-events: auto; transform: scale(1);
    box-shadow: var(--shadow);
}
.stc-card--revealed {
    opacity: 1; filter: none;
    pointer-events: none; transform: scale(1);
}
.stc-card__header {
    padding: 14px 20px;
    display: flex; align-items: center; gap: 14px;
}
.stc-card__header--coral { background: var(--c-coral); color: white; }
.stc-card__header--gold { background: var(--c-gold); color: var(--c-navy); }
.stc-card__header--green { background: var(--c-green-light); color: white; }
.stc-card__letter {
    font-size: 32px; font-weight: 900; line-height: 1;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.25); border-radius: 10px;
}
.stc-card__word { font-size: var(--fs-md); font-weight: 700; }
.stc-card__body {
    padding: 12px 20px;
    background: var(--c-white);
    font-size: var(--fs-sm); color: var(--c-text-sec);
    line-height: 1.5;
}
.stc-hint {
    text-align: center; font-size: var(--fs-sm);
    color: var(--c-text-light); margin-top: 8px;
}

/* --- 11. Phone Sim --- */
.phone-sim {
    width: 100%; max-width: 400px;
    background: var(--c-navy); border-radius: 24px;
    overflow: hidden; box-shadow: var(--shadow-lg);
    margin: 0 auto;
}
.phone-sim__bar {
    display: flex; justify-content: space-between;
    padding: 8px 20px;
    font-size: 12px; color: rgba(255,255,255,0.5);
}
.phone-sim__caller {
    text-align: center; padding: 10px 20px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.phone-sim__caller-icon {
    font-size: 28px; margin-bottom: 4px;
}
.phone-sim__caller-name {
    color: white; font-weight: 700; font-size: var(--fs-md);
}
.phone-sim__caller-num {
    color: rgba(255,255,255,0.5); font-size: 13px;
}
.phone-sim__messages {
    padding: 14px 16px;
    min-height: 80px;
    max-height: 200px;
    overflow-y: auto;
}
.phone-bubble {
    background: rgba(255,255,255,0.13);
    color: rgba(255,255,255,0.92);
    padding: 10px 14px; border-radius: 14px 14px 14px 4px;
    margin-bottom: 8px; font-size: 15px; line-height: 1.5;
    animation: bubbleIn 0.4s ease-out;
}
@keyframes bubbleIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.phone-sim__action {
    padding: 14px 16px 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.phone-sim__question {
    color: rgba(255,255,255,0.8); font-size: 15px;
    font-weight: 600; margin-bottom: 10px; text-align: center;
}
.phone-options { display: flex; flex-direction: column; gap: 8px; }
.phone-option {
    width: 100%; padding: 12px 16px;
    background: rgba(255,255,255,0.1); border: 1.5px solid rgba(255,255,255,0.2);
    border-radius: 12px; color: white;
    font-size: 15px; font-weight: 500;
    text-align: left; cursor: pointer;
    transition: all 0.2s ease;
}
.phone-option:hover { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.35); }
.phone-option--correct {
    background: rgba(74,138,92,0.4) !important;
    border-color: var(--c-green) !important;
}
.phone-option--wrong {
    background: rgba(201,64,96,0.3) !important;
    border-color: var(--c-rose) !important;
}
.phone-option:disabled { cursor: default; }
.phone-feedback {
    padding: 10px 14px; margin-top: 10px;
    border-radius: 10px; font-size: 14px;
    line-height: 1.4; animation: feedbackIn 0.3s ease-out;
}
.phone-feedback--correct { background: rgba(74,138,92,0.25); color: rgba(255,255,255,0.95); }
.phone-feedback--wrong { background: rgba(201,64,96,0.2); color: rgba(255,255,255,0.95); }

/* --- 12. Order --- */
.order-slots {
    width: 100%; max-width: 400px;
    display: flex; flex-direction: column; gap: 8px;
    margin-bottom: 16px;
}
.order-slot {
    display: flex; align-items: center; gap: 12px;
    min-height: 52px; padding: 10px 16px;
    background: var(--c-white); border: 2px dashed var(--c-border);
    border-radius: var(--radius-sm); cursor: pointer;
    transition: all 0.2s ease;
}
.order-slot--filled { border-style: solid; border-color: var(--c-coral); background: rgba(212,115,78,0.06); }
.order-slot__num {
    font-size: var(--fs-lg); font-weight: 900;
    color: var(--c-text-light); min-width: 28px;
}
.order-slot--filled .order-slot__num { color: var(--c-coral); }
.order-slot__label { font-size: var(--fs-md); font-weight: 600; color: var(--c-navy); }
.order-items {
    display: flex; flex-wrap: wrap; gap: 8px;
    justify-content: center; margin-bottom: 16px;
}
.order-item {
    padding: 12px 20px; min-height: 48px;
    background: var(--c-beige); border: 2px solid transparent;
    border-radius: var(--radius-sm);
    font-size: var(--fs-md); font-weight: 600;
    color: var(--c-navy); cursor: pointer;
    transition: all 0.2s ease;
}
.order-item:hover { border-color: var(--c-coral); }
.order-item--placed { opacity: 0.3; pointer-events: none; }
.order-slot--correct { border-color: var(--c-green) !important; background: var(--c-correct-bg) !important; }
.order-slot--wrong { border-color: var(--c-rose) !important; background: var(--c-wrong-bg) !important; animation: shake 0.4s ease; }

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

/* --- 13. If-Then --- */
.ifthen-box {
    width: 100%; max-width: 460px;
    padding: 20px 24px; margin-bottom: 20px;
    background: rgba(232,196,109,0.18);
    border-left: 5px solid var(--c-gold);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: var(--fs); font-weight: 600;
    color: var(--c-navy); line-height: 1.5;
}
.ifthen-prompt {
    font-size: var(--fs-md); color: var(--c-text-sec);
    text-align: center; margin-bottom: 12px; font-weight: 600;
}
.ifthen-options { width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 10px; }
.ifthen-option {
    width: 100%; padding: 14px 20px;
    background: var(--c-white); border: 2px solid var(--c-border);
    border-radius: var(--radius); font-size: var(--fs-md);
    color: var(--c-navy); text-align: left; font-weight: 500;
    cursor: pointer; transition: all 0.2s ease;
}
.ifthen-option:hover { border-color: var(--c-gold); }
.ifthen-option--correct { border-color: var(--c-green) !important; background: var(--c-correct-bg) !important; }
.ifthen-option--wrong { border-color: var(--c-rose) !important; background: var(--c-wrong-bg) !important; }
.ifthen-option:disabled { cursor: default; }
.science-note {
    margin-top: 12px; padding: 14px 18px;
    background: rgba(46,134,171,0.08);
    border-radius: var(--radius-xs);
    font-size: var(--fs-sm); color: var(--c-text-sec);
    line-height: 1.5;
}
.science-note strong { color: var(--c-blue); }

/* --- 14. Flag Learn (flip cards) --- */
.flag-card-wrap { width: 100%; max-width: 360px; perspective: 800px; }
.flag-card {
    position: relative; cursor: pointer;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
}
.flag-card.flipped { transform: rotateY(180deg); }
.flag-card__front, .flag-card__back {
    backface-visibility: hidden;
    border-radius: var(--radius); padding: 28px 24px;
    text-align: center; min-height: 200px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}
.flag-card__front {
    background: var(--c-white); border: 2px solid var(--c-border);
    box-shadow: var(--shadow);
}
.flag-card__back {
    background: var(--c-white); border: 2px solid var(--c-coral);
    box-shadow: var(--shadow);
    transform: rotateY(180deg);
    position: absolute; top: 0; left: 0; right: 0;
}
.flag-card__icon { font-size: 48px; margin-bottom: 12px; }
.flag-card__name {
    font-size: var(--fs-lg); font-weight: 700; color: var(--c-navy);
    margin-bottom: 8px;
}
.flag-card__hint { font-size: var(--fs-sm); color: var(--c-text-light); }
.flag-card__desc {
    font-size: var(--fs-md); color: var(--c-text-sec);
    line-height: 1.5; margin-bottom: 12px;
}
.flag-card__example {
    font-size: var(--fs-sm); color: var(--c-rose);
    font-style: italic; line-height: 1.4;
    padding: 10px 14px; background: rgba(201,64,96,0.06);
    border-radius: var(--radius-xs);
}
.flag-counter {
    font-size: var(--fs-sm); color: var(--c-text-light);
    text-align: center; margin-bottom: 12px; font-weight: 600;
}

/* --- 15. SMS Analyze --- */
.sms-mockup {
    width: 100%; max-width: 400px;
    background: #ECEFF1; border-radius: var(--radius);
    padding: 16px; margin-bottom: 16px;
}
.sms-sender {
    font-size: var(--fs-sm); font-weight: 700;
    color: var(--c-text-sec); margin-bottom: 8px;
}
.sms-bubble {
    background: var(--c-white); padding: 14px 16px;
    border-radius: 14px 14px 14px 4px;
    font-size: 15px; line-height: 1.5;
    color: var(--c-text); box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.sms-checks {
    width: 100%; max-width: 460px;
    display: flex; flex-direction: column; gap: 8px;
    margin-bottom: 16px;
}
.sms-check {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 16px;
    background: var(--c-white); border: 2px solid var(--c-border);
    border-radius: var(--radius-sm);
    cursor: pointer; transition: all 0.2s ease;
    font-size: var(--fs-md);
}
.sms-check:hover { border-color: var(--c-coral); }
.sms-check--checked { border-color: var(--c-coral); background: rgba(212,115,78,0.06); }
.sms-check__box {
    width: 24px; height: 24px; flex-shrink: 0;
    border: 2px solid var(--c-border); border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease; margin-top: 1px;
}
.sms-check--checked .sms-check__box {
    background: var(--c-coral); border-color: var(--c-coral); color: white;
}
.sms-check__label { flex: 1; line-height: 1.4; color: var(--c-navy); }
.sms-check--correct-mark { border-color: var(--c-green) !important; background: var(--c-correct-bg) !important; }
.sms-check--wrong-mark { border-color: var(--c-rose) !important; background: var(--c-wrong-bg) !important; }

/* --- 16. Matching --- */
.matching-grid {
    width: 100%; max-width: 500px;
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
}
.matching-col { display: flex; flex-direction: column; gap: 10px; }
.matching-col--left .match-item { text-align: right; }
.matching-col--right .match-item { text-align: left; }
.match-item {
    padding: 12px 16px; min-height: 48px;
    background: var(--c-white); border: 2px solid var(--c-border);
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm); font-weight: 600; color: var(--c-navy);
    cursor: pointer; transition: all 0.2s ease;
    position: relative;
}
.match-item:hover { border-color: var(--c-coral); }
.match-item--selected { border-color: var(--c-coral); background: rgba(212,115,78,0.08); box-shadow: 0 0 0 3px rgba(212,115,78,0.15); }
.match-item--matched { cursor: default; opacity: 0.85; }
.match-item--matched-0 { border-color: var(--c-coral); background: rgba(212,115,78,0.1); }
.match-item--matched-1 { border-color: var(--c-gold); background: rgba(232,196,109,0.15); }
.match-item--matched-2 { border-color: var(--c-green); background: rgba(90,158,111,0.1); }
.match-item--matched-3 { border-color: var(--c-blue); background: rgba(46,134,171,0.1); }
.match-badge {
    position: absolute; top: -8px; right: -8px;
    width: 22px; height: 22px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: white;
}
.match-badge--0 { background: var(--c-coral); }
.match-badge--1 { background: var(--c-gold); color: var(--c-navy); }
.match-badge--2 { background: var(--c-green); }
.match-badge--3 { background: var(--c-blue); }

/* --- 17. Escalation Card --- */
.esc-paths { width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 12px; }
.esc-path-btn {
    width: 100%; min-height: 64px; padding: 16px 20px;
    border: 2px solid var(--c-border);
    border-radius: var(--radius); font-size: var(--fs-md);
    font-weight: 600; text-align: left; cursor: pointer;
    display: flex; align-items: center; gap: 14px;
    transition: all 0.2s ease; background: var(--c-white);
}
.esc-path-btn__icon {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.esc-path-btn--a .esc-path-btn__icon { background: rgba(90,158,111,0.15); }
.esc-path-btn--b .esc-path-btn__icon { background: rgba(201,64,96,0.12); }
.esc-path-btn--a:hover { border-color: var(--c-green); }
.esc-path-btn--b:hover { border-color: var(--c-rose); }

.esc-steps {
    width: 100%; max-width: 480px;
    display: flex; flex-direction: column; gap: 0;
    animation: feedbackIn 0.3s ease-out;
}
.esc-step {
    display: flex; gap: 14px; padding: 12px 0;
    border-bottom: 1px solid var(--c-border);
}
.esc-step:last-child { border-bottom: none; }
.esc-step__num {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; color: white;
    flex-shrink: 0;
}
.esc-step__num--green { background: var(--c-green); }
.esc-step__num--rose { background: var(--c-rose); }
.esc-step__content { flex: 1; }
.esc-step__title { font-size: var(--fs-md); font-weight: 700; color: var(--c-navy); }
.esc-step__desc { font-size: var(--fs-sm); color: var(--c-text-sec); line-height: 1.4; }

/* --- 18. Practice 8080 --- */
.practice-steps {
    width: 100%; max-width: 440px;
    display: flex; flex-direction: column; gap: 0;
}
.practice-step {
    display: flex; gap: 14px; padding: 14px 0;
    border-bottom: 1px solid var(--c-border);
    animation: feedbackIn 0.3s ease-out;
}
.practice-step:last-child { border-bottom: none; }
.practice-step__num {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--c-coral); color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 16px; flex-shrink: 0;
}
.practice-step__text {
    font-size: var(--fs-md); color: var(--c-navy);
    line-height: 1.5; font-weight: 500;
    padding-top: 5px;
}
.practice-summary {
    margin-top: 16px; padding: 16px 20px;
    background: var(--c-correct-bg);
    border-radius: var(--radius-sm);
    font-size: var(--fs-md); color: #2E7D32;
    text-align: center; font-weight: 600;
    animation: feedbackIn 0.3s ease-out;
}

/* --- 19. Family Password --- */
.fp-explanation {
    font-size: var(--fs); color: var(--c-text-sec);
    text-align: center; line-height: 1.6;
    margin-bottom: 20px; max-width: 460px;
}
.fp-dialog {
    width: 100%; max-width: 440px;
    display: flex; flex-direction: column; gap: 8px;
    margin-bottom: 16px;
    animation: feedbackIn 0.3s ease-out;
}
.fp-line {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 10px 14px; border-radius: var(--radius-sm);
}
.fp-line--scammer { background: rgba(201,64,96,0.08); }
.fp-line--grandma { background: rgba(90,158,111,0.08); }
.fp-line--result { background: rgba(212,115,78,0.1); font-weight: 700; }
.fp-line__speaker {
    font-size: var(--fs-sm); font-weight: 700;
    min-width: 70px; flex-shrink: 0;
}
.fp-line--scammer .fp-line__speaker { color: var(--c-rose); }
.fp-line--grandma .fp-line__speaker { color: var(--c-green); }
.fp-line--result .fp-line__speaker { color: var(--c-coral); }
.fp-line__text {
    font-size: var(--fs-sm); color: var(--c-text);
    line-height: 1.4; font-style: italic;
}
.fp-line--result .fp-line__text { font-style: normal; }
.fp-task {
    margin-top: 12px; padding: 16px 20px;
    background: rgba(232,196,109,0.15);
    border-radius: var(--radius-sm);
    font-size: var(--fs-md); color: var(--c-navy);
    text-align: center; font-weight: 600;
    line-height: 1.4;
}

/* --- 20. Final Quiz --- */
.quiz-counter {
    font-size: var(--fs-sm); font-weight: 600;
    color: var(--c-text-light); margin-bottom: 12px;
    text-align: center;
}
.quiz-question {
    font-size: var(--fs-lg); font-weight: 700;
    color: var(--c-navy); text-align: center;
    margin-bottom: 20px; line-height: 1.3;
    max-width: 460px;
}
.quiz-options { width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 10px; }
.quiz-option {
    width: 100%; padding: 14px 20px; min-height: var(--btn-h);
    background: var(--c-white); border: 2px solid var(--c-border);
    border-radius: var(--radius); font-size: var(--fs-md);
    color: var(--c-navy); text-align: left; font-weight: 500;
    cursor: pointer; transition: all 0.2s ease;
}
.quiz-option:hover { border-color: var(--c-coral); }
.quiz-option--correct {
    border-color: var(--c-green) !important;
    background: var(--c-correct-bg) !important; font-weight: 700;
}
.quiz-option--wrong {
    border-color: var(--c-rose) !important;
    background: var(--c-wrong-bg) !important;
}
.quiz-option:disabled { cursor: default; }
.quiz-summary {
    text-align: center; animation: screenIn 0.4s ease-out;
}
.quiz-score {
    font-size: var(--fs-2xl); font-weight: 900;
    color: var(--c-coral); margin-bottom: 8px;
}
.quiz-score-text {
    font-size: var(--fs); color: var(--c-text-sec); margin-bottom: 20px;
}

/* --- 21. Celebration --- */
.celebration { text-align: center; }
.celebration__badge-wrap {
    position: relative; display: inline-block; margin-bottom: 20px;
}
.celebration__badge-bg {
    width: 130px; height: 130px; border-radius: 50%;
    background: linear-gradient(135deg, var(--c-gold), var(--c-coral));
    display: flex; align-items: center; justify-content: center;
    font-size: 56px;
    animation: badgePop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 32px rgba(212,115,78,0.3);
}
@keyframes badgePop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}
.celebration__title {
    font-size: var(--fs-xl); font-weight: 900;
    color: var(--c-navy); margin-bottom: 4px;
}
.celebration__badge-name {
    font-size: var(--fs-lg); font-weight: 700;
    color: var(--c-coral); margin-bottom: 20px;
}
.celebration__learned {
    list-style: none; text-align: left;
    max-width: 360px; margin: 0 auto 24px;
}
.celebration__learned li {
    padding: 6px 0 6px 28px; position: relative;
    font-size: var(--fs-md); color: var(--c-text-sec);
}
.celebration__learned li::before {
    content: '\2713'; position: absolute; left: 0;
    color: var(--c-green); font-weight: 700;
}

/* Confetti particles */
.confetti {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none; z-index: 200; overflow: hidden;
}
.confetti-piece {
    position: absolute; width: 10px; height: 10px;
    border-radius: 2px;
    animation: confettiFall linear forwards;
}
@keyframes confettiFall {
    0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* --- 22. Help Modal --- */
.help-overlay {
    position: fixed; inset: 0; z-index: 300;
    background: rgba(42,45,52,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.help-modal {
    position: fixed; z-index: 301;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 32px); max-width: 480px;
    max-height: 85vh; overflow-y: auto;
    background: var(--c-white);
    border-radius: 20px; padding: 28px 24px;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease-out;
}
@keyframes modalIn {
    from { opacity: 0; transform: translate(-50%, -48%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}
.help-modal__close {
    position: absolute; top: 12px; right: 12px;
    width: 40px; height: 40px;
    background: none; border: none;
    font-size: 24px; color: var(--c-text-sec);
    border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.help-modal__close:hover { background: rgba(0,0,0,0.05); }
.help-modal__title {
    font-size: var(--fs-lg); font-weight: 700;
    color: var(--c-navy); margin-bottom: 16px;
}
.help-section { margin-bottom: 20px; }
.help-section__title {
    font-size: var(--fs-md); font-weight: 700;
    color: var(--c-coral); margin-bottom: 8px;
}
.help-number {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0; font-size: var(--fs-md);
}
.help-number__label { font-weight: 600; color: var(--c-navy); }
.help-number__value { color: var(--c-text-sec); }
[hidden] { display: none !important; }

/* --- 23. Utilities --- */
.fade-in { animation: feedbackIn 0.3s ease-out; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.w-full { width: 100%; }

/* --- 24. Responsive --- */
@media (max-width: 420px) {
    :root { --fs: 18px; --fs-lg: 22px; --fs-xl: 26px; --fs-num: 44px; --btn-h: 52px; }
    .screen { padding: 16px 16px 24px; }
    .phone-sim { border-radius: 18px; }
    .matching-grid { gap: 8px 12px; }
    .match-item { padding: 10px 12px; font-size: 14px; }
    .flag-card__front, .flag-card__back { padding: 20px 16px; min-height: 170px; }
}
@media (min-width: 768px) {
    .screen { padding: 32px 24px 40px; }
    .phone-sim { max-width: 380px; }
}
@media (min-width: 1024px) {
    :root { --bar-h: 60px; }
}
