/**
 * Life Language Glossary & De-ID Lab Styles
 * Brand-consistent design with no emojis
 */

/* =============================================================================
   CSS VARIABLES - BRAND COLORS
   ============================================================================= */
:root {
    /* Primary Palette */
    --brand-blue: #0b63d8;
    --brand-blue-light: #e8f2ff;
    --brand-blue-mid: #0f4fb9;
    --brand-red: #f5304a;
    --brand-red-soft: #ffe6eb;

    /* Supporting Colors */
    --success: #10b981;
    --success-soft: #d1fae5;
    --warning: #f59e0b;
    --warning-soft: #fef3c7;
    --error: #ef4444;
    --error-soft: #fee2e2;

    /* Neutral Palette */
    --dark: #081426;
    --text: #2c4664;
    --muted: #5f7d9b;
    --light: #f3f8ff;
    --border: #d7e5f5;
    --white: #ffffff;

    /* Glossary Specific */
    --glossary-gradient: radial-gradient(circle at 86% 16%, rgba(245, 48, 74, 0.4) 0%, rgba(245, 48, 74, 0) 34%), linear-gradient(135deg, #02275d 0%, #0b63d8 52%, #0d4cae 100%);
    --deid-gradient: radial-gradient(circle at 86% 18%, rgba(245, 48, 74, 0.22) 0%, rgba(245, 48, 74, 0) 36%), linear-gradient(135deg, #06162f 0%, #0d2e63 60%, #06162f 100%);
}

/* =============================================================================
   HERO SECTIONS
   ============================================================================= */
.glossary-hero {
    background: var(--glossary-gradient);
    padding: 132px 0 92px;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.glossary-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='3' cy='3' r='1.5'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.glossary-hero h1 {
    font-size: 3.5rem;
    font-family: var(--font-display, 'Chakra Petch', 'Outfit', sans-serif);
    color: white;
    margin-bottom: 10px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.glossary-hero .hero-subtitle {
    font-size: 1.35rem;
    opacity: 0.95;
    max-width: 650px;
    margin: 0 auto 16px;
    font-weight: 400;
}

.hero-quote {
    font-style: normal;
    font-size: 1.1rem;
    opacity: 0.95;
    max-width: 550px;
    margin: 32px auto 0;
    padding: 20px;
    border-left: 3px solid rgba(255,255,255,0.5);
    background: rgba(7, 24, 49, 0.35);
    border-radius: 10px;
    text-align: left;
}

.hero-quick-actions {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-quick-actions .btn {
    border-radius: 999px;
    min-width: 210px;
}

.floating-add-glossary {
    position: fixed;
    right: 20px;
    bottom: 24px;
    z-index: 1200;
    border: none;
    border-radius: 999px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--brand-red) 0%, #be1b39 100%);
    color: white;
    font-weight: 700;
    box-shadow: 0 14px 30px rgba(245, 48, 74, 0.36);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.floating-add-glossary:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(245, 48, 74, 0.42);
}

/* Stats Row - Glass Morphism */
.hero-stats-row {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 48px;
}

.hero-stat-card {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 16px;
    padding: 24px 40px;
    text-align: center;
    transition: transform 0.3s ease, background 0.3s ease;
}

.hero-stat-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.2);
}

.hero-stat-card .value {
    font-size: 2.5rem;
    font-family: var(--font-display, 'Chakra Petch', 'Outfit', sans-serif);
    font-weight: 800;
    display: block;
    line-height: 1;
}

.hero-stat-card .label {
    font-size: 0.9rem;
    opacity: 0.85;
    margin-top: 8px;
}

/* De-ID Lab Hero */
.deid-hero {
    background: var(--deid-gradient);
    padding: 80px 0 60px;
    color: white;
    text-align: center;
    position: relative;
}

.deid-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M20 20h20v20H20V20zM0 0h20v20H0V0z'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.deid-hero h2 {
    font-size: 2.5rem;
    font-family: var(--font-display, 'Chakra Petch', 'Outfit', sans-serif);
    color: white;
    margin-bottom: 12px;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.deid-hero p {
    font-size: 1.15rem;
    opacity: 0.9;
    max-width: 500px;
    margin: 0 auto;
}

.deid-hero-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
}

/* =============================================================================
   TAB NAVIGATION
   ============================================================================= */
.glossary-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: -40px;
    position: relative;
    z-index: 10;
}

.tab-btn {
    padding: 20px 40px;
    background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
    border: none;
    border-radius: 16px 16px 0 0;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--brand-blue-mid);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    box-shadow: 0 -8px 30px rgba(5, 30, 67, 0.12);
    min-width: 180px;
}

.tab-btn .tab-label {
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-display, 'Chakra Petch', 'Outfit', sans-serif);
    letter-spacing: 0.02em;
}

.tab-btn .tab-desc {
    font-size: 0.8rem;
    font-weight: 400;
    opacity: 0.7;
}

.tab-btn .material-icons-round {
    font-size: 24px;
}

.tab-btn:hover {
    color: var(--brand-blue);
    transform: translateY(-2px);
}

.tab-btn.active {
    color: white;
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-blue-mid) 72%, var(--brand-red) 100%);
    box-shadow: 0 -8px 30px rgba(11, 99, 216, 0.34);
}

.tab-btn.active .tab-desc {
    opacity: 0.85;
}

.glossary-section-nav {
    position: sticky;
    top: calc(var(--nav-height, 80px) + 10px);
    z-index: 9;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 16px 0 12px;
    margin-bottom: 8px;
    scrollbar-width: thin;
}

.glossary-section-btn {
    flex: 0 0 auto;
    border: 1px solid rgba(11, 99, 216, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--brand-blue-mid);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 10px 16px;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.glossary-section-btn:hover {
    border-color: rgba(11, 99, 216, 0.34);
    background: linear-gradient(135deg, #ffffff 0%, #eef6ff 100%);
}

.glossary-section-btn.active {
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-blue-mid) 72%, var(--brand-red) 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 12px 24px rgba(11, 99, 216, 0.2);
}

.glossary-section-btn.hidden {
    display: none;
}

/* =============================================================================
   TAB CONTENT
   ============================================================================= */
.tab-content {
    display: none;
    padding: 0;
    background: white;
}

.tab-content.active {
    display: block;
}

.tab-section {
    padding: 60px 0;
}

.tab-section:nth-child(even) {
    background: var(--light);
}

.learning-hub-section {
    padding: 42px 0 24px;
}

.learning-hub-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.learning-card {
    background: linear-gradient(145deg, #ffffff 0%, #f2f8ff 65%, #fff0f4 100%);
    border: 1px solid rgba(11, 99, 216, 0.2);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 14px 28px rgba(2, 18, 42, 0.08);
}

.learning-card h3 {
    margin-bottom: 12px;
    font-size: 1.2rem;
    color: var(--dark);
}

.learning-card p {
    color: var(--text);
    line-height: 1.6;
}

.learning-card-label {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand-blue-mid);
    margin-bottom: 12px;
}

.entry-day-card {
    background: linear-gradient(180deg, #ffffff 0%, #edf6ff 70%, #fff2f6 100%);
}

.entry-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.entry-tags {
    margin-top: 14px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.entry-source {
    margin-top: 12px;
    font-size: 0.82rem;
    color: var(--muted);
}

.pulse-card {
    background: linear-gradient(180deg, #fff8ef 0%, #fff4f7 90%);
    border-color: #ffd4df;
}

.pulse-card .btn {
    margin-top: 12px;
}

.quest-card {
    background: linear-gradient(180deg, #f1f8ff 0%, #ffffff 70%, #ffeef2 100%);
}

.quest-list {
    margin: 0 0 16px;
    padding-left: 18px;
    display: grid;
    gap: 10px;
}

.quest-list li {
    color: var(--text);
    line-height: 1.5;
}

.quest-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.quest-actions .btn {
    border-radius: 999px;
}

.section-title {
    text-align: center;
    margin-bottom: 48px;
}

.section-title h2 {
    font-size: 2rem;
    color: var(--dark);
    margin-bottom: 12px;
    font-family: var(--font-display, 'Chakra Petch', 'Outfit', sans-serif);
    letter-spacing: 0.02em;
}

.section-title p {
    color: var(--muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* =============================================================================
   LANGUAGE BADGES (NO EMOJIS)
   ============================================================================= */
.lang-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--brand-blue-light);
    color: var(--brand-blue);
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
}

.lang-badge.small {
    padding: 4px 10px;
    font-size: 0.75rem;
}

/* =============================================================================
   EMOTION TAGS (COLOR-CODED)
   ============================================================================= */
.emotion-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.emotion-tag:hover {
    transform: translateY(-1px);
}

.emotion-tag.selected {
    border-color: var(--brand-blue);
    box-shadow: 0 2px 8px rgba(0, 64, 133, 0.2);
}

/* Emotion color variants */
.emotion-sadness {
    background: #dbeafe;
    color: #1e40af;
}

.emotion-anxiety {
    background: #fef3c7;
    color: #92400e;
}

.emotion-hope {
    background: #d1fae5;
    color: #065f46;
}

.emotion-love {
    background: #fce7f3;
    color: #9d174d;
}

.emotion-resilience {
    background: #e0e7ff;
    color: #3730a3;
}

.emotion-grief {
    background: #f3e8ff;
    color: #7c3aed;
}

.emotion-healing {
    background: #ccfbf1;
    color: #0d9488;
}

.emotion-frustration {
    background: #fed7aa;
    color: #c2410c;
}

/* Small version for cards */
.emotion-pill {
    padding: 4px 10px;
    font-size: 0.75rem;
}

/* =============================================================================
   QUIZ / GAME CARDS
   ============================================================================= */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.quiz-score-display {
    display: flex;
    gap: 32px;
}

.score-item {
    text-align: center;
}

.score-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--brand-blue);
    line-height: 1;
}

.score-label {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 4px;
}

.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--warning), #d97706);
    color: white;
    border-radius: 24px;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.streak-badge .material-icons-round {
    font-size: 20px;
}

.quiz-card {
    background: linear-gradient(165deg, #ffffff 0%, #f2f8ff 72%, #fff1f5 100%);
    border: 2px solid var(--border);
    border-radius: 24px;
    padding: 48px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.quiz-card:hover {
    box-shadow: 0 20px 60px rgba(11, 99, 216, 0.16);
    border-color: rgba(11, 99, 216, 0.32);
}

.quiz-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--brand-blue), var(--brand-blue-mid));
    transition: width 0.4s ease;
    border-radius: 0 2px 2px 0;
}

.quiz-difficulty {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}

.difficulty-btn {
    padding: 10px 24px;
    border: 2px solid var(--border);
    border-radius: 24px;
    background: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text);
}

.difficulty-btn:hover {
    border-color: var(--brand-blue);
    color: var(--brand-blue);
}

.difficulty-btn.active {
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-blue-mid) 68%, var(--brand-red) 100%);
    border-color: var(--brand-blue-mid);
    color: white;
}

.quiz-phrase-language {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 8px;
}

.quiz-phrase {
    font-family: 'Georgia', serif;
    font-size: 2rem;
    font-style: italic;
    color: var(--dark);
    margin: 24px 0;
    line-height: 1.4;
}

.quiz-instruction {
    color: var(--muted);
    margin-bottom: 24px;
}

.quiz-options {
    display: grid;
    gap: 16px;
    margin-top: 32px;
}

.quiz-option {
    padding: 20px 28px;
    border: 2px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 1rem;
    line-height: 1.5;
    background: rgba(255, 255, 255, 0.92);
}

.quiz-option:hover {
    border-color: var(--brand-blue);
    background: linear-gradient(135deg, var(--brand-blue-light) 0%, #fff0f4 100%);
    transform: translateX(8px);
}

.quiz-option.correct {
    border-color: var(--success);
    background: var(--success-soft);
    animation: correctPulse 0.5s ease;
}

.quiz-option.incorrect {
    border-color: var(--error);
    background: var(--error-soft);
}

.quiz-option.disabled {
    pointer-events: none;
    opacity: 0.7;
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.quiz-result {
    margin-top: 32px;
    padding: 24px;
    border-radius: 16px;
    display: none;
    text-align: left;
}

.quiz-result.show {
    display: block;
    animation: slideUp 0.4s ease;
}

.quiz-result.correct {
    background: var(--success-soft);
    border: 1px solid var(--success);
}

.quiz-result.correct .result-title {
    color: #065f46;
}

.quiz-result.incorrect {
    background: var(--error-soft);
    border: 1px solid var(--error);
}

.quiz-result.incorrect .result-title {
    color: #991b1b;
}

.result-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.result-explanation {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text);
}

.teach-card {
    margin-top: 16px;
    text-align: left;
    border-radius: 16px;
    border: 1px solid rgba(11, 99, 216, 0.28);
    background: linear-gradient(135deg, #eaf4ff 0%, #f6fbff 48%, #fff0f4 100%);
    padding: 18px 18px 16px;
}

.teach-header {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--brand-blue);
    margin-bottom: 10px;
}

.teach-header .material-icons-round {
    font-size: 18px;
}

.teach-line {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.58;
}

.teach-tip {
    margin: 2px 0 10px;
    color: #0f2f63;
    font-size: 0.88rem;
    line-height: 1.5;
    font-weight: 600;
}

.teach-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quiz-actions {
    margin-top: 32px;
}

.section-next-actions {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}

.section-next-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* =============================================================================
   CULTURAL CONTEXT GAME
   ============================================================================= */
.scenario-card {
    background: linear-gradient(140deg, #f4f8ff 0%, #eef6ff 75%, #ffeef2 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 32px;
    text-align: left;
}

.scenario-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--brand-blue);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.scenario-text {
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--dark);
}

.scenario-hud {
    display: grid;
    grid-template-columns: repeat(3, minmax(110px, 1fr));
    gap: 10px;
    margin: 0 0 12px;
}

.scenario-metric {
    border: 1px solid rgba(11, 99, 216, 0.25);
    border-radius: 12px;
    background: linear-gradient(140deg, #ffffff 0%, #eef5ff 100%);
    padding: 8px 10px;
}

.scenario-metric span {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 3px;
}

.scenario-metric strong {
    color: var(--brand-blue-mid);
    font-size: 1rem;
}

.scenario-progress-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(11, 99, 216, 0.12);
    overflow: hidden;
    margin-bottom: 16px;
}

.scenario-progress-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand-blue) 0%, #1ea6ff 48%, var(--brand-red) 100%);
    transition: width 0.35s ease;
}

.phrase-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border: 2px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease, opacity 0.22s ease;
    margin-bottom: 12px;
    background: linear-gradient(130deg, #ffffff 0%, #f2f8ff 70%, #fff3f6 100%);
    box-shadow: 0 8px 20px rgba(7, 36, 76, 0.06);
    transform: translateY(0) scale(1);
}

.phrase-option:hover {
    border-color: var(--brand-blue);
    background: linear-gradient(135deg, var(--brand-blue-light) 0%, #fff0f4 100%);
    box-shadow: 0 12px 22px rgba(11, 99, 216, 0.16);
    transform: translateY(-2px) scale(1.01);
}

.phrase-option:active {
    transform: translateY(0) scale(0.99);
}

.scenario-option-enter {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
    transition-delay: var(--scenario-delay, 0ms);
}

.scenario-option-enter.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.phrase-option .phrase-text {
    font-family: 'Georgia', serif;
    font-style: italic;
    font-size: 1.1rem;
    color: var(--dark);
}

/* =============================================================================
   CONTRIBUTION FORM
   ============================================================================= */
.submission-container {
    max-width: 700px;
    margin: 0 auto;
}

.step-indicator {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.step-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 88px;
}

.step-label {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--muted);
    text-transform: uppercase;
}

.step-marker.active .step-label {
    color: var(--brand-blue);
}

.step-marker.completed .step-label {
    color: #166534;
}

.step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border);
    transition: all 0.3s ease;
}

.step-dot.active {
    background: var(--brand-blue);
    transform: scale(1.3);
    box-shadow: 0 0 0 4px var(--brand-blue-light);
}

.step-dot.completed {
    background: var(--success);
}

.submission-feedback {
    min-height: 30px;
    margin: -24px auto 28px;
    max-width: 560px;
    border-radius: 12px;
    border: 1px solid transparent;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    color: transparent;
    transition: all 0.25s ease;
}

.submission-feedback.show {
    color: var(--text);
    background: linear-gradient(135deg, #f5f9ff 0%, #fff3f6 100%);
    border-color: rgba(11, 99, 216, 0.24);
}

.submission-feedback.success.show {
    color: #166534;
    background: #ecfdf3;
    border-color: #86efac;
}

.submission-feedback.error.show {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fca5a5;
}

.submission-step {
    display: none;
    animation: slideUp 0.4s ease;
}

.submission-step.active {
    display: block;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-title {
    text-align: center;
    margin-bottom: 40px;
}

.step-title h2 {
    font-size: 1.75rem;
    color: var(--dark);
    margin-bottom: 8px;
}

.step-title p {
    color: var(--muted);
}

.form-group {
    margin-bottom: 28px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--dark);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 4px var(--brand-blue-light);
}

.form-group textarea {
    min-height: 140px;
    resize: vertical;
    line-height: 1.6;
}

.form-hint {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 8px;
}

/* Language Selection Grid */
.language-select-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.language-option {
    padding: 24px 16px;
    border: 2px solid var(--border);
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.language-option:hover {
    border-color: var(--brand-blue);
    background: var(--brand-blue-light);
}

.language-option.selected {
    border-color: var(--brand-blue);
    background: var(--brand-blue-light);
    box-shadow: 0 4px 12px rgba(0, 64, 133, 0.15);
}

.language-option .lang-icon {
    width: 48px;
    height: 48px;
    background: var(--brand-blue-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: var(--brand-blue);
}

.language-option .lang-name {
    font-weight: 600;
    color: var(--dark);
}

.custom-language-panel {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
    padding: 20px;
    border: 1px solid rgba(11, 99, 216, 0.18);
    border-radius: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f2f8ff 100%);
}

.custom-language-panel.show {
    display: grid;
}

/* Country Fun Fact */
.country-fact {
    background: linear-gradient(135deg, var(--brand-blue-light) 0%, #dbeafe 100%);
    border: 1px solid var(--brand-blue);
    border-left: 4px solid var(--brand-blue);
    border-radius: 12px;
    padding: 20px 24px;
    margin-top: 24px;
    display: none;
}

.country-fact.show {
    display: block;
    animation: slideUp 0.3s ease;
}

.country-fact-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--brand-blue);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.country-fact-text {
    font-size: 0.95rem;
    color: var(--dark);
    line-height: 1.5;
}

.country-fact-title {
    margin-bottom: 8px;
    color: var(--dark);
    font-size: 1.1rem;
}

.country-fact-learning {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.5;
    border-top: 1px solid rgba(0, 64, 133, 0.2);
    padding-top: 10px;
}

.country-fact-actions {
    margin-top: 12px;
}

.country-fact-actions .btn {
    border-radius: 999px;
    padding: 8px 14px;
}

/* Emotion Tags Selection */
.emotion-tags-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Consent Options */
.consent-options {
    margin-top: 32px;
    padding: 24px;
    background: var(--light);
    border-radius: 16px;
    border: 1px solid var(--border);
}

.consent-options h4 {
    font-size: 1rem;
    color: var(--dark);
    margin-bottom: 16px;
}

.consent-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.consent-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--brand-blue);
}

.consent-option label {
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.5;
}

/* Step Actions */
.step-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 48px;
}

.step-quick-action {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    z-index: 65;
    width: min(92vw, 760px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(11, 99, 216, 0.28);
    background: linear-gradient(130deg, rgba(0, 32, 84, 0.94) 0%, rgba(11, 99, 216, 0.94) 58%, rgba(204, 0, 0, 0.9) 100%);
    box-shadow: 0 10px 34px rgba(0, 26, 70, 0.35);
    color: #fff;
}

.step-quick-action.hidden {
    display: none;
}

.step-quick-copy {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.93rem;
    font-weight: 700;
}

.step-quick-copy .material-icons-round {
    font-size: 20px;
}

.step-quick-action .btn {
    white-space: nowrap;
    min-height: 44px;
}

.btn-back {
    background: transparent;
    color: var(--muted);
    border: none;
    padding: 14px 28px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.btn-back:hover {
    color: var(--brand-blue);
}

.btn-next {
    background: var(--brand-blue);
    color: white;
    border: none;
    padding: 16px 36px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-next:hover {
    background: #003366;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 64, 133, 0.25);
}

.btn-submit {
    background: var(--brand-red);
}

.btn-submit:hover {
    background: #a00000;
    box-shadow: 0 8px 20px rgba(204, 0, 0, 0.25);
}

/* Success State */
.submission-success {
    text-align: center;
    padding: 60px 20px;
}

.success-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--success), #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 32px;
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.success-icon .material-icons-round {
    font-size: 48px;
    color: white;
}

.submission-success h2 {
    font-size: 2rem;
    color: var(--dark);
    margin-bottom: 16px;
}

.submission-success p {
    color: var(--muted);
    font-size: 1.1rem;
    max-width: 400px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

.submission-save-proof {
    margin: -12px auto 24px !important;
    padding: 12px 16px !important;
    max-width: 520px !important;
    border-radius: 12px !important;
    border: 1px solid #86efac !important;
    background: #ecfdf3 !important;
    color: #166534 !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
}

/* =============================================================================
   BROWSE / GLOSSARY GRID
   ============================================================================= */
.browse-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-chip {
    padding: 10px 20px;
    border: 2px solid var(--border);
    border-radius: 24px;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    color: var(--text);
}

.filter-chip:hover {
    border-color: var(--brand-blue);
    color: var(--brand-blue);
}

.filter-chip.active {
    border-color: var(--brand-blue);
    background: var(--brand-blue);
    color: white;
}

.search-bar {
    max-width: 400px;
    margin: 0 auto 40px;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 16px 20px 16px 50px;
    border: 2px solid var(--border);
    border-radius: 50px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 4px 20px rgba(0, 64, 133, 0.15);
}

.search-bar .material-icons-round {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
}

.glossary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 24px;
}

.glossary-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 28px;
    transition: all 0.3s ease;
}

.glossary-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 50px rgba(0, 64, 133, 0.12);
    border-color: var(--brand-blue);
}

.glossary-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.glossary-card-phrase {
    font-family: 'Georgia', serif;
    font-size: 1.35rem;
    font-style: italic;
    color: var(--dark);
    margin-bottom: 12px;
    line-height: 1.4;
}

.glossary-card-literal {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 16px;
    padding-left: 16px;
    border-left: 3px solid var(--border);
    font-style: italic;
}

.glossary-card-meaning {
    font-size: 1rem;
    color: var(--text);
    line-height: 1.65;
}

.glossary-card-tags {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.glossary-tag {
    font-size: 0.75rem;
    padding: 5px 12px;
    background: var(--light);
    border-radius: 12px;
    color: var(--muted);
    font-weight: 500;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 48px;
}

.page-btn {
    width: 44px;
    height: 44px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: white;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover {
    border-color: var(--brand-blue);
    color: var(--brand-blue);
}

.page-btn.active {
    background: var(--brand-blue);
    border-color: var(--brand-blue);
    color: white;
}

/* =============================================================================
   DE-ID LAB GAME
   ============================================================================= */
.deid-game-container {
    max-width: 900px;
    margin: 0 auto;
}

.deid-game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
    background: linear-gradient(145deg, #ffffff 0%, #eef6ff 75%, #fff0f5 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    margin-bottom: 24px;
}

.deid-game-header .quiz-score-display {
    gap: 18px;
}

.deid-game-header .score-value {
    font-size: 1.5rem;
}

.deid-level-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--brand-blue-light) 0%, #fff0f5 100%);
    border-radius: 20px;
    font-weight: 600;
    color: var(--brand-blue);
}

.deid-progress-bar {
    flex: 1;
    max-width: 300px;
    height: 10px;
    background: var(--border);
    border-radius: 5px;
    margin: 0 24px;
    overflow: hidden;
}

.deid-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-blue), var(--brand-blue-mid));
    border-radius: 5px;
    transition: width 0.4s ease;
}

.deid-round-info {
    font-size: 0.9rem;
    color: var(--muted);
}

.deid-sentence-card {
    background: linear-gradient(165deg, #ffffff 0%, #f2f8ff 70%, #fff1f5 100%);
    border: 2px solid var(--border);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 24px;
}

.deid-instruction {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--brand-blue);
    margin-bottom: 24px;
    font-weight: 500;
}

.deid-sentence {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 1.15rem;
    line-height: 2;
    color: var(--dark);
    background: linear-gradient(140deg, #f4f9ff 0%, #eef6ff 100%);
    padding: 28px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.deid-word {
    display: inline;
    padding: 3px 2px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.deid-word:hover {
    background: var(--brand-blue-light);
    color: var(--brand-blue);
}

.deid-word.selected {
    background: var(--brand-red);
    color: white;
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

.deid-word.correct {
    background: var(--success);
    color: white;
}

.deid-word.missed {
    background: var(--warning);
    color: white;
}

.deid-word.false-positive {
    background: var(--error-soft);
    color: var(--error);
    border: 1px dashed var(--error);
}

.deid-game-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.deid-game-actions .btn {
    min-width: 160px;
}

/* De-ID Results */
.deid-results {
    background: linear-gradient(165deg, #ffffff 0%, #f2f8ff 72%, #fff1f5 100%);
    border: 2px solid var(--border);
    border-radius: 20px;
    padding: 32px;
    margin-top: 24px;
    display: none;
}

.deid-results.show {
    display: block;
    animation: slideUp 0.4s ease;
}

.deid-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.deid-score-breakdown {
    display: flex;
    gap: 24px;
}

.score-breakdown-item {
    text-align: center;
}

.score-breakdown-item .value {
    font-size: 1.5rem;
    font-weight: 700;
}

.score-breakdown-item .value.positive { color: var(--success); }
.score-breakdown-item .value.negative { color: var(--error); }
.score-breakdown-item .value.neutral { color: var(--warning); }

.score-breakdown-item .label {
    font-size: 0.8rem;
    color: var(--muted);
}

.deid-feedback-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.deid-rewrite-panel {
    margin-top: 22px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: linear-gradient(140deg, #f8fbff 0%, #f2f8ff 70%, #fff1f5 100%);
    padding: 18px;
}

.deid-rewrite-panel h4 {
    margin-bottom: 8px;
}

.deid-rewrite-panel p {
    margin-bottom: 10px;
    color: var(--muted);
}

.deid-rewrite-reference-label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--brand-blue);
    margin-bottom: 6px;
}

.deid-rewrite-reference {
    border: 1px dashed #bfd7f3;
    background: linear-gradient(140deg, #f2f8ff 0%, #eef6ff 70%, #fff2f6 100%);
    border-radius: 10px;
    padding: 10px 12px;
    color: #12375e;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.55;
    margin-bottom: 10px;
    min-height: 52px;
}

.deid-rewrite-panel textarea {
    width: 100%;
    min-height: 110px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    resize: vertical;
    font-family: inherit;
}

.deid-rewrite-panel textarea:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(0, 64, 133, 0.12);
}

.deid-risk-block {
    margin-top: 12px;
    display: grid;
    gap: 8px;
}

.deid-risk-block label {
    font-size: 0.86rem;
    color: var(--dark);
    font-weight: 600;
}

.deid-risk-block select,
.deid-risk-block textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    font-family: inherit;
    background: white;
}

.deid-risk-block textarea {
    min-height: 82px;
    resize: vertical;
}

.deid-risk-block select:focus,
.deid-risk-block textarea:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(0, 64, 133, 0.12);
}

.deid-rewrite-actions {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.deid-rewrite-status {
    font-size: 0.88rem;
    color: var(--muted);
}

.deid-rewrite-status.success {
    color: #166534;
}

.deid-rewrite-status.error {
    color: #991b1b;
}

.deid-rewrite-status.info {
    color: #1e3a8a;
}

.deid-feedback-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-radius: 12px;
    background: var(--light);
}

.deid-feedback-item.correct { background: var(--success-soft); }
.deid-feedback-item.missed { background: var(--warning-soft); }
.deid-feedback-item.false-positive { background: var(--error-soft); }

.feedback-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feedback-icon.correct { background: var(--success); color: white; }
.feedback-icon.missed { background: var(--warning); color: white; }
.feedback-icon.false-positive { background: var(--error); color: white; }

.feedback-content {
    flex: 1;
}

.feedback-phi-value {
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
}

.feedback-category {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 8px;
}

.feedback-explanation {
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.5;
}

/* =============================================================================
   DIFFICULTY LEVELS & PROGRESSION
   ============================================================================= */
.level-selector {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 40px;
}

.level-card {
    padding: 24px 32px;
    border: 2px solid var(--border);
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    min-width: 140px;
}

.level-card:hover {
    border-color: var(--brand-blue);
    transform: translateY(-4px);
}

.level-card.active {
    border-color: var(--brand-blue);
    background: var(--brand-blue-light);
}

.level-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.level-card .level-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--dark);
    margin-bottom: 4px;
}

.level-card .level-desc {
    font-size: 0.8rem;
    color: var(--muted);
}

.level-badge-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    background: var(--brand-blue-light);
    color: var(--brand-blue);
}

/* Connector Pathway */
.connector-pathway {
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-blue-mid) 100%);
    border-radius: 24px;
    padding: 48px;
    color: white;
    text-align: center;
    margin-top: 60px;
}

.connector-pathway h3 {
    color: white;
    font-size: 1.75rem;
    margin-bottom: 16px;
}

.connector-pathway p {
    opacity: 0.9;
    max-width: 500px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

.pathway-progress {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.pathway-level {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.pathway-badge {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255,255,255,0.3);
}

.pathway-badge.earned {
    background: white;
    color: var(--brand-blue);
}

.pathway-badge .material-icons-round {
    font-size: 28px;
}

.pathway-connector {
    width: 40px;
    height: 3px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
}

.pathway-connector.complete {
    background: white;
}

/* =============================================================================
   LEADERBOARD
   ============================================================================= */
.leaderboard-container {
    max-width: 600px;
    margin: 0 auto;
}

.leaderboard-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}

.leaderboard-tab {
    padding: 10px 24px;
    border: 2px solid var(--border);
    border-radius: 24px;
    background: linear-gradient(135deg, #ffffff 0%, #f2f8ff 100%);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text);
}

.leaderboard-tab:hover {
    border-color: var(--brand-blue);
}

.leaderboard-tab.active {
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-blue-mid) 72%, var(--brand-red) 100%);
    border-color: var(--brand-blue-mid);
    color: white;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.leaderboard-status {
    padding: 18px 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, #ffffff 0%, #f4f8ff 100%);
    color: var(--muted);
    text-align: center;
    font-size: 0.95rem;
}

.leaderboard-status.success {
    border-color: #16a34a;
    background: #ecfdf3;
    color: #166534;
}

.leaderboard-status.error {
    border-color: #dc2626;
    background: #fef2f2;
    color: #991b1b;
}

.leaderboard-entry {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #ffffff 0%, #f4f8ff 85%, #fff2f6 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    transition: all 0.2s ease;
}

.leaderboard-entry:hover {
    border-color: var(--brand-blue);
    transform: translateX(4px);
}

.leaderboard-entry.top-3 {
    border-width: 2px;
}

.leaderboard-entry.rank-1 { border-color: #fbbf24; background: linear-gradient(140deg, #fffbeb 0%, #fff7e0 100%); }
.leaderboard-entry.rank-2 { border-color: #94a3b8; background: linear-gradient(140deg, #f8fafc 0%, #edf2f7 100%); }
.leaderboard-entry.rank-3 { border-color: #d97706; background: linear-gradient(140deg, #fffbeb 0%, #fff2de 100%); }

.entry-rank {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    background: var(--light);
    color: var(--muted);
}

.leaderboard-entry.rank-1 .entry-rank { background: #fbbf24; color: white; }
.leaderboard-entry.rank-2 .entry-rank { background: #94a3b8; color: white; }
.leaderboard-entry.rank-3 .entry-rank { background: #d97706; color: white; }

.entry-info {
    flex: 1;
}

.entry-name {
    font-weight: 600;
    color: var(--dark);
}

.entry-level {
    font-size: 0.85rem;
    color: var(--muted);
}

.entry-score {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-blue);
}

/* =============================================================================
   RETRO GUIDE POPUP
   ============================================================================= */
.retro-guide {
    position: fixed;
    inset: 0;
    z-index: 2200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 20px;
}

.retro-guide.hidden {
    display: none;
}

.retro-guide-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 10, 22, 0.7);
    backdrop-filter: blur(2px);
}

.retro-guide-panel {
    position: relative;
    width: min(900px, 100%);
    background: #f8fbff;
    border: 4px solid #0f172a;
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    padding: 18px;
}

.retro-guide-panel h2 {
    margin: 0 0 12px;
    font-size: 1rem;
    font-family: 'Press Start 2P', 'JetBrains Mono', monospace;
    color: #0f172a;
}

.retro-guide-row {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 14px;
    align-items: center;
}

.retro-guide-avatar {
    width: 90px;
    height: 90px;
    border: 3px solid #0f172a;
    border-radius: 10px;
    background: #0b1c35;
    display: flex;
    align-items: center;
    justify-content: center;
}

.retro-guide-avatar img {
    width: 66px;
    height: 66px;
}

.retro-guide-textbox {
    min-height: 96px;
    border: 3px solid #0f172a;
    border-radius: 10px;
    background: white;
    padding: 14px 16px;
    display: flex;
    align-items: center;
}

.retro-guide-textbox p {
    margin: 0;
    font-family: 'Press Start 2P', 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    line-height: 1.8;
    color: #0f172a;
}

.retro-guide-actions {
    margin-top: 14px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.leaderboard-name-dialog {
    position: fixed;
    inset: 0;
    z-index: 2250;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.leaderboard-name-dialog.hidden {
    display: none;
}

.leaderboard-name-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 10, 22, 0.72);
}

.leaderboard-name-panel {
    position: relative;
    width: min(420px, 100%);
    border-radius: 12px;
    border: 2px solid #0f172a;
    background: linear-gradient(145deg, #f8fbff 0%, #edf5ff 72%, #fff1f6 100%);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.32);
    padding: 18px;
}

.leaderboard-name-panel h3 {
    margin: 0 0 8px;
    font-size: 1.06rem;
    color: #0f172a;
}

.leaderboard-name-panel p {
    margin: 0 0 12px;
    color: #1f3757;
    font-size: 0.92rem;
}

.leaderboard-name-panel input {
    width: 100%;
    border: 1px solid rgba(11, 99, 216, 0.34);
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 0.95rem;
    background: #fff;
    color: var(--text);
}

.leaderboard-name-actions {
    margin-top: 14px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.interaction-toast {
    position: fixed;
    top: 96px;
    right: 18px;
    z-index: 2500;
    max-width: 360px;
    background: linear-gradient(140deg, #061a34 0%, #0a2f62 68%, #b81735 100%);
    color: #eaf5ff;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 14px;
    box-shadow: 0 16px 34px rgba(3, 15, 34, 0.35);
    padding: 12px 14px;
    line-height: 1.45;
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.interaction-toast strong {
    display: block;
    color: #ffffff;
    margin-bottom: 2px;
    font-size: 0.88rem;
    letter-spacing: 0.02em;
}

.interaction-toast.error {
    background: linear-gradient(140deg, #3a0a12 0%, #7d1125 72%, #b91c1c 100%);
}

.interaction-toast.info {
    background: linear-gradient(140deg, #061a34 0%, #0f3f83 74%, #1d4ed8 100%);
}

.interaction-toast.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

/* =============================================================================
   SCORE POPUP ANIMATION
   ============================================================================= */
.score-popup {
    position: fixed;
    pointer-events: none;
    font-size: 1.5rem;
    font-weight: 800;
    z-index: 1000;
    animation: scorePopup 1s ease forwards;
}

.score-popup.positive { color: var(--success); }
.score-popup.negative { color: var(--error); }

@keyframes scorePopup {
    0% { opacity: 0; transform: translateY(10px) scale(0.8); }
    20% { opacity: 1; transform: translateY(-10px) scale(1.1); }
    100% { opacity: 0; transform: translateY(-40px) scale(0.9); }
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */
@media (max-width: 900px) {
    .glossary-hero h1 {
        font-size: 2.5rem;
    }

    .hero-stats-row {
        flex-wrap: wrap;
        gap: 16px;
    }

    .hero-stat-card {
        padding: 20px 28px;
    }

    .glossary-tabs {
        flex-direction: column;
        padding: 0 16px;
        margin-top: -30px;
        gap: 8px;
    }

    .tab-btn {
        border-radius: 16px;
        flex-direction: row;
        justify-content: center;
    }

    .glossary-section-nav {
        top: calc(var(--nav-height, 80px) + 6px);
        padding: 12px 16px 8px;
        margin-bottom: 0;
    }

    .learning-hub-grid {
        grid-template-columns: 1fr 1fr;
    }

    .quiz-card {
        padding: 32px 24px;
    }

    .quiz-phrase {
        font-size: 1.5rem;
    }

    .glossary-grid {
        grid-template-columns: 1fr;
    }

    .language-select-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .custom-language-panel {
        grid-template-columns: 1fr;
    }

    .level-selector {
        flex-wrap: wrap;
    }

    .level-card {
        min-width: 120px;
        padding: 20px 24px;
    }

    .pathway-progress {
        flex-wrap: wrap;
    }

    .deid-game-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .deid-progress-bar {
        max-width: 100%;
        margin: 16px 0;
    }

    .interaction-toast {
        top: 88px;
        left: 14px;
        right: 14px;
        max-width: none;
    }
}

@media (max-width: 600px) {
    .glossary-hero {
        padding: 140px 0 80px;
    }

    .glossary-hero h1 {
        font-size: 2rem;
    }

    .hero-quote {
        font-size: 1rem;
        padding: 16px;
    }

    .tab-section {
        padding: 40px 0;
    }

    .learning-hub-grid {
        grid-template-columns: 1fr;
    }

    .quiz-options {
        gap: 12px;
    }

    .scenario-hud {
        grid-template-columns: 1fr 1fr;
    }

    .quiz-option {
        padding: 16px 20px;
    }

    .phrase-option .phrase-text {
        font-size: 1rem;
    }

    .step-actions {
        flex-direction: column-reverse;
        gap: 16px;
    }

    .step-quick-action {
        width: calc(100vw - 16px);
        left: 8px;
        right: 8px;
        transform: none;
        bottom: 8px;
        border-radius: 12px;
        padding: 10px 12px;
        gap: 10px;
    }

    .step-quick-copy {
        font-size: 0.82rem;
    }

    .step-quick-action .btn {
        font-size: 0.88rem;
        padding: 10px 14px;
        min-height: 40px;
    }

    .step-marker {
        min-width: 72px;
    }

    .step-label {
        font-size: 0.66rem;
    }

    .btn-back, .btn-next {
        width: 100%;
        justify-content: center;
    }

    .deid-sentence {
        font-size: 1rem;
        padding: 20px;
    }

    .connector-pathway {
        padding: 32px 24px;
    }

    .retro-guide {
        padding: 12px;
    }

    .retro-guide-row {
        grid-template-columns: 1fr;
    }

    .retro-guide-avatar {
        width: 72px;
        height: 72px;
    }

    .retro-guide-avatar img {
        width: 52px;
        height: 52px;
    }

    .retro-guide-textbox {
        min-height: 120px;
    }

    .retro-guide-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .leaderboard-name-actions {
        flex-wrap: wrap;
    }

    .leaderboard-name-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .floating-add-glossary {
        right: 12px;
        bottom: 14px;
        padding: 10px 12px;
        font-size: 0.88rem;
    }

    .interaction-toast {
        left: 10px;
        right: 10px;
        top: 84px;
    }
}

