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

/* ── Login Screen ─────────────────────────────────────────────── */
.login-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #c8e6c9 0%, #81c784 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 24px;
    padding: 40px 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    text-align: center;
}

.login-logo { font-size: 52px; margin-bottom: 8px; }
.login-title { font-size: 22px; font-weight: 800; color: #2d3748; margin-bottom: 4px; }
.login-subtitle { font-size: 13px; color: #888; margin-bottom: 24px; }

.login-tabs {
    display: flex;
    gap: 4px;
    background: #f0f0f0;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
}

.login-tab {
    flex: 1;
    padding: 8px;
    border: none;
    background: transparent;
    border-radius: 9px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #888;
    transition: all 0.2s;
}

.login-tab.active {
    background: white;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.login-field {
    text-align: left;
    margin-bottom: 14px;
}

.login-field label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #555;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-field input,
.login-field select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.login-field input:focus,
.login-field select:focus {
    border-color: #4caf50;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4caf50, #43a047);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.login-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(76,175,80,0.5); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.login-error {
    background: #ffeaea;
    color: #c0392b;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    margin-bottom: 10px;
    text-align: left;
}

.login-admin-link {
    margin-top: 20px;
    font-size: 13px;
}

.login-admin-link a {
    color: #888;
    text-decoration: none;
}

.login-admin-link a:hover { color: #555; text-decoration: underline; }

/* ── Top bar (replaces old user-selector) ─────────────────────── */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.user-info-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c5a 100%);
    padding: 10px 16px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(255,107,53,0.4);
    border: 2px solid white;
    flex-wrap: wrap;
}

.user-info-name {
    font-weight: 700;
    color: white;
    font-size: 15px;
}

.user-info-level {
    background: rgba(255,255,255,0.3);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.logout-btn {
    background: white;
    color: #ff6b35;
    border: none;
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover { background: #ffe8e0; }

.icon-btn-top {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: white;
    color: #ff6b35;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn-top:hover { transform: scale(1.1); }

/* ── Scan button ──────────────────────────────────────────────── */
.scan-btn {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(155,89,182,0.4);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scan-btn:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(155,89,182,0.5); }

/* ── OCR Modal ────────────────────────────────────────────────── */
.ocr-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 3px dashed #9b59b6;
    border-radius: 16px;
    padding: 40px 20px;
    cursor: pointer;
    background: #faf5ff;
    transition: all 0.2s;
    margin: 12px 0;
}

.ocr-upload-area:hover { background: #f3e8ff; border-color: #7d3c98; }
.ocr-upload-icon { font-size: 48px; margin-bottom: 12px; }
.ocr-upload-text { font-size: 16px; font-weight: 700; color: #7d3c98; margin-bottom: 4px; }
.ocr-upload-sub { font-size: 13px; color: #a87fc9; }

.ocr-preview-img {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 12px;
    border: 2px solid #e8e8e8;
    margin-bottom: 16px;
}

.ocr-progress-container { text-align: center; }

.ocr-progress-bar-outer {
    width: 100%;
    height: 12px;
    background: #eee;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.ocr-progress-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, #9b59b6, #e91e63);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s;
}

.ocr-status { font-size: 14px; color: #666; font-weight: 600; }

.ocr-words-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 12px;
    border: 1px solid #e8e8e8;
    margin-bottom: 12px;
}

.ocr-word-chip {
    background: white;
    border: 2px solid #ddd;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    color: #333;
}

.ocr-word-chip:hover { border-color: #9b59b6; background: #faf5ff; }

.ocr-word-chip.selected {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    border-color: #9b59b6;
    box-shadow: 0 2px 8px rgba(155,89,182,0.4);
}

.ocr-selected-bar {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    background: #faf5ff;
    border-radius: 10px;
    border: 1px solid #d7a8f0;
    margin-bottom: 10px;
    font-size: 13px;
}

.ocr-selected-label {
    font-weight: 700;
    color: #7d3c98;
    white-space: nowrap;
}

#ocr-selected-preview { color: #555; word-break: break-all; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: background 0.3s ease;
}

/* ═══════════════════════════════════════════════════════════════
   THEMES
═══════════════════════════════════════════════════════════════ */

/* ── 🌸 Cartoon ─────────────────────────────────────────────── */
body.cartoon {
    background:
        radial-gradient(circle at 20% 20%, rgba(255,200,200,0.4) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(200,230,255,0.4) 0%, transparent 40%),
        linear-gradient(135deg, #ffecd2 0%, #fcb69f 40%, #a1c4fd 100%);
}
body.cartoon .card {
    background: rgba(255,255,255,0.92);
    border: 3px solid #ffb3c1;
    border-radius: 32px;
    box-shadow: 0 12px 40px rgba(255,130,170,0.2), 8px 8px 0 #ffd6e0;
}
body.cartoon .control-btn {
    background: linear-gradient(135deg, #ff9a9e, #fad0c4);
    border: 2px solid #ffb3c1;
    color: #8B3a3a;
    border-radius: 20px;
    box-shadow: 0 4px 0 #e8a0a8;
}
body.cartoon .control-btn:hover { transform: translateY(-3px); box-shadow: 0 7px 0 #e8a0a8; }
body.cartoon .control-btn.active { background: linear-gradient(135deg, #ff6b6b, #ff8e8e); }
body.cartoon .vocab-item { border-radius: 16px; border: 2px solid #ffd6e0; background: #fff5f7; }
body.cartoon h1 { color: #e91e8c; }
body.cartoon .stop-all-btn { background: linear-gradient(135deg, #ff6b6b, #ff4757); }

/* ── ⛏️ Minecraft ───────────────────────────────────────────── */
body.minecraft {
    background-color: #87CEEB;
    background-image:
        /* Clouds */
        radial-gradient(ellipse 60px 30px at 15% 15%, rgba(255,255,255,0.9) 0%, transparent 100%),
        radial-gradient(ellipse 40px 20px at 20% 13%, rgba(255,255,255,0.9) 0%, transparent 100%),
        radial-gradient(ellipse 70px 35px at 65% 10%, rgba(255,255,255,0.9) 0%, transparent 100%),
        radial-gradient(ellipse 45px 22px at 70% 8%, rgba(255,255,255,0.9) 0%, transparent 100%),
        /* Grass strip at bottom */
        linear-gradient(to bottom, transparent 70%, #5D9E31 70%, #5D9E31 80%, #8B6340 80%);
    font-family: 'Courier New', 'Lucida Console', monospace;
    image-rendering: pixelated;
}
body.minecraft .card {
    background: #C6C6C6;
    border: 4px solid #555;
    border-radius: 0;
    box-shadow: inset -3px -3px 0 #555, inset 3px 3px 0 #fff, 6px 6px 0 rgba(0,0,0,0.3);
}
body.minecraft h1 { color: #3d1f00; text-shadow: 2px 2px 0 #fff, 3px 3px 0 #555; font-size: 22px; letter-spacing: 2px; }
body.minecraft .control-btn {
    background: #5D9E31;
    border: 3px solid #333;
    border-radius: 0;
    color: white;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    box-shadow: inset -2px -2px 0 #2d5a1b, inset 2px 2px 0 #8BC34A, 3px 3px 0 rgba(0,0,0,0.4);
    text-shadow: 1px 1px 0 #1a3a0a;
}
body.minecraft .control-btn:hover { background: #4a8a28; transform: translate(2px,2px); box-shadow: inset -2px -2px 0 #1a4a10, inset 2px 2px 0 #6aab3a, 1px 1px 0 rgba(0,0,0,0.4); }
body.minecraft .control-btn.active { background: #c0392b; box-shadow: inset -2px -2px 0 #7b241c, inset 2px 2px 0 #e74c3c; }
body.minecraft .vocab-item { border: 2px solid #555; border-radius: 0; background: #D4D4D4; box-shadow: inset 1px 1px 0 #eee, inset -1px -1px 0 #888; }
body.minecraft .stop-all-btn { background: #c0392b; border: 3px solid #333; border-radius: 0; box-shadow: inset -2px -2px 0 #7b241c, inset 2px 2px 0 #e74c3c; }
body.minecraft .settings-section { background: #B8B8B8; border: 2px solid #555; border-radius: 0; }
body.minecraft input, body.minecraft select { border-radius: 0 !important; border: 2px solid #555 !important; }
body.minecraft .vocab-word { font-family: 'Courier New', monospace; font-weight: bold; }
body.minecraft .subtitle { color: #3d1f00; }

/* ── 💗 K-pop ───────────────────────────────────────────────── */
body.kpop {
    background:
        radial-gradient(circle at 10% 90%, rgba(255,105,180,0.3) 0%, transparent 50%),
        radial-gradient(circle at 90% 10%, rgba(180,100,255,0.3) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255,200,230,0.2) 0%, transparent 70%),
        linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    position: relative;
}
body.kpop::before {
    content: '✦ ★ ✦ ✧ ★ ✦ ✧ ★ ✦ ★ ✧ ✦ ★ ✦ ✧ ★ ✦ ✧ ★ ✦';
    position: fixed;
    top: 5%;
    left: 0; right: 0;
    text-align: center;
    font-size: 18px;
    color: rgba(255,180,220,0.25);
    letter-spacing: 12px;
    pointer-events: none;
    z-index: 0;
}
body.kpop .card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,150,200,0.4);
    border-radius: 24px;
    backdrop-filter: blur(20px);
    box-shadow: 0 0 40px rgba(255,100,180,0.2), 0 0 80px rgba(150,50,255,0.1), inset 0 1px 0 rgba(255,255,255,0.1);
    color: #ffe;
}
body.kpop h1 { color: #ff79c6; text-shadow: 0 0 20px rgba(255,121,198,0.8); font-size: 26px; letter-spacing: 3px; }
body.kpop .subtitle, body.kpop p, body.kpop label, body.kpop small { color: #ccc; }
body.kpop .control-btn {
    background: linear-gradient(135deg, #ff007f, #9b00d3);
    border: 1px solid rgba(255,120,200,0.5);
    border-radius: 25px;
    color: white;
    box-shadow: 0 4px 15px rgba(255,0,127,0.4), 0 0 20px rgba(155,0,211,0.3);
    text-shadow: 0 0 8px rgba(255,255,255,0.5);
}
body.kpop .control-btn:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 8px 25px rgba(255,0,127,0.6), 0 0 30px rgba(155,0,211,0.5); }
body.kpop .control-btn.active { background: linear-gradient(135deg, #ff4500, #ff0099); animation: kpop-pulse 1s infinite alternate; }
@keyframes kpop-pulse { from { box-shadow: 0 4px 15px rgba(255,0,127,0.4); } to { box-shadow: 0 4px 30px rgba(255,0,127,0.9), 0 0 40px rgba(255,0,200,0.6); } }
body.kpop .vocab-item { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,120,200,0.3); border-radius: 12px; color: #fff; }
body.kpop .vocab-word { color: #fff; }
body.kpop .stop-all-btn { background: linear-gradient(135deg, #ff0055, #9b0099); box-shadow: 0 4px 20px rgba(255,0,85,0.5); }
body.kpop .settings-section { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,120,200,0.2); border-radius: 16px; }
body.kpop input, body.kpop select { background: rgba(255,255,255,0.1) !important; color: white !important; border-color: rgba(255,120,200,0.4) !important; }
body.kpop .word-number { color: #ff79c6; }
body.kpop .lang-badge.chinese { background: linear-gradient(135deg, #ff007f, #9b00d3); }
body.kpop .lang-badge.english { background: linear-gradient(135deg, #00b4ff, #0055ff); }

/* ── 🗡️ Demon Slayer 鬼滅 ───────────────────────────────────── */
body.demon {
    background:
        radial-gradient(ellipse at 50% 100%, rgba(180,0,0,0.4) 0%, transparent 60%),
        radial-gradient(ellipse at 20% 80%, rgba(255,140,0,0.15) 0%, transparent 40%),
        radial-gradient(ellipse at 80% 80%, rgba(255,140,0,0.15) 0%, transparent 40%),
        linear-gradient(180deg, #0a0010 0%, #1a0020 40%, #2d0010 100%);
    position: relative;
}
body.demon::after {
    content: '';
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 120px;
    background: linear-gradient(to top,
        rgba(200,0,0,0.5) 0%,
        rgba(255,80,0,0.3) 40%,
        transparent 100%);
    pointer-events: none;
    z-index: 0;
}
body.demon .card {
    background: rgba(15, 5, 25, 0.88);
    border: 1px solid rgba(200, 0, 50, 0.6);
    border-radius: 4px;
    box-shadow:
        0 0 0 1px rgba(255,100,0,0.2),
        0 20px 60px rgba(180,0,0,0.4),
        inset 0 1px 0 rgba(255,200,100,0.1);
    color: #f0e0c0;
    position: relative;
    z-index: 1;
}
body.demon h1 {
    color: #ff2244;
    text-shadow: 0 0 10px rgba(255,34,68,0.8), 0 0 30px rgba(255,0,0,0.4);
    font-size: 26px;
    letter-spacing: 4px;
}
body.demon .subtitle, body.demon p, body.demon small { color: #c8a880; }
body.demon label { color: #c8a880; }
body.demon .control-btn {
    background: linear-gradient(135deg, #8b0000, #c0392b);
    border: 1px solid rgba(255,100,50,0.6);
    border-radius: 4px;
    color: #ffd700;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(180,0,0,0.5), inset 0 1px 0 rgba(255,200,100,0.2);
    text-shadow: 0 0 8px rgba(255,215,0,0.6);
}
body.demon .control-btn:hover { background: linear-gradient(135deg, #a00000, #e74c3c); transform: translateY(-2px); box-shadow: 0 6px 25px rgba(200,0,0,0.7), 0 0 15px rgba(255,50,0,0.4); }
body.demon .control-btn.active { background: linear-gradient(135deg, #ff2244, #ff6600); animation: demon-flicker 0.8s infinite alternate; }
@keyframes demon-flicker { from { box-shadow: 0 4px 15px rgba(255,0,0,0.6); } to { box-shadow: 0 4px 30px rgba(255,100,0,0.9), 0 0 50px rgba(255,0,0,0.5); } }
body.demon .vocab-item { background: rgba(30,5,10,0.7); border: 1px solid rgba(200,0,50,0.4); border-radius: 4px; color: #f0e0c0; }
body.demon .vocab-word { color: #ffd700; font-weight: 600; }
body.demon .word-number { color: #ff4466; }
body.demon .stop-all-btn { background: linear-gradient(135deg, #4a0000, #8b0000); border: 1px solid #c0392b; color: #ffd700; box-shadow: 0 4px 20px rgba(180,0,0,0.6); }
body.demon .settings-section { background: rgba(20,5,15,0.6); border: 1px solid rgba(200,0,50,0.3); border-radius: 4px; }
body.demon input, body.demon select { background: rgba(20,5,15,0.8) !important; color: #f0e0c0 !important; border-color: rgba(200,0,50,0.4) !important; }
body.demon .lang-badge.chinese { background: linear-gradient(135deg, #8b0000, #c0392b); color: #ffd700; }
body.demon .lang-badge.english { background: linear-gradient(135deg, #1a3a6e, #2471a3); color: #ffd700; }
body.demon .saved-list-card { background: rgba(30,5,10,0.7); border: 1px solid rgba(200,0,50,0.4); }
body.demon .icon-btn { background: rgba(30,5,10,0.8); color: #ffd700; border: 1px solid rgba(200,0,50,0.3); }
body.demon .icon-btn:hover { background: rgba(139,0,0,0.6); }

/* ── btn-zh (Chinese subtitle on buttons) ───────────────────── */
.btn-zh {
    display: block;
    font-size: 10px;
    font-weight: 500;
    opacity: 0.8;
    letter-spacing: 0.5px;
    margin-top: 1px;
}

.container {
    width: 100%;
    max-width: 800px;
    position: relative;
}

.user-selector {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c5a 100%);
    padding: 10px 20px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
    border: 2px solid white;
    z-index: 10;
}

.user-selector label {
    font-size: 14px;
    color: white;
    font-weight: 600;
}

.user-selector select {
    border: none;
    background: white;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    outline: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    min-width: 150px;
}

.user-selector select:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.user-selector select:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5);
}

.user-selector button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: white;
    color: #ff6b35;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-selector button:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

#admin-btn {
    font-size: 16px;
    line-height: 1;
}

.theme-selector {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #008751 0%, #00a862 100%);
    padding: 10px 20px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0, 133, 81, 0.4);
    border: 2px solid white;
    z-index: 10;
}

.theme-selector label {
    font-size: 14px;
    color: white;
    font-weight: 600;
}

.theme-selector select {
    border: none;
    background: white;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    outline: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.theme-selector select:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.theme-selector select:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5);
}

.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

h1 {
    color: #008751;
    font-size: 32px;
    text-align: center;
    margin-bottom: 15px;
    margin-top: 50px;
    font-weight: 700;
}

.subtitle {
    text-align: center;
    color: #999;
    font-size: 14px;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* Settings Section */
.settings-section {
    margin-bottom: 30px;
}

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

.setting-group label {
    display: block;
    color: #008751;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.setting-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #f8f9fa;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.setting-group select:hover {
    border-color: #008751;
}

.setting-group select:focus {
    outline: none;
    border-color: #008751;
    background: white;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff6b35;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff6b35;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.slider-value {
    min-width: 45px;
    text-align: right;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.checkbox-label:hover {
    background: #e9ecef;
    border-color: #008751;
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
    width: 20px;
    height: 20px;
    accent-color: #008751;
}

.checkbox-label span {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

/* Speech Mode Toggle */
.speech-mode-toggle {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.mode-btn {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    color: #666;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    border-color: #008751;
    background: #f0f8f4;
}

.mode-btn.active {
    border-color: #008751;
    background: #008751;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 133, 81, 0.3);
}

.mode-description {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* Vocabulary Section */
.vocabulary-section {
    margin-bottom: 20px;
    min-height: 100px;
}

.vocab-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.vocab-item:hover {
    background: #e9ecef;
}

.word-number {
    font-size: 16px;
    font-weight: 700;
    color: #008751;
    min-width: 30px;
    text-align: center;
    background: white;
    padding: 6px 10px;
    border-radius: 8px;
    border: 2px solid #008751;
}

.vocab-word-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vocab-word {
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

.vocab-word.hidden {
    color: transparent;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
    user-select: none;
}

/* Batch delete bar */
.batch-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    margin-bottom: 8px;
    border: 1px solid rgba(0,0,0,0.1);
}

.select-all-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.select-all-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.batch-delete-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.batch-delete-btn:hover {
    background: #c0392b;
}

.vocab-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

/* Speaking timer */
.speaking-timer-container {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    padding: 8px 20px;
    background: linear-gradient(135deg, #ff6b35, #ff8c5a);
    color: white;
    border-radius: 20px;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 12px;
    box-shadow: 0 3px 10px rgba(255,107,53,0.4);
    animation: pulse-timer 1s infinite alternate;
}

.speaking-timer-display {
    font-family: monospace;
    font-size: 20px;
    letter-spacing: 2px;
}

@keyframes pulse-timer {
    from { box-shadow: 0 3px 10px rgba(255,107,53,0.4); }
    to { box-shadow: 0 3px 18px rgba(255,107,53,0.7); }
}

.lang-badge {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.lang-badge.english {
    background: #e3f2fd;
    color: #1976d2;
}

.lang-badge.chinese {
    background: #fff3e0;
    color: #f57c00;
}

.vocab-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #ff6b35;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.icon-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

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

.icon-btn.delete-btn {
    background: #ff6b6b;
}

.icon-btn.edit-btn {
    background: #008751;
}

.icon-btn.pause-btn {
    background: #ffa500;
}

.icon-btn.pause-btn.paused {
    background: #4CAF50;
}

/* Add Buttons Container */
.add-buttons-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 20px 0 15px 0;
}

.add-btn {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: #ff6b35;
    color: white;
    font-size: 32px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
    transition: all 0.3s ease;
}

.add-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.6);
}

.add-btn:active {
    transform: scale(0.95);
}

.import-text-btn {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: #008751;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 133, 81, 0.4);
    transition: all 0.3s ease;
}

.import-text-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 133, 81, 0.6);
}

.import-text-btn:active {
    transform: scale(0.95);
}

/* Current List Indicator */
.current-list-indicator {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #008751;
    border-radius: 15px;
    padding: 15px 20px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0, 133, 81, 0.1);
    animation: slideDown 0.3s ease-out;
}

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

.current-list-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.current-list-icon {
    font-size: 24px;
}

.current-list-label {
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

.current-list-name {
    font-size: 16px;
    color: #008751;
    font-weight: 700;
    background: white;
    padding: 5px 15px;
    border-radius: 10px;
    border: 1px solid #008751;
}

.auto-save-badge {
    font-size: 12px;
    color: #666;
    font-weight: 600;
    background: #e8f5e9;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid #4caf50;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.current-list-actions {
    display: flex;
    gap: 8px;
}

.btn-update {
    background: #008751;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 133, 81, 0.2);
}

.btn-update:hover {
    background: #006a3f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 133, 81, 0.3);
}

.btn-clear {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(255, 107, 107, 0.2);
}

.btn-clear:hover {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 107, 107, 0.3);
}

/* Stop All Button */
.stop-all-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.stop-all-btn {
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 68, 68, 0.4);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stop-all-btn:hover {
    background: linear-gradient(135deg, #ff5555 0%, #dd0000 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 68, 68, 0.6);
}

.stop-all-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(255, 68, 68, 0.4);
}

.stop-all-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Control Buttons */
.controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 30px 0;
}

.control-btn {
    padding: 15px 10px;
    border: none;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.7);
    color: #666;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70px;
}

.control-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

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

.control-btn.active {
    background: #008751;
    color: white;
}

/* Saved Lists Section */
.saved-lists-section {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px solid #e9ecef;
}

.saved-lists-section h3 {
    color: #008751;
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: 600;
}

.saved-lists-display {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 25px;
}

.footer a {
    color: #008751;
    text-decoration: underline;
    font-size: 13px;
    font-weight: 500;
}

.footer a:hover {
    color: #006a3f;
}

.copyright {
    margin-top: 8px;
    color: #999;
    font-size: 11px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
}

.modal-content.modal-large {
    max-width: 850px;
}

.modal-content h2 {
    color: #008751;
    font-size: 22px;
    margin-bottom: 15px;
}

.modal-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.modal-hint {
    color: #999;
    font-size: 13px;
    margin-top: 10px;
}

.modal-hint code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    color: #008751;
    font-weight: 600;
}

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

.form-group label {
    display: block;
    color: #008751;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
}

.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    background: white;
    transition: border-color 0.3s ease;
}

.form-group select:focus {
    outline: none;
    border-color: #008751;
}

.modal-content input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    margin-bottom: 20px;
    transition: border-color 0.3s ease;
}

.modal-content input:focus {
    outline: none;
    border-color: #008751;
}

.modal-content textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    margin-bottom: 20px;
    transition: border-color 0.3s ease;
    resize: vertical;
    line-height: 1.6;
}

.modal-content textarea:focus {
    outline: none;
    border-color: #008751;
}

.split-options {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
}

.split-options > label {
    display: block;
    color: #008751;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 10px;
}

.radio-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.radio-label:hover {
    border-color: #008751;
    background: #f0f9f4;
}

.radio-label input[type="radio"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.radio-label input[type="radio"]:checked + span {
    color: #008751;
    font-weight: 600;
}

.radio-label:has(input:checked) {
    border-color: #008751;
    background: #e8f5e9;
}

.radio-label span {
    font-size: 14px;
    color: #666;
}

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

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #008751;
    color: white;
}

.btn-primary:hover {
    background: #006a3f;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #e9ecef;
    color: #666;
}

.btn-secondary:hover {
    background: #dee2e6;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 10px;
}

.empty-state small {
    font-size: 13px;
    color: #bbb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .card {
        padding: 25px;
    }

    h1 {
        font-size: 26px;
        margin-top: 60px;
    }

    .controls {
        grid-template-columns: repeat(2, 1fr);
    }

    .saved-lists-display {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .user-selector {
        position: relative;
        top: 0;
        left: 0;
        margin-bottom: 15px;
        justify-content: center;
    }

    .theme-selector {
        position: relative;
        top: 0;
        right: 0;
        margin-bottom: 20px;
        justify-content: center;
    }

    .current-list-indicator {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .current-list-info {
        width: 100%;
    }

    .current-list-actions {
        width: 100%;
    }

    .current-list-actions button {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .controls {
        grid-template-columns: 1fr;
    }

    .stop-all-btn {
        font-size: 16px;
        padding: 12px 30px;
    }

    .saved-lists-display {
        grid-template-columns: 1fr;
    }

    .vocab-item {
        flex-wrap: wrap;
    }

    .vocab-word {
        width: 100%;
        margin-bottom: 8px;
    }
}

/* Animation for dictation mode */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

.vocab-item.speaking {
    animation: pulse 0.5s ease-in-out;
    background: #e8f5e9;
    border: 2px solid #008751;
}

/* Saved List Card */
.saved-list-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.saved-list-card:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #008751;
}

.saved-list-card-header {
    margin-bottom: 10px;
}

.saved-list-name {
    font-size: 15px;
    font-weight: 600;
    color: #008751;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saved-list-meta {
    font-size: 11px;
    color: #999;
}

.saved-list-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.saved-list-actions button {
    flex: 1;
    padding: 8px 10px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-saved-list-btn {
    background: #008751;
    color: white;
}

.load-saved-list-btn:hover {
    background: #006a3f;
}

.delete-saved-list-btn {
    background: #ff6b6b;
    color: white;
}

.delete-saved-list-btn:hover {
    background: #ff5252;
}

.empty-saved-lists {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px 20px;
    color: #999;
    background: #f8f9fa;
    border-radius: 12px;
}

.empty-saved-lists p {
    font-size: 14px;
    margin-bottom: 5px;
}

.empty-saved-lists small {
    font-size: 12px;
}

/* Admin Dashboard */
.admin-dashboard {
    max-height: 80vh;
    overflow-y: auto;
}

.admin-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.admin-students-list {
    max-height: 500px;
    overflow-y: auto;
}

.admin-student-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
}

.admin-student-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.admin-student-name {
    font-size: 18px;
    font-weight: 700;
    color: #008751;
}

.admin-student-level {
    background: #ff6b35;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.admin-student-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.admin-stat {
    background: white;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

.admin-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #008751;
}

.admin-stat-label {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}

.admin-student-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.admin-student-actions button {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-student-btn {
    background: #008751;
    color: white;
}

.view-student-btn:hover {
    background: #006a3f;
}

.delete-student-btn {
    background: #ff6b6b;
    color: white;
}

.delete-student-btn:hover {
    background: #ff5252;
}

