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

        :root {
            --primary: #58cc02;
            --primary-dark: #46a302;
            --secondary: #1cb0f6;
            --danger: #ff4b4b;
            --warning: #ffc800;
            --bg: #131f24;
            --bg-light: #1a2c35;
            --card: #233a44;
            --text: #ffffff;
            --text-muted: #afafaf;
            --purple: #ce82ff;
        }

        body {
            font-family: 'Segoe UI', system-ui, sans-serif;
            background: var(--bg);
            color: var(--text);
            min-height: 100vh;
        }

        .splash-screen {
            position: fixed;
            inset: 0;
            z-index: 3000;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 1rem;
            padding: 1.5rem;
            background: #070b12;
            opacity: 1;
            visibility: visible;
            transition: opacity 0.35s ease, visibility 0.35s ease;
        }

        .splash-screen.hide {
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
        }

        .splash-character {
            width: min(480px, 88vw);
            max-height: 72vh;
            object-fit: contain;
            border-radius: 28px;
            filter: drop-shadow(0 20px 45px rgba(255, 38, 58, 0.35));
            animation: splash-pop 0.55s ease-out;
        }

        .splash-title {
            color: white;
            font-size: clamp(1.35rem, 5vw, 2rem);
            text-align: center;
        }

        @keyframes splash-pop {
            from { transform: scale(0.72); opacity: 0; }
            to { transform: scale(1); opacity: 1; }
        }

        /* ===== HEADER ===== */
        .header {
            background: var(--bg-light);
            padding: 1rem 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 2px solid var(--card);
            display: none;
        }

        .logo {
            font-size: 1.4rem;
            font-weight: bold;
            color: var(--primary);
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .stats {
            display: flex;
            gap: 1.5rem;
        }

        .stat {
            display: flex;
            align-items: center;
            gap: 0.4rem;
            font-weight: 600;
            font-size: 1rem;
        }

        .sound-toggle {
            background: var(--card);
            color: var(--text);
            border: 0;
            border-radius: 10px;
            padding: 0.45rem 0.7rem;
            cursor: pointer;
            font-size: 0.85rem;
            font-weight: 700;
        }

        .sound-toggle:hover { background: var(--secondary); }

        /* ===== CONTAINER ===== */
        .container {
            max-width: 620px;
            margin: 0 auto;
            padding: 2rem 1.5rem;
        }

        /* ===== SCREENS ===== */
        .screen { display: none; }
        .screen.active { display: block; }

        /* ===== ONBOARDING ===== */
        .onboarding {
            text-align: center;
            padding-top: 2rem;
        }

        .owl-big {
            width: min(360px, 86vw);
            aspect-ratio: 1;
            display: block;
            object-fit: cover;
            margin: 0 auto 1.5rem;
            border-radius: 28%;
            box-shadow: 0 18px 55px rgba(255, 123, 0, 0.28);
            animation: float 3s ease-in-out infinite;
        }

        .logo-character {
            width: 34px;
            height: 34px;
            border-radius: 10px;
            object-fit: cover;
        }

        @keyframes float {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-12px); }
        }

        .onboarding h1 {
            font-size: 2rem;
            margin-bottom: 0.5rem;
        }

        .onboarding p {
            color: var(--text-muted);
            margin-bottom: 2rem;
        }

        .form-group {
            margin-bottom: 1.25rem;
            text-align: left;
        }

        .form-group label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 600;
            color: var(--text-muted);
            font-size: 0.9rem;
        }

        .form-group input,
        .form-group select {
            width: 100%;
            padding: 0.9rem 1rem;
            background: var(--card);
            border: 2px solid var(--card);
            border-radius: 12px;
            color: var(--text);
            font-size: 1rem;
            transition: border-color 0.2s;
        }

        .form-group input:focus,
        .form-group select:focus {
            outline: none;
            border-color: var(--secondary);
        }

        .form-group select option {
            background: var(--bg-light);
        }

        .language-source { display: none; }

        .goal-buttons {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.75rem;
        }

        .goal-btn {
            padding: 0.9rem;
            background: var(--card);
            border: 2px solid var(--card);
            border-radius: 12px;
            color: var(--text);
            cursor: pointer;
            font-size: 0.95rem;
            transition: all 0.2s;
            text-align: center;
        }

        .goal-btn:hover { border-color: var(--secondary); }
        .goal-btn.selected {
            border-color: var(--primary);
            background: rgba(88,204,2,0.15);
        }

        /* ===== PLACEMENT TEST ===== */
        .test-header {
            text-align: center;
            margin-bottom: 2rem;
        }

        .test-header h2 { font-size: 1.6rem; margin-bottom: 0.5rem; }
        .test-header p { color: var(--text-muted); }

        .progress-bar {
            height: 14px;
            background: var(--card);
            border-radius: 8px;
            overflow: hidden;
            margin-bottom: 0.5rem;
        }

        .progress-fill {
            height: 100%;
            background: var(--primary);
            border-radius: 8px;
            transition: width 0.4s ease;
        }

        .progress-text {
            text-align: center;
            color: var(--text-muted);
            font-size: 0.85rem;
            margin-bottom: 1.5rem;
        }

        .q-word {
            background: var(--card);
            border-radius: 16px;
            padding: 1.5rem;
            text-align: center;
            font-size: 2rem;
            font-weight: bold;
            margin-bottom: 1.5rem;
            letter-spacing: 1px;
        }

        .q-label {
            color: var(--text-muted);
            font-size: 0.9rem;
            margin-bottom: 1.25rem;
        }

        .options {
            display: grid;
            gap: 0.75rem;
        }

        .option {
            background: var(--card);
            border: 2px solid var(--card);
            border-radius: 12px;
            padding: 1rem 1.25rem;
            cursor: pointer;
            font-size: 1rem;
            text-align: left;
            color: var(--text);
            transition: all 0.2s;
            width: 100%;
        }

        .option:hover:not(.disabled) { border-color: var(--secondary); background: rgba(28,176,246,0.1); }
        .option.selected { border-color: var(--secondary); background: rgba(28,176,246,0.2); }
        .option.correct { border-color: var(--primary); background: rgba(88,204,2,0.2); }
        .option.wrong { border-color: var(--danger); background: rgba(255,75,75,0.2); animation: shake 0.4s ease; }
        .option.disabled { cursor: not-allowed; }

        @keyframes shake {
            0%,100% { transform: translateX(0); }
            25% { transform: translateX(-8px); }
            75% { transform: translateX(8px); }
        }

        /* ===== PLACEMENT RESULT ===== */
        .placement-result {
            text-align: center;
            padding: 2rem 0;
        }

        .level-badge-big {
            width: 120px;
            height: 120px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 3rem;
            font-weight: bold;
            margin-bottom: 1rem;
            box-shadow: 0 6px 25px rgba(88,204,2,0.4);
            animation: pop 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
        }

        @keyframes pop {
            0% { transform: scale(0); opacity: 0; }
            80% { transform: scale(1.15); }
            100% { transform: scale(1); opacity: 1; }
        }

        .placement-result h2 { font-size: 1.8rem; margin-bottom: 0.5rem; }
        .placement-result p { color: var(--text-muted); margin-bottom: 2rem; }

        /* ===== HOME SCREEN ===== */
        .home-top {
            display: flex;
            align-items: center;
            gap: 1rem;
            margin-bottom: 2rem;
            background: var(--card);
            border-radius: 16px;
            padding: 1rem 1.25rem;
        }

        .avatar {
            width: 56px;
            height: 56px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.75rem;
            flex-shrink: 0;
            background-size: cover;
            background-position: center;
        }

        .home-top-info h3 { font-size: 1.1rem; }
        .home-top-info span { color: var(--text-muted); font-size: 0.9rem; }

        .verified-badge {
            display: none;
            width: fit-content;
            margin-top: 0.3rem;
            padding: 0.2rem 0.55rem;
            border-radius: 999px;
            background: rgba(28, 176, 246, 0.16);
            color: var(--secondary) !important;
            font-size: 0.72rem !important;
            font-weight: 800;
            line-height: 1.2;
        }

        .verified-badge.show { display: inline-flex; }

        .owner-title {
            display: none;
            width: fit-content;
            margin-top: 0.3rem;
            color: var(--warning) !important;
            font-size: 0.78rem !important;
            font-weight: 800;
        }

        .owner-title.show { display: block; }
        #home-level-text { display: block; margin-top: 0.3rem; }

        .home-top-xp {
            margin-left: auto;
            text-align: center;
        }

        .home-top-xp .xp-num {
            font-size: 1.4rem;
            font-weight: bold;
            color: var(--warning);
        }

        .home-top-xp span { color: var(--text-muted); font-size: 0.8rem; display: block; }
        .stat-fire { color: #ff9600; }
        .stat-xp { color: var(--warning); }
        .stat-hearts { color: var(--danger); }

        .profile-reset-btn {
            margin-top: -1rem;
            margin-bottom: 1.5rem;
            padding: 0.75rem 1rem;
            font-size: 0.95rem;
        }

        .section-title {
            font-size: 1.2rem;
            font-weight: 700;
            margin-bottom: 1rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 1px;
            font-size: 0.85rem;
        }

        /* ===== UNIT TRACK ===== */
        .unit-track {
            margin-bottom: 2rem;
        }

        .unit-header {
            background: linear-gradient(135deg, var(--card), #2a4a58);
            border-radius: 16px 16px 0 0;
            padding: 1rem 1.5rem;
            display: flex;
            align-items: center;
            gap: 1rem;
            border-bottom: 2px solid var(--bg);
        }

        .unit-icon { font-size: 2rem; }

        .unit-header-info h3 { font-size: 1.1rem; }
        .unit-header-info span { color: var(--text-muted); font-size: 0.85rem; }

        .unit-badge {
            margin-left: auto;
            background: var(--bg);
            padding: 0.3rem 0.75rem;
            border-radius: 20px;
            font-size: 0.8rem;
            font-weight: 600;
        }

        .unit-badge.locked { color: var(--text-muted); }
        .unit-badge.active { color: var(--primary); }
        .unit-badge.done { color: var(--warning); }

        .lesson-nodes {
            background: var(--bg-light);
            border-radius: 0 0 16px 16px;
            padding: 1.5rem;
            display: flex;
            flex-wrap: wrap;
            gap: 1rem;
            justify-content: center;
        }

        .lesson-node {
            width: 70px;
            height: 70px;
            border-radius: 50%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
            font-size: 1.5rem;
            position: relative;
            border: 3px solid transparent;
        }

        .lesson-node span {
            font-size: 0.65rem;
            font-weight: 600;
            margin-top: 2px;
        }

        .lesson-node.available {
            background: var(--primary);
            box-shadow: 0 4px 0 var(--primary-dark);
        }

        .lesson-node.available:hover {
            transform: translateY(-3px);
            box-shadow: 0 7px 0 var(--primary-dark);
        }

        .lesson-node.available:active {
            transform: translateY(1px);
            box-shadow: 0 2px 0 var(--primary-dark);
        }

        .lesson-node.completed {
            background: var(--warning);
            box-shadow: 0 4px 0 #cc9f00;
        }

        .lesson-node.locked {
            background: var(--card);
            cursor: not-allowed;
            opacity: 0.5;
        }

        .lesson-node.current {
            background: var(--primary);
            box-shadow: 0 4px 0 var(--primary-dark);
            border-color: white;
            animation: pulse-node 2s ease-in-out infinite;
        }

        @keyframes pulse-node {
            0%, 100% { box-shadow: 0 4px 0 var(--primary-dark), 0 0 0 0 rgba(88,204,2,0.4); }
            50% { box-shadow: 0 4px 0 var(--primary-dark), 0 0 0 10px rgba(88,204,2,0); }
        }

        /* ===== LESSON SCREEN ===== */
        .lesson-top {
            display: flex;
            align-items: center;
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        .close-btn {
            background: var(--card);
            border: none;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            color: var(--text-muted);
            font-size: 1.2rem;
            cursor: pointer;
            transition: all 0.2s;
            flex-shrink: 0;
        }

        .close-btn:hover { background: var(--danger); color: white; }

        .lesson-progress-bar {
            flex: 1;
            height: 14px;
            background: var(--card);
            border-radius: 8px;
            overflow: hidden;
        }

        .lesson-progress-fill {
            height: 100%;
            background: var(--primary);
            border-radius: 8px;
            transition: width 0.4s ease;
        }

        .hearts-display {
            display: flex;
            gap: 3px;
            flex-shrink: 0;
        }

        .heart { font-size: 1.3rem; transition: all 0.3s; }
        .heart.lost { opacity: 0.2; transform: scale(0.8); }

        .q-type-label {
            color: var(--text-muted);
            font-size: 0.9rem;
            margin-bottom: 0.5rem;
        }

        .q-text {
            font-size: 1.4rem;
            font-weight: 600;
            margin-bottom: 1.5rem;
            line-height: 1.4;
        }

        .q-word-card {
            background: var(--card);
            border-radius: 16px;
            padding: 1.25rem 1.5rem;
            display: inline-flex;
            align-items: center;
            gap: 0.75rem;
            margin-bottom: 1.75rem;
            font-size: 1.5rem;
            font-weight: bold;
        }

        .speak-btn {
            background: var(--secondary);
            border: none;
            width: 38px;
            height: 38px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 1rem;
            transition: transform 0.2s;
            flex-shrink: 0;
        }

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

        /* ===== FEEDBACK BAR ===== */
        .feedback-bar {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            padding: 1.25rem 1.5rem;
            transform: translateY(100%);
            transition: transform 0.3s ease;
            z-index: 100;
        }

        .feedback-bar.show { transform: translateY(0); }
        .feedback-bar.correct-fb { background: #3a6f0a; border-top: 3px solid var(--primary); }
        .feedback-bar.wrong-fb { background: #6f1515; border-top: 3px solid var(--danger); }

        .feedback-inner {
            max-width: 620px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .fb-text h3 { font-size: 1.1rem; margin-bottom: 0.2rem; }
        .fb-text p { color: rgba(255,255,255,0.8); font-size: 0.9rem; }

        .continue-btn {
            background: var(--primary);
            color: white;
            border: none;
            padding: 0.75rem 1.75rem;
            border-radius: 12px;
            font-size: 1rem;
            font-weight: 700;
            cursor: pointer;
            transition: transform 0.2s;
            white-space: nowrap;
        }

        .continue-btn:hover { transform: scale(1.05); }
        .feedback-bar.wrong-fb .continue-btn { background: var(--danger); }

        /* ===== RESULTS ===== */
        .results-screen {
            text-align: center;
            padding: 2rem 0;
        }

        .results-emoji { font-size: 5rem; animation: bounce 0.8s ease; margin-bottom: 1rem; }

        @keyframes bounce {
            0%,100% { transform: translateY(0); }
            50% { transform: translateY(-20px); }
        }

        .results-screen h2 { font-size: 2rem; margin-bottom: 0.5rem; }
        .results-screen p { color: var(--text-muted); margin-bottom: 2rem; }

        .result-stats {
            display: flex;
            justify-content: center;
            gap: 3rem;
            margin-bottom: 2.5rem;
        }

        .rs { text-align: center; }
        .rs-val { font-size: 2.5rem; font-weight: bold; color: var(--primary); }
        .rs-val.gold { color: var(--warning); }
        .rs-label { color: var(--text-muted); font-size: 0.85rem; }

        /* ===== BUTTONS ===== */
        .btn-primary {
            background: var(--primary);
            color: white;
            border: none;
            padding: 1rem 2.5rem;
            border-radius: 12px;
            font-size: 1.1rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s;
            width: 100%;
            margin-bottom: 0.75rem;
        }

        .btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); }

        .btn-secondary {
            background: transparent;
            color: var(--text-muted);
            border: 2px solid var(--card);
            padding: 0.8rem 2rem;
            border-radius: 12px;
            font-size: 1rem;
            cursor: pointer;
            transition: all 0.2s;
            width: 100%;
        }

        .btn-secondary:hover { border-color: var(--text-muted); color: var(--text); }

        /* ===== GAMEOVER ===== */
        .gameover-screen { text-align: center; padding: 3rem 0; }
        .gameover-screen .emoji { font-size: 5rem; margin-bottom: 1rem; }
        .gameover-screen h2 { font-size: 1.8rem; margin-bottom: 0.5rem; }
        .gameover-screen p { color: var(--text-muted); margin-bottom: 2rem; }

        /* ===== CONFETTI ===== */
        .confetti-wrap {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            pointer-events: none; z-index: 999;
        }

        .cp {
            position: absolute;
            width: 10px; height: 10px;
            animation: cf 2.5s ease-out forwards;
        }

        @keyframes cf {
            0% { transform: translateY(-80px) rotate(0deg); opacity: 1; }
            100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
        }

        /* ===== RESPONSIVE ===== */
        @media (max-width: 480px) {
            .header { padding: 0.75rem 1rem; }
            .stats { gap: 1rem; }
            .stat .stat-label { display: none; }
            .container { padding: 1rem; }
            .result-stats { gap: 1.5rem; }
        }

/* ===== PRIVACY / STORE READINESS ADDITIONS ===== */
.privacy-note {
    margin: 0.85rem auto 1.1rem;
    padding: 0.85rem 1rem;
    max-width: 460px;
    border: 1px solid rgba(88, 204, 2, 0.35);
    border-radius: 16px;
    background: rgba(88, 204, 2, 0.08);
    color: var(--text);
    font-size: 0.92rem;
    line-height: 1.45;
}

.legal-links, .app-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.legal-links { margin-top: 1rem; }
.app-footer { padding: 1rem 1.5rem 1.5rem; }

.legal-links a, .app-footer a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 700;
}

.legal-links a:hover, .app-footer a:hover { text-decoration: underline; }

.safe-area-pad {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

.speech-warning {
    margin: 10px auto 0;
    max-width: 520px;
    min-height: 20px;
    font-size: 13px;
    line-height: 1.35;
    text-align: center;
    color: #7a5b00;
    font-weight: 700;
}

/* ===== APP LANGUAGE SELECTION ===== */
.language-onboarding { padding-top: 1rem; }
.language-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    margin-top: 1.5rem;
}
.ui-lang-btn {
    border: 2px solid var(--card);
    background: var(--card);
    color: var(--text);
    border-radius: 14px;
    padding: 0.95rem 0.75rem;
    text-align: left;
    cursor: pointer;
    font-weight: 800;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.ui-lang-btn small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-weight: 600;
}
.ui-lang-btn:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    background: rgba(88,204,2,0.12);
}
@media (max-width: 520px) {
    .language-grid { grid-template-columns: 1fr; }
}
