/* ============================================================ */
/* FILE: css/dictation.css - DICTATION MODE STYLES              */
/* Nghe → Gõ từ vào chỗ trống → (nếu bí) gợi ý 4 đáp án         */
/* Prefix: dict-* để tránh trùng CSS cũ                          */
/* ============================================================ */
/* V6: THÊM 2 CHIỀU ĐỘ KHÓ                                       */
/*   - .dict-distractor-box — box riêng cho level distractor     */
/*   - .dict-distractor-chip — 5 màu (xanh→tím)                  */
/*   - .dict-distractor-tag — badge nhỏ "🎚️3" trong star badge   */
/*   - Mobile: 2 box chips xếp dọc, chip nhỏ hơn                 */
/* V5: STAR BADGE + STAR CHIPS + dropdown stars                  */
/* V4: LEVEL BADGE + DROPDOWN LEVEL                              */
/* V3: LEVEL CHIPS + IPA ROW                                     */
/* V2: FIX NÚT SỬA/XÓA + cải thiện layout                        */
/* V1: MVP                                                       */
/* ============================================================ */

/* ============================================================ */
/* ===== CONTAINER CHÍNH ===== */
/* ============================================================ */

.dict-container {
    background: var(--bg-secondary);
    border-radius: 28px;
    padding: 1.8rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    margin-bottom: 1.8rem;
    border: 1px solid var(--border);
}

/* ============================================================ */
/* ===== HEADER ===== */
/* ============================================================ */

.dict-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border);
}

.dict-set-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.dict-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.dict-counter {
    background: var(--accent);
    color: white;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

#dictLevelBadge {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

/* ============================================================ */
/* ===== LEVEL BADGE CŨ (backward compat) ===== */
/* ============================================================ */

.dict-level-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.3px;
    border: 1px solid transparent;
    transition: transform 0.15s ease;
}

.dict-level-badge-1 { background: rgba(34, 197, 94, 0.15); color: #22c55e; border-color: rgba(34, 197, 94, 0.35); }
.dict-level-badge-2 { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border-color: rgba(59, 130, 246, 0.35); }
.dict-level-badge-3 { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border-color: rgba(245, 158, 11, 0.4); }
.dict-level-badge-4 { background: rgba(239, 68, 68, 0.15); color: #ef4444; border-color: rgba(239, 68, 68, 0.4); }
.dict-level-badge-5 { background: linear-gradient(135deg, rgba(168, 85, 247, 0.18), rgba(236, 72, 153, 0.12)); color: #d946ef; border-color: rgba(168, 85, 247, 0.45); font-weight: 800; }
.dict-level-badge:hover { transform: translateY(-1px); }

/* ============================================================ */
/* ===== STAR BADGE + LEVEL TAG ===== */
/* ============================================================ */

.dict-star-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.18rem 0.55rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.2px;
    border: 1px solid transparent;
    transition: transform 0.15s ease;
    background: var(--bg-primary);
}

.dict-star-badge .star-filled {
    color: #fbbf24;
    letter-spacing: -1px;
    font-size: 0.72rem;
    line-height: 1;
}

.dict-star-badge .star-empty {
    color: rgba(148, 163, 184, 0.4);
    letter-spacing: -1px;
    font-size: 0.72rem;
    line-height: 1;
}

.dict-star-badge .star-label {
    margin-left: 0.2rem;
    font-weight: 800;
    font-size: 0.68rem;
    opacity: 0.9;
    letter-spacing: 0.4px;
}

.dict-star-badge-1 { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.35); }
.dict-star-badge-1 .star-label { color: #22c55e; }
.dict-star-badge-2 { background: rgba(59, 130, 246, 0.12); border-color: rgba(59, 130, 246, 0.35); }
.dict-star-badge-2 .star-label { color: #60a5fa; }
.dict-star-badge-3 { background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.4); }
.dict-star-badge-3 .star-label { color: #f59e0b; }
.dict-star-badge-4 { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.4); }
.dict-star-badge-4 .star-label { color: #ef4444; }
.dict-star-badge-5 {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(239, 68, 68, 0.12));
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 1px 5px rgba(245, 158, 11, 0.2);
}
.dict-star-badge-5 .star-label { color: #f59e0b; font-weight: 900; }

.dict-star-badge:hover { transform: translateY(-1px); }

/* ⭐ V6: TAG nhỏ hiển thị distractor level trong star badge */
.dict-distractor-tag {
    display: inline-flex;
    align-items: center;
    margin-left: 0.3rem;
    padding: 0.05rem 0.4rem;
    border-radius: 12px;
    font-size: 0.62rem;
    font-weight: 800;
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.35);
    letter-spacing: 0.2px;
    line-height: 1.3;
}

/* ============================================================ */
/* ===== MODE SELECTOR ===== */
/* ============================================================ */

.dict-mode-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 1rem;
}

/* ============================================================ */
/* ===== AUDIO AREA ===== */
/* ============================================================ */

.dict-audio-area {
    text-align: center;
    padding: 1rem 0 0.5rem 0;
}

.dict-audio-btn {
    background: linear-gradient(135deg, var(--accent), #6366f1);
    color: white;
    border: none;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 2.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.dict-audio-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 28px rgba(59, 130, 246, 0.5);
}

.dict-audio-btn:active { transform: scale(0.95); }

.dict-audio-btn.speaking {
    animation: dictPulse 0.8s ease-in-out infinite;
}

@keyframes dictPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.dict-audio-hint {
    margin-top: 0.6rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

.dict-audio-hint kbd {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.7rem;
    font-family: monospace;
    color: var(--text-primary);
}

/* ============================================================ */
/* ===== SENTENCE + BLANK ===== */
/* ============================================================ */

.dict-sentence-wrap {
    margin: 1.2rem 0;
    padding: 1.2rem 1.5rem;
    background: var(--bg-primary);
    border-radius: 20px;
    border-left: 4px solid var(--accent);
    text-align: center;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.dict-sentence {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.5;
    word-break: break-word;
}

.dict-blank {
    display: inline-block;
    min-width: 120px;
    border-bottom: 3px solid var(--accent);
    color: var(--accent);
    text-align: center;
    font-weight: 700;
    margin: 0 0.3rem;
    padding: 0 0.5rem;
    vertical-align: baseline;
    transition: all 0.2s ease;
}

.dict-blank.filled { border-bottom-color: var(--success); color: var(--success); }
.dict-blank.wrong { border-bottom-color: var(--danger); color: var(--danger); }

.dict-vi-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
    opacity: 0.75;
    margin-top: 0.2rem;
}

/* ============================================================ */
/* ===== INPUT AREA ===== */
/* ============================================================ */

.dict-input-area {
    display: flex;
    gap: 0.6rem;
    align-items: stretch;
    margin-top: 1rem;
}

.dict-input {
    flex: 1;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    color: var(--text-primary);
    padding: 0.8rem 1.2rem;
    border-radius: 16px;
    outline: none;
    font-size: 1.05rem;
    font-family: inherit;
    transition: all 0.2s ease;
    min-width: 0;
}

.dict-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.dict-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--bg-secondary);
}

.dict-input.correct {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.08);
    color: var(--success);
    font-weight: 600;
}

.dict-input.wrong {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger);
}

.dict-check-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.8rem 1.8rem;
    border-radius: 16px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-family: inherit;
}

.dict-check-btn:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-1px); }
.dict-check-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================================ */
/* ===== HINT AREA ===== */
/* ============================================================ */

.dict-hint-toggle-wrap {
    text-align: center;
    margin-top: 0.8rem;
}

.dict-hint-btn {
    background: transparent;
    border: 1px dashed var(--warning);
    color: var(--warning);
    padding: 0.5rem 1.4rem;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    font-family: inherit;
}

.dict-hint-btn:hover {
    background: rgba(245, 158, 11, 0.1);
    border-style: solid;
    transform: translateY(-1px);
}

.dict-hint-btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.dict-hint-panel {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 16px;
    animation: dictFadeIn 0.25s ease;
}

.dict-hint-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--warning);
    margin-bottom: 0.7rem;
    text-align: center;
    letter-spacing: 0.3px;
}

.dict-hint-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.dict-hint-option {
    background: var(--bg-primary);
    border: 2px solid var(--border);
    color: var(--text-primary);
    padding: 0.7rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.15s ease;
    text-align: center;
    word-break: break-word;
}

.dict-hint-option:hover:not(:disabled) {
    border-color: var(--accent);
    background: var(--bg-secondary);
    transform: translateY(-1px);
}

.dict-hint-option:disabled { cursor: not-allowed; }
.dict-hint-option.correct { background: var(--success); border-color: var(--success); color: white; font-weight: 700; }
.dict-hint-option.wrong { background: var(--danger); border-color: var(--danger); color: white; }
.dict-hint-option.dimmed { opacity: 0.4; }

/* ============================================================ */
/* ===== FEEDBACK ===== */
/* ============================================================ */

.dict-feedback {
    margin-top: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.5;
    animation: dictFadeIn 0.25s ease;
    display: none;
}

.dict-feedback.show { display: block; }

.dict-feedback.correct {
    background: rgba(34, 197, 94, 0.1);
    border-left: 4px solid var(--success);
    color: var(--success);
}

.dict-feedback.wrong {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--danger);
    color: var(--danger);
}

.dict-feedback strong { font-weight: 700; }

@keyframes dictFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================ */
/* ===== ANSWER REVEAL ===== */
/* ============================================================ */

.dict-answer-reveal {
    margin-top: 1rem;
    padding: 1rem 1.2rem;
    background: var(--bg-primary);
    border-radius: 16px;
    border-left: 4px solid var(--success);
    animation: dictFadeIn 0.3s ease;
    display: none;
}

.dict-answer-reveal.show { display: block; }

.dict-answer-row {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.35rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.dict-answer-row + .dict-answer-row {
    border-top: 1px dashed var(--border);
    margin-top: 0.35rem;
    padding-top: 0.55rem;
}

.dict-answer-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 90px;
    flex-shrink: 0;
    padding-top: 0.1rem;
}

.dict-answer-value {
    flex: 1;
    color: var(--text-primary);
    word-break: break-word;
}

.dict-answer-value strong { color: var(--success); font-weight: 700; }

.dict-answer-value .ipa {
    font-family: 'Courier New', monospace;
    color: var(--accent);
    font-size: 0.88rem;
    letter-spacing: 0.3px;
}

.dict-speak-blank-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--accent);
    padding: 3px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.75rem;
    margin-left: 0.3rem;
    transition: all 0.15s ease;
    font-family: inherit;
    vertical-align: middle;
}

.dict-speak-blank-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: scale(1.05);
}

.dict-full-sentence-btn {
    margin-top: 0.8rem;
    width: 100%;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.dict-full-sentence-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35);
}

/* ============================================================ */
/* ===== ACTIONS ===== */
/* ============================================================ */

.dict-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 1.2rem;
    flex-wrap: wrap;
}

.dict-actions .ctrl-btn {
    flex: 1;
    min-width: 140px;
}

.dict-next-btn { background: var(--accent) !important; }
.dict-reset-btn { background: var(--bg-card) !important; }

/* ============================================================ */
/* ===== EMPTY STATE ===== */
/* ============================================================ */

.dict-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--text-secondary);
}

.dict-empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.8rem;
    opacity: 0.5;
    line-height: 1;
}

.dict-empty p { font-size: 0.9rem; line-height: 1.6; margin: 0.3rem 0; }
.dict-empty strong { color: var(--accent); }

.dict-empty-cta {
    display: inline-block;
    margin-top: 0.8rem;
    background: var(--accent);
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all 0.2s ease;
}

.dict-empty-cta:hover { background: var(--accent-hover); transform: translateY(-1px); }

/* ============================================================ */
/* ===== MANAGE PANEL HEADERS ===== */
/* ============================================================ */

.dict-manage-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.dict-manage-header-icon { font-size: 1.2rem; flex-shrink: 0; }

.dict-manage-header-title {
    flex: 1;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 0;
}

.dict-manage-header-badge {
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

/* ===== PROMPT COPY BOX ===== */

.dict-prompt-box {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 1.2rem 1.3rem;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.dict-prompt-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ec4899, #a855f7, #3b82f6);
}

.dict-prompt-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dict-prompt-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.9rem;
}

.dict-prompt-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* ===== IMPORT TEXTAREA WRAPPER ===== */

.dict-import-wrap {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 1rem 1.2rem;
    border-left: 3px solid var(--accent);
    margin-bottom: 1.5rem;
}

.dict-import-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dict-import-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.8rem;
}

.dict-import-desc code {
    background: rgba(0, 0, 0, 0.3);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-family: monospace;
}

.dict-import-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.8rem; }

/* ============================================================ */
/* ===== EDIT/DELETE BUTTONS ===== */
/* ============================================================ */

.edit-dict-question-btn,
.delete-dict-question-btn {
    border: none;
    padding: 0.4rem 1.1rem;
    border-radius: 40px;
    color: white;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.edit-dict-question-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    margin-right: 0.5rem;
}

.delete-dict-question-btn { background: linear-gradient(135deg, #ef4444, #dc2626); }

.edit-dict-question-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(245, 158, 11, 0.4);
    filter: brightness(1.05);
}

.delete-dict-question-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(239, 68, 68, 0.4);
    filter: brightness(1.05);
}

.edit-dict-question-btn:active,
.delete-dict-question-btn:active { transform: translateY(0) scale(0.97); }

.set-item-in-folder .set-actions .rename-dict-set-btn,
.set-item-in-folder .set-actions .delete-dict-set-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 3px 8px;
    border-radius: 8px;
    transition: all 0.15s ease;
    font-family: inherit;
    line-height: 1;
}

.set-item-in-folder .set-actions .rename-dict-set-btn { color: var(--success); }
.set-item-in-folder .set-actions .rename-dict-set-btn:hover { background: rgba(34, 197, 94, 0.15); transform: scale(1.15); }
.set-item-in-folder .set-actions .delete-dict-set-btn { color: var(--danger); }
.set-item-in-folder .set-actions .delete-dict-set-btn:hover { background: rgba(239, 68, 68, 0.15); transform: scale(1.15); }

#dictQuestionListContainer .card-item {
    align-items: center;
    padding: 0.9rem 1rem;
}

#dictQuestionListContainer .card-item > div:last-child {
    display: flex;
    gap: 0;
    flex-shrink: 0;
    align-items: center;
    flex-wrap: wrap;
}

/* ============================================================ */
/* ===== LEVEL/STAR/STAR-CHIP SELECTORS ===== */
/* ============================================================ */

.dict-level-box {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.06), rgba(168, 85, 247, 0.04));
    border-radius: 16px;
    padding: 1rem 1.2rem;
    border-left: 3px solid var(--accent);
    margin-bottom: 1.2rem;
}

/* ⭐ V6: Box cho distractor level — màu khác để phân biệt với box sao */
.dict-distractor-box {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.07), rgba(168, 85, 247, 0.04));
    border-radius: 16px;
    padding: 1rem 1.2rem;
    border-left: 3px solid #a78bfa;
    margin-bottom: 1.5rem;
}

.dict-level-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dict-level-desc {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    line-height: 1.5;
    opacity: 0.85;
}

.dict-level-chips {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.dict-level-chip {
    background: var(--bg-primary);
    border: 2px solid var(--border);
    color: var(--text-secondary);
    padding: 0.5rem 0.9rem;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.dict-level-chip:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.dict-level-chip.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
}

.dict-level-chip .level-icon { font-size: 0.85rem; }
.dict-level-chip .level-num { font-weight: 800; }
.dict-level-chip .level-star { font-size: 0.85rem; line-height: 1; }

/* ⭐ V5: STAR CHIP modifier */
.dict-level-chip.dict-star-chip {
    background: var(--bg-primary);
    border-color: var(--border);
    color: var(--text-secondary);
    gap: 0.25rem;
}

.dict-level-chip.dict-star-chip:hover {
    border-color: #fbbf24;
    background: rgba(251, 191, 36, 0.08);
    color: var(--text-primary);
}

.dict-level-chip.dict-star-chip.active {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: white;
    border-color: #f59e0b;
    box-shadow: 0 3px 12px rgba(245, 158, 11, 0.4);
}

.dict-level-chip.dict-star-chip .level-star { color: #fbbf24; }
.dict-level-chip.dict-star-chip.active .level-star { color: white; }
.dict-level-chip.dict-star-chip .level-num { font-weight: 800; font-size: 0.85rem; }

/* ============================================================ */
/* ⭐ V6: DISTRACTOR CHIP (5 màu: xanh lá → tím)                 */
/* ============================================================ */

.dict-distractor-chip {
    background: var(--bg-primary);
    border: 2px solid var(--border);
    color: var(--text-secondary);
    padding: 0.5rem 0.9rem;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.dict-distractor-chip .dist-icon { font-size: 0.85rem; line-height: 1; }
.dict-distractor-chip .dist-num { font-weight: 800; font-size: 0.82rem; }

/* Hover — nhẹ nhàng đổi màu */
.dict-distractor-chip:hover {
    transform: translateY(-1px);
    color: var(--text-primary);
    border-color: #a78bfa;
    background: rgba(139, 92, 246, 0.08);
}

/* Level 1 — Khác biệt — Xanh lá */
.dict-distractor-chip[data-level="1"].active {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    border-color: #22c55e;
    box-shadow: 0 3px 12px rgba(34, 197, 94, 0.4);
}
.dict-distractor-chip[data-level="1"].active .dist-icon { color: white; }

/* Level 2 — Cùng loại — Xanh dương */
.dict-distractor-chip[data-level="2"].active {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border-color: #3b82f6;
    box-shadow: 0 3px 12px rgba(59, 130, 246, 0.4);
}
.dict-distractor-chip[data-level="2"].active .dist-icon { color: white; }

/* Level 3 — Gần âm — Cam */
.dict-distractor-chip[data-level="3"].active {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border-color: #f59e0b;
    box-shadow: 0 3px 12px rgba(245, 158, 11, 0.4);
}
.dict-distractor-chip[data-level="3"].active .dist-icon { color: white; }

/* Level 4 — Rất gần âm — Đỏ */
.dict-distractor-chip[data-level="4"].active {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border-color: #ef4444;
    box-shadow: 0 3px 12px rgba(239, 68, 68, 0.4);
}
.dict-distractor-chip[data-level="4"].active .dist-icon { color: white; }

/* Level 5 — Cực gần âm — Tím */
.dict-distractor-chip[data-level="5"].active {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: white;
    border-color: #a855f7;
    box-shadow: 0 3px 12px rgba(168, 85, 247, 0.4);
}
.dict-distractor-chip[data-level="5"].active .dist-icon { color: white; }

/* ============================================================ */
/* ===== DROPDOWN TRONG EDIT MODAL ===== */
/* ============================================================ */

#dictEditStars,
#dictEditLevel,
#dictEditDistractorLevel {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.7rem 1rem;
    border-radius: 14px;
    outline: none;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

#dictEditStars:focus,
#dictEditLevel:focus,
#dictEditDistractorLevel:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

#dictEditStars option,
#dictEditLevel option,
#dictEditDistractorLevel option {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 0.5rem;
}

/* ============================================================ */
/* ===== RESPONSIVE ===== */
/* ============================================================ */

@media (max-width: 768px) {
    .dict-container {
        padding: 1.2rem;
        border-radius: 20px;
    }

    .dict-audio-btn { width: 84px; height: 84px; font-size: 2rem; }

    .dict-sentence-wrap { padding: 1rem 1.1rem; min-height: 80px; }
    .dict-sentence { font-size: 1.2rem; }
    .dict-blank { min-width: 90px; }

    .dict-input-area { gap: 0.4rem; }
    .dict-input { padding: 0.7rem 1rem; font-size: 1rem; border-radius: 14px; }
    .dict-check-btn { padding: 0.7rem 1.2rem; font-size: 0.85rem; border-radius: 14px; }

    .dict-hint-options { grid-template-columns: 1fr; }
    .dict-hint-option { padding: 0.6rem 0.9rem; font-size: 0.9rem; }

    .dict-answer-reveal { padding: 0.85rem 1rem; }
    .dict-answer-row { font-size: 0.85rem; gap: 0.4rem; }
    .dict-answer-label { min-width: 75px; font-size: 0.7rem; }

    .dict-actions .ctrl-btn { min-width: 120px; font-size: 0.8rem; padding: 0.55rem 1rem; }

    .dict-header { gap: 0.4rem; }
    .dict-set-name { font-size: 0.82rem; }
    .dict-counter { font-size: 0.7rem; padding: 0.15rem 0.55rem; }

    /* Badge tablet */
    .dict-level-badge { font-size: 0.68rem; padding: 0.15rem 0.5rem; }
    .dict-star-badge { font-size: 0.66rem; padding: 0.15rem 0.5rem; }
    .dict-star-badge .star-filled,
    .dict-star-badge .star-empty { font-size: 0.68rem; }
    .dict-star-badge .star-label { font-size: 0.62rem; }
    .dict-distractor-tag { font-size: 0.58rem; padding: 0.03rem 0.35rem; margin-left: 0.25rem; }

    .dict-header-right { gap: 0.4rem; }

    .dict-prompt-box,
    .dict-import-wrap { padding: 1rem; border-radius: 16px; }
    .dict-prompt-title,
    .dict-import-title { font-size: 0.88rem; }
    .dict-prompt-desc,
    .dict-import-desc { font-size: 0.74rem; }

    /* Chip tablet */
    .dict-level-box,
    .dict-distractor-box {
        padding: 0.9rem 1rem;
        border-radius: 14px;
    }
    .dict-distractor-box { margin-bottom: 1.2rem; }
    .dict-level-title { font-size: 0.82rem; }
    .dict-level-desc { font-size: 0.7rem; }
    .dict-level-chip,
    .dict-distractor-chip { font-size: 0.74rem; padding: 0.45rem 0.8rem; }
}

@media (max-width: 480px) {
    .dict-container { padding: 1rem; border-radius: 16px; }

    .dict-audio-btn { width: 72px; height: 72px; font-size: 1.8rem; }
    .dict-audio-hint { font-size: 0.7rem; }

    .dict-sentence-wrap { padding: 0.85rem 0.9rem; border-radius: 14px; }
    .dict-sentence { font-size: 1.05rem; }
    .dict-blank { min-width: 70px; margin: 0 0.2rem; padding: 0 0.3rem; border-bottom-width: 2px; }
    .dict-vi-hint { font-size: 0.75rem; }

    .dict-input { padding: 0.6rem 0.85rem; font-size: 1rem; }
    .dict-check-btn { padding: 0.6rem 1rem; font-size: 0.8rem; }

    .dict-hint-btn { font-size: 0.78rem; padding: 0.4rem 1.1rem; }
    .dict-hint-panel { padding: 0.8rem; }
    .dict-hint-title { font-size: 0.74rem; }
    .dict-hint-option { font-size: 0.85rem; padding: 0.55rem 0.8rem; }

    .dict-answer-row { font-size: 0.8rem; }
    .dict-answer-value .ipa { font-size: 0.8rem; }
    .dict-full-sentence-btn { font-size: 0.78rem; padding: 0.55rem 0.9rem; }

    .dict-actions { flex-direction: column; }
    .dict-actions .ctrl-btn { width: 100%; min-width: 0; }

    .dict-empty-icon { font-size: 2.5rem; }
    .dict-empty p { font-size: 0.82rem; }

    /* Sửa/Xóa mobile */
    #dictQuestionListContainer .card-item > div:last-child {
        width: 100%;
        margin-top: 0.6rem;
        justify-content: flex-start;
    }
    .edit-dict-question-btn { margin-right: 0.4rem; }
    .edit-dict-question-btn,
    .delete-dict-question-btn { font-size: 0.72rem; padding: 0.35rem 0.9rem; }

    /* Chip mobile */
    .dict-level-box,
    .dict-distractor-box {
        padding: 0.8rem 0.9rem;
        border-radius: 12px;
        margin-bottom: 1.2rem;
    }
    .dict-level-title { font-size: 0.78rem; }
    .dict-level-desc { font-size: 0.66rem; margin-bottom: 0.6rem; }
    .dict-level-chips { gap: 0.3rem; }
    .dict-level-chip,
    .dict-distractor-chip { font-size: 0.7rem; padding: 0.4rem 0.7rem; gap: 0.2rem; }
    .dict-level-chip .level-icon,
    .dict-distractor-chip .dist-icon { font-size: 0.78rem; }

    /* Badge mobile */
    .dict-level-badge { font-size: 0.62rem; padding: 0.12rem 0.45rem; gap: 0.15rem; }
    .dict-star-badge { font-size: 0.6rem; padding: 0.12rem 0.45rem; gap: 0.1rem; }
    .dict-star-badge .star-filled,
    .dict-star-badge .star-empty { font-size: 0.62rem; }
    .dict-star-badge .star-label { font-size: 0.58rem; margin-left: 0.15rem; }
    .dict-distractor-tag { font-size: 0.55rem; padding: 0.02rem 0.3rem; margin-left: 0.2rem; }

    .dict-header-right { gap: 0.3rem; }

    /* Dropdown mobile */
    #dictEditStars,
    #dictEditLevel,
    #dictEditDistractorLevel {
        font-size: 1rem;
        padding: 0.6rem 0.85rem;
        padding-right: 2.2rem;
        background-position: right 0.75rem center;
    }
}

/* ============================================================ */
/* ===== END FILE ===== */
/* ============================================================ */