/* CSS Variables */
:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #1e1e3f;
    --bg-card-hover: #2a2a4a;
    --text-primary: #f0f0f5;
    --text-secondary: #9898b0;
    --accent: #6c5ce7;
    --accent-hover: #a29bfe;
    --accent-glow: rgba(108, 92, 231, 0.4);
    --success: #00cec9;
    --success-bg: rgba(0, 206, 201, 0.15);
    --success-glow: rgba(0, 206, 201, 0.3);
    --error: #ff7675;
    --error-bg: rgba(255, 118, 117, 0.15);
    --warning: #fdcb6e;
    --border: rgba(255, 255, 255, 0.1);
    --option-bg: rgba(255, 255, 255, 0.05);
    --option-hover: rgba(255, 255, 255, 0.1);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 40px rgba(108, 92, 231, 0.15);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;
    --glass-bg: rgba(30, 30, 63, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
    --gradient-primary: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
    --gradient-success: linear-gradient(135deg, #00cec9 0%, #55efc4 100%);
    --gradient-danger: linear-gradient(135deg, #ff7675 0%, #fd79a8 100%);
    --gradient-warm: linear-gradient(135deg, #fdcb6e 0%, #f39c12 100%);
}

/* Light mode */
body:not(.dark-mode) {
    --bg-primary: #f8f9fe;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f2ff;
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --accent: #6c5ce7;
    --accent-hover: #5f4dd0;
    --accent-glow: rgba(108, 92, 231, 0.2);
    --border: rgba(0, 0, 0, 0.08);
    --option-bg: #f8f9fe;
    --option-hover: #eef0ff;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 40px rgba(108, 92, 231, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(0, 0, 0, 0.08);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

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

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

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

.animate-slide-in {
    animation: slideIn 0.3s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.2s ease-out;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    transition: background 0.4s ease, color 0.3s ease;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Performans: Quiz alanlarında layout containment */
.question-container {
    contain: content;
}

/* Azaltılmış hareket tercihi — animasyonları kapat */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Düşük güçlü cihazlarda backdrop-filter azalt */
@media (max-width: 768px) {
    .card,
    .quiz-header,
    .question-text,
    .option,
    .tabs {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

html {
    scroll-behavior: smooth;
    height: -webkit-fill-available;
    overflow-x: hidden;
}

/* Selection color */
::selection {
    background: var(--accent);
    color: white;
}

/* Global select/dropdown dark mode fix */
select {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.9rem;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239898b0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

select option {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 8px 12px;
}

select option:checked {
    background: var(--accent);
    color: white;
}

body:not(.dark-mode) select {
    background-color: var(--bg-card);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23636e72' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

body:not(.dark-mode) select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* Global focus-visible for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* ==================== AUTH SCREEN ==================== */
.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg-primary);
}

.auth-screen::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(108, 92, 231, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(0, 206, 201, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.auth-container {
    width: 100%;
    max-width: min(420px, calc(100% - 48px));
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    box-shadow: var(--shadow), var(--shadow-glow);
    position: relative;
    z-index: 1;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h1 {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.auth-form h2 {
    font-size: 1.3rem;
    margin-bottom: 24px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    background: var(--option-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.auth-error {
    color: var(--error);
    font-size: 0.9rem;
    margin-bottom: 16px;
    text-align: center;
    min-height: 20px;
}

.btn-full {
    width: 100%;
    max-width: 100%;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-switch a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-divider span {
    padding: 0 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* User Info in Header */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--option-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.user-info span {
    font-weight: 500;
    font-size: 0.9rem;
}

#userInfo.guest {
    opacity: 0.7;
}

/* Animated background */
body.dark-mode::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(108, 92, 231, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(0, 206, 201, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(253, 203, 110, 0.05) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px;
    position: relative;
    overflow-x: hidden;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    padding: 20px 24px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow), var(--shadow-glow);
    overflow: hidden;
    flex-wrap: wrap;
    gap: 12px;
}

.header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    z-index: 0;
    isolation: isolate;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
    z-index: 0;
    pointer-events: none;
}

@media (hover: hover) {
    .btn:hover::before {
        left: 100%;
    }
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
}

@media (hover: hover) {
    .btn-primary:hover:not(:disabled) {
        transform: translateY(-3px);
        box-shadow: 0 8px 25px var(--accent-glow);
    }
}

.btn-primary:active:not(:disabled) {
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.btn:disabled {
    pointer-events: none;
}

.btn:disabled::before {
    display: none;
}

.btn-secondary {
    background: var(--option-bg);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

@media (hover: hover) {
    .btn-secondary:hover {
        background: var(--option-hover);
        border-color: var(--accent);
        transform: translateY(-2px);
    }
}

.btn-danger {
    background: var(--gradient-danger);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 118, 117, 0.3);
}

@media (hover: hover) {
    .btn-danger:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(255, 118, 117, 0.4);
    }
}

.btn-icon {
    width: 48px;
    height: 48px;
    padding: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    font-size: 1.3rem;
    box-shadow: var(--shadow);
}

@media (hover: hover) {
    .btn-icon:hover {
        transform: rotate(15deg) scale(1.1);
        background: var(--option-hover);
    }
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-large {
    padding: 16px 40px;
    font-size: 1.15rem;
    border-radius: var(--radius);
    max-width: 100%;
}

/* Theme Toggle */
.dark-mode .icon-sun { display: none; }
.dark-mode .icon-moon { display: inline; }
body:not(.dark-mode) .icon-sun { display: inline; }
body:not(.dark-mode) .icon-moon { display: none; }

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 28px;
    flex-wrap: wrap;
    padding: 8px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
}

.tab {
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.tab:hover {
    background: var(--option-hover);
    color: var(--text-primary);
}

.tab.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

/* Cards */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--glass-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow-x: hidden;
    max-width: 100%;
}

@media (hover: hover) {
    .card:hover {
        box-shadow: var(--shadow), var(--shadow-glow);
    }
}

.hidden {
    display: none !important;
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr));
    gap: 14px;
    margin-bottom: 28px;
}

.category-btn {
    padding: 18px 16px;
    background: var(--option-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.category-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s;
}

@media (hover: hover) {
    .category-btn:hover {
        transform: translateY(-4px);
        border-color: var(--accent);
        box-shadow: 0 8px 25px var(--accent-glow);
    }
}

.category-btn.selected {
    border-color: transparent;
    color: white;
    box-shadow: 0 8px 25px var(--accent-glow);
}

.category-btn.selected::before {
    opacity: 1;
}

.category-btn span {
    position: relative;
    z-index: 1;
}

.category-btn .count {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 6px;
    font-weight: 400;
}

.category-btn.selected .count {
    color: rgba(255, 255, 255, 0.85);
}

/* Quiz Options */
.quiz-options {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    max-width: 100%;
}

.quiz-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.quiz-options select {
    padding: 8px 12px;
    background: var(--option-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.quiz-options input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

/* Quiz Area */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    flex-wrap: wrap;
    gap: 8px;
}

.quiz-progress {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--option-bg);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
}

.timer-display {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 8px 16px;
    background: var(--option-bg);
    border-radius: var(--radius-sm);
    transition: all 0.3s;
}

.timer-display.warning {
    background: var(--warning);
    color: #1a1a2e;
    animation: pulse 1s infinite;
}

.timer-display.danger {
    background: var(--error);
    color: white;
    animation: pulse 0.5s infinite;
}

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

.quiz-score {
    display: flex;
    gap: 12px;
    font-size: 1rem;
}

.quiz-score .correct,
.quiz-score .wrong {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.quiz-score .correct {
    color: var(--success);
    background: var(--success-bg);
}

.quiz-score .wrong {
    color: var(--error);
    background: var(--error-bg);
}

.progress-bar {
    height: 8px;
    background: var(--option-bg);
    border-radius: 4px;
    margin-bottom: 28px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Word Highlighting - Global */
.word {
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background 0.2s;
    display: inline-block; /* Satır arası düzgün görünüm için */
}

.word:hover {
    background: var(--option-hover);
    box-shadow: 0 0 0 1px var(--accent); /* Hover durumunda belirginlik */
}

.word.unknown {
    background: var(--warning);
    color: #1a1a2e;
    font-weight: 500;
}

/* Question */
.question-container {
    margin-bottom: 32px;
}

.question-header {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.question-header .question-text {
    flex: 1;
    margin-bottom: 0;
}

.favorite-btn {
    flex-shrink: 0;
    background: transparent;
    border: 2px solid var(--border);
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
}

.favorite-btn:hover {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.favorite-btn.active {
    background: #ffd700;
    border-color: #ffd700;
}

.favorite-btn.active .fav-icon {
    color: #1a1a2e;
}

.favorite-btn .fav-icon {
    color: #ffd700;
}

.question-text {
    font-size: 1.2rem;
    line-height: 1.9;
    margin-bottom: 32px;
    padding: 28px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    position: relative;
    box-shadow: var(--shadow);
    overflow-wrap: break-word;
    word-break: break-word;
}

.question-text::before {
    content: '"';
    position: absolute;
    top: 12px;
    left: 20px;
    font-size: 3rem;
    color: var(--accent);
    opacity: 0.3;
    font-family: Georgia, serif;
    line-height: 1;
}

/* Options */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 28px;
}

.option {
    padding: 20px 24px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    position: relative;
    cursor: pointer;
}

@media (hover: hover) {
    .option:hover:not(.disabled) {
        border-color: var(--accent);
        background: var(--option-hover);
        transform: translateX(8px);
        box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    }
}

/* Seçim Butonu */
.option-select-btn {
    width: 44px;
    height: 44px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 2px;
    color: white;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.option-select-btn:hover:not(:disabled) {
    transform: scale(1.15);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.option .text {
    flex: 1;
    min-width: 0;
    font-size: 1.2rem; /* Şık metni büyütüldü */
    padding-top: 8px;
    cursor: text; /* Metin seçilebilir imleci */
    overflow-wrap: break-word;
    word-break: break-word;
}

.option.selected {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.option.selected .option-select-btn {
    background: white;
    color: var(--accent);
    box-shadow: 0 4px 12px rgba(255,255,255,0.3);
}

.option.correct {
    background: var(--success-bg);
    border-color: var(--success);
    animation: scaleIn 0.2s ease-out;
}

.option.correct .option-select-btn {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.option.wrong {
    background: var(--error-bg);
    border-color: var(--error);
    animation: shake 0.3s ease-out;
}

.option.wrong .option-select-btn {
    background: var(--error);
    border-color: var(--error);
    color: white;
}

.option.disabled {
    cursor: default;
    pointer-events: none;
}

.option.disabled .option-select-btn {
    cursor: not-allowed;
    opacity: 0.7;
}

.feedback {
    padding: 24px;
    border-radius: var(--radius);
    margin-top: 16px;
    margin-bottom: 24px;
    text-align: center;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.feedback p {
    margin: 0;
}

.feedback.correct {
    background: var(--success-bg);
    color: var(--success);
    border-color: var(--success);
}

.feedback.correct p {
    font-size: 1.2rem;
}

.feedback.wrong {
    background: var(--error-bg);
    color: var(--error);
    border-color: var(--error);
}

.feedback.wrong p {
    font-size: 1.1rem;
}

.feedback .gpt-ask-btn {
    margin-top: 4px;
}

/* GPT Inline Button in Feedback */
.feedback .gpt-explain-inline-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.feedback .gpt-explain-inline-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

/* Hint System */
.hint-area {
    margin-bottom: 16px;
}

.btn-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #fdcb6e 0%, #f39c12 100%);
    color: #1a1a2e;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.btn-hint:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(243, 156, 18, 0.4);
}

.btn-hint.active {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.hint-content {
    margin-top: 12px;
    padding: 16px;
    background: rgba(253, 203, 110, 0.1);
    border: 1px solid rgba(253, 203, 110, 0.3);
    border-radius: var(--radius-sm);
    animation: fadeIn 0.3s ease-out;
}

.hint-content p {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.hint-content p:last-child {
    margin-bottom: 0;
}

.hint-tip {
    color: #fdcb6e !important;
}

.hint-translation {
    color: var(--text-secondary) !important;
    font-style: italic;
}

/* Quiz Actions */
.quiz-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
}

/* Results */
.results-summary {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.result-stat {
    text-align: center;
    padding: 24px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    min-width: 0;
    transition: all 0.3s ease;
}

.result-stat:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

.result-number {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.section-header h2 {
    margin: 0;
}

.filter-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    max-width: 100%;
}

.filter-controls select,
.filter-controls input {
    padding: 8px 12px;
    background: var(--option-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    min-width: 0;
    max-width: 100%;
}

/* Questions List */
.questions-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 600px;
    overflow-y: auto;
}

.question-item {
    padding: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    border-left: 4px solid var(--error);
    border: 1px solid var(--glass-border);
    border-left: 4px solid var(--error);
    transition: all 0.3s ease;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

@media (hover: hover) {
    .question-item:hover {
        transform: translateX(6px);
        box-shadow: var(--shadow);
    }
}

.question-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.wrong-date {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.question-item .category-tag {
    display: inline-block;
    padding: 6px 12px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.question-item .question {
    margin-bottom: 12px;
    line-height: 1.6;
    overflow-wrap: break-word;
    word-break: break-word;
}

.question-item .answers {
    display: flex;
    gap: 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.question-item .your-answer {
    color: var(--error);
}

.question-item .correct-answer {
    color: var(--success);
}

.question-item .actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Words List */
.words-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.word-tag {
    padding: 10px 18px;
    background: var(--gradient-warm);
    color: #1a1a2e;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(253, 203, 110, 0.3);
    transition: all 0.3s ease;
}

@media (hover: hover) {
    .word-tag:hover {
        transform: scale(1.05);
        box-shadow: 0 6px 18px rgba(253, 203, 110, 0.4);
    }
}

.word-tag .remove {
    cursor: pointer;
    font-weight: bold;
    opacity: 0.7;
}

.word-tag .remove:hover {
    opacity: 1;
}

/* Empty State */
.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
}

/* Help Text */
.help-text {
    margin-top: 24px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
}

/* Streak & Goal */
.streak-goal-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    margin-bottom: 28px;
}

.streak-card {
    background: var(--gradient-warm);
    padding: 28px;
    border-radius: var(--radius-lg);
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 30px rgba(253, 203, 110, 0.3);
    position: relative;
    overflow: hidden;
}

.streak-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 60%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translate(-10%, -10%) rotate(0deg); }
    50% { transform: translate(10%, 10%) rotate(180deg); }
}

.streak-icon {
    font-size: 2.5rem;
}

.streak-value {
    font-size: 3rem;
    font-weight: 800;
}

.streak-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.goal-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 28px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
}

.goal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-weight: 600;
}

.goal-progress {
    display: flex;
    align-items: center;
    gap: 16px;
}

.goal-bar {
    flex: 1;
    height: 12px;
    background: var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.goal-fill {
    height: 100%;
    background: var(--gradient-success);
    border-radius: 6px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 15px var(--success-glow);
}

.goal-text {
    font-weight: 600;
    min-width: 80px;
    text-align: right;
}

.goal-setting {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.goal-setting input {
    padding: 12px;
    font-size: 1.2rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--option-bg);
    color: var(--text-primary);
    text-align: center;
}

/* Weekly Chart */
.weekly-chart-container {
    background: var(--option-bg);
    padding: 24px;
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.weekly-chart-container h3 {
    margin-bottom: 16px;
}

.weekly-chart {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 120px;
    gap: 8px;
    margin-bottom: 8px;
}

.chart-bar {
    flex: 1;
    background: var(--border);
    border-radius: 4px 4px 0 0;
    position: relative;
    min-height: 4px;
    transition: height 0.3s ease;
}

.chart-bar .bar-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, var(--accent), var(--accent-hover));
    border-radius: 4px 4px 0 0;
    transition: height 0.3s ease;
}

.chart-bar.today .bar-fill {
    background: linear-gradient(to top, var(--success), #00e676);
}

.chart-bar .bar-value {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 600;
}

.weekly-labels {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.weekly-labels span {
    flex: 1;
    text-align: center;
}

@media (max-width: 600px) {
    .streak-goal-container {
        grid-template-columns: 1fr;
    }
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
    gap: 18px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 24px 20px;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

@media (hover: hover) {
    .stat-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-glow);
    }
}

.stat-value {
    display: block;
    font-size: 2.2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 4px;
}

.category-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.category-stat-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background: var(--option-bg);
    border-radius: var(--radius-sm);
}

.category-stat-item .name {
    flex: 1;
    font-weight: 500;
}

.category-stat-item .bar {
    flex: 2;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.category-stat-item .bar-fill {
    height: 100%;
    background: var(--success);
    border-radius: 4px;
    transition: width 0.3s;
}

.category-stat-item .percentage {
    width: 50px;
    text-align: right;
    font-weight: 600;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Exam Simulation Styles */
.exam-description {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.exam-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.exam-option-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 24px 20px;
    border-radius: var(--radius);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

@media (hover: hover) {
    .exam-option-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-glow);
        border-color: var(--accent);
    }
}

.exam-option-icon {
    font-size: 2rem;
}

.exam-option-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.exam-option-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.exam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 8px;
}

.exam-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.3rem;
    font-weight: 700;
    padding: 8px 16px;
    background: var(--option-bg);
    border-radius: var(--radius-sm);
}

.exam-timer.warning {
    background: var(--warning);
    color: #1a1a2e;
}

.exam-timer.danger {
    background: var(--error);
    color: white;
}

.exam-progress-info {
    font-size: 1.1rem;
    font-weight: 600;
}

.question-nav-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 6px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.q-nav-btn {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid var(--border);
    background: var(--option-bg);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.q-nav-btn:hover {
    border-color: var(--accent);
}

.q-nav-btn.current {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.q-nav-btn.answered {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.q-nav-btn.flagged {
    border-color: var(--warning);
    box-shadow: 0 0 0 2px var(--warning);
}

.exam-nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
}

.exam-results-summary {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 48px;
    margin: 32px 0;
}

.exam-result-big {
    text-align: center;
}

.exam-score {
    font-size: 4rem;
    font-weight: 800;
    color: var(--accent);
}

.exam-score-label {
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.exam-result-percentage {
    text-align: center;
}

.exam-result-percentage span:first-child {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--success);
}

.exam-result-percentage .label {
    color: var(--text-secondary);
}

.exam-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.exam-stat {
    background: var(--option-bg);
    padding: 16px;
    border-radius: var(--radius-sm);
    text-align: center;
}

.exam-stat .value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
}

.exam-stat .value.correct {
    color: var(--success);
}

.exam-stat .value.wrong {
    color: var(--error);
}

.exam-stat .label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.category-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.category-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--option-bg);
    border-radius: var(--radius-sm);
}

.category-result-item .name {
    font-weight: 500;
}

.category-result-item .score {
    font-weight: 600;
}

.exam-result-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
}

@media (max-width: 600px) {
    .exam-options {
        grid-template-columns: 1fr;
    }
    
    .question-nav-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .exam-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Touch Improvements */
@media (max-width: 768px) {
    /* Larger touch targets */
    .option {
        padding: 16px 18px;
        min-height: 56px;
    }
    
    .option:active:not(.disabled) {
        transform: scale(0.98);
        transition-duration: 0.1s;
    }
    
    .option-select-btn {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
    
    .btn {
        padding: 14px 24px;
        font-size: 1rem;
        min-height: 48px;
    }
    
    .btn:active:not(:disabled) {
        transform: scale(0.96);
        transition-duration: 0.1s;
    }
    
    .btn-small {
        padding: 10px 16px;
        font-size: 0.95rem;
        min-height: 44px;
    }
    
    /* Tabs: horizontal scroll instead of wrap */
    .tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        gap: 6px;
        padding: 8px;
        scroll-snap-type: x mandatory;
    }
    
    .tabs::-webkit-scrollbar {
        display: none;
    }
    
    .tab {
        padding: 12px 16px;
        min-height: 44px;
        white-space: nowrap;
        flex-shrink: 0;
        scroll-snap-align: start;
        font-size: 0.85rem;
    }
    
    /* Swipe hint */
    .swipe-hint {
        text-align: center;
        color: var(--text-secondary);
        font-size: 0.85rem;
        margin-top: 16px;
        opacity: 0.7;
    }
    
    /* Question container for swipe */
    .question-container {
        touch-action: pan-x;
    }
    
    /* Flashcard touch improvements */
    .flashcard {
        height: 260px;
    }
    
    .flashcard-word {
        font-size: 1.8rem;
    }
    
    .flashcard-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .flashcard-actions .btn {
        width: 100%;
    }
    
    /* ===== QUIZ-ACTIVE: HIDE HEADER & TABS TO MAXIMIZE QUIZ AREA ===== */
    body.quiz-active .header {
        display: none !important;
    }
    
    body.quiz-active .tabs {
        display: none !important;
    }
    
    /* ===== VIEWPORT-FIT QUIZ LAYOUT FOR MOBILE ===== */
    /* Uses --vh from JS for real viewport height on mobile browsers */
    
    /* Quiz card: flex column, fill viewport minus container padding only */
    #quiz-area.card,
    #exam-area.card,
    #challenge-game.card {
        display: flex;
        flex-direction: column;
        /* Header & tabs hidden when quiz-active, so only subtract container padding */
        max-height: calc(var(--app-height, 100vh) - 20px);
        padding: 10px 10px 0;
        overflow: hidden;
        position: relative;
    }
    
    /* Quiz header compact */
    .quiz-header {
        flex-wrap: wrap;
        gap: 4px;
        padding: 8px 10px;
        margin-bottom: 6px;
        flex-shrink: 0;
    }
    
    .quiz-progress {
        font-size: 0.82rem;
        padding: 3px 8px;
    }
    
    .quiz-score {
        gap: 6px;
    }
    
    .quiz-score .correct,
    .quiz-score .wrong {
        padding: 3px 6px;
        font-size: 0.78rem;
    }
    
    .timer-display {
        order: -1;
        width: 100%;
        justify-content: center;
        font-size: 0.95rem;
        padding: 3px 8px;
    }
    
    /* Progress bar compact */
    .progress-bar {
        height: 4px;
        margin-bottom: 6px;
        flex-shrink: 0;
    }
    
    /* Question container: scrollable area */
    .question-container {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 0;
        min-height: 0;
    }
    
    .question-text {
        font-size: 0.92rem;
        padding: 10px 12px;
        line-height: 1.65;
        margin-bottom: 6px;
    }
    
    .question-text::before {
        display: none;
    }
    
    .question-header {
        gap: 6px;
    }
    
    .favorite-btn {
        width: 34px;
        height: 34px;
        font-size: 1.1rem;
    }
    
    /* Options compact */
    .options-container {
        gap: 6px;
        margin-top: 6px;
    }
    
    .option {
        padding: 10px 12px;
        min-height: 40px;
        gap: 8px;
    }
    
    .option-select-btn {
        width: 32px;
        height: 32px;
        font-size: 0.95rem;
    }
    
    .option .text {
        font-size: 0.88rem;
        padding-top: 2px;
    }
    
    /* Feedback compact — inside scrollable question-container */
    .feedback {
        padding: 10px 12px;
        margin-top: 8px;
        margin-bottom: 4px;
    }
    
    .feedback.correct p,
    .feedback.wrong p {
        font-size: 0.9rem;
    }
    
    .feedback .gpt-explain-inline-btn {
        padding: 8px 12px;
        font-size: 0.82rem;
        margin-top: 6px;
    }
    
    /* Hint area compact */
    .hint-area {
        margin-bottom: 4px;
    }
    
    .btn-hint {
        padding: 5px 10px;
        font-size: 0.82rem;
    }
    
    .hint-content {
        padding: 8px;
        font-size: 0.82rem;
    }
    
    /* Quiz actions - fixed at card bottom, never scrolls away */
    .quiz-actions {
        flex-shrink: 0;
        background: var(--bg-primary);
        padding: 8px 0;
        margin: 0 -10px;
        padding: 8px 10px;
        border-top: 1px solid var(--border);
    }
    
    .quiz-actions .btn {
        flex: 1;
        padding: 10px 14px;
        font-size: 0.9rem;
        min-height: 42px;
    }
    
    /* Exam nav buttons - same fixed bottom pattern */
    .exam-nav-buttons {
        flex-shrink: 0;
        background: var(--bg-primary);
        padding: 8px 10px;
        margin: 0 -10px;
        border-top: 1px solid var(--border);
    }
    
    .exam-nav-buttons .btn {
        padding: 10px 14px;
        font-size: 0.9rem;
    }
    
    /* DB Explanation compact */
    .db-explanation {
        padding: 8px;
        margin-top: 6px;
    }
    
    .db-explanation p {
        font-size: 0.82rem;
        margin: 3px 0;
    }
    
    /* Exam question container also scrollable */
    #examQuestionContainer {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        min-height: 0;
    }
    
    /* Larger category buttons */
    .category-btn {
        padding: 16px 14px;
        font-size: 0.95rem;
    }
    
    .category-btn:active {
        transform: scale(0.96);
        transition-duration: 0.1s;
    }
    
    /* Fix header on mobile */
    .header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 16px 18px;
    }
    
    .header h1 {
        font-size: 1.4rem;
    }
    
    .header-actions {
        width: 100%;
        justify-content: center;
    }
    
    /* Improve question readability */
    .question-text {
        font-size: 1.1rem;
        padding: 18px;
        line-height: 1.8;
    }
    
    .question-text::before {
        font-size: 2rem;
        top: 8px;
        left: 14px;
    }
    
    .option .text {
        font-size: 1rem;
        padding-top: 6px;
    }
    
    /* Card padding reduction */
    .card {
        padding: 20px 16px;
        border-radius: var(--radius);
    }
    
    /* Results summary */
    .results-summary {
        gap: 16px;
    }
    
    .result-stat {
        min-width: 90px;
        padding: 18px 14px;
    }
    
    .result-number {
        font-size: 2.2rem;
    }
    
    /* Auth screen */
    .auth-container {
        padding: 28px 20px;
    }
    
    .auth-header h1 {
        font-size: 1.6rem;
    }
    
    /* Filter controls */
    .filter-controls {
        flex-wrap: wrap;
        width: 100%;
    }
    
    .filter-controls select,
    .filter-controls input {
        flex: 1;
        min-width: 0;
    }
    
    /* Section header */
    .section-header {
        gap: 12px;
    }
    
    .section-header h2 {
        font-size: 1.2rem;
    }
    
    /* Exam header */
    .exam-header {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .exam-timer {
        font-size: 1.1rem;
        padding: 6px 12px;
    }
    
    .exam-progress-info {
        font-size: 0.95rem;
    }
    
    /* Exam results */
    .exam-results-summary {
        flex-direction: column;
        gap: 20px;
    }
    
    .exam-score {
        font-size: 3rem;
    }
    
    /* GPT toggle safe area */
    .gpt-panel-toggle {
        bottom: calc(24px + env(safe-area-inset-bottom));
    }
    
    /* Streak/Goal */
    .streak-card {
        padding: 20px;
    }
    
    .streak-value {
        font-size: 2.2rem;
    }
    
    .goal-card {
        padding: 20px;
    }
    
    /* Stats grid */
    .stat-card {
        padding: 18px 14px;
    }
    
    .stat-value {
        font-size: 1.8rem;
    }
    
    /* hover effects handled by @media (hover: hover) globally */
    
    /* Challenge mode */
    .challenge-mode-selector {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Flashcard Styles */
.flashcard-area {
    text-align: center;
}

.flashcard-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 1.1rem;
}

.flashcard-score {
    color: var(--text-secondary);
}

.flashcard-container {
    perspective: 1000px;
    margin-bottom: 24px;
}

.flashcard {
    width: 100%;
    max-width: 400px;
    height: 250px;
    margin: 0 auto;
    cursor: pointer;
    position: relative;
}

.flashcard-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    gap: 16px;
}

.flashcard-front {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 15px 40px var(--accent-glow);
}

.flashcard-back {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--glass-border);
    transform: rotateY(180deg);
    box-shadow: var(--shadow);
}

.flashcard-word {
    font-size: 2.5rem;
    font-weight: 700;
    text-transform: capitalize;
}

.flashcard-hint {
    font-size: 0.9rem;
    opacity: 0.8;
}

.flashcard-meaning {
    font-size: 1.3rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.flashcard-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.flashcard-nav {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.btn-success {
    background: var(--gradient-success);
    color: white;
    box-shadow: 0 4px 15px var(--success-glow);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--success-glow);
}

.btn-success.ready-active {
    animation: readyPulse 2s ease-in-out infinite;
}

@keyframes readyPulse {
    0%, 100% { box-shadow: 0 4px 15px var(--success-glow); }
    50% { box-shadow: 0 4px 25px var(--success-glow), 0 0 0 4px rgba(0, 206, 201, 0.2); }
}

.flashcard-complete {
    text-align: center;
    padding: 40px;
}

.flashcard-complete h3 {
    font-size: 1.8rem;
    margin-bottom: 12px;
}

.flashcard-summary {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin: 24px 0;
    font-size: 1.2rem;
}

.flashcard-summary .known {
    color: var(--success);
}

.flashcard-summary .unknown {
    color: var(--error);
}

/* Dictionary Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow), var(--shadow-glow);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-close:hover {
    color: var(--text-primary);
}

.dictionary-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dictionary-item {
    padding: 12px;
    background: var(--option-bg);
    border-radius: var(--radius-sm);
}

.dictionary-item .type {
    font-size: 0.8rem;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.dictionary-item .meaning {
    color: var(--text-primary);
}

/* GPT Explanation Modal */
.gpt-modal {
    max-width: 600px;
}

.gpt-modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.gpt-question-section {
    background: var(--option-bg);
    border-radius: var(--radius-sm);
    padding: 16px;
    border-left: 4px solid var(--accent);
}

.gpt-question-text {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.gpt-answers {
    display: flex;
    gap: 16px;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.gpt-answers .your-answer {
    color: var(--error);
    font-weight: 500;
}

.gpt-answers .correct-answer {
    color: var(--success);
    font-weight: 500;
}

.gpt-cache-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--success-bg);
    color: var(--success);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    width: fit-content;
}

.gpt-explanation-content {
    background: var(--option-bg);
    border-radius: var(--radius-sm);
    padding: 20px;
    line-height: 1.7;
    font-size: 0.95rem;
    max-height: 400px;
    overflow-y: auto;
}

.gpt-explanation-content p {
    margin-bottom: 8px;
}

.gpt-explanation-content p:last-child {
    margin-bottom: 0;
}

.gpt-explanation-content strong {
    color: var(--accent);
}

.gpt-explanation-content em {
    color: var(--text-secondary);
    font-style: italic;
}

/* GPT Section Styling */
.gpt-section {
    margin-bottom: 16px;
    padding: 14px;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--border);
}

.gpt-section:last-child {
    margin-bottom: 0;
}

.gpt-section h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.gpt-section p {
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.gpt-section.correct-section {
    background: var(--success-bg);
    border-left-color: var(--success);
}

.gpt-section.correct-section h4 {
    color: var(--success);
}

.gpt-section.wrong-section {
    background: var(--error-bg);
    border-left-color: var(--error);
}

.gpt-section.wrong-section h4 {
    color: var(--error);
}

.gpt-section.grammar-section {
    background: rgba(108, 92, 231, 0.1);
    border-left-color: var(--accent);
}

.gpt-section.grammar-section h4 {
    color: var(--accent);
}

.gpt-section.tip-section {
    background: rgba(253, 203, 110, 0.1);
    border-left-color: var(--warning);
}

.gpt-section.tip-section h4 {
    color: var(--warning);
}

.gpt-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 40px 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.gpt-error {
    color: var(--error);
    text-align: center;
    padding: 20px;
}

.gpt-ask-btn {
    background: var(--gradient-primary) !important;
}

/* ==================== GPT CHAT PANEL ==================== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
    width: 100%;
}

.app-wrapper .container {
    flex: 1;
    min-width: 0;
    transition: margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
}

/* Desktop (>1200px): side-by-side, panel 380px */
.app-wrapper.panel-open .container {
    margin-right: 380px;
}

/* GPT Panel Toggle Button */
.gpt-panel-toggle {
    position: fixed;
    right: 20px;
    bottom: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px var(--accent-glow), 0 4px 16px rgba(0,0,0,0.3);
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gpt-panel-toggle:hover {
    transform: scale(1.1) translateY(-4px);
    box-shadow: 0 12px 40px var(--accent-glow), 0 8px 24px rgba(0,0,0,0.4);
}

.gpt-panel-toggle .toggle-icon {
    font-size: 1.8rem;
}

.gpt-panel-toggle .toggle-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    background: var(--error);
    color: white;
    border-radius: 11px;
    font-size: 0.75rem;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-shadow: 0 2px 8px rgba(255, 118, 117, 0.5);
}

.gpt-panel-toggle .toggle-badge.show {
    display: flex;
    animation: bounce 0.5s ease;
}

.app-wrapper.panel-open .gpt-panel-toggle {
    opacity: 0;
    pointer-events: none;
    transform: translateX(100px);
}

/* GPT Chat Panel */
.gpt-chat-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 32px rgba(0,0,0,0.2);
}

.app-wrapper.panel-open .gpt-chat-panel {
    transform: translateX(0);
}

.gpt-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.gpt-panel-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.gpt-panel-title .gpt-icon {
    font-size: 1.5rem;
}

.gpt-panel-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--option-bg);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.gpt-panel-close:hover {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

.gpt-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.gpt-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.gpt-welcome-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.gpt-welcome-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.gpt-welcome-message h3 {
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.gpt-welcome-message p {
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Chat Message Bubbles */
.gpt-message {
    background: var(--glass-bg);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--border);
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.gpt-message-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.gpt-message-question {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    flex: 1;
    margin-right: 12px;
}

.gpt-message-answers {
    display: flex;
    gap: 8px;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.gpt-message-answers .user-ans {
    color: var(--error);
    font-weight: 600;
}

.gpt-message-answers .correct-ans {
    color: var(--success);
    font-weight: 600;
}

.gpt-message-content {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-primary);
    overflow-wrap: break-word;
    word-break: break-word;
}

.gpt-message-content .gpt-section {
    margin-bottom: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
}

.gpt-message-content .gpt-section:last-child {
    margin-bottom: 0;
}

.gpt-message-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 12px;
    text-align: right;
}

.gpt-message.loading {
    text-align: center;
    padding: 32px;
}

.gpt-message.loading .loading-spinner {
    margin: 0 auto 12px;
}

/* Panel Footer */
.gpt-panel-footer {
    padding: 16px 20px;
    background: var(--glass-bg);
    border-top: 1px solid var(--border);
}

.gpt-ask-current-btn {
    margin-bottom: 12px;
    padding: 14px 20px;
    font-size: 1rem;
}

.gpt-ask-current-btn .btn-icon {
    margin-right: 8px;
}

.gpt-ask-current-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.gpt-panel-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    justify-content: center;
}

/* Question indicator in panel */
.gpt-current-question-indicator {
    background: var(--option-bg);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 16px;
    border-left: 4px solid var(--accent);
}

.gpt-current-question-indicator .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.gpt-current-question-indicator .question-preview {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Highlight animation for existing messages */
@keyframes highlight {
    0% { 
        box-shadow: 0 0 0 3px var(--accent);
        transform: scale(1.02);
    }
    100% { 
        box-shadow: none;
        transform: scale(1);
    }
}

/* Responsive — GPT panel (mobile handled in Panel Open section below) */
@media (max-width: 600px) {
    .gpt-panel-toggle {
        right: 16px;
        bottom: 16px;
        width: 56px;
        height: 56px;
    }
    
    .gpt-panel-toggle .toggle-icon {
        font-size: 1.5rem;
    }
}

/* Exam Size Selector */
.exam-size-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 24px 0;
}

.exam-size-option input[type="radio"] {
    display: none;
}

.exam-size-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px;
    background: var(--option-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

@media (hover: hover) {
    .exam-size-card:hover {
        background: var(--option-hover);
        border-color: var(--accent);
        transform: translateY(-2px);
    }
}

.exam-size-option input[type="radio"]:checked + .exam-size-card {
    background: var(--accent-glow);
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.exam-size-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.exam-size-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.exam-size-count {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 600;
}

.exam-size-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Distribution Info */
.exam-distribution-info {
    background: var(--option-bg);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.exam-distribution-info h4 {
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.distribution-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr));
    gap: 8px;
}

.distribution-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.distribution-item .cat-name {
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

.distribution-item .cat-count {
    color: var(--accent);
    font-weight: 600;
    margin-left: 8px;
}

@media (max-width: 768px) {
    .exam-size-selector {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .exam-size-card {
        flex-direction: row;
        justify-content: flex-start;
        gap: 16px;
        padding: 16px;
    }
    
    .exam-size-icon {
        margin-bottom: 0;
    }
    
    .distribution-preview {
        grid-template-columns: 1fr 1fr;
    }
}

/* Responsive - Small screens */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 1.3rem;
    }
    
    .tabs {
        gap: 4px;
        padding: 6px;
        margin-bottom: 20px;
    }
    
    .tab {
        padding: 10px 14px;
        font-size: 0.8rem;
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .quiz-options {
        flex-direction: column;
        gap: 12px;
    }
    
    .quiz-options label {
        width: 100%;
    }
    
    .quiz-options select {
        flex: 1;
    }
    
    .results-summary {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }
    
    .result-stat {
        width: 100%;
        max-width: 200px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .gpt-modal {
        max-width: 95%;
        padding: 20px;
    }
    
    .gpt-answers {
        flex-direction: column;
        gap: 8px;
    }
    
    /* Quiz actions - even more compact on small phones */
    .quiz-actions .btn {
        font-size: 0.85rem;
        padding: 8px 12px;
        min-height: 38px;
    }
    
    /* Exam nav buttons */
    .exam-nav-buttons .btn {
        flex: 1;
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    /* Quiz card: header/tabs hidden via quiz-active, only subtract container padding */
    #quiz-area.card,
    #exam-area.card,
    #challenge-game.card {
        max-height: calc(var(--app-height, 100vh) - 16px);
        padding: 8px 8px 0;
    }
    
    /* Smaller header on small phones */
    .header {
        padding: 10px 12px;
        margin-bottom: 10px;
    }
    
    .header h1 {
        font-size: 1.2rem;
    }
    
    /* Tabs compact */
    .tabs {
        margin-bottom: 10px;
        padding: 4px;
        gap: 3px;
    }
    
    .tab {
        padding: 8px 10px;
        font-size: 0.78rem;
    }
    
    /* Container less padding */
    .container {
        padding: 6px;
    }
    
    /* Even more compact quiz elements */
    .quiz-header {
        padding: 6px 8px;
        margin-bottom: 4px;
    }
    
    .progress-bar {
        height: 3px;
        margin-bottom: 4px;
    }
    
    .question-text {
        font-size: 0.88rem;
        padding: 8px 10px;
        margin-bottom: 4px;
    }
    
    .options-container {
        gap: 5px;
        margin-top: 4px;
    }
    
    .option {
        padding: 8px 10px;
        min-height: 36px;
        gap: 6px;
    }
    
    .option-select-btn {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }
    
    .option .text {
        font-size: 0.85rem;
        padding-top: 1px;
    }
    
    .feedback {
        padding: 8px 10px;
        margin-top: 6px;
        margin-bottom: 2px;
    }
    
    .feedback.correct p,
    .feedback.wrong p {
        font-size: 0.85rem;
    }
    
    /* User info compact */
    .user-info {
        padding: 6px 12px;
        gap: 8px;
    }
    
    .user-info span {
        font-size: 0.85rem;
    }
    
    /* Flashcard */
    .flashcard {
        height: 220px;
        max-width: 100%;
    }
    
    .flashcard-word {
        font-size: 1.6rem;
    }
    
    .flashcard-meaning {
        font-size: 1.1rem;
    }
    
    .flashcard-nav {
        flex-direction: column;
    }
    
    .flashcard-nav .btn {
        width: 100%;
    }
    
    /* Words list */
    .words-list {
        max-height: 350px;
    }
    
    .word-tag {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    
    /* Questions list */
    .questions-list {
        max-height: 500px;
    }
    
    .question-item {
        padding: 14px;
    }
    
    .question-item .answers {
        flex-direction: column;
        gap: 6px;
    }
    
    /* Btn large */
    .btn-large {
        padding: 14px 28px;
        font-size: 1.05rem;
        width: 100%;
    }
    
    /* Stats actions */
    .stats-actions .btn {
        min-width: unset;
    }
    
    /* History filter */
    #historyFilter {
        min-width: unset;
        width: 100%;
    }
    
    /* Exam result actions */
    .exam-result-actions {
        flex-direction: column;
    }
    
    .exam-result-actions .btn {
        width: 100%;
    }
    
    /* Challenge result actions */
    .challenge-result-actions {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .challenge-result-actions .btn {
        width: 100%;
    }
    
    /* Lobby actions */
    .lobby-actions {
        flex-direction: column;
    }
    
    .lobby-actions .btn {
        width: 100%;
    }
    
    /* Room code card */
    .room-code-card-value {
        font-size: 1.8rem;
    }
}

/* ==================== QUESTION CATEGORY BADGE ==================== */
.question-category-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.question-category-badge:empty {
    display: none;
}

/* Question meta row (category + community stats) */
.question-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

/* Community solve rate badge */
.community-stats {
    display: flex;
    align-items: center;
    gap: 4px;
}

.community-solve-rate {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(108, 92, 231, 0.12);
    color: var(--accent);
    border: 1px solid rgba(108, 92, 231, 0.25);
}

.community-solve-rate.easy {
    background: rgba(0, 206, 201, 0.12);
    color: var(--success);
    border-color: rgba(0, 206, 201, 0.25);
}

.community-solve-rate.medium {
    background: rgba(253, 203, 110, 0.12);
    color: #f39c12;
    border-color: rgba(253, 203, 110, 0.3);
}

.community-solve-rate.hard {
    background: rgba(255, 118, 117, 0.12);
    color: var(--error);
    border-color: rgba(255, 118, 117, 0.25);
}

/* ==================== QUESTION RATING & FEEDBACK ==================== */
.question-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.question-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rating-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.star-rating {
    display: flex;
    gap: 2px;
}

.star-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 2px;
    transition: transform 0.15s, color 0.15s;
    color: var(--text-secondary);
    line-height: 1;
}

.star-btn.active,
.star-btn.hover-active {
    color: #ffd700;
}

@media (hover: hover) {
    .star-btn:hover {
        transform: scale(1.2);
    }
}

.star-btn:active {
    transform: scale(0.9);
}

.avg-rating {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.feedback-report-btn {
    font-size: 0.8rem !important;
    padding: 6px 12px !important;
    white-space: nowrap;
}

/* Feedback Modal (inline, not overlay) */
.feedback-modal {
    margin-top: 10px;
    padding: 14px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    animation: fadeIn 0.2s ease-out;
}

.feedback-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 0.9rem;
}

.feedback-modal-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
}

.feedback-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.feedback-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s;
}

.feedback-option:has(input:checked) {
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent);
}

.feedback-option input[type="radio"] {
    accent-color: var(--accent);
}

.feedback-comment {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--option-bg);
    color: var(--text-primary);
    font-size: 0.85rem;
    resize: vertical;
    min-height: 50px;
    max-height: 120px;
    margin-bottom: 8px;
    font-family: inherit;
}

.feedback-comment:focus {
    outline: none;
    border-color: var(--accent);
}

/* ==================== ANSWER HISTORY INDICATOR ==================== */
.history-indicator {
    margin-bottom: 12px;
    text-align: center;
}

.history-indicator.hidden {
    display: none;
}

.history-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    animation: fadeIn 0.3s ease-out;
}

.history-badge.history-correct {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(0, 206, 201, 0.3);
}

.history-badge.history-wrong {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid rgba(255, 118, 117, 0.3);
}

.history-badge.history-new {
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent);
    border: 1px solid rgba(108, 92, 231, 0.3);
}

/* History Filter Dropdown Styling */
#historyFilter {
    min-width: 0;
    width: 100%;
}

/* Stats Actions Container */
.stats-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.stats-actions .btn {
    flex: 1;
    min-width: 0;
}

/* ==================== STRIKETHROUGH OPTION ==================== */
.option-strikethrough-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(255, 118, 117, 0.3);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: auto;
    opacity: 0.6;
}

.option-strikethrough-btn:hover {
    background: rgba(255, 118, 117, 0.15);
    color: var(--error);
    border-color: var(--error);
    opacity: 1;
}

.option.struck-out {
    background: rgba(255, 118, 117, 0.08) !important;
    border-color: rgba(255, 118, 117, 0.2) !important;
    position: relative;
}

.option.struck-out .text {
    text-decoration: line-through;
    text-decoration-color: var(--error);
    text-decoration-thickness: 2px;
    color: var(--text-secondary);
    opacity: 0.6;
}

.option.struck-out .option-select-btn {
    opacity: 0.5;
    background: rgba(255, 118, 117, 0.2) !important;
}

.option.struck-out .option-strikethrough-btn {
    background: rgba(255, 118, 117, 0.2);
    color: var(--error);
    border-color: var(--error);
    opacity: 1;
}

.option.struck-out::after {
    content: '';
    position: absolute;
    left: 60px;
    right: 50px;
    top: 50%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--error), transparent);
    opacity: 0.4;
}

/* Hide strikethrough button when option is disabled (answered) */
.option.disabled .option-strikethrough-btn {
    display: none;
}

/* Database Explanation Styles */
.db-explanation {
    margin-top: 15px;
    padding: 15px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--accent);
    text-align: left;
}

.db-explanation p {
    margin: 8px 0;
    line-height: 1.6;
    font-size: 0.95rem;
}

.db-explanation .explanation-tip {
    color: var(--warning);
    background: rgba(253, 203, 110, 0.1);
    padding: 10px;
    border-radius: var(--radius-sm);
}

.db-explanation .explanation-text {
    color: var(--text-primary);
}

.db-explanation .explanation-translation {
    color: var(--text-secondary);
    font-style: italic;
    background: rgba(108, 92, 231, 0.1);
    padding: 10px;
    border-radius: var(--radius-sm);
}

.db-explanation .explanation-difficulty {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* GPT Inline Explain Button */
.gpt-explain-inline-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.gpt-explain-inline-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.gpt-explain-inline-btn:active {
    transform: translateY(0);
}

/* Panel Open - Responsive Layout (tek kaynak) */
/* 1025-1200px: side-by-side, panel 350px */
@media (max-width: 1200px) and (min-width: 1025px) {
    .gpt-chat-panel {
        width: 350px;
    }
    .app-wrapper.panel-open .container {
        margin-right: 350px;
    }
}

/* 769-1024px landscape: side-by-side, panel 340px */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .gpt-chat-panel {
        width: 340px;
    }
    .app-wrapper.panel-open .container {
        margin-right: 340px;
    }
}

/* 769-1024px portrait: overlay */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
    .gpt-chat-panel {
        width: 380px;
    }
    .app-wrapper.panel-open .container {
        margin-right: 0;
        opacity: 0.3;
        pointer-events: none;
    }
}

/* <=768px: full overlay */
@media (max-width: 768px) {
    .gpt-chat-panel {
        width: 100%;
        max-width: 100%;
    }
    .app-wrapper.panel-open .container {
        margin-right: 0;
        opacity: 0.3;
        pointer-events: none;
    }
}

@media (max-width: 600px) {
    .gpt-explain-inline-btn {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
}

/* ==================== CHALLENGE MODE STYLES ==================== */
.challenge-description {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 1rem;
}

.challenge-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

.challenge-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
    background: var(--option-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

@media (hover: hover) {
    .challenge-action-card:hover {
        background: var(--option-hover);
        border-color: var(--accent);
        transform: translateY(-2px);
        box-shadow: var(--shadow-glow);
    }
}

.challenge-action-icon {
    font-size: 2.5rem;
}

.challenge-action-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.challenge-action-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.challenge-history-section {
    margin-top: 24px;
}

.challenge-history-section h3 {
    margin-bottom: 12px;
    color: var(--text-primary);
}

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

.challenge-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--option-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.challenge-history-item .room-name {
    font-weight: 600;
    color: var(--text-primary);
}

.challenge-history-item .room-info {
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.challenge-history-item .room-result {
    font-weight: 600;
}

.challenge-history-item .room-result.win {
    color: var(--success);
}

.challenge-history-item.active-room {
    border-color: var(--success);
    background: rgba(76, 175, 80, 0.05);
}

.challenge-history-item .room-status-badge {
    font-size: 0.75rem;
    font-weight: 600;
}

.scoreboard-item.disconnected {
    opacity: 0.5;
}

/* Card header with back button */
.card-header-with-back {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.card-header-with-back h2 {
    margin: 0;
}

/* Challenge Mode Selector */
.challenge-mode-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 8px;
}

.challenge-mode-option {
    cursor: pointer;
}

.challenge-mode-option input[type="radio"] {
    display: none;
}

.challenge-mode-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 8px;
    background: var(--option-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    text-align: center;
}

.challenge-mode-option input[type="radio"]:checked + .challenge-mode-card {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.mode-icon {
    font-size: 1.5rem;
}

.mode-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.mode-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Custom Category Grid */
.challenge-category-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

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

.challenge-category-item label {
    font-size: 0.85rem;
    color: var(--text-primary);
    flex: 1;
}

.challenge-category-item input[type="number"] {
    width: 60px;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-align: center;
    font-size: 0.9rem;
}

/* Room Lobby */
.room-lobby-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.room-lobby-header h2 {
    margin: 0;
}

/* Room Code Card — big, tappable, shareable */
.room-code-card {
    text-align: center;
    padding: 20px 16px 16px;
    background: var(--accent-glow);
    border: 2px dashed var(--accent);
    border-radius: var(--radius);
    margin-bottom: 16px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.room-code-card:active {
    transform: scale(0.98);
}

.room-code-card-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.room-code-card-value {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 0.3em;
    color: var(--accent-hover);
    font-family: 'Courier New', monospace;
    user-select: all;
}

.room-code-card-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
}

.room-code-copied-toast {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 0.8rem;
    color: var(--success);
    font-weight: 600;
    animation: fadeIn 0.2s ease-out;
}

.room-info-bar {
    display: flex;
    gap: 20px;
    padding: 12px 16px;
    background: var(--option-bg);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.participants-section {
    margin-bottom: 20px;
}

.participants-section h3 {
    margin-bottom: 12px;
}

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

.participant-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--option-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.participant-item.is-admin {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.participant-name {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.participant-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    background: var(--accent);
    color: white;
}

.participant-status {
    font-size: 0.85rem;
}

.participant-status.ready {
    color: var(--success);
    font-weight: 600;
}

.participant-status.waiting {
    color: var(--text-secondary);
}

.lobby-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 16px;
}

.lobby-status-text {
    margin-top: 12px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Challenge Game */
.challenge-lives {
    display: flex;
    gap: 4px;
    font-size: 1.2rem;
}

#challenge-game.card {
    position: relative;
}

/* 2-column layout: main game + sidebar scoreboard */
.challenge-game-layout {
    display: flex;
    gap: 16px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.challenge-game-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Scoreboard Panel — sidebar on desktop, collapsible on mobile */
.challenge-scoreboard-panel {
    width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.scoreboard-toggle {
    display: none; /* hidden on desktop */
}

.challenge-scoreboard {
    padding: 16px;
    background: var(--option-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    flex: 1;
    overflow-y: auto;
}

.challenge-scoreboard h4 {
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.live-scoreboard {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.scoreboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    font-size: 0.9rem;
}

.scoreboard-item.current-user {
    border: 1px solid var(--accent);
    background: var(--accent-glow);
}

.scoreboard-rank {
    font-weight: 700;
    color: var(--accent-hover);
    min-width: 24px;
}

.scoreboard-name {
    flex: 1;
    margin-left: 8px;
    color: var(--text-primary);
    font-weight: 500;
}

.scoreboard-score {
    font-weight: 700;
    color: var(--text-primary);
}

/* ===== Radial Timer ===== */
.challenge-timer-radial {
    position: relative;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.challenge-timer-radial .timer-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.challenge-timer-radial .timer-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 3;
}

.challenge-timer-radial .timer-ring {
    fill: none;
    stroke: var(--accent);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 125.66;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.3s;
}

.challenge-timer-radial.warning .timer-ring {
    stroke: var(--warning);
}

.challenge-timer-radial.danger .timer-ring {
    stroke: var(--error);
    animation: pulse 0.5s infinite;
}

.challenge-timer-radial .timer-value {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
    z-index: 1;
}

.challenge-timer-radial.warning .timer-value {
    color: var(--warning);
}

.challenge-timer-radial.danger .timer-value {
    color: var(--error);
}

/* ===== Countdown Overlay ===== */
.challenge-countdown-overlay {
    position: absolute;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(15, 15, 26, 0.92);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(8px);
}

body:not(.dark-mode) .challenge-countdown-overlay {
    background: rgba(248, 249, 254, 0.95);
}

.countdown-number {
    font-size: 6rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: countdownPop 0.8s ease-out;
    line-height: 1;
}

.countdown-label {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-top: 12px;
    font-weight: 600;
}

@keyframes countdownPop {
    0% { transform: scale(2); opacity: 0; }
    50% { transform: scale(0.9); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* Answer Status */
.answer-status {
    text-align: center;
    padding: 8px 16px;
    margin-top: 8px;
    border-radius: var(--radius-sm);
    background: var(--option-bg);
    border: 1px solid var(--border);
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.answer-status.all-answered {
    background: rgba(76, 175, 80, 0.1);
    border-color: #4caf50;
    color: #4caf50;
}

/* Challenge Results */
.challenge-winner-section {
    text-align: center;
    padding: 24px;
    margin-bottom: 24px;
}

.winner-announcement {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--warning);
    margin-bottom: 8px;
}

.winner-name {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-warm);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.winner-stats {
    color: var(--text-secondary);
    margin-top: 8px;
}

.challenge-results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.result-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--option-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.result-row.rank-1 {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.result-row.rank-2 {
    border-color: #c0c0c0;
    background: rgba(192, 192, 192, 0.1);
}

.result-row.rank-3 {
    border-color: #cd7f32;
    background: rgba(205, 127, 50, 0.1);
}

.result-rank {
    font-size: 1.5rem;
    font-weight: 800;
    min-width: 40px;
    text-align: center;
}

.result-info {
    flex: 1;
}

.result-username {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.05rem;
}

.result-detail {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.result-score {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--accent-hover);
}

.challenge-result-actions {
    text-align: center;
    margin-top: 24px;
}

/* Room Settings Section */
.room-settings-section {
    margin-top: 8px;
    margin-bottom: 20px;
}

.settings-section-title {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.room-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.room-setting-card {
    padding: 14px 16px;
    background: var(--option-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.2s ease;
}

.room-setting-card:hover {
    border-color: var(--accent);
}

.setting-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.setting-title {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary);
}

.setting-select {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-family: inherit;
    cursor: pointer;
    appearance: auto;
    transition: border-color 0.2s ease;
}

.setting-select:focus {
    outline: none;
    border-color: var(--accent);
}

/* Responsive */
/* Mobile: scoreboard becomes collapsible bar */
@media (max-width: 768px) {
    .challenge-game-layout {
        flex-direction: column;
    }

    .challenge-scoreboard-panel {
        width: 100%;
        order: -1; /* above the game area */
    }

    .scoreboard-toggle {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        padding: 8px 14px;
        background: var(--option-bg);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        cursor: pointer;
        font-size: 0.85rem;
        color: var(--text-primary);
        font-family: inherit;
        font-weight: 600;
        transition: background 0.2s;
    }

    .scoreboard-toggle:active {
        background: var(--option-hover);
    }

    .scoreboard-toggle-rank {
        background: var(--gradient-primary);
        color: white;
        padding: 2px 8px;
        border-radius: 10px;
        font-size: 0.8rem;
        font-weight: 700;
    }

    .scoreboard-toggle-label {
        flex: 1;
    }

    .scoreboard-toggle-arrow {
        font-size: 0.7rem;
        transition: transform 0.2s;
    }

    .challenge-scoreboard-panel.expanded .scoreboard-toggle-arrow {
        transform: rotate(180deg);
    }

    .challenge-scoreboard {
        display: none;
        margin-top: 4px;
        max-height: 200px;
        overflow-y: auto;
    }

    .challenge-scoreboard-panel.expanded .challenge-scoreboard {
        display: block;
        animation: fadeIn 0.2s ease-out;
    }
}

@media (max-width: 600px) {
    .challenge-actions-grid {
        grid-template-columns: 1fr;
    }
    
    .challenge-mode-selector {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .challenge-category-grid {
        grid-template-columns: 1fr;
    }
    
    .room-settings-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .room-lobby-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .room-info-bar {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .room-code-card-value {
        font-size: 1.6rem;
    }
}

@media (max-width: 400px) {
    .room-settings-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== KRITIK KELIMELER ==================== */

.kw-stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.kw-stat-item {
    background: var(--option-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kw-stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
}

.kw-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kw-search-bar {
    margin-bottom: 16px;
}

.kw-search-bar input {
    width: 100%;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--option-bg);
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.kw-search-bar input:focus {
    border-color: var(--accent);
}

.kw-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kw-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--option-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: background 0.15s, border-color 0.15s;
}

.kw-item:hover {
    background: var(--option-hover);
    border-color: var(--accent);
}

.kw-rank {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 28px;
    text-align: center;
}

.kw-item:nth-child(-n+3) .kw-rank {
    color: var(--accent);
    font-size: 0.95rem;
}

.kw-info {
    flex: 1;
    min-width: 0;
}

.kw-expression {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    word-break: break-word;
}

.kw-bar-container {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.kw-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.4s ease;
}

.kw-bar.kw-type-phrase {
    background: var(--gradient-primary);
}

.kw-bar.kw-type-word {
    background: var(--gradient-success);
}

.kw-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.kw-count {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.kw-type-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kw-type-badge.kw-type-phrase {
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent);
}

.kw-type-badge.kw-type-word {
    background: var(--success-bg);
    color: var(--success);
}

/* Progress Bar */
.kw-progress-section {
    margin-bottom: 16px;
}

.kw-progress-bar-wrapper {
    background: var(--option-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}

.kw-progress-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.kw-progress-learned {
    color: var(--success);
    font-weight: 600;
}

.kw-progress-remaining {
    color: var(--text-secondary);
}

.kw-progress-track {
    height: 10px;
    background: var(--border);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 6px;
}

.kw-progress-fill {
    height: 100%;
    background: var(--gradient-success);
    border-radius: 5px;
    transition: width 0.4s ease;
}

.kw-progress-pct {
    text-align: right;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--success);
}

/* Learn Button */
.kw-learn-btn {
    background: transparent;
    border: 1px solid var(--success);
    color: var(--success);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}

.kw-learn-btn:hover {
    background: var(--success);
    color: #fff;
}

/* Complete Message */
.kw-complete-message {
    text-align: center;
    padding: 40px 20px;
}

.kw-complete-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
}

.kw-complete-message h3 {
    color: var(--success);
    margin-bottom: 8px;
}

.kw-complete-message p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.kw-footer {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

@media (max-width: 600px) {
    .kw-stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .kw-item {
        padding: 8px 10px;
        gap: 8px;
    }
    
    .kw-expression {
        font-size: 0.85rem;
    }
    
    .kw-learn-btn {
        padding: 3px 8px;
        font-size: 0.7rem;
    }
}

/* ==================== EXTRA SMALL SCREENS (≤380px) ==================== */
@media (max-width: 380px) {
    .container {
        padding: 4px;
    }
    
    .card {
        padding: 12px 8px;
    }
    
    .header {
        padding: 8px 10px;
        margin-bottom: 6px;
    }
    
    .header h1 {
        font-size: 1.1rem;
    }
    
    .tab {
        padding: 6px 8px;
        font-size: 0.72rem;
    }
    
    .tabs {
        margin-bottom: 6px;
        padding: 3px;
        gap: 2px;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    /* Quiz card: header/tabs hidden, nearly full viewport */
    #quiz-area.card,
    #exam-area.card,
    #challenge-game.card {
        max-height: calc(var(--app-height, 100vh) - 12px);
        padding: 6px 6px 0;
    }
    
    .quiz-header {
        padding: 4px 6px;
        margin-bottom: 3px;
    }
    
    .quiz-progress {
        font-size: 0.75rem;
        padding: 2px 6px;
    }
    
    .quiz-score .correct,
    .quiz-score .wrong {
        padding: 2px 5px;
        font-size: 0.72rem;
    }
    
    .progress-bar {
        height: 2px;
        margin-bottom: 3px;
    }
    
    .question-text {
        font-size: 0.82rem;
        padding: 6px 8px;
        margin-bottom: 3px;
        line-height: 1.55;
    }
    
    .options-container {
        gap: 4px;
        margin-top: 3px;
    }
    
    .option {
        padding: 7px 8px;
        min-height: 32px;
        gap: 5px;
    }
    
    .option-select-btn {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }
    
    .option .text {
        font-size: 0.8rem;
    }
    
    .quiz-actions .btn {
        font-size: 0.8rem;
        padding: 7px 10px;
        min-height: 34px;
    }
    
    .feedback {
        padding: 6px 8px;
        margin-top: 4px;
    }
    
    .feedback.correct p,
    .feedback.wrong p {
        font-size: 0.8rem;
    }
    
    .auth-container {
        padding: 20px 14px;
    }
    
    .auth-header h1 {
        font-size: 1.4rem;
    }
    
    .question-nav-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
        padding: 10px;
    }
    
    .q-nav-btn {
        font-size: 0.75rem;
    }
    
    .exam-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .kw-stats-bar {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .room-settings-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== TABLET (769px - 1024px) ==================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 20px;
        max-width: 100%;
    }
    
    /* Header stays row but tighter */
    .header {
        padding: 16px 20px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    /* Tabs: 2 rows max, smaller padding */
    .tabs {
        gap: 8px;
        padding: 8px;
    }
    
    .tab {
        padding: 10px 16px;
        font-size: 0.88rem;
    }
    
    /* Category grid: 3 columns on tablet */
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Quiz area */
    .quiz-header {
        padding: 14px 16px;
    }
    
    .question-text {
        font-size: 1.1rem;
        padding: 22px;
        line-height: 1.8;
    }
    
    .option {
        padding: 16px 20px;
    }
    
    .option .text {
        font-size: 1.05rem;
    }
    
    /* Card */
    .card {
        padding: 24px;
    }
    
    /* Results */
    .results-summary {
        gap: 32px;
    }
    
    /* Stats grid: 3 columns */
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Streak/Goal */
    .streak-goal-container {
        grid-template-columns: 1fr 2fr;
    }
    
    /* Flashcard */
    .flashcard {
        max-width: 450px;
        height: 280px;
    }
    
    /* Exam size selector */
    .exam-size-selector {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Challenge */
    .challenge-actions-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .challenge-mode-selector {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Auth */
    .auth-container {
        max-width: 440px;
    }
    
    /* KW stats */
    .kw-stats-bar {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ==================== TABLET PORTRAIT (769px - 1024px, portrait) ==================== */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
    /* Tabs scroll on portrait tablet too */
    .tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .tabs::-webkit-scrollbar {
        display: none;
    }
    
    .tab {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* Category grid: 2 columns in portrait */
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
}

/* ==================== SMALL LAPTOP / LARGE TABLET (1025px - 1200px) ==================== */
@media (min-width: 1025px) and (max-width: 1200px) {
    .container {
        max-width: 920px;
    }
    
    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr));
    }
}

/* ==================== LANDSCAPE MOBILE (short height) ==================== */
@media (max-height: 500px) and (orientation: landscape) {
    .auth-screen {
        padding: 12px;
        align-items: flex-start;
    }
    
    .auth-container {
        padding: 20px;
    }
    
    .flashcard {
        height: 160px;
    }
    
    /* Hide header and tabs in landscape quiz to maximize space */
    .header {
        padding: 6px 10px;
        margin-bottom: 4px;
    }
    
    .header h1 {
        font-size: 1rem;
    }
    
    .tabs {
        margin-bottom: 4px;
        padding: 3px;
    }
    
    .tab {
        padding: 5px 8px;
        font-size: 0.72rem;
    }
    
    .container {
        padding: 4px;
    }
    
    .card {
        padding: 8px;
    }
    
    /* Quiz viewport fit for landscape - header/tabs hidden */
    #quiz-area.card,
    #exam-area.card,
    #challenge-game.card {
        display: flex;
        flex-direction: column;
        max-height: calc(var(--app-height, 100vh) - 12px);
        padding: 4px 6px 0;
        overflow: hidden;
    }
    
    .quiz-header {
        padding: 4px 6px;
        margin-bottom: 2px;
    }
    
    .progress-bar {
        height: 2px;
        margin-bottom: 2px;
    }
    
    .question-container {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        min-height: 0;
        margin-bottom: 0;
    }
    
    .question-text {
        padding: 6px 8px;
        font-size: 0.82rem;
        margin-bottom: 3px;
        line-height: 1.5;
    }
    
    .options-container {
        gap: 3px;
        margin-top: 3px;
    }
    
    .option {
        padding: 6px 8px;
        min-height: 30px;
        gap: 5px;
    }
    
    .option-select-btn {
        width: 22px;
        height: 22px;
        font-size: 0.75rem;
    }
    
    .option .text {
        font-size: 0.78rem;
    }
    
    .quiz-actions {
        flex-shrink: 0;
        padding: 4px 6px;
        margin: 0 -6px;
        border-top: 1px solid var(--border);
    }
    
    .quiz-actions .btn {
        flex: 1;
        padding: 5px 8px;
        font-size: 0.78rem;
        min-height: 30px;
    }
    
    .feedback {
        padding: 4px 6px;
        margin-bottom: 2px;
    }
    
    .feedback.correct p,
    .feedback.wrong p {
        font-size: 0.78rem;
    }
}

/* ==================== LANDSCAPE TABLET ==================== */
@media (min-height: 501px) and (max-height: 800px) and (orientation: landscape) and (min-width: 769px) {
    .container {
        padding: 16px;
    }
    
    .header {
        padding: 12px 16px;
        margin-bottom: 16px;
    }
    
    .tabs {
        margin-bottom: 16px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .tabs::-webkit-scrollbar {
        display: none;
    }
    
    .tab {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 10px 16px;
    }
    
    .card {
        padding: 20px;
    }
    
    .question-text {
        padding: 18px;
        margin-bottom: 16px;
    }
    
    .quiz-header {
        padding: 10px 14px;
        margin-bottom: 12px;
    }
    
    .progress-bar {
        margin-bottom: 12px;
    }
    
    .flashcard {
        height: 220px;
    }
}

/* ==================== PWA INSTALL BANNER ==================== */
.install-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top));
    animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.install-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.install-banner-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    flex-shrink: 0;
}

.install-banner-text {
    flex: 1;
    min-width: 0;
}

.install-banner-text strong {
    display: block;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.install-banner-text span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.install-banner .btn {
    flex-shrink: 0;
    min-height: 38px;
    padding: 8px 18px;
    font-size: 0.9rem;
}

.install-banner-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.2s;
}

.install-banner-close:hover {
    color: var(--text-primary);
}

/* iOS Install Guide */
.ios-install-guide {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: 0 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.ios-guide-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

.ios-guide-content p {
    margin: 8px 0;
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.ios-guide-content .install-banner-close {
    position: absolute;
    top: 8px;
    right: 8px;
}

.ios-share-icon {
    font-size: 1.1rem;
}

/* When install banner is visible, push content down */
.install-banner:not(.hidden) ~ .auth-screen,
.install-banner:not(.hidden) ~ .app-wrapper {
    padding-top: 68px;
}

/* ==================== FRIENDS SYSTEM ==================== */

.friend-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.friend-section h3 {
    margin: 0 0 12px 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.friend-add-section {
    margin-bottom: 8px;
}

.friend-add-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.friend-add-row input {
    flex: 1;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--option-bg);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.friend-request-status {
    font-size: 0.85rem;
    margin-top: 6px;
    min-height: 20px;
}

.friend-request-status.success {
    color: var(--success);
}

.friend-request-status.error {
    color: var(--error);
}

.friend-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.friend-item.friend-pending {
    border-left: 3px solid var(--warning);
}

.friend-item.friend-sent {
    opacity: 0.7;
}

.friend-name {
    font-weight: 600;
    color: var(--text-primary);
}

.friend-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.friend-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.friend-actions {
    display: flex;
    gap: 6px;
}

/* Enriched Friend Card */
.friend-card {
    padding: 14px !important;
}

.friend-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.friend-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.friend-info {
    flex: 1;
    min-width: 0;
}

.friend-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.friend-online-dot {
    font-size: 0.7rem;
}

.friend-streak-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--warning);
    background: rgba(253, 203, 110, 0.15);
    padding: 1px 6px;
    border-radius: 10px;
}

.friend-mini-stats {
    display: flex;
    gap: 10px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 3px;
}

/* Tab Badge */
.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--error);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 4px;
    line-height: 1;
}

/* Empty State Card */
.empty-state-card {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-secondary);
}

.empty-state-card .empty-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 10px;
}

.empty-state-card p {
    margin: 4px 0;
}

.empty-state-card .empty-hint {
    font-size: 0.82rem;
    opacity: 0.7;
}

/* Compare Modal Progress Bars */
.compare-stat-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.compare-stat-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    min-width: 80px;
}

.compare-bar-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.compare-bar {
    flex: 1;
    height: 8px;
    background: var(--option-bg);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.compare-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.compare-bar-fill.user {
    background: var(--gradient-primary);
}

.compare-bar-fill.friend {
    background: var(--gradient-success);
}

.compare-value {
    font-size: 0.82rem;
    font-weight: 600;
    min-width: 40px;
    text-align: right;
}

.compare-value.user {
    color: var(--accent);
}

.compare-value.friend {
    color: var(--success);
}

.compare-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 16px 0 8px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.compare-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.compare-user-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.compare-user-tag.user { color: var(--accent); }
.compare-user-tag.friend { color: var(--success); }

/* ==================== PROFILE MODAL ==================== */
.profile-modal {
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
}

.profile-modal-body {
    padding: 0 20px 20px;
}

.profile-info-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.profile-avatar-lg {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.profile-info-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-username {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-primary);
}

.profile-email {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.profile-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.profile-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.profile-stat {
    text-align: center;
}

.profile-stat-val {
    display: block;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--accent);
}

.profile-stat-lbl {
    display: block;
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.profile-sections {
    margin-top: 12px;
}

.profile-section {
    border-bottom: 1px solid var(--border);
}

.profile-section:last-child {
    border-bottom: none;
}

.profile-section-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 14px 4px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: color 0.2s;
}

.profile-section-toggle:hover {
    color: var(--accent);
}

.toggle-arrow {
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: transform 0.2s;
}

.profile-section-content {
    padding: 0 4px 16px;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-form input,
.profile-form select {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--option-bg);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.profile-form input:focus,
.profile-form select:focus {
    outline: none;
    border-color: var(--accent);
}

.profile-select {
    appearance: none;
    padding-right: 30px;
}

.profile-hint {
    font-size: 0.82rem;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin: 0;
}

.profile-hint-ok {
    color: var(--success);
    background: var(--success-bg);
}

.profile-hint-warn {
    color: var(--warning);
    background: rgba(253, 203, 110, 0.1);
}

.profile-warning {
    font-size: 0.85rem;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: rgba(253, 203, 110, 0.1);
    border: 1px solid rgba(253, 203, 110, 0.3);
    color: var(--warning);
    line-height: 1.5;
}

.profile-danger {
    font-size: 0.85rem;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--error-bg);
    border: 1px solid rgba(255, 118, 117, 0.3);
    color: var(--error);
    line-height: 1.5;
}

.profile-msg {
    font-size: 0.82rem;
    padding: 6px 0;
    min-height: 1em;
}

.profile-msg-success {
    color: var(--success);
}

.profile-msg-error {
    color: var(--error);
}

.data-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 10px;
    background: var(--option-bg);
    border-radius: var(--radius-sm);
}

.data-summary-grid span {
    text-align: center;
    padding: 4px 0;
}

/* Username clickable */
.user-display-name {
    cursor: pointer;
    transition: color 0.2s;
}

.user-display-name:hover {
    color: var(--accent);
}

/* Room Invites */
.room-invite-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.room-invite-item .friend-actions {
    align-self: flex-end;
}

.invite-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.invite-room {
    font-weight: 600;
    color: var(--text-primary);
}

.invite-detail {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Friend Streaks */
.friend-streaks-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.streak-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--option-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.streak-item.active {
    border-left: 3px solid var(--warning);
    background: rgba(253, 203, 110, 0.05);
}

.streak-item.inactive {
    opacity: 0.6;
}

.streak-fire {
    font-size: 1.3rem;
}

.streak-friend {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
}

.streak-count {
    font-weight: 700;
    color: var(--warning);
    font-size: 0.95rem;
}

.streak-best {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Daily Goal Widget */
.daily-goal-widget {
    background: var(--option-bg);
    border-radius: var(--radius-sm);
    padding: 14px;
    border: 1px solid var(--border);
}

.daily-goal-progress-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.daily-goal-bar {
    flex: 1;
    height: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    overflow: hidden;
}

.daily-goal-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.daily-goal-actions {
    margin-top: 10px;
    text-align: right;
}

/* Leaderboard */
.leaderboard-type-selector {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.lb-type-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--option-bg);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.lb-type-btn:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.lb-type-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.friend-leaderboard {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lb-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--option-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.lb-row.lb-self {
    background: rgba(108, 92, 231, 0.12);
    border-color: var(--accent);
}

.lb-rank {
    font-size: 1.1rem;
    min-width: 28px;
    text-align: center;
}

.lb-name {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
}

.lb-metric {
    font-weight: 700;
    color: var(--accent);
    font-size: 0.95rem;
}

/* Friend Compare Modal */
.modal-wide {
    max-width: 600px;
    width: 95%;
}

.friend-compare-content {
    max-height: 70vh;
    overflow-y: auto;
    padding: 4px;
}

.compare-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px;
    margin-bottom: 16px;
    background: var(--option-bg);
    border-radius: var(--radius-sm);
}

.compare-name {
    font-weight: 700;
    color: var(--accent);
    font-size: 1rem;
}

.compare-vs {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}

.compare-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.compare-section h4 {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
}

.compare-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    padding: 6px 0;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.compare-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.compare-val {
    text-align: center;
    color: var(--text-primary);
    font-weight: 600;
}

.compare-val.winner {
    color: var(--success);
}

/* Lobby Invite Section */
.lobby-invite-section {
    margin: 16px 0;
    padding: 12px;
    background: var(--option-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.lobby-invite-section h4 {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* ==================== PASSWORD VISIBILITY & FORGOT PASSWORD ==================== */

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    flex: 1;
    padding-right: 45px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px 8px;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.password-toggle:hover {
    color: var(--text-primary);
}

.auth-success {
    color: var(--success);
    font-size: 0.9rem;
    margin-top: 8px;
    text-align: center;
}

.forgot-password-body {
    padding: 20px;
}

.forgot-step {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.forgot-step p {
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.security-question-text {
    font-weight: 600;
    color: var(--accent);
    padding: 12px;
    background: var(--option-bg);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
}

.forgot-step input,
.forgot-step select {
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--option-bg);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.forgot-step .password-input-wrapper {
    margin-top: 8px;
}

#securityAnswerGroup {
    margin-top: 8px;
}

/* ==================== SKELETON LOADING ==================== */
@keyframes skeleton-pulse {
    0% { opacity: 0.6; }
    50% { opacity: 0.3; }
    100% { opacity: 0.6; }
}

.skeleton {
    background: var(--border);
    border-radius: var(--radius-sm);
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.skeleton-card {
    height: 64px;
    border-radius: var(--radius);
}

.skeleton-line {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-40 { width: 40%; }

.skeleton-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--option-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ==================== CUSTOM CONFIRM DIALOG ==================== */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.confirm-overlay.active {
    opacity: 1;
    visibility: visible;
}

.confirm-dialog {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    max-width: 380px;
    width: 100%;
    padding: 24px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.confirm-overlay.active .confirm-dialog {
    transform: scale(1);
}

.confirm-icon {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 12px;
}

.confirm-title {
    text-align: center;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.confirm-message {
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
}

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

.confirm-actions .btn {
    flex: 1;
    padding: 12px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: 380px;
    width: calc(100% - 40px);
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: var(--radius);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 500;
    pointer-events: auto;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
    line-height: 1.4;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hide {
    transform: translateX(120%);
    opacity: 0;
}

.toast-icon {
    font-size: 1.15rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    min-width: 0;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 2px 4px;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 var(--radius) var(--radius);
    transition: width linear;
}

.toast.toast-success {
    border-left: 4px solid var(--success);
}

.toast.toast-success .toast-progress {
    background: var(--success);
}

.toast.toast-error {
    border-left: 4px solid var(--error);
}

.toast.toast-error .toast-progress {
    background: var(--error);
}

.toast.toast-warning {
    border-left: 4px solid var(--warning);
}

.toast.toast-warning .toast-progress {
    background: var(--warning);
}

.toast.toast-info {
    border-left: 4px solid var(--accent);
}

.toast.toast-info .toast-progress {
    background: var(--accent);
}

@media (max-width: 600px) {
    .toast-container {
        top: auto;
        bottom: calc(70px + env(safe-area-inset-bottom));
        right: 10px;
        left: 10px;
        max-width: 100%;
        width: auto;
    }

    .toast {
        transform: translateY(120%);
    }

    .toast.show {
        transform: translateY(0);
    }

    .toast.hide {
        transform: translateY(120%);
    }
}

/* ==================== MOBILE BOTTOM NAVIGATION ==================== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 4px 6px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease;
    position: relative;
    min-height: 54px;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 0 0 3px 3px;
    transition: width 0.25s ease;
}

.bottom-nav-item.active {
    color: var(--accent);
}

.bottom-nav-item.active::before {
    width: 32px;
}

.bottom-nav-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.bottom-nav-label {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.bottom-nav-item:active {
    transform: scale(0.9);
    transition-duration: 0.1s;
}

/* ==================== MORE MENU (BOTTOM SHEET) ==================== */
.more-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 500;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.more-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.more-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 501;
    max-height: 70vh;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom);
}

.more-menu-overlay.active .more-menu {
    transform: translateY(0);
}

.more-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 12px;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
}

.more-menu-header::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
}

.more-menu-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--option-bg);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.more-menu-close:hover {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

.more-menu-items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 8px 20px 28px;
}

.more-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 18px 8px;
    background: var(--option-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.more-menu-item:active {
    transform: scale(0.95);
    background: var(--option-hover);
}

.more-menu-item.active {
    border-color: var(--accent);
    background: rgba(108, 92, 231, 0.12);
    color: var(--accent);
}

.more-menu-icon {
    font-size: 1.4rem;
}

/* ==================== INLINE STYLE MIGRATIONS ==================== */
.room-code-input {
    text-transform: uppercase;
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 0.3em;
}

.favorites-quiz-action {
    margin-bottom: 16px;
}

.gpt-button-container {
    margin-top: 20px;
    text-align: center;
}

.gpt-explain-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.gpt-explain-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.gpt-explain-btn:active {
    transform: scale(0.97);
}

.dict-example {
    font-style: italic;
    color: var(--text-secondary);
    margin-top: 4px;
}

.dict-tureng-link {
    margin-top: 12px;
}

.distribution-total {
    background: var(--accent-glow);
}

.feedback-success-msg {
    text-align: center;
    padding: 16px;
    color: var(--success);
}

/* ==================== SWIPE HINTS ==================== */
.swipe-hint-banner {
    display: none;
    text-align: center;
    padding: 6px 12px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
    gap: 6px;
    align-items: center;
    justify-content: center;
}

.swipe-hint-banner .swipe-arrow {
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .swipe-hint-banner {
        display: flex;
    }
}

/* ==================== AUTH FORM VALIDATION ==================== */
.form-group input.input-error,
.form-group select.input-error {
    border-color: var(--error) !important;
    box-shadow: 0 0 0 2px rgba(255, 118, 117, 0.15);
}

.form-group input.input-success,
.form-group select.input-success {
    border-color: var(--success) !important;
    box-shadow: 0 0 0 2px rgba(0, 206, 201, 0.15);
}

.form-group .field-hint {
    font-size: 0.75rem;
    margin-top: 4px;
    min-height: 1em;
    transition: color 0.2s;
}

.form-group .field-hint.hint-error {
    color: var(--error);
}

.form-group .field-hint.hint-success {
    color: var(--success);
}

.auth-form .form-group {
    transition: transform 0.15s ease;
}

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

.form-group.shake {
    animation: shake 0.3s ease;
}

/* ==================== QUIZ UI COMPACT (MOBILE) ==================== */
@media (max-width: 768px) {
    .question-meta-row {
        margin-bottom: 2px;
        gap: 4px;
    }

    .question-category-badge {
        font-size: 0.68rem;
        padding: 2px 8px;
    }

    .community-solve-rate {
        font-size: 0.65rem;
        padding: 2px 8px;
    }

    .history-indicator {
        font-size: 0.72rem;
        padding: 2px 0;
    }

    .question-actions {
        gap: 6px;
        padding: 6px 0;
        margin-top: 8px;
    }

    .rating-label {
        display: none;
    }

    .question-rating {
        justify-content: center;
        width: 100%;
    }

    .star-rating {
        gap: 4px;
    }

    .feedback-report-btn {
        font-size: 0.75rem;
    }

    .avg-rating {
        font-size: 0.72rem;
    }

    .favorite-btn {
        min-width: 44px;
        min-height: 44px;
        font-size: 1.2rem;
    }

    .hint-area {
        margin-bottom: 4px;
    }

    .btn-hint {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* ==================== TOUCH TARGET FIXES (min 44x44px) ==================== */
@media (max-width: 768px) {
    .option-strikethrough-btn {
        width: 44px;
        height: 44px;
        font-size: 0.9rem;
        opacity: 0.8;
    }

    .star-btn {
        padding: 8px;
        font-size: 1.5rem;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .kw-learn-btn {
        padding: 10px 16px;
        font-size: 0.8rem;
        min-height: 44px;
    }

    .word-tag .remove {
        padding: 8px 12px;
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .btn-small {
        min-height: 40px;
        min-width: 40px;
        padding: 8px 14px;
    }

    .modal-close {
        min-width: 44px;
        min-height: 44px;
        font-size: 1.5rem;
    }

    .feedback-report-btn {
        min-height: 44px;
        padding: 10px 16px;
    }

    .option-select-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 10px 16px;
    }

    .flashcard-action-btn {
        min-height: 48px;
        padding: 12px 20px;
    }

    .friend-actions .btn {
        min-width: 44px;
        min-height: 44px;
        padding: 8px 12px;
    }

    .profile-section-toggle {
        min-height: 48px;
        padding: 14px 8px;
    }

    .lb-type-btn {
        min-height: 40px;
        padding: 8px 16px;
    }
}

/* ==================== BOTTOM NAV RESPONSIVE ==================== */
@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: stretch;
    }

    .app-wrapper .tabs {
        display: none !important;
    }

    .app-wrapper .container {
        padding-bottom: calc(62px + env(safe-area-inset-bottom));
    }

    .gpt-panel-toggle {
        bottom: calc(70px + env(safe-area-inset-bottom)) !important;
    }

    body.quiz-active .bottom-nav {
        display: none !important;
    }

    body.quiz-active .app-wrapper .container {
        padding-bottom: 0;
    }

    body.quiz-active .gpt-panel-toggle {
        bottom: calc(24px + env(safe-area-inset-bottom)) !important;
    }
}
