/* ===== RESET & BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0f0f1a;
    color: #e0e0e0;
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
#sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    border-right: 1px solid #2a2a4a;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid #2a2a4a;
}

.sidebar-header h1 {
    font-size: 1.5rem;
    color: #ffd700;
    font-weight: 800;
}
.sidebar-header h1 span { color: #ff6b6b; }
.tagline {
    font-size: 0.8rem;
    color: #888;
    margin-top: 4px;
}

.nav-links {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s;
    text-align: left;
}
.nav-btn:hover { background: #ffffff10; color: #fff; }
.nav-btn.active { background: #ffd70020; color: #ffd700; font-weight: 600; }
.nav-icon { font-size: 1.2rem; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid #2a2a4a;
    text-align: center;
}

.streak-display {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ff9500;
    margin-bottom: 8px;
}
.streak-fire { font-size: 1.4rem; }

.reset-btn {
    background: transparent;
    border: 1px solid #ff4444;
    color: #ff4444;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: inherit;
    transition: all 0.2s;
}
.reset-btn:hover { background: #ff444420; }

/* ===== MAIN CONTENT ===== */
#main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px 40px;
    max-width: 1100px;
}

.page { display: none; }
.page.active { display: block; }

.page-header { margin-bottom: 30px; }
.page-header h2 { font-size: 1.8rem; color: #fff; margin-bottom: 6px; }
.page-header p { color: #888; font-size: 0.95rem; }

/* ===== DASHBOARD ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #1e1e3a 0%, #252550 100%);
    border: 1px solid #3a3a6a;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
}
.stat-number { font-size: 2rem; font-weight: 800; color: #ffd700; }
.stat-label { font-size: 0.85rem; color: #888; margin-top: 4px; }

.progress-overview {
    background: #1a1a2e;
    border: 1px solid #2a2a4a;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
}
.progress-overview h3 { color: #fff; margin-bottom: 20px; }

.cefr-block { margin-bottom: 16px; }
.cefr-label { font-size: 0.9rem; color: #ccc; margin-bottom: 6px; display: flex; justify-content: space-between; }
.cefr-bar {
    height: 12px;
    background: #2a2a4a;
    border-radius: 6px;
    overflow: hidden;
}
.cefr-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
    width: 0%;
}
#fill-a1 { background: linear-gradient(90deg, #4CAF50, #8BC34A); }
#fill-a2 { background: linear-gradient(90deg, #FF9800, #FFC107); }
#fill-b1 { background: linear-gradient(90deg, #E91E63, #FF5722); }
.cefr-percent { font-size: 0.85rem; color: #888; margin-top: 4px; text-align: right; }

.daily-tip {
    background: linear-gradient(135deg, #1a3a2a 0%, #1a2a1a 100%);
    border: 1px solid #2a5a3a;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
}
.daily-tip h3 { color: #8BC34A; margin-bottom: 10px; }
.daily-tip p { color: #bbb; line-height: 1.6; }

.level-map { margin-bottom: 30px; }
.level-map h3 { color: #fff; margin-bottom: 16px; }

#level-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.level-card {
    background: #1e1e3a;
    border: 1px solid #3a3a6a;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.level-card:hover { transform: translateY(-2px); border-color: #ffd700; }
.level-card.completed { border-color: #4CAF50; }
.level-card.locked { opacity: 0.5; cursor: not-allowed; }
.level-card.current { border-color: #ffd700; box-shadow: 0 0 20px #ffd70030; }

.level-card .level-cefr {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 8px;
}
.level-cefr.a1 { background: #4CAF5030; color: #8BC34A; }
.level-cefr.a2 { background: #FF980030; color: #FFC107; }
.level-cefr.b1 { background: #E91E6330; color: #FF5722; }

.level-card .level-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
}
.level-card .level-words {
    font-size: 0.8rem;
    color: #888;
}
.level-card .level-check {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 1.2rem;
}

/* ===== LEVEL SELECTOR ===== */
.level-selector {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.level-selector label { color: #888; font-size: 0.9rem; }
.level-selector select {
    background: #1e1e3a;
    border: 1px solid #3a3a6a;
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    min-width: 280px;
}
.level-selector select:focus { outline: none; border-color: #ffd700; }

/* ===== FLASHCARDS ===== */
.flashcard-progress {
    text-align: center;
    margin-bottom: 16px;
}
#card-counter { color: #888; font-size: 0.9rem; }
.mini-progress {
    height: 4px;
    background: #2a2a4a;
    border-radius: 2px;
    margin-top: 8px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}
.mini-fill {
    height: 100%;
    background: #ffd700;
    border-radius: 2px;
    transition: width 0.3s;
}

.flashcard {
    width: 100%;
    max-width: 500px;
    min-height: 320px;
    margin: 0 auto 24px;
    perspective: 1000px;
    cursor: pointer;
}

.flashcard-front, .flashcard-back {
    background: linear-gradient(135deg, #1e1e3a 0%, #2a2a5a 100%);
    border: 2px solid #3a3a7a;
    border-radius: 20px;
    padding: 40px 32px;
    text-align: center;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.flashcard.flipped .flashcard-front { display: none; }
.flashcard:not(.flipped) .flashcard-back { display: none; }

.word-article {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.word-article.der { color: #4fc3f7; }
.word-article.die { color: #f48fb1; }
.word-article.das { color: #81c784; }

.word-german { font-size: 2.2rem; font-weight: 800; color: #fff; margin-bottom: 8px; }
.word-pos { font-size: 0.85rem; color: #888; font-style: italic; margin-bottom: 16px; }
.word-english { font-size: 1.8rem; font-weight: 700; color: #ffd700; margin-bottom: 20px; }

.word-example { margin-bottom: 16px; width: 100%; }
.example-de {
    font-size: 1rem;
    color: #aaa;
    font-style: italic;
    margin-bottom: 4px;
    display: inline;
}
.example-en { font-size: 0.9rem; color: #666; margin-top: 6px; }

.word-tip {
    font-size: 0.85rem;
    color: #8BC34A;
    background: #8BC34A15;
    padding: 8px 16px;
    border-radius: 8px;
}

.flip-hint { font-size: 0.8rem; color: #555; margin-top: 16px; }

.speak-btn {
    background: #ffd70020;
    border: 1px solid #ffd70040;
    font-size: 1.8rem;
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
}
.speak-btn:hover { background: #ffd70040; transform: scale(1.1); }

.speak-btn-small {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    vertical-align: middle;
    margin-left: 4px;
}

.flashcard-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ctrl-btn {
    padding: 12px 24px;
    border: 1px solid #3a3a6a;
    background: #1e1e3a;
    color: #ccc;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s;
}
.ctrl-btn:hover { background: #2a2a5a; border-color: #5a5a9a; }
.ctrl-btn.know-btn {
    background: #4CAF5020;
    border-color: #4CAF50;
    color: #8BC34A;
}
.ctrl-btn.know-btn:hover { background: #4CAF5040; }

/* ===== QUIZ ===== */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: #1a1a2e;
    border-radius: 12px;
}
.quiz-progress { color: #888; }
.quiz-score { color: #ffd700; font-weight: 700; font-size: 1.1rem; }

.quiz-question {
    font-size: 1.4rem;
    font-weight: 600;
    color: #fff;
    text-align: center;
    margin-bottom: 12px;
    padding: 24px;
    background: linear-gradient(135deg, #1e1e3a, #2a2a5a);
    border-radius: 16px;
    line-height: 1.5;
}
.quiz-hint {
    text-align: center;
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.quiz-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.quiz-option {
    padding: 16px 20px;
    background: #1e1e3a;
    border: 2px solid #3a3a6a;
    border-radius: 12px;
    color: #ccc;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-family: inherit;
}
.quiz-option:hover { border-color: #ffd700; color: #fff; background: #25254a; }
.quiz-option.correct {
    border-color: #4CAF50 !important;
    background: #4CAF5020 !important;
    color: #8BC34A !important;
}
.quiz-option.wrong {
    border-color: #ff4444 !important;
    background: #ff444420 !important;
    color: #ff6b6b !important;
}
.quiz-option.disabled { pointer-events: none; }

.quiz-feedback {
    text-align: center;
    font-size: 1.1rem;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 16px;
    min-height: 50px;
}

.quiz-next-btn {
    display: block;
    margin: 0 auto;
    padding: 14px 32px;
    background: #ffd700;
    border: none;
    color: #1a1a2e;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}
.quiz-next-btn:hover { background: #ffed4a; transform: scale(1.02); }

/* ===== RESULTS ===== */
.result-card {
    text-align: center;
    background: linear-gradient(135deg, #1e1e3a 0%, #2a2a5a 100%);
    border: 1px solid #3a3a7a;
    border-radius: 24px;
    padding: 48px 32px;
    max-width: 500px;
    margin: 40px auto;
}
.result-emoji { font-size: 4rem; margin-bottom: 16px; }
.result-score { font-size: 2.5rem; font-weight: 800; color: #ffd700; margin-bottom: 12px; }
.result-message { font-size: 1.1rem; color: #aaa; margin-bottom: 24px; line-height: 1.5; }
.result-details { font-size: 0.9rem; color: #888; margin-bottom: 24px; }
.result-card .ctrl-btn { margin: 6px; }

/* ===== LISTEN ===== */
.listen-progress { text-align: center; margin-bottom: 20px; color: #888; }

.listen-card {
    background: linear-gradient(135deg, #1e1e3a 0%, #2a2a5a 100%);
    border: 2px solid #3a3a7a;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 550px;
    margin: 0 auto 24px;
}

.big-speak-btn {
    background: #ffd70020;
    border: 2px solid #ffd70060;
    font-size: 1.5rem;
    padding: 20px 32px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    margin: 8px;
    color: #ffd700;
    font-family: inherit;
}
.big-speak-btn:hover { background: #ffd70040; transform: scale(1.05); }
.slow-btn { font-size: 1.2rem; border-color: #81c784; color: #81c784; background: #81c78420; }
.slow-btn:hover { background: #81c78440; }

.listen-input-area {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.listen-input-area input {
    background: #0f0f1a;
    border: 2px solid #3a3a6a;
    color: #fff;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-family: inherit;
    width: 300px;
    text-align: center;
}
.listen-input-area input:focus { outline: none; border-color: #ffd700; }

.listen-feedback {
    margin-top: 16px;
    font-size: 1.1rem;
    min-height: 40px;
}
.listen-answer {
    margin-top: 12px;
    padding: 16px;
    background: #0f0f1a;
    border-radius: 10px;
}
.listen-answer .german-word { font-size: 1.3rem; color: #ffd700; font-weight: 700; }
.listen-answer .english-word { color: #888; font-size: 0.95rem; margin-top: 4px; }

/* ===== SENTENCES ===== */
.sentences-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sentence-card {
    background: #1e1e3a;
    border: 1px solid #3a3a6a;
    border-radius: 14px;
    padding: 20px 24px;
    transition: all 0.2s;
}
.sentence-card:hover { border-color: #5a5a9a; }

.sentence-de {
    font-size: 1.15rem;
    color: #fff;
    font-weight: 500;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.sentence-en { font-size: 0.95rem; color: #888; font-style: italic; margin-bottom: 8px; }
.sentence-word {
    display: inline-block;
    font-size: 0.8rem;
    padding: 2px 10px;
    border-radius: 6px;
    font-weight: 600;
}
.sentence-word.noun { background: #4fc3f720; color: #4fc3f7; }
.sentence-word.verb { background: #ff980020; color: #ff9800; }
.sentence-word.adj { background: #e91e6320; color: #e91e63; }

.sentence-speak-btn {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
}

/* ===== GRAMMAR ===== */
.grammar-content {
    background: #1e1e3a;
    border: 1px solid #3a3a6a;
    border-radius: 16px;
    padding: 32px;
    line-height: 1.8;
}
.grammar-content h3 { color: #ffd700; margin: 20px 0 12px; font-size: 1.2rem; }
.grammar-content h3:first-child { margin-top: 0; }
.grammar-content p { color: #bbb; margin-bottom: 12px; }
.grammar-content .grammar-example {
    background: #0f0f1a;
    border-left: 3px solid #ffd700;
    padding: 12px 16px;
    margin: 8px 0 16px;
    border-radius: 0 8px 8px 0;
}
.grammar-content .grammar-example .de { color: #fff; font-weight: 500; }
.grammar-content .grammar-example .en { color: #888; font-size: 0.9rem; }
.grammar-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}
.grammar-content th, .grammar-content td {
    padding: 10px 14px;
    border: 1px solid #3a3a6a;
    text-align: left;
}
.grammar-content th { background: #0f0f1a; color: #ffd700; font-weight: 600; }
.grammar-content td { color: #ccc; }
.grammar-content .tip {
    background: #8BC34A15;
    border: 1px solid #8BC34A40;
    padding: 12px 16px;
    border-radius: 10px;
    color: #8BC34A;
    margin: 12px 0;
}

/* ===== EXAM ===== */
.exam-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 700px;
}

.exam-card {
    background: linear-gradient(135deg, #1e1e3a, #2a2a5a);
    border: 2px solid #3a3a6a;
    border-radius: 16px;
    padding: 28px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.exam-card:hover { border-color: #ffd700; transform: translateY(-3px); }
.exam-card h3 { color: #fff; margin-bottom: 8px; }
.exam-card p { color: #888; font-size: 0.9rem; }
.exam-best { color: #ffd700; font-size: 0.85rem; margin-top: 12px; font-weight: 600; }

.exam-timer-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #1a1a2e;
    border-radius: 12px;
    margin-bottom: 24px;
}
#exam-timer { color: #ff6b6b; font-weight: 700; font-size: 1.2rem; min-width: 60px; }
.exam-progress-bar {
    flex: 1;
    height: 6px;
    background: #2a2a4a;
    border-radius: 3px;
}
.exam-progress-fill {
    height: 100%;
    background: #ffd700;
    border-radius: 3px;
    transition: width 0.3s;
}
#exam-q-counter { color: #888; min-width: 50px; text-align: right; }

/* ===== PRACTICE LEVEL INFO ===== */
.practice-level-info {
    margin-bottom: 20px;
    padding: 12px 18px;
    background: #1a1a2e;
    border: 1px solid #2a2a4a;
    border-radius: 10px;
    font-size: 0.9rem;
    color: #ccc;
}
.level-info-badge {
    display: inline-block;
    color: #ffd700;
}
.level-info-badge.complete {
    color: #8BC34A;
}
.level-info-fails {
    display: inline-block;
    color: #ff6b6b;
    margin-left: 12px;
}

/* ===== EXAM DETAILS BOX ===== */
.exam-details-box {
    text-align: left;
    margin-top: 20px;
    padding: 20px;
    background: #0f0f1a;
    border-radius: 14px;
    border: 1px solid #2a2a4a;
}

.exam-detail-header {
    text-align: center;
    margin-bottom: 16px;
}
.exam-detail-badge {
    display: inline-block;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
}
.exam-detail-badge.complete {
    background: #4CAF5030;
    color: #8BC34A;
    border: 1px solid #4CAF5060;
}
.exam-detail-badge.in-progress {
    background: #ffd70020;
    color: #ffd700;
    border: 1px solid #ffd70060;
}

.exam-pass-tracker {
    margin-bottom: 16px;
}
.exam-pass-label {
    font-size: 0.85rem;
    color: #aaa;
    margin-bottom: 8px;
}
.exam-pass-bar {
    height: 10px;
    background: #2a2a4a;
    border-radius: 5px;
    overflow: hidden;
}
.exam-pass-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ff9800);
    border-radius: 5px;
    transition: width 0.5s ease;
}

.exam-stats-row {
    display: flex;
    justify-content: space-around;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 0;
    border-top: 1px solid #2a2a4a;
    border-bottom: 1px solid #2a2a4a;
}
.exam-stat-item {
    text-align: center;
}
.exam-stat-num {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    color: #ffd700;
}
.exam-stat-lbl {
    display: block;
    font-size: 0.75rem;
    color: #888;
    margin-top: 2px;
}

.exam-fail-warning {
    background: #ff444415;
    border: 1px solid #ff444440;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.85rem;
    color: #ff6b6b;
    margin-bottom: 12px;
    line-height: 1.5;
}
.exam-fail-warning strong {
    color: #ff8888;
}

.exam-penalty-info {
    background: #ff980015;
    border: 1px solid #ff980040;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.8rem;
    color: #ff9800;
    margin-bottom: 12px;
    line-height: 1.4;
}

.exam-history-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    margin-top: 12px;
}

.exam-history-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.exam-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
}
.exam-history-item.pass {
    background: #4CAF5010;
    border: 1px solid #4CAF5030;
}
.exam-history-item.fail {
    background: #ff444410;
    border: 1px solid #ff444430;
}

.attempt-num {
    color: #888;
    font-weight: 600;
    min-width: 32px;
}
.attempt-score {
    color: #ffd700;
    font-weight: 700;
    min-width: 45px;
    text-align: center;
}
.attempt-result {
    font-weight: 600;
    min-width: 70px;
    text-align: center;
}
.exam-history-item.pass .attempt-result { color: #8BC34A; }
.exam-history-item.fail .attempt-result { color: #ff6b6b; }
.attempt-date {
    color: #666;
    font-size: 0.75rem;
}

/* ===== LOCKED DROPDOWN OPTIONS ===== */
.level-selector select option:disabled {
    color: #555;
    background: #151525;
}

/* ===== MOBILE ===== */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    background: #1e1e3a;
    border: 1px solid #3a3a6a;
    color: #ffd700;
    font-size: 1.5rem;
    padding: 8px 14px;
    border-radius: 10px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-menu-btn { display: block; }
    #sidebar {
        transform: translateX(-100%);
    }
    #sidebar.open { transform: translateX(0); }
    #main-content {
        margin-left: 0;
        padding: 20px 16px;
        padding-top: 60px;
    }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .quiz-options { grid-template-columns: 1fr; }
    .exam-options { grid-template-columns: 1fr; }
    .flashcard-front, .flashcard-back { padding: 24px 20px; }
    .word-german { font-size: 1.7rem; }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.page.active { animation: fadeIn 0.3s ease; }

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0f0f1a; }
::-webkit-scrollbar-thumb { background: #3a3a6a; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #5a5a8a; }

/* ===== APP FOOTER ===== */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 260px;
    right: 0;
    padding: 12px 24px;
    background: #0a0a16;
    border-top: 1px solid #1a1a2a;
    text-align: center;
    font-size: 0.75rem;
    color: #555;
    z-index: 50;
}
.app-footer p { margin-bottom: 4px; }
.footer-links { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.footer-links a { color: #888; text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: #ffd700; }
.footer-sep { color: #333; }

@media (max-width: 768px) {
    .app-footer { left: 0; }
}

/* ===== LEGAL MODAL ===== */
.legal-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.legal-modal-overlay.active {
    display: flex;
}
.legal-modal {
    background: #1a1a2e;
    border: 1px solid #2a2a4a;
    border-radius: 20px;
    width: 100%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 40px 36px;
    position: relative;
    animation: fadeIn 0.3s ease;
}
.legal-modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: #888;
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}
.legal-modal-close:hover { color: #fff; }
.legal-modal-body h2 {
    font-size: 1.5rem;
    color: #ffd700;
    margin-bottom: 8px;
    font-weight: 800;
}
.legal-modal-body .legal-date {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 24px;
}
.legal-modal-body h3 {
    font-size: 1.1rem;
    color: #fff;
    margin: 24px 0 10px;
    font-weight: 700;
}
.legal-modal-body p {
    color: #bbb;
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 12px;
}
.legal-modal-body ul {
    color: #bbb;
    font-size: 0.9rem;
    line-height: 1.7;
    margin: 0 0 12px 20px;
}
.legal-modal-body .legal-highlight {
    background: #ff444418;
    border: 1px solid #ff444440;
    border-radius: 10px;
    padding: 16px 20px;
    margin: 16px 0;
    color: #ff6b6b;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.6;
}
.legal-modal-body .legal-contact {
    background: #ffd70010;
    border: 1px solid #ffd70030;
    border-radius: 10px;
    padding: 16px 20px;
    margin-top: 20px;
}
.legal-modal-body .legal-contact p {
    color: #ccc;
    margin-bottom: 4px;
}
@media (max-width: 768px) {
    .legal-modal { padding: 28px 20px; }
}
