        /* ===== Profile modal ===== */
        .profile-modal-overlay {
            position: fixed; inset: 0;
            background: rgba(0, 0, 0, 0.6);
            z-index: 9999;
            align-items: center; justify-content: center;
        }
        .profile-modal-content {
            background: var(--bg-secondary);
            color: var(--text-primary);
            border: 1px solid var(--border-color);
            border-radius: 20px;
            max-width: 640px; width: 92%; max-height: 90vh;
            overflow-y: auto;
            padding: 0;
            box-shadow: 0 20px 60px var(--shadow-color);
        }
        .profile-modal-header {
            display: flex; justify-content: space-between; align-items: center;
            padding: 20px 24px 16px;
            background: linear-gradient(135deg, var(--accent), var(--accent-2));
            border-radius: 20px 20px 0 0;
            margin-bottom: 0;
        }
        .profile-modal-header h2 {
            margin: 0; font-size: 20px; color: #fff;
        }
        .profile-close-btn {
            background: rgba(255,255,255,0.2); border: none; font-size: 20px;
            cursor: pointer; color: #fff;
            line-height: 1; padding: 4px 8px; border-radius: 8px;
        }
        .profile-close-btn:hover { background: rgba(255,255,255,0.35); }
        .profile-loading {
            padding: 40px 24px; text-align: center; color: var(--text-secondary);
        }
        /* Profile content body padding */
        #profileContent {
            padding: 20px 24px 24px;
        }
        .profile-error {
            padding: 12px;
            background: var(--error-bg); color: var(--error-text);
            border: 1px solid var(--error-border); border-radius: 6px;
        }
        .pf-info-grid {
            display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
            font-size: 13px; margin-bottom: 18px; padding: 14px;
            background: var(--bg-tertiary); border: 1px solid var(--border-color);
            border-radius: 14px; color: var(--text-primary);
        }
        .pf-label { color: var(--text-secondary); font-size: 12px; }
        .pf-section-h {
            margin: 0 0 8px; font-size: 15px; color: var(--text-primary);
        }
        .pf-section {
            margin-bottom: 18px;
        }
        .pf-input {
            width: 100%; padding: 8px 10px;
            border: 1px solid var(--input-border);
            border-radius: 4px; font-size: 13px;
            background: var(--input-bg); color: var(--text-primary);
            box-sizing: border-box;
        }
        .pf-input:focus {
            outline: none; border-color: var(--input-focus);
        }
        .pf-hint {
            font-size: 11px; color: var(--text-secondary); margin-top: 4px;
        }
        .pf-btn {
            margin-top: 10px; padding: 7px 14px;
            border: none; border-radius: 4px;
            cursor: pointer; font-size: 13px; color: #fff;
        }
        .pf-btn-primary { background: var(--btn-primary); }
        .pf-btn-primary:hover { background: var(--btn-primary-hover); }
        .pf-btn-warn { background: #f59e0b; }
        .pf-btn-warn:hover { background: #d97706; }
        .pf-inline-msg { margin-left: 10px; font-size: 13px; }
        .pf-msg-info { color: var(--text-secondary); }
        .pf-msg-success { color: var(--success-text); }
        .pf-msg-error { color: var(--error-text); }
        .pf-stats-grid {
            display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
            font-size: 13px; margin-bottom: 18px;
        }
        .pf-stat-card {
            padding: 14px 10px; background: var(--bg-tertiary);
            border: 1px solid var(--border-color);
            border-radius: 14px; text-align: center;
        }
        .pf-stat-label { color: var(--text-secondary); font-size: 12px; margin-top: 4px; }
        .pf-stat-val { font-size: 24px; font-weight: 700; color: var(--text-primary); }
        .pf-badges-box, .pf-pwd-box {
            padding: 16px; background: var(--bg-tertiary);
            border: 1px solid var(--border-color); border-radius: 14px;
        }
        .pf-badge {
            display: inline-block; padding: 2px 8px;
            background: rgba(99, 102, 241, 0.18); color: var(--btn-primary);
            border-radius: 10px; font-size: 11px; margin-right: 4px;
        }
        .pf-label-block {
            display: block; margin-bottom: 10px;
            font-size: 13px; color: var(--text-primary);
        }
        .pf-label-block .pf-input { margin-top: 4px; }
        .pf-tag {
            font-size: 11px; padding: 1px 6px;
            border-radius: 999px; margin-left: 4px;
        }
        .pf-tag-ok { color: var(--success-text); background: var(--success-bg); }
        .pf-tag-warn { color: var(--error-text); background: var(--error-bg); }

        /* Profile avatar section */
        .pf-avatar-box {
            display: flex; gap: 16px; align-items: flex-start;
            padding: 16px; background: var(--bg-tertiary);
            border: 1px solid var(--border-color); border-radius: 14px;
        }
        .pf-avatar-preview {
            width: 80px; height: 80px; border-radius: 50%;
            background: linear-gradient(135deg, var(--btn-primary) 0%, #4f46e5 100%);
            color: #fff; display: flex; align-items: center; justify-content: center;
            font-size: 40px; flex-shrink: 0; overflow: hidden;
            border: 2px solid var(--border-color);
        }
        .pf-avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
        .pf-avatar-emoji { line-height: 1; }
        .pf-avatar-actions { flex: 1; min-width: 0; }
        .pf-avatar-actions .pf-btn { display: inline-flex; align-items: center; gap: 4px; margin-right: 6px; }
        .pf-btn-secondary {
            background: var(--btn-secondary);
            color: #fff;
        }
        .pf-btn-secondary:hover { background: var(--btn-secondary-hover); }
        .pf-emoji-row {
            display: flex; flex-wrap: wrap; gap: 4px;
            margin-top: 10px;
        }
        .pf-emoji-pick {
            width: 32px; height: 32px;
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            border-radius: 6px;
            font-size: 18px; cursor: pointer;
            display: inline-flex; align-items: center; justify-content: center;
            padding: 0; color: var(--text-primary);
        }
        .pf-emoji-pick:hover {
            border-color: var(--btn-primary);
            background: var(--bg-tertiary);
        }

        /* Profil szint blokk */
        .pf-level-block { margin-bottom: 14px; }
        .pf-level-head {
            display: flex; justify-content: space-between; align-items: center;
            margin-bottom: 6px; color: var(--text-primary); font-size: 14px;
        }
        .pf-level-icon { font-size: 20px; }
        .pf-level-points { color: var(--text-primary); }
        .pf-level-bar {
            height: 12px; background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            border-radius: 999px; overflow: hidden;
        }
        .pf-level-bar-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--accent) 0%, #f59e0b 50%, #ec4899 100%);
            transition: width 0.6s cubic-bezier(.34,1.56,.64,1);
            box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
        }
        .pf-level-next {
            margin-top: 6px; font-size: 12px; color: var(--text-secondary);
            text-align: right;
        }
        .pf-badges-row {
            display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px;
        }
        .pf-badge-big {
            display: inline-flex; align-items: center; gap: 8px;
            padding: 8px 16px; border-radius: 14px;
            background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(236, 72, 153, 0.1));
            color: #f59e0b; font-weight: 700; font-size: 14px;
            border: 1px solid rgba(245, 158, 11, 0.3);
            box-shadow: 0 2px 6px rgba(245, 158, 11, 0.15);
            transition: transform 0.15s ease, box-shadow 0.15s ease;
        }
        .pf-badge-big:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
        }
        .pf-badge-big .badge-icon {
            font-size: 20px; line-height: 1;
        }

        /* Chip: még nagyobb ponton + jelvényen */
        .user-chip-points { font-size: 14px !important; padding: 4px 12px !important; font-weight: 700 !important; }
        .user-chip-badges .badge-pill {
            padding: 4px 12px !important;
            font-size: 14px !important;
        }
        .user-chip-avatar { box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3); }

        /* Aranyos chip finomhangolás (+10% méret, level badge hangsúly) */
        .user-chip { padding: 5px; gap: 5px; }
        .user-chip-main { padding: 7px 14px 7px 7px; gap: 12px; }
        .user-chip-name { font-size: 14px; max-width: 200px; }
        .user-chip-points { font-size: 15px !important; padding: 4px 12px !important; font-weight: 700 !important; }
        .user-chip-logout { height: 38px; padding: 0 16px; font-size: 14px; }
        .user-chip-badges .badge-pill {
            font-size: 15px !important;
            padding: 4px 12px !important;
        }
        .user-chip-badges .level-pill {
            background: linear-gradient(135deg, rgba(245,158,11,0.35) 0%, rgba(236,72,153,0.3) 100%) !important;
            color: #fbbf24 !important;
            border: 1px solid rgba(245,158,11,0.5);
            font-weight: 800 !important;
            box-shadow: 0 1px 4px rgba(245,158,11,0.3);
            animation: chipLevelGlow 3s ease-in-out infinite;
        }
        .user-chip-badges .extra-pill {
            background: rgba(99, 102, 241, 0.22) !important;
            color: var(--btn-primary) !important;
        }
        @keyframes chipLevelGlow {
            0%, 100% { box-shadow: 0 1px 4px rgba(245,158,11,0.3); }
            50%      { box-shadow: 0 2px 10px rgba(245,158,11,0.55); }
        }
        .user-chip:hover {
            box-shadow: 0 4px 14px var(--shadow-color), 0 0 0 1px rgba(99,102,241,0.25);
        }
        @media (max-width: 600px) {
            .user-chip-avatar { width: 38px; height: 38px; font-size: 20px; }
            .user-chip-name { display: none; }
            .user-chip-info { flex-direction: row; align-items: center; gap: 4px; }
            .user-chip-meta { margin-top: 0; }
            .user-chip-points, .user-chip-badges .badge-pill { font-size: 12px !important; padding: 2px 8px !important; }
            .user-chip-logout { height: 32px; padding: 0 12px; font-size: 12px; }
        }

/* ===== Gamification FX ===== */
#gamifFxRoot { position: fixed; inset: 0; pointer-events: none; z-index: 9999; }
#gamifFxRoot > * { pointer-events: auto; }

.gamif-toast {
    position: fixed; top: 90px; right: 24px;
    display: inline-flex; align-items: center; gap: 10px;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: #fff; padding: 12px 20px; border-radius: 999px;
    font-weight: 700; font-size: 16px; box-shadow: 0 8px 24px rgba(108, 92, 231, 0.4);
    animation: gamif-toast-in 0.4s cubic-bezier(.34,1.56,.64,1) both;
}
.gamif-toast-icon { font-size: 22px; animation: gamif-spin 0.6s ease-out; }
.gamif-toast-out { animation: gamif-toast-out 0.6s ease both; }
@keyframes gamif-toast-in {
    from { transform: translateX(120%) scale(0.8); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
}
@keyframes gamif-toast-out {
    to { transform: translateY(-30px); opacity: 0; }
}
@keyframes gamif-spin {
    0% { transform: rotate(0deg) scale(0.5); }
    70% { transform: rotate(380deg) scale(1.3); }
    100% { transform: rotate(360deg) scale(1); }
}

.gamif-chip-pulse { animation: gamif-pulse 1.2s ease-out; }
@keyframes gamif-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(108, 92, 231, 0); }
    30% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(108, 92, 231, 0.3); }
    60% { transform: scale(1.02); box-shadow: 0 0 0 14px rgba(108, 92, 231, 0); }
}

.gamif-badge-pop {
    position: fixed; top: 150px; right: 24px;
    display: flex; align-items: center; gap: 14px;
    background: var(--bg-secondary, #fff); color: var(--text-primary, #1a1a1a);
    padding: 16px 18px; border-radius: 14px; min-width: 280px; max-width: 360px;
    border: 2px solid #ffd700;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25), 0 0 0 4px rgba(255, 215, 0, 0.15);
    animation: gamif-badge-in 0.5s cubic-bezier(.34,1.56,.64,1) both;
}
.gamif-badge-out { animation: gamif-badge-out 0.5s ease both; }
@keyframes gamif-badge-in {
    from { transform: translateX(120%) rotate(8deg); opacity: 0; }
    to { transform: translateX(0) rotate(0deg); opacity: 1; }
}
@keyframes gamif-badge-out {
    to { transform: translateX(120%); opacity: 0; }
}
.gamif-badge-icon { font-size: 44px; line-height: 1; animation: gamif-bounce 1s ease-out infinite; }
@keyframes gamif-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.gamif-badge-body { flex: 1; }
.gamif-badge-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: #b8860b; font-weight: 700; }
.gamif-badge-name { font-size: 17px; font-weight: 700; margin-top: 2px; }
.gamif-badge-desc { font-size: 13px; opacity: 0.75; margin-top: 4px; }
.gamif-badge-bonus { font-size: 13px; color: #6c5ce7; font-weight: 700; margin-top: 4px; }
.gamif-badge-close {
    background: transparent; border: none; font-size: 24px; cursor: pointer;
    color: var(--text-primary, #1a1a1a); opacity: 0.4; padding: 0 4px; line-height: 1;
}
.gamif-badge-close:hover { opacity: 1; }

.gamif-levelup-overlay {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.65);
    display: flex; align-items: center; justify-content: center;
    animation: gamif-fade-in 0.3s ease both;
}
.gamif-levelup-out { animation: gamif-fade-out 0.4s ease both; }
@keyframes gamif-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes gamif-fade-out { to { opacity: 0; } }
.gamif-levelup-card {
    position: relative; overflow: hidden;
    background: var(--bg-secondary, #fff); color: var(--text-primary, #1a1a1a);
    padding: 36px 48px; border-radius: 20px; text-align: center;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
    animation: gamif-pop 0.6s cubic-bezier(.34,1.56,.64,1) both;
    max-width: 90vw;
}
@keyframes gamif-pop {
    from { transform: scale(0.4) rotate(-10deg); opacity: 0; }
    to { transform: scale(1) rotate(0deg); opacity: 1; }
}
.gamif-levelup-badge { font-size: 80px; line-height: 1; margin-bottom: 12px; animation: gamif-spin-slow 2s ease-in-out infinite; display: inline-block; }
@keyframes gamif-spin-slow { 0%, 100% { transform: rotate(-8deg) scale(1); } 50% { transform: rotate(8deg) scale(1.08); } }
.gamif-levelup-title { font-size: 14px; text-transform: uppercase; letter-spacing: 1.5px; color: #6c5ce7; font-weight: 700; }
.gamif-levelup-name { font-size: 28px; font-weight: 800; margin: 8px 0 24px; }
.gamif-levelup-btn {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: #fff; border: none; padding: 12px 36px; border-radius: 999px;
    font-size: 16px; font-weight: 700; cursor: pointer;
    box-shadow: 0 6px 16px rgba(108, 92, 231, 0.4);
    transition: transform 0.15s ease;
}
.gamif-levelup-btn:hover { transform: translateY(-2px); }

.gamif-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.gc-piece {
    position: absolute; top: -20px; width: 8px; height: 14px;
    border-radius: 2px; opacity: 0.9;
    animation-name: gc-fall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}
@keyframes gc-fall {
    0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(420px) rotate(720deg); opacity: 0; }
}

@media (max-width: 600px) {
    .gamif-toast { right: 12px; left: 12px; top: 80px; justify-content: center; }
    .gamif-badge-pop { right: 12px; left: 12px; max-width: none; min-width: 0; }
    .gamif-levelup-card { padding: 28px 24px; }
    .gamif-levelup-badge { font-size: 64px; }
    .gamif-levelup-name { font-size: 22px; }
}

/* Chrome autofill detection trigger (animationstart event lő) */
@keyframes onAutoFillStart { from {} to {} }
@keyframes onAutoFillCancel { from {} to {} }
input:-webkit-autofill { animation-name: onAutoFillStart; }
input:not(:-webkit-autofill) { animation-name: onAutoFillCancel; }
