/* ===== WORDQUEST - CSS ===== */
:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.3);
    --success: #22c55e;
    --success-glow: rgba(34, 197, 94, 0.3);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.3);
    --warning: #f59e0b;
    --border: rgba(255, 255, 255, 0.08);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-main);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
}

#app {
    position: relative;
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
}

.screen {
    display: none;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0 20px 40px;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

.hidden { display: none !important; }

/* ===== SPLASH ===== */
#splash {
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.splash-bg {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 30% 20%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
}

.splash-content {
    text-align: center;
    z-index: 1;
}

.splash-icon {
    font-size: 5rem;
    margin-bottom: 16px;
    animation: splashBounce 1.5s ease-in-out infinite;
}

@keyframes splashBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-12px) scale(1.05); }
}

.splash-title {
    font-size: 2.8rem;
    font-weight: 900;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.splash-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    letter-spacing: 0.15em;
    font-weight: 600;
    margin-bottom: 32px;
}

.splash-loader {
    width: 200px;
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 4px;
    margin: 0 auto 16px;
    overflow: hidden;
}

.loader-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 4px;
    animation: loadBar 2s ease-in-out forwards;
}

@keyframes loadBar {
    0% { width: 0%; }
    100% { width: 100%; }
}

.splash-hint {
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* ===== HOME ===== */
#home {
    padding-top: 20px;
}

.home-header {
    padding: 0 0 16px;
}

.home-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.stat-icon { font-size: 1.2rem; }

.stat-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-main);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.home-hero {
    text-align: center;
    padding: 24px 0 32px;
}

.hero-icon {
    font-size: 3.5rem;
    margin-bottom: 12px;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 900;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

.hero-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Section Titles */
.section-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

/* Mode Cards */
.mode-section { margin-bottom: 24px; }

.mode-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mode-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    color: var(--text-main);
    font-family: inherit;
    width: 100%;
}

.mode-card:hover, .mode-card.selected {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.08);
    box-shadow: 0 0 20px var(--accent-glow);
}

.mode-card.selected {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.12);
}

.mode-icon { font-size: 2rem; flex-shrink: 0; }

.mode-info h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.mode-info p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.mode-count {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    background: rgba(59, 130, 246, 0.12);
    padding: 4px 10px;
    border-radius: 20px;
    flex-shrink: 0;
}

/* Exam & Difficulty Pills */
.exam-section, .diff-section { margin-bottom: 20px; }

.exam-pills, .diff-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.exam-pill, .diff-pill {
    padding: 8px 18px;
    border-radius: 25px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    font-family: inherit;
}

.exam-pill:hover, .diff-pill:hover {
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--accent);
}

.exam-pill.active, .diff-pill.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--accent);
    color: var(--accent);
}

/* Start Button */
.start-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 800;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 28px;
    font-family: inherit;
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.3);
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(59, 130, 246, 0.4);
}

.start-btn:active {
    transform: translateY(0);
}

.start-icon { font-size: 1.2rem; }

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 20px 0;
    border-top: 1px solid var(--border);
}

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

.qs-num {
    display: block;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
}

.qs-label {
    font-size: 0.68rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== QUIZ SCREEN ===== */
#quiz {
    padding-top: 16px;
}

.quiz-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.quiz-back {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    font-family: inherit;
}

.quiz-back:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.quiz-progress { flex: 1; }

.progress-bar {
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 6px;
    transition: width 0.4s ease;
    width: 0%;
}

.progress-text {
    font-size: 0.72rem;
    color: var(--text-dim);
    text-align: center;
    display: block;
}

.quiz-timer {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.timer-icon { font-size: 0.85rem; }

.timer-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    min-width: 20px;
    text-align: center;
}

.timer-value.warning { color: var(--warning); }
.timer-value.danger { color: var(--danger); animation: timerPulse 0.5s ease infinite; }

@keyframes timerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Quiz Status */
.quiz-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 4px;
}

.status-streak, .status-xp {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    font-weight: 700;
}

.streak-fire, .xp-star { font-size: 1rem; }

/* Question */
.question-area {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    margin-bottom: 20px;
    position: relative;
}

.question-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
    margin-bottom: 8px;
}

.question-level {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

.question-text {
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--text-main);
}

/* Options */
.options-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.25s;
    text-align: left;
    width: 100%;
    font-family: inherit;
}

.option-letter {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-dim);
    flex-shrink: 0;
    transition: all 0.25s;
}

.option-text {
    flex: 1;
}

.option-btn:hover:not(.disabled) {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.06);
}

.option-btn:hover:not(.disabled) .option-letter {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
}

/* Option States */
.option-btn.correct {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.1);
    animation: correctPop 0.4s ease;
}

.option-btn.correct .option-letter {
    background: var(--success);
    color: #fff;
}

.option-btn.wrong {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
    animation: wrongShake 0.4s ease;
}

.option-btn.wrong .option-letter {
    background: var(--danger);
    color: #fff;
}

.option-btn.disabled {
    cursor: default;
    opacity: 0.5;
}

.option-btn.disabled.correct { opacity: 1; }
.option-btn.disabled.wrong { opacity: 0.8; }

@keyframes correctPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

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

/* Word Info */
.word-info {
    padding: 14px 16px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius);
    margin-bottom: 12px;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.word-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.word-en {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent);
}

.word-arrow { color: var(--text-dim); }

.word-tr {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    text-align: center;
    word-break: break-word;
}

/* Next Button */
.next-btn {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    animation: slideUp 0.3s ease;
}

.next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

/* ===== RESULTS SCREEN ===== */
#results {
    padding-top: 40px;
    align-items: center;
}

.results-header {
    text-align: center;
    margin-bottom: 28px;
}

.results-emoji {
    font-size: 4rem;
    margin-bottom: 12px;
    animation: resultsBounce 1s ease;
}

@keyframes resultsBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.results-title {
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 6px;
}

.results-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Score Circle */
.results-score {
    margin-bottom: 28px;
}

.score-circle {
    position: relative;
    width: 140px;
    height: 140px;
}

.score-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-bg {
    fill: none;
    stroke: var(--bg-secondary);
    stroke-width: 8;
}

.score-fill {
    fill: none;
    stroke: var(--accent);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 326.73;
    stroke-dashoffset: 326.73;
    transition: stroke-dashoffset 1.5s ease;
}

.score-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.score-num {
    font-size: 2.5rem;
    font-weight: 900;
}

.score-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Results Stats */
.results-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    width: 100%;
    margin-bottom: 24px;
}

.rs-item {
    text-align: center;
    padding: 12px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.rs-icon { display: block; font-size: 1.2rem; margin-bottom: 4px; }

.rs-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 800;
}

.rs-label {
    font-size: 0.68rem;
    color: var(--text-dim);
    text-transform: uppercase;
}

/* Review Section */
.review-section {
    width: 100%;
    margin-bottom: 24px;
}

.review-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-muted);
}

.review-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.review-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.review-word {
    font-weight: 700;
    color: var(--danger);
    font-size: 0.9rem;
}

.review-meaning {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ===== BONUS WORDS ===== */
.bonus-words-section {
    width: 100%;
    margin-bottom: 24px;
    animation: slideUp 0.5s ease;
}
.bonus-words-section.hidden { display: none; }

.bonus-words-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #f59e0b;
    margin-bottom: 4px;
}

.bonus-words-desc {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.bonus-words-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bonus-word-card {
    background: linear-gradient(135deg, rgba(245,158,11,0.08), rgba(251,191,36,0.04));
    border: 1px solid rgba(245,158,11,0.2);
    border-radius: var(--radius);
    padding: 14px 16px;
    transition: all 0.3s;
}

.bonus-word-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    flex-wrap: wrap;
    gap: 6px;
}

.bonus-word-en {
    font-size: 1.05rem;
    font-weight: 800;
    color: #f59e0b;
}

.bonus-word-tr {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    background: rgba(245,158,11,0.12);
    padding: 2px 10px;
    border-radius: 12px;
}

.bonus-word-ex {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.4;
}

/* Results Actions */
.results-actions {
    display: flex;
    gap: 12px;
    width: 100%;
}

.action-btn {
    flex: 1;
    padding: 14px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    font-family: inherit;
}

.action-btn.primary {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
}

.action-btn.secondary {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.action-btn:hover {
    transform: translateY(-2px);
}

/* ===== XP POPUP ===== */
.xp-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: 900;
    color: var(--warning);
    pointer-events: none;
    z-index: 100;
    animation: xpFloat 1s ease-out forwards;
    text-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
}

@keyframes xpFloat {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0.5); }
    50% { opacity: 1; transform: translate(-50%, -80%) scale(1.2); }
    100% { opacity: 0; transform: translate(-50%, -120%) scale(0.8); }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-dim); border-radius: 4px; }

/* ===== LONG OPTIONS (grammar, sentence completion, dialogue, restatement) ===== */
.option-text-long {
    font-size: 0.82rem;
    line-height: 1.5;
}

/* ===== DIALOGUE TEXT ===== */
.dialogue-text {
    font-size: 0.92rem;
    line-height: 1.7;
    text-align: left;
}

/* ===== REVIEW MODE CARD ===== */
.mode-review {
    border-color: rgba(245, 158, 11, 0.25);
    background: rgba(245, 158, 11, 0.06);
}

.mode-review:hover, .mode-review.selected {
    border-color: var(--warning);
    background: rgba(245, 158, 11, 0.12);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.2);
}

.mode-count-review {
    color: var(--warning);
    background: rgba(245, 158, 11, 0.15);
}

/* ===== DAILY GOAL ===== */
.daily-goal-section {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.daily-goal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.daily-goal-header .section-title {
    margin-bottom: 0;
}

.daily-check {
    font-size: 1.2rem;
}

.daily-goal-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    overflow: hidden;
    margin: 10px 0 6px;
}

.daily-goal-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #22c55e);
    border-radius: 8px;
    transition: width 0.5s ease;
    width: 0%;
}

.daily-goal-text {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
}

/* ===== CATEGORY STATS ===== */
.cat-stats-section {
    padding: 20px 0 10px;
    border-top: 1px solid var(--border);
}

.cat-stats-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cat-stat-item {
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.cat-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.cat-stat-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}

.cat-stat-pct {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--accent);
}

.cat-stat-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 4px;
}

.cat-stat-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
}

.cat-stat-detail {
    font-size: 0.72rem;
    color: var(--text-dim);
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 41, 59, 0.95);
    color: var(--text-main);
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 0.88rem;
    font-weight: 600;
    z-index: 999;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 1.9s forwards;
    white-space: nowrap;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

/* ===== SHARE SECTION ===== */
.share-section {
    width: 100%;
    margin-bottom: 20px;
}

.share-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
    text-align: center;
}

.share-buttons {
    display: flex;
    gap: 10px;
}

.share-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    border: 1px solid var(--border);
    font-family: inherit;
}

.share-btn-icon { font-size: 1rem; }

.share-copy {
    background: var(--bg-card);
    color: var(--text-main);
}

.share-copy:hover {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.08);
}

.share-whatsapp {
    background: rgba(37, 211, 102, 0.1);
    color: #25d366;
    border-color: rgba(37, 211, 102, 0.25);
}

.share-whatsapp:hover {
    background: rgba(37, 211, 102, 0.18);
    border-color: #25d366;
}

.share-challenge {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.25);
}

.share-challenge:hover {
    background: rgba(245, 158, 11, 0.18);
    border-color: var(--warning);
}

/* ===== CHALLENGE BANNER ===== */
.challenge-banner {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(239, 68, 68, 0.08));
    border: 1.5px solid rgba(245, 158, 11, 0.35);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
    animation: bannerPulse 2s ease-in-out infinite;
}

@keyframes bannerPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.2); }
    50% { box-shadow: 0 0 20px 4px rgba(245, 158, 11, 0.15); }
}

.challenge-banner-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.challenge-banner-info h3 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--warning);
    margin-bottom: 4px;
}

.challenge-banner-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.challenge-target-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main) !important;
}

.challenge-banner-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    justify-content: center;
}

.challenge-accept-btn {
    padding: 10px 28px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 800;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.25s;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.challenge-accept-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.challenge-decline-btn {
    padding: 10px 20px;
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--border);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.25s;
}

.challenge-decline-btn:hover {
    border-color: var(--danger);
    color: var(--danger);
}

/* ===== CHALLENGE COMPARISON (VS) ===== */
.challenge-comparison {
    width: 100%;
    margin-bottom: 20px;
    padding: 20px;
    background: var(--bg-card);
    border: 1.5px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-lg);
    animation: slideUp 0.5s ease;
}

.comparison-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--warning);
    text-align: center;
    margin-bottom: 16px;
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
}

.comp-player {
    text-align: center;
    padding: 12px 8px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.comp-player.winner {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.08);
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.15);
}

.comp-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
}

.comp-score {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--accent);
}

.comp-pct {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 2px;
}

.comp-vs {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--warning);
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.comp-winner {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 800;
}

/* ===== PARTY / GROUP CHALLENGE RESULTS ===== */
.party-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 12px;
}
.party-results {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.party-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--card);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.2s;
}
.party-row.party-me {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
}
.party-row.party-top-1 {
    background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(234,179,8,0.08));
    border-color: rgba(245,158,11,0.3);
}
.party-row.party-top-2 {
    background: linear-gradient(135deg, rgba(156,163,175,0.12), rgba(156,163,175,0.05));
    border-color: rgba(156,163,175,0.2);
}
.party-row.party-top-3 {
    background: linear-gradient(135deg, rgba(180,83,9,0.12), rgba(180,83,9,0.05));
    border-color: rgba(180,83,9,0.2);
}
.party-rank {
    font-size: 1.1rem;
    min-width: 28px;
    text-align: center;
    font-weight: 700;
}
.party-name {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.party-score {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 40px;
    text-align: right;
}
.party-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 30px;
    text-align: right;
}
.party-message {
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    margin-top: 12px;
    padding: 8px;
    background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(147,51,234,0.1));
    border-radius: var(--radius-sm);
}

/* ===== AD CONTAINER ===== */
.ad-container {
    width: 100%;
    margin: 16px 0;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.ad-container ins {
    width: 100%;
}

/* ===== STATS PAGE BUTTON ===== */
.stats-page-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(139,92,246,0.15));
    border: 1px solid rgba(59,130,246,0.3);
    border-radius: var(--radius);
    color: var(--accent);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 16px;
    transition: all 0.2s;
}
.stats-page-btn:active {
    transform: scale(0.97);
    background: linear-gradient(135deg, rgba(59,130,246,0.25), rgba(139,92,246,0.25));
}

/* ===== LEADERBOARD BUTTON ===== */
.leaderboard-page-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(251,191,36,0.15));
    border: 1px solid rgba(245,158,11,0.3);
    border-radius: var(--radius);
    color: #f59e0b;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.2s;
}
.leaderboard-page-btn:active {
    transform: scale(0.97);
    background: linear-gradient(135deg, rgba(245,158,11,0.25), rgba(251,191,36,0.25));
}

/* ===== LEADERBOARD SCREEN ===== */
.lb-my-rank-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid rgba(245,158,11,0.3);
}
.lb-my-avatar { font-size: 2rem; }
.lb-my-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.lb-my-name { font-weight: 700; color: var(--text); font-size: 1rem; }
.lb-my-stat { font-size: 0.78rem; color: var(--text-dim); }
.lb-my-rank-num {
    font-size: 1.4rem;
    font-weight: 800;
    color: #f59e0b;
    min-width: 48px;
    text-align: center;
}

.lb-nickname-section {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.lb-nickname-section input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
}
.lb-nickname-section input:focus {
    border-color: var(--accent);
}
.lb-save-btn {
    padding: 10px 16px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
}
.lb-save-btn:active { transform: scale(0.95); }

.lb-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.lb-tab {
    flex: 1;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}
.lb-tab.active {
    background: rgba(245,158,11,0.15);
    border-color: rgba(245,158,11,0.4);
    color: #f59e0b;
}

.lb-sort-pills {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}
.lb-sort-pill {
    flex: 1;
    padding: 7px 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    color: var(--text-dim);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}
.lb-sort-pill.active {
    background: rgba(59,130,246,0.15);
    border-color: rgba(59,130,246,0.4);
    color: var(--accent);
}

.lb-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 20px;
}
.lb-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.05);
}
.lb-row.me {
    border-color: rgba(59,130,246,0.4);
    background: rgba(59,130,246,0.08);
}
.lb-row.top-1 { border-color: rgba(255,215,0,0.4); background: rgba(255,215,0,0.06); }
.lb-row.top-2 { border-color: rgba(192,192,192,0.3); background: rgba(192,192,192,0.05); }
.lb-row.top-3 { border-color: rgba(205,127,50,0.3); background: rgba(205,127,50,0.05); }

.lb-rank {
    min-width: 36px;
    text-align: center;
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--text-dim);
}
.lb-row.top-1 .lb-rank,
.lb-row.top-2 .lb-rank,
.lb-row.top-3 .lb-rank { font-size: 1.2rem; }
.lb-avatar { font-size: 1.3rem; }
.lb-player-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.lb-name { font-weight: 700; font-size: 0.88rem; color: var(--text); }
.lb-stat-line { font-size: 0.75rem; color: var(--text-dim); }

.lb-loading, .lb-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* ===== STATS SCREEN ===== */
.stats-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 0 16px;
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    z-index: 10;
}
.stats-header h2 {
    font-size: 1.2rem;
    font-weight: 800;
}
.back-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.back-btn:active { transform: scale(0.9); }

.stats-section {
    margin-bottom: 20px;
}
.stats-section .section-title {
    margin-bottom: 12px;
}

/* Overview Card */
.stats-overview-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
}
.stats-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    text-align: center;
    margin-bottom: 16px;
}
.sov-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sov-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
}
.sov-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* XP Level Bar */
.xp-level-bar {
    position: relative;
    height: 24px;
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    overflow: hidden;
}
.xp-level-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #8b5cf6);
    border-radius: 12px;
    transition: width 0.6s ease;
    min-width: 2px;
}
.xp-level-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-main);
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* Accuracy Ring */
.stats-accuracy-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 24px;
}
.accuracy-ring {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}
.accuracy-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.ring-bg {
    fill: none;
    stroke: rgba(255,255,255,0.06);
    stroke-width: 10;
}
.ring-fill {
    fill: none;
    stroke: var(--success);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 339.29;
    stroke-dashoffset: 339.29;
    transition: stroke-dashoffset 1s ease;
}
.ring-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
}
.accuracy-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.acc-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
}
.acc-row span:first-child {
    color: var(--text-muted);
}
.acc-row span:last-child {
    font-weight: 700;
    color: var(--text-main);
}

/* Category Detail Cards */
.cat-detail-card {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    border: 1px solid var(--border);
    margin-bottom: 10px;
}
.cat-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.cat-detail-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
}
.cat-detail-pct {
    font-size: 0.88rem;
    font-weight: 800;
}
.cat-detail-bar {
    height: 8px;
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}
.cat-detail-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}
.cat-detail-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Leitner Boxes */
.leitner-boxes {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.lbox {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 14px 8px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}
.lbox-icon { font-size: 1.4rem; }
.lbox-count {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-main);
}
.lbox-label {
    font-size: 0.65rem;
    color: var(--text-dim);
    text-transform: uppercase;
}
.lbox-1 { border-color: rgba(239,68,68,0.3); }
.lbox-2 { border-color: rgba(245,158,11,0.3); }
.lbox-3 { border-color: rgba(34,197,94,0.3); }

/* Leitner Progress Bar */
.leitner-progress {
    display: flex;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(255,255,255,0.06);
}
.lp-segment {
    height: 100%;
    transition: width 0.6s ease;
    min-width: 0;
}
.lp-0 { background: var(--text-dim); }
.lp-1 { background: var(--danger); }
.lp-2 { background: var(--warning); }
.lp-3 { background: var(--success); }

/* Daily Stats Card */
.daily-stats-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border);
    text-align: center;
}
.daily-big-number {
    font-size: 3rem;
    font-weight: 900;
    color: var(--accent);
    line-height: 1;
}
.daily-goal-label {
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: 4px;
}
.daily-streak-info {
    margin-top: 12px;
    font-size: 0.88rem;
    color: var(--text-dim);
}
.daily-streak-info strong {
    color: var(--warning);
}

/* Reset Button */
.stats-reset {
    padding-top: 8px;
    margin-bottom: 32px;
}
.reset-btn {
    width: 100%;
    padding: 12px;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.reset-btn:active {
    background: rgba(239,68,68,0.2);
    transform: scale(0.97);
}

/* ===== NOTIFICATIONS ===== */
.notif-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 16px;
}
.notif-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.notif-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.notif-icon {
    font-size: 1.3rem;
}
.notif-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.notif-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
}
.notif-status-text {
    font-size: 0.72rem;
    font-weight: 500;
}
.notif-status-text.on { color: var(--success); }
.notif-status-text.off { color: var(--text-muted); }

/* Toggle switch */
.notif-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.notif-switch input { opacity: 0; width: 0; height: 0; }
.notif-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(100,116,139,0.3);
    border-radius: 24px;
    transition: 0.3s;
}
.notif-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}
.notif-switch input:checked + .notif-slider {
    background: var(--accent);
}
.notif-switch input:checked + .notif-slider::before {
    transform: translateX(20px);
}

/* Time selector row */
.notif-time-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.notif-time-label {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.notif-time-select {
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-main);
    color: var(--text-main);
    font-size: 0.78rem;
    font-family: inherit;
    cursor: pointer;
}
.notif-time-select:focus {
    outline: none;
    border-color: var(--accent);
}

/* ===== ADAPTIVE DIFFICULTY ===== */

/* Adaptive pill on home screen */
.diff-pill-adaptive {
    background: linear-gradient(135deg, rgba(245,158,11,0.1), rgba(239,68,68,0.1));
    border-color: rgba(245,158,11,0.3);
    color: #f59e0b;
}
.diff-pill-adaptive:hover {
    border-color: rgba(245,158,11,0.5) !important;
    color: #f59e0b !important;
}
.diff-pill-adaptive.active {
    background: linear-gradient(135deg, rgba(245,158,11,0.2), rgba(239,68,68,0.15));
    border-color: #f59e0b;
    color: #f59e0b;
}

/* Adaptive hint under difficulty pills */
.adaptive-hint {
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.15);
}
.adaptive-hint.hidden { display: none; }

/* Question meta row (badge + level + adaptive indicator) */
.question-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.question-meta-row .question-badge {
    margin-bottom: 0;
}
.question-meta-row .question-level {
    position: static;
}

/* Adaptive indicator in quiz */
.adaptive-indicator {
    margin-left: auto;
}
.adaptive-indicator.hidden { display: none; }

.adaptive-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
    letter-spacing: 0.05em;
}
.adaptive-b1 {
    background: rgba(34,197,94,0.15);
    color: #22c55e;
}
.adaptive-b2 {
    background: rgba(234,179,8,0.15);
    color: #eab308;
}
.adaptive-c1 {
    background: rgba(239,68,68,0.15);
    color: #ef4444;
}

/* Results: adaptive summary card */
.rs-adaptive { margin-bottom: 16px; }
.rs-adaptive.hidden { display: none; }

.rs-adaptive-card {
    background: var(--bg-card);
    border: 1px solid rgba(245,158,11,0.2);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.rs-adaptive-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
}
.rs-adaptive-level {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.rs-adaptive-dist {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}
.rs-ad-pill {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
}
.rs-ad-pill.b1 {
    background: rgba(34,197,94,0.12);
    color: #22c55e;
}
.rs-ad-pill.b2 {
    background: rgba(234,179,8,0.12);
    color: #eab308;
}
.rs-ad-pill.c1 {
    background: rgba(239,68,68,0.12);
    color: #ef4444;
}

/* ===== DICTIONARY PAGE BUTTON ===== */
.dictionary-page-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, rgba(34,197,94,0.15), rgba(16,185,129,0.15));
    border: 1px solid rgba(34,197,94,0.3);
    border-radius: var(--radius);
    color: #22c55e;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.2s;
    font-family: inherit;
}
.dictionary-page-btn:active {
    transform: scale(0.97);
    background: linear-gradient(135deg, rgba(34,197,94,0.25), rgba(16,185,129,0.25));
}

/* ===== DICTIONARY SCREEN ===== */
.dict-search-section {
    margin-bottom: 12px;
}
.dict-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    transition: border-color 0.2s;
}
.dict-search-box:focus-within {
    border-color: var(--accent);
}
.dict-search-icon {
    font-size: 1rem;
    flex-shrink: 0;
}
.dict-search-box input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 0.92rem;
    font-family: inherit;
}
.dict-search-box input::placeholder {
    color: var(--text-dim);
}
.dict-clear-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: none;
    color: var(--text-dim);
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.dict-clear-btn.hidden { display: none; }

/* Dictionary Filters */
.dict-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.dict-filter-pill {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.dict-filter-pill.active {
    background: rgba(34,197,94,0.15);
    border-color: rgba(34,197,94,0.4);
    color: #22c55e;
}

/* Dictionary Summary */
.dict-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 0 4px;
}
.dict-count {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-dim);
}

/* Dictionary List */
.dict-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 20px;
}
.dict-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-dim);
    font-size: 0.9rem;
}
.dict-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-dim);
    font-size: 0.88rem;
}

/* Dictionary Word Card */
.dict-word-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.dict-word-card.dict-bonus {
    border-color: rgba(245,158,11,0.2);
    background: linear-gradient(135deg, rgba(245,158,11,0.05), transparent);
}
.dict-leitner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dict-leitner-dot.box-0 { background: var(--text-dim); }
.dict-leitner-dot.box-1 { background: var(--danger); }
.dict-leitner-dot.box-2 { background: var(--warning); }
.dict-leitner-dot.box-3 { background: var(--success); }
.dict-word-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.dict-word-en {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--accent);
    word-break: break-word;
}
.dict-word-card.dict-bonus .dict-word-en {
    color: #f59e0b;
}
.dict-word-tr {
    font-size: 0.82rem;
    color: var(--text-muted);
    word-break: break-word;
}
.dict-word-ex {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-style: italic;
    margin-top: 2px;
    word-break: break-word;
}
.dict-word-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}
.dict-word-level {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(139,92,246,0.15);
    color: #a78bfa;
}
.dict-word-type {
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
}

/* ===== QUIZ WORD LOOKUP ===== */
.quiz-lookup-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    background: rgba(34,197,94,0.08);
    border: 1px solid rgba(34,197,94,0.25);
    border-radius: var(--radius-sm);
    color: #22c55e;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 12px;
    transition: all 0.2s;
    font-family: inherit;
}
.quiz-lookup-btn:active {
    transform: scale(0.97);
    background: rgba(34,197,94,0.15);
}

/* Lookup Panel */
.quiz-lookup-panel {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    max-height: 65vh;
    background: var(--bg-primary);
    border-top: 2px solid rgba(34,197,94,0.4);
    border-radius: 20px 20px 0 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    animation: slidePanelUp 0.3s ease;
    box-shadow: 0 -8px 30px rgba(0,0,0,0.4);
}
.quiz-lookup-panel.hidden {
    display: none !important;
}
@keyframes slidePanelUp {
    from { transform: translateX(-50%) translateY(100%); }
    to { transform: translateX(-50%) translateY(0); }
}
.lookup-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 8px;
}
.lookup-panel-header h3 {
    font-size: 0.95rem;
    font-weight: 800;
    color: #22c55e;
}
.lookup-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lookup-search-input {
    margin: 0 18px 10px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-main);
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
}
.lookup-search-input:focus {
    border-color: var(--accent);
}
.lookup-search-input::placeholder {
    color: var(--text-dim);
}
.lookup-results {
    flex: 1;
    overflow-y: auto;
    padding: 0 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.lookup-hint {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.82rem;
    padding: 20px 0;
}
.lookup-word-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.lookup-word-item.lookup-bonus {
    border-color: rgba(245,158,11,0.2);
}
.lookup-word-en {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent);
    min-width: 80px;
}
.lookup-word-item.lookup-bonus .lookup-word-en {
    color: #f59e0b;
}
.lookup-word-tr {
    flex: 1;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.lookup-word-level {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(139,92,246,0.15);
    color: #a78bfa;
    flex-shrink: 0;
}

/* ===== SAFE AREA ===== */
@supports (padding-top: env(safe-area-inset-top)) {
    #home { padding-top: calc(20px + env(safe-area-inset-top)); }
    #quiz { padding-top: calc(16px + env(safe-area-inset-top)); }
    #stats { padding-top: calc(20px + env(safe-area-inset-top)); }
    #leaderboard { padding-top: calc(20px + env(safe-area-inset-top)); }
    #dictionary { padding-top: calc(20px + env(safe-area-inset-top)); }
    .screen { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
}