* {
    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: 4px; }
.login-version { font-size: 12px; color: #008751; font-weight: 700; margin-bottom: 20px; }

.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; }

/* ── Refresh Voices Button ────────────────────────────────────── */
.refresh-voices-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 0 4px;
    opacity: 0.6;
    vertical-align: middle;
    transition: opacity 0.2s, transform 0.3s;
}
.refresh-voices-btn:hover { opacity: 1; transform: rotate(180deg); }

/* ── Social Login ─────────────────────────────────────────────── */
.social-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 14px;
    color: #aaa;
    font-size: 13px;
}
.social-divider::before, .social-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}
.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 11px 16px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 10px;
    transition: opacity 0.2s, transform 0.1s;
}
.social-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.social-btn:active { transform: translateY(0); }
.google-btn { background: #fff; border: 2px solid #e0e0e0; color: #3c4043; }
.facebook-btn { background: #1877f2; color: #fff; }

/* ── 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; }
body.minecraft .setting-group label { color: #3d1f00; font-family: 'Courier New', monospace; }
body.minecraft .user-info-bar { background: linear-gradient(135deg, #5D9E31, #3d7a1f); border-color: #333; box-shadow: inset -2px -2px 0 #2d5a1b, 3px 3px 0 rgba(0,0,0,0.3); border-radius: 0; }
body.minecraft .theme-selector { background: linear-gradient(135deg, #C6C6C6, #B8B8B8); border: 3px solid #333; border-radius: 0; box-shadow: inset -2px -2px 0 #555, inset 2px 2px 0 #fff; }
body.minecraft .theme-selector label, body.minecraft .theme-selector select { color: #333; }
body.minecraft .word-number { font-family: 'Courier New', monospace; border-radius: 0; }
body.minecraft .icon-btn { border-radius: 0; border: 2px solid #555; }
body.minecraft .batch-bar { background: #B8B8B8; border: 2px solid #555; border-radius: 0; }

/* ── 💗 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 .setting-group label { color: #ff79c6; }
body.kpop .setting-group select, body.kpop .setting-group input { color: #fff; }
body.kpop .slider-value { color: #fff; }
body.kpop .mode-description { color: #aaa; }
body.kpop .user-info-bar { background: linear-gradient(135deg, #ff007f, #9b00d3); box-shadow: 0 4px 15px rgba(255,0,127,0.4); }
body.kpop .theme-selector { background: linear-gradient(135deg, #9b00d3, #5500aa); box-shadow: 0 4px 15px rgba(155,0,211,0.4); }
body.kpop .word-number { background: rgba(255,0,127,0.2); border-color: #ff79c6; }
body.kpop .icon-btn { background: rgba(255,255,255,0.08); color: #ff79c6; border: 1px solid rgba(255,120,200,0.3); }
body.kpop .icon-btn:hover { background: rgba(255,0,127,0.3); }
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 .setting-group label { color: #ffd700; }
body.demon .slider-value { color: #ffd700; }
body.demon .mode-description { color: #c8a880; }
body.demon .user-info-bar { background: linear-gradient(135deg, #6a0000, #8b0000); box-shadow: 0 4px 15px rgba(180,0,0,0.5); }
body.demon .theme-selector { background: linear-gradient(135deg, #1a0020, #2d0040); border-color: rgba(200,0,50,0.5); box-shadow: 0 4px 15px rgba(200,0,50,0.3); }
body.demon .word-number { background: rgba(139,0,0,0.4); border-color: rgba(200,0,50,0.6); }
body.demon .batch-bar { background: rgba(30,5,10,0.8); border: 1px solid rgba(200,0,50,0.3); }
body.demon .current-list-indicator { background: rgba(30,5,10,0.8); border-color: rgba(200,0,50,0.5); }
body.demon .current-list-label, body.demon .current-list-name { color: #ffd700; }
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: 22px 16px 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

h1 {
    color: #008751;
    font-size: 22px;
    text-align: center;
    margin-bottom: 12px;
    margin-top: 8px;
    font-weight: 700;
}

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

/* Settings Section */
.settings-collapsible {
    margin: 8px 0 18px;
    border: 1.5px solid #e0e0e0;
    border-radius: 16px;
    overflow: hidden;
    background: #fafafa;
}
.settings-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 700;
    color: #008751;
    cursor: pointer;
}
.settings-toggle-arrow {
    transition: transform 0.2s ease;
    font-size: 12px;
}
.settings-collapsible.is-collapsed .settings-toggle-arrow {
    transform: rotate(-90deg);
}
.settings-collapsible.is-collapsed .settings-section,
.settings-collapsible.is-collapsed .list-collapsible-body {
    display: none;
}
.settings-section,
.list-collapsible-body {
    margin: 0;
    padding: 4px 16px 16px;
}

.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;
}

/* Vocab hint bar */
.vocab-hint-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 4px 0 10px;
    flex-wrap: wrap;
}
.vocab-hint {
    font-size: 11px;
    color: #aaa;
    margin: 0;
    letter-spacing: 0.2px;
    flex: 1;
}
.clear-marks-btn {
    font-size: 11px;
    color: #999;
    background: none;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 3px 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.clear-marks-btn:hover { color: #e67e22; border-color: #e67e22; background: #fff8f0; }

body.kpop .vocab-hint { color: rgba(255,180,220,0.6); }
body.kpop .clear-marks-btn { color: rgba(255,120,200,0.5); border-color: rgba(255,120,200,0.3); }
body.kpop .clear-marks-btn:hover { color: #ff79c6; border-color: #ff79c6; background: rgba(255,0,127,0.1); }
body.demon .vocab-hint { color: rgba(200,168,128,0.6); }
body.demon .clear-marks-btn { color: rgba(255,215,0,0.4); border-color: rgba(200,0,50,0.3); background: transparent; }
body.demon .clear-marks-btn:hover { color: #ffd700; border-color: #c0392b; background: rgba(139,0,0,0.2); }
body.minecraft .vocab-hint { color: #555; font-family: 'Courier New', monospace; }
body.minecraft .clear-marks-btn { font-family: 'Courier New', monospace; border-radius: 0; border-color: #555; color: #555; }

/* Done / used word state */
.done-btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 50%;
    border: 2px solid #ddd;
    background: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    line-height: 1;
}
.done-btn:hover { border-color: #4caf50; color: #4caf50; background: #f1faf1; transform: scale(1.15); }
.done-btn.is-done {
    border-color: #4caf50;
    background: #4caf50;
    color: white;
}

.vocab-word-container { cursor: pointer; }
.vocab-word-container:hover .vocab-word { opacity: 0.75; }

.vocab-item.done {
    background: #f0faf0;
    border: 1.5px solid #a5d6a7;
    opacity: 0.8;
}
.vocab-item.done .vocab-word {
    text-decoration: line-through;
    color: #999;
}
.vocab-item.done .word-number {
    background: #a5d6a7;
    border-color: #4caf50;
    color: white;
}
/* Dark theme overrides for done state */
body.kpop .done-btn { background: rgba(255,255,255,0.05); border-color: rgba(255,120,200,0.3); color: rgba(255,120,200,0.4); }
body.kpop .done-btn:hover { border-color: #ff007f; color: #ff007f; background: rgba(255,0,127,0.1); }
body.kpop .done-btn.is-done { background: #ff007f; border-color: #ff007f; color: white; }
body.kpop .vocab-item.done { background: rgba(255,0,127,0.1); border-color: rgba(255,0,127,0.4); }
body.demon .done-btn { background: rgba(30,5,10,0.4); border-color: rgba(200,0,50,0.3); color: rgba(255,215,0,0.3); }
body.demon .done-btn:hover { border-color: #c0392b; color: #ffd700; }
body.demon .done-btn.is-done { background: #8b0000; border-color: #c0392b; color: #ffd700; }
body.demon .vocab-item.done { background: rgba(139,0,0,0.2); border-color: rgba(200,0,50,0.6); }
body.minecraft .done-btn { border-radius: 0; border: 2px solid #888; background: #D4D4D4; color: #aaa; }
body.minecraft .done-btn.is-done { background: #5D9E31; border-color: #333; color: white; }

/* 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;
}

.current-list-indicator.has-unsaved {
    border-color: #e67e22;
    background: linear-gradient(135deg, #fff8f0 0%, #fdebd0 100%);
    box-shadow: 0 2px 12px rgba(230, 126, 34, 0.25);
    animation: pulseUnsaved 2s ease-in-out infinite;
}

@keyframes pulseUnsaved {
    0%, 100% { box-shadow: 0 2px 12px rgba(230, 126, 34, 0.25); }
    50% { box-shadow: 0 4px 20px rgba(230, 126, 34, 0.5); }
}

.unsaved-badge {
    font-size: 12px;
    color: #e67e22;
    font-weight: 700;
    background: #fef3e2;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid #e67e22;
    animation: blinkBadge 1.5s ease-in-out infinite;
}

@keyframes blinkBadge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.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;
    position: relative;
    z-index: 2;
    pointer-events: auto;
}

.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(4, 1fr);
    gap: 12px;
    margin: 20px 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;
    position: relative;
    z-index: 2;
    pointer-events: auto;
}

.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: 0;
    font-weight: 600;
}

.saved-lists-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.saved-lists-import-btn {
    background: #008751;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 8px 14px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

.saved-lists-import-btn:hover { background: #006a3f; }

.saved-lists-hint {
    color: #666;
    font-size: 13px;
    margin-bottom: 14px;
    line-height: 1.4;
}

.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;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: flex-start;
    justify-content: center;
}

.modal.active {
    display: flex;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.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%;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

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

.import-modal-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.import-modal-content textarea {
    flex: 0 1 auto;
    max-height: 22vh;
    min-height: 72px;
    margin-bottom: 12px;
}

.import-modal-content:has(#import-sections-preview:not([hidden])) textarea {
    max-height: 16vh;
}

.import-modal-content .import-sections-preview {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    margin-bottom: 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.import-modal-content .modal-buttons {
    flex-shrink: 0;
    margin-top: 4px;
    padding-top: 12px;
    background: #fff;
}

.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;
}

.import-file-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.import-file-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e8f5e9;
    color: #2e7d32;
    border: 2px solid #a5d6a7;
    border-radius: 12px;
    padding: 8px 14px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

.import-file-btn:hover { background: #c8e6c9; }

.import-file-name {
    color: #666;
    font-size: 13px;
}

.import-sections-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    padding: 12px 14px;
    background: #e8f5e9;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #2e7d32;
    cursor: pointer;
}

.import-sections-toggle input {
    width: auto;
    margin: 0;
    accent-color: #008751;
}

.import-sections-preview {
    margin-bottom: 16px;
    max-height: min(50vh, 420px);
    overflow: auto;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 12px;
}

.import-sections-preview > p {
    margin: 0 0 10px;
    font-weight: 700;
    color: #008751;
    font-size: 13px;
}

.import-section-card {
    background: white;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #2d3748;
}

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

.import-section-words {
    color: #666;
    font-size: 13px;
    line-height: 1.45;
}

.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: 16px 10px 22px;
    }

    h1 {
        font-size: 22px;
        margin-top: 6px;
    }

    .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;
}


/* ── Flashcard carousel ──────────────────────────────────────── */
.list-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin: 8px 0 4px;
}
.list-section-title,
.flashcard-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #008751;
}
.list-section-sub {
    margin: 0 0 10px;
    font-size: 11px;
    color: #999;
}

.flashcard-section {
    margin: 4px 0 16px;
}

.sequence-bar {
    display: flex;
    gap: 8px;
    margin: 0 0 10px;
}
.sequence-btn {
    flex: 1;
    border: 2px solid #008751;
    background: #fff;
    color: #008751;
    font-weight: 700;
    font-size: 14px;
    border-radius: 16px;
    padding: 10px 8px;
    cursor: pointer;
    transition: transform 0.45s ease;
}
.sequence-btn .btn-zh {
    display: block;
    font-size: 11px;
    font-weight: 600;
    opacity: 0.8;
    margin-top: 1px;
}
.sequence-btn:hover { background: #e8f5e9; }
.flashcard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.flashcard-header-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-left: auto;
}

.flashcard-view-tabs {
    display: flex;
    gap: 4px;
    background: #f0f0f0;
    border-radius: 12px;
    padding: 4px;
    margin: 0 0 10px;
}

.flashcard-view-tab {
    flex: 1;
    padding: 8px 6px;
    border: none;
    background: transparent;
    border-radius: 9px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: #888;
}

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

.flashcard-section.is-table-view .flashcard-carousel-wrap,
.flashcard-section.is-table-view .flashcard-dots,
.flashcard-section.is-table-view .flashcard-spell {
    display: none;
}

.flashcard-section:not(.is-table-view) .flashcard-table {
    display: none !important;
}

.flashcard-table {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 4px;
}

@media (min-width: 560px) {
    .flashcard-table { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 840px) {
    .flashcard-table { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.flashcard-table-card {
    min-width: 0;
}

.flashcard-table-card .flashcard-inner,
.flashcard-table-card .flashcard-face {
    min-height: 118px;
    border-radius: 14px;
    padding: 18px 8px 10px;
    border-width: 2px;
    box-shadow: 0 4px 10px rgba(0, 133, 81, 0.12);
}

.flashcard-table-card .flashcard-number {
    top: 6px;
    left: 6px;
    min-width: 20px;
    font-size: 11px;
    padding: 1px 5px;
}

.flashcard-table-card .flashcard-lang {
    top: 6px;
    right: 6px;
    font-size: 9px;
    padding: 1px 5px;
}

.flashcard-table-card .flashcard-word {
    font-size: clamp(13px, 3.4vw, 20px);
    overflow-wrap: anywhere;
}

.flashcard-table-card .flashcard-hidden-mark {
    font-size: 28px;
}

.flashcard-table-card .flashcard-flip-btn {
    font-size: 12px;
    padding: 4px 8px;
    margin-top: 4px;
}

.flashcard-table-card.active .flashcard-face {
    box-shadow: 0 0 0 3px #008751;
}

.flashcard-table-card.speaking .flashcard-face {
    box-shadow: 0 0 0 3px #ff9800;
}

.saved-lists-search {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    margin-bottom: 10px;
}

.saved-lists-search:focus {
    outline: none;
    border-color: #008751;
}

.saved-lists-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.saved-list-chip {
    border: 2px solid #a5d6a7;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.saved-list-chip.active {
    background: #008751;
    border-color: #008751;
    color: #fff;
}

.saved-list-category {
    display: inline-block;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 6px;
}

.import-category-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #008751;
    margin: 0 0 6px;
}

.import-category-input {
    margin-bottom: 12px !important;
}
.flashcard-bulk-btn {
    border: 1.5px solid #008751;
    background: white;
    color: #008751;
    font-weight: 700;
    font-size: 12px;
    border-radius: 999px;
    padding: 6px 10px;
    cursor: pointer;
    white-space: nowrap;
}
.flashcard-bulk-btn:hover { background: #e8f5e9; }
.flashcard-counter {
    flex-shrink: 0;
    font-weight: 700;
    font-size: 13px;
    color: #008751;
    background: #e8f5e9;
    border: 2px solid #008751;
    border-radius: 999px;
    padding: 4px 10px;
}

.flashcard-carousel-wrap {
    position: relative;
}
.flashcard-nav {
    position: absolute;
    top: 42%;
    z-index: 3;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #008751;
    background: rgba(255,255,255,0.92);
    color: #008751;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 133, 81, 0.2);
}
.flashcard-nav#flashcard-prev { left: 2px; }
.flashcard-nav#flashcard-next { right: 2px; }
.flashcard-nav:disabled {
    opacity: 0.25;
    cursor: default;
}

.flashcard-track {
    position: relative;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    gap: 0;
    width: 100%;
    padding: 4px 0 2px;
    scrollbar-width: none;
    touch-action: pan-x;
    outline: none;
}
.flashcard-track::-webkit-scrollbar { display: none; }

.flashcard-slide {
    flex: 0 0 100%;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    transform-style: preserve-3d;
    perspective: 1200px;
    user-select: none;
    box-sizing: border-box;
    padding: 0 2px;
}
.flashcard-slide.active { opacity: 1; }

.flashcard-inner {
    display: grid;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    transition: transform 0.55s cubic-bezier(.4, .2, .2, 1);
    cursor: pointer;
    min-height: min(52vh, 460px);
}
.flashcard-inner.flipped {
    transform: rotateY(180deg);
}
.flashcard-face {
    grid-area: 1 / 1;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: rotateY(0deg);
    border-radius: 22px;
    padding: 28px 36px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: min(52vh, 460px);
    background: linear-gradient(180deg, #ffffff 0%, #f3faf4 100%);
    border: 3px solid #008751;
    box-shadow: 0 10px 28px rgba(0, 133, 81, 0.18);
    position: relative;
}
.flashcard-back {
    transform: rotateY(180deg);
    background: linear-gradient(180deg, #e8f5e9 0%, #c8e6c9 100%);
}
.flashcard-number {
    position: absolute;
    top: 12px;
    left: 12px;
    min-width: 32px;
    font-size: 16px;
    font-weight: 800;
    color: #008751;
    background: white;
    border: 2px solid #008751;
    border-radius: 10px;
    padding: 4px 8px;
    line-height: 1;
}
.flashcard-lang {
    position: absolute;
    top: 14px;
    right: 12px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    color: white;
}
.flashcard-lang.english { background: #1976d2; }
.flashcard-lang.chinese { background: #e53935; }
.flashcard-word {
    font-weight: 800;
    color: #1b5e20;
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
    width: 100%;
    margin-top: 8px;
    padding: 0 4px;
}
.flashcard-word.size-xl { font-size: clamp(40px, 12vw, 72px); }
.flashcard-word.size-lg { font-size: clamp(30px, 8vw, 52px); }
.flashcard-word.size-md { font-size: clamp(22px, 5.8vw, 38px); }
.flashcard-word.size-sm { font-size: clamp(18px, 4.6vw, 28px); }

.flashcard-syllables {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 12px;
    width: 100%;
}
.flashcard-syllable-label {
    width: 100%;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #2e7d32;
    opacity: 0.8;
}
.syllable-word {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 6px;
}
.syllable {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5em;
    padding: 6px 11px;
    border-radius: 14px;
    font-weight: 800;
    font-size: clamp(16px, 4.2vw, 26px);
    line-height: 1.2;
    border: 2px solid transparent;
}
.syllable.s1 { background: #e8f5e9; border-color: #81c784; color: #1b5e20; }
.syllable.s2 { background: #fff8e1; border-color: #ffcc80; color: #e65100; }
.syllable.s3 { background: #e3f2fd; border-color: #64b5f6; color: #0d47a1; }
.syllable-dot {
    color: #81c784;
    font-weight: 900;
    font-size: 18px;
    line-height: 1;
}
.syllable-gap {
    display: inline-block;
    width: 10px;
}
.flashcard-syllables.compact {
    margin-top: 6px;
    gap: 4px 6px;
}
.flashcard-syllables.compact .syllable {
    font-size: 11px;
    padding: 2px 5px;
    border-radius: 8px;
    border-width: 1px;
    min-width: 0;
}
.flashcard-syllables.compact .syllable-dot { font-size: 11px; }

.flashcard-table-card .flashcard-syllables { margin-top: 4px; }
.flashcard-hidden-mark {
    font-size: clamp(64px, 16vw, 96px);
    font-weight: 800;
    color: #008751;
    opacity: 0.4;
    line-height: 1;
}
.flashcard-flip-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    border: 2px solid #008751;
    background: white;
    color: #008751;
    font-weight: 700;
    font-size: 14px;
    border-radius: 999px;
    padding: 10px 12px;
    cursor: pointer;
}

.flashcard-dots {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.flashcard-spell {
    margin: 12px 4px 0;
}

.flashcard-spell-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 6px;
}

.flashcard-spell-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.flashcard-spell-input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
}

.flashcard-spell-input:focus {
    outline: none;
    border-color: #008751;
}

.flashcard-spell-btn {
    flex: 0 0 auto;
    background: #008751;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

.flashcard-spell-btn:hover { background: #006a3f; }

.flashcard-spell-result {
    min-height: 1.3em;
    margin: 8px 0 0;
    font-size: 14px;
    font-weight: 700;
}

.flashcard-spell-result.ok { color: #2e7d32; }
.flashcard-spell-result.bad { color: #c62828; }
.flashcard-spell-result.hint { color: #888; font-weight: 600; }

.flashcard-spell-input.is-ok { border-color: #2e7d32; background: #e8f5e9; }
.flashcard-spell-input.is-bad { border-color: #c62828; background: #ffebee; }

.flashcard-dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #cfd8dc;
    cursor: pointer;
}
.flashcard-dot.active {
    background: #008751;
    transform: scale(1.35);
}

.flashcard-slide.speaking .flashcard-face {
    animation: pulse 0.5s ease-in-out;
    box-shadow: 0 0 0 3px #81c784, 0 12px 28px rgba(0, 133, 81, 0.28);
}
.flashcard-slide.done .flashcard-face {
    border-color: #81c784;
}

body.cartoon .flashcard-title,
body.cartoon .list-section-title,
body.cartoon .flashcard-counter,
body.cartoon .settings-toggle { color: #e91e8c; }
body.cartoon .settings-collapsible { border-color: #ffd6e0; }
body.cartoon .flashcard-counter { background: #fff0f5; border-color: #ffb3c1; }
body.cartoon .flashcard-nav,
body.cartoon .flashcard-flip-btn,
body.cartoon .flashcard-bulk-btn,
body.cartoon .sequence-btn,
body.cartoon .flashcard-number { border-color: #ffb3c1; color: #e91e8c; }
body.cartoon .flashcard-face {
    border-color: #ffb3c1;
    background: linear-gradient(180deg, #fff 0%, #fff5f7 100%);
    border-radius: 28px;
    box-shadow: 0 10px 24px rgba(255, 130, 170, 0.25), 6px 6px 0 #ffd6e0;
}
body.cartoon .flashcard-back { background: linear-gradient(180deg, #fff0f5 0%, #ffd6e0 100%); }
body.cartoon .flashcard-word { color: #c2185b; }
body.cartoon .flashcard-syllable-label { color: #e91e8c; }
body.cartoon .syllable.s1 { background: #ffe4ec; border-color: #ffb3c1; color: #c2185b; }
body.cartoon .syllable.s2 { background: #fff3e0; border-color: #ffcc80; color: #e65100; }
body.cartoon .syllable.s3 { background: #f3e5f5; border-color: #ce93d8; color: #6a1b9a; }
body.cartoon .syllable-dot { color: #ff8aa0; }
body.cartoon .flashcard-hidden-mark { color: #ff8aa0; }
body.cartoon .flashcard-dot.active { background: #e91e8c; }

body.minecraft .flashcard-title,
body.minecraft .list-section-title,
body.minecraft .settings-toggle { font-family: 'Courier New', monospace; color: #3d1f00; }
body.minecraft .settings-collapsible { border-radius: 0; border: 2px solid #555; }
body.minecraft .flashcard-counter,
body.minecraft .flashcard-nav,
body.minecraft .flashcard-flip-btn,
body.minecraft .flashcard-bulk-btn,
body.minecraft .sequence-btn,
body.minecraft .flashcard-number {
    border-radius: 0;
    font-family: 'Courier New', monospace;
    border-color: #333;
    color: #3d1f00;
}
body.minecraft .flashcard-counter { background: #D4D4D4; }
body.minecraft .flashcard-face {
    border-radius: 0;
    border: 4px solid #555;
    background: #D4D4D4;
    box-shadow: inset -3px -3px 0 #555, inset 3px 3px 0 #fff, 4px 4px 0 rgba(0,0,0,0.3);
}
body.minecraft .flashcard-back { background: #5D9E31; }
body.minecraft .flashcard-back .flashcard-hidden-mark { color: #fff; }
body.minecraft .flashcard-word { font-family: 'Courier New', monospace; color: #1a3a0a; }
body.minecraft .syllable { border-radius: 0; font-family: 'Courier New', monospace; }
body.minecraft .flashcard-dot { border-radius: 0; }
body.minecraft .flashcard-dot.active { background: #5D9E31; }

body.kpop .flashcard-title,
body.kpop .list-section-title,
body.kpop .flashcard-counter,
body.kpop .settings-toggle { color: #ff79c6; }
body.kpop .settings-collapsible { border-color: rgba(255,120,200,0.35); background: rgba(255,255,255,0.05); }
body.kpop .list-section-sub { color: rgba(255,180,220,0.6); }
body.kpop .flashcard-counter { background: rgba(255,0,127,0.15); border-color: #ff79c6; }
body.kpop .flashcard-nav,
body.kpop .flashcard-flip-btn,
body.kpop .flashcard-bulk-btn,
body.kpop .sequence-btn {
    background: rgba(255,255,255,0.08);
    border-color: #ff79c6;
    color: #ff79c6;
}
body.kpop .flashcard-face {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,120,200,0.6);
    box-shadow: 0 0 24px rgba(255,0,127,0.25);
    color: #fff;
}
body.kpop .flashcard-back { background: rgba(255,0,127,0.18); }
body.kpop .flashcard-word { color: #fff; }
body.kpop .flashcard-syllable-label { color: #ff79c6; }
body.kpop .syllable.s1 { background: rgba(255,121,198,0.25); border-color: #ff79c6; color: #fff; }
body.kpop .syllable.s2 { background: rgba(189,147,249,0.28); border-color: #bd93f9; color: #fff; }
body.kpop .syllable.s3 { background: rgba(139,233,253,0.22); border-color: #8be9fd; color: #fff; }
body.kpop .syllable-dot { color: #ff79c6; }
body.kpop .flashcard-number { background: rgba(255,0,127,0.2); border-color: #ff79c6; color: #ff79c6; }
body.kpop .flashcard-hidden-mark { color: #ff79c6; }
body.kpop .flashcard-dot { background: rgba(255,120,200,0.3); }
body.kpop .flashcard-dot.active { background: #ff007f; }

body.demon .flashcard-title,
body.demon .list-section-title,
body.demon .flashcard-counter,
body.demon .settings-toggle { color: #ffd700; }
body.demon .settings-collapsible { border-color: rgba(200,0,50,0.45); background: rgba(20,5,15,0.6); }
body.demon .list-section-sub { color: rgba(200,168,128,0.7); }
body.demon .flashcard-counter { background: rgba(139,0,0,0.4); border-color: rgba(200,0,50,0.6); }
body.demon .flashcard-nav,
body.demon .flashcard-flip-btn,
body.demon .flashcard-bulk-btn,
body.demon .sequence-btn {
    background: rgba(30,5,10,0.8);
    border-color: rgba(200,0,50,0.6);
    color: #ffd700;
    border-radius: 4px;
}
body.demon .flashcard-face {
    background: rgba(30,5,10,0.85);
    border-color: rgba(200,0,50,0.6);
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(180,0,0,0.4);
}
body.demon .flashcard-back { background: rgba(139,0,0,0.45); }
body.demon .flashcard-word { color: #ffd700; }
body.demon .flashcard-syllable-label { color: #ffd700; }
body.demon .syllable.s1 { background: rgba(139,0,0,0.45); border-color: #ff4466; color: #ffd700; }
body.demon .syllable.s2 { background: rgba(80,0,0,0.5); border-color: #ffcc80; color: #ffe082; }
body.demon .syllable.s3 { background: rgba(20,20,40,0.55); border-color: #90caf9; color: #fff; }
body.demon .syllable-dot { color: #ff4466; }
body.demon .flashcard-number { background: rgba(139,0,0,0.4); border-color: rgba(200,0,50,0.6); color: #ff4466; border-radius: 4px; }
body.demon .flashcard-hidden-mark { color: #ff4466; }
body.demon .flashcard-dot { background: rgba(200,0,50,0.35); border-radius: 2px; }
body.demon .flashcard-dot.active { background: #ffd700; }

@media (max-width: 768px) {
    .flashcard-nav { width: 34px; height: 34px; font-size: 22px; }
    .flashcard-face,
    .flashcard-inner { min-height: min(56vh, 520px); }
    .flashcard-face { padding: 32px 28px 18px; }
    .flashcard-bulk-btn { font-size: 11px; padding: 5px 8px; }
}
