/* --- VARIABLES & RESET --- */
:root {
    /* V3 Design System */
    --bg:        #0f1520;
    --surface:   #161e2e;
    --surface2:  #1c2640;
    --surface3:  #212d47;
    --teal:      #00d4aa;
    --teal-glow: rgba(0, 212, 170, 0.18);
    --teal-dim:  rgba(0, 212, 170, 0.08);
    --gold:      #f5c842;
    --gold-dim:  rgba(245, 200, 66, 0.1);
    --rose:      #fb7185;
    --indigo:    #818cf8;
    --text:      #e2e8f0;
    --text-2:    #94a3b8;
    --text-3:    #475569;
    --border:    rgba(255,255,255,0.06);
    --border-t:  rgba(0,212,170,0.2);

    /* Safe area insets */
    --safe-top:    env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);

    /* Legacy aliases (keeps existing CSS working) */
    --bg-gradient:      var(--bg);
    --glass-bg:         var(--surface);
    --glass-border:     var(--border);
    --text-primary:     var(--text);
    --text-secondary:   var(--text-2);
    --accent-color:     var(--teal);
    --accent-glow:      var(--teal-glow);
    --critical-color:   #e74c3c;
    --warning-color:    #f39c12;
    --success-color:    #2ecc71;

    --sidebar-width: 260px;
    --radius-lg: 16px;
    --radius-md: 8px;
    --transition-speed: 0.3s;
}

body.light-mode {
    --bg:        #f5f7fa;
    --surface:   #ffffff;
    --surface2:  #f0f2f5;
    --surface3:  #e8eaed;
    --text:      #2c3e50;
    --text-2:    #7f8c8d;
    --text-3:    #aab4be;
    --border:    rgba(0,0,0,0.08);
    --border-t:  rgba(0,191,165,0.2);

    --bg-gradient:    var(--bg);
    --glass-bg:       var(--surface);
    --glass-border:   var(--border);
    --text-primary:   var(--text);
    --text-secondary: var(--text-2);
    --accent-color:   #2980b9;
    --accent-glow:    rgba(41, 128, 185, 0.3);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Outfit', 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    line-height: 1.6;
}

/* Subtle ambient background texture */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 40% at 50% -10%, rgba(0,212,170,0.07), transparent),
        radial-gradient(ellipse 60% 30% at 80% 110%, rgba(129,140,248,0.05), transparent);
    pointer-events: none;
    z-index: 0;
}

/* --- LAYOUT --- */
.app-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    height: 100%;
    width: 100vw;
}

/* --- SIDEBAR --- */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--glass-border);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 10;
}

body.light-mode .sidebar {
    background: rgba(255, 255, 255, 0.5);
}

.logo-area h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--accent-color), #2ecc71);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
    line-height: 1.2;
}

.level-selector label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.level-selector select {
    width: 100%;
    padding: 10px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    outline: none;
    cursor: pointer;
}

.nav-links {
    list-style: none;
    flex-grow: 1;
}

.nav-links li {
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
}

.nav-links li:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    padding-left: 20px;
}

.nav-links li.active {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.nav-links li.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-links li.locked:hover {
    background: transparent;
    padding-left: 15px;
    /* No move effect */
}

/* --- MAIN CONTENT --- */
.main-content {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
    position: relative;
    max-height: 100vh;
}

.content-section {
    display: none;
    animation: fadeIn 0.4s ease-out;
    max-width: 900px;
    margin: 0 auto;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 300;
}

/* --- PROGESS BAR --- */
.progress-bar-container {
    width: 200px;
    text-align: right;
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-top: 5px;
    overflow: hidden;
}

.progress-segment {
    height: 100%;
    background: var(--accent-color);
    width: 0%;
    transition: width 0.5s ease;
}

/* --- CARDS & GLASSMORPHISM --- */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* --- LEARNING CARD (VOCAB) --- */
.learning-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 20px !important;
    /* Override default card padding for compactness */
    max-width: 800px;
    margin: 0 auto;
}

.learning-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
}

/* Desktop: Side-by-Side Layout */
@media (min-width: 768px) {
    .learning-content-wrapper {
        flex-direction: row;
        justify-content: center;
        align-items: flex-start;
        /* Align top */
    }

    .character-display {
        text-align: right;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        min-width: 200px;
    }

    /* Move Audio button to left of pinyin on desktop for balance */
    #audio-btn {
        order: -1;
        margin-bottom: 5px;
    }
}

.character-display {
    text-align: center;
    position: relative;
    z-index: 2;
}

/* Visual Aids - Compact */
.visual-aid {
    margin-bottom: 10px;
    width: 100px;
    /* Reduced from 120 */
    height: 100px;
    border-radius: 12px;
    /* Soft square looks more modern than circle sometimes, but let's keep circle if preferred. User wants COMPACT. */
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 10px auto;
    border: 2px solid var(--accent-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

@media (min-width: 768px) {
    .visual-aid {
        margin-right: 0;
        margin-left: auto;
    }

    /* align right on desktop */
}

.visual-aid img {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

.visual-aid.hidden {
    display: none;
}

/* Typography Focus */
#pinyin-display {
    font-size: 2.5rem;
    /* Increased Focus */
    margin: 5px 0;
    font-weight: 700;
    color: var(--accent-color);
    letter-spacing: 1px;
    line-height: 1;
}

#english-display {
    font-size: 1rem;
    /* Reduced to not dominate */
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-weight: 500;
}

/* Drawing Area */
#character-target {
    width: 260px;
    height: 260px;
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
    transition: width 0.4s ease, height 0.4s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

#character-target svg {
    display: block;
    transition: width 0.4s ease, height 0.4s ease;
}

/* Write step expansion animation */
@keyframes write-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 212, 170, 0.4), inset 0 0 20px rgba(0, 0, 0, 0.2); }
    50% { box-shadow: 0 0 24px 8px rgba(0, 212, 170, 0.15), inset 0 0 20px rgba(0, 0, 0, 0.2); }
}
@keyframes write-glow-border {
    0%, 100% { border-color: var(--teal); }
    50% { border-color: var(--gold); }
}

#character-target.write-active {
    width: 320px;
    height: 320px;
    border: 2px solid var(--teal);
    animation: write-pulse 2s ease-in-out infinite, write-glow-border 3s ease-in-out infinite;
}
#character-target.write-active svg {
    width: 320px !important;
    height: 320px !important;
}

/* Controls */
.controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    /* Allow wrapping on very small screens */
    justify-content: center;
    margin-top: 10px;
    width: 100%;
}

.action-btn {
    padding: 10px 20px;
    /* Compact padding */
    border: none;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn:hover:not(:disabled) {
    background: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-glow);
    border-color: transparent;
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.02);
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.2s;
    color: var(--text-primary);
}

.icon-btn:hover {
    transform: scale(1.1);
    color: var(--accent-color);
}

/* Feedback - Compact & Less Dominant */
.feedback {
    margin-top: 10px;
    font-size: 0.95rem;
    /* Reduced */
    min-height: 1.4em;
    font-weight: 400;
    opacity: 0.9;
    padding: 5px 15px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.2);
}

.feedback.success {
    color: var(--success-color);
    background: rgba(46, 204, 113, 0.1);
}

.feedback.error {
    color: var(--critical-color);
    background: rgba(231, 76, 60, 0.1);
}

/* --- PHRASES LIST --- */
.list-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-bottom: 50px;
}

.phrase-item {
    background: var(--glass-bg);
    padding: 20px;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--glass-border);
    transition: transform 0.2s;
}

.phrase-item:hover {
    transform: translateX(5px);
    border-color: var(--accent-color);
}

.phrase-content h3 {
    font-size: 1.4rem;
    margin-bottom: 5px;
}

.phrase-content p {
    color: var(--text-secondary);
}

/* --- STORY MODE --- */
.story-card {
    line-height: 2;
    font-size: 1.2rem;
}

.story-line {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
}

.story-line .pinyin {
    display: block;
    color: var(--accent-color);
    font-size: 0.9em;
    margin-bottom: 2px;
}

.story-line .chinese {
    display: block;
    font-size: 1.5em;
    font-weight: bold;
}

.story-line .english {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-top: 5px;
}

/* --- RESOURCES GRID --- */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding-bottom: 50px;
}

.resource-card {
    background: var(--glass-bg);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    transition: all 0.3s;
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.resource-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
}

.resource-tag {
    display: inline-block;
    padding: 4px 8px;
    background: var(--accent-color);
    color: white;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 10px;
    align-self: flex-start;
}

.resource-card h3 {
    margin-bottom: 10px;
}

.resource-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    flex-grow: 1;
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    padding: 5px 15px;
    border-radius: 20px;
    cursor: pointer;
}

.secondary-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* --- REVIEW MODE --- */
.review-toggle-btn {
    padding: 6px 14px;
    border: 1px solid var(--accent-color);
    border-radius: 20px;
    background: transparent;
    color: var(--accent-color);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.review-toggle-btn:hover, .review-toggle-btn.active {
    background: var(--accent-color);
    color: white;
}
.review-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    background: rgba(0, 191, 165, 0.08);
    border: 1px solid rgba(0, 191, 165, 0.2);
    border-radius: 10px;
}
.review-slider {
    flex: 1;
    accent-color: var(--accent-color);
    cursor: pointer;
}
.review-position {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-color);
    white-space: nowrap;
    min-width: 40px;
    text-align: center;
}
.review-nav-btn {
    padding: 6px 10px;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}
.review-nav-btn:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}
.review-exit-btn {
    padding: 6px 12px;
    border: 1px solid var(--critical-color);
    border-radius: 8px;
    background: rgba(231, 76, 60, 0.1);
    color: var(--critical-color);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}
.review-exit-btn:hover {
    background: var(--critical-color);
    color: white;
}

/* --- MOBILE SETTINGS --- */
.mobile-settings-btn { display: none; }
.mobile-settings-panel { display: none; }
.mobile-theme-header-btn { display: none; }

/* --- MOBILE --- */
@media (max-width: 768px) {
    /* ===== APP SHELL: 3-part flex column ===== */
    .app-wrapper {
        flex-direction: column;
        height: 100dvh;
        overflow: hidden;
        padding-top: max(var(--safe-top), 8px);
        padding-bottom: calc(56px + max(var(--safe-bottom), 8px));
    }

    /* ===== TOP BAR ===== */
    .sidebar {
        width: 100%;
        height: auto;
        flex-shrink: 0;
        padding: 0 18px 10px;
        border-right: none;
        border-bottom: none;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: 8px;
        position: relative;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .logo-area {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }
    .logo-area h1 {
        display: block;
        font-size: 17px;
        font-weight: 700;
        letter-spacing: -0.3px;
        margin: 0;
        white-space: nowrap;
        color: var(--teal);
    }
    .logo-area h1 br { display: none; }

    /* Hide desktop-only sidebar items */
    .theme-btn { display: none; }
    .sidebar-auth { display: none !important; }
    .level-selector { display: none; }

    /* Streak pill */
    .streak-pill {
        display: flex;
        align-items: center;
        gap: 5px;
        background: var(--gold-dim);
        border: 1px solid rgba(245,200,66,0.2);
        border-radius: 20px;
        padding: 4px 10px;
        font-size: 12px;
        font-weight: 600;
        color: var(--gold);
    }

    /* Mobile theme toggle (header) */
    .mobile-theme-header-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 9px;
        color: var(--text);
        width: 32px;
        height: 32px;
        font-size: 15px;
        cursor: pointer;
        flex-shrink: 0;
        transition: background 0.2s;
    }
    .mobile-theme-header-btn:active {
        background: var(--surface2);
    }

    /* Mobile settings gear */
    .mobile-settings-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 9px;
        color: var(--text);
        width: 32px;
        height: 32px;
        font-size: 15px;
        cursor: pointer;
        flex-shrink: 0;
    }

    /* Settings dropdown panel */
    .mobile-settings-panel {
        display: none;
        position: absolute;
        top: 100%;
        right: 8px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 10px;
        min-width: 160px;
        z-index: 500;
        box-shadow: 0 8px 24px rgba(0,0,0,0.5);
        flex-direction: column;
        gap: 6px;
    }
    .mobile-settings-panel.open { display: flex; }
    .mobile-settings-panel .theme-btn,
    .mobile-settings-panel .mobile-theme-btn {
        display: block;
        width: 100%;
        text-align: center;
    }
    .mobile-settings-panel .mobile-signout-btn {
        width: 100%;
        text-align: center;
        padding: 8px;
        border-radius: 8px;
    }

    /* ===== BOTTOM NAV BAR (fixed to viewport bottom) ===== */
    .nav-links {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 900;
        display: flex;
        border-top: 1px solid var(--border);
        padding: 8px 0 max(var(--safe-bottom), 8px);
        background: var(--bg);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: none;
        margin: 0;
        flex-grow: 0;
        list-style: none;
    }

    body.light-mode .nav-links {
        background: var(--bg);
        border-top-color: var(--border);
    }

    .nav-links li {
        flex: 1;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        padding: 6px 0;
        margin: 0;
        font-size: 10px;
        font-weight: 500;
        color: var(--text-3);
        position: relative;
        min-height: auto;
        border-radius: 0;
    }

    .nav-links li .icon {
        font-size: 20px;
        line-height: 1;
    }

    .nav-links li:hover {
        background: transparent;
        padding-left: 0;
    }

    .nav-links li.active {
        color: var(--teal);
        background: transparent;
        box-shadow: none;
    }

    .nav-links li.active::before { display: none; }
    .nav-links li.active::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 4px;
        height: 4px;
        background: var(--teal);
        border-radius: 50%;
    }

    .nav-links li.locked { opacity: 0.35; }

    /* ===== MAIN CONTENT (scrollable middle) ===== */
    .main-content {
        flex: 1;
        min-height: 0;
        padding: 0 18px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    .main-content::-webkit-scrollbar { display: none; }
    .main-content { -ms-overflow-style: none; scrollbar-width: none; }

    /* ===== MOBILE LEVEL SELECTOR ===== */
    .mobile-level-selector {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 0;
        padding: 0 0 10px;
    }
    .mobile-level-selector label {
        font-size: 12px;
        color: var(--text-3);
        font-weight: 500;
        letter-spacing: 0.5px;
        white-space: nowrap;
        text-transform: uppercase;
        flex-shrink: 0;
    }
    .mobile-level-selector select {
        flex: 1;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 10px;
        color: var(--text);
        font-family: 'Outfit', sans-serif;
        font-size: 14px;
        font-weight: 500;
        padding: 8px 30px 8px 12px;
        appearance: none;
        -webkit-appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
    }

    /* ===== SECTION HEADER / PROGRESS ===== */
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 7px;
        margin-bottom: 10px;
        padding: 0;
    }
    .section-header h2 {
        font-size: 13px;
        font-weight: 500;
        color: var(--text-2);
        letter-spacing: 0.3px;
    }
    .progress-bar-container {
        width: 100%;
        text-align: left;
        gap: 0;
    }
    #progress-text,
    .progress-bar-container span {
        font-family: 'JetBrains Mono', monospace;
        font-size: 13px;
        font-weight: 600;
        color: var(--teal);
    }
    .progress-bar {
        height: 6px;
        background: var(--surface2);
        border-radius: 100px;
        margin-top: 7px;
    }
    .progress-segment,
    #progress-segment {
        background: linear-gradient(90deg, var(--teal), #00f0c8) !important;
        border-radius: 100px;
        box-shadow: 0 0 8px rgba(0,212,170,0.5);
    }

    /* ===== LEARNING CARD (v3 flash card style) ===== */
    .learning-card {
        background: var(--surface) !important;
        border: 1px solid var(--border) !important;
        border-radius: 22px !important;
        padding: 20px !important;
        position: relative;
        overflow: hidden;
        gap: 10px;
    }
    .learning-card::before {
        content: '';
        position: absolute;
        top: -40px;
        right: -40px;
        width: 140px;
        height: 140px;
        background: radial-gradient(circle, var(--teal-glow), transparent 70%);
        pointer-events: none;
    }

    /* Card layout: info (pinyin + meaning + audio) LEFT, character RIGHT */
    .learning-content-wrapper {
        flex-direction: row !important;
        align-items: flex-start;
        gap: 14px !important;
    }

    .character-display {
        flex: 1;
        text-align: left;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding-top: 4px;
    }

    /* Hide visual aid on mobile */
    .visual-aid,
    #visual-aid-container { display: none !important; }

    #pinyin-display {
        font-size: 26px;
        font-weight: 700;
        color: var(--teal);
        letter-spacing: 1px;
        line-height: 1;
        margin-bottom: 5px;
    }
    #english-display {
        font-size: 15px;
        color: var(--text-2);
        margin-bottom: 10px;
    }

    /* Audio button as teal pill */
    #audio-btn,
    .icon-btn {
        display: inline-flex !important;
        align-items: center;
        gap: 7px;
        background: var(--teal-dim);
        border: 1px solid var(--border-t);
        border-radius: 20px;
        padding: 6px 14px;
        font-size: 12px;
        font-weight: 500;
        color: var(--teal);
        cursor: pointer;
    }
    #audio-btn:active,
    .icon-btn:active { background: rgba(0,212,170,0.2); }

    /* Character target box */
    .canvas-area {
        display: flex;
        justify-content: flex-end;
        flex-shrink: 0;
    }
    .canvas-label { display: none; }
    #character-target {
        width: 110px;
        height: 110px;
        background: var(--surface2);
        border: 1px solid var(--border) !important;
        border-radius: 18px;
        box-shadow: none !important;
    }
    #character-target svg {
        width: 110px !important;
        height: 110px !important;
    }
    #character-target.write-active {
        width: 160px;
        height: 160px;
        border: 2px solid var(--teal) !important;
        box-shadow: 0 0 20px rgba(0,212,170,0.15) !important;
        animation: write-pulse 2s ease-in-out infinite, write-glow-border 3s ease-in-out infinite;
    }
    #character-target.write-active svg {
        width: 160px !important;
        height: 160px !important;
    }
    .free-draw-container, #free-draw-canvas {
        width: 110px;
        height: 110px;
    }

    /* ===== STEP INDICATORS ===== */
    .step-progress {
        gap: 0;
        padding: 0 0 14px;
    }
    .step-item {
        flex: 1;
        min-width: auto;
    }
    .step-number {
        width: 30px;
        height: 30px;
        font-size: 12px;
        font-weight: 700;
        background: var(--surface2);
        border: 1px solid var(--border);
        color: var(--text-3);
    }
    .step-item.active .step-number {
        background: var(--teal);
        color: #0f1520;
        border-color: var(--teal);
        box-shadow: 0 0 0 4px var(--teal-glow), 0 0 16px var(--teal-glow);
    }
    .step-item.completed .step-number {
        background: var(--surface3);
        color: var(--teal);
        border: 1px solid var(--border-t);
    }
    .step-label {
        font-size: 9px;
        letter-spacing: 0.5px;
    }
    .step-item.active .step-label { color: var(--teal); }
    .step-item .step-label { color: var(--text-3); }
    .step-connector {
        height: 2px;
        background: var(--border);
        margin-bottom: 18px;
    }

    /* ===== ACTION BUTTONS (v3 grid layout) ===== */
    .controls {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr 1fr auto;
        gap: 8px;
        margin-top: 0;
    }
    .action-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        padding: 11px 8px;
        font-size: 13px;
        font-weight: 600;
        border-radius: 12px;
        border: none !important;
        border-left: none !important;
        min-width: unset;
        max-width: unset;
        white-space: nowrap;
    }
    .action-btn:active { transform: scale(0.96); opacity: 0.85; }

    /* Color each button */
    #listen-btn { background: var(--teal); color: #0f1520; }
    #pronounce-btn { background: var(--surface2); color: var(--indigo); border: 1px solid rgba(129,140,248,0.25) !important; }
    #draw-btn { background: var(--surface2); color: var(--gold); border: 1px solid rgba(245,200,66,0.25) !important; }
    #next-btn { background: var(--surface2); color: #4ade80; border: 1px solid rgba(74,222,128,0.25) !important; }
    #share-btn {
        width: 40px;
        height: 40px;
        background: var(--surface2);
        border: 1px solid var(--border) !important;
        border-radius: 12px;
        min-width: unset;
        max-width: unset;
        padding: 0;
    }

    /* ===== FEEDBACK (instruction bar style, below buttons) ===== */
    .feedback {
        background: var(--teal-dim);
        border: 1px solid var(--border-t);
        border-radius: 10px;
        padding: 9px 14px;
        font-size: 12px;
        color: var(--teal);
        text-align: center;
        margin-top: 12px;
    }
    .feedback.success { color: var(--teal); background: var(--teal-dim); border-color: var(--border-t); }
    .feedback.error { color: var(--rose); background: rgba(251,113,133,0.08); border-color: rgba(251,113,133,0.2); }
    .feedback.warning { color: var(--gold); background: var(--gold-dim); border-color: rgba(245,200,66,0.2); }

    /* ===== CANVAS MODE TOGGLE ===== */
    .canvas-mode-toggle {
        gap: 8px;
        margin-top: 8px;
    }
    .mode-btn {
        background: var(--surface2);
        border: 1px solid var(--border);
        border-radius: 10px;
        color: var(--text-2);
        font-size: 12px;
        padding: 6px 12px;
    }
    .mode-btn.active {
        background: var(--teal);
        color: #0f1520;
        border-color: var(--teal);
    }

    /* ===== REVIEW BAR ===== */
    .review-bar {
        background: var(--teal-dim);
        border: 1px solid var(--border-t);
        border-radius: 10px;
        padding: 8px 12px;
        gap: 8px;
    }
    .review-toggle-btn {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
}

/* ===== BELOW-CARD CONTENT ===== */
.below-card-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 14px;
    padding-bottom: 24px;
    max-width: 700px;
    margin: 0 auto;
}
@media (max-width: 768px) {
    .below-card-content {
        gap: 10px;
        padding-top: 10px;
        padding-bottom: 20px;
        max-width: none;
    }
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    flex-shrink: 0;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 10px;
    text-align: center;
}
.stat-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 20px;
    font-weight: 600;
    line-height: 1;
    margin-bottom: 3px;
}
.stat-val.v-streak { color: var(--gold); }
.stat-val.v-xp { color: var(--teal); }
.stat-val.v-time { color: var(--indigo); }
.stat-lbl { font-size: 10px; color: var(--text-3); letter-spacing: 0.3px; }

/* Word of the Day */
.wod-row {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}
.wod-char-mini {
    font-family: 'Noto Serif SC', serif;
    font-size: 36px;
    font-weight: 700;
    color: var(--indigo);
    line-height: 1;
    text-shadow: 0 0 20px rgba(129,140,248,0.3);
    flex-shrink: 0;
}
.wod-info { flex: 1; }
.wod-tag { font-size: 9px; color: var(--text-3); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 2px; }
.wod-pinyin-mini { font-size: 13px; color: var(--indigo); font-weight: 600; }
.wod-meaning-mini { font-size: 12px; color: var(--text-2); }
.wod-share {
    background: rgba(129,140,248,0.1);
    border: 1px solid rgba(129,140,248,0.2);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 11px;
    color: var(--indigo);
    cursor: pointer;
    flex-shrink: 0;
}

/* Quick Actions Grid */
.quick-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    flex-shrink: 0;
}
.quick-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 13px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.15s;
    position: relative;
    overflow: hidden;
}
.quick-card:active { transform: scale(0.97); }
.quick-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 50px; height: 50px;
    border-radius: 50%;
    opacity: 0.1;
}
.qc-review::before { background: var(--teal); }
.qc-test::before { background: var(--rose); }
.qc-story::before { background: var(--gold); }
.qc-rank::before { background: var(--indigo); }
.quick-icon { font-size: 20px; flex-shrink: 0; }
.quick-title { font-size: 13px; font-weight: 600; color: var(--text); }
.quick-sub { font-size: 11px; color: var(--text-3); margin-top: 1px; }

/* Pro Upsell Card */
.upsell {
    background: linear-gradient(135deg, #192035, #1a2a3a);
    border: 1px solid rgba(0,212,170,0.22);
    border-radius: 18px;
    padding: 15px 16px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.upsell::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 120px; height: 120px;
    background: radial-gradient(circle, rgba(0,212,170,0.1), transparent 70%);
}
.upsell-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}
.pro-badge {
    background: linear-gradient(135deg, var(--teal), #00b894);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 10px;
    font-weight: 700;
    color: #0f1520;
    letter-spacing: 0.8px;
}
.upsell-price { text-align: right; }
.price-main {
    font-family: 'JetBrains Mono', monospace;
    font-size: 20px;
    font-weight: 700;
    color: var(--teal);
}
.price-sub { font-size: 10px; color: var(--text-3); }
.upsell-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.upsell-desc { font-size: 12px; color: var(--text-2); margin-bottom: 10px; line-height: 1.5; }
.upsell-perks-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.perk-chip {
    background: var(--teal-dim);
    border: 1px solid rgba(0,212,170,0.15);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    color: var(--teal);
    display: flex;
    align-items: center;
    gap: 4px;
}
.upsell-cta-btn {
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    background: var(--teal);
    border: none;
    border-radius: 12px;
    padding: 13px;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #0f1520;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.upsell-cta-btn:active { opacity: 0.85; }

/* Fade-up animation for mobile content */
@keyframes fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 768px) {
    .learning-card { animation: fade-up 0.35s ease both; }
    .stats-row { animation: fade-up 0.35s 0.08s ease both; }
    .wod-row { animation: fade-up 0.35s 0.14s ease both; }
    .quick-grid { animation: fade-up 0.35s 0.20s ease both; }
    .upsell { animation: fade-up 0.35s 0.26s ease both; }
}

/* ===== LEARNED/UNKNOWN WORD HIGHLIGHTING ===== */
.word-known {
    color: var(--teal);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(0, 212, 170, 0.3);
    text-underline-offset: 2px;
}
.word-unknown {
    color: var(--text-3);
    opacity: 0.6;
    cursor: help;
    border-bottom: 1px dashed var(--text-3);
}
.phrase-relevant {
    border-left: 3px solid var(--teal);
    background: var(--teal-dim);
}
body.light-mode .word-known {
    color: #00897b;
    text-decoration-color: rgba(0, 137, 123, 0.3);
}
body.light-mode .word-unknown {
    color: #aab4be;
}

/* ===== BACKGROUND AUDIO BUTTON ===== */
.audio-btn {
    margin-top: 4px;
}
.audio-btn.audio-active,
.mobile-audio-btn.audio-active {
    color: var(--teal);
    border-color: var(--teal);
}
.mobile-audio-btn { display: none; }
@media (max-width: 768px) {
    .mobile-audio-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 9px;
        color: var(--text);
        width: 32px;
        height: 32px;
        font-size: 15px;
        cursor: pointer;
        flex-shrink: 0;
    }
}

/* --- MODALS --- */
.modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-gradient);
    padding: 30px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 450px;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.close-modal:hover {
    color: var(--text-primary);
}

.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.auth-btn {
    padding: 12px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: bold;
    color: white;
    transition: opacity 0.2s;
}

.auth-btn:hover {
    opacity: 0.9;
}

.auth-btn.google {
    background-color: #db4437;
}

.auth-btn.facebook {
    background-color: #4267B2;
}

.auth-btn.apple {
    background-color: #000;
}

.auth-btn.email {
    background-color: var(--accent-color);
}

.premium-features {
    text-align: left;
    margin: 20px auto;
    width: fit-content;
    list-style: none;
}

.premium-features li {
    margin-bottom: 8px;
    font-size: 1.1em;
}

/* --- THEME TOGGLE --- */
.theme-btn {
    padding: 10px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    width: 100%;
}

.theme-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* --- LEADERBOARD --- */
.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    transition: transform 0.2s;
}

.leaderboard-item:hover {
    transform: translateX(5px);
}

.leaderboard-item.highlight {
    border-color: var(--accent-color);
    background: rgba(0, 191, 165, 0.1);
}

.leaderboard-item .rank {
    font-size: 1.5rem;
    font-weight: 700;
    min-width: 50px;
    color: var(--accent-color);
}

.leaderboard-item .user-info {
    flex-grow: 1;
}

.leaderboard-item .user-info h4 {
    margin-bottom: 2px;
}

.leaderboard-item .user-info span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.leaderboard-item .score {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-color);
}

.trial-text {
    margin-top: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.feedback.warning {
    color: var(--warning-color);
    background: rgba(243, 156, 18, 0.1);
}

/* --- QUICK GUIDE --- */
.quick-guide-overlay {
    position: fixed;
    background: var(--accent-color);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    z-index: 2000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    font-size: 0.9rem;
    pointer-events: none;
    animation: guide-bounce 1s infinite alternate;
    white-space: nowrap;
}
.quick-guide-overlay::after {
    content: '';
    position: absolute;
    border-width: 8px;
    border-style: solid;
}
.quick-guide-overlay[data-pos="top"]::after {
    top: 100%; left: 50%; transform: translateX(-50%);
    border-color: var(--accent-color) transparent transparent transparent;
}
.quick-guide-overlay[data-pos="bottom"]::after {
    bottom: 100%; left: 50%; transform: translateX(-50%);
    border-color: transparent transparent var(--accent-color) transparent;
}
.quick-guide-skip {
    pointer-events: auto;
    background: rgba(0,0,0,0.2);
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    margin-left: 10px;
    cursor: pointer;
    font-weight: bold;
}
.quick-guide-skip:hover {
    background: rgba(0,0,0,0.4);
}
@keyframes guide-bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-8px); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* --- AUTH GATE BLUR --- */
body.auth-required .app-wrapper {
    filter: blur(8px);
    pointer-events: none;
    user-select: none;
}

/* --- MOBILE LEVEL SELECTOR --- */
.mobile-level-selector {
    display: none;
}
@media (max-width: 768px) {
    .mobile-level-selector {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 0;
        margin-bottom: 10px;
    }
    .mobile-level-selector label {
        font-size: 0.85rem;
        color: var(--text-secondary);
        white-space: nowrap;
    }
    .mobile-level-selector select {
        flex: 1;
        padding: 8px 12px;
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
        color: var(--text-primary);
        border-radius: var(--radius-md);
        font-size: 0.9rem;
        outline: none;
    }
}

/* --- STEP PROGRESS INDICATOR --- */
.step-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 100%;
    padding: 12px 0 8px;
}
.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 60px;
}
.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 2px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}
.step-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}
.step-item.active .step-number {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    box-shadow: 0 0 12px var(--accent-glow);
}
.step-item.active .step-label {
    color: var(--accent-color);
    font-weight: 600;
}
.step-item.completed .step-number {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}
.step-item.completed .step-label {
    color: var(--success-color);
}
.step-connector {
    flex: 1;
    height: 2px;
    background: var(--glass-border);
    margin: 0 4px;
    margin-bottom: 18px;
}
@media (max-width: 768px) {
    .step-item { min-width: 50px; }
    .step-number { width: 28px; height: 28px; font-size: 0.75rem; }
    .step-label { font-size: 0.55rem; }
}

/* --- BUTTON ACCENT COLORS --- */
.action-btn {
    flex: 1;
    min-width: 70px;
    max-width: 140px;
    justify-content: center;
    border-radius: 10px;
}
.action-btn-listen { border-left: 3px solid #3498db; }
.action-btn-speak { border-left: 3px solid #9b59b6; }
.action-btn-write { border-left: 3px solid #e67e22; }
.action-btn-next { border-left: 3px solid var(--success-color); }
.action-btn-share {
    border-left: 3px solid #f39c12;
    max-width: 50px;
    flex: 0 0 auto;
}

/* --- CANVAS AREA --- */
.canvas-area {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}
.canvas-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}
.canvas-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.free-draw-container {
    position: relative;
    width: 260px;
    height: 260px;
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.05);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.2);
}
#free-draw-canvas {
    display: block;
    width: 260px;
    height: 260px;
    border-radius: var(--radius-md);
    cursor: crosshair;
}
.clear-canvas-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0,0,0,0.3);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    color: var(--text-primary);
}
.clear-canvas-btn:hover {
    background: rgba(231,76,60,0.5);
}

/* --- CANVAS MODE TOGGLE --- */
.canvas-mode-toggle {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 8px;
}
.mode-btn {
    padding: 6px 14px;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}
.mode-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}
.mode-btn:hover:not(.active) {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

/* --- PRICING CARDS (Upgrade Modal) --- */
.pricing-options {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: center;
}
.pricing-card {
    flex: 0 1 320px;
    max-width: 360px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    position: relative;
}
.pricing-highlight {
    border-color: var(--accent-color);
    background: rgba(0,191,165,0.08);
}
.pricing-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-color);
    color: white;
    padding: 2px 12px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}
.pricing-card h3 {
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.pricing-amount {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-color);
    line-height: 1;
    margin-bottom: 4px;
}
.pricing-period {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-secondary);
}
.pricing-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.pricing-compare {
    font-size: 0.7rem;
    color: var(--accent-color);
    font-style: italic;
    margin-top: 6px;
    opacity: 0.85;
}
@media (max-width: 480px) {
    .pricing-options { flex-direction: column; }

    /* Slightly smaller char box on small phones */
    #character-target { width: 100px; height: 100px; }
    #character-target svg { width: 100px !important; height: 100px !important; }
    .free-draw-container, #free-draw-canvas { width: 100px; height: 100px; }
    #character-target.write-active { width: 140px; height: 140px; }
    #character-target.write-active svg { width: 140px !important; height: 140px !important; }
    #pinyin-display { font-size: 22px; }

    .action-btn { padding: 9px 6px; font-size: 12px; }
    .section-header h2 { font-size: 12px; }
    .nav-links li { font-size: 9px; }
    .nav-links li .icon { font-size: 18px; }
}