@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #6C63FF 0%, #3F3D56 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

/* Main container */
.container-app {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
    max-width: 560px;
    width: 100%;
    padding: 32px;
    animation: slideUp 0.4s ease-out;
}

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

/* Header */
.app-title {
    font-weight: 700;
    font-size: 28px;
    color: #2D2B55;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.app-title i {
    color: #6C63FF;
}

.badge {
    font-weight: 500;
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 50px;
}

/* Word card */
.word-card {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f1ff 100%);
    border: 1px solid rgba(108, 99, 255, 0.1);
    border-radius: 20px;
    padding: 32px 24px;
    margin-bottom: 20px;
}

#word {
    font-size: 30px;
    font-weight: 700;
    color: #6C63FF;
    margin-bottom: 28px;
    letter-spacing: -0.5px;
}

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

.option {
    background: white;
    border: 2px solid #e8e8f0;
    border-radius: 14px;
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    text-align: left;
}

.option:hover {
    border-color: #6C63FF;
    background: #f8f7ff;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.15);
}

.option.correct {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    border-color: transparent;
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.option.wrong {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

.option:disabled {
    cursor: not-allowed;
    transform: none;
}

.option:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Result */
.result {
    text-align: center;
    padding: 14px 18px;
    border-radius: 14px;
    margin-top: 16px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
}

.result.correct {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.result.wrong {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.hidden {
    display: none;
}

/* Action buttons */
#action-buttons {
    display: flex;
    width: 100%;
}

.action-btn {
    flex: 1;
    padding: 12px;
    background: linear-gradient(135deg, #6C63FF, #5A52E0);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.4);
}

.action-btn.btn-abort {
    background: linear-gradient(135deg, #6B7280, #4B5563);
}

.action-btn.btn-abort:hover {
    box-shadow: 0 4px 16px rgba(107, 114, 128, 0.4);
}

/* Progress bar */
.progress-container {
    margin: 20px 0;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8f9ff, #f0f4ff);
    border: 1px solid rgba(108, 99, 255, 0.1);
    border-radius: 16px;
}

.progress-text {
    font-size: 14px;
    font-weight: 600;
    color: #2D2B55;
}

.progress-percent {
    font-size: 13px;
    font-weight: 600;
    color: #6C63FF;
}

.progress {
    background: #e8e8f0;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(135deg, #6C63FF, #10B981);
    border-radius: 8px;
    transition: width 0.4s ease;
}

/* Header buttons */
.btn-outline-warning {
    font-weight: 500;
}

.btn-outline-info {
    font-weight: 500;
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(108, 99, 255, 0.3);
    border-radius: 3px;
}

/* Mobile */
@media (max-width: 480px) {
    body {
        padding: 8px;
        align-items: flex-start;
        padding-top: 16px;
    }

    .container-app {
        padding: 20px;
        border-radius: 20px;
    }

    .app-title {
        font-size: 24px;
    }

    #word {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .word-card {
        padding: 24px 16px;
    }

    .option {
        padding: 12px 14px;
        font-size: 14px;
    }

    .badge {
        font-size: 11px;
        padding: 6px 10px;
    }

    #badges {
        gap: 6px !important;
    }
}

.text-purple { color: #6C63FF !important; }
.text-purple a { color: #6C63FF; }
.about-page .card { border-radius: 12px; }

/* Dark mode */
body.dark {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

body.dark .container-app {
    background: rgba(30, 30, 50, 0.95);
    color: #e0e0e0;
}

body.dark .word-card {
    background: linear-gradient(135deg, #2a2a3e, #252540);
    border-color: rgba(108, 99, 255, 0.2);
}

body.dark #word { color: #a9a4ff; }

body.dark .option {
    background: #2a2a3e;
    border-color: #3a3a50;
    color: #e0e0e0;
}

body.dark .option:hover {
    background: #33334a;
    border-color: #6C63FF;
}

body.dark .progress-container {
    background: linear-gradient(135deg, #2a2a3e, #252540);
    border-color: rgba(108, 99, 255, 0.2);
}

body.dark .progress-text { color: #e0e0e0; }
body.dark .progress { background: #3a3a50; }

body.dark .result.correct {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.3);
}

body.dark .result.wrong {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}

body.dark .option.correct {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    border-color: transparent;
}

body.dark .option.wrong {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
    border-color: transparent;
}

body.dark .about-page,
body.dark .about-page p,
body.dark .about-page li,
body.dark .about-page strong {
    color: #e0e0e0;
}

body.dark .about-page .card {
    background: rgba(255,255,255,0.05) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
}

body.dark .about-page .bg-dark.bg-opacity-50 {
    background: rgba(255,255,255,0.08) !important;
}

body.dark .about-page .text-muted {
    color: #999 !important;
}

body.dark .form-control {
    background: #2a2a3e;
    border-color: rgba(108,99,255,0.3);
    color: #fff;
}

body.dark .form-select {
    background: #2a2a3e;
    border-color: rgba(108,99,255,0.3);
    color: #fff;
}

/* Speak button */
.speak-btn {
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}
.speak-btn:hover { opacity: 1; }

.xyz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.xyz-grid .option { margin: 0; font-size: 18px; font-weight: 700; min-height: 48px; }
.xyz-img { max-width: 100%; max-height: 50vh; border-radius: 8px; margin: 8px 0; cursor: zoom-in; object-fit: contain; }
.xyz-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,.9); z-index: 9999; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.xyz-overlay img { max-width: 100%; max-height: 100%; object-fit: contain; touch-action: pinch-zoom; }
